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
qla2x00_calc_iocbs_64(uint16_t dsds) { uint16_t iocbs; iocbs = 1; if (dsds > 2) { iocbs += (dsds - 2) / 5; if ((dsds - 2) % 5) iocbs++; } return (iocbs); }
false
false
false
false
false
0
x_val(edge_t * e, node_t * v, int dir) { node_t *other; int d, rv, f; if (agtail(e) == v) other = aghead(e); else other = agtail(e); if (!(SEQ(ND_low(v), ND_lim(other), ND_lim(v)))) { f = 1; rv = ED_weight(e); } else { f = 0; if (TREE_EDGE(e)) rv = ED_cutvalue(e); else rv = 0; ...
false
false
false
false
false
0
implicit_conversion (tree to, tree from, tree expr, bool c_cast_p, int flags) { conversion *conv; if (from == error_mark_node || to == error_mark_node || expr == error_mark_node) return NULL; /* Other flags only apply to the primary function in overload resolution, or after we've chosen on...
false
false
false
false
false
0
viewvpnport( Port ) vpnport_list *Port; { fprintf( stdout, "\n--> Port" ); viewvpnline( Port->LINE ); fprintf( stdout, "\n\t\tVEX_ATOM : " ); viewvexexprbound( Port->VEX_ATOM ); if ( Port->DIR >= VPN_MAX_DIR_TYPE ) { fprintf( stdout, "\n\t\tDIR : %d", (int)Port->DIR ); } else { fprint...
false
false
false
false
false
0
loose_backend__stream_fwrite(git_oid *oid, git_odb_stream *_stream) { loose_writestream *stream = (loose_writestream *)_stream; loose_backend *backend = (loose_backend *)_stream->backend; int error; char final_path[GIT_PATH_MAX]; if ((error = git_filebuf_hash(oid, &stream->fbuf)) < GIT_SUCCESS) return git__ret...
false
false
false
false
true
1
s5k6aa_probe(struct i2c_client *client, const struct i2c_device_id *id) { const struct s5k6aa_platform_data *pdata = client->dev.platform_data; struct v4l2_subdev *sd; struct s5k6aa *s5k6aa; int i, ret; if (pdata == NULL) { dev_err(&client->dev, "Platform data not specified\n"); return -EINVAL; } if (pd...
false
false
false
false
false
0
ProcessCreationOptions( ) { const char *pszValue; /* File format */ nFormat = NCDF_FORMAT_NC; pszValue = CSLFetchNameValue( papszCreationOptions, "FORMAT" ); if ( pszValue != NULL ) { if ( EQUAL( pszValue, "NC" ) ) { nFormat = NCDF_FORMAT_NC; } #ifdef NETCDF_HAS_NC2 ...
false
false
false
false
false
0
gth_sa_save_ref_md5(GthSA *sa, GthInput *input) { gt_assert(sa && input); gth_input_save_ref_md5(input, &sa->ref_md5, sa->ref_file_num, sa->ref_seq_num); }
false
false
false
false
false
0
task_pool_data_get(void **thread_data) { void *data; if(!thread_data) return -1; pthread_once(&task_pool_once, task_pool_initialize); data = pthread_getspecific(g_task_pool_key); *thread_data = data; return 0; }
false
false
false
false
false
0
writeback_listener_initable_init (GInitable *initable, GCancellable *cancellable, GError **error) { TrackerWritebackListenerPrivate *priv; GError *internal_error = NULL; priv = TRACKER_WRITEBACK_LISTENER_GET_PRIVATE (initable); priv->con...
false
false
false
false
false
0
clustexpand(devp, clust, fill) devstat *devp; long clust; int fill; { u_char *buf; long n, new, size; int duperrno; if (!fill) buf = NULL; else { duperrno = errno; size = (long)(devp -> clustsize) * (long)(devp -> sectsize); if (!(buf = (u_char *)malloc(size))) { doserrno = errno; errno = duperrno; ...
false
false
false
false
false
0
ext2_free_blocks (struct inode * inode, unsigned long block, unsigned long count) { struct buffer_head *bitmap_bh = NULL; struct buffer_head * bh2; unsigned long block_group; unsigned long bit; unsigned long i; unsigned long overflow; struct super_block * sb = inode->i_sb; struct ext2_sb_info * sbi = E...
false
false
false
false
false
0
writeItem(DcmItem &dataset) const { /* write ReferencedSOPClassUID and ReferencedSOPInstanceUID */ OFCondition result = DSRCompositeReferenceValue::writeItem(dataset); /* write ReferencedWaveformChannels (conditional) */ if (result.good()) { if (!ChannelList.isEmpty()) result = C...
false
false
false
false
false
0
_Cthread_once() { Cth_pid_t pid; unsigned thID = 0; /* WIN32 thread ID */ #ifdef _CTHREAD #if _CTHREAD_PROTO != _CTHREAD_PROTO_WIN32 pthread_mutexattr_t mattr; #if _CTHREAD_PROTO != _CTHREAD_PROTO_LINUX int n; #endif #endif /* _CTHREAD_PROTO != _CTHREAD_PROTO_WIN32 */ #endif #ifndef _C...
false
false
false
false
false
0
mx_adjustment_dispose (GObject *object) { MxAdjustmentPrivate *priv = MX_ADJUSTMENT (object)->priv; stop_interpolation (MX_ADJUSTMENT (object)); /* Remove idle handlers */ mx_adjustment_remove_idle (&priv->value_source); mx_adjustment_remove_idle (&priv->lower_source); mx_adjustment_remove_idle (&priv->up...
false
false
false
false
false
0
getNextBlogImage(int ix, bool blog) { BlogListWidget * listWidget = (blog) ? m_blogListWidget : m_projectListWidget; for (int i = ix; i < listWidget->imageRequestList().count(); i++) { QString image = listWidget->imageRequestList().at(i); if (image.isEmpty()) continue; QNetworkAccessMan...
false
false
false
false
false
0
set_algorithm(cmd_parms *cmd, void *config, const char *alg) { if (!strcasecmp(alg, "MD5-sess")) { return "AuthDigestAlgorithm: ERROR: algorithm `MD5-sess' " "is not fully implemented"; } else if (strcasecmp(alg, "MD5")) { return apr_pstrcat(cmd->pool, "Invalid algorithm in A...
false
false
false
false
false
0
nautilus_file_compare_for_sort_internal (NautilusFile *file_1, NautilusFile *file_2, gboolean directories_first, gboolean reversed) { gboolean is_directory_1, is_directory_2; if (directories_first) { is_directory_1 = nautilus_file_is_directory (file_1); is_directory_2 = nautilus_file_is_directo...
false
false
false
false
false
0
pipes(fd_t fd[3][2], unsigned stdfds) { int j, k; static Boolean_t use_ptys = TRUE; /* pipe(2) creates two file descriptors: [0] read, [1] write; * this code transposes some to produce: [0] parent, [1] child */ if (stdfds == 2 && use_ptys) { struct termios termios = original_termios; termios.c_oflag &=...
false
false
false
false
false
0
ndmca_media_capture_tape_offset (struct ndm_session *sess) { struct ndm_control_agent *ca = &sess->control_acb; struct ndm_job_param * job = &ca->job; int rc; unsigned long long off; rc = ndmca_tape_get_state(sess); if (rc) return NDMP_LENGTH_INFINITY; /* invalid? */ if (!ca->tape_state.blockno.valid) retu...
false
false
false
false
false
0
sinfo_new_cube_ops( cpl_imagelist * cube1, cpl_imagelist * cube2, int operation) { if (cube1==NULL || cube2==NULL) { sinfo_msg_error("null cubes"); return NULL ; } switch(operation) { case '+': return sinfo_new_cube_add(cube1, cube2) ; ca...
false
false
false
false
false
0
_gl_load_history(GetLine *gl, const char *filename, const char *comment) { /* * If filesystem access is to be excluded, then history files can't * be read. */ #ifdef WITHOUT_FILE_SYSTEM _err_record_msg(gl->err, "Can't load history without filesystem access", END_ERR_MSG); errno = EINVAL; return 1; #...
false
false
false
false
false
0
map_invisible(xchar x, xchar y) { if (x != u.ux || y != u.uy) { /* don't display I at hero's location */ if (level.flags.hero_memory) levl[x][y].glyph = GLYPH_INVISIBLE; show_glyph(x, y, GLYPH_INVISIBLE); } }
false
false
false
false
false
0
Seek(size_t pOffset, aiOrigin pOrigin) { if (!mFile) { return AI_FAILURE; } // Just to check whether our enum maps one to one with the CRT constants BOOST_STATIC_ASSERT(aiOrigin_CUR == SEEK_CUR && aiOrigin_END == SEEK_END && aiOrigin_SET == SEEK_SET); // do the seek return (0 == ::fseek(mFile, (long)pOff...
false
false
false
false
false
0
nfs_map_gid_to_group(const struct nfs_server *server, kgid_t gid, char *buf, size_t buflen) { struct idmap *idmap = server->nfs_client->cl_idmap; int ret = -EINVAL; __u32 id; id = from_kgid(&init_user_ns, gid); if (!(server->caps & NFS_CAP_UIDGID_NOMAP)) ret = nfs_idmap_lookup_name(id, "group", buf, buflen, idm...
false
false
false
false
false
0
decode_bytes_and_gain(COOKContext *q, const uint8_t *inbuffer, cook_gains *gains_ptr) { int offset; offset = decode_bytes(inbuffer, q->decoded_bytes_buffer, q->bits_per_subpacket/8); init_get_bits(&q->gb, q->decoded_bytes_buffer + offset, q-...
false
false
false
false
false
0
colors() const { if (d->colorList.isEmpty()) { QList<QColor> list; for (int i = 0; i < STANDARD_PALETTE_SIZE; ++i) { list += standardColor(i); } return list; } else { return d->colorList; } }
false
false
false
false
false
0
git_text_gather_stats(git_text_stats *stats, const git_buf *text) { size_t i; memset(stats, 0, sizeof(*stats)); for (i = 0; i < git_buf_len(text); i++) { unsigned char c = text->ptr[i]; if (c == '\r') { stats->cr++; if (i + 1 < git_buf_len(text) && text->ptr[i + 1] == '\n') stats->crlf++; } el...
false
false
false
false
false
0
InnerProduct(TVector x, TVector y, TMatrix S) { if (!x || !y || !S) { dw_Error(NULL_ERR); return 0.0; } if ((DimV(x) != RowM(S)) || (DimV(y) != ColM(S)) || (DimV(x) != DimV(y))) { dw_Error(SIZE_ERR); return 0.0; } dw_ClearError(); return bInnerProduct(pElementV(x),pElementV(y),pElem...
false
false
false
false
false
0
JimParseScript(struct JimParserCtx *pc) { while (1) { /* the while is used to reiterate with continue if needed */ if (!pc->len) { pc->tstart = pc->p; pc->tend = pc->p - 1; pc->tline = pc->linenr; pc->tt = JIM_TT_EOL; pc->eof = 1; ...
false
false
false
false
false
0
string_hash (void *string) { unsigned int hash = 5381; int c; while ((c = *(const char *)string)) { hash = ((hash << 5) + hash) + c; /* hash * 33 + c */ string = ((char *)string) + 1; } return hash; }
false
false
false
false
false
0
v_delay_or_event_control(void) #else v_delay_or_event_control() #endif { #line 1816 "./verilog.g" zzRULE; zzBLOCK(zztasp1); zzMake0; { if ( (LA(1)==V_POUND) ) { #line 1816 "./verilog.g" v_delay_control(); } else { if ( (LA(1)==V_AT) ) { #line 1817 "./verilog.g" v_event_control(); } e...
false
false
false
false
false
0
qlcnic_get_fw_version(struct qlcnic_adapter *adapter) { struct uni_data_desc *fw_data_desc; const struct firmware *fw = adapter->fw; u32 major, minor, sub; __le32 version_offset; const u8 *ver_str; int i, ret; if (adapter->ahw->fw_type != QLCNIC_UNIFIED_ROMIMAGE) { version_offset = *(__le32 *)&fw->data[QLCNIC...
false
false
false
false
false
0
LHelpRedef(char *key, char *message) { Help *h; for(h = helps; h != NULL; h = h->next) if(strcmp(key, h->key) == 0) { h->message = message; return; } LHelpDef(key, message); }
false
false
false
false
false
0
Argument_main(Argument *arg){ register FastaDB *fdb; register ArgumentSet *as = ArgumentSet_create("Sequence Input Options"); gchar *query_path; register Alphabet *alphabet; FastaClean_Info fci; ArgumentSet_add_option(as, 'f', "fasta", "path", "Fasta input file", NULL, ...
false
false
false
false
false
0
Clear(vtkPixelListEntryMemory *mm) { assert("pre: mm_exists" && mm!=0); if(this->Size>0) { // it works even if first==last mm->FreeSubList(this->First,this->Last); this->Size=0; } }
false
false
false
false
false
0
handleBackground(unsigned long pixel_) { if (pixel_!=handleBackground()) { unsigned long old=handleBackground(); _handleBg=pixel_; updateHandleTile(); } }
false
false
false
false
false
0
vidioc_s_frequency(struct file *file, void *priv, const struct v4l2_frequency *f) { struct ma901radio_device *radio = video_drvdata(file); if (f->tuner != 0) return -EINVAL; return ma901radio_set_freq(radio, clamp_t(unsigned, f->frequency, FREQ_MIN * FREQ_MUL, FREQ_MAX * FREQ_MUL)); }
false
false
false
false
false
0
loadmenu(MENU *menu) { int i; if (emacsviterm == YES) { mousereinit(); (void) printf("\033V1"); /* display the scrollbar */ (void) printf("\033M0@%s@%s@", menu[0].text, menu[0].value); for (i = 1; menu[i].text != NULL; ++i) { (void) printf("\033M@%s@%s@", menu[i].text, menu[i].value); } } else { /* my...
false
false
false
false
false
0
intel_verify_pin_cvt_connect(struct hda_codec *codec, struct hdmi_spec_per_pin *per_pin) { hda_nid_t pin_nid = per_pin->pin_nid; int mux_idx, curr; mux_idx = per_pin->mux_idx; curr = snd_hda_codec_read(codec, pin_nid, 0, AC_VERB_GET_CONNECT_SEL, 0); if (curr != mux_idx) snd_hda_codec_write_cache(codec...
false
false
false
false
false
0
nat_t_setup_hashes(void) { struct hash *hash; int n = NUMNATTCAP; int i; /* The draft says to use MD5. */ hash = hash_get(HASH_MD5); if (!hash) { /* Should never happen. */ log_print("nat_t_setup_hashes: " "could not find MD5 hash structure!"); return -1; } /* Populate isakmp_nat_t_cap with hash...
true
true
false
false
false
1
S8259Synco(void) { int x; setprg32(0x8000,latch[5]&7); if(!UNIFchrrama) // No CHR RAM? Then BS'ing is ok. { if(!type) { for(x=0;x<4;x++) setchr2(0x800*x,(x&1)|((latch[x]&7)<<1)|((latch[4]&7)<<4)); } else { for(x=0;x<4;x++) setchr2(0x800*x,(latch[x]&0x7)|((latch[4]&7)<<3)); } } switch(...
false
false
false
false
false
0
hash_insert( struct hash * hp, OBJECT * key, int * found ) { ITEM * i; unsigned int keyval = hash_keyval( key ); #ifdef HASH_DEBUG_PROFILE profile_frame prof[1]; if ( DEBUG_PROFILE ) profile_enter( 0, prof ); #endif if ( !hp->items.more ) hashrehash( hp ); i = hash_sea...
false
false
false
false
false
0
scan_longlong(const char* src,signed long long* dest) { unsigned int i,o; unsigned long long l; char c=src[0]; o=c=='-' || c=='+'; if ((i=scan_ulonglong(src+o,&l))) { if (i+o) *dest=c=='-'?-l:l; return i+o; } return 0; }
false
false
false
false
false
0
ClickAction(Widget w, XEvent *event, String *params, Cardinal *nparams) { XmTabWidget wid = (XmTabWidget)w; Widget tab_wid; XmTabCallbackStruct call_data; XmTabConstraintRec *tab_constraint; tab_wid = search_tab(wid, event); if(!tab_wid) { return; } change_ta...
false
false
false
false
false
0
name_free_sub(name_table * nt, uint sub_index, bool unmark) { /* If the subtable is in a previous save level, gs_free_object() * may not actually free the memory, in case that happens, we need * to explicitly remove the gc mark if requested. */ if (unmark) { name_sub_table *sub = nt->sub[...
false
false
false
false
false
0
skip_prefixes(byte **p, int &sizep, int addrsize) { while (sizep > 0) { if (**p == 0x66 || **p == 0x67 || **p == 0xf2 || **p == 0xf3 || (addrsize == X86_ADDRSIZE64 && (**p & 0xf0) == 0x40)) { sizep--; (*p)++; } else { break; } } }
false
false
false
false
false
0
ExpectedNofPropertiesFromEstimate(int estimate) { // If no properties are added in the constructor, they are more likely // to be added later. if (estimate == 0) estimate = 2; // We do not shrink objects that go into a snapshot (yet), so we adjust // the estimate conservatively. if (Serializer::enabled()) ...
false
false
false
false
false
0
ComputeAABB(b2AABB* aabb, const b2Transform& xf, int32 childIndex) const { B2_NOT_USED(childIndex); b2Vec2 lower = b2Mul(xf, m_vertices[0]); b2Vec2 upper = lower; for (int32 i = 1; i < m_vertexCount; ++i) { b2Vec2 v = b2Mul(xf, m_vertices[i]); lower = b2Min(lower, v); upper = b2Max(upper, v); } b2Vec2 r...
false
false
false
false
false
0
fits_delete_keyword(struct ccd_frame *fr, char *kwd) { FITS_row *v1; if (kwd == NULL) return 0; if (fr == NULL) return -1; v1 = fits_keyword_lookup(fr, kwd); if (v1 != NULL) { // replace current value if ((fr->nvar + fr->var - v1) > 0) memcpy(v1, v1 + 1, FITS_HCOLS * (fr->nvar + fr->var - v1)); fr->nv...
false
true
false
false
false
1
dmp_fcallx(FILE *f, struct expr_t *ndp) { int32 first_time; char paren; dmp_expr(f, ndp->lu.x); if (ndp->ru.x == NULL) return; paren = '('; __wrap_putc(paren, f); if (ndp->ru.x == NULL) return; /* know fcall operator left always unused */ for (first_time = TRUE, ndp = ndp->ru.x; ndp != NULL; ndp = ndp->ru.x...
false
false
false
false
false
0
getpriority(int which, int who) { int rv = __getpriority(which, who); return (rv < 0) ? rv : 20-rv; }
false
false
false
false
false
0
cgcef_getaroff(CGCEf *cgcef) { CGCEf *ref; if (!cgcef) { return (off_t)-1; } cgcef_assert(cgcef->e_magic == CGCEF_MAGIC); if (!(ref = cgcef->e_parent)) { return (off_t)-1; } cgcef_assert(ref->e_magic == CGCEF_MAGIC); cgcef_assert(cgcef->e_base >= ref->e_base + SARMAG + sizeof(struct a...
false
false
false
false
false
0
icalcomponent_get_duration(icalcomponent* comp) { icalcomponent *inner = icalcomponent_get_inner(comp); icalproperty *end_prop = icalcomponent_get_first_property(inner,ICAL_DTEND_PROPERTY); icalproperty *dur_prop = icalcomponent_get_first_property(inner,ICAL_DURATION_PROPERTY); struct icaldurati...
false
false
false
false
false
0
imap_find_new_msgs_p2( imap_store_t *ctx, struct imap_cmd *gcmd, int response ) { struct imap_cmd_simple *cmdp = (struct imap_cmd_simple *)gcmd, *cmd; if (response != RESP_OK) { imap_done_simple_box( ctx, gcmd, response ); return; } INIT_IMAP_CMD(imap_cmd_simple, cmd, cmdp->callback, cmdp->callback_aux) imap_...
false
false
false
false
false
0
main(int argc,char *argv[]) { char *name = NULL; char *wild = "*.*"; int filesizes = 0; int hidden = 0; int c; while ((c = getopt(argc,argv,":hn:sa"))!=-1) { switch(c) { case 'h': usage(argv[0],0); break; case 's': filesizes = 1; break; case 'a': ...
false
true
false
false
true
1
drmHashDestroy(void *t) { HashTablePtr table = (HashTablePtr)t; HashBucketPtr bucket; HashBucketPtr next; int i; if (table->magic != HASH_MAGIC) return -1; /* Bad magic */ for (i = 0; i < HASH_SIZE; i++) { for (bucket = table->buckets[i]; bucket;) { next = bucket->next; d...
false
false
false
false
false
0
pick_light(Event *ev) { int i; DView *dv = dview[uistate.mousefocus]; DGeom *dg = dgeom[INDEXOF(lr_id)]; Transform V, T, Tnorm, Tmodel, Tnet, Tt; float xpick, ypick; Pick *pick = NULL; CamView(dv->cam, V); /* Top-level modelling transform */ GeomPosition( dv->Item, T ); TmConcat( T,V, T ); pick ...
false
false
false
false
false
0
SetupTable(li, box) HTMLInfo li; HTMLBox box; { int i, j; HRow *rs; HData *ds; int bx, by; HTable *ts = (HTable *)box->closure; bx = 0; by = 0; for (j = 0, rs = (HRow *)GListGetHead(ts->grid); rs != NULL; rs = (HRow *)GListGetNext(ts->grid), j++) { if (rs->ca == NULL) continue; for (...
false
false
false
false
false
0
attr_rtx_cost (x) rtx x; { int cost = 0; enum rtx_code code; if (!x) return 0; code = GET_CODE (x); switch (code) { case MATCH_OPERAND: if (XSTR (x, 1)[0]) return 10; else return 0; case EQ_ATTR: /* Alternatives don't result into function call. */ if (!strcmp (X...
false
false
false
false
false
0
cb_sync_plugin(GtkWidget *widget, gpointer data) { GList *plugin_list, *temp_list; struct plugin_s *Pplugin; int number; number = GPOINTER_TO_INT(data); plugin_list=NULL; plugin_list = get_plugin_list(); for (temp_list = plugin_list; temp_list; temp_list = temp_list->next) { Pplugin = (st...
false
false
false
false
false
0
DumpNodeOptions ( XMP_OptionBits options, XMP_TextOutputProc outProc, void * refCon ) { char buffer [32]; // Decimal of a 64 bit int is at most about 20 digits. static const char * optNames[] = { " schema", // 0x8000_0000 " ?30", " ?29", " -COMMAS-", ...
false
false
false
false
false
0
dw_mci_adjust_fifoth(struct dw_mci *host, struct mmc_data *data) { unsigned int blksz = data->blksz; const u32 mszs[] = {1, 4, 8, 16, 32, 64, 128, 256}; u32 fifo_width = 1 << host->data_shift; u32 blksz_depth = blksz / fifo_width, fifoth_val; u32 msize = 0, rx_wmark = 1, tx_wmark, tx_wmark_invers; int idx = ARRAY...
false
false
false
false
false
0
tab(void) { if (sensitive()==MSTrue&&isProtected()==MSFalse) insertString(MSTextTabString); else top()->traverseToNext(); }
false
false
false
false
false
0
teardown (Test *test, gconstpointer unused) { g_object_unref (test->service); secret_service_disconnect (); g_assert (test->service == NULL); mock_service_stop (); }
false
false
false
false
false
0
FactDeinstall( void *theEnv, struct fact *newFact) { struct multifield *theSegment; int i; FactData(theEnv)->NumberOfFacts--; theSegment = &newFact->theProposition; newFact->whichDeftemplate->busyCount--; for (i = 0 ; i < (int) theSegment->multifieldLength ; i++) { AtomDeinstall(the...
false
false
false
false
false
0
z_set_height(zwinid window, unsigned height) { unsigned x; if(height * window->width > window->buffer_size) { n_show_error(E_OUTPUT, "height too large", height); return; } window->height = height; if(height > window->biggest_height) window->biggest_height = height; x = window->max_offset; wi...
false
false
false
false
false
0
ubifs_lpt_lookup(struct ubifs_info *c, int lnum) { int err, i, h, iip, shft; struct ubifs_nnode *nnode; struct ubifs_pnode *pnode; if (!c->nroot) { err = ubifs_read_nnode(c, NULL, 0); if (err) return ERR_PTR(err); } nnode = c->nroot; i = lnum - c->main_first; shft = c->lpt_hght * UBIFS_LPT_FANOUT_SHIFT;...
false
false
false
false
false
0
hidpp_root_get_feature(struct hidpp_device *hidpp, u16 feature, u8 *feature_index, u8 *feature_type) { struct hidpp_report response; int ret; u8 params[2] = { feature >> 8, feature & 0x00FF }; ret = hidpp_send_fap_command_sync(hidpp, HIDPP_PAGE_ROOT_IDX, CMD_ROOT_GET_FEATURE, params, 2, &response); if (...
false
false
false
false
false
0
ChopLastNode(char *str) /* Chop off trailing node name (possible blank) starting from last character and removing up to the first / encountered e.g. /a/b/c -> /a/b /a/b/ -> /a/b */ { char *sp; int ret; if ((sp = LastFileSeparator(str)) == NULL) { r...
false
false
false
false
false
0
_item_unselect(Elm_Toolbar_Item *item) { Widget_Data *wd; if ((!item) || (!item->selected)) return; wd = elm_widget_data_get(WIDGET(item)); if (!wd) return; item->selected = EINA_FALSE; wd->selected_item = NULL; edje_object_signal_emit(VIEW(item), "elm,state,unselected", "elm"); elm_widget_signa...
false
false
false
false
false
0
reset (int argc _GL_UNUSED_PARAMETER, char **argv _GL_UNUSED_PARAMETER) { fd_set mask; int nfnd = 1; FD_ZERO (&mask); while (nfnd > 0) { FD_SET (fileno (cin), &mask); if ((nfnd = empty (&mask, 0)) < 0) { error (0, errno, "reset"); code = -1; lostpeer (0); } else if (nfnd) { ...
false
false
false
false
false
0
snd_hda_codec_proc_new(struct hda_codec *codec) { char name[32]; struct snd_info_entry *entry; int err; snprintf(name, sizeof(name), "codec#%d", codec->core.addr); err = snd_card_proc_new(codec->card, name, &entry); if (err < 0) return err; snd_info_set_text_ops(entry, codec, print_codec_info); return 0; }
false
false
false
false
false
0
regmap_encx24j600_phy_reg_read(void *context, unsigned int reg, unsigned int *val) { struct encx24j600_context *ctx = context; int ret; unsigned int mistat; reg = MIREGADR_VAL | (reg & PHREG_MASK); ret = regmap_write(ctx->regmap, MIREGADR, reg); if (unlikely(ret)) goto err_out; ret = regmap_write(ctx-...
false
false
false
false
false
0
ion_get_client_serial(const struct rb_root *root, const unsigned char *name) { int serial = -1; struct rb_node *node; for (node = rb_first(root); node; node = rb_next(node)) { struct ion_client *client = rb_entry(node, struct ion_client, node); if (strcmp(client->name, name)) continue; serial =...
false
false
false
false
false
0
listContainmentsOfType(const QString &type, const QString &category, const QString &parentApp) { QString constraint; if (parentApp.isEmpty()) { constraint.append("(not exist [X-KDE-ParentApp] or ...
false
false
false
false
false
0
make_print_list(struct include_field *fl,struct field *f) { struct print_field *ret = NULL,*c = NULL; struct field *n; if(fl == NULL) { while(f != NULL) { if(strcmp(f->name,"FILLER") != 0) { if(ret == NULL) { re...
false
false
false
false
false
0
gf_sk_is_multicast_address(const char *multi_IPAdd) { #ifdef GPAC_HAS_IPV6 u32 val; char *sep; struct addrinfo *res; if (!multi_IPAdd) return 0; /*IPV6 multicast address*/ sep = strchr(multi_IPAdd, ':'); if (sep) sep = strchr(multi_IPAdd, ':'); if (sep && !strnicmp(multi_IPAdd, "ff", 2)) return 1; /*ipv4 mult...
false
false
false
false
false
0
set_curr_group(void) { long i, n; switch (global.mode) { case NewsModeConnected: case NewsModeAllgroups: case NewsModeSomegroups: case NewsModeNewgroups: n = ScrListGetFirstSelected(main_widgets.group_list); if (!global.curr_group || global.curr_group->disp != n) { global.curr_group = NU...
false
false
false
false
false
0
netsnmp_arch_ip_scalars_ipv6IpForwarding_get(u_long *value) { FILE *filep; int rc; if (NULL == value) return -1; filep = fopen(ipfw6_name, "r"); if (NULL == filep) { DEBUGMSGTL(("access:ipv6IpForwarding", "could not open %s\n", ipfw6_name)); return -2; ...
false
false
false
false
false
0
namco_obj_init( int gfxbank, int palXOR, int (*codeToTile)( int code ) ) { mGfxC355 = gfxbank; mPalXOR = palXOR; if( codeToTile ) { mpCodeToTile = codeToTile; } else { mpCodeToTile = DefaultCodeToTile; } spriteram16 = auto_malloc(0x14200); memset( mSpritePos,0x00,sizeof(mSpritePos) ); }
false
false
false
false
false
0
us_rawnet_multi_receive( us_rawnet_multi_t * self, time_t cur_time, void * context, void ( *handler )( us_rawnet_multi_t * self, int ethernet_port, void * context, uint8_t * buf, uint16_t len ) ) { int receive_count = 0; int i; for ( i = 0; i < self->ethernet_port_count; ++i ) { ...
false
false
false
false
false
0
qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { Q_ASSERT(staticMetaObject.cast(_o)); SecureStream *_t = static_cast<SecureStream *>(_o); switch (_id) { case 0: _t->tlsHandshaken(); break; case 1: _t->tlsCl...
false
false
false
false
false
0
stc_print_bands(stcolor_device *sd, FILE *prn_stream) { int escp_used,color,buf_a,iprint,w,m; int ncolor = sd->color_info.num_components == 1 ? 1 : 4; while(sd->stc.stc_y < sd->stc.prt_scans) { /* * find the begin of the band */ for(w = 0; sd->stc.stc_y < sd->stc.buf_y; ++sd->stc.stc_y) { ...
false
true
false
false
false
1
on_map(int sub, double cut, int horiz) { return (sub >= 0 && cut >= 0.0 && ((horiz && sub < region.rows && cut <= (double)(region.cols - 1)) || (!horiz && sub < region.cols && cut <= (double)(region.rows - 1)))); }
false
false
false
false
false
0
notebook_create_window_cb (GtkNotebook *notebook, GtkWidget *page, gint x, gint y, gpointer user_data) { NemoApplication *app; NemoWindow *new_window; NemoWindowPane *new_pane; NemoWindowSlot *slot; if (!NEMO_IS_WINDOW_SLOT (page)) { return NULL; } app = NEMO_APPLICATION (g_applicat...
false
false
false
false
false
0
g_mime_part_iter_new (GMimeObject *toplevel) { GMimePartIter *iter; g_return_val_if_fail (GMIME_IS_OBJECT (toplevel), NULL); iter = g_slice_new (GMimePartIter); iter->path = g_array_new (FALSE, FALSE, sizeof (int)); iter->toplevel = toplevel; g_object_ref (toplevel); iter->parent = NULL; g_mime_part_iter_...
false
false
false
false
false
0
ns1__executeCommand(soap* soap, char* command, char** result) { // security check if (!soap->userid || !soap->passwd) { DEBUG_LOG("MaNGOSsoap: Client didn't provide login information"); return 401; } uint32 accountId = sAccountMgr.GetId(soap->userid); if (!accountId) { ...
false
false
false
false
false
0
Parse(trpgToken tok,trpgReadBuffer &buf) { int envMode; int minFilter; int magFilter; int wrapS,wrapT; trpgColor borderCol; try { switch (tok) { case TRPGMAT_TXENV_MODE: buf.Get(envMode); tenv->SetEnvMode(envMode); break; case TRPGMAT_...
false
false
false
false
false
0
R_GenerateComposite(int texnum) { byte *block; texture_t *texture; texpatch_t *patch; patch_t *realpatch; int x, x1, x2; int i; column_t *patchcol; short *collump; unsigned short *colofs; texture = textures[texnum]; block = Z_Malloc(texturecompositesize[texnum], PU_STATIC, ...
false
false
false
false
false
0
zterp_io_putc(const zterp_io *io, uint16_t c) { if(!use_utf8_io) { if(c > UINT8_MAX) c = UNICODE_QUESTIONMARK; #ifdef ZTERP_GLK if(io->type == IO_GLK) { glk_put_char_stream(io->file, c); } else #endif { if(textmode(io) && c == UNICODE_LINEFEED) c = '\n'; putc(c, io->fp); ...
false
false
false
false
false
0
dominates(const Instruction *Def, const Instruction *User) const { const BasicBlock *UseBB = User->getParent(); const BasicBlock *DefBB = Def->getParent(); // Any unreachable use is dominated, even if Def == User. if (!isReachableFromEntry(UseBB)) return true; // Unreachabl...
false
false
false
false
false
0
get_non_default_template_args_count (tree args, int flags) { int n = TREE_VEC_LENGTH (INNERMOST_TEMPLATE_ARGS (args)); if (/* We use this flag when generating debug information. We don't want to expand templates at this point, for this may generate new decls, which gets decl counts out of sync, which may in ...
false
false
false
false
false
0
intel_miptree_map_depthstencil(struct brw_context *brw, struct intel_mipmap_tree *mt, struct intel_miptree_map *map, unsigned int level, unsigned int slice) { struct intel_mipmap_tree *z_mt = mt; struct intel_mipmap_tree *s_mt = mt->stencil_mt; bool map_z32f_x24s8 = mt->format == ...
false
false
false
false
false
0
snd_compr_ioctl_avail(struct snd_compr_stream *stream, unsigned long arg) { struct snd_compr_avail ioctl_avail; size_t avail; avail = snd_compr_calc_avail(stream, &ioctl_avail); ioctl_avail.avail = avail; if (copy_to_user((__u64 __user *)arg, &ioctl_avail, sizeof(ioctl_avail))) return -EFAULT; return 0; }
false
false
false
false
false
0
REDIRECT_save(const void *ip, const struct xt_entry_target *target) { const struct nf_nat_range *range = (const void *)target->data; if (range->flags & NF_NAT_RANGE_PROTO_SPECIFIED) { printf(" --to-ports "); printf("%hu", ntohs(range->min_proto.tcp.port)); if (range->max_proto.tcp.port != range->min_proto.tcp....
false
false
false
false
false
0
CreateWrinkledSpectrumTexture(const Transform &tex2world, const TextureParams &tp) { // Initialize 3D texture mapping _map_ from _tp_ TextureMapping3D *map = new IdentityMapping3D(tex2world); return new WrinkledTexture<Spectrum>(tp.FindInt("octaves", 8), tp.FindFloat("roughness", .5f), map);...
false
false
false
false
false
0
match_domain_name_ip(char *domain_name, struct in_addr match_addr, struct in_addr match_mask) { int i; struct hostent *host; struct in_addr addr; if (!looks_like_domain_name(domain_name)) return(-1); /* Note that endhostent() is never called. */ if ((host = gethostbyname((const char *) domain_name)...
false
false
false
false
false
0
mtnic_map_cmd(struct mtnic *mtnic, u16 op, struct mtnic_pages pages) { unsigned int j; u32 addr; unsigned int len; u32 *page_arr = mtnic->cmd.buf; int nent = 0; int err = 0; memset(page_arr, 0, PAGE_SIZE); len = PAGE_SIZE * pages.num; pages.buf = (u32 *)umalloc(PAGE_SIZE * (pages.num + 1)); addr = PAGE_SIZE...
false
false
false
false
false
0
OnAuthClient(struct adapter *padapter, struct recv_frame *precv_frame) { unsigned int seq, len, status, offset; unsigned char *p; unsigned int go2asoc = 0; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); u8 *pframe = precv_frame->rx_data; ...
false
false
false
false
false
0