functionSource stringlengths 20 97.4k | CWE-119 bool 2
classes | CWE-120 bool 2
classes | CWE-469 bool 2
classes | CWE-476 bool 2
classes | CWE-other bool 2
classes | combine int64 0 1 |
|---|---|---|---|---|---|---|
ar_state2dstring(ar_state_t state, dstring *state_as_string)
{
const char *letter = "u";
switch (state) {
case AR_WAITING:
letter = "w";
break;
case AR_RUNNING:
letter = "r";
break;
case AR_EXITED:
letter = "x";
break;
case AR_DELETED:
... | false | false | false | false | false | 0 |
nv50_dac_dpms(struct drm_encoder *encoder, int mode)
{
struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder);
struct nv50_disp *disp = nv50_disp(encoder->dev);
struct {
struct nv50_disp_mthd_v1 base;
struct nv50_disp_dac_pwr_v0 pwr;
} args = {
.base.version = 1,
.base.method = NV50_DISP_MTHD_V1_DAC_... | false | false | false | false | false | 0 |
bsfilter_do_filter(BsFilterData *data)
{
int status = 0;
gchar *file = NULL;
gboolean whitelisted = FALSE;
MsgInfo *msginfo = to_filter_data->msginfo;
if (config.whitelist_ab) {
gchar *ab_folderpath;
if (*config.whitelist_ab_folder == '\0' ||
strcasecmp(config.whitelist_ab_folder, "Any") == 0) {
/* mat... | false | false | false | false | false | 0 |
lrange (Tree l, int i, int j)
{
Tree r = nil;
int c = j;
while (c>i) r = cons( nth(l,--c), r);
return r;
} | false | false | false | false | false | 0 |
writeCallback(void *p, const char *buffer, int len) {
IOCallbackContext *ctx = (IOCallbackContext*)p;
JNIEnv *env = ctx->env;
int remain = len;
int copying;
while(1) {
copying = ctx->bufferlen < remain ? ctx->bufferlen : remain;
(*env)->SetByteArrayRegion(env, ctx->buffer, 0, co... | false | false | false | false | false | 0 |
xfitfunc(void *edata, double *x) {
ubfit *uf = (ubfit *)edata;
prand *s = uf->s;
int i, e, di = s->di;
double rv = 0.0;
/* For all the vertexes */
for (i = 0; i < uf->nvxs; i++) {
double v[MXTD], ev;
/* Apply matrix cube interpolation */
icxCubeInterp(x, di, di, v, uf->vxs[i].p);
/* Evaluate the error ... | false | false | false | false | false | 0 |
Vfind(HFILEID f, /* IN: file id */
const char *vgname /* IN: name of vgroup to find */)
{
int32 vgid = -1;
vginstance_t *v = NULL;
VGROUP *vg = NULL;
int32 ret_value = 0;
CONSTR(FUNC, "Vfind");
/* check for null vgroup name */
if (vgname == NULL)
H... | false | false | false | false | false | 0 |
snd_ymfpci_info_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
unsigned int reg = kcontrol->private_value;
if (reg < 0x80 || reg >= 0xc0)
return -EINVAL;
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 2;
uinfo->value.integer.min = 0;
uinfo->value.integer.max = 16383;
retur... | false | false | false | false | false | 0 |
smoothsort(void * const head, uint64_t const count, size_t const elsz,
int (* const cmp)(void const * const, void const * const))
{
// `smoothsort`
// `head` points to begining of the array to be sorted.
// `count` indicates the length of the array pointed to by `head`
// `elsz` ind... | false | false | false | false | false | 0 |
ReceiveInt( void )
{
if (isStarted.GetValue()==0)
return 0;
if (headPush.IsEmpty()==false)
return headPush.Pop();
Packet *p = incomingMessages.PopInaccurate();
if (p)
return p;
if (tailPush.IsEmpty()==false)
return tailPush.Pop();
return 0;
} | false | false | false | false | false | 0 |
r600_prepare_blit_copy(struct drm_device *dev, struct drm_file *file_priv)
{
drm_radeon_private_t *dev_priv = dev->dev_private;
int ret;
DRM_DEBUG("\n");
ret = r600_nomm_get_vb(dev);
if (ret)
return ret;
dev_priv->blit_vb->file_priv = file_priv;
set_default_state(dev_priv);
set_shaders(dev);
return 0;
} | false | false | false | false | false | 0 |
InitSentinelsNear(Unit* pTarget)
{
if (!m_lAssistList.empty())
{
for (GuidList::const_iterator itr = m_lAssistList.begin(); itr != m_lAssistList.end(); ++itr)
{
if (*itr == m_creature->GetObjectGuid())
{
continue;
... | false | false | false | false | false | 0 |
OpernameGetCandidates(List *names, char oprkind)
{
FuncCandidateList resultList = NULL;
char *resultSpace = NULL;
int nextResult = 0;
char *schemaname;
char *opername;
Oid namespaceId;
CatCList *catlist;
int i;
/* deconstruct the name list */
DeconstructQualifiedName(names, &schemaname, &ope... | false | false | true | false | true | 1 |
ajFeattabOutSetTypeC(AjPFeattabOut thys, const char* type)
{
ajint i = 0;
if(!*type)
return ajTrue;
for(i=0; featOutTypes[i].Name; i++)
{
if(ajCharMatchCaseC(featOutTypes[i].Name, type))
{
if(featOutTypes[i].Value)
ajStrAssignC(&thys->Type, featOutTypes[i].Value);
return ajTrue;
}
... | false | false | false | false | false | 0 |
ASN1_dup(int (*i2d)(void*, unsigned char**), char *(*d2i)(void**, const unsigned char**, long int), char *x) {
unsigned char *b,*p;
long i;
char *ret;
if (x == NULL) return(NULL);
i=(long)i2d(x,NULL);
b=(unsigned char *)OPENSSL_malloc((unsigned int)i+10);
if (b == NULL) { ASN1err(ASN1_F_ASN1_DUP,ERR_R_MAL... | false | false | false | false | false | 0 |
agent_ack_sleep(struct agent_pvt *p)
{
int digit;
int to = 1000;
struct ast_frame *f;
struct timeval start = ast_tvnow();
int ms;
/* Wait a second and look for something */
while ((ms = ast_remaining_ms(start, to))) {
ms = ast_waitfor(p->chan, ms);
if (ms < 0) {
return -1;
}
if (ms == 0) {
return ... | false | false | false | false | false | 0 |
frequencyboxvaluechanged(double value)
{
char str[256];
if(freq2box->value() < (value * 1.12))
{
freq2box->setValue(value * 1.12);
}
if(typebox->currentIndex() == 2)
{
sprintf(str,"%f Hz", freqbox->value() / orderbox->value());
remove_trailing_zeros(str);
ordervaluelabel->setText(str);
}... | false | false | false | false | false | 0 |
remove_cost_data(pq* q, void* data, long cost){
int root = 0;
while (root <= 1000){
pqnode n = q->q[root];
if (n.cost == cost && data == n.data){n.data = 0;return 1;}
else if (n.cost > cost) return 0;
// Branch below
if (q->q[2*root+1].cost <= cost) root = 2*root + 1; // branch left
else if (q->q[2*(root+... | false | false | false | false | false | 0 |
TestCommandViewElement2( String )
char *String;
{
auth2elem *AutElement;
char *Scan;
if ( ! TestMode2 ) return;
if ( String != (char *)0 )
{
Scan = strchr( String, ' ' );
if ( Scan != (char *)0 )
{
*Scan = '\0';
}
String = namealloc( String );
Scan = namealloc( Sc... | false | false | false | false | false | 0 |
Packet(Barry::JLPacket &packet, int timeout)
{
if( packet.HasData() ) {
SyncSend(packet.m_cmd);
PacketData(packet.m_data, *packet.m_receive, false, timeout);
}
else {
PacketData(packet.m_cmd, *packet.m_receive, false, timeout);
}
} | false | false | false | false | false | 0 |
PyvtkvmtkBoundaryReferenceSystems_OrientBoundaryNormalOutwards(PyObject *, PyObject *args)
{
vtkPythonArgs ap(args, "OrientBoundaryNormalOutwards");
vtkPolyData *temp0 = NULL;
vtkPolyData *temp1 = NULL;
vtkIdType temp2;
double temp3[3];
double save3[3];
const int size3 = 3;
double temp4[3];
double sa... | false | false | false | false | false | 0 |
print_feature (GstPluginFeature * feature)
{
const gchar *rname;
rname = gst_plugin_feature_get_name (feature);
GST_DEBUG ("%s", rname);
} | false | false | false | false | false | 0 |
Trace_Factor(void *_cv,Spline *spline, real t) {
CharView *cv = (CharView *) _cv;
TraceData *head = cv->freehand.head, *pt, *from=NULL, *to=NULL;
int fromnum = spline->from->ptindex, tonum = spline->to->ptindex;
StrokeInfo *si = CVFreeHandInfo();
int p;
if ( si->radius<=0 || si->pressure1==si->... | false | false | false | false | false | 0 |
tdx_data_open_files(struct group_data *data)
{
unmap_index(data);
unmap_data(data);
data->index = NULL;
data->data = NULL;
if (!file_open_index(data, NULL))
goto fail;
if (!file_open_data(data, NULL))
goto fail;
return true;
fail:
if (data->indexfd >= 0)
close(d... | false | false | false | false | false | 0 |
memory_hash(PyMemoryViewObject *self)
{
if (self->hash == -1) {
Py_buffer *view = &self->view;
char *mem = view->buf;
Py_ssize_t ret;
char fmt;
CHECK_RELEASED_INT(self);
if (!view->readonly) {
PyErr_SetString(PyExc_ValueError,
"cannot has... | false | false | false | false | false | 0 |
Random(const char * material)
{
pieceT pieces [32]; // List of pieces excluding kings
unsigned int nPieces[2] = {0, 0}; // Number of pieces per side excluding kings.
unsigned int total = 0; // Total number of pieces excluding kings.
colorT side = WHITE;
// The material string... | false | false | false | false | false | 0 |
GetBestGreenToRed(
const uint32_t* argb, int stride, int tile_width, int tile_height,
VP8LMultipliers prev_x, VP8LMultipliers prev_y,
const int accumulated_red_histo[256], VP8LMultipliers* const best_tx) {
int min_green_to_red = -64;
int max_green_to_red = 64;
int green_to_red = 0;
int eval_min = 1;... | false | false | false | false | false | 0 |
indi_find_prop(struct indi_device_t *idev, const char *name)
{
indi_list *isl;
struct indi_prop_t *iprop;
for (isl = il_iter(idev->props); ! il_is_last(isl); isl = il_next(isl)) {
iprop = (struct indi_prop_t *)il_item(isl);
if (strncmp(iprop->name, name, sizeof(iprop->name)) == 0) {
return iprop... | false | false | false | false | false | 0 |
_bfd_default_link_order (bfd *abfd,
struct bfd_link_info *info,
asection *sec,
struct bfd_link_order *link_order)
{
switch (link_order->type)
{
case bfd_undefined_link_order:
case bfd_section_reloc_link_order:
case bfd_symbol_reloc_link_order:
default:
abort ();
case bfd_indi... | false | false | false | false | false | 0 |
getPointerRegClass(unsigned Kind) const {
switch (Kind) {
default: llvm_unreachable("Unexpected Kind in getPointerRegClass!");
case 0: // Normal GPRs.
if (TM.getSubtarget<X86Subtarget>().is64Bit())
return &X86::GR64RegClass;
return &X86::GR32RegClass;
case 1: // Normal GRPs except the stack pointe... | false | false | false | false | false | 0 |
evhttp_read_header(struct evhttp_connection *evcon,
struct evhttp_request *req)
{
enum message_read_status res;
evutil_socket_t fd = evcon->fd;
res = evhttp_parse_headers(req, bufferevent_get_input(evcon->bufev));
if (res == DATA_CORRUPTED || res == DATA_TOO_LONG) {
/* Error while reading, terminate */
ev... | false | false | false | false | false | 0 |
Imatrix_submat(Imatrix R, int r, int c)
{
if (R == 0 || c > ImatrixMNcols(R) || r > ImatrixMrows(R) * ImatrixMNcols(R)) {
bad_error("bad subscripts or zero matrix in Imatrix_submat()");
} else {
ImatrixMrows(R) = r;
ImatrixMcols(R) = c;
}
return R;
} | false | false | false | false | false | 0 |
deleteData( const unsigned long offset, const unsigned long count, int &exceptioncode )
{
exceptioncode = 0;
if ((long)count < 0)
exceptioncode = DOMException::INDEX_SIZE_ERR;
else
checkCharDataOperation(offset, exceptioncode);
if (exceptioncode)
return;
DOMStringImpl *oldStr = str;
s... | false | false | false | false | false | 0 |
loadSvgString(const QString & svg) {
QByteArray byteArray(svg.toUtf8());
QByteArray result = loadSvg(byteArray, "", true);
return (!result.isEmpty());
} | false | false | false | false | false | 0 |
backup_current_db_name(THD *thd,
LEX_STRING *saved_db_name)
{
if (!thd->db)
{
/* No current (default) database selected. */
saved_db_name->str= NULL;
saved_db_name->length= 0;
}
else
{
strmake(saved_db_name->str, thd->db, saved_db_name->length - 1);
save... | false | false | false | false | false | 0 |
tree_cell_text(GtkTreeViewColumn *col,GtkCellRenderer *cell,GtkTreeModel *md,GtkTreeIter *iter,gTree *Tr)
{
gTreeRow *row=NULL;
gTreeCell *data;
const char *buf = "";
char *key;
int index = -1;
double align;
key = Tr->iterToKey(iter);
if (key)
row=(gTreeRow*)g_hash_table_lookup(Tr->datakey,(gpointer)key);
... | false | false | false | false | false | 0 |
fcoe_transport_lookup(struct net_device *netdev)
{
struct fcoe_transport *ft = NULL;
list_for_each_entry(ft, &fcoe_transports, list)
if (ft->match && ft->match(netdev))
return ft;
return NULL;
} | false | false | false | false | false | 0 |
dwceqos_set_rx_mode(struct net_device *ndev)
{
struct net_local *lp = netdev_priv(ndev);
u32 regval = 0;
u32 mc_filter[2];
int reg = 1;
struct netdev_hw_addr *ha;
unsigned int max_mac_addr;
max_mac_addr = DWCEQOS_MAX_PERFECT_ADDRESSES(lp->feature1);
if (ndev->flags & IFF_PROMISC) {
regval = DWCEQOS_MAC_PKT_... | false | false | false | false | false | 0 |
dwarf_init_reg_rules_dw(struct Dwarf_Regtable_Entry_s *base,
unsigned first, unsigned last,int initial_value)
{
struct Dwarf_Regtable_Entry_s *r = base+first;
unsigned i = first;
for( ; i < last; ++i,++r) {
r->dw_offset_relevant = 0;
r->dw_value_type = DW_EXPR_OFFSET;
r->dw_regnu... | false | false | false | false | false | 0 |
Vector_Full(Vector vec)
{
Vector end = vec + vec_size;
do
*vec++ = ALL_1;
while (vec < end);
} | false | false | false | false | false | 0 |
find_info_map_value(const char* id, void* key) {
if (find_info(id) == NULL) {
ast_extra_info_map* INFO = new ast_extra_info_map();
add_info(id, INFO);
}
std::map<void*, void*> & S = ((ast_extra_info_map*) find_info(id))->get_map();
// if not in the map? NULL will be retuned. right?
... | false | false | false | false | false | 0 |
iwl_mvm_stop_ap_ibss(struct ieee80211_hw *hw,
struct ieee80211_vif *vif)
{
struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
iwl_mvm_prepare_mac_removal(mvm, vif);
mutex_lock(&mvm->mutex);
/* Handle AP stop while in CSA */
if (rcu_access_pointer(m... | false | false | false | false | false | 0 |
bonobo_selector_construct (BonoboSelector *sel,
const gchar *title,
BonoboSelectorWidget *selector)
{
g_return_val_if_fail (BONOBO_IS_SELECTOR (sel), NULL);
g_return_val_if_fail (BONOBO_IS_SELECTOR_WIDGET (selector), NULL);
sel->priv->selector = selector;
g_signal_conne... | false | false | false | false | false | 0 |
rowCount( const QModelIndex &parent ) const
{
PageItem *parentItem;
if ( !parent.isValid() )
parentItem = d_func()->rootItem;
else
parentItem = static_cast<PageItem*>( parent.internalPointer() );
return parentItem->childCount();
} | false | false | false | false | false | 0 |
psmouse_connect(struct serio *serio, struct serio_driver *drv)
{
struct psmouse *psmouse, *parent = NULL;
struct input_dev *input_dev;
int retval = 0, error = -ENOMEM;
mutex_lock(&psmouse_mutex);
/*
* If this is a pass-through port deactivate parent so the device
* connected to this port can be successfully ... | false | false | false | false | false | 0 |
OidFunctionCall1(Oid functionId, Datum arg1)
{
FmgrInfo flinfo;
FunctionCallInfoData fcinfo;
Datum result;
fmgr_info(functionId, &flinfo);
InitFunctionCallInfoData(fcinfo, &flinfo, 1, NULL, NULL);
fcinfo.arg[0] = arg1;
fcinfo.argnull[0] = false;
result = FunctionCallInvoke(&fcinfo);
/* Check for null res... | false | false | false | false | false | 0 |
AndersonDarlingErrFix(int n, double x) {
if (x > 0.8) {
return (-130.2137 + (745.2337 - (1705.091 - (1950.646 -
(1116.360 - 255.7844 * x) * x) * x) * x) * x) / n;
}
double cutoff = 0.01265 + 0.1757 / n;
double t;
if (x < cutoff) {
t = x / cutoff;
t = sqrt(t) * (1 - t) * (49 * t - 102);... | false | false | false | false | false | 0 |
print_pretty(struct wipe_desc *wp, int line)
{
if (!line) {
printf("offset type\n");
printf("----------------------------------------------------------------\n");
}
printf("0x%-17jx %s [%s]", wp->offset, wp->type, wp->usage);
if (wp->label && *wp->label)
printf("\n%27s %s", "LABEL:", wp->la... | false | false | false | false | false | 0 |
_e2_combobox_key_press_cb (GtkWidget *entry, GdkEventKey *event,
gpointer data)
{
if (!(event->keyval == GDK_Up || event->keyval == GDK_Down))
return FALSE;
GtkComboBox *combo = GTK_COMBO_BOX (entry->parent);
gboolean cycle = (data != NULL);
gint pos = gtk_combo_box_get_active (combo);
if (event->keyval == GDK... | false | false | false | false | false | 0 |
performDecay(PPtr parent,int & totalcharge,int & numbercharge) const
{
// for an already decayed particle apply to children
if(!parent->children().empty())
{
for(unsigned int ix=0;ix<parent->children().size();++ix)
performDecay(parent->children()[ix],totalcharge,numbercharge);
}
// for a stable par... | false | false | false | false | false | 0 |
contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
{
if (d->textSelectable || d->hasLinks){
QContextMenuEvent contextMenuEvent(QContextMenuEvent::Reason(event->reason()),
event->pos().toPoint(), event->screenPos(), event->modifiers());
QApplication::se... | false | false | false | false | false | 0 |
begin_section (GtkGrid *add_to,
const gchar *caption,
gint *from_row,
gint for_rows)
{
GtkWidget *widget;
PangoAttribute *attr;
PangoAttrList *bold;
g_return_if_fail (add_to != NULL);
g_return_if_fail (caption != NULL);
g_return_if_fail (from_row != NULL);
bold = pa... | false | false | false | false | false | 0 |
SwLedOn(struct _adapter *padapter, struct LED_871x *pLed)
{
u8 LedCfg;
if (padapter->bSurpriseRemoved || padapter->bDriverStopped)
return;
LedCfg = r8712_read8(padapter, LEDCFG);
switch (pLed->LedPin) {
case LED_PIN_GPIO0:
break;
case LED_PIN_LED0:
/* SW control led0 on.*/
r8712_write8(padapter, LEDCFG, ... | false | false | false | false | false | 0 |
_ifupdownplugin_guess_connection_type (if_block *block)
{
if_data *curr = block->info;
const gchar* ret_type = NULL;
const gchar* value = ifparser_getkey(block, "inet");
if(value && !strcmp("ppp", value)) {
ret_type = NM_SETTING_PPP_SETTING_NAME;
}
while(!ret_type && curr) {
if(!strncmp("wireless-", curr->ke... | false | false | false | false | false | 0 |
addedBeef(string successMsg)
{
// Assemble the multipart message.
mail::Header::list headers;
vector<mail::emailAddress> from_addresses;
from_addresses.push_back(mail::address("Libmail Address Book",
"libmail@localhost"));
headers << mail::Header::addresslist("From", from_addresses);
headers << ma... | false | false | false | false | false | 0 |
PopSequenceAddr( struct sequence *pSequence )
{
if( pSequence->stackSize )
{
pSequence->addr = pSequence->stackData[--pSequence->stackSize];
}
else
{
data16_t *pStatus = GetSequenceStatusAddr(pSequence);
*pStatus &= 0xff7f; /* wipe "sequence-is-playing" flag */
}
} | false | false | false | false | false | 0 |
operator<< (wostream& os, TaggerWord &w) {
os<<w.get_string_tags()<< L" \t Word: " << w.get_superficial_form();
return os;
} | false | false | false | false | false | 0 |
ci_upload_dpm_level_enable_mask(struct amdgpu_device *adev)
{
struct ci_power_info *pi = ci_get_pi(adev);
PPSMC_Result result;
ci_apply_disp_minimum_voltage_request(adev);
if (!pi->sclk_dpm_key_disabled) {
if (pi->dpm_level_enable_mask.sclk_dpm_enable_mask) {
result = amdgpu_ci_send_msg_to_smc_with_parameter... | false | false | false | false | false | 0 |
tp_svc_channel_type_call_emit_call_state_changed (gpointer instance,
guint arg_Call_State,
guint arg_Call_Flags,
const GValueArray *arg_Call_State_Reason,
GHashTable *arg_Call_State_Details)
{
g_assert (instance != NULL);
g_assert (G_TYPE_CHECK_INSTANCE_TYPE (instance, TP_TYPE_SVC_CHANNEL_TYPE_CALL)... | false | false | false | false | false | 0 |
drm_dp_dual_mode_set_tmds_output(enum drm_dp_dual_mode_type type,
struct i2c_adapter *adapter, bool enable)
{
uint8_t tmds_oen = enable ? 0 : DP_DUAL_MODE_TMDS_DISABLE;
ssize_t ret;
if (type < DRM_DP_DUAL_MODE_TYPE2_DVI)
return 0;
ret = drm_dp_dual_mode_write(adapter, DP_DUAL_MODE_TMDS_OEN,
&t... | false | false | false | false | false | 0 |
trace_ip_opts (struct sockaddr_in *to)
{
#ifdef IP_OPTIONS
if (opt_gateways && *opt_gateways)
{
char *gateway, *optbase;
struct addrinfo hints, *res;
memset (&hints, 0, sizeof (hints));
hints.ai_family = AF_INET;
hints.ai_socktype = SOCK_DGRAM;
memset (&ip_opts, 0, sizeof (ip... | false | false | false | false | false | 0 |
CanReadFile(const char *filename)
{
itkDebugMacro(<< "JPEG2000ImageIO::CanReadFile()");
//
// If the file exists, and have extension .j2k or jp2 or jpt, then we are good
// to read it.
//
if ( !itksys::SystemTools::FileExists(filename) )
{
itkDebugMacro(<< "File doesn't exist");
return false;
... | false | false | false | false | false | 0 |
convert_to_utf8(struct strbuf *line, const char *charset)
{
char *out;
if (!charset || !*charset) {
charset = guess_charset(line, metainfo_charset);
if (!charset)
return;
}
if (!strcasecmp(metainfo_charset, charset))
return;
out = reencode_string(line->buf, metainfo_charset, charset);
if (!out)
die("... | false | false | false | false | false | 0 |
cache_value()
{
if (!example)
return FALSE;
value_cached= TRUE;
value_buff.set(buffer, sizeof(buffer), example->collation.collation);
value= example->str_result(&value_buff);
if ((null_value= example->null_value))
value= 0;
else if (value != &value_buff)
{
/*
We copy string value to avoi... | false | false | false | false | false | 0 |
ensGvalleleLoadSubhandle(EnsPGvallele gva)
{
if (!gva)
return NULL;
if (gva->Subhandle)
return gva->Subhandle;
if (!gva->Adaptor)
{
ajDebug("ensGvalleleLoadSubhandle cannot fetch a subhandle "
"from the database for an Ensembl Genetic Variation Allele "
... | false | false | false | false | false | 0 |
latency_cb (jack_latency_callback_mode_t mode, void *arg)
{
jack_latency_range_t range;
if (mode == JackCaptureLatency) {
jack_port_get_latency_range (input_port, mode, &range);
range.min += latency;
range.max += latency;
jack_port_set_latency_range (output_port, mode, &range);
} else {
jack_port_get_laten... | false | false | false | false | false | 0 |
turret_breach_finish_init (edict_t * self)
{
// get and save info for muzzle location
if (!self->target)
{
gi.dprintf ("%s at %s needs a target\n", self->classname,
vtos (self->s.origin));
}
else
{
self->target_ent = G_PickTarget (self->target);
VectorSubtract (self->target_ent->... | false | false | false | false | false | 0 |
chanopt_is_set (unsigned int global, guint8 per_chan_setting)
{
if (per_chan_setting == SET_ON || per_chan_setting == SET_OFF)
return per_chan_setting;
else
return global;
} | false | false | false | false | false | 0 |
tile_border_source_strength(struct tile *ptile)
{
struct city *pcity;
int strength = 0;
if (BORDERS_DISABLED == game.info.borders) {
return 0;
}
pcity = tile_city(ptile);
if (pcity) {
strength = city_size_get(pcity) + 2;
} else {
base_type_iterate(pbase) {
if (tile_has_base(ptile, pba... | false | false | false | false | false | 0 |
NK7110_GetSMSFolderStatus(gn_data *data, struct gn_statemachine *state)
{
unsigned char req[] = {FBUS_FRAME_HEADER, 0x6B,
0x08, /* Folder ID */
0x0F, 0x01};
gn_error error;
gn_sms_folder read;
int i;
req[4] = get_memory_type(data->sms_folder->folder_id);
dprintf("Getting SMS Folder (%i) stat... | false | true | false | false | true | 1 |
dial ( TFILE *f, char *s, int nowait )
{
int err=0, hsc=-1 ;
char c, dsbuf [ 128 ], *p, *message ;
sprintf ( dsbuf, nowait ? "D%.126s;" : "D%.127s" , s ) ;
message = strdup2 ( "I ", gettext ( "dialing %s" ) ) ;
if ( message ) {
msg ( message, dsbuf+1 ) ;
free ( message ) ;
}
c = cmd ( f, dsbuf, ... | true | true | false | false | true | 1 |
asn1_cb(const char *elem, int len, void *bitstr)
{
tag_exp_arg *arg = bitstr;
int i;
int utype;
int vlen = 0;
const char *p, *vstart = NULL;
int tmp_tag, tmp_class;
for(i = 0, p = elem; i < len; p++, i++)
{
/* Look for the ':' in name value pairs */
if (*p == ':')
{
vstart = p + 1;
vlen = len -... | false | false | false | false | false | 0 |
deco_intern(unsigned char deco)
{
char *name;
if (deco == 0)
return deco;
name = deco_tb[deco - 128];
for (deco = 1; deco < 128; deco++) {
if (deco_def_tb[deco].name == 0) {
deco = user_deco_define(name); /* try a user decoration */
if (deco == 128) /* try a standard decoration */
deco = deco_define... | false | false | false | false | false | 0 |
EffectWMORepair(SpellEffectIndex /*effIdx*/)
{
DEBUG_LOG("Effect: WMORepair");
if (!gameObjTarget)
return;
if (gameObjTarget->GetGoType() != GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING)
{
sLog.outError("Spell::EffectWMORepair called without valid targets. Spell Id %u", m_spellInfo->Id);
... | false | false | false | false | false | 0 |
rightmost_1 (uint64_t *m, int max_i){
int block = max_i / 64;
// first skip over all of the leading 0 blocks.
while (block > 0 && m[block] == 0) block--;
if (m[block] == 0) return -1;
// now we need to determine the rightmost 1 in m[block].
#ifdef USE_ASM_BITSCAN // then we can use our bitscan() function.
retu... | false | false | false | false | false | 0 |
uri_to_str(Uri *uri)
{
Ds ds;
ds_init(&ds);
ds_asprintf(&ds, "%s/", uri_scheme_authority(uri));
if (uri->path != NULL)
ds_asprintf(&ds, "%s", uri->path);
if (uri->query_string != NULL)
ds_asprintf(&ds, "?%s", url_encode(uri->query_string, 0));
if (uri->fragment != NULL)
ds_asprintf(&ds, "#%s", url_encod... | false | false | false | false | false | 0 |
skip_sep (LexState *ls) {
int count = 0;
int s = ls->current;
lua_assert(s == '[' || s == ']');
save_and_next(ls);
while (ls->current == '=') {
save_and_next(ls);
count++;
}
return (ls->current == s) ? count : (-count) - 1;
} | false | false | false | false | false | 0 |
vx2_set_input_level(struct snd_vx222 *chip)
{
int i, miclevel, preamp;
unsigned int data;
miclevel = chip->mic_level;
miclevel += V2_MICRO_LEVEL_RANGE; /* add 318 - 0xff */
preamp = 0;
while (miclevel > 210) { /* limitation to +9dB of 3310 real gain */
preamp++; /* raise pre ampli + 18dB */
miclevel -... | false | false | false | false | false | 0 |
qat_algs_unregister(void)
{
mutex_lock(&algs_lock);
if (--active_devs != 0)
goto unlock;
crypto_unregister_aeads(qat_aeads, ARRAY_SIZE(qat_aeads));
crypto_unregister_algs(qat_algs, ARRAY_SIZE(qat_algs));
unlock:
mutex_unlock(&algs_lock);
} | false | false | false | false | false | 0 |
gcr_grid_get_boolean (GcrGrid *grid, unsigned row, unsigned column)
{
g_return_val_if_fail (GCR_IS_GRID (grid) && row < grid->rows && column < grid->cols && grid->types[column] == G_TYPE_BOOLEAN, false);
return grid->row_data[row][column] == "t";
} | false | false | false | false | false | 0 |
counterspell(object *op, int dir) {
object *head;
int mflags;
mapstruct *m;
sint16 sx, sy;
sx = op->x+freearr_x[dir];
sy = op->y+freearr_y[dir];
m = op->map;
mflags = get_map_flags(m, &m, sx, sy, &sx, &sy);
if (mflags&P_OUT_OF_MAP)
return;
FOR_MAP_PREPARE(m, sx, sy, tm... | false | false | false | false | false | 0 |
inotify_handle_event(struct fsnotify_group *group,
struct inode *inode,
struct fsnotify_mark *inode_mark,
struct fsnotify_mark *vfsmount_mark,
u32 mask, void *data, int data_type,
const unsigned char *file_name, u32 cookie)
{
struct inotify_inode_mark *i_mark;
struct inotify_event_info *event;
st... | false | false | false | false | false | 0 |
snd_ctl_ext_elem_list(snd_ctl_t *handle, snd_ctl_elem_list_t *list)
{
snd_ctl_ext_t *ext = handle->private_data;
int ret;
unsigned int i, offset;
snd_ctl_elem_id_t *ids;
list->count = ext->callback->elem_count(ext);
list->used = 0;
ids = list->pids;
offset = list->offset;
for (i = 0; i < list->space; i++) {
... | false | false | false | false | false | 0 |
read_header_file(const char* fn, int ext, anbool only, void* dest,
void* (*readfunc)(const qfits_header*, void*)) {
qfits_header* hdr;
void* result;
if (only) {
hdr = anqfits_get_header_only(fn, ext);
} else {
hdr = anqfits_get_header2(fn, ext);
}
if (!hdr) {
ERROR("Failed to read FITS header fro... | false | false | false | false | false | 0 |
file_data_set_list_name (FileData *fdata,
const char *value)
{
g_free (fdata->list_name);
fdata->list_name = g_strdup (value);
g_free (fdata->sort_key);
if (fdata->list_name != NULL)
fdata->sort_key = g_utf8_collate_key_for_filename (fdata->list_name, -1);
else
fdata->sort_key = NULL;
} | false | false | false | false | false | 0 |
stop_tracing(void)
{
if (tracef != NULL && tracef != stdout)
(void) fclose(tracef);
tracef = NULL;
if (tracef_pipe != NULL) {
(void) fclose(tracef_pipe);
tracef_pipe = NULL;
}
if (toggled(DS_TRACE)) {
toggle_toggle(&appres.toggle[DS_TRACE]);
menubar_retoggle(&appres.toggle[DS_TRACE]);
}
if (toggled(EVE... | false | false | false | false | false | 0 |
readHeadOfDataObject( std::string* poName)
{
std::string nameOrBrace = GetNextToken();
if( nameOrBrace != "{")
{
if( poName)
*poName = nameOrBrace;
if( GetNextToken() != "{")
ThrowException( "Opening brace expected.");
}
} | false | false | false | false | false | 0 |
setTemporaryCachePath(const QString &absPath)
{
d->m_TmpCachePath = QDir::cleanPath(absPath);
QDir test(d->m_TmpCachePath);
if (!test.exists()) {
if (!test.mkpath(test.absolutePath()))
LOG_ERROR(QString("Unable to create DataPack::TempCache %1").arg(d->m_TmpCachePath));
}
} | false | false | false | false | false | 0 |
ProcessFunctionWeakReferences(Heap* heap,
Object* function,
WeakObjectRetainer* retainer) {
Object* head = heap->undefined_value();
JSFunction* tail = NULL;
Object* candidate = function;
while (candidate != heap->undefined... | false | false | false | false | false | 0 |
visit_enter(ir_function_signature *ir)
{
if (strcmp(ir->function_name(), "main") != 0)
return visit_continue;
ir_dereference *lhs = new(mem_ctx) ir_dereference_variable(discarded);
ir_rvalue *rhs = new(mem_ctx) ir_constant(false);
ir_assignment *assign = new(mem_ctx) ir_assignment(lhs, rhs);
ir->b... | false | false | false | false | false | 0 |
on_response(GtkWidget *w, gint response, gpointer id) {
ConfData *cd;
/* printf ("r: %d, i: %d\n", response, id); */
cd = g_hash_table_lookup(id_hash, id);
if (cd) {
switch (response) {
case GTK_RESPONSE_OK:
on_ok_clicked(w, id);
break;
case GTK_RESPON... | false | false | false | false | false | 0 |
mud_log_finalize (GObject *object)
{
MudLog *MLog;
GObjectClass *parent_class;
MLog = MUD_LOG(object);
if(MLog->priv->active)
mud_log_close(MLog);
if(MLog->priv->name)
g_free(MLog->priv->name);
g_free(MLog->priv);
parent_class = g_type_class_peek_parent(G_OBJECT_GET_CLAS... | false | false | false | false | false | 0 |
xcerror(void)
{
LVAL cmsg,emsg,arg;
/* get the correction message, the error message, and the argument */
cmsg = xlgastring();
emsg = xlgastring();
arg = (moreargs() ? xlgetarg() : s_unbound);
xllastarg();
/* signal the error */
xlcerror((char *) getstring(cmsg), (char *) getstring(ems... | false | false | false | false | false | 0 |
olpc_apsp_open(struct serio *port)
{
struct olpc_apsp *priv = port->port_data;
unsigned int tmp;
if (priv->open_count++ == 0) {
/* Enable interrupt 0 by clearing its bit */
tmp = readl(priv->base + PJ_INTERRUPT_MASK);
writel(tmp & ~INT_0, priv->base + PJ_INTERRUPT_MASK);
}
return 0;
} | false | false | false | false | false | 0 |
gru_read_gpa(unsigned long *value, unsigned long gpa)
{
void *cb;
void *dsr;
int ret, iaa;
STAT(read_gpa);
if (gru_get_cpu_resources(GRU_NUM_KERNEL_DSR_BYTES, &cb, &dsr))
return MQE_BUG_NO_RESOURCES;
iaa = gpa >> 62;
gru_vload_phys(cb, gpa, gru_get_tri(dsr), iaa, IMA);
ret = gru_wait(cb);
if (ret == CBS_IDL... | false | false | false | false | false | 0 |
PaUnixThread_PrepareNotify( PaUnixThread* self )
{
PaError result = paNoError;
PA_UNLESS( self->parentWaiting, paInternalError );
PA_ENSURE( PaUnixMutex_Lock( &self->mtx ) );
self->locked = 1;
error:
return result;
} | false | false | false | false | false | 0 |
connman_inet_add_ipv6_network_route(int index, const char *host,
const char *gateway,
unsigned char prefix_len)
{
struct in6_rtmsg rt;
int sk, err = 0;
DBG("index %d host %s gateway %s", index, host, gateway);
if (host == NULL)
return -EINVAL;
memset(&rt, 0, sizeof(rt));
rt.rtmsg_dst_len = prefix_... | false | false | false | false | false | 0 |
normal_critval (double a)
{
double z;
if (a > 0.10) {
z = ndtri(1.0 - a);
} else {
z = -ndtri(a);
}
if (get_cephes_errno()) {
z = NADBL;
}
return z;
} | false | false | false | false | false | 0 |
lookup_tag_reverse (tree type, tree name)
{
struct cp_binding_level *level;
timevar_push (TV_NAME_LOOKUP);
for (level = current_binding_level; level; level = level->level_chain)
{
binding_entry entry = level->type_decls == NULL
? NULL
: binding_table_reverse_maybe_remap (level->type_dec... | false | false | false | false | false | 0 |
printMachOIndirectSymbols() {
for (const auto &Load : Obj->load_commands()) {
if (Load.C.cmd == MachO::LC_DYSYMTAB) {
MachO::dysymtab_command DLC = Obj->getDysymtabLoadCommand();
DictScope Group(W, "Indirect Symbols");
W.printNumber("Number", DLC.nindirectsyms);
ListScope D(W, "Symbols");
... | false | false | false | false | false | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.