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
GetLastDamagedPlayers (edict_t * self, char *buf) { if (self->client->resp.last_damaged_players[0] == '\0') strcpy(buf, "nobody"); else Q_strncpyz(buf, self->client->resp.last_damaged_players, PARSE_BUFSIZE); self->client->resp.last_damaged_players[0] = '\0'; }
false
false
false
false
false
0
PrintDataTo(StringStream* stream) { LGap::PrintDataTo(stream); LLabel* rep = replacement(); if (rep != NULL) { stream->Add(" Dead block replaced with B%d", rep->block_id()); } }
false
false
false
false
false
0
acl_fetch_srv_id(struct proxy *px, struct session *l4, void *l7, int dir, struct acl_expr *expr, struct acl_test *test) { if (!l4->srv) return 0; test->flags = ACL_TEST_F_READ_ONLY; test->i = l4->srv->puid; return 1; }
false
false
false
false
false
0
e_mail_signature_editor_commit (EMailSignatureEditor *editor, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *simple; AsyncContext *async_context; ESourceMailSignature *e...
false
false
false
false
false
0
md5Digest( const char *token ) { md5_state_t md5state; unsigned char md5pword[16]; md5_init( &md5state ); md5_append( &md5state, (unsigned const char *)token, (int)strlen( token ) ); md5_finish( &md5state, md5pword ); char tmp[33]; strncpy( tmp, "\0", sizeof(tmp) ); for ( int j = 0; j ...
false
false
false
false
false
0
write_generic_handle_routines(FILE *header) { generic_handle_t *gh; LIST_FOR_EACH_ENTRY(gh, &generic_handle_list, generic_handle_t, entry) { const char *name = gh->name; fprintf(header, "handle_t __RPC_USER %s_bind(%s);\n", name, name); fprintf(header, "void __RPC_USER %s_unbind(%s, handle_t);\n", nam...
false
false
false
false
false
0
irmo_iterator_next(IrmoIterator *iter) { void *result; if (iter->status == ITERATOR_INIT) { irmo_iterator_advance(iter); } if (iter->status == ITERATOR_FINISHED) { // Have iterated over the entire set. result = NULL; } else { ...
false
false
false
false
false
0
embHitlistReadNodeFasta(AjPFile inf, const AjPStr fam, const AjPStr sfam, const AjPStr fold, const AjPStr klass) { AjPList ret = NULL; const AjPStr class = NULL; class = klass; if(!inf) ajFatal("NULL arg passed to embHitlistReadNodeFasta"); /* Allocate the list if it does n...
false
false
false
false
false
0
tx_start(SLMP_INFO *info) { if (debug_level >= DEBUG_LEVEL_ISR) printk("%s(%d):%s tx_start() tx_count=%d\n", __FILE__,__LINE__, info->device_name,info->tx_count ); if (!info->tx_enabled ) { write_reg(info, CMD, TXRESET); write_reg(info, CMD, TXENABLE); info->tx_enabled = true; } if ( info->tx_count ) ...
false
false
false
false
false
0
key_set_timeout(struct key *key, unsigned timeout) { struct timespec now; time_t expiry = 0; /* make the changes with the locks held to prevent races */ down_write(&key->sem); if (timeout > 0) { now = current_kernel_time(); expiry = now.tv_sec + timeout; } key->expiry = expiry; key_schedule_gc(key->expir...
false
false
false
false
false
0
flushCxnCbk (TimeoutId id, void *data) { Connection cxn = (Connection) data ; ASSERT (id == cxn->flushTimerId) ; VALIDATE_CONNECTION (cxn) ; cxn->flushTimerId = 0 ; if (!(cxn->state == cxnFeedingS || cxn->state == cxnConnectingS || cxn->state == cxnIdleS)) { syslog (LOG_ERR,CXN_BAD_STATE,...
false
false
false
false
false
0
Gif_GetNamedImage(Gif_Stream *gfs, const char *name) { int i; if (!name) return gfs->nimages ? gfs->images[0] : 0; for (i = 0; i < gfs->nimages; i++) if (gfs->images[i]->identifier && strcmp(gfs->images[i]->identifier, name) == 0) return gfs->images[i]; return 0; }
false
false
false
false
false
0
posix_runtime_query(mca_base_module_t **module, int *priority, const char *hint) { char tmp_buff[OPAL_SHMEM_POSIX_FILE_LEN_MAX]; int fd = -1; *priority = 0; *module = NULL; /* if hint isn't null, then someone else already figured out who is the * best r...
false
false
false
false
false
0
Java_sun_misc_Version_getJvmVersionInfo(JNIEnv *env, jclass cls) { jvm_version_info info; GetJvmVersionInfo_fp func_p; if (!JDK_InitJvmHandle()) { JNU_ThrowInternalError(env, "Handle for JVM not found for symbol lookup"); } func_p = (GetJvmVersionInfo_fp) JDK_FindJvmEntry("JVM_GetVersionInf...
false
false
false
false
false
0
value(std::string key) { for (int i = 0; i < keys.size(); i++) { if (keys[i] == key) return values[i]; } std::stringstream fail; fail << "Key '" << key << "' not found."; return fail.str(); }
false
false
false
false
false
0
pxe_close_file(struct file *file) { struct inode *inode = file->inode; struct pxe_pvt_inode *socket = PVT(inode); if (!socket->tftp_goteof) { #if GPXE if (socket->tftp_localport == 0xffff) { gpxe_close_file(inode); } else #endif if (socket->tftp_localport != 0) { tftp_error(inode, 0, "No error...
false
false
false
false
false
0
smug_read_images(struct session *session, struct album *album) { char url[1000]; struct smug_curl_buffer *curl_buf; CURL *curl = NULL; CURLcode res; int retval; if (!session) return -EINVAL; curl_buf = smug_curl_buffer_alloc(); if (!curl_buf) return -ENOMEM; curl = curl_init(); if (!curl) return -EIN...
false
false
false
false
false
0
perform_block_operation_on_part_of_sequence(ED4_blockoperation block_operation, ED4_sequence_terminal *term, int repeat) { GBDATA *gbd = term->get_species_pointer(); GB_ERROR error = 0; if (gbd) { char *seq = GB_read_string(gbd); int len = GB_read_string_count(gbd); if (range_col1>...
false
false
false
false
false
0
GetOption(const wxString& name, int *value ) const { long n; if (GetOption(name).ToLong(&n)) { *value = (int)n; return true; } return false; }
false
false
false
false
false
0
construct_eigrp_request(struct in_addr *dd, u_int32_t autosys, int *psize) { u_char *tpacket; iphdr_t *iph; eigrp_t *eigrph; eigrppara_t *epara; eigrpsoft_t *esoft; u_int16_t cs; /* checksum */ char all_igrp[]="224.0.0.10"; *psize=sizeof(iphdr_t)+sizeof(eigrp_t) +size...
false
false
false
false
false
0
ntb_signal_emit(struct ntb_signal *signal, void *data) { struct ntb_listener *l, *next; ntb_list_for_each_safe(l, next, &signal->listener_list, link) if (!l->notify(l, data)) return false; return true; }
false
false
false
false
false
0
set_mt_num(Block *bpt, int num) { while (bpt != NULL) { if (bpt->inner != NULL) set_mt_num(bpt->inner, 0); num++; bpt->no = num; bpt = bpt->next; } }
false
false
false
false
false
0
check_self_atari(int pos, int color_to_move) { #if 1 int lib; #endif if (!is_self_atari(pos, color_to_move)) return 1; if (is_ko(pos, color_to_move, NULL)) return 1; #if 1 /* FIXME: At some time I added this exceptional case but I can no * longer see how it would be useful. It might still be, ho...
false
false
false
false
false
0
report_print_standard_section(const seaudit_log_t * log, const seaudit_report_t * report, xmlChar * id, xmlChar * title, FILE * outfile) { size_t sz, len, i; int rt = 0; if (!report_is_valid_section_name((char *)id)) { ERR(log, "%s", "Invalid standard section ID."); errno = EINVAL; return -1; } sz = s...
false
false
false
false
false
0
SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) { #if (PY_VERSION_HEX >= 0x02020000) PyObject *inst = 0; PyObject *newraw = data->newraw; if (newraw) { inst = PyObject_Call(newraw, data->newargs, NULL); if (inst) { #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS) PyObject **dict...
false
false
false
false
false
0
sigsegvHandler(int sig, siginfo_t *info, void *secret) { void *trace[100]; char **messages = NULL; int i, trace_size = 0; ucontext_t *uc = (ucontext_t*) secret; sds infostring; struct sigaction act; REDIS_NOTUSED(info); redisLog(REDIS_WARNING, "======= Ooops! Redis %s got signal...
false
false
false
false
false
0
ffile_copy_simple(int src_fd, int dest_fd) { size_t cpylen = 0; while (1) { ssize_t rdlen, wrlen; char buff[MAX_BUFF_LEN]; rdlen = read(src_fd, buff, sizeof(buff)); if (rdlen <= 0) { if (rdlen == 0) { break; } pr_error_info("read"); return rdlen; } wrlen = ffile_write(dest_fd, bu...
false
false
false
false
false
0
varpde(noeudPtr s) { int i,j,k, iloc, jloc; creal a[36], b[6]; //N<3 __fem->initvarmat ( ihowsyst, flag.complexe, N, &param); for(k=0;k<__mesh.getNumberOfPoints();k++) for(i=0;i<2*N;i++) systable[i]->table[k] = 0; for(k=0;k<__mesh.getNumberOfCells();k++) { flag.solv = 2+k; //used by al...
false
false
false
false
false
0
normalizedFormUid(const QString &formUid) { QString newUid = formUid; newUid.replace("\\", "/"); if (newUid.endsWith(".xml")) { newUid = newUid.left(newUid.lastIndexOf("/")); } return newUid; }
false
false
false
false
false
0
Cmd_Players_f (edict_t *ent) { int i; int count; char small[64]; char large[1280]; int index[256]; count = 0; for (i = 0 ; i < maxclients->value ; i++) if (game.clients[i].pers.connected) { index[count] = i; count++; } // sort by frags qsort (index, count, sizeof(index[0]), PlayerSort); // p...
false
false
false
false
false
0
TraverseArc2D(GF_Node *node, void *rs, Bool is_destroy) { DrawableContext *ctx; Drawable *stack = (Drawable *)gf_node_get_private(node); GF_TraverseState *tr_state = (GF_TraverseState *)rs; if (is_destroy) { drawable_node_del(node); return; } arc2d_check_changes(node, stack, tr_state); switch (tr_state->tr...
false
false
false
false
false
0
cb_search_compare(GtkTreeModel *model, gint column, const gchar *key, GtkTreeIter *iter, gpointer user) { const gchar *dname = dp_row_get_name_display(model, (DirRow2*) iter); if(dname != NULL) { if(the_isearch_info.offset_use) { const gsize len = g_utf8_strlen(dname, -1); if(the_isearch_info.offset < len...
false
false
false
false
false
0
snd_hdac_power_up_pm(struct hdac_device *codec) { if (!atomic_inc_not_zero(&codec->in_pm)) return snd_hdac_power_up(codec); return 0; }
false
false
false
false
false
0
utf8_decode_fwrd(unsigned char **p,int *plen) { struct utf8_sm sm; unsigned char *s = *p; int len; int c = -2; /* Return this on no more input. */ if (plen) len = *plen; else len = -1; utf8_init(&sm); while (len) { c = utf8_decode(&sm, *s); if (c >= 0) { /* We've got a character */ --len; ++s...
true
true
false
false
true
1
xsh_bpmap_collapse_median(cpl_image* median, cpl_imagelist * list, cpl_mask * bpmap) { int nx, ny, nimg, i; cpl_image **pimg = NULL; cpl_vector *pixvector = NULL; double* data = NULL; cpl_binary* mask_data = NULL; int ix, iy, k; XSH_ASSURE_NOT_NULL(median); XSH_ASSURE_NOT_NULL(list); XSH_ASSURE_N...
false
false
false
false
false
0
ipxcp_script(fsm *f,char *script) { int linkunit = f->unit; int unit = lns[linkunit].ipxcp_unit; ipxcp_options *ho = &ipxcp_hisoptions[unit]; ipxcp_options *go = &ipxcp_gotoptions[unit]; char strspeed[32], strlocal[32], strremote[32]; char strnetwork[32], strpid[32]; char *argv[14]; char strproto_lcl[32],...
true
true
false
false
false
1
on_key_release_event(GtkWidget *widget, GdkEventKey *ev, gpointer user_data) { /* user may have rebound keybinding to a different modifier than Ctrl, so check all */ if (switch_in_progress && is_modifier_key(ev->keyval)) { GeanyDocument *doc; switch_in_progress = FALSE; if (switch_dialog) { gtk_widget_d...
false
false
false
false
false
0
gmpc_test_plugin_real_tool_menu_integration (GmpcPluginToolMenuIface* base, GtkMenu* menu) { GmpcTestPlugin * self; gint result = 0; const gchar* _tmp0_ = NULL; GtkMenuItem* _tmp1_; GtkMenuItem* _tmp2_; GtkMenuItem* item; GtkMenu* _tmp3_; self = (GmpcTestPlugin*) base; g_return_val_if_fail (menu != NULL, 0); ...
false
false
false
false
false
0
sh_number_of_writes_needed (unsigned char *write_needed, int child_count) { int writes = 0; int i = 0; for (i = 0; i < child_count; i++) { if (write_needed[i]) writes++; } return writes; }
false
false
false
false
false
0
getdelim_(S *s,I *n,I d,FILE *f) { I m; S z; if(getdelim(s,n,d,f)==-1){*n=0; R -1;} m=strlenn(*s,*n); z=strdupn(*s,m); free(*s); *s=z; R *n=m; }
false
false
false
false
false
0
atk_value_get_type (void) { static GType type = 0; if (!type) { GTypeInfo tinfo = { sizeof (AtkValueIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, }; type = g_type_register_static (G_TYPE_INTERFACE, "AtkValue", &tinfo, 0); } return type; }
false
false
false
false
false
0
git_stash_foreach( git_repository *repo, stash_cb callback, void *payload) { git_reference *stash; git_reflog *reflog = NULL; int error; size_t i, max; const git_reflog_entry *entry; error = git_reference_lookup(&stash, repo, GIT_REFS_STASH_FILE); if (error == GIT_ENOTFOUND) return 0; if (error < 0) go...
false
false
false
false
false
0
BeginReplay( List &backup, Map *map ) { List &gam_units = Gam->GetMission()->GetUnits(); Unit *u; while ( !gam_units.IsEmpty() ) { u = static_cast<Unit *>( gam_units.RemHead() ); backup.AddTail( u ); if ( !u->IsSheltered() ) map->SetUnit( NULL, u->Position() ); } Unit *next = NULL; for ( u = s...
false
false
false
false
false
0
addrharvest_parse_address( AddressHarvester *harvester, HeaderEntry *entry, AddressCache *cache, const gchar *hdrBuf ) { gchar buffer[ ADDR_BUFFSIZE + 2 ]; const gchar *bp; const gchar *ep; gchar *atCh, *email, *name; gint bufLen; /* Search for an address */ while((atCh = addrharvest_find_at( hdrBuf )) != N...
false
false
false
false
false
0
ladish_exit(struct cdbus_method_call * call_ptr) { log_info("Exit command received through D-Bus"); if (!ladish_command_exit(NULL, ladish_studio_get_cmd_queue())) { /* if queuing of command failed, force exit anyway, JACK server will be left started, but refusing exit command is worse */ g_quit...
false
false
false
false
false
0
store_initable_init (GInitable *initable, GCancellable *cancellable, GError **error) { CamelStore *store; CamelService *service; const gchar *user_dir; gchar *filename; store = CAMEL_STORE (initable); /* Chain up to parent interface's init() method. */ if (!parent_init...
false
false
false
false
false
0
F_unless(struct alisp_instance *instance, struct alisp_object * args) { struct alisp_object * p1, * p2; p1 = car(args); p2 = cdr(args); delete_object(instance, args); if ((p1 = eval(instance, p1)) == &alsa_lisp_nil) { return F_progn(instance, p2); } else { delete_tree(instance, p1); delete_tree(instance, p...
false
false
false
false
false
0
zend_do_while_end(const znode *while_token, const znode *close_bracket_token TSRMLS_DC) /* {{{ */ { zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); /* add unconditional jump */ opline->opcode = ZEND_JMP; opline->op1.u.opline_num = while_token->u.opline_num; SET_UNUSED(opline->op1); SET_UNUSED(oplin...
false
false
false
false
false
0
espopen (pazargs, frd, pipid) const char **pazargs; boolean frd; pid_t *pipid; { int aidescs[3]; pid_t ipid; FILE *eret; if (frd) { aidescs[0] = SPAWN_NULL; aidescs[1] = SPAWN_READ_PIPE; } else { aidescs[0] = SPAWN_WRITE_PIPE; aidescs[1] = SPAWN_NULL; } ...
false
false
false
false
false
0
qcow_write_compressed(BlockDriverState *bs, int64_t sector_num, const uint8_t *buf, int nb_sectors) { BDRVQcowState *s = bs->opaque; z_stream strm; int ret, out_len; uint8_t *out_buf; uint64_t cluster_offset; if (nb_sectors == 0) { /* align end of file t...
false
false
false
false
false
0
possible_click( GtkTreeView *treeview GCC_UNUSED, GtkTreePath *path, GtkTreeViewColumn *col GCC_UNUSED, gpointer user_data GCC_UNUSED ) { int error, *indices, row; /* Get selected row via double-clicks or keyboard */ indices = gtk_tree_path_get_indices( path ); if( !indices ) re...
false
false
false
false
false
0
FindFreeHandle() { unsigned int i; static unsigned int sequence = 0; for(i=0; i<nSOCKET_LINKS; i++) if(links[i] == 0) return i | (++sequence << 16); return 0xffff; }
false
false
false
false
false
0
add_item_cb (PluginHandle * plugin, GtkWidget * menu) { GtkWidget * item = gtk_check_menu_item_new_with_label (aud_plugin_get_name (plugin)); gtk_check_menu_item_set_active ((GtkCheckMenuItem *) item, aud_plugin_get_enabled (plugin)); gtk_menu_shell_append ((GtkMenuShell *) menu, item); aud_pl...
false
false
false
false
false
0
NET_ReadWaitData(net_packet_t *packet, net_waitdata_t *data) { int i; char *s; if (!NET_ReadInt8(packet, (unsigned int *) &data->num_players) || !NET_ReadInt8(packet, (unsigned int *) &data->num_drones) || !NET_ReadInt8(packet, (unsigned int *) &data->ready_players) || !NET_ReadInt8(packet, ...
false
true
false
false
false
1
parse_get_line(char *lineout, int max_line_len, char *start, int max_size, char *cur) { char * t = lineout; int i, num_chars_read=0; char c; for ( i = 0; i < max_line_len-1; i++ ) { do { if ( (cur - start) >= max_size ) { *lineout = 0; if ( lineout > t ) { return num_chars_read; } else { ...
false
false
false
false
false
0
panel_round (const DATASET *dset, int t, int code) { if (code == SMPL_T1) { while ((t + 1) % dset->pd != 1) { t++; } } else { while ((t + 1) % dset->pd != 0) { t--; } } return t; }
false
false
false
false
false
0
drawFieldValue(void) { if (frozen()==MSFalse&&owner()->mapped()==MSTrue&&mapped()==MSTrue) { int sht=fieldValue()->shadowThickness(); XFillRectangle(display(),window(),backgroundShadowGC(), fieldValue()->x()+sht,fieldValue()->y()+sht, fieldValue()->width()-(sht<<1),fieldValue()->height()-(sht...
false
false
false
false
false
0
radeon_uvd_calc_upll_dividers(struct radeon_device *rdev, unsigned vclk, unsigned dclk, unsigned vco_min, unsigned vco_max, unsigned fb_factor, unsigned fb_mask, unsigned pd_min, unsigned pd_max, unsigned pd_even, unsigned *optimal_fb_div, unsigned *optimal_vclk_div, unsi...
false
false
false
false
false
0
updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState) { if (!targetWidget()) { return; } if (oldState == Stopped && newState == Running) { if (!m_under.data() || m_under.data()->target() != targetWidget() || m_under.data()->size() != targetWidget()->size()) { ...
false
false
false
false
false
0
RecycleLines() { if (ffline == NULL) return; /* nothing to do */ ChkErrorLines(); /* ChkWindowLines(); -- nothing needs attention */ /* ChkBufLines(); -- nothing needs attention */ if (faline == NULL) { faline = ffline; } else { LinePtr laline = lastline(faline); laline->l_next = ffline; ffline->l_pr...
false
false
false
false
false
0
WebPINewDecoder(WebPDecBuffer* output_buffer) { WebPIDecoder* idec = (WebPIDecoder*)calloc(1, sizeof(*idec)); if (idec == NULL) { return NULL; } idec->state_ = STATE_WEBP_HEADER; idec->chunk_size_ = 0; InitMemBuffer(&idec->mem_); WebPInitDecBuffer(&idec->output_); VP8InitIo(&idec->io_); WebPRes...
false
false
false
false
false
0
lower_sequence (gimple_seq *seq, struct lower_data *data) { gimple_stmt_iterator gsi; for (gsi = gsi_start (*seq); !gsi_end_p (gsi); ) lower_stmt (&gsi, data); }
false
false
false
false
false
0
do_onepass_sig( IOBUF out, int ctb, PKT_onepass_sig *ops ) { int rc = 0; IOBUF a = iobuf_temp(); write_version( a, ctb ); iobuf_put(a, ops->sig_class ); iobuf_put(a, ops->digest_algo ); iobuf_put(a, ops->pubkey_algo ); write_32(a, ops->keyid[0] ); write_32(a, ops->keyid[1] ); iobuf_...
false
false
false
false
false
0
sheet_widget_radio_button_init_full (SheetWidgetRadioButton *swrb, GnmCellRef const *ref, char const *label, GnmValue const *value, gboolean active) { g_return_if_fail (swrb != NULL); swrb->being_updated = FALSE; swrb->label = g_strdup (label ? label : _("RadioButton")); swrb->v...
false
false
false
false
false
0
rtl8188eu_set_hal_ops(struct adapter *adapt) { struct hal_ops *halfunc = &adapt->HalFunc; adapt->HalData = kzalloc(sizeof(struct hal_data_8188e), GFP_KERNEL); if (adapt->HalData == NULL) DBG_88E("cant not alloc memory for HAL DATA\n"); halfunc->hal_power_on = rtl8188eu_InitPowerOn; halfunc->hal_init = &rtl818...
false
false
false
false
false
0
textblock_vappend_c(textblock *tb, byte attr, const char *fmt, va_list vp) { size_t temp_len = TEXTBLOCK_LEN_INITIAL; char *temp_space = mem_zalloc(temp_len); size_t remaining = tb->size - tb->strlen; size_t new_length; /* We have to format the incoming string in native (external) format * re-allocating the t...
false
false
false
false
false
0
free_curve_list (curve_list_type *curve_list) { unsigned this_curve; for (this_curve = 0; this_curve < curve_list->length; this_curve++) { free_curve (curve_list->data[this_curve]); free (curve_list->data[this_curve]); } /* If the character was empty, it won't have any curves. */ if (curv...
false
false
false
false
false
0
do_preprocessed( void) /* * The source file has been already preprocessed. * Copy the lines to output. * Install macros according the #define directives. */ { const char * corrupted = "This preprocessed file is corrupted"; /* _F_ */ FILEINFO * file; char * lbuf; ...
false
false
false
false
false
0
netxen_init_msix_entries(struct netxen_adapter *adapter, int count) { int i; for (i = 0; i < count; i++) adapter->msix_entries[i].entry = i; }
false
false
false
false
false
0
next_tgid(struct pid_namespace *ns, struct tgid_iter iter) { struct pid *pid; if (iter.task) put_task_struct(iter.task); rcu_read_lock(); retry: iter.task = NULL; pid = find_ge_pid(iter.tgid, ns); if (pid) { iter.tgid = pid_nr_ns(pid, ns); iter.task = pid_task(pid, PIDTYPE_PID); /* What we to know is if ...
false
false
false
false
false
0
check_modem_rate(enum ast_fax_modems modems, unsigned int rate) { switch (rate) { case 2400: if (!(modems & (AST_FAX_MODEM_V27 | AST_FAX_MODEM_V34))) { return 1; } break; case 4800: if (!(modems & (AST_FAX_MODEM_V27 | AST_FAX_MODEM_V34))) { return 1; } break; case 7200: case 9600: if (!(modems ...
false
false
false
false
false
0
nfs_access_search_rbtree(struct inode *inode, struct rpc_cred *cred) { struct rb_node *n = NFS_I(inode)->access_cache.rb_node; struct nfs_access_entry *entry; while (n != NULL) { entry = rb_entry(n, struct nfs_access_entry, rb_node); if (cred < entry->cred) n = n->rb_left; else if (cred > entry->cred) ...
false
false
false
false
false
0
exh_cpl_command_list(char *prefix) { int i, j; int plen = strlen(prefix); char **list; for (i = 0, j = 0; exh_commands[i].cmd_name; ++i) { if (!strncmp(exh_commands[i].cmd_name, prefix, plen)) ++j; if (exh_commands[i].cmd_name[0] != exh_commands[i].cmd_char && exh_commands[i].cmd_char &...
false
false
false
false
false
0
driver_open_device( CoreInputDevice *device, unsigned int number, InputDeviceInfo *info, void **driver_data ) { int fd; int mouseId = -1; int flags; PS2MouseData *data; /* open device */...
false
false
false
false
false
0
wq_get_first_waiter( struct mqueue_inode_info *info, int sr) { struct list_head *ptr; ptr = info->e_wait_q[sr].list.prev; if (ptr == &info->e_wait_q[sr].list) return NULL; return list_entry(ptr, struct ext_wait_queue, list); }
false
false
false
false
false
0
add_connection_data(struct connection *pconn, const unsigned char *data, int len) { struct socket_packet_buffer *buf; if (NULL == pconn || !pconn->used || (is_server() && pconn->server.is_closing)) { return TRUE; } buf = pconn->send_buffer; log_debug("add %d b...
false
true
false
false
false
1
cmd_set(char **arg) { char *reg_text = get_arg(arg); char *val_text = get_arg(arg); int reg; address_t value = 0; address_t regs[DEVICE_NUM_REGS]; if (!(reg_text && val_text)) { printc_err("set: must specify a register and a value\n"); return -1; } reg = dis_reg_from_name(reg_text); if (reg < 0) { prin...
false
false
false
false
false
0
finish() { //save our size before padding getBitCount(); // Pad with a binary 1 (0x80) update(0x80); //append 0's to make a 56-byte buf. while ((nrBytes & 63) != 56) update(0); //##### Append length in bits appendBitCount(); // Output hash std::vector<unsigned char...
false
false
false
false
false
0
ay_check_release(GtkWidget *widget, gpointer userdata) { int is_auto = GPOINTER_TO_INT(userdata); char *version = ay_get_last_version(); if (version) { eb_debug(DBG_CORE, "Last version: %s\n", version); ay_compare_version(version, !is_auto); free(version); } }
false
false
false
false
false
0
selectAddrRegReg(SDValue Addr, SDValue &Base, SDValue &Offset) const { // Operand is a result from an ADD. if (Addr.getOpcode() == ISD::ADD) { Base = Addr.getOperand(0); Offset = Addr.getOperand(1); return true; } return false; }
false
false
false
false
false
0
initialize_res_quotas(struct mlx4_dev *dev, struct resource_allocator *res_alloc, enum mlx4_resource res_type, int vf, int num_instances) { res_alloc->guaranteed[vf] = num_instances / (2 * (dev->persist->num_vfs + 1)); res_alloc->quota[vf] = (num_instances / 2) + res_alloc->guaranteed[vf]; ...
false
false
false
false
false
0
__ocfs2_wait_on_mount(struct ocfs2_super *osb, int quota) { /* This check is good because ocfs2 will wait on our recovery * thread before changing it to something other than MOUNTED * or DISABLED. */ wait_event(osb->osb_mount_event, (!quota && atomic_read(&osb->vol_state) == VOLUME_MOUNTED) || atomic_rea...
false
false
false
false
false
0
ctcl_leap_month(int y) { char leap=lunarstr.mid(y-beginning_year,2).at(0); if(leap=='a') leap='0'+10; if(leap=='b') leap='0'+11; if(leap=='c') leap='0'+12; return leap-'0'; }
false
false
false
false
false
0
kvm_update_dr6(struct kvm_vcpu *vcpu) { if (!(vcpu->guest_debug & KVM_GUESTDBG_USE_HW_BP)) kvm_x86_ops->set_dr6(vcpu, vcpu->arch.dr6); }
false
false
false
false
false
0
pilCdbDumpGroup(PilCdbGroup *db_group, FILE *file) { PilCdbEntry *db_entry; PilCdbValue *db_data; char *db_key; PilDictionary *entries; if (!db_group || !file) return EXIT_FAILURE; /* * If there are no entries in this group nothing has to be written to * the output stream. */ if (!(entri...
false
false
false
false
false
0
operator- (Value::vector &v1, Value::vector &v2) { // set difference Value::vector result ; Value::vector common = v1 & v2 ; // get all common elements for (Value::vector::iterator i = v1.begin() ; i != v1.end() ; i++) { Value::vector::iterator j ; for (j = common.begin() ; j != common.en...
false
false
false
false
false
0
find_per_thread_rwlock_class_wait_stat(PFS_thread *thread, PFS_rwlock_class *klass) { PFS_single_stat_chain *stat; uint index; DBUG_ASSERT(thread != NULL); DBUG_ASSERT(klass != NULL); index= klass->m_index; DBUG_ASSERT(index < rwlock_class_max); stat= &(thread->m_i...
false
false
false
false
false
0
print_marked_com_elts(ComListElement *r_list, int r_num) #else /* K&R style */ print_marked_com_elts(r_list, r_num) ComListElement *r_list; /* list of elements, some marked */ int r_num; /* number of elements in whole list */ #endif /* HAVE_STDC */ { int i; COLNO_t col; for (i=0,col=78; i<r_num; i...
false
false
false
false
false
0
rgb_to_intn_px( const comp_t *comp_ln, const struct info_s *info ) { const float COMP_WEIGHT_BGR[] = {_COMP_WEIGHT_B_, _COMP_WEIGHT_G_, _COMP_WEIGHT_R_}; // sc_defi.h comp_t rgba = *comp_ln; float ipx = 0; for (int k = 0; k < CHANNELS_RGB; k++) { ipx += (float)(rgba & BITMASK_RGB) * COMP_WEIGHT_BGR[k]; rgba ...
false
false
false
false
false
0
log_count_print (Node *p, void *closure) { struct log_data_and_rcs *data = closure; Node *pv; pv = findnode (data->rcs->versions, p->key); if (pv == NULL) error (1, 0, "missing version `%s' in RCS file `%s'", p->key, data->rcs->print_path); if (log_version_requested (data->log_data, data->...
false
false
false
false
false
0
wl1271_cmd_test(struct wl1271 *wl, void *buf, size_t buf_len, u8 answer) { int ret; size_t res_len = 0; wl1271_debug(DEBUG_CMD, "cmd test"); if (answer) res_len = buf_len; ret = wl1271_cmd_send(wl, CMD_TEST, buf, buf_len, res_len); if (ret < 0) { wl1271_warning("TEST command failed"); return ret; } r...
false
false
false
false
false
0
guide_next() { guide_step++; while(guide_step<guide_tot_steps && ( ( pane_text[2*guide_step][0] == ':' && sp->max_wins==1 ) || ( pane_text[2*guide_step][0] == ';' && sp->max_wins> 1 ) )) guide_step++; }
false
false
false
false
false
0
FlushBlockBuf() { CPLErr eErr = CE_None; if( nLoadedBlock < 0 || !bLoadedBlockDirty ) return CE_None; bLoadedBlockDirty = FALSE; if (!SetDirectory()) return CE_Failure; eErr = WriteEncodedTileOrStrip(nLoadedBlock, pabyBlockBuf, TRUE); if (eErr != CE_None) { ...
false
false
false
false
false
0
apdu_disconnect (int slot) { int sw; if (slot < 0 || slot >= MAX_READER || !reader_table[slot].used ) return SW_HOST_NO_DRIVER; if (reader_table[slot].disconnect_card) { sw = lock_slot (slot); if (!sw) { sw = reader_table[slot].disconnect_card (slot); unlock_slot ...
false
false
false
false
false
0
vrrp_print(register const u_char *bp, register u_int len, int ttl) { int version, type, auth_type; const char *type_s; TCHECK(bp[0]); version = (bp[0] & 0xf0) >> 4; type = bp[0] & 0x0f; type_s = tok2str(type2str, "unknown type (%u)", type); printf("VRRPv%u, %s", version, type_s); if (ttl != 255) printf(", (t...
false
false
false
false
false
0
e_attachment_store_get_attachments (EAttachmentStore *store) { GList *list = NULL; GtkTreeModel *model; GtkTreeIter iter; gboolean valid; g_return_val_if_fail (E_IS_ATTACHMENT_STORE (store), NULL); model = GTK_TREE_MODEL (store); valid = gtk_tree_model_get_iter_first (model, &iter); while (valid) { EAttach...
false
false
false
false
false
0
silent_fmt_hits(AjPList hits, AjPFeattable feat, AjBool silent) { PSilent res; AjPFeature sf = NULL; AjPStr tmpFeatStr = NULL; ajListSort(hits,silent_basecompare); while(ajListPop(hits,(void **)&res)) { sf = ajFeatNewII(feat, res->match, res->match+ajStr...
false
false
false
false
false
0
gtkaml_namespace_visitor_real_visit_using_directive (ValaCodeVisitor* base, ValaUsingDirective* ns_ref) { GtkamlNamespaceVisitor * self; ValaList* _tmp0_; ValaUsingDirective* _tmp1_; self = (GtkamlNamespaceVisitor*) base; g_return_if_fail (ns_ref != NULL); _tmp0_ = self->priv->using_directives; _tmp1_ = ns_ref; ...
false
false
false
false
false
0
gamgi_engine_link_object_layer (gamgi_object *object, gamgi_layer *layer) { /******************************* * bonds have no layer parents * *******************************/ switch (object->class) { case GAMGI_ENGINE_TEXT: gamgi_engine_link_text_layer (GAMGI_CAST_TEXT object, layer); break; case GAMGI_ENG...
false
false
false
false
false
0
print_kprobe_event(struct trace_iterator *iter, int flags, struct trace_event *event) { struct kprobe_trace_entry_head *field; struct trace_seq *s = &iter->seq; struct trace_probe *tp; u8 *data; int i; field = (struct kprobe_trace_entry_head *)iter->ent; tp = container_of(event, struct trace_probe, call.ev...
false
false
false
false
false
0