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
gt_cstr_array_preprend(const char **gt_cstr_array, const char *p) { unsigned long i, a_len; char **a; gt_assert(gt_cstr_array && p); a_len = gt_cstr_array_size(gt_cstr_array); a = gt_malloc(sizeof (char*) * (a_len + 2)); a[0] = gt_cstr_dup(p); for (i = 0; i < a_len; i++) a[i+1] = gt_cstr_dup(gt_cstr_a...
false
false
false
false
false
0
fe_userlist_insert (session *sess, struct User *newuser, int row, int sel) { GtkTreeModel *model = sess->res->user_model; GdkPixbuf *pix = get_user_icon (sess->server, newuser); GtkTreeIter iter; char *nick; int nick_color = 0; if (prefs.hex_away_track && newuser->away) nick_color = COL_AWAY; else if (prefs.h...
false
true
false
false
true
1
make_clientitem(GtkWidget *menu, Window w) { GtkWidget *item; char buf[BUF_SIZE]; if (is_on_cur_desk(w) && !is_skip(w)) { snprint_wm_name(buf, sizeof buf, w); item = gtk_menu_item_new_with_label(buf); gtk_menu_append(GTK_MENU(menu), item); gtk_signal_connect(GTK_OBJECT(item)...
true
true
false
false
false
1
latex_run_makeindex (GuEditor* ec) { int retcode; if (g_find_program_in_path ("makeindex")) { gchar* command = g_strdup_printf ("%s makeindex \"%s.idx\"", C_TEXSEC, g_path_get_basename(ec->basename)); ...
false
false
false
false
false
0
emit_copy_option(PQExpBuffer query, const char *keyword, const char *option) { appendPQExpBufferStr(query, keyword); if (option[0] == '\'' || ((option[0] == 'E' || option[0] == 'e') && option[1] == '\'')) appendPQExpBufferStr(query, option); else appendStringLiteralConn(query, option, pset.db); }
false
false
false
false
false
0
is_proc_object_dupe(struct proc_acl *subject, struct file_acl *object) { struct file_acl *tmp = NULL; tmp = lookup_acl_object_by_name(subject, object->filename); if (tmp == NULL) tmp = lookup_acl_object(subject, object); else { /* found a match by filename, handle 'Z' flag here */ if (object->mode & GR_OBJ_R...
false
false
false
false
false
0
gt_Sfxmappedrange_delete(GtSfxmappedrange *sfxmappedrange) { if (sfxmappedrange == NULL) { return; } gt_log_log("delete table %s",gt_str_get(sfxmappedrange->tablename)); gt_fa_xmunmap(sfxmappedrange->ptr); sfxmappedrange->ptr = NULL; gt_fa_xmunmap(sfxmappedrange->entire); sfxmappedrange->entire = NU...
false
false
false
false
false
0
rb_reg_expr_str(str, s, len) VALUE str; const char *s; long len; { const char *p, *pend; int need_escape = 0; p = s; pend = p + len; while (p<pend) { if (*p == '/' || (!ISPRINT(*p) && !ismbchar(*p))) { need_escape = 1; break; } p += mbclen(*p); } if (!need_escape) { rb...
false
false
false
false
false
0
open_expanded(char *path, char *mode) { glob_t gl; int ret; FILE *fp = NULL; gl.gl_offs = 0; gl.gl_pathv = NULL; gl.gl_pathc = 0; ret = glob(path, GLOB_TILDE, NULL, &gl); if (ret == 0) { fp = fopen(gl.gl_pathv[0], mode); } globfree(&gl); return fp; }
false
false
false
false
true
1
cs5535_gpio_probe(struct platform_device *pdev) { struct resource *res; int err = -EIO; ulong mask_orig = mask; /* There are two ways to get the GPIO base address; one is by * fetching it from MSR_LBAR_GPIO, the other is by reading the * PCI BAR info. The latter method is easier (especially across * differe...
false
false
false
false
false
0
YM3526_sh_start(const struct MachineSound *msound) { int i; int rate = Machine->sample_rate; intf_3526 = msound->sound_interface; if( intf_3526->num > MAX_3526 ) return 1; if (options.use_filter) rate = intf_3526->baseclock/72; /* Timer state clear */ memset(Timer_3526,0,sizeof(Timer_3526));...
false
false
false
false
true
1
lookup_driver(lookup_funct_t lookup_func, void explain_func(void), const char *driver_class, const char *driver_name, const char *path) { void *retval = lookup_func(path, driver_name); if (!retval) { if (!driver_name) sciprintf("The default %s is not available; please choose" " one explicitly.\n", ...
false
false
false
false
false
0
playlist_length_get (cli_infos_t *infos, const gchar *playlist, gint *len) { xmmsv_coll_t *coll; if (playlist) { /* FIXME: Getting the whole playlist is a bit of overkill (at least linear in the size of the playlist.), but I am not aware of a more efficient IPC-method. */ if ((coll = get_...
false
false
false
false
false
0
i2c_default_probe(struct i2c_adapter *adap, unsigned short addr) { int err; union i2c_smbus_data dummy; #ifdef CONFIG_X86 if (addr == 0x73 && (adap->class & I2C_CLASS_HWMON) && i2c_check_functionality(adap, I2C_FUNC_SMBUS_READ_BYTE_DATA)) err = i2c_smbus_xfer(adap, addr, 0, I2C_SMBUS_READ, 0, I2C_SMBUS...
false
false
false
false
false
0
yield() { if(SDL_WM_GrabInput(SDL_GRAB_QUERY) == SDL_GRAB_ON) SDL_WM_GrabInput(SDL_GRAB_OFF); }
false
false
false
false
false
0
macosx_xquerytree(Window w, Window *root_return, Window *parent_return, Window **children_return, unsigned int *nchildren_return) { if (!w || !root_return || !parent_return || !children_return || !nchildren_return) {} return (Status) 0; }
false
false
false
false
false
0
rfc822tok_print(const struct rfc822token *token, void (*print_func)(char, void *), void *ptr) { int prev_isatom=0; int isatom; while (token) { isatom=rfc822_is_atom(token->token); if (prev_isatom && isatom) (*print_func)(' ', ptr); print_token(token, print_func, ptr); prev_isatom=isatom; token=token->...
false
false
false
false
false
0
find_realm_in_path(krb5_context context, krb5_tkt_creds_context ctx, const krb5_data *realm) { const krb5_data *r; for (r = ctx->cur_realm + 1; r->data != NULL; r++) { if (data_eq(*r, *realm)) return r; } return NULL; }
false
false
false
false
false
0
waitEnter() { if (m_waitState || m_isClosing) { return; } m_waitState = true; if (mainWin->m_connDebug) Pmsg0(000, "Entering Wait State\n"); app->setOverrideCursor(QCursor(Qt::WaitCursor)); disconnectSignals(); disconnectConsoleSignals(m_currentConsole); m_waitTreeItem = treeWidget->curre...
false
false
false
false
false
0
CMDhelp(ac, av) int ac; char *av[]; { CMDENT *cp; Reply("%s\r\n", NNTP_HELP_FOLLOWS); for (cp = CMDtable; cp->Name; cp++) if (cp->Help == NULL) Printf(" %s\r\n", cp->Name); else Printf(" %s %s\r\n", cp->Name, cp->Help); Printf("Report problems to <%s@%s>\r\n", NEWSMASTER, GetCon...
false
false
false
false
false
0
snip (bfd *abfd) { abfd->lru_prev->lru_next = abfd->lru_next; abfd->lru_next->lru_prev = abfd->lru_prev; if (abfd == bfd_last_cache) { bfd_last_cache = abfd->lru_next; if (abfd == bfd_last_cache) bfd_last_cache = NULL; } }
false
false
false
false
false
0
SetTransformer(Transformer *t) { if (matrix != t) { Unref(matrix); matrix = t; if (matrix != nil) { matrix->Reference(); } } }
false
false
false
false
false
0
exit_client(struct Client *client_p, /* The local client originating the * exit or NULL, if this exit is * generated by this server for * internal reasons. * This will not get any of the * generated messages. */ struct Client *source_p, /* Client exiting */ struct Client *from, /...
false
false
false
false
false
0
link_selected_event_listener (GSignalInvocationHint * signal_hint, guint n_param_values, const GValue * param_values, gpointer data) { AtkObject *accessible; GSignalQuery signal_query; const gchar *name, *minor; gint detail1 = 0; g_signal_query (sig...
false
false
false
false
false
0
wm8350_out2_ramp_step(struct wm8350_data *wm8350_data) { struct wm8350_output *out2 = &wm8350_data->out2; struct wm8350 *wm8350 = wm8350_data->wm8350; int left_complete = 0, right_complete = 0; u16 reg, val; /* left channel */ reg = wm8350_reg_read(wm8350, WM8350_LOUT2_VOLUME); val = (reg & WM8350_OUT2L_VOL_MAS...
false
false
false
false
false
0
extpb_find_subentry(gn_phonebook_entry *entry, gn_phonebook_entry_type type) { int i; for (i = 0; i < entry->subentries_count; ++i) if (entry->subentries[i].entry_type == type) return entry->subentries[i].data.number; return NULL; }
false
false
false
false
false
0
gfx_v7_0_cp_gfx_enable(struct amdgpu_device *adev, bool enable) { int i; if (enable) { WREG32(mmCP_ME_CNTL, 0); } else { WREG32(mmCP_ME_CNTL, (CP_ME_CNTL__ME_HALT_MASK | CP_ME_CNTL__PFP_HALT_MASK | CP_ME_CNTL__CE_HALT_MASK)); for (i = 0; i < adev->gfx.num_gfx_rings; i++) adev->gfx.gfx_ring[i].ready = false...
false
false
false
false
false
0
getV(va_list arg) { double *value = va_arg(arg, double*); OfxStatus stat = get(*value); # ifdef OFX_DEBUG_PARAMETERS if (stat == kOfxStatOK) { std::cout << ' ' << *value; } # endif return stat; }
false
false
false
false
false
0
message_view_saveas(message_view_t * view) { GtkWindow *parent = toplevel_get_window(view->top); char *path = util_save_file(parent, "Save View As", view->filename); if (path == NULL) { return; } g_free(view->filename); view->filename = path; if (seaudit_model_save_to_file(view->model, view->filename) < 0) { ...
false
false
false
false
false
0
gt_graphics_cairo_draw_text_right(GtGraphics *gg, double x, double y, const char *text) { PangoRectangle ink; GtGraphicsCairo *g = gt_graphics_cairo_cast(gg); gt_assert(g && text && g->layout); pango_layout_set_text(g->layout, text, -1); /* get text extents */ pango_...
false
false
false
false
false
0
onStateChanged() { if(d->mQmlChild) { if (state() == ROTATED) { d->mQmlChild->hide(); enableDefaultBackground(true); } else if (state() == VIEW) { d->mQmlChild->show(); if (!hasBackground()) enableDefaultBackground(false); } ...
false
false
false
false
false
0
gui_edit_get_text( GuiWidget *widget, char *buffer, int limit, int start, int length ) { char *ptr; if ( widget->type != GUI_EDIT ) return 0; if ( start < 0 ) start = 0; ptr = widget->spec.edit.buffer + start; if ( length == -1 ) length = strlen( ptr ); if ( length > limit ) ...
false
false
false
false
false
0
rtl8723a_fill_fake_txdesc(struct rtw_adapter *padapter, u8 *pDesc, u32 BufferLen, u8 IsPsPoll, u8 IsBTQosNull) { struct tx_desc *ptxdesc; /* Clear all status */ ptxdesc = (struct tx_desc *)pDesc; memset(pDesc, 0, TXDESC_SIZE); /* offset 0 */ /* own, bFirstSeg, bLastSeg; */ ptxdesc->txdw0 |= cpu_to_l...
false
false
false
false
false
0
symtab_list_type(symbol_type type, symbol_ident_list *list) { symtab *st = symtab_tos(); int i = 0; list->size = symtab_type_count(type); list->idents = (char **)malloc(list->size * sizeof(char *) ); if (list->idents != NULL) { symtab_entry *e = binary_min(st->root); while (e != NULL...
false
true
false
false
true
1
setran(struct csa *csa, int iseed) { xassert(iseed >= 1); mult = 16807; modul = 2147483647; i15 = 1 << 15; i16 = 1 << 16; jran = iseed; return; }
false
false
false
false
false
0
__ipr_remove(struct pci_dev *pdev) { unsigned long host_lock_flags = 0; struct ipr_ioa_cfg *ioa_cfg = pci_get_drvdata(pdev); int i; unsigned long driver_lock_flags; ENTER; spin_lock_irqsave(ioa_cfg->host->host_lock, host_lock_flags); while (ioa_cfg->in_reset_reload) { spin_unlock_irqrestore(ioa_cfg->host->hos...
false
false
false
false
false
0
addRangeTableEntryForRelation(ParseState *pstate, Relation rel, Alias *alias, bool inh, bool inFromCl) { RangeTblEntry *rte = makeNode(RangeTblEntry); char *refname = alias ? alias->aliasname : RelationGetRelationName(rel); Assert(pstate != NULL); rte->rtekind = RTE_RELATION...
false
false
false
false
false
0
rb_ary_frozen_p(ary) VALUE ary; { if (OBJ_FROZEN(ary)) return Qtrue; if (FL_TEST(ary, ARY_TMPLOCK)) return Qtrue; return Qfalse; }
false
false
false
false
false
0
GetAreaFlag(float x, float y, float z, bool* isOutdoors) const { uint32 mogpFlags; int32 adtId, rootId, groupId; WMOAreaTableEntry const* wmoEntry = 0; AreaTableEntry const* atEntry = 0; bool haveAreaInfo = false; if (GetAreaInfo(x, y, z, mogpFlags, adtId, rootId, groupId)) { haveAr...
false
false
false
false
false
0
display_battery(s_dmi * dmi) { moreprintf("Battery\n"); moreprintf("\tVendor : %s\n", dmi->battery.manufacturer); moreprintf("\tManufacture Date : %s\n", dmi->battery.manufacture_date); moreprintf("\tSerial : %s\n", dmi->battery.serial); moreprintf("\tName ...
false
false
false
false
false
0
save_shifts(void) { register shifts *p; register short *sp1; register short *sp2; register short *send; p = (shifts *) allocate((unsigned) (sizeof(shifts) + (nshifts - 1) * sizeof(short))); p->number = this_state->number; p->nshifts = nshifts; sp1 = shiftset; ...
false
false
false
false
true
1
append_env(const char* var, const char* value) { char* orig_value = getenv(var); if(!orig_value) { setenv(var, value, 1); } else { char* new_value = malloc(strlen(orig_value) + strlen(value) + 2); strcpy(new_value, orig_value); strcat(new_value, " "); strc...
false
true
false
false
true
1
rocker_port_change_proto_down(struct net_device *dev, bool proto_down) { struct rocker_port *rocker_port = netdev_priv(dev); if (rocker_port->dev->flags & IFF_UP) rocker_port_set_enable(rocker_port, !proto_down); rocker_port->dev->proto_down = proto_down; return 0; }
false
false
false
false
false
0
test_display_func (EContact *contact, gpointer data) { GList *entries = NULL; EVCard *card = E_VCARD (contact); GList *attrs, *a; attrs = e_vcard_get_attributes (card); for (a = attrs; a; a = a->next) { if (strcmp (e_vcard_attribute_get_name (a->data), EVC_TEL) == 0 && e_vcard_attribute_has_type (a->data,...
false
false
false
false
false
0
image_find_option(unsigned int optiontype) { int i; for (i = 0; i < cfgn; i++) { if (image_cfg[i].type == optiontype) return &image_cfg[i]; } return NULL; }
false
false
false
false
false
0
write_match(unsigned len, unsigned off) { // mm,mmm,n,ll,r,q[mmmmm-8] = match n*4+ll, offset ((q-1)<<rb)+r+1 if (level==1) { assert(len>=minMatch && len<=maxMatch); assert(off>0); assert(len>=4); assert(rb>=0 && rb<=8); int ll=lg(len)-1; assert(ll>=2); off+=(1<<rb)-1; int lo=lg(off)...
false
false
false
false
false
0
uv_fs_mkdir(uv_loop_t* loop, uv_fs_t* req, const char* path, int mode, uv_fs_cb cb) { WRAP_EIO(UV_FS_MKDIR, eio_mkdir, mkdir, ARGS2(path, mode)) }
false
false
false
false
false
0
odf_print_spreadsheet_content_prelude (GnmOOExport *state) { gsf_xml_out_start_element (state->xml, TABLE "calculation-settings"); gsf_xml_out_add_int (state->xml, TABLE "null-year", 1930); odf_add_bool (state->xml, TABLE "automatic-find-labels", FALSE); odf_add_bool (state->xml, TABLE "case-sensitive", FALSE); od...
false
false
false
false
false
0
SetControlDir(const std::string &dir) { if (dir.empty()) control_dir = gm_user.Home() + "/.jobstatus"; else control_dir = dir; }
false
false
false
false
false
0
doc_write_c03c(int val, double dcycs) { int vol; vol = val & 0xf; if(g_doc_vol != vol) { /* don't bother playing sound..wait till next update */ /* sound_play(dcycs); */ g_doc_vol = vol; doc_printf("Setting doc vol to 0x%x at %f\n", vol, dcycs); } DOC_LOG("c03c write", -1, dcycs * g_dsamps_per_dcyc, v...
false
false
false
false
false
0
fuse_register_polled_file(struct fuse_conn *fc, struct fuse_file *ff) { spin_lock(&fc->lock); if (RB_EMPTY_NODE(&ff->polled_node)) { struct rb_node **link, *uninitialized_var(parent); link = fuse_find_polled_node(fc, ff->kh, &parent); BUG_ON(*link); rb_link_node(&ff->polled_node, parent, link); r...
false
false
false
false
true
1
vmdaudio_decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size) { VmdAudioContext *s = avctx->priv_data; unsigned char *output_samples = (unsigned char *)data; /* point to the start of the encoded d...
false
false
false
false
false
0
HPDF_PDFA_SetPDFAConformance (HPDF_Doc pdf,HPDF_PDFAType pdfatype) { HPDF_OutputIntent xmp; HPDF_STATUS ret; const char *info = NULL; if (!HPDF_HasDoc(pdf)) { return HPDF_INVALID_DOCUMENT; } xmp = HPDF_DictStream_New(pdf->mmgr,pdf->xref); if (!xmp) { return HPDF_INVALID...
false
false
false
false
false
0
HCPcszip_endaccess(accrec_t * access_rec) { CONSTR(FUNC, "HCPcszip_endaccess"); compinfo_t *info; /* special element information */ comp_coder_szip_info_t *szip_info; /* ptr to SZIP info */ info = (compinfo_t *) access_rec->special_info; szip_info = &(info->cinfo.coder_info.szip_info);...
false
false
false
false
false
0
ppd_mark_choices(ppd_file_t *ppd, /* I - PPD file */ const char *s) /* I - "*Option Choice ..." string */ { int i, /* Looping var */ num_options; /* Number of options */ cups_option_t *options, /* Options */ *option; /* Current option */ if (!s) return; options = NULL; n...
false
false
false
false
false
0
command_photos_recentlyUpdated(flickcurl* fc, int argc, char *argv[]) { int min_date= -1; flickcurl_photos_list* photos_list = NULL; flickcurl_photos_list_params list_params; int rc; flickcurl_photos_list_params_init(&list_params); min_date = atoi(argv[1]); if(argc >2) { list_params.per_page = pa...
false
false
false
false
false
0
write_cnf_file(const char* filename) const { bool uniform = true; for (int p=1;p<=Clause::num_bool_vars();p++) { if (Clause::weight(p) != 0.5) { uniform = false; break; } } FILE *CNF; if ( (CNF = fopen(filename,"w")) == NULL ) { printf("Can not open CNF file %s! File %s, line %d.\n", filename, __FILE...
false
false
false
false
false
0
wraps_update_max(struct isl_wraps *wraps, struct isl_coalesce_info *info) { int k; isl_int max_k; unsigned total = isl_basic_map_total_dim(info->bmap); isl_int_init(max_k); for (k = 0; k < info->bmap->n_eq; ++k) { if (info->eq[2 * k] == STATUS_VALID && info->eq[2 * k + 1] == STATUS_VALID) continue; ...
false
false
false
false
false
0
hset_iter_release(hset_iter_t **hxi_ptr) { hset_iter_t *hxi = *hxi_ptr; if (hxi != NULL) { hset_iter_check(hxi); hash_refcnt_dec(HASH(hxi->hx)); if (hxi->deleted && 0 == hxi->hx->refcnt) hash_resize_as_needed(HASH(hxi->hx)); hxi->magic = 0; WFREE(hxi); *hxi_ptr = NULL; } }
false
false
false
false
false
0
readline(FXStream& store,FXchar* buffer,FXuint size){ register FXuint i=0; while(!store.eof() && i<size){ store >> buffer[i]; if(buffer[i]=='\r') continue; if(buffer[i]=='\n') break; i++; } buffer[i]=0; }
false
false
false
false
false
0
receive_mergeable(struct net_device *dev, struct virtnet_info *vi, struct receive_queue *rq, unsigned long ctx, unsigned int len) { void *buf = mergeable_ctx_to_buf_address(ctx); struct virtio_net_hdr_mrg_rxbuf *hdr = buf; u16 num_buf = virtio16_to_cpu(vi->vdev, hdr->num_buffers); struct pag...
false
false
false
false
false
0
dJulian () { int DaysInYear = 365; if (leapYear ()) DaysInYear++; return ( year + 1.0 * (dayofyear (year, month, day) - 1) / DaysInYear); }
false
false
false
false
false
0
frame_set_seek(mpg123_handle *fr, off_t sp) { fr->firstframe = frame_offset(fr, sp); #ifndef NO_NTOM if(fr->down_sample == 3) ntom_set_ntom(fr, fr->firstframe); #endif fr->ignoreframe = ignoreframe(fr); #ifdef GAPLESS /* The sample offset is used for non-gapless mode, too! */ fr->firstoff = sp - frame_outs(fr, fr->...
false
false
false
false
false
0
SFFindTable(SplineFont *sf,uint32 tag) { struct ttf_table *tab; for ( tab=sf->ttf_tables; tab!=NULL && tab->tag!=tag; tab=tab->next ); return( tab ); }
false
false
false
false
false
0
jpu_streamon(struct file *file, void *priv, enum v4l2_buf_type type) { struct jpu_ctx *ctx = fh_to_ctx(priv); struct jpu_q_data *src_q_data, *dst_q_data, *orig, adj, *ref; enum v4l2_buf_type adj_type; src_q_data = jpu_get_q_data(ctx, V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE); dst_q_data = jpu_get_q_data(ctx, V4L2_BUF_TY...
false
false
false
false
false
0
qpowi(NUMBER *q1, NUMBER *q2) { register NUMBER *r; BOOL invert, sign; ZVALUE num, zden, z2; if (qisfrac(q2)) { math_error("Raising number to fractional power"); /*NOTREACHED*/ } num = q1->num; zden = q1->den; z2 = q2->num; sign = (num.sign && zisodd(z2)); invert = z2.sign; num.sign = 0; z2.sign = 0; ...
false
false
false
false
false
0
createEncryptor() { return new RSAEncryptImpl(_key.impl()->getRSA(), _paddingMode); }
false
false
false
false
false
0
HandleVendorCommandSLConnect(const cec_command &command) { SetSLInitialised(); TransmitVendorCommandSetDeviceMode(command.destination, command.initiator, CEC_DEVICE_TYPE_RECORDING_DEVICE); if (m_processor->IsActiveSource(command.destination) && m_processor->IsHandledByLibCEC(command.destination)) { CCECBu...
false
false
false
false
false
0
bytes_count(PyBytesObject *self, PyObject *args) { PyObject *sub_obj; const char *str = PyBytes_AS_STRING(self), *sub; Py_ssize_t sub_len; char byte; Py_ssize_t start = 0, end = PY_SSIZE_T_MAX; Py_buffer vsub; PyObject *count_obj; if (!stringlib_parse_args_finds_byte("count", args, &su...
false
false
false
false
true
1
main(void) { s_server = mg_create_server(NULL, ev_handler); mg_set_option(s_server, "listening_port", "8080"); signal(SIGTERM, signal_handler); signal(SIGINT, signal_handler); printf("Started on port %s\n", mg_get_option(s_server, "listening_port")); while (s_signal_received == 0) { mg_poll_server(s_s...
false
false
false
false
false
0
xsh_parameters_pre_overscan( const char *recipe_id, cpl_parameterlist * plist ) { cpl_parameter* p=NULL; char paramname[256]; char recipename[256]; XSH_ASSURE_NOT_NULL( recipe_id ) ; XSH_ASSURE_NOT_NULL( plist ) ; sprintf(recipename,"xsh.%s",recipe_id); sprintf(paramname,"%s.%s",recipename,...
true
true
false
false
false
1
Vnoldattrs(int32 vgid) { CONSTR(FUNC, "Vnoldattrs"); VGROUP *vg; vginstance_t *v; intn n_old_attrs=0; intn ii; uint16 *areflist=NULL; int32 ret_value = 0; HEclear(); if (HAatom_group(vgid) != VGIDGROUP) HGOTO_ERROR(DFE_ARGS, FAIL); /* Get number of old-style attributes ...
false
false
false
true
false
1
iwl_queue_init(struct iwl_queue *q, int slots_num, u32 id) { q->n_window = slots_num; q->id = id; /* slots_num must be power-of-two size, otherwise * get_cmd_index is broken. */ if (WARN_ON(!is_power_of_2(slots_num))) return -EINVAL; q->low_mark = q->n_window / 4; if (q->low_mark < 4) q->low_mark = 4; q...
false
false
false
false
false
0
efreet_icon_lookup_path_path(Efreet_Cache_Icon_Element *elem, const char *path) { Eina_List *ll; const char *ext, *pp; unsigned int i; int len; len = strlen(path); for (i = 0; i < elem->paths_count; ++i) { if (strncmp(path, elem->paths[i], len)) continue; pp = strrchr(elem-...
false
false
false
false
false
0
ap_get_star(struct ccd_frame *fr, struct star *s, struct ap_params *p, struct bad_pix_map *bp) { double phn, flnsq, fsq; s->aph.tflux = aperture_flux(fr, p->r1, s->x, s->y, &s->aph.star_min, &s->aph.star_max, &s->aph.star_all, &fsq); phn = sqrt(fabs(s->aph.tflux - fr->exp.bias * s->ap...
false
false
false
false
false
0
operator== (BoxObj& box) { float tol = 0.0001; return ( Math::equal(_left, box._left, tol) && Math::equal(_right, box._right, tol) && Math::equal(_bottom, box._bottom, tol) && Math::equal(_top, box._top, tol) ); }
false
false
false
false
false
0
boxString(PyTypeObject *type, PyObject *arg, java::lang::Object *obj) { int result = boxJObject(type, arg, obj); if (result <= 0) return result; if (PyString_Check(arg) || PyUnicode_Check(arg)) { if (obj != NULL) { *obj = p2j(arg); if (PyErr_Occurred()) ...
false
false
false
false
false
0
troop_filter(int recNo) { int i, unitCount=0, totalUnit=unit_array.size(); Unit* unitPtr; for( i=1 ; i<=totalUnit ; i++ ) { if( unit_array.is_deleted(i) ) continue; unitPtr = unit_array[i]; if( unitPtr->nation_recno == info.viewing_nation_recno && (unitPtr->rank_id==RANK_GENERAL || unitPtr->rank_i...
false
false
false
false
false
0
nvs_vpd_write ( struct nvs_device *nvs, unsigned int field, const void *data, size_t len ) { struct nvs_vpd_device *nvsvpd = container_of ( nvs, struct nvs_vpd_device, nvs ); struct pci_device *pci = nvsvpd->vpd.pci; unsigned int address; size_t max_len; int rc; /* Locate VPD field */ if ( ( rc = pci_vp...
false
false
false
false
false
0
imprime_matriz(int m, int n, float **M) { int i, j /* indices para percorrer a matriz */ ; for (i = 0; i < m; i++) { for (j = 0; j < n; j++) printf("%.4f\t", M[i][j]); printf("\n"); } printf("\n"); }
false
false
false
false
false
0
getCoverageForFunction(const FunctionRecord &Function) { auto MainFileID = findMainViewFileID(Function); if (!MainFileID) return CoverageData(); CoverageData FunctionCoverage(Function.Filenames[*MainFileID]); std::vector<coverage::CountedRegion> Regions; for (const auto &CR : Function.CountedRegions) ...
false
false
false
false
false
0
__cdsgroup_discard(txn, flags) DB_TXN *txn; u_int32_t flags; { ENV *env; COMPQUIET(flags, 0); env = txn->mgrp->env; /* * As the txn handle can not be used any more, we call * __cdsgroup_commit to release the lock and destroy the handle. */ (void)__cdsgroup_commit(txn, 0); return (__cdsgroup_notsup(env, "...
false
false
false
false
false
0
fromPacket(ArBasePacket *packetIn, ArMapId *mapIdOut) { if ((packetIn == NULL) || (mapIdOut == NULL)) { return false; } char sourceBuffer[512]; packetIn->bufToStr(sourceBuffer, sizeof(sourceBuffer)); char fileNameBuffer[512]; packetIn->bufToStr(fileNameBuffer, sizeof(f...
false
false
false
false
false
0
toConstraint(SharedContext& ctx, ClauseCreator& gc, ProgramBuilder& prg) { if (value() != value_free && !ctx.addUnary(trueLit())) { return false; } if (!hasVar()) { return true; } ClauseCreator bc(ctx.master()); Literal a = literal(); gc.start().add(~a); prg.vars_.mark( ~a ); bool sat = false; bool nant= !ne...
false
false
false
false
false
0
e_theme_handler_set(void *data __UNUSED__, Evas_Object *obj __UNUSED__, const char *path) { E_Action *a; char buf[PATH_MAX]; int copy = 1; if (!path) return; /* if not in system dir or user dir, copy to user dir */ e_prefix_data_concat_static(buf, "data/themes"); if (!strncmp(buf, path, strlen(bu...
true
true
false
false
false
1
create_the_matrix(TSPCostTable *table, int rows, int columns) { int i; table->cost_table = malloc(rows * sizeof(int*)); if (!table->cost_table) printf("Everything is bad, you must ask for help\n"); table->cost_table[0] = malloc(rows * columns * sizeof(int)); if (!table->cost_table) printf("Everything is ba...
false
false
false
true
false
1
peep2_reg_dead_p (ofs, reg) int ofs; rtx reg; { int regno, n; if (ofs >= MAX_INSNS_PER_PEEP2 + 1) abort (); ofs += peep2_current; if (ofs >= MAX_INSNS_PER_PEEP2 + 1) ofs -= MAX_INSNS_PER_PEEP2 + 1; if (peep2_insn_data[ofs].insn == NULL_RTX) abort (); regno = REGNO (reg); n = HARD...
false
false
false
false
false
0
port_get_link_speed(struct ksz_port *port) { uint interrupt; struct ksz_port_info *info; struct ksz_port_info *linked = NULL; struct ksz_hw *hw = port->hw; u16 data; u16 status; u8 local; u8 remote; int i; int p; int change = 0; interrupt = hw_block_intr(hw); for (i = 0, p = port->first_port; i < port->p...
false
false
false
false
false
0
TestOptions(int argc, char **argv) { int opt = 0; int ex_code = 0; Badge.port = DEFAULT_PORT; Badge.speed = DEFAULT_SPEED; while( (opt=getopt(argc, argv, OPT_LIST)) != -1) { switch(opt) { case 'p': { Badge.port = optarg; break; } case 'v': { Badge.speed=atoi(op...
false
false
false
false
false
0
gdome_n_unref (GdomeNode *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } *exc = 0; if (((Gdome_xml_Node *)self)->n == NULL) { if (((Gdome_xml_Node *)self)->refcnt > 0) ((Gdome_xml_Node *)self)->refcnt--; if (((Gdome_xml_Node *)self)->refcnt == 0 && ((Gdome_xml_...
false
false
false
false
false
0
hpt36x_init_chipset(struct pci_dev *dev) { u8 drive_fast; pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, (L1_CACHE_BYTES / 4)); pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0x78); pci_write_config_byte(dev, PCI_MIN_GNT, 0x08); pci_write_config_byte(dev, PCI_MAX_LAT, 0x08); pci_read_config_byte(dev, 0x51, &dri...
false
false
false
false
false
0
Multiply(const Element &a, const Element &b) const { size_t aSize = STDMIN(a.reg.size(), result.reg.size()); Element r((word)0, m); for (int i=m-1; i>=0; i--) { if (r[m-1]) { ShiftWordsLeftByBits(r.reg.begin(), r.reg.size(), 1); XorWords(r.reg.begin(), m_modulus.reg, r.reg.size()); } else ShiftWor...
false
false
false
false
false
0
rj54n1_g_register(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg) { struct i2c_client *client = v4l2_get_subdevdata(sd); if (reg->reg < 0x400 || reg->reg > 0x1fff) /* Registers > 0x0800 are only available from Sharp support */ return -EINVAL; reg->size = 1; reg->val = reg_read(client, reg->reg)...
false
false
false
false
false
0
mg_link_irctab (session *sess, int focus) { GtkWidget *win; if (sess->gui->is_tab) { win = mg_changui_destroy (sess); mg_changui_new (sess, sess->res, 0, focus); mg_populate (sess); hexchat_is_quitting = FALSE; if (win) gtk_widget_destroy (win); return; } mg_unpopulate (sess); win = mg_changui_de...
false
false
false
false
false
0
sat_log_browser_open () { GtkWidget *hbox; gchar *fname; gchar *confdir; if (!initialised) { /* do some init stuff */ hbox = gtk_hbox_new (FALSE, 10); gtk_box_pack_start_defaults (GTK_BOX (hbox), create_message_list ()); ...
false
false
false
false
false
0
pad_max_char(CHARSET_INFO *cs, char *str, char *end) { char buf[10]; char buflen; if (!(cs->state & MY_CS_UNICODE)) { if (cs->max_sort_char <= 255) { bfill(str, end - str, cs->max_sort_char); return; } buf[0]= cs->max_sort_char >> 8; buf[1]= cs->max_sort_char & 0xFF; bufle...
true
true
false
false
false
1
sbitmap_a_and_b (sbitmap dst, sbitmap a, sbitmap b) { unsigned int i, n = dst->size; sbitmap_ptr dstp = dst->elms; sbitmap_ptr ap = a->elms; sbitmap_ptr bp = b->elms; for (i = 0; i < n; i++) *dstp++ = *ap++ & *bp++; }
false
false
false
false
true
1
camel_db_delete_uid (CamelDB *cdb, const gchar *folder, const gchar *uid, GError **error) { gchar *tab; gint ret; camel_db_begin_transaction (cdb, error); ret = camel_db_create_deleted_table (cdb, error); tab = sqlite3_mprintf ( "INSERT OR REPLACE...
false
false
false
false
false
0
_tpl_log_manager_clear_account (TplLogManager *self, TpAccount *account) { GList *l; TplLogManagerPriv *priv; g_return_if_fail (TPL_IS_LOG_MANAGER (self)); priv = self->priv; for (l = priv->stores; l != NULL; l = g_list_next (l)) { _tpl_log_store_clear_account (TPL_LOG_STORE (l->data), accoun...
false
false
false
false
false
0
ast_for_with_stmt(struct compiling *c, const node *n) { int i, n_items; asdl_seq *items, *body; REQ(n, with_stmt); n_items = (NCH(n) - 2) / 2; items = asdl_seq_new(n_items, c->c_arena); for (i = 1; i < NCH(n) - 2; i += 2) { withitem_ty item = ast_for_with_item(c, CHILD(n, i)); ...
false
false
false
false
true
1