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
drag_handle (MxSlider *bar, gfloat x, gfloat y) { MxSliderPrivate *priv = bar->priv; gdouble value; gfloat ux, pos, handle_width_2, fill_size, offset; if (!clutter_actor_transform_stage_point (CLUTTER_ACTOR (bar), x, y, ...
false
false
false
false
false
0
brcmf_btcoex_detach(struct brcmf_cfg80211_info *cfg) { brcmf_dbg(TRACE, "enter\n"); if (!cfg->btcoex) return; if (cfg->btcoex->timer_on) { cfg->btcoex->timer_on = false; del_timer_sync(&cfg->btcoex->timer); } cancel_work_sync(&cfg->btcoex->work); brcmf_btcoex_boost_wifi(cfg->btcoex, false); brcmf_btcoe...
false
false
false
false
false
0
dpsh_yuv_decode(unsigned char *src, char *dst, int *decodesize) { int i , dec_size; dec_size=sh_DecodeBlock(src, dst, *decodesize); for (i=1; i< dec_size; i++) dst[i] +=dst [i-1]; *decodesize=dec_size; }
false
false
false
false
false
0
bibl_verbose0( bibl *bin ) { int i; for ( i=0; i<bin->nrefs; ++i ) bibl_verbose2( bin->ref[i], "", i+1 ); }
false
false
false
false
false
0
pqsecure_raw_write(PGconn *conn, const void *ptr, size_t len) { ssize_t n; int flags = 0; int result_errno = 0; char sebuf[256]; DECLARE_SIGPIPE_INFO(spinfo); #ifdef MSG_NOSIGNAL if (conn->sigpipe_flag) flags |= MSG_NOSIGNAL; retry_masked: #endif /* MSG_NOSIGNAL */ DISABLE_SIGPIPE(conn, spinfo, ret...
false
false
false
false
true
1
ev_syserr (const char *msg) { if (!msg) msg = "(libev) system error"; if (syserr_cb) syserr_cb (msg); else { #if EV_AVOID_STDIO ev_printerr (msg); ev_printerr (": "); ev_printerr (strerror (errno)); ev_printerr ("\n"); #else perror (msg); #endif abort (); } }
false
false
false
false
false
0
knowledge_known(const knowledge_player *current, const char *item, const knowledge_type *kt) { int i; for (i = 0; i < current->item_count; i++) { if (strcmp(kt->type, current->items[i]->handler->type) == 0 && strcmp(item, current->items[i]->item) == 0) { /* already known, bailout */ ...
false
false
false
false
false
0
nec_set_irq_line(int irqline, int state) { if (irqline == IRQ_LINE_NMI) { if( I.nmi_state == state ) return; I.nmi_state = state; if (state != CLEAR_LINE) { I.pending_irq |= NMI_IRQ; } } else { I.irq_state = state; if (state == CLEAR_LINE) { // if (!I.IF) NS010718 fix interr...
false
false
false
false
false
0
dbcb_set_prep_stmt(size_t pst_id, const prep_stmt& v) { if (cstate.prep_stmts.size() <= pst_id) { cstate.prep_stmts.resize(pst_id + 1); } cstate.prep_stmts[pst_id] = v; }
false
false
false
false
false
0
tag_is_valid(char *tag_string) { if (!g_ascii_strncasecmp(tag_string, "head", 4) || !g_ascii_strncasecmp(tag_string, "hr", 2) || !g_ascii_strncasecmp(tag_string, "br", 2) || !g_ascii_strncasecmp(tag_string, "body", 4) || !g_ascii_strcasecmp(tag_string, "p") || !g_ascii_strcasecmp(tag_string, "html") || !g_...
false
false
false
false
false
0
do_print_stat_pids( struct stat_context *ctx ) { struct pidinfo *info_p; info_p = ctx->pinfo; while ( info_p != NULL ) { if ( group_get_size( info_p->grp ) > 0 ) { gui_print_pid_banner( info_p ); print_titlebar(); ...
false
false
false
false
false
0
trace_dump_blend_state(const struct pipe_blend_state *state) { unsigned valid_entries = 1; if (!trace_dumping_enabled_locked()) return; if(!state) { trace_dump_null(); return; } trace_dump_struct_begin("pipe_blend_state"); trace_dump_member(bool, state, dither); trace_dump_me...
false
false
false
false
false
0
binascii_crc32_impl(PyModuleDef *module, Py_buffer *data, unsigned int crc) /*[clinic end generated code: output=620a961643393c4f input=bbe340bc99d25aa8]*/ #ifdef USE_ZLIB_CRC32 /* This was taken from zlibmodule.c PyZlib_crc32 (but is PY_SSIZE_T_CLEAN) */ { Byte *buf; Py_ssize_t len; int signed_val; b...
false
false
false
false
false
0
L4() {register object *base=vs_base; register object *sup=base+VM4; VC4 vs_check; vs_top=sup; goto TTL; TTL:; (((object)VV[4])->s.s_dbind)= Cnil; (((object)VV[5])->s.s_dbind)= Cnil; base[0]= ((object)VV[7]); base[1]= ((object)VV[8]); vs_top=(vs_base=base+0)+2; (void) (*Lnk91)(); vs_top=sup; (((object)VV[6])...
false
false
false
false
false
0
initHardwareAnimationElements(VertexData* vdata, ushort numberOfElements, bool animateNormals) { ushort elemsSupported = numberOfElements; if (vdata->hwAnimationDataList.size() < numberOfElements) { elemsSupported = ...
false
false
false
false
false
0
bigint_add2(word x[], u32bit x_size, const word y[], u32bit y_size) { if(bigint_add2_nc(x, x_size, y, y_size)) ++x[x_size]; }
false
false
false
false
false
0
cvs_status_dialog (GtkAction* action, CVSPlugin* plugin, gchar *filename) { GtkBuilder* bxml; GtkWidget* dialog; GtkWidget* fileentry; GtkWidget* project; GtkWidget* button; CVSData* data; GError* error = NULL; bxml = gtk_builder_new(); if (!gtk_builder_add_from_file(bxml, GLADE_FILE, &error)) { g_warning(...
false
false
false
false
false
0
builtins_mdFindObjects_Final ( NSSCKMDFindObjects *mdFindObjects, NSSCKFWFindObjects *fwFindObjects, NSSCKMDSession *mdSession, NSSCKFWSession *fwSession, NSSCKMDToken *mdToken, NSSCKFWToken *fwToken, NSSCKMDInstance *mdInstance, NSSCKFWInstance *fwInstance ) { struct builtinsFOStr *fo = (struct built...
false
false
false
false
false
0
dbuf_puts(dynamic_buffer *dbuf, char const *str) { int l = strlen(str); if (!l) return 0; if (dbuf->allocated_len <= dbuf->len + l) { if (dbuf_makeroom(dbuf, dbuf->len+l) != 0) return -1; } strcpy((dbuf->buffer+dbuf->len), str); dbuf->len += l; return 0; }
false
false
false
false
false
0
eval_args(const wchar_t *line, std::vector<completion_t> &args) { expand_flags_t eflags = 0; if (! show_errors) eflags |= EXPAND_NO_DESCRIPTIONS; if (this->parser_type != PARSER_TYPE_GENERAL) eflags |= EXPAND_SKIP_CMDSUBST; int do_loop=1; CHECK(line, 1); // CHECK( args, 1 ); ...
false
false
false
false
false
0
root_type_1 (type, count) tree type; int count; { /* Give up after searching 1000 levels, in case this is a recursive pointer type. Such types are possible in Ada, but it is not possible to represent them in DWARF1 debug info. */ if (count > 1000) return error_mark_node; switch (TREE_CO...
false
false
false
false
false
0
time_utc_or_local(int argc, VALUE *argv, int utc_p, VALUE klass) { struct vtm vtm; VALUE time; time_arg(argc, argv, &vtm); if (utc_p) time = time_new_timew(klass, timegmw(&vtm)); else time = time_new_timew(klass, timelocalw(&vtm)); if (utc_p) return time_gmtime(time); return...
false
false
false
false
false
0
giggle_revision_set_author (GiggleRevision *revision, GiggleAuthor *author) { g_return_if_fail (GIGGLE_IS_REVISION (revision)); g_return_if_fail (GIGGLE_IS_AUTHOR (author) | !author); g_clear_object (&revision->priv->author); revision->priv->author = g_object_ref (author); }
false
false
false
false
false
0
voter_act(tenm_object *my, const tenm_object *player) { double result[2]; /* sanity check */ if (my == NULL) return 0; if (player == NULL) return 0; /* for deal_damage */ my->count[0] = 0; /* "damaged" count down */ if (my->count[1] > 0) (my->count[1])--; /* speed change */ (my->coun...
false
false
false
false
false
0
glade_gtk_tool_item_post_create (GladeWidgetAdaptor *adaptor, GObject *object, GladeCreateReason reason) { if (GTK_IS_SEPARATOR_TOOL_ITEM (object)) return; if (reason == GLADE_CREATE_USER && gtk_bin_get_child (GTK_BIN (object)) == NULL) gtk_containe...
false
false
false
false
false
0
noise(int samplerate) { static int counter, polyoffs; int c_pa6_level = update_c_pa6(samplerate); int sum = 0; /* * bit 4 of latch A: noise counter rate modulation? * CV2 input of lower 556 is connected via 2k resistor */ if ( sound_latch_a & 0x10 ) counter -= noise_freq * 2 / 3; /* ????? */ ...
false
false
false
false
false
0
BuildFeatureDefn( const char *pszLayerName, CPLODBCStatement *poStmt ) { poFeatureDefn = new OGRFeatureDefn( pszLayerName ); int nRawColumns = poStmt->GetColCount(); poFeatureDefn->Reference(); panFieldOrdinals = (int *) CPLMalloc( sizeof(int) * nRawColumns )...
false
false
false
false
false
0
getFPTOUINT(EVT OpVT, EVT RetVT) { if (OpVT == MVT::f32) { if (RetVT == MVT::i8) return FPTOUINT_F32_I8; if (RetVT == MVT::i16) return FPTOUINT_F32_I16; if (RetVT == MVT::i32) return FPTOUINT_F32_I32; if (RetVT == MVT::i64) return FPTOUINT_F32_I64; if (RetVT == MVT::i128) ...
false
false
false
false
false
0
set_forward_options(void) { #ifdef FORWARD switch(forward_option) { case 'f': kerberos5_set_forward(1); kerberos5_set_forwardable(0); break; case 'F': kerberos5_set_forward(1); kerberos5_set_forwardable(1); break; case 'G': kerberos5_set_forward(0); kerberos5_set_forwardable(0); break; default: ...
false
false
false
false
false
0
SimplifyWithOpReplaced(Value *V, Value *Op, Value *RepOp, const TargetData *TD) { // Trivial replacement. if (V == Op) return RepOp; Instruction *I = dyn_cast<Instruction>(V); if (!I) return 0; // If this is a binary operator, try to simplify it with the replaced...
false
false
false
false
false
0
free_los_section_memory (LOSObject *obj, size_t size) { LOSSection *section = LOS_SECTION_FOR_OBJ (obj); int num_chunks, i, start_index; size += LOS_CHUNK_SIZE - 1; size &= ~(LOS_CHUNK_SIZE - 1); num_chunks = size >> LOS_CHUNK_BITS; g_assert (size > 0 && size - sizeof (LOSObject) <= LOS_SECTION_OBJECT_LIMIT); ...
false
false
false
false
false
0
fill_norms_table (unsigned x0, unsigned y0, unsigned level, const wfa_info_t *wi, motion_t *mt) /* * Compute norms of difference images for all possible displacements * in 'mc_forward_norm' and 'mc_backward_norm'. * * No return value. * * Side effects: * 'mt->mc_backward_norms' are computed * 'mt->mc_fo...
false
false
false
false
false
0
storeProcedures(List *opfamilyname, Oid amoid, Oid opfamilyoid, Oid opclassoid, List *procedures, bool isAdd) { Relation rel; Datum values[Natts_pg_amproc]; bool nulls[Natts_pg_amproc]; HeapTuple tup; Oid entryoid; ObjectAddress myself, referenced; ListCell *l; rel = heap_open(AccessMethodPro...
false
false
false
false
false
0
create_multi_UBspline_1d_s (Ugrid x_grid, BCtype_s xBC, int num_splines) { // Create new spline multi_UBspline_1d_s* restrict spline = malloc (sizeof(multi_UBspline_1d_s)); spline->spcode = MULTI_U1D; spline->tcode = SINGLE_REAL; spline->xBC = xBC; spline->x_grid = x_grid; spline->num_splines = num_splines...
false
false
false
false
false
0
mwifiex_ret_802_11_snmp_mib(struct mwifiex_private *priv, struct host_cmd_ds_command *resp, u32 *data_buf) { struct host_cmd_ds_802_11_snmp_mib *smib = &resp->params.smib; u16 oid = le16_to_cpu(smib->oid); u16 query_type = le16_to_cpu(smib->query_type); u32 ul_temp; mwifiex_dbg(priv->adapter...
false
false
false
false
false
0
libinjection_sqli_lookup_word(struct libinjection_sqli_state *sql_state, int lookup_type, const char* str, size_t len) { if (lookup_type == LOOKUP_FINGERPRINT) { return libinjection_sqli_check_fingerprint(sql_state) ? 'X' : '\0'; } else { return bsearch_keyword...
false
false
false
false
false
0
simplifySection( std::size_t i, std::size_t j) { if ( (i+1) == j ) return; geos::geom::LineSegment seg(pts[i], pts[j]); double maxDistance = -1.0; std::size_t maxIndex = i; for (std::size_t k=i+1; k<j; k++) { double distance = seg.distance(pts[k]); if (distance > maxDistance) { maxDistance = distanc...
false
false
false
false
false
0
main (int argc, char **argv) { char *config_path; struct vink_client* cl; int i; while ((i = getopt_long (argc, argv, "", long_options, 0)) != -1) { switch (i) { case 0: break; case '?': fprintf (stderr, "Try `%s --help' for more information.\n", argv[0]); return EXIT_FA...
false
true
false
false
true
1
ChangeSection(MCSection *Section, const MCExpr *Subsection) { MCSection *CurSection = getCurrentSectionOnly(); if (CurSection && isBundleLocked()) report_fatal_error("Unterminated .bundle_lock when changing a section"); MCAssembler &Asm = getAssembler(); // Ensure the prev...
false
false
false
false
false
0
ajRangeIsOrdered(const AjPRange thys) { ajuint nr; ajuint i; ajuint st; ajuint en; ajuint last = 0; nr = thys->n; for(i = 0; i < nr; i++) { ajRangeElementGetValues(thys, i, &st, &en); ajDebug("ajRangeOrdered [%u] st:%u en:%u (last:%u)\n", i, st, en, last...
false
false
false
false
true
1
bgav_qt_mdhd_read(qt_atom_header_t * h, bgav_input_context_t * input, qt_mdhd_t * ret) { int result; READ_VERSION_AND_FLAGS; memcpy(&ret->h, h, sizeof(*h)); result = bgav_input_read_32_be(input, &ret->creation_time) && bgav_input_read_32_be(input, &ret->modification_time) && bga...
false
false
false
false
false
0
RES_WriteObj(struct sess *sp) { char *r; ssize_t low, high; CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); WRW_Reserve(sp->wrk, &sp->fd); if (sp->wrk->obj->response == 200 && sp->http->conds && RFC2616_Do_Cond(sp)) { sp->wantbody = 0; http_SetResp(sp->wrk->resp, "HTTP/1.1", 304, "Not Modified"); http_Unset(...
false
false
false
true
false
1
cmd_cc(int dev_id, int argc, char **argv) { bdaddr_t bdaddr; uint16_t handle; uint8_t role; unsigned int ptype; int dd, opt; role = 0x01; ptype = HCI_DM1 | HCI_DM3 | HCI_DM5 | HCI_DH1 | HCI_DH3 | HCI_DH5; for_each_opt(opt, cc_options, NULL) { switch (opt) { case 'p': hci_strtoptype(optarg, &ptype); ...
false
false
false
false
false
0
PyvtkMINCImageAttributes_GetAttributeValueAsArray(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetAttributeValueAsArray"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkMINCImageAttributes *op = static_cast<vtkMINCImageAttributes *>(vp); char *temp0 = NULL; char *temp1 = NULL; Py...
false
false
false
false
false
0
greallocn(void *p, int nObjs, int objSize, bool checkoverflow) { int n; if (nObjs == 0) { if (p) { gfree(p); } return NULL; } n = nObjs * objSize; if (objSize <= 0 || nObjs < 0 || nObjs >= INT_MAX / objSize) { fprintf(stderr, "Bogus memory allocation size\n"); if (checkoverflow) { ...
false
false
false
false
false
0
Store() { VSILFILE *filIni = VSIFOpenL(filename.c_str(), "w+"); if (filIni == NULL) return; Sections::iterator iterSect; for (iterSect = sections.begin(); iterSect != sections.end(); ++iterSect) { CPLString osLine; // write the section name osLine.Printf( "[%s]\r\n"...
false
false
false
false
false
0
maybeMergeRanges(IntListPtr list, int i) { int rc; while(i > 0 && list->ranges[i].from <= list->ranges[i - 1].to + 1) { list->ranges[i - 1].from = MIN(list->ranges[i - 1].from, list->ranges[i].from); list->ranges[i - 1].to = MAX(list->ranges[i - 1].to, l...
false
false
false
false
false
0
base_print(HSQUIRRELVM v) { const SQChar *str; sq_tostring(v,2); sq_getstring(v,-1,&str); if(_ss(v)->_printfunc) _ss(v)->_printfunc(v,_SC("%s"),str); return 0; }
false
false
false
false
false
0
resume_network(char *buf) { char *p = buf, *p2; int state = 0; struct network *n = network_new(); if (buf[0] == '#') return; while (1) { p2 = strchr(p, '|'); if (!p2) { p2 = strchr(p, '\n'); if (!p2) break; } *p2++ = 0; p = strip_spaces(p); switch (state) { /* ssid */ case 0: s...
false
false
false
false
false
0
strip_whitespace (const char *s) { char *p, *q; char ch; if (s == 0) return 0; p = q = XNEWVEC (char, strlen (s) + 1); while ((ch = *s++) != '\0') if (! ISSPACE (ch)) *p++ = ch; *p = '\0'; return q; }
false
false
false
false
false
0
krb5_write(kx_context *kc, int fd, const void *buf, size_t len) { krb5_data data; krb5_error_code ret; unsigned char tmp[4]; size_t outlen; ret = krb5_encrypt (CONTEXT(kc), K5DATA(kc)->crypto, KRB5_KU_OTHER_ENCRYPTED, buf, len, &data); if (ret){ krb5_warn (CONTEXT(kc), ret, "krb5_wri...
true
true
false
false
false
1
close_map(map * m) { if (m->fd < 0) return; if (G_close_cell(m->fd) < 0) G_fatal_error(_("Unable to close raster map <%s@%s>"), m->name, m->mapset); if (m->have_cats) { btree_free(&m->btree); G_free_cats(&m->cats); m->have_cats = 0; } if (m->have_colors) { G_free_colors(&m->colors);...
false
false
false
false
false
0
suicide_set_config(StonithPlugin* s, StonithNVpair* list) { ERRIFWRONGDEV(s,S_OOPS); return S_OK; }
false
false
false
false
false
0
evergreen_vm_reg_valid(u32 reg) { /* context regs are fine */ if (reg >= 0x28000) return true; /* check config regs */ switch (reg) { case WAIT_UNTIL: case GRBM_GFX_INDEX: case CP_STRMOUT_CNTL: case CP_COHER_CNTL: case CP_COHER_SIZE: case VGT_VTX_VECT_EJECT_REG: case VGT_CACHE_INVALIDATION: case VGT_GS_V...
false
false
false
false
false
0
yypushandrestart(const char *filename, int quoted_form) { FILE *fp = 0; char *path = 0; /* Check for stack overflow */ if (file_stack_ptr == FILE_STACK_SIZE-1) { /* Error, stack overflow */ return 2; } fp = open_included_file(filename, quoted_form, &path); if (fp) { /...
false
false
false
false
false
0
dgap_tty_set_termios(struct tty_struct *tty, struct ktermios *old_termios) { struct board_t *bd; struct channel_t *ch; struct un_t *un; unsigned long lock_flags; unsigned long lock_flags2; if (!tty || tty->magic != TTY_MAGIC) return; un = tty->driver_data; if (!un || un->magic != DGAP_UNIT_MAGIC) ret...
false
false
false
false
false
0
matroxfb_imageblit(struct fb_info* info, const struct fb_image* image) { struct matrox_fb_info *minfo = info2minfo(info); DBG_HEAVY(__func__); if (image->depth == 1) { u_int32_t fgx, bgx; fgx = ((u_int32_t*)info->pseudo_palette)[image->fg_color]; bgx = ((u_int32_t*)info->pseudo_palette)[image->bg_color]; ...
false
false
false
false
false
0
strerror(int errnum) { static char message[32] = "error "; /* enough for error 2^63-1 */ char numbuf[32]; char *p; p = numbuf + sizeof numbuf; *--p = '\0'; do { *--p = (errnum % 10) + '0'; errnum /= 10; } while (errnum); return (char *)memcpy(message + 6, p, (numbuf + sizeof numbuf...
false
false
false
false
false
0
DoVerboseConstructor1Args ( Obj oper, Obj arg1 ) { Obj res; Obj kind1; Obj method; Int i; /* get the kinds of the arguments */ while (!IS_OPERATION(arg1))...
false
false
false
true
false
1
fireStatusChanged(ThreatRefStatusChangeEvent& pThreatRefStatusChangeEvent) { if (getSource()) { getSource()->processThreatEvent(&pThreatRefStatusChangeEvent); } }
false
false
false
false
false
0
Comp_Continue(progfuncs_t *progfuncs) { qccprogfuncs = progfuncs; if (setjmp(qcccompileerror)) { PostCompile(); if (*errorfile && externs->useeditor) externs->useeditor(progfuncs, errorfile, errorline, comp_nump, comp_parms); return false; } if (qcc_compileactive) QCC_ContinueCompile(); else { Pos...
false
false
false
false
false
0
pixPaintBoxa(PIX *pixs, BOXA *boxa, l_uint32 val) { l_int32 i, n, d, rval, gval, bval, newindex; l_int32 mapvacancy; /* true only if cmap and not full */ BOX *box; PIX *pixd; PIXCMAP *cmap; PROCNAME("pixPaintBoxa"); if (!pixs) return (PIX *)ERROR_PT...
false
false
false
false
false
0
pr_process(const int bytes, struct sp_xpmsg *req) { struct joborptr *pp; struct spptr inptr; if (bytes != sizeof(struct sp_xpmsg)) { disp_arg[9] = bytes; report(1110); /* {Sched ptr message length error} */ } pp = fetch_ptr(); if (pp->jorp_sender != req->spr_pid) { nfreport(8120); /* {Buffer sequence...
false
false
false
false
false
0
doEnter() { e->textCursor().insertBlock(); return true; }
false
false
false
false
false
0
eXdbmGetVarString(DB_ID dbid, DB_LIST list, char *entryname, char **value) { TDbmListEntry *search; int ret; /* the database manager must be initialized */ ret = DbmIsInit(); if( ret == -1) return(-1); /* check the dbid parameter */ if(CheckDbIdent(dbid) == -1) { RaiseError(DBM_WRONG_ID); retu...
false
false
false
false
false
0
setshflag(n, val) int n, val; { #if defined (FD) && !defined (_NOEDITMODE) CONST char *cp; #endif *(shflaglist[n].var) = val; #if defined (FD) && !defined (_NOEDITMODE) if (shflaglist[n].var == &emacsmode) cp = "emacs"; else if (shflaglist[n].var == &vimode) cp = "vi"; else cp = NULL; if (cp) { emacsmode = v...
false
false
false
false
false
0
execMenu( QAction* action ) { foreach ( QToolButton* button, m_toolButtons ) { if ( button->defaultAction() == action ) { button->setDown( true ); action->menu()->exec( button->mapToGlobal( button->rect().bottomLeft() + QPoint( 0, 1 ) ) ); button->setDown( false ); ...
false
false
false
false
false
0
exDXLEndMacroDefinition(DXLConnection *conn) { int sts = 0; if (conn->dxuiConnected) { return ERROR; } else { if (!conn->macroDef) { fprintf(stderr,"exDXLEndMacroDefinition: not valid before exDXLBeginMacroDefinition()\n"); return ERROR; } /* endif */...
false
false
false
false
false
0
sftk_handleKeyObject(SFTKSession *session, SFTKObject *object) { SFTKAttribute *attribute; CK_KEY_TYPE key_type; CK_BBOOL ckfalse = CK_FALSE; CK_RV crv; /* verify the required fields */ if ( !sftk_hasAttribute(object,CKA_KEY_TYPE) ) { return CKR_TEMPLATE_INCOMPLETE; } /* now verify th...
false
false
false
false
false
0
fluid_settings_setnum(fluid_settings_t* settings, const char *name, double val) { fluid_setting_node_t *node; fluid_num_setting_t* setting; int retval = 0; fluid_return_val_if_fail (settings != NULL, 0); fluid_return_val_if_fail (name != NULL, 0); fluid_return_val_if_fail (name[0] != '\0', 0); ...
false
false
false
false
false
0
flat_hindexed(MPI_Datatype dtype, struct trdtype **pbuff, int *psize, int fmt) { int i; /* favourite index */ int extent; /* datatype extent */ /* * Make sure datatype buffer has at least (count + 1) extra records. */ if (checkdtbuf(pbuff, psize, dtype->dt_count + 1)) return(LAMERROR); /* * Add the ...
false
false
false
false
false
0
putOriginalRepresentation( const E_TransferSyntax repType, const DcmRepresentationParameter * repParam, DcmPixelSequence * pixSeq) { // delete RepresentationList clearRepresentationList(repListEnd); // delete unencapsulated representation DcmPolymorphOBOW::putUint16Array(NULL,0); existUn...
false
false
false
false
false
0
ask_user_for_save_uri (GtkWindow* parent) { GtkWidget* dialog; gchar* uri; dialog = gtk_file_chooser_dialog_new (_("Save file as"), parent, GTK_FILE_CHOOSER_ACTION_SAVE, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, NULL); if(gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPO...
false
false
false
false
false
0
ct_ddvcard_factory(GWEN_PLUGIN_MANAGER *pm, const char *modName, const char *fileName) { GWEN_PLUGIN *pl; pl=LC_Crypt_TokenDDV_Plugin_new(pm, modName, fileName); if (pl==NULL) { DBG_ERROR(LC_LOGDOMAIN, "No plugin created"); return NULL; } return pl; }
false
false
false
false
false
0
is_client_associated_to_ibss23a(struct rtw_adapter *padapter) { struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; if (pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS && (pmlmeinfo->state & 0x03) == MSR_ADHOC) return true; else return false; }
false
false
false
false
false
0
xen_late_init_mcelog(void) { int ret; /* Only DOM0 is responsible for MCE logging */ if (!xen_initial_domain()) return -ENODEV; /* register character device /dev/mcelog for xen mcelog */ ret = misc_register(&xen_mce_chrdev_device); if (ret) return ret; ret = bind_virq_for_mce(); if (ret) goto deregiste...
false
false
false
false
false
0
chi2_test(random_fn_t fn, unsigned max) { unsigned classes; unsigned *values; unsigned n, i, expected; double ratio, chi2, p; int retried = 0; classes = MIN(CHI_MAX_CLASSES, max); XMALLOC0_ARRAY(values, classes); printf("Chi-squared test with uniform %u random numbers over %u classes:\n", max, classes); e...
false
false
false
false
false
0
adf_init_ring(struct adf_etr_ring_data *ring) { struct adf_etr_bank_data *bank = ring->bank; struct adf_accel_dev *accel_dev = bank->accel_dev; struct adf_hw_device_data *hw_data = accel_dev->hw_device; uint64_t ring_base; uint32_t ring_size_bytes = ADF_SIZE_TO_RING_SIZE_IN_BYTES(ring->ring_size); ring_size_b...
false
false
false
false
false
0
GC_remove_roots_inner(ptr_t b, ptr_t e) { int i; for (i = 0; i < n_root_sets; ) { if ((word)GC_static_roots[i].r_start >= (word)b && (word)GC_static_roots[i].r_end <= (word)e) { GC_remove_root_at_pos(i); } else { i++; } } GC_rebuild_root_inde...
false
false
false
false
false
0
resolve_relay_free (struct ResolveRelayCb *rrc) { GHashTableIter iter; gpointer value; g_object_unref (rrc->source); g_clear_object(&rrc->media); g_clear_error (&rrc->error); g_object_unref (rrc->options); g_list_free (rrc->keys); if (rrc->map) { g_hash_table_iter_init (&iter, rrc->map); while...
false
false
false
false
false
0
GXDrawCreatePixmap(GDisplay *gdisp, uint16 width, uint16 height) { GXWindow gw = gcalloc(1,sizeof(struct gxwindow)); int wamcairo = false; if ( gw==NULL ) return( NULL ); gw->ggc = _GXDraw_NewGGC(); gw->ggc->bg = ((GXDisplay *) gdisp)->def_background; if ( gw->ggc==NULL ) { gfree(gw); return( ...
false
false
false
false
false
0
ncp_alloc_req(void) { struct ncp_request_reply *req; req = kmalloc(sizeof(struct ncp_request_reply), GFP_KERNEL); if (!req) return NULL; init_waitqueue_head(&req->wq); atomic_set(&req->refs, (1)); req->status = RQ_IDLE; return req; }
false
false
false
false
false
0
pcl3_set_printquality(pcl_FileData *data, int quality) { data->print_quality = quality; if (pcl_use_oldquality(data->level)) return pcl3_set_oldquality(data); return 0; }
false
false
false
false
false
0
databuf_append(DataBuf *db, const char *src, size_t src_size) { size_t new_size; DATABUF_VALIDATE(db); if (src == NULL || src_size == 0) return 0; new_size = db->len+src_size; #ifdef DEBUG if (debug) databuf_print(db, 1, "databuf_append() size=%zd", src_size); #endif if ((new_size > db->allo...
false
false
false
false
false
0
startTranscript() { time_t tick; if (logFile != NULL) return; time(&tick); struct timeval tv; struct tm *tm; gettimeofday(&tv, NULL); tm = localtime(&tv.tv_sec); sprintf(logFileName, "%s%d%02d%02d%02d%02d%02d%04d.log", adventureName, tm->tm_year+1900, tm->tm_mon+1, tm->...
false
false
false
false
false
0
add_cmd_usage(Jim_Interp *interp, const jim_subcmd_type * ct, Jim_Obj *cmd) { if (cmd) { Jim_AppendStrings(interp, Jim_GetResult(interp), Jim_String(cmd), " ", NULL); } Jim_AppendStrings(interp, Jim_GetResult(interp), ct->cmd, NULL); if (ct->args && *ct->args) { Jim_AppendStrings(interp,...
false
false
false
false
false
0
memory_subsys_offline(struct device *dev) { struct memory_block *mem = to_memory_block(dev); if (mem->state == MEM_OFFLINE) return 0; /* Can't offline block with non-present sections */ if (mem->section_count != sections_per_block) return -EINVAL; return memory_block_change_state(mem, MEM_OFFLINE, MEM_ONLIN...
false
false
false
false
false
0
OnTCPTimer(CTimerEvent& WXUNUSED(evt)) { if(!IsRunning()) { return; } serverconnect->StopConnectionTry(); if (IsConnectedED2K() ) { return; } serverconnect->ConnectToAnyServer(); }
false
false
false
false
false
0
FCEUSND_Power(void) { int x; SetNESSoundMap(); memset(PSG,0x00,sizeof(PSG)); FCEUSND_Reset(); memset(Wave,0,sizeof(Wave)); memset(WaveHi,0,sizeof(WaveHi)); memset(&EnvUnits,0,sizeof(EnvUnits)); for(x=0;x<5;x++) ChannelBC[x]=0; soundtsoffs=0; LoadDM...
false
false
false
false
false
0
clear_trans_filt(trans *p,int filtn) { int i; p->set &= ~((tflags) (1 << filtn) ); p->pes &= ~((tflags) (1 << filtn) ); p->is_full &= ~((tflags) (1 << filtn) ); p->pes_start &= ~((tflags) (1 << filtn) ); p->pes_started &= ~((tflags) (1 << filtn) ); for (i = MASKL*filtn; i < MASKL*(filtn+1) ; i++){ p->mask[i]...
false
false
false
false
false
0
change_Felix (QString c) { int p = page_felix (c); spinBox->setValue (p); }
false
false
false
false
false
0
nextChar(IteratedChar* it, InputText* det) const { int32_t firstByte; it->index = it->nextIndex; it->error = FALSE; firstByte = it->charValue = it->nextByte(det); if (firstByte < 0) { return FALSE; } if (firstByte <= 0x7F || firstByte == 0xFF) { // single byte character. ...
false
false
false
false
false
0
_dxf_attributeFuzz(attributeP att, double *ff) { ENTRY(("_dxf_attributeFuzz(0x%x, 0x%x)", att, ff)); if (ff) *ff = att->ff; EXIT(("")); return &att->fuzz; }
false
false
false
false
false
0
decode_len(fp, enc, len) FILE *fp; unsigned char *enc; int len; { int rlen; int i; if (print_id_and_len) fprintf(fp, "%02x ", enc[0]); rlen = enc[0]; for (i=1; i<len; i++) { if (print_id_and_len) fprintf(fp, "%02x ", enc[i]); rlen = (rlen * 0x100) + e...
false
false
false
false
false
0
_invalidate_flash(lc_callback cb, void *cb_arg, uint32_t cb_stage) { int err = 0; if ((err = rmt->InvalidateFlash(cb, cb_arg, cb_stage))) return LC_ERROR_INVALIDATE; return 0; }
false
false
false
false
false
0
netdev_timer(unsigned long data) { struct net_device *dev = (struct net_device *)data; struct netdev_private *np = netdev_priv(dev); void __iomem * ioaddr = ns_ioaddr(dev); int next_tick = NATSEMI_TIMER_FREQ; const int irq = np->pci_dev->irq; if (netif_msg_timer(np)) { /* DO NOT read the IntrStatus register, ...
false
false
false
false
false
0
lf_directive(char *line, string_ty **ifn, long *lino) { int result; long n; string_ty *s; char *ep; /* * see if this is a .so directive */ if (*line != '.') return 0; trace(("source(line = \"%s\")\n{\n", line)); result = 0; l...
false
false
false
false
true
1
matroxfb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue, unsigned transp, struct fb_info *fb_info) { struct matrox_fb_info* minfo = container_of(fb_info, struct matrox_fb_info, fbcon); DBG(__func__) /* * Set a single color register. The values supplied are * already r...
false
false
false
false
false
0
getto(P *p, P *cur, P *top, long int line) { if (p == NULL) { P *best = cur; long dist = MAXLONG; long d; d = (line >= cur->line ? line - cur->line : cur->line - line); if (d < dist) { dist = d; best = cur; } d = (line >= top->line ? line - top->line : top->line - line); if (d < dist) { dist...
false
false
false
false
false
0
say_datetime_from_now(struct ast_channel *chan, time_t t, const char *ints, const char *lang) { if (!strncasecmp(lang, "en", 2)) { /* English syntax */ return ast_say_datetime_from_now_en(chan, t, ints, lang); } else if (!strncasecmp(lang, "fr", 2)) { /* French syntax */ return ast_say_datetime_from_now_fr...
false
false
false
false
false
0