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
fs_rtp_bitrate_adapter_query (GstPad *pad, GstObject *parent, GstQuery *query) { FsRtpBitrateAdapter *self = FS_RTP_BITRATE_ADAPTER (parent); gboolean res; switch (GST_QUERY_TYPE (query)) { case GST_QUERY_CAPS: { GstCaps *caps, *filter; gst_query_parse_caps (query, &filter); caps = fs_...
false
false
false
false
false
0
inf_text_default_buffer_buffer_insert_text(InfTextBuffer* buffer, guint pos, InfTextChunk* chunk, InfUser* user) { InfTextDefaultBufferPrivate* priv; priv = INF_TEXT_DEFAULT_BUFFER_PRIVAT...
false
false
false
false
false
0
Devices_UpdateHATABSEntry(char device, UWORD entry_address, UWORD table_address) { UWORD address; if (entry_address != 0 && MEMORY_dGetByte(entry_address) == device) return entry_address; if (MEMORY_dGetByte(HATABS) != 'P' || MEMORY_dGetByte(HATABS + 3) != 'C' || MEMORY_dGetByte(HATABS + 6) != 'E' || M...
false
false
false
false
false
0
Ns_IndexFindMultiple(Ns_Index *indexPtr, void *key) { void **firstPtrPtr; void **retPtrPtr; int i; int n; /* * Find a place in the array that matches the key */ firstPtrPtr = (void **) bsearch(key, indexPtr->el, (size_t)indexPtr->n, sizeof(void *), indexPtr->CmpKeyW...
false
true
false
false
true
1
showRoutes(const QList<GpxRoute> &routes) { QStringList scriptStr; int i=0; foreach(const GpxRoute &rt, routes) { scriptStr << QString("rtes[%1].%2();").arg(i).arg(rt.getVisible()?"show":"hide"); i++; } evaluateJS(scriptStr); }
false
false
false
false
false
0
createProfile( const gchar *pnName, const gchar *pnFile ) { struct sProfile *psProfile; psProfile = g_malloc0( sizeof( struct sProfile ) ); if ( psProfile != NULL ) { psProfile -> pnName = g_strdup( pnName ); if ( pnFile == NULL ) { gchar *pnTmp = g_strdup_printf( "%s/%s", getProfilesDir(), pnName ); g_m...
false
false
false
false
false
0
dvdread(unsigned long sector,unsigned char *buf,int N) { int x; if (!map->get(sector)) return 0; if (dvd->seek(SECTOFS(sector)) != SECTOFS(sector)) return 0; for (x=1;x < N && map->get(sector+x);) x++; N = dvd->read(buf,x * 2048) >> 11; if (N < 0) N = 0; return N; }
false
false
false
false
false
0
restore_parse_state(struct parse *cfile) { struct parse *saved_state; if (cfile->saved_state == NULL) { return DHCP_R_NOTYET; } saved_state = cfile->saved_state; memcpy(cfile, saved_state, sizeof(*cfile)); cfile->saved_state = saved_state; return ISC_R_SUCCESS; }
false
false
false
false
false
0
sort_string(GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer userdata) { gchar *name1, *name2; gint ret = 0; gint colnum = GPOINTER_TO_INT(userdata); gtk_tree_model_get(model, a, colnum, &name1, -1); gtk_tree_model_get(model, b, colnum, &name2, -1); if (!name1 || !name2) { ...
false
false
false
false
false
0
vb2_dc_vaddr(void *buf_priv) { struct vb2_dc_buf *buf = buf_priv; if (!buf->vaddr && buf->db_attach) buf->vaddr = dma_buf_vmap(buf->db_attach->dmabuf); return buf->vaddr; }
false
false
false
false
false
0
operator()(int m, int n) { REPORT int w = lower_val+1; int i = lower_val+n-m; if (m<=0 || m>nrows_val || n<=0 || n>ncols_val || i<0 || i>=w) Throw(IndexException(m,n,*this)); return store[w*(m-1)+i]; }
false
false
false
false
false
0
test_core_env__cleanup(void) { int i; char **val; for (i = 0; i < NUM_VARS; ++i) { cl_setenv(env_vars[i], env_save[i]); git__free(env_save[i]); env_save[i] = NULL; } /* these will probably have already been cleaned up, but if a test * fails, then it's probably good to try and clear out these dirs */ f...
false
false
false
false
false
0
WebPCleanupTransparentArea(WebPPicture* pic) { int x, y, w, h; if (pic == NULL) return; w = pic->width / SIZE; h = pic->height / SIZE; // note: we ignore the left-overs on right/bottom if (pic->use_argb) { uint32_t argb_value = 0; for (y = 0; y < h; ++y) { int need_reset = 1; for (x = 0...
false
false
false
false
false
0
removeWindow(FluxboxWindow *w, bool still_alive) { if (w == 0) return -1; // if w is focused and alive, remove the focus ... except if it // is a transient window. removing the focus from such a window // leads in a wild race between BScreen::reassociateWindow(), // BScreen::changeWorkspac...
false
false
false
false
false
0
trinity_dpm_display_configuration_changed(struct radeon_device *rdev) { struct trinity_power_info *pi = trinity_get_pi(rdev); if (pi->voltage_drop_in_dce) trinity_dce_enable_voltage_adjustment(rdev, true); trinity_add_dccac_value(rdev); }
false
false
false
false
false
0
do_tag_checks(HSCPRC *hp, HSCATTR *dest, STRPTR str) { /* * checks performed only for tags, * but are skipped for macros */ if (!(dest->varflag & VF_MACRO)) { /* * parse uri (convert abs.uris, check existence) */ if (dest->vartype == VT_URI) { EXPSTR *dest_uri = ini...
false
false
false
false
false
0
test_object_tree_write__from_memory(void) { // write a tree from a memory git_treebuilder *builder; git_tree *tree; git_oid id, bid, rid, id2; git_oid_fromstr(&id, first_tree); git_oid_fromstr(&id2, second_tree); git_oid_fromstr(&bid, blob_oid); //create a second tree from first tree using `git_treebuilder_...
false
false
false
false
false
0
parse_time(const Glib::ustring& text, const std::locale& locale, bool& success) { //std::cout << "debug: " << G_STRFUNC << ": text=" << text << std::endl; //The sequence of statements here seems to be very fragile. If you move things then it stops working. //return parse_tm(text, locale, 'X' /* time */); //Th...
false
false
false
false
false
0
libshut_get_interrupt(int upsfd, unsigned char *buf, int bufsize, int timeout) { int ret; if (upsfd < 1) { return -1; } /* FIXME: hardcoded interrupt EP => need to get EP descr for IF descr */ ret = shut_interrupt_read(upsfd, 0x81, buf, bufsize, timeout); if (ret > 0) upsdebugx(6, " ok"); else upsd...
false
false
false
false
false
0
MainLibLookup (MainLib ml, char *xclass, char *name) #else MainLibEntry MainLibLookup(ml, xclass, name) MainLib ml; char *xclass; char *name; #endif { MainLibEntry cur; if( !ml || (!xclass && !name) ) return NULL; for(cur=ml->head; cur!=NULL; cur=cur->next){ if( (!xclass || !strcmp(xclass, cu...
false
false
false
false
false
0
numaSort(NUMA *naout, NUMA *nain, l_int32 sortorder) { l_int32 i, n, gap, j; l_float32 tmp; l_float32 *array; PROCNAME("numaSort"); if (!nain) return (NUMA *)ERROR_PTR("nain not defined", procName, NULL); /* Make naout if necessary; otherwise do in-place */ ...
false
false
false
false
false
0
FilterFrame( uint8_t *io, int width, int height, double position, double frame_delta ) { show_every = (int) gtk_range_get_value( GTK_RANGE( glade_xml_get_widget( kinoplus_glade, "hscale_slow_mo" ) ) ); if ( current ++ % show_every == 0 ) memcpy( tempframe, io, width * height * 3 ); else memcpy( io,...
false
false
false
false
false
0
printMessage(char* str, int maxlen) const { int remain = maxlen; if (source != NULL) { remain = source->printMessage(str, maxlen); } char aux[100]; sprintf(aux, "From %s:%d\n", file, line); int newremain = remain - strlen(aux); if (newremain < 0) { aux[remain] = '\0'; newremain = 0; } strcat(str, aux); ...
false
false
false
false
true
1
size() const { if (this->name() == NULL) return 0; size_t data_size = 0; for (int i = 4; i < NUM_KNOWN_ATTRIBUTES; ++i) data_size += this->known_attributes_[i].size(i); for (Other_attributes::const_iterator p = this->other_attributes_.begin(); p != this->other_attributes_.end(); ++p) ...
false
false
false
false
false
0
cpr_get_utf8( const char *keyword, const char *prompt ) { char *p; p = cpr_get( keyword, prompt ); if( p ) { char *utf8 = native_to_utf8( p ); xfree( p ); p = utf8; } return p; }
false
false
false
false
false
0
dib8096p_set_diversity_in(struct dvb_frontend *fe, int onoff) { struct dib8000_state *state = fe->demodulator_priv; u16 reg_1287; switch (onoff) { case 0: /* only use the internal way - not the diversity input */ dprintk("%s mode OFF : by default Enable Mpeg INPUT", __func__); /* outputRate = 8 */ di...
false
false
false
false
false
0
delete_one_address_conf(const char *address, struct ConfItem *aconf) { int masktype, bits; unsigned long hv; struct AddressRec *arec, *arecl = NULL; struct rb_sockaddr_storage addr; masktype = parse_netmask(address, (struct sockaddr *)&addr, &bits); #ifdef RB_IPV6 if(masktype == HM_IPV6) { /* We have to do thi...
false
false
false
false
false
0
jl_array_grow_beg(jl_array_t *a, size_t inc) { // designed to handle the case of growing and shrinking at both ends if (inc == 0) return; size_t es = a->elsize; size_t nb = inc*es; if (a->offset >= inc) { a->data = (char*)a->data - nb; a->offset -= inc; } else { ...
false
false
false
false
false
0
goo_canvas_line_dash_new (gint num_dashes, ...) { GooCanvasLineDash *dash; va_list var_args; gint i; dash = g_new (GooCanvasLineDash, 1); dash->ref_count = 1; dash->num_dashes = num_dashes; dash->dashes = g_new (double, num_dashes); dash->dash_offset = 0.0; va_start (var_args, num_dashes); f...
false
false
false
false
false
0
egl_st_create_api(enum st_api_type api) { struct st_api *stapi = NULL; switch (api) { case ST_API_OPENGL: #if FEATURE_GL || FEATURE_ES1 || FEATURE_ES2 #if _EGL_EXTERNAL_GL stapi = egl_st_load_gl(); #else stapi = st_gl_api_create(); #endif #endif break; case ST_API_OPENVG: #if FEATURE_VG ...
false
false
false
false
false
0
_print_nodes_t(sinfo_data_t * sinfo_data, int width, bool right_justify, char *suffix) { char id[FORMAT_STRING_SIZE]; char tmp[8]; if (sinfo_data) { if (params.cluster_flags & CLUSTER_FLAG_BG) convert_num_unit((float)sinfo_data->nodes_total, tmp, sizeof(tmp), UNIT_NONE); else snprintf(tmp, sizeo...
false
false
false
false
false
0
remove_address_replacements (rtx in_rtx) { int i, j; char reload_flags[MAX_RELOADS]; int something_changed = 0; memset (reload_flags, 0, sizeof reload_flags); for (i = 0, j = 0; i < n_replacements; i++) { if (loc_mentioned_in_p (replacements[i].where, in_rtx)) reload_flags[replacements[i].what] |=...
false
false
false
false
false
0
read_line (int fd, char *buf, size_t maxlen) { size_t bytes = 0; ReadStatus retval; memset (buf, '\0', maxlen); maxlen -= 1; /* ensure nul term */ retval = READ_STATUS_OK; while (TRUE) { ssize_t chunk; size_t to_read; again: t...
false
false
false
false
false
0
callbackEvent(void *NotUsed, int argc, char **argv, char **azColName) { int i; int c; for (i = 0; i < argc; i++) { if (strcmp(azColName[i], "event_id") == 0) { snprintf(event_id, sizeof(event_id), "%s", argv[i] ? argv[i] : "NULL"); } else if (strcmp(azColName[i], "event_type") == 0) { c = *argv...
false
false
false
false
false
0
control_config_button_pressed(int n) { switch (n) { case TARGET_TAB: case SHIP_TAB: case WEAPON_TAB: case COMPUTER_TAB: Tab = n; Scroll_offset = Selected_line = 0; control_config_list_prepare(); gamesnd_play_iface(SND_SCREEN_MODE_PRESSED); break; case BIND_BUTTON: control_config_do_bind();...
false
false
false
false
false
0
IsAnimated(size_t index) const { size_t animatedCount = animateds.size(); if (index == ~(size_t)0) { for (size_t i = 0; i < animatedCount; ++i) { if (animateds[i]->HasCurve()) return true; } return false; } else { size_t i = BinarySearch(index); return i < animatedCount && animateds[i...
false
false
false
false
false
0
cciss_allocate_sg_chain_blocks( ctlr_info_t *h, int chainsize, int nr_cmds) { int j; SGDescriptor_struct **cmd_sg_list; if (chainsize <= 0) return NULL; cmd_sg_list = kmalloc(sizeof(*cmd_sg_list) * nr_cmds, GFP_KERNEL); if (!cmd_sg_list) return NULL; /* Build up chain blocks for each command */ for (j = ...
false
false
false
false
false
0
ParseQueryNoAction( void *theEnv, EXPRESSION *top, char *readSource) { EXPRESSION *insQuerySetVars; struct token queryInputToken; insQuerySetVars = ParseQueryRestrictions(theEnv,top,readSource,&queryInputToken); if (insQuerySetVars == NULL) return(NULL); IncrementIndentDepth(theEnv,3); P...
false
false
false
false
false
0
ad_conn_set_method(ad_conn_t *conn, char *method) { char *prev = conn->method; if (conn->method) { free(conn->method); } conn->method = strdup(method); return prev; }
false
false
false
false
true
1
_g_settings_set_string_list (GSettings *settings, const char *key, GList *list) { int len; char **strv; int i; GList *scan; len = g_list_length (list); strv = g_new (char *, len + 1); for (i = 0, scan = list; scan; scan = scan->next) strv[i++] = scan->data; strv[i] = NULL; g...
false
false
false
false
false
0
qla2x00_unmap_iobases(struct qla_hw_data *ha) { if (IS_QLA82XX(ha)) { iounmap((device_reg_t *)ha->nx_pcibase); if (!ql2xdbwr) iounmap((device_reg_t *)ha->nxdb_wr_ptr); } else { if (ha->iobase) iounmap(ha->iobase); if (ha->cregbase) iounmap(ha->cregbase); if (ha->mqiobase) iounmap(ha->mqiobase...
false
false
false
false
false
0
addModSrcFile( const std::string& file ) { int mod_action_flags = 0; // perform OPARI instrumentation? // if( uses_openmp && !isFileExcluded( opari_excl_files, file ) ) mod_action_flags |= ModFileS::MOD_ACTION_FLAG_OPARI; // perform TAU instrumentation? // if( Config.inst_type == INST_TYPE_TAUINST )...
false
false
false
false
false
0
get_tool_mode_pixbuf(enum editor_tool_mode etm) { struct sprite *sprite = NULL; GdkPixbuf *pixbuf = NULL; sprite = editor_get_mode_sprite(etm); if (sprite) { pixbuf = sprite_get_pixbuf(sprite); /* if (pixbuf) { g_object_ref(pixbuf); } */ } return pixbuf; }
false
false
false
false
false
0
intf_close ( struct interface *intf, int rc ) { struct interface *dest; intf_close_TYPE ( void * ) *op = intf_get_dest_op ( intf, intf_close, &dest ); void *object = intf_object ( dest ); DBGC ( INTF_COL ( intf ), "INTF " INTF_INTF_FMT " close (%s)\n", INTF_INTF_DBG ( intf, dest ), strerror ( rc ) ); i...
false
false
false
false
false
0
to_printer_callback() { _to_printer = !_to_printer; if (!_to_printer) { if (strcmp(editor_->text()->string(), command(format()))==0) editor_->field( "./" ); } else { if (strcmp(editor_->text()->string(), "./")==0) editor_->field(command(format())); } }
false
false
false
false
false
0
gst_queue2_chain_buffer_or_buffer_list (GstQueue2 * queue, GstMiniObject * item, GstQueue2ItemType item_type) { /* we have to lock the queue since we span threads */ GST_QUEUE2_MUTEX_LOCK_CHECK (queue, queue->sinkresult, out_flushing); /* when we received EOS, we refuse more data */ if (queue->is_eos) g...
false
false
false
false
false
0
lj_cf_package_loader_preload(lua_State *L) { const char *name = luaL_checkstring(L, 1); lua_getfield(L, LUA_ENVIRONINDEX, "preload"); if (!lua_istable(L, -1)) luaL_error(L, LUA_QL("package.preload") " must be a table"); lua_getfield(L, -1, name); if (lua_isnil(L, -1)) { /* Not found? */ const char *b...
false
false
false
false
false
0
_e_screensaver_handler_screensaver_off_cb(void *data __UNUSED__, int type __UNUSED__, void *event __UNUSED__) { // e_screensaver_force_update(); // e_dpms_force_update(); _e_screensaver_on = EINA_FALSE; if (_e_screensaver_suspend_timer) { ecore_timer_del(_e_screensaver_suspend_timer); ...
false
false
false
false
false
0
ep_ExportAObject(aobj, tr, for_a) A aobj; A tr; I for_a; { char *trp; A z; /* the object that is returned */ A cc; /* the integer scalar completion code */ A cv; /* A object of export vector */ I cvlen; /* length of character vector result */ cc = gi(1); ...
false
false
false
false
true
1
test_scenario_1_test4 (InterestTestFixture *fixture, gconstpointer user_data) { unity_webapps_window_tracker_mock_set_active_window (UNITY_WEBAPPS_WINDOW_TRACKER_MOCK (fixture->window_tracker), 7); unity_webapps_interest_manager_set_interest_is_active (fixture->interest_manager, fixture->id2, TRUE); unity...
false
false
false
false
false
0
il_ht_conf(struct il_priv *il, struct ieee80211_vif *vif) { struct il_ht_config *ht_conf = &il->current_ht_config; struct ieee80211_sta *sta; struct ieee80211_bss_conf *bss_conf = &vif->bss_conf; D_ASSOC("enter:\n"); if (!il->ht.enabled) return; il->ht.protection = bss_conf->ht_operation_mode & IEEE8021...
false
false
false
false
false
0
pr_equivalence_table(FILE *fp, Common_table *equiv_head_p) { Common_table *eqpt; eqpt = equiv_head_p; if (equiv_head_p != NULL) { fputs("%% *** Equivalence Set Table ***\n", fp); fputs("equivalence {\n", fp); } while (eqpt != NULL) { switch (eqpt->mem_type) { case COMMON_NUMERIC: f...
false
false
false
false
false
0
vlv_power_sequencer_pipe(struct intel_dp *intel_dp) { struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp); struct drm_device *dev = intel_dig_port->base.base.dev; struct drm_i915_private *dev_priv = dev->dev_private; struct intel_encoder *encoder; unsigned int pipes = (1 << PIPE_A) | (1 << PIPE_B)...
false
false
false
false
false
0
numInterpreters() { size_t count = 0; if (Interpreter::s_hook) { Interpreter* scr = Interpreter::s_hook; do { ++count; scr = scr->next; } while (scr != Interpreter::s_hook); } return count; }
false
false
false
false
false
0
ErrMsg( int nErrorCode ) { const char *p; static char szErrMsg[64]; switch( nErrorCode ) { case 0: p = ""; break; case CT_OVERFLOW: p = "ARRAY OVERFLOW"; break; case CT_LEN_MISMATCH: p = "LENGTH_MISMATCH"; break...
false
false
false
false
false
0
sr_commit_i(IndexReader *ir) { SegmentInfo *si = SR(ir)->si; char *segment = SR(ir)->si->name; char tmp_file_name[SEGMENT_NAME_MAX_LENGTH]; if (SR(ir)->undelete_all || SR(ir)->deleted_docs_dirty) { if (si->del_gen >= 0) { fn_for_generation(tmp_file_name, segment, "del", si->del_gen)...
false
false
false
false
false
0
getColor(void) { float color; switch(cl_disbeamclr->integer) { case 0: default: color = 0xd6; //bright green break; case 1: color = 0x74; //blue break; case 2: color = 0x40; //red break; case 3: color = 0xe0; //yellow break; case 4: color = 0xff; //purple break; } re...
false
false
false
false
false
0
Do( const Audio& in, DataArray& A, DataArray& K, TData& E ) { if ( !AbleToExecute() ) return false; DataArray R; // autocorrelation coefficients R.Resize( mCurrentConfig.GetOrder() ); R.SetSize( mCurrentConfig.GetOrder() ); ComputeAutocorrelation( in.GetBuffer(), R ); if ( fabs( R[0] ) <= 1e-6 ) { /** Sp...
false
false
false
false
false
0
binary_hash_1(void *binary) { if (((ARCH_WORD *)binary)[2] == ~(ARCH_WORD)0) return *(ARCH_WORD *)binary & 0xFF; return DES_STD_HASH_1(((ARCH_WORD *)binary)[2]); }
false
false
false
false
false
0
findMeter(char *s) { int i = 1; while (strcmp(meters[i], " ")) if (!strcasecmp(s, (char *) meters[i])) return(i); else i++; return LX_ERROR_BYTE; }
false
false
false
false
true
1
johansen_test_complete (GRETL_VAR *jvar, const DATASET *dset, gretlopt opt, PRN *prn) { void *handle = NULL; int (*jfun) (GRETL_VAR *, const DATASET *, gretlopt, PRN *); int err = 0; gretl_error_clear(); jfun = get_plugin_function("johansen_coint_test", &handle); if (jfun == NULL) { ...
false
false
false
false
false
0
solicitRequest(SPtr<TSrvOptIA_PD> queryOpt, SPtr<TSrvCfgIface> ptrIface, bool fake) { // --- Is this PD without IAPREFIX options? --- SPtr<TIPv6Addr> hint = 0; if (!queryOpt->countPrefixes()) { Log(Notice) << "PD option (with IAPREFIX suboptions missing) received. " << LogEnd; hint = new TI...
false
false
false
false
false
0
test_init (void) { int i; for (i = 0; i < pixels * 4; i++) test [i] = (double) random () / RAND_MAX; }
false
false
false
false
true
1
sleep_millisecs_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count) { unsigned long msecs; int err; err = kstrtoul(buf, 10, &msecs); if (err || msecs > UINT_MAX) return -EINVAL; ksm_thread_sleep_millisecs = msecs; return count; }
false
false
false
false
false
0
copy_file(char *src, char* dst){ FILE *fpin, *fpout; char buf[512]; int n; fpin = fopen(src,"r"); fpout = fopen(dst,"w"); if ( fpin == NULL || fpout == NULL) { fprintf(stderr,"Unable to open %s or %s\n",src,dst); return; } for(;;){ n = fread(buf, 1, 512, fpin); if(n == 0) break; fwrite(buf, 1...
false
false
true
false
true
1
free_call_data (gpointer _data) { CallData *data = _data; g_object_unref (data->self); g_free (data->buf); if (data->json_result != NULL) json_node_free (data->json_result); if (data->json_error != NULL) json_node_free (data->json_error); g_slice_free (CallData, data); }
false
false
false
false
false
0
wasp_copy_vector( wasp_vector vo, wasp_integer ln ){ wasp_vector vn = wasp_make_vector( ln ); while( ln-- ){ wasp_vector_put( vn, ln, wasp_vector_get( vo, ln ) ); } return vn; }
false
false
false
false
false
0
handle_go_direction (NautilusWindowSlot *slot, GFile *location, gboolean forward) { GList **list_ptr, **other_list_ptr; GList *list, *other_list, *link; NautilusBookmark *bookmark; gint i; list_ptr = (forward) ? (&slot->details->forward_list) : (&slot->details->back_list); o...
false
false
false
false
false
0
write_to_temp(const char *zText, char *zFile, size_t nLen){ FILE *f; int fd; char *zTmp = getenv("TMPDIR"); /* most Unices */ if( zTmp==0 ) zTmp = getenv("TEMP"); /* Windows/Cygwin */ if( zTmp==0 ) zTmp = "/tmp"; bprintf(zFile,nLen,"%s/cvstrac_XXXXXX", zTmp); fd = mkstemp(zFile); if( fd<0 || 0=...
false
false
false
false
false
0
sqlite_db_collation_needed_dispatcher( void *dbh, sqlite3* db, /* unused */ int eTextRep, /* unused */ const char* collation_name ) { dTHX; dSP; D_imp_dbh(dbh); ENTER; SAVETMPS; PUSHMARK(SP); XPUSHs( dbh ); XPUSHs( sv_2mortal( newSVpv( collati...
false
false
false
false
false
0
price() const { if (commodity_ && commodity_->annotated) { amount_t temp(((annotated_commodity_t *)commodity_)->price); temp *= *this; DEBUG_PRINT("amounts.commodities", "Returning price of " << *this << " = " << temp); return temp; } return *this; }
false
false
false
false
false
0
wi_thread_block_signals(int signal, ...) { sigset_t signals; va_list ap; va_start(ap, signal); sigemptyset(&signals); sigaddset(&signals, signal); while((signal = va_arg(ap, int))) sigaddset(&signals, signal); va_end(ap); #ifdef WI_PTHREADS pthread_sigmask(SIG_SETMASK, &signals, NULL); #else sigproc...
false
false
false
false
false
0
iscsit_start_kthreads(struct iscsi_conn *conn) { int ret = 0; spin_lock(&iscsit_global->ts_bitmap_lock); conn->bitmap_id = bitmap_find_free_region(iscsit_global->ts_bitmap, ISCSIT_BITMAP_BITS, get_order(1)); spin_unlock(&iscsit_global->ts_bitmap_lock); if (conn->bitmap_id < 0) { pr_err("bitmap_find_free_r...
false
false
false
false
false
0
Cbuf_Execute (void) { int i; char *text; char line[1024]; int quotes; alias_count = 0; // don't allow infinite alias loops while (cmd_text.cursize) { // find a \n or ; line break text = (char *)cmd_text.data; quotes = 0; for (i=0 ; i< cmd_text.cursize ; i++) { if (text[i] == '"'...
true
true
false
false
false
1
find_free_superio(void) { int i; for (i = 0; i < NR_SUPERIOS; i++) if (superios[i].io == 0) return &superios[i]; return NULL; }
false
false
false
false
false
0
_gsskrb5_compare_name (OM_uint32 * minor_status, gss_const_name_t name1, gss_const_name_t name2, int * name_equal ) { krb5_const_principal princ1 = (krb5_const_principal)name1; krb5_const_principal princ2 = (krb5_const_principal)name2; krb5_context c...
false
false
false
false
false
0
READUINTPAIR(BIO * fd, unsigned int * val1, unsigned int * val2) { unsigned char c; signed char d; unsigned char v[4]; if (-1 == READALL(fd, &c, sizeof(unsigned char))) return -1; if ( ((c & 15) > 4) || ( (c>>4) > 4) ) { fd->log(fd->context, DOODLE_LOG_CRITICAL, _("Assertion failed at...
true
true
false
false
false
1
var_ns_delete(Var_ns **root, char *name) { Var_ns *v; if ((v = lookup(*root, name)) == NULL) return(-1); do_delete(root, v); return(0); }
false
false
false
false
false
0
rtl8169_irq_mask_and_ack(void *ioaddr) { DBGP ( "rtl8169_irq_mask_and_ack\n" ); RTL_W16(IntrMask, 0x0000); RTL_W16(IntrStatus, 0xffff); }
false
false
false
false
false
0
iio_dummy_init(void) { int i, ret; if (instances > 10) { instances = 1; return -EINVAL; } /* Fake a bus */ iio_dummy_devs = kcalloc(instances, sizeof(*iio_dummy_devs), GFP_KERNEL); /* Here we have no actual device so call probe */ for (i = 0; i < instances; i++) { ret = iio_dummy_probe(i); if (ret...
false
false
false
false
false
0
ddIsIthAddVarPair( DdManager * dd, DdNode * f, DdNode * g, unsigned int i) { return(f->index == i && g->index == i && cuddT(f) == DD_ONE(dd) && cuddE(f) == DD_ZERO(dd) && cuddT(g) == DD_ZERO(dd) && cuddE(g) == DD_ONE(dd)); }
false
false
false
false
false
0
my_string_empty(const char string[]) { return string == NULL || string[0] == '\0'; }
false
false
false
false
false
0
_tourneyparseerror (parse_t parse, char *msg, char *atoken) { char buf[512]; if (atoken) Com_sprintf (buf, sizeof(buf), msg, atoken); else Q_strncpyz (buf, msg, sizeof(buf)); gi.dprintf ("Error in " TOURNEYINI " at line %i: %s.\n", parse.lnumber, buf); }
false
false
false
false
false
0
option_set_toggle_button(GtkBuilder *builder, const gchar *name, gboolean dflt) { gboolean active; GtkWidget *button; g_return_if_fail (builder && name); if (!prefs_get_int_value(name, &active)) active = dflt; button = GTK_WIDGET(gtk_builder_get_object(builder, name)); if (button) ...
false
false
false
false
false
0
hashrescan(PG_FUNCTION_ARGS) { IndexScanDesc scan = (IndexScanDesc) PG_GETARG_POINTER(0); ScanKey scankey = (ScanKey) PG_GETARG_POINTER(1); HashScanOpaque so = (HashScanOpaque) scan->opaque; Relation rel = scan->indexRelation; /* if we are called from beginscan, so is still NULL */ if (so) { /* release any p...
false
false
false
false
false
0
po_message_set_msgctxt (po_message_t message, const char *msgctxt) { message_ty *mp = (message_ty *) message; if (msgctxt != mp->msgctxt) { char *old_msgctxt = (char *) mp->msgctxt; mp->msgctxt = (msgctxt != NULL ? xstrdup (msgctxt) : NULL); if (old_msgctxt != NULL) free (old_msgctxt...
false
false
false
false
false
0
tty_print_glyph(window, x, y, glyph) winid window; xchar x, y; int glyph; { int ch; boolean reverse_on = FALSE; int color; unsigned special; #ifdef CLIPPING if(clipping) { if(x <= clipx || y < clipy || x >= clipxmax || y >= clipymax) return; } #endif /* map glyph t...
false
false
false
false
false
0
kgd2kfd_probe(struct kgd_dev *kgd, struct pci_dev *pdev, const struct kfd2kgd_calls *f2g) { struct kfd_dev *kfd; const struct kfd_device_info *device_info = lookup_device_info(pdev->device); if (!device_info) return NULL; kfd = kzalloc(sizeof(*kfd), GFP_KERNEL); if (!kfd) return NULL; kfd->kgd = kgd...
false
false
false
false
false
0
dsc_add_page(CDSC *dsc, int ordinal, char *label) { dsc->page[dsc->page_count].ordinal = ordinal; dsc->page[dsc->page_count].label = dsc_alloc_string(dsc, label, (int)strlen(label)+1); dsc->page[dsc->page_count].begin = 0; dsc->page[dsc->page_count].end = 0; dsc->page[dsc->page_count].orientation ...
false
true
false
false
false
1
vxlan_get_rx_port(struct net_device *dev) { struct vxlan_sock *vs; struct net *net = dev_net(dev); struct vxlan_net *vn = net_generic(net, vxlan_net_id); sa_family_t sa_family; __be16 port; unsigned int i; spin_lock(&vn->sock_lock); for (i = 0; i < PORT_HASH_SIZE; ++i) { hlist_for_each_entry_rcu(vs, &vn->soc...
false
false
false
false
false
0
symbol_handler(eval_scalar *result, char *name) { if (strcmp(name, "$") == 0) { FileOfs ofs; if (!pos_to_offset(*(viewer_pos*)&cursor, &ofs)) return 0; scalar_create_int_q(result, ofs); return true; } return ht_uformat_viewer::symbol_handler(result, name); }
false
false
false
false
false
0
var_print(ptr) VARIABLE *ptr; { double maxp, minp, maxx; int i, j, k; char fmt[80]; if (ptr == (VARIABLE *)NULL) return; if (TYPE(ptr) == TYPE_STRING) { if (var_pinp) PrintOut( "%d %d %% \"",NROW(ptr),NCOL(ptr) ); for(i = 0; i < NROW(ptr); i++) { for(j = 0; j < NCOL(ptr); j++)...
false
false
false
false
true
1
pcm_init() { int n; if (!sound) { pcm.hz = 11025; pcm.len = 4096; pcm.buf = malloc(pcm.len); pcm.pos = 0; dsp = -1; return; } if (!dsp_device) dsp_device = strdup(DSP_DEVICE); dsp = open(dsp_device, O_WRONLY); n = 0x80009; ioctl(dsp, SNDCTL_DSP_SETFRAGMENT, &n); n = AFMT_U8; ioctl(dsp, SNDCTL_D...
false
false
false
false
true
1
_nm_object_set_property (NMObject *object, const char *interface, const char *prop_name, GValue *value) { g_return_if_fail (NM_IS_OBJECT (object)); g_return_if_fail (interface != NULL); g_return_if_fail (prop_name != NULL); g_return_if_fail (G_IS_VALUE (value)); if (!dbus_g_proxy_call_with_timeo...
false
false
false
false
false
0
gretl_lower (char *str) { char *p = str; while (*p) { if (isupper((unsigned char) *p)) { *p = tolower(*p); } p++; } return str; }
false
false
false
false
false
0
printableHtml(bool withValues) const { Q_UNUSED(withValues); if (m_FormItem->getOptions().contains(Constants::NOT_PRINTABLE)) return QString(); return QString("<table width=100% border=0 cellpadding=0 cellspacing=0 style=\"margin: 0px\">" "<tbody>" "<tr>" ...
false
false
false
false
false
0
comm_open(fde_t *F, int family, int sock_type, int proto, const char *note) { int fd; /* First, make sure we aren't going to run out of file descriptors */ if (number_fd >= hard_fdlimit) { errno = ENFILE; return -1; } /* * Next, we try to open the socket. We *should* drop the reserved FD * l...
false
false
false
false
false
0
go_style_set_marker (GOStyle *style, GOMarker *marker) { g_return_if_fail (GO_IS_STYLE (style)); g_return_if_fail (GO_IS_MARKER (marker)); if (style->marker.mark != marker) { if (style->marker.mark != NULL) g_object_unref (style->marker.mark); style->marker.mark = marker; } }
false
false
false
false
false
0
aes_cipher_free(aes_cnt_cipher_t *cipher) { if (!cipher) return; if (cipher->using_evp) { EVP_CIPHER_CTX_cleanup(&cipher->key.evp); } memset(cipher, 0, sizeof(aes_cnt_cipher_t)); tor_free(cipher); }
false
false
false
false
false
0
VItoLine(VIewobj *vi, char *tmpstr) { char *cp; tmpstr[0] = ' '; tmpstr[1] = '\0'; strcat(tmpstr, VIgetType(vi)); cp = VIgetLang(vi); if (cp != NULL && *cp != '\0') { strcat(tmpstr, " "); strcat(tmpstr, cp); } /** Size **/ cp = VIgetSize(vi); if (cp ...
false
false
false
false
false
0