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
chomp(char *buf, size_t len) { if (len >= 1 && buf[len-1] == '\n') { if (len >= 2 && buf[len-2] == '\r') { len -= 2; } else { len -= 1; } buf[len] = '\0'; } return len; }
false
false
false
false
false
0
mentry_find(const char *path, struct metahash *mhash) { struct metaentry *base; unsigned key; if (!mhash) { msg(MSG_ERROR, "%s called with empty hash table\n", __func__); return NULL; } key = hash(path); for (base = mhash->bucket[key]; base; base = base->next) { if (!strcmp(base->path, path)) return ba...
false
false
false
false
false
0
lt(double const *value1, double const *value2, unsigned int length) { for (unsigned long i = 0; i < length; ++i) { if (lt(value1[i], value2[i])) { return true; } else if (lt(value2[i], value1[i])) { return false; } } return false; }
false
false
false
false
false
0
xlsx_write_cols (XLSXWriteState *state, GsfXMLOut *xml, GnmStyle **styles) { int first_col = 0, i; int last_col = gnm_sheet_get_last_col (state->sheet); ColRowInfo const *info = sheet_col_get (state->sheet, first_col); gsf_xml_out_start_element (xml, "cols"); for (i = first_col + 1; i <= last_col; i++) { ColRo...
false
false
false
false
false
0
obj_indirectly_held_by_player (sc_gameref_t game, sc_int object) { sc_bool result; /* Check, trace result, and return. */ result = obj_indirectly_held_by_player_internal (game, object); if (obj_trace) { sc_trace ("Object: checking for object %ld indirectly" " held by player, %s\n", o...
false
false
false
false
false
0
OpenIncludeFile(char * includeFile) { struct __ecereNameSpace__ecere__com__Instance * file; char location[274]; __ecereNameSpace__ecere__sys__StripLastDirectory(sourceFileStack[(include_stack_ptr >= 0) ? include_stack_ptr : 0], location); __ecereNameSpace__ecere__sys__PathCat(location, includeFile); file = __ecereName...
false
false
false
false
false
0
getWinXY(Display *dpy, ButWin *win) { static bool errorPrinted = FALSE; Status status; Window wmframe = win->win; XWindowAttributes frame_attr; while (True) { Window root, parent; Window *childlist; unsigned int ujunk; status = XQueryTree(dpy, wmframe, &root, &parent, &childlist, &ujun...
false
false
false
false
false
0
analyze_neighbor(int pos, int *found_black, int *found_white) { switch (board[pos]) { case EMPTY: if (!(*found_black) && living_neighbor(pos, BLACK) && safe_move(pos, WHITE) != WIN) *found_black = 1; if (!(*found_white) && living_neighbor(pos, WHITE) && safe_move(pos, BLACK) != WIN...
false
false
false
false
false
0
zl10036_set_bandwidth(struct zl10036_state *state, u32 fbw) { /* fbw is measured in kHz */ u8 br, bf; int ret; u8 buf_bf[] = { 0xc0, 0x00, /* 6/7: rsd=0 bf=0 */ }; u8 buf_br[] = { 0xf0, 0x00, /* 12/13: br=0xa clr=0 tl=0*/ }; u8 zl10036_rsd_off[] = { 0xc8 }; /* set RSD=1 */ /* ensure correct values */ i...
false
false
false
false
false
0
unget_char(unsigned int c) {//=================================== ungetc(c,f_in); if(c == '\n') linenum--; }
false
false
false
false
false
0
exclude_level() { SELECT_LEX_UNIT *units= 0, **units_last= &units; for (SELECT_LEX *sl= first_select(); sl; sl= sl->next_select()) { // unlink current level from global SELECTs list if (sl->link_prev && (*sl->link_prev= sl->link_next)) sl->link_next->link_prev= sl->link_prev; // bring up underl...
false
false
false
false
false
0
xfrin_fail(dns_xfrin_ctx_t *xfr, isc_result_t result, const char *msg) { if (result != DNS_R_UPTODATE) { xfrin_log(xfr, ISC_LOG_ERROR, "%s: %s", msg, isc_result_totext(result)); if (xfr->is_ixfr) /* Pass special result code to force AXFR retry */ result = DNS_R_BADIXFR; } xfrin_cancelio(xfr); /* * ...
false
false
false
false
false
0
lwgeom_deserialize(uchar *srl) { int type = lwgeom_getType(srl[0]); LWDEBUGF(2, "lwgeom_deserialize got %d - %s", type, lwgeom_typename(type)); switch (type) { case POINTTYPE: return (LWGEOM *)lwpoint_deserialize(srl); case LINETYPE: return (LWGEOM *)lwline_deserialize(srl); case CIRCSTR...
false
false
false
false
false
0
hex_key(char *key) { static char hk[KEY_SZ * 2 + 1]; unsigned int c; for (c = 0; c < KEY_SZ; c++) { NDEB(D(L, "%d of %d, <%02X> at %p\n", c, KEY_SZ, (unsigned char)key[c], hk + c * 2)); sprintf(hk + c * 2, "%02X", (unsigned char)key[c]); } hk[c * 2] = 0; return...
false
false
false
false
false
0
rtw_freq2ch(u32 freq) { u8 i; u32 ch = 0; for (i = 0; i < ch_freq_map_num; i++) { if (freq == ch_freq_map[i].frequency) { ch = ch_freq_map[i].channel; break; } } if (i == ch_freq_map_num) ch = 1; return ch; }
false
false
false
false
false
0
j_config_remove_initial(Jconf *jconf) { JCONF_AM *am; JCONF_LM *lm; JCONF_SEARCH *s; if(jconf->am_root->next != NULL && jconf->am_root->id == 0) { am = jconf->am_root->next; free(jconf->am_root); jconf->am_root = am; } if(jconf->lm_root->next != NULL && jconf->lm_root->id == 0) { lm = jconf...
false
false
false
false
false
0
ca_send_message(struct dst_state *state, struct ca_msg *p_ca_message, void __user *arg) { int i = 0; u32 command = 0; struct ca_msg *hw_buffer; int result = 0; if ((hw_buffer = kmalloc(sizeof (struct ca_msg), GFP_KERNEL)) == NULL) { dprintk(verbose, DST_CA_ERROR, 1, " Memory allocation failure"); return -ENO...
false
false
false
false
false
0
move_chunks_up_to_len(struct sparse_file *from, struct sparse_file *to, unsigned int len) { int64_t count = 0; struct output_file *out_counter; struct backed_block *last_bb = NULL; struct backed_block *bb; struct backed_block *start; int64_t file_len = 0; /* * overhead is sparse file header, initial skip ch...
false
false
false
false
false
0
_argument_list_append (argument_list_t *list, token_list_t *argument) { argument_node_t *node; node = ralloc (list, argument_node_t); node->argument = argument; node->next = NULL; if (list->head == NULL) { list->head = node; } else { list->tail->next = node; } list->tail = node; }
false
false
false
false
false
0
MPI_Wait_epilog(MPI_Fint *req, MPI_Status *s __attribute__((unused))) { EZTRACE_EVENT1(FUT_MPI_STOP_WAIT, req); }
false
false
false
false
false
0
dib7000p_set_adc_state(struct dib7000p_state *state, enum dibx000_adc_states no) { u16 reg_908 = 0, reg_909 = 0; u16 reg; if (state->version != SOC7090) { reg_908 = dib7000p_read_word(state, 908); reg_909 = dib7000p_read_word(state, 909); } switch (no) { case DIBX000_SLOW_ADC_ON: if (state->version == SOC...
false
false
false
false
false
0
strxmov(char *dst,const char *src, ...) { va_list pvar; va_start(pvar,src); while (src != NullS) { while ((*dst++ = *src++)) ; dst--; src = va_arg(pvar, char *); } va_end(pvar); *dst = 0; /* there might have been no sources! */ return dst; }
false
false
false
false
false
0
pci_backup_excluded ( struct pci_device *pci, unsigned int offset, const uint8_t *exclude ) { if ( ! exclude ) return 0; for ( ; *exclude != PCI_CONFIG_BACKUP_EXCLUDE_END ; exclude++ ) { if ( offset == *exclude ) { DBGC ( pci, "PCI %p skipping configuration offset " "%02x\n", pci, offset ); ...
false
false
false
false
false
0
OnGUITimer(wxTimerEvent& WXUNUSED(evt)) { // Former TimerProc section static uint32 msPrev1, msPrev5; uint32 msCur = theStats::GetUptimeMillis(); // can this actually happen under wxwin ? if (!SafeState()) { return; } #ifndef CLIENT_GUI static uint32 msPrevGraph, msPrevStats; int msGraphUpdate = thePre...
false
false
false
false
false
0
catgets (nl_catd catalog_desc, int set, int message, const char *string) { __nl_catd catalog; size_t idx; size_t cnt; /* Be generous if catalog which failed to be open is used. */ if (catalog_desc == (nl_catd) -1 || ++set <= 0 || message < 0) return (char *) string; catalog = (__nl_catd) catalog_desc...
false
false
false
false
false
0
keyReleaseEvent(XKeyEvent &ke) { if (m_cycling) { unsigned int state = FbTk::KeyUtil::instance().cleanMods(ke.state); state &= ~FbTk::KeyUtil::instance().keycodeToModmask(ke.keycode); if (state) // still cycling return; m_cycling = false; focusControl().stopCycl...
false
false
false
false
false
0
plLibOpen(const char *fn) /* pmr: const */ { FILE *ret = NULL; PDFstrm *pdfs = plLibOpenPdfstrm(fn); if (pdfs == NULL) { return NULL; } if (pdfs->file != NULL) { ret = pdfs->file; pdfs->file = NULL; } pdf_close(pdfs); return ret; }
false
false
false
false
false
0
InList(const char *s) const { if (0 == words) return false; unsigned char firstChar = s[0]; int j = starts[firstChar]; if (j >= 0) { while (static_cast<unsigned char>(words[j][0]) == firstChar) { if (s[1] == words[j][1]) { const char *a = words[j] + 1; const char *b = s + 1; while (*a && *a == *b...
false
false
false
false
false
0
fore200e_activate_vcin(struct fore200e* fore200e, int activate, struct atm_vcc* vcc, int mtu) { struct host_cmdq* cmdq = &fore200e->host_cmdq; struct host_cmdq_entry* entry = &cmdq->host_entry[ cmdq->head ]; struct activate_opcode activ_opcode; struct deactivate_opcode deactiv_opcode; str...
false
false
false
false
false
0
setIconInternal(NETRArray<NETIcon> &icons, int &icon_count, Atom property, NETIcon icon, Bool replace) { if (role != Client) return; int proplen, i, sz, j; if (replace) { for (i = 0; i < icons.size(); i++) { delete [] icons[i].data; icons[i].data = 0; icons[i].siz...
false
false
false
false
false
0
at(K x, K y) { K a,z; if(4==xt)R NYI; //TODO: Value/Execute when 4==xt ... weird cases: (first a:1) if(7!=xt)R at_verb(x,y); a=enlist(y); M(a) z=dot(x,a); cd(a); R z; }
false
false
false
false
false
0
MGPS_sepoly(CPoint3 *pts, int num, double ewidth, int *ecol) { int i; for (i=2; i<num; i++) smoothTriangle(pts, pts+i-1, pts+i); for (i=0; i<num; i++) fprintf(psout, "%g %g ", pts[i].x, pts[i].y); fprintf(psout, "%g %g %g ", ecol[0]/255.0, ecol[1]/255.0, ecol[2]/255.0); fprintf(psout, "%g clines\...
false
false
false
false
false
0
gsf_outfile_open_pkg_set_content_type (GsfOutfileOpenPkg *open_pkg, char const *content_type) { g_return_if_fail (content_type != NULL); if (open_pkg->content_type != content_type) { g_free (open_pkg->content_type); open_pkg->content_type = g_strdup (content_type); } }
false
false
false
false
false
0
fix_invalid_entities (const gchar * line) { const gchar *cp, *pp; /* current pointer, previous pointer */ gssize size; GString *ret = g_string_new (NULL); pp = line; cp = strchr (line, '&'); while (cp) { size = cp - pp; ret = g_string_append_len (ret, pp, size); cp++; if (g_ascii_st...
false
false
false
false
false
0
fnt_face_done_fonts( FNT_Face face ) { FT_Memory memory = FT_FACE(face)->memory; FT_Stream stream = FT_FACE(face)->stream; FNT_Font* cur = face->fonts; FNT_Font* limit = cur + face->num_fonts; for ( ; cur < limit; cur++ ) fnt_font_done( cur, stream ); FREE( face->fonts ); ...
false
false
false
false
false
0
ExecReScanSort(SortState *node) { PlanState *outerPlan = outerPlanState(node); /* * If we haven't sorted yet, just return. If outerplan's chgParam is not * NULL then it will be re-scanned by ExecProcNode, else no reason to * re-scan it at all. */ if (!node->sort_Done) return; /* must drop pointer to so...
false
false
false
false
false
0
opustex_is_out_of_neume (gregorio_syllable * syllable) { if (!(syllable->text) && !(syllable->elements[1]) && syllable->elements[0]->type != GRE_ELEMENT) { return 1; } return 0; }
false
false
false
false
false
0
fs_nice_transmitter_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { FsNiceTransmitter *self = FS_NICE_TRANSMITTER (object); switch (prop_id) { case PROP_COMPONEN...
false
false
false
false
false
0
FilterTimeMatch(time_t stattime,char *from,char *to) { time_t fromtime,totime, now = CFSTARTTIME; fromtime = Date2Number(from,now); totime = Date2Number(to,now); return ((fromtime < stattime) && (stattime < totime)); }
false
false
false
false
false
0
e1000e_update_mc_addr_list_generic(struct e1000_hw *hw, u8 *mc_addr_list, u32 mc_addr_count) { u32 hash_value, hash_bit, hash_reg; int i; /* clear mta_shadow */ memset(&hw->mac.mta_shadow, 0, sizeof(hw->mac.mta_shadow)); /* update mta_shadow from mc_addr_list */ for (i = 0...
false
false
false
false
false
0
discard() { if (!(flags&ConnectionClose) && !(flags&HeadRequest)) { FXchar buffer[1024]; while(readBody(buffer,1024)==1024) ; } }
false
false
false
false
false
0
time_save(const void *ip, const struct xt_entry_match *match) { const struct xt_time_info *info = (const void *)match->data; unsigned int h, m, s; if (info->daytime_start != XT_TIME_MIN_DAYTIME || info->daytime_stop != XT_TIME_MAX_DAYTIME) { divide_time(info->daytime_start, &h, &m, &s); printf(" --timestar...
false
false
false
false
false
0
showOnlyThisTrack() { QList <GpxTrack> &tlist = gpx.getTracks(); for (int i=0; i<tlist.size(); i++) { tlist[i].setVisible(i == menuIndex? true: false); trkList[i]->setCheckState(i==menuIndex? Qt::Checked: Qt::Unchecked); } trkItem->setCheckState(Qt::Checked); mapWidget->showTracks(gpx.getTracks()); }
false
false
false
false
false
0
initialize (const char *const filePath, tagFileInfo *const info) { tagFile *result = (tagFile*) malloc (sizeof (tagFile)); if (result != NULL) { memset (result, 0, sizeof (tagFile)); growString (&result->line); growString (&result->name); result->fields.max = 20; result->fields.list = (tagExtensionFiel...
false
false
false
false
true
1
sigusr2_handler(int nr) { int ile = queue_size(waiting); while (ile) { thread_data* el = (thread_data*) queue_front(waiting); queue_pop(waiting); switch (aio_error(el->aio)) { case 0: queue_push(working, el); return; case EINPROGRES...
false
false
false
false
false
0
skd_timer_tick(ulong arg) { struct skd_device *skdev = (struct skd_device *)arg; u32 timo_slot; u32 overdue_timestamp; unsigned long reqflags; u32 state; if (skdev->state == SKD_DRVR_STATE_FAULT) /* The driver has declared fault, and we want it to * stay that way until driver is reloaded. */ return; ...
false
false
false
false
false
0
hud_lock_has_homing_point() { if ( Player_ai->targeted_subsys || Player->locking_subsys || Player->locking_on_center ) { return 1; } return 0; }
false
false
false
false
false
0
reconnect(SMSCConn *conn) { SmscWrapper *wrap = conn->data; Msg *msg; int ret; int wait = 1; /* disable double-reconnect * NOTE: it is still possible that we do double-connect if * first thread gets through this if-statement and then * execution switches to another thread.. this ...
false
false
false
false
false
0
_read_reg(struct w1_slave *sl, u8 address, unsigned char* buf) { u8 wrbuf[3]; dev_dbg(&sl->dev, "Reading with slave: %p, reg addr: %0#4x, buff addr: %p", sl, (unsigned int)address, buf); if (!buf) return -EINVAL; mutex_lock(&sl->master->bus_mutex); dev_dbg(&sl->dev, "mutex locked"); if (w1_reset_select...
false
false
false
false
false
0
start_element_handler (GMarkupParseContext *context, const gchar *element_name, const gchar **attribute_names, const gchar **attribute_values, gpointer user_data, GError **error) { ParseInfo *info = (ParseInfo *)user_data; if (ELEMENT_IS (TAG_RECENT_FILES)) push_state (...
false
false
false
false
false
0
guestfs_session_readdir(GuestfsSession *session, const gchar *dir, GError **err) { guestfs_h *g = session->priv->g; if (g == NULL) { g_set_error(err, GUESTFS_ERROR, 0, "attempt to call %s after the session has been closed", "readdir"); return NULL; } struct guestfs_diren...
false
false
false
false
false
0
rk3x_i2c_start(struct rk3x_i2c *i2c) { u32 val; rk3x_i2c_clean_ipd(i2c); i2c_writel(i2c, REG_INT_START, REG_IEN); /* enable adapter with correct mode, send START condition */ val = REG_CON_EN | REG_CON_MOD(i2c->mode) | REG_CON_START; /* if we want to react to NACK, set ACTACK bit */ if (!(i2c->msg->flags & I2...
false
false
false
false
false
0
xen_blkbk_unmap(struct xen_blkif *blkif, struct grant_page *pages[], int num) { struct gnttab_unmap_grant_ref unmap[BLKIF_MAX_SEGMENTS_PER_REQUEST]; struct page *unmap_pages[BLKIF_MAX_SEGMENTS_PER_REQUEST]; unsigned int invcount = 0; int ret; while (num) { ...
false
false
false
false
false
0
writeText(const std::string &v, const char *name) { printLevel(); if (name) { printString(name); printString(" = \""); } for (size_t i = 0; i<v.size(); i++) if (v[i] == '\"') printString("\\\""); else backend->putc(v[i]); printString("\";\n"); }
false
false
false
false
false
0
check_flags (unsigned op, unsigned flags) { unsigned res = ~flags & op; if(res & KADM5_PRIV_GET) return KADM5_AUTH_GET; if(res & KADM5_PRIV_GET_KEYS) return KADM5_AUTH_GET_KEYS; if(res & KADM5_PRIV_ADD) return KADM5_AUTH_ADD; if(res & KADM5_PRIV_MODIFY) return KADM5_AUTH_MODIFY; if(re...
false
false
false
false
false
0
acct_storage_p_close_connection(pgsql_conn_t **pg_conn) { if(!pg_conn || !*pg_conn) return SLURM_SUCCESS; acct_storage_p_commit((*pg_conn), 0); /* discard changes */ pgsql_close_db_connection(&(*pg_conn)->db_conn); list_destroy((*pg_conn)->update_list); xfree((*pg_conn)->cluster_name); xfree((*pg_conn)); ret...
false
false
false
false
false
0
sony_allocate_output_report(struct sony_sc *sc) { if ((sc->quirks & SIXAXIS_CONTROLLER) || (sc->quirks & NAVIGATION_CONTROLLER)) sc->output_report_dmabuf = kmalloc(sizeof(union sixaxis_output_report_01), GFP_KERNEL); else if (sc->quirks & DUALSHOCK4_CONTROLLER_BT) sc->output_report_dmabuf = kmalloc(DS4_...
false
false
false
false
false
0
reset_angles() { outsideLoop()->set_rel_angle(0); SEC_loop *rloop = rootsideLoop(); Angle toFix(rloop->get_center(), strandToOutside()->get_fixpoint()); set_abs_angle(toFix); }
false
false
false
false
false
0
procmerge(const char *dbname, const char *tgname){ ESTDB *db; int ecode; time_t curtime; curtime = time(NULL); if(!(db = est_db_open(dbname, ESTDBWRITER, &ecode))){ printferror("%s: %s", dbname, est_err_msg(ecode)); return 1; } est_db_set_informer(db, dbinform, NULL); if(!est_db_merge(db, tgname...
false
false
false
false
false
0
DoSetSplitterPosition( int newXPos, int splitterColumn, bool WXUNUSED(allPages), bool fromAutoCenter ) { wxPropertyGrid* pg = GetGrid(); int adjust = newXPos - DoGetSplitterPosition(splitterColumn); if ( !pg->HasVirtualWidth() ) { // No virtual width int otherColumn; if ( adjus...
false
false
false
false
false
0
ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructure_type (gpointer src, MonoReflectionType *type) { MonoClass *klass; MonoDomain *domain = mono_domain_get (); MonoObject *res; if (src == NULL) return NULL; MONO_CHECK_ARG_NULL (type, NULL); klass = mono_class_from_mono_type (type->type); if (!mon...
false
false
false
false
false
0
property_traverse(PyObject *self, visitproc visit, void *arg) { propertyobject *pp = (propertyobject *)self; Py_VISIT(pp->prop_get); Py_VISIT(pp->prop_set); Py_VISIT(pp->prop_del); Py_VISIT(pp->prop_doc); return 0; }
false
false
false
false
false
0
mgmt_pin_code_request(int sk, uint16_t index, void *buf, size_t len) { struct mgmt_ev_pin_code_request *ev = buf; struct controller_info *info; char addr[18]; int err; if (len < sizeof(*ev)) { error("Too small pin_code_request event"); return; } ba2str(&ev->addr.bdaddr, addr); DBG("hci%u %s", index, addr...
false
false
false
false
false
0
destroy() { // Have to delete the VAO & VBOs to avoid leaking resources. glDeleteVertexArrays(1, &m_vertArrayObj); glDeleteBuffers(Shader::NUM_VERTEX_ATTRIBS, m_vertBuffers); // All geometry data was allocated contiguously with one malloc call if (m_vertPositions) free(m_vertPositions); m_vertPositions = 0; m_v...
false
false
false
false
false
0
parse_uint15(private_parser_t *this, int rule_number, u_int16_t *output_pos) { if (this->byte_pos + sizeof(u_int16_t) > this->input_roof) { return short_input(this, rule_number); } if (this->bit_pos != 1) { return bad_bitpos(this, rule_number); } if (output_pos) { memcpy(output_pos, this->byte_pos,...
false
true
false
false
false
1
t1_poll(struct napi_struct *napi, int budget) { struct adapter *adapter = container_of(napi, struct adapter, napi); int work_done = process_responses(adapter, budget); if (likely(work_done < budget)) { napi_complete(napi); writel(adapter->sge->respQ.cidx, adapter->regs + A_SG_SLEEPING); } return work...
false
false
false
false
false
0
_maxI_sum_find(unsigned int maxI[2], double *sumon, double *sumoff, double mat[6][6]) { double maxm, tmp; unsigned int rrI, ccI; /* we hope that all these loops are unrolled by the optimizer */ *sumon = *sumoff = 0.0; for (rrI=0; rrI<6; rrI++) { *sumon += AIR_ABS(mat[rrI][rrI]); } maxm...
false
false
false
false
false
0
skip_field(struct csa *csa) { /* read and skip next field (assumed to be blank) */ read_field(csa); if (csa->field[0] != '\0') error(csa, "field %d must be blank\n", csa->fldno); return; }
false
false
false
false
false
0
find_bits(unsigned long mask, UINT8 *first, UINT8* len) { unsigned char bit_pos = 0, bit_len = 0; *first =0; *len = 0; if (mask == 0) return; while (!(mask & 0x1)) { mask = mask >> 1; bit_pos++; } while (mask & 0x1) { mask = mask >> 1; bit_len++; } *first = bit_pos; *len = bit_len; }
false
false
false
false
false
0
lift_object(obj, container, cnt_p, telekinesis) struct obj *obj, *container; /* object to pick up, bag it's coming out of */ long *cnt_p; boolean telekinesis; { int result, old_wt, new_wt, prev_encumbr, next_encumbr; if (obj->otyp == BOULDER && In_sokoban(&u.uz)) { You("cannot get your %s around this %s.", ...
false
false
false
false
false
0
find_storage_resource(UAContext *ua, RESTORE_CTX &rx, char *Storage, char *MediaType) { STORE *store; if (rx.store) { Dmsg1(200, "Already have store=%s\n", rx.store->name()); return; } /* * Try looking up Storage by name */ LockRes(); foreach_res(store, R_STORAGE) { if (str...
false
false
false
false
false
0
reproduce(int ind_level) { Out.push("InBFS ("); iter->reproduce(0); Out.push(" : "); src->reproduce(0); if (use_transpose) Out.push("^"); Out.push(".Nodes "); Out.push(" ; "); root->reproduce(0); Out.push(")"); /* if ((edge_cond != NULL) || (node_cond != NULL)) { Out.pu...
false
false
false
false
false
0
sdhci_iproc_readl(struct sdhci_host *host, int reg) { u32 val = readl(host->ioaddr + reg); pr_debug("%s: readl [0x%02x] 0x%08x\n", mmc_hostname(host->mmc), reg, val); return val; }
false
false
false
false
false
0
streamTo(SourceStream &s) const { s << SourceStream::Endl << "for ("; if (varDecl) s << "var " << varDecl; else s << lexpr; s << " in " << expr << ')' << SourceStream::Indent << statement << SourceStream::Unindent; }
false
false
false
false
false
0
ssl_load_private_key(struct ssl_context_handle* ctx_, const char* pem_file) { struct net_context_openssl* ctx = (struct net_context_openssl*) ctx_; if (SSL_CTX_use_PrivateKey_file(ctx->ssl, pem_file, SSL_FILETYPE_PEM) < 0) { LOG_ERROR("SSL_CTX_use_PrivateKey_file: %s", ERR_error_string(ERR_get_error(), NULL)); r...
false
false
false
false
false
0
gfork_l_sigchld( void * user_arg) { int child_pid; int child_status; int child_rc; globus_bool_t dead; gfork_log(2, "Sigint child\n"); globus_mu...
false
false
false
false
false
0
cr_input_new_real (void) { CRInput *result = NULL; result = g_try_malloc (sizeof (CRInput)); if (!result) { cr_utils_trace_info ("Out of memory"); return NULL; } memset (result, 0, sizeof (CRInput)); PRIVATE (result) = g_try_malloc (sizeo...
false
false
false
false
false
0
vte_get_working_directory(void) { gchar buffer[4096 + 1]; gchar *file; gchar *cwd; gint length; if (pid > 0) { file = g_strdup_printf("/proc/%d/cwd", pid); length = readlink(file, buffer, sizeof(buffer)); if (length > 0 && *buffer == '/') { buffer[length] = '\0'; g_free(vte_info.dir); vte_in...
false
false
false
false
false
0
vp3021_alps_tded4_tuner_set_params(struct dvb_frontend *fe) { struct dtv_frontend_properties *c = &fe->dtv_property_cache; struct dvb_bt8xx_card *card = (struct dvb_bt8xx_card *) fe->dvb->priv; u8 buf[4]; u32 div; struct i2c_msg msg = { .addr = 0x60, .flags = 0, .buf = buf, .len = sizeof(buf) }; div = (c->freque...
false
false
false
false
false
0
SHA1_Final( SHA1_ctx* ctx, byte digest[ SHA1_DIGEST_BYTES ] ) { unsigned mlen = 0 ; unsigned padding = 0 ; #if defined( word64 ) word64 temp = 0 ; #endif #if defined( word64 ) mlen = (unsigned)(( ctx->bits >> 3 ) % SHA1_INPUT_BYTES); #else mlen = (unsigned)(( ctx->lbits >> 3 ) % SHA1_INPUT_BYTES); ...
false
true
false
false
false
1
identity_page_button_clicked(GtkWidget* widget_p, void* data) { IdentityPage* instance_p = static_cast<IdentityPage*>(data); int message_index; if (widget_p == instance_p->name_help_button_p) { message_index = IdentityMessages::name; } else if (widget_p == instance_p->number_help_button_p) { message_i...
false
false
false
false
false
0
GetPalette() const { if ((pDib)&&(head.biClrUsed)) return (RGBQUAD*)((BYTE*)pDib + sizeof(BITMAPINFOHEADER)); return NULL; }
false
false
false
false
false
0
doShuffleTestOnMultiFile(const std::string &filename) { cout << " True Shuffling: " << filename << endl; std::string file = OBTestUtil::GetFilename(filename); // read a smiles string OBMol mol; OBConversion canConv; OBFormat *format = canConv.FormatFromExt(file.c_str()); OB_REQUIRE( format ); OB_REQUIRE...
false
false
false
false
false
0
increment_clone(char *last_rsc_id) { int lpc = 0; int len = 0; char *tmp = NULL; gboolean complete = FALSE; CRM_CHECK(last_rsc_id != NULL, return NULL); if (last_rsc_id != NULL) { len = strlen(last_rsc_id); } lpc = len - 1; while (complete == FALSE && lpc > 0) { swi...
false
false
false
false
false
0
copy_tag_nolock(StgClosure **p, const StgInfoTable *info, StgClosure *src, nat size, nat gen_no, StgWord tag) { StgPtr to, from; nat i; to = alloc_for_copy(size,gen_no); from = (StgPtr)src; to[0] = (W_)info; for (i = 1; i < size; i++) { // unroll for small i to[i] = from[i]; } ...
false
false
false
false
false
0
Dump() { cerr << "DocMatch id: " << id << " {" << endl; locations->Start_Get(); for(int i = 0; i < locations->Count(); i++) { Location *loc = (Location *)locations->Get_Next(); cerr << "location [" << loc->from; cerr << ", " << loc->to << "] "; cerr << "weight " << loc->weight; cerr << " flags " << loc->...
false
false
false
false
false
0
ibus_get_socket_path (void) { static gchar *path = NULL; if (path == NULL) { gchar *hostname = "unix"; gchar *display; gchar *displaynumber = "0"; /* gchar *screennumber = "0"; */ gchar *p; path = g_strdup (g_getenv ("IBUS_ADDRESS_FILE")); if (path != NU...
false
false
false
false
false
0
gst_init_check (int *argc, char **argv[], GError ** err) { #ifndef GST_DISABLE_OPTION_PARSING GOptionGroup *group; GOptionContext *ctx; #endif gboolean res; if (gst_initialized) { GST_DEBUG ("already initialized gst"); return TRUE; } #ifndef GST_DISABLE_OPTION_PARSING ctx = g_option_context_new ("-...
false
false
false
false
false
0
_screen_primary_output_assign(E_Randr_Output_Info *removed) { Eina_List *iter; E_Randr_Output_Info *primary_output = NULL, *output_info; EINA_SAFETY_ON_TRUE_RETURN(E_RANDR_12_NO_OUTPUTS); if (e_randr_screen_info.rrvd_info.randr_info_12->primary_output && (removed != e_randr_screen_info.rrvd_info.randr_inf...
false
false
false
false
false
0
a2dp_get(struct avdtp *session, struct avdtp_remote_sep *rsep) { GSList *l; struct a2dp_server *server; struct avdtp_service_capability *cap; struct avdtp_media_codec_capability *codec_cap = NULL; bdaddr_t src; avdtp_get_peers(session, &src, NULL); server = find_server(servers, &src); if (!server) return...
false
false
false
false
false
0
pan_cache_step_done_cb(CacheLoader *cl, gint error, gpointer data) { PanWindow *pw = data; if (pw->cache_list) { PanCacheData *pc; pc = pw->cache_list->data; if (!pc->cd) { pc->cd = cl->cd; cl->cd = NULL; } } cache_loader_free(cl); pw->cache_cl = NULL; pan_layout_update_idle(pw); }
false
false
false
false
false
0
copy_temp_to_slot(Lm *lm, const int kind) { int slot_num = get_slot_num(lm, kind); int i; for (i = 0; i < slot_num; i++) { Slot *slot = get_slot(lm, kind, i); copy_temp_to_slot_body(slot); } }
false
false
false
false
false
0
read(int *ip) { Lock qlock(Q_mutex, false); inRead = 1; qlock.get(); void* cp = base_p[read_p].qcp ; // Read the aprsString* if (ip) *ip = base_p[read_p].qcmd ; // read the optional integer command base_p[read_p].qcp = NULL; // Set the data pointer to NULL base_p...
false
false
false
false
false
0
remove_duplicate_connections() { // 5.Dec.1999 - This function dominated the running time of click-xform. // Use an algorithm faster on the common case (few connections per // element). int nelem = _elements.size(); Vector<int> removers; for (int i = 0; i < nelem; i++) { int trav = _first_con...
false
false
false
false
false
0
send_entity() { char* cl; int len; int left; int tr; if (entity_len > 0) { outs("entity\n"); outs(itoa(entity_len)); out(1, " "); out(entity_len, entity_buf); out(1, "\n"); } }
false
false
false
false
false
0
find_x(const char *s, int len, int style, int x) const { IS_UTF8_ALIGNED(s) // TODO: use binary search which may be quicker. int i = 0; while (i<len) { int cl = fl_utf8len1(s[i]); int w = int( string_width(s, i+cl, style) ); if (w>x) return i; i += cl; } return len; }
false
false
false
false
false
0
add(const QString &openStr, bool isUrl) { if( isUrl ) { add( KUrl( openStr ) ); } else { KUrl url; url.setPath( openStr ); add( url ); } }
false
false
false
false
false
0
sun_set_xcyl(void) { sunlabel->apc = SSWAP16(read_int(0, SSWAP16(sunlabel->apc), sectors, 0, _("Extra sectors per cylinder"))); }
false
false
false
false
false
0
process_speex_page (ogg_state_t *ogg_info, ogg_codec_t *codec, ogg_page *page) { refbuf_t *refbuf; if (codec->headers < 2) { ogg_packet packet; ogg_stream_pagein (&codec->os, page); while (ogg_stream_packetout (&codec->os, &packet) > 0) { /* first time ar...
false
false
false
false
false
0
gray_cs_to_psdrgb_cm(gx_device * dev, frac gray, frac out[]) { int i = ((psd_device *)dev)->devn_params.separations.num_separations; out[0] = out[1] = out[2] = gray; for(; i>0; i--) /* Clear spot colors */ out[2 + i] = 0; }
false
false
false
false
false
0