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
init_krb5_pa_pk_as_req(krb5_pa_pk_as_req **in) { (*in) = malloc(sizeof(krb5_pa_pk_as_req)); if ((*in) == NULL) return; (*in)->signedAuthPack.data = NULL; (*in)->signedAuthPack.length = 0; (*in)->trustedCertifiers = NULL; (*in)->kdcPkId.data = NULL; (*in)->kdcPkId.length = 0; }
false
false
false
false
false
0
UniformInitializer(GAGenome & c) { GA2DBinaryStringGenome &child=DYN_CAST(GA2DBinaryStringGenome &, c); child.resize(GAGenome::ANY_SIZE, GAGenome::ANY_SIZE); for(int i=child.width()-1; i>=0; i--) for(int j=child.height()-1; j>=0; j--) child.gene(i, j, GARandomBit()); }
false
false
false
false
false
0
AH_JobQueue_Dump(AH_JOBQUEUE *jq, FILE *f, unsigned int insert) { uint32_t k; AH_JOB *j; GWEN_STRINGLISTENTRY *se; for (k=0; k<insert; k++) fprintf(f, " "); fprintf(f, "JobQueue:\n"); for (k=0; k<insert; k++) fprintf(f, " "); fprintf(f, "Usage : %d\n", jq->usage); for (k=0; k<insert; k++) ...
false
false
false
false
false
0
GetPaletteColor(BYTE i, BYTE* r, BYTE* g, BYTE* b) { RGBQUAD* ppal=GetPalette(); if (ppal) { *r = ppal[i].rgbRed; *g = ppal[i].rgbGreen; *b = ppal[i].rgbBlue; return true; } return false; }
false
false
false
false
false
0
btreeIdbucketNew(ajuint n, ajuint refcount) { AjPIdbucket bucket = NULL; AjPBtId Id = NULL; ajuint i; /* ajDebug("In btreeIdbucketNew\n"); */ if(n) { if(statSaveIdbucketNext) { bucket = statSaveIdbucket[--statSaveIdbucketNext]; for(i=0;i<bucket->Max...
false
false
false
false
false
0
get_next_keymap_line (FILE *fp, char *bxsym, char *modsym, Bit32s *ascii, char *hostsym) { char line[256]; char buf[256]; line[0] = 0; while (1) { lineCount++; if (!fgets(line, sizeof(line)-1, fp)) return -1; // EOF init_parse_line (line); if (get_next_word (bxsym) >= 0) { modsym[0] = 0; ...
false
false
false
false
true
1
YuvToBgraRowSSE2(const uint8_t* y, const uint8_t* u, const uint8_t* v, uint8_t* dst, int len) { int n; for (n = 0; n + 2 <= len; n += 2) { const __m128i uv_0 = LoadUVPart(u[0], v[0]); const __m128i tmp0_1 = GetRGBA32bWithUV(y[0], uv_0); const __m...
false
false
false
false
false
0
rs6000_option_init_struct (struct gcc_options *opts) { if (DEFAULT_ABI == ABI_DARWIN) /* The Darwin libraries never set errno, so we might as well avoid calling them when that's the only reason we would. */ opts->x_flag_errno_math = 0; /* Enable section anchors by default. */ if (!TARGET_MACHO) ...
false
false
false
false
false
0
FullSortTophits(struct tophit_s *h) { int i; /* If we don't have /any/ hits, then don't * bother. */ if (h->num == 0) return; /* Assign the ptrs in h->hit. */ h->hit = MallocOrDie(h->num * sizeof(struct hit_s *)); for (i = 0; i < h->num; i++) h->hit[i] = &(h->unsrt[i]); /* Sort the pointer...
false
false
false
false
false
0
ct_ship_process_ABtrails(ship *shipp) { int idx; object *objp; ship_info* sip; Assert(shipp != NULL); Assert(shipp->objnum >= 0); objp = &Objects[shipp->objnum]; sip=&Ship_info[shipp->ship_info_index]; // if this is not a ship, we don't care if((objp->type != OBJ_SHIP) || (Ships[objp->instance].ab_count <...
false
false
false
true
false
1
cmd_exit(ClientData clientData, Tcl_Interp *interp, int argc, char *argv[]) { int status = 0; if (argc > 2) { interp->result = "wrong # args: should be \"exit ?returnCode?\""; return TCL_ERROR; } if (argc == 2 && Tcl_GetInt(interp, argv[1], &status) != TCL_OK) return TCL_ERROR; ...
false
false
false
false
false
0
pergm_print (const char *vname, const double *d, int T, int L, gretlopt opt, PRN *prn) { char xstr[32]; double dt, yt; int t; if (opt & OPT_R) { pprintf(prn, "\n%s\n", _("Residual periodogram")); } else { pprintf(prn, _("\nPeriodogram for %s\n"), vname); } pprintf(prn, _("Number of ...
false
false
false
false
false
0
_rtl92se_hw_configure(struct ieee80211_hw *hw) { struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); struct rtl_phy *rtlphy = &(rtlpriv->phy); struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); u8 reg_bw_opmode = 0; u32 reg_rrsr = 0; u8 regtmp = 0; reg_bw_opmode = BW_OP...
false
false
false
false
false
0
dump_file(gar_t *G, const char *fname) { jmp_buf env; gar_fdata_t *volatile fd = NULL; unsigned char s[1024]; size_t n; // Make sure to close the zipped file stream. if (setjmp(env)) { gar_close(fd); return 1; } // Open the specified zipped file. fd = gar_open(G, fname, env); if (fd == NUL...
false
false
false
false
false
0
jk_putv(jk_ws_service_t *s, ...) { va_list va; const char *str; va_start(va, s); while (1) { str = va_arg(va, const char *); if (str == NULL) break; s->write(s, str, (unsigned int)strlen(str)); } va_end(va); }
false
false
false
false
false
0
herror(s) const char *s; { struct iovec iov[4]; register struct iovec *v = iov; int error = h_errno; if (s && *s) { v->iov_base = (char *)s; v->iov_len = strlen(s); v++; v->iov_base = ": "; v->iov_len = 2; v++; } v->iov_base = ((unsigned int)(error) < h_nerr) ? h_errlist[error] : "Unknown error"; ...
false
false
false
false
false
0
write_descriptors(FILE *file, type_t *type, unsigned int *tfsoff) { unsigned int offset = 0; var_list_t *fs = type_struct_get_fields(type); var_t *f; if (fs) LIST_FOR_EACH_ENTRY(f, fs, var_t, entry) { type_t *ft = f->type; unsigned int size = field_memsize( ft, &offset ); if...
false
false
false
false
false
0
create_pixbuf (const gchar *filename) { gchar *pathname = NULL; GdkPixbuf *pixbuf; GError *error = NULL; if (!filename || !filename[0]) return NULL; pathname = find_pixmap_file (filename); if (!pathname) { g_warning ("Couldn't find pixmap file: %s", filename);...
false
false
false
false
false
0
spi_atk_deregister_event_listeners (void) { gint i; GArray *ids = listener_ids; listener_ids = NULL; if (atk_bridge_focus_tracker_id) { atk_remove_focus_tracker (atk_bridge_focus_tracker_id); atk_bridge_focus_tracker_id = 0; } if (ids) { for (i = 0; i < ids->len; i++) { ...
false
false
false
false
false
0
musb_try_b_hnp_enable(struct musb *musb) { void __iomem *mbase = musb->mregs; u8 devctl; dev_dbg(musb->controller, "HNP: Setting HR\n"); devctl = musb_readb(mbase, MUSB_DEVCTL); musb_writeb(mbase, MUSB_DEVCTL, devctl | MUSB_DEVCTL_HR); }
false
false
false
false
false
0
assoc_mgr_init(void *db_conn, assoc_init_args_t *args, int db_conn_errno) { static uint16_t enforce = 0; static uint16_t cache_level = ASSOC_MGR_CACHE_ALL; static uint16_t checked_prio = 0; if (!checked_prio) { char *prio = slurm_get_priority_type(); if (prio && !strncmp(prio, "priority/multifactor", 20))...
false
false
false
false
false
0
T_FireFlicker (fireflicker_t* flick) { int amount; if (--flick->count) return; amount = (P_Random()&3)*16; if (flick->sector->lightlevel - amount < flick->minlight) flick->sector->lightlevel = flick->minlight; else flick->sector->lightlevel = flick->maxlight - amount; flick->count =...
false
false
false
false
false
0
qh_getdistance(facetT *facet, facetT *neighbor, realT *mindist, realT *maxdist) { vertexT *vertex, **vertexp; realT dist; FOREACHvertex_(facet->vertices) vertex->seen= False; FOREACHvertex_(neighbor->vertices) vertex->seen= True; *mindist= 0.0; *maxdist= 0.0; FOREACHvertex_(facet->vertices) { ...
false
false
false
false
true
1
FcValueCanonicalize (const FcValue *v) { FcValue new; switch ((int) v->type) { case FcTypeString: new.u.s = FcValueString(v); new.type = FcTypeString; break; case FcTypeCharSet: new.u.c = FcValueCharSet(v); new.type = FcTypeCharSet; break; case FcTypeLangSet: new.u.l = FcValueLangSet(v);...
false
false
false
false
false
0
libipv4addr_to_reversestring(ipv6calc_ipv4addr *ipv4addrp, char *resultstring, const uint32_t formatoptions) { int retval = 1; uint8_t octet; int bit_start, bit_end, nbit; char tempstring[NI_MAXHOST]; unsigned int noctet; if ( ((formatoptions & (FORMATOPTION_printprefix | FORMATOPTION_printsuffix | FORMATOPTION...
false
false
false
false
false
0
dl_SQLSetConnectAttr ( SQLHDBC ConnectionHandle, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER StringLength) { typedef SQLRETURN SQL_API ep_SQLSetConnectAttr ( SQLHDBC ConnectionHandle, SQLINTEGER Attribute,...
false
false
false
true
false
1
lookup_display_item (GcrDisplayView *self, GcrRenderer *renderer) { GcrDisplayItem *item = g_hash_table_lookup (self->pv->items, renderer); g_return_val_if_fail (item, NULL); g_assert (item->display_view == self); return item; }
false
false
false
false
false
0
gst_flv_mux_write_buffer (GstFlvMux * mux, GstFlvPad * cpad, GstBuffer * buffer) { GstBuffer *tag; GstFlowReturn ret; /* clipping function arranged for running_time */ if (!mux->streamable) gst_flv_mux_update_index (mux, buffer, cpad); tag = gst_flv_mux_buffer_to_tag (mux, buffer, cpad); gst_buffer_...
false
false
false
false
false
0
utl_alcbyt (size) unsigned int size; { unsigned int max_size; char *pt_blc ; struct uttyp *prv_typ = NULL; struct uttyp *pt_typ = NULL; char *pt_byt ; unsigned int i ; /* ###------------------------------------------------------### */ /* This function makes a memory...
false
false
false
false
false
0
remove_tail_space(char *str) { char *s = str + strlen(str); while (s-- > str && isspace(*s)) *s = 0; }
false
false
false
false
false
0
checksum(struct nv *nv) { uint32_t sum = 0; unsigned int s = nv->size; if (s != sizeof(*nv) / sizeof(sum)) return 0; while (s--) sum += ((uint32_t *) nv)[s]; /* Ignore chksum member itself. */ return nv->chksum - sum == nv->chksum; }
false
false
false
false
false
0
i2400m_dev_start(struct i2400m *i2400m, enum i2400m_bri bm_flags) { int result = 0; mutex_lock(&i2400m->init_mutex); /* Well, start the device */ if (i2400m->updown == 0) { result = __i2400m_dev_start(i2400m, bm_flags); if (result >= 0) { i2400m->updown = 1; i2400m->alive = 1; wmb();/* see i2400m->updow...
false
false
false
false
false
0
eel_editable_label_accessible_delete_text (AtkEditableText *text, gint start_pos, gint end_pos) { GtkWidget *widget; EelEditableLabel *label; GtkEditable *editable; widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text)); if (widget == NULL) /* State is defunct */...
false
false
false
false
false
0
strPrefix(const char * s1, const char * s2) { ASSERT(s1 != NULL && s2 != NULL); unsigned int count = 0; while(*s1 == *s2) { if(*s1 == 0) // seen end of string, strings are identical { return count; } count++; s1++; s2++; } return c...
false
false
false
false
false
0
_ibar_icon_at_coord(IBar *b, Evas_Coord x, Evas_Coord y) { const Eina_List *l; IBar_Icon *ic; EINA_LIST_FOREACH(b->icons, l, ic) { Evas_Coord dx, dy, dw, dh; evas_object_geometry_get(ic->o_holder, &dx, &dy, &dw, &dh); if (E_INSIDE(x, y, dx, dy, dw, dh)) return ic; } retur...
false
false
false
false
false
0
mount_record_new (GMount *mount) { MountRecord *mount_record; mount_record = g_new (MountRecord, 1); mount_record->root = g_mount_get_root (mount); mount_record->name = g_strdup (g_object_get_data (G_OBJECT (mount), "g-stable-name")); mount_record->creation_time = time (NULL); return mount_record; }
false
false
false
false
false
0
plc_fillin(plc_state_t *s, int16_t amp[], int len) { int i; int pitch_overlap; float old_step; float new_step; float old_weight; float new_weight; float gain; int orig_len; orig_len = len; if (s->missing_samples == 0) { /* As the gap in real speech starts we need to assess the last known pitch, and prepa...
false
false
false
false
false
0
canvas_finderror(void *error_object) { t_canvas *x; /* find all root canvases */ for (x = canvas_list; x; x = x->gl_next) { if (glist_dofinderror(x, error_object)) return; } error("... sorry, I couldn't find the source of that error."); }
false
false
false
false
false
0
ganv_port_destroy(GtkObject* object) { g_return_if_fail(object != NULL); g_return_if_fail(GANV_IS_PORT(object)); GanvItem* item = GANV_ITEM(object); GanvPort* port = GANV_PORT(object); GanvCanvas* canvas = GANV_CANVAS(item->canvas); if (canvas) { if (port->impl->is_input) { ganv_canvas_for_each_edge...
false
false
false
false
false
0
type_set_name(PyTypeObject *type, PyObject *value, void *context) { PyHeapTypeObject* et; char *tp_name; PyObject *tmp; if (!check_set_special_type_attr(type, value, "__name__")) return -1; if (!PyUnicode_Check(value)) { PyErr_Format(PyExc_TypeError, "can only a...
false
false
false
false
false
0
SetPref(const char *key, void *data) { ptr_list *pref_data = NULL; void *old_data = NULL; LList *list_data = l_list_find_custom(s_global_prefs, key, s_compare_ptr_key); if (!list_data) { s_add_pref(key, data); return (NULL); } pref_data = (ptr_list *)list_data->data; old_data = pref_data->value; pref_d...
false
false
false
false
false
0
icmViewingConditions_read( icmBase *pp, unsigned int len, /* tag length */ unsigned int of /* start offset within file */ ) { icmViewingConditions *p = (icmViewingConditions *)pp; icc *icp = p->icp; int rv; char *bp, *buf; if (len < 36) { sprintf(icp->err,"icmViewingConditions_read: Tag too small to be leg...
false
true
false
false
true
1
kv_unforce_levels(struct radeon_device *rdev) { if (rdev->family == CHIP_KABINI || rdev->family == CHIP_MULLINS) return kv_notify_message_to_smu(rdev, PPSMC_MSG_NoForcedLevel); else return kv_set_enabled_levels(rdev); }
false
false
false
false
false
0
change_save_filename( GtkButton *button GCC_UNUSED, gpointer user_data ) { struct binary_info *info = user_data; char *new_filename; new_filename = ui_get_save_filename( "Fuse - Save Binary Data" ); if( !new_filename ) return; free( info->filename ); info->filename = new_filename; gtk_label_set_text( ...
false
false
false
false
false
0
set_ncache_xrootpmap(void) { Atom pmap, type; int format; unsigned long length, after; XImage *image = NULL; XErrorHandler old_handler; RAWFB_RET_VOID #if !NO_X11 if (!ncache) { return; } X_LOCK; old_handler = XSetErrorHandler(trap_xerror); trapped_xerror = 0; pmap = XInternAtom(dpy, "_XROOTPMAP_ID", Tru...
false
false
false
false
false
0
Record_To_Vector (register RECORD *rp, int len, Object sym, Display *dpy, unsigned long flags) { register int i; Object v, x; GC_Node2; v = Null; GC_Link2 (sym, v); v = Make_Vector (len, Null); VECTOR(v)->data[0] = sym; for (i = 1; rp->slot; i++, rp++) { ...
false
false
false
false
false
0
_talloc_set(void *ptr, const void *ctx, size_t size, const char *name) { void ***child; void *p; p = talloc_named_const(ctx, size, name); if (unlikely(!p)) goto set_ptr; child = talloc(p, void **); if (unlikely(!child)) { talloc_free(p); p = NULL; goto set_ptr; } *child = ptr; talloc_set_name_const(c...
false
true
false
false
true
1
try_to_sell_stuff(struct player *pplayer, struct city *pcity) { improvement_iterate(pimprove) { if (can_city_sell_building(pcity, pimprove) && !building_has_effect(pimprove, EFT_DEFEND_BONUS)) { /* selling walls to buy defenders is counterproductive -- Syela */ really_handle_city_sell(pplayer, pcity, pimpr...
false
false
false
false
false
0
switch_iterate_devices(struct dm_target *ti, iterate_devices_callout_fn fn, void *data) { struct switch_ctx *sctx = ti->private; int path_nr; int r; for (path_nr = 0; path_nr < sctx->nr_paths; path_nr++) { r = fn(ti, sctx->path_list[path_nr].dmdev, sctx->path_list[path_nr].start, ti->len, data); if (...
false
false
false
false
false
0
eio_message_socket_accept(eio_obj_t *obj, List objs) { int fd; unsigned char *uc; unsigned short port; struct sockaddr_in addr; slurm_msg_t *msg = NULL; int len = sizeof(addr); debug3("Called eio_msg_socket_accept"); xassert(obj); xassert(obj->ops->handle_msg); while ((fd = accept(obj->fd, (struct sockaddr...
false
false
false
false
false
0
collect_method_images (MonoMethodInflated *method, CollectData *data) { MonoMethod *m = method->declaring; add_image (method->declaring->klass->image, data); if (method->context.class_inst) collect_ginst_images (method->context.class_inst, data); if (method->context.method_inst) collect_ginst_images (method->c...
false
false
false
false
false
0
connected_partners( std::vector<HepMC::GenParticle*>* output, int code, int code_index, int num_indices ) const { /// protected: for recursive use by Flow::connected_partners() // if ( !m_particle_owner ) return; // nothing to do // look for connected partners joined to this m_particle_owner // thr...
false
false
false
false
false
0
stackfilt_exit(void) { struct stack_elt *tmp_elt = NULL; if (warnings_enabled && stack) { warning(MYNAME " Warning: leftover stack entries; " "check command line for mistakes\n"); } while (stack) { waypt_flush(&(stack->waypts)); tmp_elt = stack; stack = stack->next; xfree(tmp_el...
false
false
false
false
false
0
m_links(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]) { if(ConfigServerHide.flatten_links && !IsExemptShide(source_p)) scache_send_flattened_links(source_p); else mo_links(client_p, source_p, parc, parv); return 0; }
false
false
false
false
false
0
exec_file(str filename, object global, object local) { // Set suitable default values for global and local dicts. if (global.is_none()) { if (PyObject *g = PyEval_GetGlobals()) global = object(detail::borrowed_reference(g)); else global = dict(); } if (local.is_none()) local = global; //...
false
false
false
false
true
1
deleteFold(start, end, recursive, had_visual) linenr_T start; linenr_T end; int recursive; int had_visual; /* TRUE when Visual selection used */ { garray_T *gap; fold_T *fp; garray_T *found_ga; fold_T *found_fp = NULL; linenr_T found_off = 0; int use_level; int maybe_smal...
false
false
false
false
false
0
parse_ip_port(const char *str, const char **endptr, host_addr_t *addr_ptr, uint16 *port_ptr) { const char *s = str; host_addr_t addr; uint16 port; bool ret = FALSE; s = skip_ascii_spaces(s); if (!string_to_host_addr(s, &s, &addr) || !is_host_addr(addr)) { port = 0; goto done; } if (':' == s[0]) { uint3...
false
false
false
false
false
0
return_port(char *port_s) { char *end_c; int res; struct servent *serv; res=strtol(port_s,&end_c,10); if (*end_c=='\0') return res; /*It's not number, so try service name*/ serv=getservbyname(port_s,NULL); if (serv==NULL) return -1; return ntohs(serv->s_port); }
false
false
false
false
false
0
FFwd() { if ((status&RT_RUNNING) == 0) return; if (status&RT_MODE_ERGO) { load_msecs += 10000; // jump forward 10 seconds main->notifySeek(load_msecs); } else displayWorkoutDistance += 1; // jump forward a kilometer in the workout }
false
false
false
false
false
0
TC0100SCN_tilemap_update(void) { int chip,j; for (chip = 0;chip < TC0100SCN_chips;chip++) { tilemap_set_scrolly(TC0100SCN_tilemap[chip][0][TC0100SCN_dblwidth[chip]],0,TC0100SCN_bgscrolly[chip]); tilemap_set_scrolly(TC0100SCN_tilemap[chip][1][TC0100SCN_dblwidth[chip]],0,TC0100SCN_fgscrolly[chip]); fo...
false
false
false
false
false
0
Lzma2State_SetFromMethod(IStateCoder *p, ISzAlloc *alloc) { CLzma2Dec *decoder = alloc->Alloc(alloc, sizeof(CLzma2Dec)); p->p = decoder; if (decoder == 0) return SZ_ERROR_MEM; p->Free = Lzma2State_Free; p->SetProps = Lzma2State_SetProps; p->Init = Lzma2State_Init; p->Code = Lzma2State_Code; Lzma2Dec...
false
false
false
false
false
0
sx9500_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, int state) { struct sx9500_data *data = iio_priv(indio_dev); int ret; if (chan->type != IIO_PROXIMITY || type != IIO_EV_TYPE_THRESH || ...
false
false
false
false
false
0
maybe_hot_frequency_p (int freq) { struct cgraph_node *node = cgraph_get_node (current_function_decl); if (!profile_info || !flag_branch_probabilities) { if (node->frequency == NODE_FREQUENCY_UNLIKELY_EXECUTED) return false; if (node->frequency == NODE_FREQUENCY_HOT) return true; ...
false
false
false
false
false
0
recmutex_lock(recmutex_t *mutex) { int self = current_thread ? current_thread->number : 0; if (mutex->counter != 0 && mutex->owner_threadnum != self) return -1; /* EAGAIN, more or less */ mutex->counter++; mutex->owner_threadnum = self; return 0; }
false
false
false
false
false
0
user(char *name) { #ifndef USE_PAM const char *cp, *shell; #endif if (logged_in) { if (guest) { reply(530, "Can't change user from guest login."); return; } else if (dochroot) { reply(530, "Can't change user from chroot user."); return; } end_login(); } #ifdef USE_PAM authentication_setup(name...
false
false
false
false
false
0
camel_imapx_command_failed (CamelIMAPXCommand *ic, const GError *error) { CamelIMAPXRealCommand *real_ic; g_return_if_fail (CAMEL_IS_IMAPX_COMMAND (ic)); g_return_if_fail (error != NULL); real_ic = (CamelIMAPXRealCommand *) ic; g_return_if_fail (real_ic->error == NULL); real_ic->err...
false
false
false
false
false
0
wait_tcp_ready(func_args* args) { #ifdef _POSIX_THREADS pthread_mutex_lock(&args->signal->mutex); if (!args->signal->ready) pthread_cond_wait(&args->signal->cond, &args->signal->mutex); args->signal->ready = 0; /* reset */ pthread_mutex_unlock(&args->signal->mutex); #endif }
false
false
false
false
false
0
copyAndDetach(const ArConfig &config) { if (this != &config) { // Note that the name is not copied... IFDEBUG(ArLog::log(ArLog::Verbose, "%soperator= (from %s) begins", myLogPrefix.c_str(), config.myLogPrefix.c_str())); // TODO: Th...
false
false
false
false
false
0
sms_to_status(u32 is_demod_locked, u32 is_rf_locked) { if (is_demod_locked) return FE_HAS_SIGNAL | FE_HAS_CARRIER | FE_HAS_VITERBI | FE_HAS_SYNC | FE_HAS_LOCK; if (is_rf_locked) return FE_HAS_SIGNAL | FE_HAS_CARRIER; return 0; }
false
false
false
false
false
0
mapfd(int fd) { redir *rp; for(rp = runq->redir;rp;rp = rp->next){ switch(rp->type){ case RCLOSE: if(rp->from==fd) fd=-1; break; case RDUP: case ROPEN: if(rp->to==fd) fd = rp->from; break; } } return fd; }
false
false
false
false
false
0
banner_create(VMG_ uint argc) { int parent_id; int other_id; int where; int wintype; int align; int siz; int siz_units; unsigned long style; int hdl; /* check arguments */ check_argc_range(vmg_ argc, 7, 8); /* retrieve the 'parent' parameter */ if (a...
false
false
false
false
false
0
getCertSubjectName(OFString& str) { if (x509) { char certSubjectName[2048]; /* certificate subject name (DN) */ certSubjectName[0]= '\0'; X509_NAME_oneline(X509_get_subject_name(x509), certSubjectName, 2048); str = certSubjectName; } else str.clear(); }
false
false
false
false
false
0
dwarf2out_flush_queued_reg_saves (void) { queued_reg_save *q; size_t i; FOR_EACH_VEC_ELT (queued_reg_save, queued_reg_saves, i, q) { unsigned int reg, sreg; record_reg_saved_in_reg (q->saved_reg, q->reg); if (q->reg == pc_rtx) reg = DWARF_FRAME_RETURN_COLUMN; else reg = dwf...
false
false
false
false
false
0
qed_init_array_dmae(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt, u32 addr, u32 dmae_data_offset, u32 size, const u32 *buf, bool b_must_dmae, bool b_can_dmae) { int rc = 0; /* Perform DMAE only for lengthy enough sections or for wide-bus */ if ...
false
false
false
false
false
0
check_coalesce_eq(int i, int j, struct isl_coalesce_info *info) { int known, nested; enum isl_change change; known = isl_basic_map_divs_known(info[i].bmap); if (known < 0 || !known) return known < 0 ? isl_change_error : isl_change_none; known = isl_basic_map_divs_known(info[j].bmap); if (known < 0 || !known) ...
false
false
false
false
false
0
gs_subprocess_wait_sync_check (GSSubprocess *self, GCancellable *cancellable, GError **error) { gboolean ret = FALSE; int exit_status; if (!gs_subprocess_wait_sync (self, &exit_status, cancellable, error)) goto out; if (!g_spawn_check_exit_status (exit_status, err...
false
false
false
false
false
0
rll_enc_finalize(rll_t *e, rllitr_t *itr) { int c; rll_enc(e, itr, 0, -1); *itr->q = 7; // end marker; there is always room for an extra symbol for (e->l = 0, c = 0; c < 6; ++c) e->l += e->mc[c]; }
false
false
false
false
false
0
colocaPecaNivellInfantil(int indexPeca){ QPointF centrePeca=conjuntJoc->arrayPeces[indexPeca]->pos()+ conjuntJoc->arrayPeces[indexPeca]->centrePeca(); bool resultat= false; for(int j=0;j<=conjuntFigura->arrayPeces.size()-1;j++){ if(conjuntFigura->arrayPeces[j]->shape().contains(centrePeca- ...
false
false
false
false
false
0
distance(const Vector &v, const Matrix &m, double bound) const { double d = bound; for (int i = 0; i < countSegments(); ++i) { double d1 = segment(i).distance(v, m, d); if (d1 < d) d = d1; } if (closed()) { Vector u[2]; double d1 = closingSegment(u).distance(v, m , d); if (d1 ...
false
false
false
false
false
0
Clean() { notprocessed.clear(); processed.clear(); bool ok = true; for (JobSelectionMap::iterator it = jcJobMap.begin(); it != jcJobMap.end(); ++it) { for (std::list<Job*>::iterator itJ = it->second.first.begin(); itJ != it->second.first.end();) { if (!(*itJ)->State ||...
false
false
false
false
false
0
addToken (string s, Token tok) { operators[tok] = s ; for (int i = 0 ; i < tokens.size() ; i++) { TokenNode *node = tokens[i] ; if (node->add (s, 0, tok)) { return ; } } TokenNode *node = new TokenNode (s[0], BAD, NULL) ; tokens.push_back (node) ; node->add (s...
false
false
false
false
false
0
InitInfo (Connector* conn) { if (conn->_csinfo == nil) { conn->_csinfo = new CSolverInfo; } }
false
false
false
false
false
0
zap_changes(Void) { register chainp cp; register Argtypes *at; /* arrange to get correct count of prototypes that would change by running f2c again */ if (prev_proc && proc_argchanges) proc_protochanges++; prev_proc = proc_argchanges = 0; for(cp = new_procs; cp; cp = cp->nextp) if (at = ((Namep)cp->data...
false
false
false
false
false
0
gtk_sat_module_close_cb (GtkWidget *button, gpointer data) { GtkSatModule *module = GTK_SAT_MODULE (data); gchar *name; gint retcode; name = g_strdup (module->name); sat_log_log (SAT_LOG_LEVEL_DEBUG, _("%s: Module %s recevied CLOSE signal."), ...
false
false
false
false
false
0
mimageFreeScaleInfo(MImageScaleInfo *isi) { if(isi){ delete[] isi->xpoints; delete[] isi->ypoints; delete[] isi->xapoints; delete[] isi->yapoints; delete isi; } return(NULL); }
false
false
false
false
false
0
panel_toplevel_get_effective_auto_hide_size (PanelToplevel *toplevel) { int size; if (toplevel->priv->orientation & PANEL_HORIZONTAL_MASK) size = CLAMP (toplevel->priv->auto_hide_size, 1, toplevel->priv->original_height / 2); else size = CLAMP (toplevel->priv->auto_hide_size, 1, toplevel->priv...
false
false
false
false
false
0
mx_stylable_iface_init (MxStylableIface *iface) { static gboolean is_initialized = FALSE; if (G_UNLIKELY (is_initialized == FALSE)) { GParamSpec *pspec; is_initialized = TRUE; pspec = g_param_spec_uint ("x-mx-column-spacing", "Column Spacing", ...
false
false
false
false
false
0
pixaSortByIndex(PIXA *pixas, NUMA *naindex, l_int32 copyflag) { l_int32 i, n, index; BOX *box; PIX *pix; PIXA *pixad; PROCNAME("pixaSortByIndex"); if (!pixas) return (PIXA *)ERROR_PTR("pixas not defined", procName, NULL); if (!naindex) ret...
false
false
false
false
false
0
cmd_script_list(void) { GSList *tmp; GString *data; if (perl_scripts == NULL) { printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, TXT_NO_SCRIPTS_LOADED); return; } printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_SCRIPT_LIST_HEADER); data = g_string_new(N...
false
false
false
false
false
0
cifaddr (int unit, u_int32_t our_adr, u_int32_t his_adr) { struct rtentry rt; if (kernel_version < KVERSION(2,1,16)) { /* * Delete the route through the device */ memset (&rt, '\0', sizeof (rt)); SET_SA_FAMILY (rt.rt_dst, AF_INET); SET_SA_FAMILY (rt.rt_gateway, AF_INET); rt.rt...
false
false
false
false
false
0
split_comments(mystring comments) { mylist<mystring> comment_list; if (!comments.empty()) { char *s = new char[strlen(comments.c_str()) + 1]; memcpy( s, comments.c_str(), strlen(comments.c_str()) + 1); char *start; char *end; start = s; end = strchr(s, '\n'); while (end != NULL) { *end++ = '\0'; ...
false
false
false
false
false
0
ubsec_rsa_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx) { int to_return = 0; if(!rsa->p || !rsa->q || !rsa->dmp1 || !rsa->dmq1 || !rsa->iqmp) { UBSECerr(UBSEC_F_UBSEC_RSA_MOD_EXP, UBSEC_R_MISSING_KEY_COMPONENTS); goto err; } to_return = ubsec_mod_exp_crt(r0, I, rsa->p, rsa->q, rsa->dmp1, ...
false
false
false
false
false
0
recupererNValeurs(int n) { int i=0; TYPE_ELEMENTS_MATRICE *TAB=(TYPE_ELEMENTS_MATRICE*) malloc (n*sizeof(TYPE_ELEMENTS_MATRICE)); for(i=0; i<n; i++) { printf(" > "); scanf("%"FORMAT_PRINTF,&TAB[i]); } return TAB; }
false
true
false
false
false
1
get_random_data(u_char *buffer, size_t bytes) { int random_fd; /* try to open /dev/urandom */ /* note: for better randomness but very very slow generation use /dev/random */ if ((random_fd = open("/dev/urandom", O_RDONLY)) < 0) return -1; /* obtain the appropriate amount of data */ if ...
false
false
false
false
false
0
alloc_pending (size_t size) { if (error_pending ()) /* Probably alloc_pending callers will have already checked for this case. But we might as well handle it if they don't, I guess. */ return 0; return alloc_pending_internal (&pending_error_text, size); }
false
false
false
false
false
0
MayIndexedAccess(JSObject* receiver, uint32_t index, v8::AccessType type) { ASSERT(receiver->IsAccessCheckNeeded()); // Check for compatibility between the security tokens in the // current lexical context and the accessed object. ASSERT(Top::context()); /...
false
false
false
false
false
0
duo_log(int priority, const char*msg, const char *user, const char *ip, const char *err) { char buf[512]; int i, n; n = snprintf(buf, sizeof(buf), "%s", msg); if (user != NULL && (i = snprintf(buf + n, sizeof(buf) - n, " for '%s'", user)) > 0) { n += i; } if (ip != NUL...
true
true
false
false
false
1
kv_dpm_late_init(void *handle) { /* powerdown unused blocks for now */ struct amdgpu_device *adev = (struct amdgpu_device *)handle; int ret; if (!amdgpu_dpm) return 0; /* init the sysfs and debugfs files late */ ret = amdgpu_pm_sysfs_init(adev); if (ret) return ret; kv_dpm_powergate_acp(adev, true); kv_...
false
false
false
false
false
0
VerifyParameterAttrs(Attributes Attrs, const Type *Ty, bool isReturnValue, const Value *V) { if (Attrs == Attribute::None) return; Attributes FnCheckAttr = Attrs & Attribute::FunctionOnly; Assert1(!FnCheckAttr, "Attribute " + Attribute::getAsString(FnCheckAttr) + ...
false
false
false
false
false
0
ivtv_v4l2_open(struct file *filp) { struct video_device *vdev = video_devdata(filp); int res; if (mutex_lock_interruptible(vdev->lock)) return -ERESTARTSYS; res = ivtv_open(filp); mutex_unlock(vdev->lock); return res; }
false
false
false
false
false
0