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
report( u4 *data, u4 *data2, u4 length, int print) { u4 i; double worst = data[0]; for (i=1; i<BUCKETS; ++i) { if (worst > data[i]) { worst = data[i]; } if (worst > 32-data[i]) { worst = 32-data[i]; } if (worst > data2[i]) { worst = data2[i]; } if (worst > 32-data2[i]...
false
false
false
false
false
0
__acl_to_any_text(acl_t acl, ssize_t *len_p, const char *prefix, char separator, const char *suffix, int options) { acl_obj *acl_obj_p = ext2int(acl, acl); ssize_t size, len = 0, entry_len = 0, suffix_len = suffix ? strlen(suffix) : 0; string_obj *string_obj_p, *tmp; acl_entry_obj *entry_obj_p, *mask_obj_p = ...
false
true
false
true
false
1
intel_disable_sdvo(struct intel_encoder *encoder) { struct drm_i915_private *dev_priv = encoder->base.dev->dev_private; struct intel_sdvo *intel_sdvo = to_sdvo(encoder); struct intel_crtc *crtc = to_intel_crtc(encoder->base.crtc); u32 temp; intel_sdvo_set_active_outputs(intel_sdvo, 0); if (0) intel_sdvo_set_en...
false
false
false
false
false
0
assertEquals(const void* expected, const void* actual, long lineNumber, const std::string& fileName) { if (expected != actual) assertImplementation(false, notEqualsMessage(expected, actual), lineNumber, fileName); }
false
false
false
false
false
0
messageSavePartial(message *m, const char *dir, const char *md5id, unsigned part) { char fullname[1024]; fileblob *fb; unsigned long time_val; cli_dbgmsg("messageSavePartial\n"); time_val = time(NULL); snprintf(fullname, 1024, "%s"PATHSEP"clamav-partial-%lu_%s-%u", dir, time_val, md5id, part); fb = messageExp...
true
true
false
false
false
1
operator<<(Operator op) { assert(op == OpPlusPlus || op == OpMinusMinus); return *this << ((op == OpPlusPlus) ? "++" : "--"); }
false
false
false
false
false
0
vm_finalize_features(struct virtio_device *vdev) { struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev); /* Give virtio_ring a chance to accept features. */ vring_transport_features(vdev); /* Make sure there is are no mixed devices */ if (vm_dev->version == 2 && !__virtio_test_bit(vdev, VIRTIO_F_VE...
false
false
false
false
false
0
obj_new( EnvT* e) { StackGuard<EnvStackT> guard( e->Interpreter()->CallStack()); int nParam=e->NParam(); if( nParam == 0) { return new DObjGDL( 0); } DString objName; e->AssureScalarPar<DStringGDL>( 0, objName); // this is a struct name -> convert to UPPERCASE ...
false
false
false
false
false
0
gwy_file_abandon_contents(guchar *buffer, gsize size, G_GNUC_UNUSED GError **error) { GMappedFile *mfile; if (!mapped_files || !(mfile = g_hash_table_lookup(mapped_files, buffer))) { g_warning("Don't know anything about mapping to address %p.", buffer...
false
false
false
false
false
0
prop_toggle_tool_button_real_update_property (IPropToolItem* base, IBusProperty* prop) { PropToggleToolButton * self; IBusProperty* _tmp0_ = NULL; const gchar* _tmp1_ = NULL; IBusProperty* _tmp2_ = NULL; const gchar* _tmp3_ = NULL; IBusProperty* _tmp4_ = NULL; IBusProperty* _tmp5_ = NULL; IBusText* _tmp6_ = NUL...
false
false
false
false
false
0
start_rubberbanding (NemoIconContainer *container, GdkEventButton *event) { AtkObject *accessible; NemoIconContainerDetails *details; NemoIconRubberbandInfo *band_info; GdkRGBA bg_color, border_color; GList *p; NemoIcon *icon; GtkStyleContext *context; details = container->details; band_info = &details...
false
false
false
false
false
0
stmmac_set_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *pause) { struct stmmac_priv *priv = netdev_priv(netdev); struct phy_device *phy = priv->phydev; int new_pause = FLOW_OFF; int ret = 0; if (priv->pcs) /* FIXME */ return -EOPNOTSUPP; if (pause->rx_pause) new_pause |= FLOW_RX;...
false
false
false
false
false
0
UpdateString(char **string,char *value) { if (value==NULL) return; if (*string==NULL) *string=(char *)safemalloc(strlen(value)+1); else *string=(char *)realloc(*string,strlen(value)+1); strcpy(*string,value); }
false
true
false
false
false
1
find_spot_in_room(mapstruct *map, int x, int y, int *kx, int *ky, RMParms *RP) { char **layout2; int i, j; free_spots_struct spots; spots.number_of_free_spots_in_room = 0; spots.room_free_spots_x = (int *)calloc(sizeof(int), RP->Xsize*RP->Ysize); spots.room_free_spots_y = (int *)calloc(sizeof(i...
false
false
false
false
false
0
PrepareForRendering() { GLint ivalue; glGetIntegerv(vtkgl::CURRENT_PROGRAM, &ivalue); if (ivalue != 0) { vtkErrorMacro("PrepareForRendering() cannot be called after a shader program has been bound."); return; } for (int cc=0; cc < VTK_MAX_LIGHTS; cc++) { // use the light's 4th diffuse c...
false
false
false
false
false
0
getNorm1() const { double norm = 0.0; for (int j = 0; j < numCols(); j++) { ConstVector colj(data.base()+ld*j, 1, rows); double normj = colj.getNorm1(); if (norm < normj) norm = normj; } return norm; }
false
false
false
false
false
0
initviewcalculation( int view, int jamming, int sx, int sy, int _mode, int _height ) // mode: +1 = add view ; -1 = remove view { height = _height; if ( view < 0 ) view = 0; if ( view > 255 ) viewdist = 255; else viewdist = view; jamdist = jamming; mode = _mode; int md; ...
false
false
false
false
false
0
_gtk_marshal_VOID__OBJECT_OBJECT_OBJECTv (GClosure *closure, GValue *return_value, gpointer instance, va_list args, gpointer m...
false
false
false
false
false
0
signal_wake_up_state(struct task_struct *t, unsigned int state) { set_tsk_thread_flag(t, TIF_SIGPENDING); /* * TASK_WAKEKILL also means wake it up in the stopped/traced/killable * case. We don't check t->state here because there is a race with it * executing another processor and just now entering stopped state...
false
false
false
false
false
0
ipa_write_jump_function (struct output_block *ob, struct ipa_jump_func *jump_func) { streamer_write_uhwi (ob, jump_func->type); switch (jump_func->type) { case IPA_JF_UNKNOWN: break; case IPA_JF_KNOWN_TYPE: streamer_write_uhwi (ob, jump_func->value.known_type.offset); stream_write...
false
false
false
false
false
0
vinlet_newsig(t_symbol *s) { t_vinlet *x = (t_vinlet *)pd_new(vinlet_class); x->x_canvas = canvas_getcurrent(); x->x_inlet = canvas_addinlet(x->x_canvas, &x->x_obj.ob_pd, &s_signal); x->x_endbuf = x->x_buf = (t_float *)getbytes(0); x->x_bufsize = 0; x->x_directsignal = 0; outlet_new(&x->x_ob...
false
false
false
false
false
0
dbFindLeaf(dmtree_t * tp, int l2nb, int *leafidx) { int ti, n = 0, k, x = 0; /* first check the root of the tree to see if there is * sufficient free space. */ if (l2nb > tp->dmt_stree[ROOT]) return -ENOSPC; /* sufficient free space available. now search down the tree * starting at the next level for the ...
false
false
false
false
false
0
has_next_match(match_counters *counters, match_operation *cur) { if (!counters) { return false; } if (counters->right) { if (counters->right->match->match->id == cur->id) { return true; } else if (has_next_match(counters->right, cur)) { return true; } else if (counters->right->left) { if (counters...
false
false
false
false
false
0
yy_pop_parser_stack(yyParser *pParser){ YYCODETYPE yymajor; yyStackEntry *yytos = &pParser->yystack[pParser->yyidx]; if( pParser->yyidx<0 ) return 0; #ifndef NDEBUG if( yyTraceFILE && pParser->yyidx>=0 ){ fprintf(yyTraceFILE,"%sPopping %s\n", yyTracePrompt, yyTokenName[yytos->major]); } #endi...
false
false
false
false
false
0
yajl_buf_append(yajl_buf buf, const void * data, unsigned int len) { yajl_buf_ensure_available(buf, len); if (len > 0) { assert(data != NULL); memcpy(buf->data + buf->used, data, len); buf->used += len; buf->data[buf->used] = 0; } }
false
false
false
false
false
0
xdmGetAuthHelper(unsigned short namelen, const char *name, int nbytes) { Xauth *new; if (!(new = generateAuthHelper(namelen, name, nbytes))) return 0; /* * set the first byte of the session key to zero as it * is a DES key and only uses 56 bits */ ((char *)new->data)[new->data_l...
false
false
false
false
false
0
parse_linemode (char *str) { if (!str) alwayslinemode = 1; else if (strcmp (str, "nokludge") == 0) lmodetype = NO_AUTOKLUDGE; else syslog (LOG_NOTICE, "invalid argument to --linemode: %s", str); }
false
false
false
false
false
0
HXPread(accrec_t * access_rec, int32 length, void * data) { CONSTR(FUNC, "HXPread"); /* for HERROR */ extinfo_t *info = /* information on the special element */ (extinfo_t *) access_rec->special_info; int32 ret_value = SUCCEED; /* validate length */ if (length < 0) HGOTO...
false
false
false
false
true
1
setUpdateInformation() { ui->updateVersions->clear(); for(int i = 0; i < m_desc.updateInformation().count(); ++i) { ui->updateVersions->addItem(tkTr(Trans::Constants::FROM_1_TO_2) .arg(m_desc.updateInformation().at(i).fromVersion()) ...
false
false
false
false
false
0
_estrdup(const char *s ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) { int length; char *p; length = strlen(s)+1; p = (char *) _emalloc(length ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC); if (UNEXPECTED(p == NULL)) { return p; } memcpy(p, s, length); return p; }
false
false
false
false
false
0
blinkUpdate(void) { const MSBinaryMatrix& newBlink=blinkMatrix(); if (verify(newBlink)==MSTrue) { MSBoolean stopTimer=MSTrue; if (blinkTimer()!=0) { if (blinkPhase()==Normal) { for (int i=0;i<newBlink.length();i++) { if (newBlink(i)==1) { stopTimer=MSFalse; break...
false
false
false
false
false
0
is_done() { int i, j; for(i=0; i<game_size_x(); i++) { for(j=0; j<game_size_y(); j++) { if(area_in(i,j) == AREA_CLEAR) return FALSE; } } return TRUE; }
false
false
false
false
false
0
chkpage(char *pag) { register int n; register int off; register short *ino = (short *) pag; if ((n = GET_SHORT(ino,0)) < 0 || n > PBLKSIZ / (int)sizeof(short)) return 0; if (n > 0) { off = PBLKSIZ; for (ino++; n > 0; ino += 2) { if (GET_SHORT(ino,0) > off || GET_SHORT(ino,1) > off || GET_SHORT(in...
false
false
false
false
false
0
compress() { if (NumClasses) return; for (unsigned i = 0, e = EC.size(); i != e; ++i) EC[i] = (EC[i] == i) ? NumClasses++ : EC[EC[i]]; }
false
false
false
false
false
0
DeleteItem(unsigned long id) { struct icon_info *tmp; tmp = Head; if (tmp == NULL) return False; if (tmp->id == id){ if (Hilite == tmp) Hilite = NULL; if ((tmp->icon_pixmap_w != None) && (tmp->flags & ICON_OURS)) XDestroyWindow(dpy, tmp->icon_pixmap_w); if (tmp->IconWin != None) ...
false
true
false
false
false
1
VideoInputFrameArrived (IDeckLinkVideoInputFrame * videoFrame, IDeckLinkAudioInputPacket * audioFrame) { GstDecklinkSrc *decklinksrc; g_return_val_if_fail (priv != NULL, S_OK); g_return_val_if_fail (GST_IS_DECKLINK_SRC (priv), S_OK); decklinksrc = GST_DECKLINK_SRC (priv); // Handle Video Frame if (vi...
false
false
false
false
false
0
player_map_init(struct player *pplayer) { pplayer->server.private_map = fc_realloc(pplayer->server.private_map, MAP_INDEX_SIZE * sizeof(*pplayer->server.private_map)); whole_map_iterate(ptile) { player_tile_init(ptile, pplayer); } whole_map_iterate_end; dbv_init(&pplayer->tile_known, ...
false
false
false
false
false
0
IsGlslBuiltin (const std::string& name) { static const char* s_reservedKeywords[] = { "radians", "degrees", "sin", "cos", "tan", "asin", "acos", "atan", "sinh", "cosh", "tanh", "asinh", "acosh", "atanh", "pow", "exp", "log", "exp2", "log2", "sqrt", "inversesqrt", "abs", "s...
false
false
false
false
false
0
receive_thread(const char* pathname_p) { ScopedHandle<const char*> pathname_h(pathname_p); // get the arguments for the exec() call below (because this is a // multi-threaded program, we must do this before fork()ing because // we use functions to get the arguments which are not async-signal-safe) std::pair...
false
false
false
false
false
0
free_unknown_poss() { int curr_person, locus, loop_v; if (unknown_poss != NULL) { for (curr_person = 1; curr_person <= totperson; curr_person++){ /* only entries for people with unknown genotype */ if ( person[curr_person]->unknown ) { for (locus = 0; locus < mlocus; locus++){ if ( person[curr...
false
false
false
false
false
0
DeInitSSLLibrary() { CRYPTO_set_locking_callback( NULL ); delete[] mutexes; mutexes = NULL; ERR_free_strings(); }
false
false
false
false
false
0
std_bbtree_lookup_extended(struct std_bbtree *tree, const void *lookup_key, void * *orig_key, void * *value) { struct std_bbtreenode *node; if (!tree) return 0; node = std_bbtree_node_lookup(tree->root, tree->key_compare, tree->key_compare_data, lookup_key); if (node) { ...
false
false
false
false
false
0
res_ftime(std::string& file, int diff = 0) { struct stat statbuf = {0}; stat(file.c_str(), &statbuf); time_t tt = statbuf.st_mtime + diff; struct tm* p=gmtime(&tt); //int offset; //int offset= -(int)timezone; //offset = offset/60/60*100 + (offset/60)%60; char buf[256]; //sprintf(buf, "%s, %02d %s %04d %02d:%0...
false
false
false
false
false
0
iio_push_event(struct iio_dev *indio_dev, u64 ev_code, s64 timestamp) { struct iio_event_interface *ev_int = indio_dev->event_interface; struct iio_event_data ev; int copied; /* Does anyone care? */ if (test_bit(IIO_BUSY_BIT_POS, &ev_int->flags)) { ev.id = ev_code; ev.timestamp = timestamp; copied = kfifo...
false
false
false
false
false
0
slotResult( const KUrl &url, QByteArray data, NetworkAccessManagerProxy::Error e ) { if( !m_urls.contains( url ) ) return; const CoverFetchUnit::Ptr unit( m_urls.take( url ) ); if( !unit ) { m_queue->remove( unit ); return; } if( e.code != QNetworkReply::NoError ) {...
false
false
false
false
false
0
IntrIfBegin ( void ) { /* ignore or code */ if ( IntrReturning > 0 ) { return; } if ( IntrIgnoring > 0 ) { IntrIgnoring++; return; } if ( IntrCoding > 0 ) { CodeIfBegin(); return; } }
false
false
false
false
false
0
gda_tree_dispose (GObject *object) { GdaTree *tree = (GdaTree *) object; g_return_if_fail (GDA_IS_TREE (tree)); if (tree->priv) { if (tree->priv->root) unset_root_node (tree); if (tree->priv->managers) { g_slist_foreach (tree->priv->managers, (GFunc) g_object_unref, NULL); g_slist_free (tree->priv->m...
false
false
false
false
false
0
core_tpg_alloc_lun( struct se_portal_group *tpg, u64 unpacked_lun) { struct se_lun *lun; lun = kzalloc(sizeof(*lun), GFP_KERNEL); if (!lun) { pr_err("Unable to allocate se_lun memory\n"); return ERR_PTR(-ENOMEM); } lun->unpacked_lun = unpacked_lun; lun->lun_link_magic = SE_LUN_LINK_MAGIC; atomic_set(&lun-...
false
false
false
false
false
0
knh_readuline(CTX ctx, kline_t uline, char *buf, size_t bufsiz) { kuri_t uri = ULINE_uri(uline); size_t line = ULINE_line(uline); buf[0] = 0; if(uline != 0 && uri > URI_EVAL && line != 0) { char const *fname = URI__(uri); FILE *fp = fopen(fname, "r"); if(fp != NULL) { if(line == 1) { readuline(fp, buf,...
false
false
false
false
false
0
setf_v_v( float *v1, float *v2, int num) { int i; for (i=0; i<num; i++) v1[i] = v2[i]; return(v1); }
false
false
false
false
false
0
cp932_int2char(unsigned int in, unsigned char* out) { if (in >= 0x100) { if (out) { out[0] = (unsigned char)((in >> 8) & 0xFF); out[1] = (unsigned char)(in & 0xFF); } return 2; } else return 0; }
false
false
false
false
false
0
check_text(uch *buffer, int maxsize) { int j; for (j = 0; j < maxsize; ++j) { if (buffer[j] == 0) { cli_dbgmsg("PNG: text contains NULL character(s)\n"); return 1; } else if (latin1_text_discouraged[buffer[j]]) { cli_dbgmsg("PNG: text has control character(s)\n"); return 1; } ...
false
false
false
false
false
0
nfcmrvl_i2c_parse_dt(struct device_node *node, struct nfcmrvl_platform_data *pdata) { int ret; ret = nfcmrvl_parse_dt(node, pdata); if (ret < 0) { pr_err("Failed to get generic entries\n"); return ret; } if (of_find_property(node, "i2c-int-falling", NULL)) pdata->irq_polarity = IRQF_TRIGGER_FALLING; e...
false
false
false
false
false
0
save_cma_preset(struct section_file *file, int i) { const struct cm_parameter *const pparam = cmafec_preset_get_parameter(i); char *name = cmafec_preset_get_descr(i); secfile_insert_str(file, name, "cma.preset%d.name", i); output_type_iterate(o) { secfile_insert_int(file, pparam->minimal_surplus[o], ...
false
false
false
false
false
0
r_exception2(struct SN_env * z) { z->ket = z->c; /* [, line 157 */ if (!(find_among_b(z, a_9, 8))) return 0; /* substring, line 157 */ z->bra = z->c; /* ], line 157 */ if (z->c > z->lb) return 0; /* atlimit, line 157 */ return 1; }
false
false
false
false
false
0
ibb_finished() { JT_IBB *j = d->j; d->j = 0; if(j->success()) { if(j->mode() == JT_IBB::ModeRequest) { #ifdef IBB_DEBUG qDebug("IBBConnection[%d]: %s [%s] accepted.", d->id, qPrintable(d->peer.full()), qPrintable(d->sid)); #endif d->state = Active; setOpenMode(QIODevice::ReadWrite); d->m->link...
false
false
false
false
false
0
double_print_infinity_to_dstring(double value, dstring *string) { bool ret = true; DENTER(ULONG_LAYER, "double_print_infinity_to_dstring"); if (string != NULL) { if (value == DBL_MAX) { sge_dstring_append(string, "infinity"); } else { ret = false; } } DEXIT; return...
false
false
false
false
false
0
string_out (unsigned char *p) { int i; unsigned char a; for (i=0; i<16; i++) { a=*p++; output1("%c",(a<' ')?'_':a); } }
false
false
false
false
false
0
fimc_md_unregister_entities(struct fimc_md *fmd) { int i; for (i = 0; i < FIMC_MAX_DEVS; i++) { struct fimc_dev *dev = fmd->fimc[i]; if (dev == NULL) continue; v4l2_device_unregister_subdev(&dev->vid_cap.subdev); dev->vid_cap.ve.pipe = NULL; fmd->fimc[i] = NULL; } for (i = 0; i < FIMC_LITE_MAX_DEVS; i...
false
false
false
false
false
0
wlc_phy_txpower_recalc_target_lcnphy(struct brcms_phy *pi) { u16 pwr_ctrl; if (wlc_lcnphy_tempsense_based_pwr_ctrl_enabled(pi)) { wlc_lcnphy_calib_modes(pi, LCNPHY_PERICAL_TEMPBASED_TXPWRCTRL); } else if (wlc_lcnphy_tssi_based_pwr_ctrl_enabled(pi)) { pwr_ctrl = wlc_lcnphy_get_tx_pwr_ctrl(pi); wlc_lcnphy_set_tx...
false
false
false
false
false
0
bot_motd(int idx, char *par) { FILE *vv; char *s = TBUF, *who, *p; int i; struct flag_record fr = { FR_BOT, USER_BOT, 0, 0, 0, 0 }; who = newsplit(&par); if (!par[0] || !egg_strcasecmp(par, botnetnick)) { int irc = 0; p = strchr(who, ':'); if (p) p++; else p = who; if (who[...
false
false
false
false
false
0
cleanup( QString &err ){ if (MACRO_DEBUG) printf("Erase all records on computer\n"); if (!dev->open(err)) { err = tr("ERROR: open failed: ") + err; } MacroPacket cmd(ERASE_ALL_RECORDS); cmd.addToPayload(UNKNOWN); if (!cmd.write(dev, err)) if (MACRO_DEBUG) printf("Error during erase al...
false
false
false
false
false
0
wbt201_data_chunk(struct read_state *st, const void *buf) { gbuint32 tim; gbuint16 flags; double lat, lon, alt; time_t rtim; waypoint *tpt = NULL; const char *bp = (const char *) buf; /* Zero records are skipped */ if (all_null(buf, RECLEN_WBT201)) { return 1; } fl...
false
false
false
false
false
0
operator<<(raw_ostream &OS, const TagStats &Stats) { for (auto Tag : Stats) { OS << Tag.first << ":" << Tag.second << " "; } return OS; }
false
false
false
false
false
0
evd_dbus_agent_unown_name (GObject *object, guint owner_id, GError **error) { ObjectData *obj_data; g_return_val_if_fail (G_IS_OBJECT (object), FALSE); g_return_val_if_fail (owner_id > 0, FALSE); obj_data = evd_dbus_agent_get_object_data (object); ...
false
false
false
false
false
0
dialog_function_load_recent_funcs (FunctionSelectState *state) { GSList const *recent_funcs; for (recent_funcs = gnm_conf_get_functionselector_recentfunctions (); recent_funcs; recent_funcs = recent_funcs->next) { char const *name = recent_funcs->data; GnmFunc *fd; if (name == NULL) continue; ...
false
false
false
false
false
0
processRGBAImage(imageStruct &image) { int h,w,height,width; long src=0; register int R,R1,G,G1,B,B1; //too many for x86? i really don't know or care int rightGain,imageGain; unsigned char *pixels=image.data; unsigned char *saved = m_savedImage.data; m_savedImage.xsize=image.xsize; m_savedImage.ysize=...
false
false
false
false
false
0
_build_uid_list(char *users, int *user_cnt, uid_t **user_list, bool *user_not) { char *last = NULL, *tmp = NULL, *tok; int u_cnt = 0, i; uid_t *u_list, u_tmp; *user_cnt = 0; *user_list = (uid_t *) NULL; *user_not = false; if (!users) return ESLURM_USER_ID_MISSING; i = strlen(users); u_list = xmalloc...
false
false
false
false
false
0
c2tp(double x, GByte *r) { double mant, temp; int negative, exp, i; // handle 0 case if (x == 0.0) { for (i = 0; i < 6; r[i++] = 0); return; } // compute mantissa, sign and exponent mant = frexp(x, &exp) * 2 - 1; exp--; negative = 0; if (mant < 0) { mant = -mant; negative = 1; ...
false
false
false
false
false
0
acpi_remove_cmos_rtc_space_handler(struct acpi_device *adev) { if (ACPI_FAILURE(acpi_remove_address_space_handler(adev->handle, ACPI_ADR_SPACE_CMOS, &acpi_cmos_rtc_space_handler))) pr_err(PREFIX "Error removing CMOS-RTC region handler\n"); }
false
false
false
false
false
0
mailsasl_ref(void) { #ifdef LIBETPAN_REENTRANT pthread_mutex_lock(&sasl_lock); #endif sasl_use_count ++; if (sasl_use_count == 1) sasl_client_init(NULL); #ifdef LIBETPAN_REENTRANT pthread_mutex_unlock(&sasl_lock); #endif }
false
false
false
false
false
0
isert_connected_handler(struct rdma_cm_id *cma_id) { struct isert_conn *isert_conn = cma_id->qp->qp_context; struct isert_np *isert_np = cma_id->context; isert_info("conn %p\n", isert_conn); mutex_lock(&isert_conn->mutex); isert_conn->state = ISER_CONN_UP; kref_get(&isert_conn->kref); mutex_unlock(&isert_conn-...
false
false
false
false
false
0
_mesa_DiscardFramebufferEXT(GLenum target, GLsizei numAttachments, const GLenum *attachments) { struct gl_framebuffer *fb; GLint i; GET_CURRENT_CONTEXT(ctx); fb = get_framebuffer_target(ctx, target); if (!fb) { _mesa_error(ctx, GL_INVALID_ENUM, "glDiscardFrame...
false
false
false
false
false
0
ucol_getSimpleCEGenerator(ucolCEGenerator *g, UColToken *tok, uint32_t strength, UErrorCode *status) { /* TODO: rename to enum names */ uint32_t high, low, count=1; uint32_t maxByte = (strength == UCOL_TERTIARY)?0x3F:0xFF; if(strength == UCOL_SECONDARY) { low = UCOL_COMMON_TOP2<<24; hig...
false
false
false
false
false
0
crb_check_resource(struct acpi_resource *ares, void *data) { struct resource *io_res = data; struct resource res; if (acpi_dev_resource_memory(ares, &res)) { *io_res = res; io_res->name = NULL; } return 1; }
false
false
false
false
false
0
Create() { if (m_DictionarySize == m_DictionarySizePrev && m_NumFastBytesPrev == m_NumFastBytes) return S_OK; RETURN_IF_NOT_S_OK(m_MatchFinder.Create(m_DictionarySize, kNumOpts, m_NumFastBytes, kMatchMaxLen - m_NumFastBytes)); m_DictionarySizePrev = m_DictionarySize; m_NumFastBytesPrev = m_NumFastByt...
false
false
false
false
false
0
btrfs_ioctl_set_fslabel(struct file *file, void __user *arg) { struct btrfs_root *root = BTRFS_I(file_inode(file))->root; struct btrfs_super_block *super_block = root->fs_info->super_copy; struct btrfs_trans_handle *trans; char label[BTRFS_LABEL_SIZE]; int ret; if (!capable(CAP_SYS_ADMIN)) return -EPERM; if ...
true
true
false
false
false
1
change_return_type (tree new_ret, tree fntype) { tree newtype; tree args = TYPE_ARG_TYPES (fntype); tree raises = TYPE_RAISES_EXCEPTIONS (fntype); tree attrs = TYPE_ATTRIBUTES (fntype); if (new_ret == error_mark_node) return fntype; if (same_type_p (new_ret, TREE_TYPE (fntype))) return fntype; ...
false
false
false
false
false
0
write_cam(struct adapter *padapter, u8 entry, u16 ctrl, u8 *mac, u8 *key) { unsigned int i, val, addr; int j; u32 cam_val[2]; addr = entry << 3; for (j = 5; j >= 0; j--) { switch (j) { case 0: val = ctrl | (mac[0] << 16) | (mac[1] << 24); break; case 1: val = mac[2] | (mac[3] << 8) | (mac[4] << 16...
false
false
false
false
false
0
vt_mpifile_free( const MPI_File fh ) { int i = 0; uint32_t fid; while( (i < nfiles) && (fh != mpifh_fid_map[i].mpifh) ) i++; if( i < nfiles ) { fid = mpifh_fid_map[i].file_data.fid; nfiles--; if( i < nfiles ) mpifh_fid_map[i] = mpifh_fid_map[nfiles]; return fid; } else vt_err...
false
false
false
false
false
0
create_compound_type(void) { hid_t ret_value=-1; if((ret_value = H5Tcreate(H5T_COMPOUND, sizeof(comp_datatype))) < 0) goto error; if(H5Tinsert(ret_value, "a", HOFFSET(comp_datatype, a), H5T_NATIVE_FLOAT) < 0) goto error; if(H5Tinsert(ret_value, "x", HOFFSET(comp_datatype, x), H5T_NATIVE...
false
false
false
false
false
0
crush_remove_tree_bucket_item(struct crush_bucket_tree *bucket, int item) { unsigned i; unsigned newsize; for (i = 0; i < bucket->h.size; i++) { int node; int weight; int j; int depth = calc_depth(bucket->h.size); if (bucket->h.items[i] != item) continue; node = crush_calc_tree_node(i); weight ...
false
false
false
false
false
0
P_GiveInventoryItem(player_t *player, int sprnum, mobjtype_t type) { int curinv = 0; int i; boolean ok = false; mobjtype_t item = 0; inventory_t* invtail; // repaint the status bar due to inventory changing player->st_update = true; while(1) { // inventory is f...
false
false
false
false
false
0
sftkdbLoad_Legacy(PRBool isFIPS) { PRLibrary *lib = NULL; LGSetCryptFunc setCryptFunction = NULL; if (legacy_glue_lib) { /* this check is necessary because it's possible we loaded the * legacydb to read secmod.db, which told us whether we were in * FIPS mode or not. */ if (isFIPS && !legacy_glue_libC...
false
false
false
false
false
0
validate() { if (model_ && (when() % 100) < 10) { if (model_->numberIntegers() != model_->numberObjects() && (model_->numberObjects() || (model_->specialOptions()&1024) == 0)) { int numberOdd = 0; for (int i = 0; i < model_-...
false
false
false
true
false
1
dbiblast_parseUnknown(const AjPStr line, AjPFile * alistfile, AjBool systemsort, AjPStr const * fields, ajint* maxFieldLen, ajuint* countfield, AjPStr* myid, AjPList* myfdl) { static ajint called = 0; static AjBool reset = AJTRUE; (void) line; (void) alis...
false
false
false
false
false
0
gretl_model_get_param_number (const MODEL *pmod, const DATASET *dset, const char *s) { char pname[VNAMELEN], tmp[VNAMELEN]; int i, idx = -1; if (pmod == NULL) { return -1; } if (!strcmp(s, "0")) { strcpy(pname, "const"); } else { strcpy(pname, s); } for (i=0; i<pmod->ncoef...
false
false
false
false
false
0
fft_proc( double *xr, double *xi, fftfloat *refac, fftfloat *imfac, int size) { int step, shift, pos; int exp, estep; estep = size; for (step = 1; step < size; step *= 2) { int x1; int x2 = 0; estep >>= 1; for (pos = 0; pos < size; pos += (2 * step)) { x1 = x2; x2 += step; exp = 0...
false
false
false
false
false
0
export_store(struct class *class, struct class_attribute *attr, const char *buf, size_t len) { long gpio; struct gpio_desc *desc; int status; status = kstrtol(buf, 0, &gpio); if (status < 0) goto done; desc = gpio_to_desc(gpio); /* reject invalid GPIOs */ if (!desc) { pr_warn("%s: invalid GPIO...
false
false
false
false
false
0
enque_msg_to_PCB(MsgEnv *msg_env, PCB* dest) { if(dest->receive_env_head == NULL){ dest->receive_env_head = msg_env; dest->receive_env_tail = msg_env; } else{ dest->receive_env_tail->next = msg_env; dest->receive_env_tail = msg_env; } msg_env->next = NULL; }
false
false
false
false
false
0
git_smart_subtransport_http(git_smart_subtransport **out, git_transport *owner) { http_subtransport *t; if (!out) return -1; t = git__calloc(sizeof(http_subtransport), 1); GITERR_CHECK_ALLOC(t); t->owner = (transport_smart *)owner; t->parent.action = http_action; t->parent.close = http_close; t->parent.fre...
false
false
false
false
false
0
find_cost(pq* q, long cost){ int root = 0; while (root <= 1000){ pqnode n = q->q[root]; if (n.cost == cost) return n.data; 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+1)].cost <= cost) root = 2*(root+1); // bran...
false
false
false
false
false
0
encode(string in) { int n; byte igroup[3], ogroup[4]; output = ""; iocp = 0; ateof = false; if (crlf) linelength = 0; iolen = in.length(); while (!ateof) { igroup[0] = igroup[1] = igroup[2] = 0; for (n = 0; n < 3; n++) { if (iocp == iolen) { ateof = true; break; } igroup[n] = (byte)i...
false
false
false
false
false
0
vi_urldecode(char *d, char *s, int n) { char *start = d; if (n < 1) return; while(*s && n > 1) { int c = *s; switch(c) { case '+': c = ' '; break; case '%': if (*(s+1) && *(s+2)) { int high = toupper(*(s+1)); int low = toupper(*(s+2)); if (high <= '9') high -= '0'; else high = (...
false
false
false
false
false
0
gnumeric_search (GnmFuncEvalInfo *ei, GnmValue const * const *argv) { char const *needle = value_peek_string (argv[0]); char const *haystack = value_peek_string (argv[1]); gnm_float start = argv[2] ? value_get_as_float (argv[2]) : 1.0; size_t i, istart; char const *hay2; GORegexp r; if (start < 1 || start >= IN...
false
false
false
false
false
0
identify_label_fetch (gint k, cpaneld * cpanel, GGobiData * d, ggobid * gg) { gchar *lbl = NULL; GList *labels = NULL, *l; gint id_display_type = cpanel->id_display_type; /* * How can I tell if the current page of the notebook * corresponds to the data? */ if (id_display_type & ID_VAR_LABELS) { GtkWidget...
false
false
false
false
false
0
do_tree_grafting(exec_list *instructions) { ir_variable_refcount_visitor refs; struct tree_grafting_info info; info.progress = false; info.refs = &refs; visit_list_elements(info.refs, instructions); call_for_basic_blocks(instructions, tree_grafting_basic_block, &info); return info.progress; }
false
false
false
false
false
0
foldOpenCursor() { int done; checkupdate(curwin); if (hasAnyFolding(curwin)) for (;;) { done = DONE_NOTHING; (void)setManualFold(curwin->w_cursor.lnum, TRUE, FALSE, &done); if (!(done & DONE_ACTION)) break; } }
false
false
false
false
false
0
_purge_job_start_req(void) { int purged = 0; ListIterator iter; uint16_t msg_type; uint32_t offset; Buf buffer; iter = list_iterator_create(agent_list); while ((buffer = list_next(iter))) { offset = get_buf_offset(buffer); if (offset < 2) continue; set_buf_offset(buffer, 0); unpack16(&msg_type, buffe...
false
false
false
false
false
0
cin_decode_lzss(const unsigned char *src, int src_size, unsigned char *dst, int dst_size) { uint16_t cmd; int i, sz, offset, code; unsigned char *dst_end = dst + dst_size; const unsigned char *src_end = src + src_size; while (src < src_end && dst < dst_end) { code = *src++; for (i =...
false
false
false
false
false
0