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
set_res(void *userctx, const char *res) { struct plctx *plctx = userctx; plctx->luser = heim_string_create(res); if (plctx->luser == NULL) return ENOMEM; return 0; }
false
false
false
false
false
0
fd_writeable(slurm_fd_t fd) { struct pollfd ufds; int msg_timeout = 5000; int rc, time_left; struct timeval tstart; char temp[2]; ufds.fd = fd; ufds.events = POLLOUT; gettimeofday(&tstart, NULL); while (shutdown_time == 0) { time_left = msg_timeout - _tot_wait(&tstart); rc = poll(&ufds, 1, time_left);...
false
false
false
false
false
0
gva_main_execute_search (void) { GtkTreeSelection *selection; GtkTreeModel *model; GtkTreeView *view; GtkTreeIter iter; GtkEntry *entry; gchar *text; entry = GTK_ENTRY (GVA_WIDGET_MAIN_SEARCH_ENTRY); view = GTK_TREE_VIEW (GVA_WIDGET_MAIN_TREE_VIEW); ...
false
false
false
false
false
0
entry_present_value_to_zapped_value(Slapi_Attr *a, Slapi_Value *v) { if(v!=NULL) { Slapi_Value *r= valueset_remove_value(a, &a->a_present_values, v); if(r!=NULL) { slapi_value_free(&r); } } return LDAP_SUCCESS; }
false
false
false
false
false
0
main (int argc, char **argv) { int i; char *p; struct utsname utsname; /* determine the system's host name */ uname (&utsname); if (!(Hostname = safe_strdup (utsname.nodename))) return DL_EX_ERROR; if ((p = strchr (Hostname, '.'))) *p = '\0'; /* parse the command line options. */ Dotlock...
false
false
false
false
false
0
collect_mace4_syms(Plist clauses, BOOL arithmetic) { Ilist fsyms, rsyms, p; int max_domain = -1; fsyms = fsym_set_in_topforms(clauses); rsyms = rsym_set_in_topforms(clauses); lex_order(fsyms, rsyms, NULL, NULL, lex_compare_arity_0123); for (p = fsyms; p; p = p->next) { int sn = p->i; int dom = na...
false
false
false
false
false
0
prep_stmt (tree t) { if (!STMT_LINENO_FOR_FN_P (t)) input_line = STMT_LINENO (t); current_stmt_tree ()->stmts_are_full_exprs_p = STMT_IS_FULL_EXPR_P (t); }
false
false
false
false
false
0
pp_base_newline (pretty_printer *pp) { obstack_1grow (pp->buffer->obstack, '\n'); pp_needs_newline (pp) = false; pp->buffer->line_length = 0; }
false
false
false
false
false
0
plpgsql_ns_lookup(PLpgSQL_nsitem *ns_cur, bool localmode, const char *name1, const char *name2, const char *name3, int *names_used) { /* Outer loop iterates once per block level in the namespace chain */ while (ns_cur != NULL) { PLpgSQL_nsitem *nsitem; /* Check this level for unqualified match to va...
false
false
false
false
false
0
__wil_up(struct wil6210_priv *wil) { struct net_device *ndev = wil_to_ndev(wil); struct wireless_dev *wdev = wil->wdev; int rc; WARN_ON(!mutex_is_locked(&wil->mutex)); rc = wil_reset(wil, true); if (rc) return rc; /* Rx VRING. After MAC and beacon */ rc = wil_rx_init(wil, 1 << rx_ring_order); if (rc) re...
false
false
false
false
false
0
ids_sasl_getpluginpath(sasl_conn_t *conn, const char **path) { /* Try to get path from config, otherwise check for SASL_PATH environment * variable. If neither of these are set, default to /usr/lib64/sasl2 on * 64-bit Linux machines, and /usr/lib/sasl2 on all other platforms. */ char *pluginpath...
false
false
false
false
true
1
compare(const DOMString &str) const { int asize = chars.size(); int bsize = str.size(); int diff = 0; int index = 0; while (index < asize && index < bsize) { int a = (int) chars[index]; int b = (int) str[index]; diff = a - b; if (diff) return diff...
false
false
false
false
false
0
nfs4_decode_dirent(struct xdr_stream *xdr, struct nfs_entry *entry, int plus) { unsigned int savep; uint32_t bitmap[3] = {0}; uint32_t len; __be32 *p = xdr_inline_decode(xdr, 4); if (unlikely(!p)) goto out_overflow; if (*p == xdr_zero) { p = xdr_inline_decode(xdr, 4); if (unlikely(!p)) goto out_...
false
false
false
false
false
0
sdr_parse_opt (int key, char *arg, struct sdr_cmd_args *sdr_cmd_args) { switch (key) { case ARGP_FLUSH_CACHE_KEY: sdr_cmd_args->flush_cache = 1; break; case ARGP_QUIET_CACHE_KEY: sdr_cmd_args->quiet_cache = 1; break; case ARGP_SDR_CACHE_DIRECTORY_K...
false
false
false
false
false
0
getScheme(const gchar * szSchemeName) const { UT_uint32 kLimit = m_vecSchemes.getItemCount(); UT_uint32 k; for (k=0; k<kLimit; k++) { XAP_PrefsScheme * p = getNthScheme(k); if(!p) { UT_ASSERT_HARMLESS(p); continue; } if (strcmp(static_cast<const char*>(szSchemeName),static_cast<const char*>(p->getS...
false
false
false
false
false
0
q_edge_torus_area_lagrange_grad(e_info) struct qinfo *e_info; { REAL **x; REAL area; int m,j,k,i; struct gauss_lag *gl = &gauss_lagrange[web.dimension][web.gauss1D_order]; int ctrl = web.skel[EDGE].ctrlpts; REAL **u = e_info->u; int wrap,wrapnum; MAT2D(g,MAXVCOUNT,MAXCOORD); x = e_info->x; for ( i = ...
false
false
false
false
false
0
gnc_pricedb_convert_balance_nearest_price(GNCPriceDB *pdb, gnc_numeric balance, const gnc_commodity *balance_currency, const gnc_commodity *new_currency, Timespec t) { GNCPrice *price, *currency_price; GList *price_list, *list_helper; gnc_numeric currency_price_value; gnc...
false
false
false
false
false
0
brcmf_sdio_tx_ctrlframe(struct brcmf_sdio *bus, u8 *frame, u16 len) { u8 doff; u16 pad; uint retries = 0; struct brcmf_sdio_hdrinfo hd_info = {0}; int ret; brcmf_dbg(TRACE, "Enter\n"); /* Back the pointer to make room for bus header */ frame -= bus->tx_hdrlen; len += bus->tx_hdrlen; /* Add alignment paddin...
false
false
false
false
false
0
game_compare_func(GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer user_data) { GValue value_a = {0, }; GValue value_b = {0, }; gchar *str_a, *str_b; gint r = 0, i; gint sort_pos[] = { 6, 7, 8, 9, 3, 4, 0, 1, 11, 12, 14, 15, 17, 18}; gtk_tree_model_get_value...
false
false
false
false
false
0
igb_restore_vlan(struct igb_adapter *adapter) { u16 vid = 1; igb_vlan_mode(adapter->netdev, adapter->netdev->features); igb_vlan_rx_add_vid(adapter->netdev, htons(ETH_P_8021Q), 0); for_each_set_bit_from(vid, adapter->active_vlans, VLAN_N_VID) igb_vlan_rx_add_vid(adapter->netdev, htons(ETH_P_8021Q), vid); }
false
false
false
false
false
0
handle_io_free(int ndx) { /* IO from a free worker means "kill me" */ DEBUGF(1,("Free worker[%ld] spontaneously died.", (long) free_workers[ndx].pid)); kill_worker(&free_workers[ndx]); --num_free_workers; free_workers[ndx] = free_workers[num_free_workers]; return 1; }
false
false
false
false
false
0
blt_bo_fill(drm_intel_bo *tmp_bo, drm_intel_bo *bo, int val) { uint8_t *gtt_ptr; int i; drm_intel_gem_bo_map_gtt(tmp_bo); gtt_ptr = tmp_bo->virtual; for (i = 0; i < BO_SIZE; i++) gtt_ptr[i] = val; drm_intel_gem_bo_unmap_gtt(tmp_bo); if (bo->offset < mappable_gtt_limit && (IS_G33(devid) || intel_gen(de...
false
false
false
false
false
0
save_xy(void) { char tbuf[64]; Window window, frame, child; XWindowAttributes wa; int x, y; int ix; window = XtWindow(toplevel); if (!x_get_window_attributes(window, &wa)) return; (void) XTranslateCoordinates(display, window, wa.root, -wa.border_width, -wa.border_width, &x, &y, &child); frame = XtWind...
false
false
false
false
false
0
if_usb_reset_device(struct if_usb_card *cardp) { struct cmd_ds_802_11_reset *cmd = cardp->ep_out_buf + 4; int ret; lbtf_deb_enter(LBTF_DEB_USB); *(__le32 *)cardp->ep_out_buf = cpu_to_le32(CMD_TYPE_REQUEST); cmd->hdr.command = cpu_to_le16(CMD_802_11_RESET); cmd->hdr.size = cpu_to_le16(sizeof(struct cmd_ds_802_1...
false
false
false
false
false
0
bp__writer_create(bp__writer_t* w, const char* filename) { off_t filesize; size_t filename_length; /* copy filename + '\0' char */ filename_length = strlen(filename) + 1; w->filename = malloc(filename_length); if (w->filename == NULL) return BP_EALLOC; memcpy(w->filename, filename, filename_length); w...
false
false
false
false
false
0
scrub_checksum(struct scrub_block *sblock) { u64 flags; int ret; /* * No need to initialize these stats currently, * because this function only use return value * instead of these stats value. * * Todo: * always use stats */ sblock->header_error = 0; sblock->generation_error = 0; sblock->checksum_e...
false
false
false
false
false
0
extract_subset(_param p) { double i, j, k; _set *cur, *val; j = POPn; i = POPn; cur = POP(_set); if (i < 0 || j < i) runtime_error(_("invalid indices")); k = i; while (k-- >= 1 && cur != NULL) cur = cur->next; if (cur == NULL) runtime_error(_("first index out of range")); val = ...
false
false
false
true
false
1
ddf1_cvt_config_record(struct lib_context *lc, struct dev_info *di, struct ddf1 *ddf1, int idx) { unsigned int i; uint16_t max_pds; uint32_t *ids, x; uint64_t *off; struct ddf1_config_record *hdr = CR(ddf1, idx); if (BYTE_ORDER == ddf1->disk_format) return 1; max_pds = hdr->primary_element_count; i...
false
false
false
false
false
0
newIfuTable() { VimosIfuTable *ifuTab; /* allocate new VimosIfuTable */ ifuTab = (VimosIfuTable *) pil_malloc(sizeof(VimosIfuTable)); /* check if space was allocated */ if (ifuTab == NULL) { pilMsgError("newIfuTable","Allocation Error"); return(NULL); } /* copy "IFU" into name of table and ini...
false
false
false
false
false
0
operator()(transaction_t& xact) { bool xact_in_budget = false; for (pending_xacts_list::iterator i = pending_xacts.begin(); i != pending_xacts.end(); i++) for (account_t * acct = xact_account(xact); acct; acct = acct->parent) { if (acct == xact_account(*(*i).second)) { xact_in_budget =...
false
false
false
false
false
0
ap_set_listener(cmd_parms *cmd, void *dummy, int argc, char *const argv[]) { char *host, *scope_id, *proto; apr_port_t port; apr_status_t rv; const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); if (err != NULL) { return err; } i...
false
false
false
false
false
0
strarray_find(char **array, const char *item) { char **tmp; int index; g_return_val_if_fail(array != NULL, 0); g_return_val_if_fail(item != NULL, 0); index = 0; for (tmp = array; *tmp != NULL; tmp++, index++) { if (g_strcasecmp(*tmp, item) == 0) return index; } return -1; }
false
false
false
false
false
0
affs_free_block(struct super_block *sb, u32 block) { struct affs_sb_info *sbi = AFFS_SB(sb); struct affs_bm_info *bm; struct buffer_head *bh; u32 blk, bmap, bit, mask, tmp; __be32 *data; pr_debug("%s(%u)\n", __func__, block); if (block > sbi->s_partition_size) goto err_range; blk = block - sbi->s_reser...
false
false
false
false
false
0
my_asctime(time_t t) { struct tm *tm; char *str; int len; tm = localtime(&t); str = g_strdup(asctime(tm)); len = strlen(str); if (len > 0) str[len-1] = '\0'; return str; }
false
false
false
false
false
0
dump_subfile (struct gimg_struct *img, const char *subfile_name) { struct subfile_struct *subfile; /* no extension defailts to TRE */ if (strchr(subfile_name, '.') == NULL) { struct submap_struct *submap = get_submap(img, subfile_name); if (submap) { dump_tre(submap->tre); return; } } subfile = get_s...
false
false
false
false
false
0
spaceship_init(struct player_spaceship *ship) { int i; ship->structurals = ship->components = ship->modules = 0; for(i=0; i<NUM_SS_STRUCTURALS; i++) { ship->structure[i] = FALSE; } ship->fuel = ship->propulsion = 0; ship->habitation = ship->life_support = ship->solar_panels = 0; ship->state = SSHIP...
false
false
false
false
false
0
parseStarter (typeList *instructionList) { if (DEBUG_FLAG) printf("Parser start\n"); //delegate instrusction list to global instrList = instructionList; //init string for attribute if (strInit(&attribute) == STR_ERROR) { if (DEBUG_FLAG) printf("Attribute string allocation error\n"); return INTERNAL_ERROR; ...
false
false
false
false
false
0
input_pad_window_show (void *window_data) { GtkWidget *window; InputPadGtkWindow *input_pad_window; g_return_if_fail (window_data != NULL && INPUT_PAD_IS_GTK_WINDOW (window_data)); window = GTK_WIDGET (window_data); input_pad_window = INPUT_PAD_GTK_WINDOW (window); if (i...
false
false
false
false
false
0
statementEndsWithComma(const string &line, int index) const { assert(line[index] == '='); bool isInComment_ = false; bool isInQuote_ = false; int parenCount = 0; size_t lineLength = line.length(); size_t i = 0; char quoteChar_ = ' '; for (i = index + 1; i < lineLength; ++i) { char ch = line[i]; if (isIn...
false
false
false
false
false
0
_edsf_persona_store_set_contact_gender (EdsfPersonaStore* self, EContact* contact, FolksGender gender) { EContact* _tmp0_ = NULL; EVCardAttribute* new_attr = NULL; EVCardAttribute* _tmp1_ = NULL; FolksGender _tmp2_ = 0; g_return_if_fail (self != NULL); g_return_if_fail (contact != NULL); _tmp0_ = contact; _edsf...
false
false
false
false
false
0
clr_top_supdiag_elt(RNScalar * b,int p,int z,RNScalar * u,int m,int n,int min) { int i; RNScalar r, x, hypot, cos, sin; for (i=p+1; i<=z; i++) { r = REF2D(b,m,n,p,i); x = REF2D(b,m,n,i,i); if (r==0) break; hypot = ((RNScalar) sqrt (r*r + x*x)); //hypot = pythag(r,x); cos = x/hypot; sin = r/hypot; /*...
false
false
false
false
false
0
url_hilite_abook(long int linenum, char *line, LT_INS_S **ins, void *local) { register char *lp; if((lp = strchr(line, ':')) && !strncmp(line, AB_COMMENT_STR, strlen(AB_COMMENT_STR))) (void) url_hilite(linenum, lp + 1, ins, local); return(0); }
false
false
false
false
false
0
SetShowNoninter(int dev) { /* Change or display settings from the command line. */ char *devstr; char dest[4]; int change = 0, tmp, left, right; /* Increase or decrease levels, optionally by a number. */ if (!strncmp(optarg, "+", 1) || !strncmp(optarg, "-", 1)) { ErrorExitWarn(Re...
false
false
false
false
false
0
lli_prep_dialout(struct FsmInst *fi, int event, void *arg) { struct Channel *chanp = fi->userdata; FsmDelTimer(&chanp->drel_timer, 60); FsmDelTimer(&chanp->dial_timer, 73); chanp->l2_active_protocol = chanp->l2_protocol; chanp->incoming = 0; chanp->cs->cardmsg(chanp->cs, MDL_INFO_SETUP, (void *) (long)chanp->cha...
false
false
false
false
false
0
dbus_connection_changed_cb (NMDBusManager *dbus_mgr, DBusGConnection *connection, gpointer user_data) { NMBluezManager *self = NM_BLUEZ_MANAGER (user_data); if (!connection) bluez_cleanup (self, TRUE); else bluez_connect (self); }
false
false
false
false
false
0
f_something_to_initialize(Ccode_option cco) { { Ccode_option kc_selvar_0_1 = phylum_cast<Ccode_option>( cco ); if ((kc_selvar_0_1->prod_sel() == sel_CcodeOption)) { const attributes attr = phylum_cast<const impl_Ccode_option_CcodeOption*>(kc_selvar_0_1)->attributes_1; const Ctexts ct = phylum_cast<const...
false
false
false
false
false
0
importFromCRSURL( const char *pszURL ) { const char *pszCur; if( EQUALN(pszURL,"http://opengis.net/def/crs",26) ) pszCur = pszURL + 26; else if( EQUALN(pszURL,"http://www.opengis.net/def/crs",30) ) pszCur = pszURL + 30; else if( EQUALN(pszURL,"www.opengis.net/def/crs",23) ) ...
false
false
false
false
false
0
readString(core::stringc& newstring) { newstring=""; while (B3DFile->getPos() <= B3DFile->getSize()) { c8 character; B3DFile->read(&character, sizeof(character)); if (character==0) return; newstring.append(character); } }
false
false
false
false
false
0
gst_play_bin_send_custom_event (GstObject * combiner, const gchar * event_name) { GstPad *src; GstPad *peer; GstStructure *s; GstEvent *event; gboolean ret = FALSE; src = gst_element_get_static_pad (GST_ELEMENT_CAST (combiner), "src"); peer = gst_pad_get_peer (src); if (peer) { s = gst_structure_ne...
false
false
false
false
false
0
device_info(int fd, char *prepend) { struct input_id id; char buf[32]; int rc; rc = ioctl(fd, EVIOCGNAME(sizeof(buf)), buf); if (rc >= 0) fprintf(stderr,"%sName: %.*s\n",prepend, rc, buf); else perror ("EVIOCGNAME"); rc = ioctl(fd, EVIOCGID, &id); if (rc >= 0) fprintf(stderr, "%sbus: %d, vendor/produ...
true
true
false
false
false
1
mark_conflict (struct du_head *chains, unsigned id) { while (chains) { bitmap_set_bit (&chains->conflicts, id); chains = chains->next_chain; } }
false
false
false
false
false
0
core_alua_state_lba_dependent( struct se_cmd *cmd, struct t10_alua_tg_pt_gp *tg_pt_gp) { struct se_device *dev = cmd->se_dev; u64 segment_size, segment_mult, sectors, lba; /* Only need to check for cdb actually containing LBAs */ if (!(cmd->se_cmd_flags & SCF_SCSI_DATA_CDB)) return 0; spin_lock(&dev->t10_alu...
false
false
false
false
false
0
lam_setup(void **testdata) { CRUT_DEBUG("Initializing lam."); *testdata = NULL; cr_register_callback(signal_callback, NULL, CR_SIGNAL_CONTEXT); cr_register_callback(thread_callback, NULL, CR_THREAD_CONTEXT); return 0; }
false
false
false
false
false
0
setJobsCheckedList() { m_JobsCheckedList = ""; bool first = true; /* Update the items in the version table */ int cnt = jobTable->rowCount(); for (int row=0; row<cnt; row++) { QTableWidgetItem* jobItem = jobTable->item(row, 0); if (jobItem->checkState() == Qt::Checked) { if (!first) ...
false
false
false
false
false
0
handleExternalEntityRef(XML_Parser parser, const XML_Char* context, const XML_Char* base, const XML_Char* systemId, const XML_Char* publicId) { ParserEngine* pThis = reinterpret_cast<ParserEngine*>(XML_GetUserData(parser)); if (!context && !pThis->_externalParameterEntities) return XML_STATUS_ERROR; if (context && ...
false
false
false
false
false
0
kmclipm_vector_get_bpm(kmclipm_vector *kv) { cpl_vector *mask = NULL; KMCLIPM_TRY { KMCLIPM_TRY_CHECK_AUTOMSG(kv != NULL, CPL_ERROR_NULL_INPUT); KMCLIPM_TRY_EXIT_IFN( mask = kv->mask); } KMCLIPM_CATCH { mask = NULL; }...
false
false
false
false
false
0
setPage(int pageIndex, GBool updateP) { annotLocker(); Page *pageobj = doc->getPage(pageIndex); Object obj1; if (pageobj) { Ref pageRef = pageobj->getRef(); obj1.initRef(pageRef.num, pageRef.gen); page = pageIndex; } else { obj1.initNull(); page = 0; } if (updateP) { update("P", ...
false
false
false
false
false
0
__gmpfr_ceil_log2 (double d) { long exp; #if _GMP_IEEE_FLOATS union ieee_double_extract x; x.d = d; exp = x.s.exp - 1023; x.s.exp = 1023; /* value for 1 <= d < 2 */ if (x.d != 1.0) /* d: not a power of two? */ exp++; return exp; #else double m; if (d < 0.0) return __gmpfr_floor_log2(-d)+1; ...
false
false
false
false
false
0
operator()( const Application* a1, const Application* a2 ) const { if( a1->function() < a2->function() ) return( true ); else if( a1->function() > a2->function() ) return( false ); else { for( size_t i = 0; i < a1->arity(); ++i ) { if( a1->term(i) < a2->term( i ) ) return( true ); el...
false
false
false
false
false
0
der_put_boolean(unsigned char *p, size_t len, const int *data, size_t *size) { if(len < 1) return ASN1_OVERFLOW; if(*data != 0) *p = 0xff; else *p = 0; *size = 1; return 0; }
false
false
false
false
false
0
getResultValue(UT_uint32 indx) const { UT_return_val_if_fail(m_pSS, NULL); UT_String S1, S2; struct tm * tM; char * s; switch(indx) { case 0: // relationship if(m_iVersionOfDiff == 0xffffffff) { // equal return g_strdup(m_pSS->getValue(XAP_STRING_ID_DLG_DocComparison_Identical)); } else i...
false
false
false
false
false
0
chapms2_add_to_response_cache(int id, unsigned char *challenge, unsigned char *response, unsigned char *auth_response) { int i = chapms2_response_cache_next_index; chapms2_response_cache[i].id = id; memcpy(chapms2_response_cache[i].challenge, challenge, 16); memcpy(chapms2_response_cache[i].respo...
false
false
false
false
false
0
_cred_state_pack(slurm_cred_ctx_t ctx, Buf buffer) { ListIterator i = NULL; cred_state_t *s = NULL; pack32(list_count(ctx->state_list), buffer); i = list_iterator_create(ctx->state_list); while ((s = list_next(i))) _cred_state_pack_one(s, buffer); list_iterator_destroy(i); }
false
false
false
false
false
0
print_cookie(char *name, const uint8_t *cookie, int len) { printf(" %s %02x%02x%02x%02x", name, cookie[0], cookie[1], cookie[2], cookie[3]); if (len == 8) printf("%02x%02x%02x%02x", cookie[4], cookie[5], cookie[6], cookie[7]); }
false
false
false
false
false
0
_sort_by_sct(void *void1, void *void2) { int diffs, diffc, difft; sinfo_data_t *sinfo1; sinfo_data_t *sinfo2; _get_sinfo_from_void(&sinfo1, &sinfo2, void1, void2); diffs = sinfo1->min_sockets - sinfo2->min_sockets; diffc = sinfo1->min_cores - sinfo2->min_cores; difft = sinfo1->min_threads - sinfo2->min_threads...
false
false
false
false
false
0
inlist(struct ll_string* front, char* string) { struct ll_string* current; for(current = front; current != NULL; current = current->next) { if(strcmp(current->string, string) == 0) { return 1; } } return 0; }
false
false
false
false
false
0
dock() { if (findSystemTray()){ FXuint id = getTrayVisual(); if (id) { if (id!=XVisualIDFromVisual((Visual*)getVisual()->getVisual())) opaque=true; else opaque=false; } if (!opaque) { /// Don't draw the background XSetWindowAttributes sattr; sattr.backg...
false
false
false
false
false
0
dmg_track_sectors(uint64_t *total, uint8_t *data_to_write, uint32_t stripeNum, uint32_t stripeType, uint64_t stripeCount) { int ret = CL_CLEAN, usable = 0; switch (stripeType) { case DMG_STRIPE_STORED: *data_to_write = 1; usable = 1; break; case DMG_STRIP...
false
false
false
false
false
0
P(const double z, const Energy2 t, const IdList &ids, const bool mass) const { double val = z/(1.-z); if(mass) { Energy m = getParticleData(ids[0])->mass(); val-= sqr(m)/t; } return 2.*colourFactor()*val; }
false
false
false
false
false
0
ds9490r_set_pullup(void *data, int delay) { struct ds_device *dev = data; if (ds_set_pullup(dev, delay)) return 1; return 0; }
false
false
false
false
false
0
monitor_on_object_added (GDBusObjectManager *manager, GDBusObject *object, gpointer user_data) { if (!monitor_has_name_owner ()) goto out; monitor_print_timestamp (); g_print ("%s%sAdded %s%s\n", _color_get (_COLOR_BOLD_ON), _co...
false
false
false
false
false
0
write_video_frame_theora(void * data, gavl_video_frame_t * frame) { theora_t * theora; int result; int i; ogg_packet op; theora = data; if(theora->have_packet) { if(!th_encode_packetout(theora->ts, 0, &op)) { bg_log(BG_LOG_ERROR, LOG_DOMAIN, "Theora encoder produced ...
false
false
false
false
true
1
retofinv_draw_background(struct mame_bitmap *bitmap) { int x,y,offs; int sx,sy,tile,palette; int bg_dirtybank; /* for every character in the Video RAM, check if it has been modified */ /* since last time and update it accordingly. */ /* if bank differ redraw all */ bg_dirtybank = (retofinv_bg_char_ba...
false
false
false
false
false
0
SSL_read_PrivateKey(char* filename, EVP_PKEY **key, pem_password_cb *cb, void *s) { EVP_PKEY *rc; BIO *bioS; BIO *bioF; /* 1. try PEM (= DER+Base64+headers) */ if ((bioS=BIO_new_file(filename, "r")) == NULL) return NULL; rc = PEM_read_bio_PrivateKey(bioS, key, cb, s); BIO_free(bioS)...
false
false
false
false
false
0
afOpenNamedFD (int fd, const char *mode, AFfilesetup setup, const char *filename) { if (!mode) { _af_error(AF_BAD_ACCMODE, "null access mode"); return AF_NULL_FILEHANDLE; } int access; if (mode[0] == 'r') access = _AF_READ_ACCESS; else if (mode[0] == 'w') access = _AF_WRITE_ACCESS; else { _af_error(...
false
false
false
false
true
1
PySSL_compression(PySSLSocket *self) { #ifdef OPENSSL_NO_COMP Py_RETURN_NONE; #else const COMP_METHOD *comp_method; const char *short_name; if (self->ssl == NULL) Py_RETURN_NONE; comp_method = SSL_get_current_compression(self->ssl); if (comp_method == NULL || comp_method->type == NID_un...
false
false
false
false
false
0
mthca_destroy_qp(struct ib_qp *qp) { if (qp->uobject) { mthca_unmap_user_db(to_mdev(qp->device), &to_mucontext(qp->uobject->context)->uar, to_mucontext(qp->uobject->context)->db_tab, to_mqp(qp)->sq.db_index); mthca_unmap_user_db(to_mdev(qp->device), &to_mucontext(qp->uobject->contex...
false
false
false
false
false
0
lj_tab_dup(lua_State *L, const GCtab *kt) { GCtab *t; uint32_t asize, hmask; t = newtab(L, kt->asize, kt->hmask > 0 ? lj_fls(kt->hmask)+1 : 0); lua_assert(kt->asize == t->asize && kt->hmask == t->hmask); t->nomm = 0; /* Keys with metamethod names may be present. */ asize = kt->asize; if (asize > 0) { ...
false
false
false
false
false
0
CERT_EncodeSubjectKeyID(PLArenaPool *arena, const SECItem* srcString, SECItem *encodedValue) { SECStatus rv = SECSuccess; if (!srcString) { PORT_SetError(SEC_ERROR_INVALID_ARGS); return SECFailure; } if (SEC_ASN1EncodeItem (arena, encodedValue, srcString, ...
false
false
false
false
false
0
angry_shk_exists(void) { struct monst *shkp; for (shkp = next_shkp(fmon, false); shkp; shkp = next_shkp(shkp->nmon, false)) { if (ANGRY(shkp)) return true; } return false; }
false
false
false
false
false
0
interpret_target(struct walker *walker, char *target, unsigned char *sha1) { if (!get_sha1_hex(target, sha1)) return 0; if (!check_ref_format(target)) { struct ref *ref = alloc_ref(target); if (!walker->fetch_ref(walker, ref)) { hashcpy(sha1, ref->old_sha1); free(ref); return 0; } free(ref); } re...
false
false
false
false
false
0
movie_compress_area( int x, int y, int w, int h, int s ) { libspectrum_dword *dpoint, *dline; libspectrum_byte d, d1, *b; libspectrum_byte buff[ 960 ]; int w0, h0, l; dline = &display_last_screen[x + 40 * y]; b = buff; l = -1; d1 = ( ( *dline >> s ) & 0xff ) + 1; /* *d1 != dpoint :-) */ for( h0 = h; ...
false
false
false
false
false
0
menu_load(const gchar * filename) { GlivImage *im; static gboolean loading = FALSE; if (loading || currently_loading()) { /* We are not reentrant. */ return FALSE; } loading = TRUE; if (current_image->node != NULL && (filename == current_image->node->data || c...
false
false
false
false
false
0
betaln(double a0, double b0) { /* ----------------------------------------------------------------------- * Evaluation of the logarithm of the beta function ln(beta(a0,b0)) * ----------------------------------------------------------------------- */ static double e = .918938533204673;/* e == 0.5*LN(2*PI) */...
false
false
false
false
false
0
EC_POINT_dup(const EC_POINT *a, const EC_GROUP *group) { EC_POINT *t; int r; if (a == NULL) return NULL; t = EC_POINT_new(group); if (t == NULL) return(NULL); r = EC_POINT_copy(t, a); if (!r) { EC_POINT_free(t); return NULL; } else return t; }
false
false
false
false
false
0
ir_edit_set_scale(GxIREdit *ir_edit, gdouble scale, gint scroll_center) { if (FP_EQUAL(scale, ir_edit->scale)) { return; } gdouble mx = ir_edit->odata_len / ir_edit->max_scale_fact; if (scale == 0.0) { g_signal_emit_by_name(ir_edit,"scale-min-reached", TRUE); g_signal_emit_by_name(ir_edit,"scale-max-reached",...
false
false
false
false
false
0
get_primary_dev(const char *sysfs_dir, const struct device *dev, dev_t *result) { char path[PATH_MAX+1]; char temp_path[PATH_MAX+1]; char buffer[64]; struct stat info; FILE *fp; uint32_t pri_maj, pri_min; int size, ret = 0; /* check if dev is a partition */ if (dm_snprintf(path, PATH_MAX, "%s/dev/block/...
false
false
false
false
false
0
binding_table_foreach (binding_table table, bt_foreach_proc proc, void *data) { const size_t chain_count = table->chain_count; size_t i; for (i = 0; i < chain_count; ++i) { binding_entry entry = table->chain[i]; for (; entry != NULL; entry = entry->chain) proc (entry, data); } }
false
false
false
false
false
0
detect_bios_type(vbios_map * map, int entry_size) { unsigned int i; uint16_t r1, r2; r1 = r2 = 32000; for (i = 0; i < map->mode_table_size; i++) { if (map->mode_table[i].resolution <= r1) { r1 = map->mode_table[i].resolution; } else if (map->mode_table[i].resolution <= r2)...
false
false
false
false
false
0
display_object(int col, int row, bool cursor, int oid) { int k_idx = oid; object_kind *k_ptr = &k_info[k_idx]; const char *inscrip = get_autoinscription(oid); char o_name[80]; /* Choose a color */ bool aware = (!k_ptr->flavor || k_ptr->aware); byte attr = curs_attrs[(int)aware][(int)cursor]; /* Find graphic...
true
true
false
false
false
1
countBlocks(bdescr *bd) { W_ n; for (n=0; bd != NULL; bd=bd->link) { n += bd->blocks; } return n; }
false
false
false
false
false
0
__snd_emux_inc_count(struct snd_emux *emu) { emu->used++; if (!try_module_get(emu->ops.owner)) goto __error; if (!try_module_get(emu->card->module)) { module_put(emu->ops.owner); __error: emu->used--; return 0; } return 1; }
false
false
false
false
false
0
jj_rescan_token() { jj_rescan = true; JJCalls* p = jj_2_rtns; do { if (p->gen > jj_gen) { jj_la = p->arg; jj_lastpos = jj_scanpos = p->first; jj_3_1(); } p = p->next; } while (p != NULL); jj_rescan = false; }
false
false
false
false
false
0
gt_pch_nx_VEC_call_site_record_gc (void *x_p) { struct VEC_call_site_record_gc * const x = (struct VEC_call_site_record_gc *)x_p; if (gt_pch_note_object (x, x, gt_pch_p_23VEC_call_site_record_gc, gt_ggc_e_23VEC_call_site_record_gc)) { { size_t i0; size_t l0 = (size_t)(((*x).base).prefix.nu...
false
false
false
false
true
1
Isin_fwd(const Isin_t *thisIsin, double lon, double lat, double *x, double *y) /* !C****************************************************************************** !Description: Isin_fwd (forward mapping) converts geographic coordinates ('lon', 'lat') to map projection coordinates ('x', 'y'). !Inpu...
false
false
false
false
false
0
parseParameter( const std::string& line, const std::string& key, int& value ){ int v = valueFromKey( line, key ); if( v >= 0 ) value = v; }
false
false
false
false
false
0
unite( const Meta::TrackPtr& B ) { if( !m_collection ) return; if( !B ) return; QString str = B->uidUrl(); if( !m_collection->m_ids.contains( str ) ) { warning() << "TrackSet::subtract called for a track not even known to the collection. Track uid is"<<str<<"example from collect...
false
false
false
false
false
0
cmc_config_base_save(CmdCfg *cmc, FILE *out) { if((cmc != NULL) && (out != NULL)) { const GList *iter; CField *fld; xml_put_node_open(out, cmc->name); for(iter = cmc->fields; iter != NULL; iter = g_list_next(iter)) { fld = iter->data; if(strcmp(fld->name, "modified") == 0) continue; switch(f...
false
false
false
false
false
0
static_raw_y0 (int cell_x, int cell_y, int cell_z, int shell, static_polytope *polytope) { int n, n_x, n_y, n_z; int i, j; n = polytope->n_cells; /**************************************** * find neighbours in cells in -y faces * ****************************************/ n_y = -shell + cell_y; if (n_y < 0 || n_y > ...
false
false
false
false
false
0
iface_screen(int rep, int display, int *flags_ptr) { /* ALF TODO need to make this actual time since last run */ unsigned int interval = difftime(time(NULL), iface[0].last_online); /* interval since last update */ int iface_nmbr; if (!interval) return 0; /* need at least 1 second, no divide by 0 */ if ((*flag...
false
false
false
false
false
0