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
memcpy_endian(void *dst, void *src, size_t n) { union { uint8_t b; uint32_t u; } host_endian; host_endian.u = 1; if (host_endian.b == LJ_ENDIAN_SELECT(1, 0)) { memcpy(dst, src, n); } else { size_t i; for (i = 0; i < n; i++) ((uint8_t *)dst)[i] = ((uint8_t *)src)[n-i-1]; } }
false
true
false
false
false
1
jobacct_storage_p_job_start(void *db_conn, struct job_record *job_ptr) { slurmdbd_msg_t msg, msg_rc; dbd_job_start_msg_t req; dbd_id_rc_msg_t *resp; int rc = SLURM_SUCCESS; if ((rc = _setup_job_start_msg(&req, job_ptr)) != SLURM_SUCCESS) return rc; msg.msg_type = DBD_JOB_START; msg.data ...
false
false
false
false
false
0
extract_string(char **string) { char *str; if(**string != '"') return NULL; else (*string)++; str = *string; for(; *str; str++) { switch(*str) { case '"': return str; break; case '\\': str++; break; } } return NULL; }
false
false
false
false
false
0
export_srcsel_cb(GtkWidget *widget, gpointer data) { FolderItem *src; src = foldersel_folder_sel(NULL, FOLDER_SEL_ALL, NULL, FALSE); if (src && src->path) gtk_entry_set_text(GTK_ENTRY(src_entry), src->path); }
false
false
false
false
false
0
ajTextinClear(AjPTextin thys) { ajDebug("ajTextinClear called\n"); if(!thys) return; ajStrSetClear(&thys->Db); ajStrSetClear(&thys->Qry); ajStrSetClear(&thys->Formatstr); ajStrSetClear(&thys->QryFields); ajStrSetClear(&thys->Filename); /* preserve thys->List */ if(thys->...
false
false
false
false
false
0
lf_read_pre_raw_newline( pnmState *pnm, byte *data, int len) { while(pnm->pos < len && data[pnm->pos] != '\n' && data[pnm->pos] != '\r') pnm->pos++; if(pnm->pos >= len) return PNM_NEED_DATA; if(pnm->mac_newlines && data[pnm->pos] == '\n') { if(pnm->pos >= len-1) return PNM_NEED_DATA; els...
false
false
false
false
false
0
mcap_uncache_mcl(struct mcap_mcl *mcl) { if (!(mcl->ctrl & MCAP_CTRL_CACHED)) return; DBG("Got MCL from cache"); mcl->mi->cached = g_slist_remove(mcl->mi->cached, mcl); mcl->mi->mcls = g_slist_prepend(mcl->mi->mcls, mcl); mcl->ctrl &= ~MCAP_CTRL_CACHED; mcl->ctrl &= ~MCAP_CTRL_FREE; }
false
false
false
false
false
0
fdgradf(vnl_vector<double> const& x) { vnl_vector<double> g(dim); this->fdgradf(x, g); return g; }
false
false
false
false
false
0
gwy_serialize_get_struct_size(const guchar *object_name, gsize nspec, const GwySerializeSpec *spec) { gsize i, size; g_return_val_if_fail(spec || !nspec, 0); g_return_val_if_fail(object_name && *object_name, 0); size = strlen(object_name) + 1...
false
false
false
false
false
0
xmms_samba_browse (xmms_xform_t *xform, const gchar *url, xmms_error_t *error) { struct smbc_dirent *dir; int handle; g_static_mutex_lock (&mutex); handle = smbc_opendir (url); g_static_mutex_unlock (&mutex); if (handle < 0) { xmms_error_set (error, XMMS_ERROR_GENERIC, "C...
false
false
false
false
false
0
av_set_lookup_and_remove (av_set_t *setp, vinsn_t sought_vinsn) { expr_t expr; av_set_iterator i; FOR_EACH_EXPR_1 (expr, i, setp) if (vinsn_equal_p (EXPR_VINSN (expr), sought_vinsn)) { _list_iter_remove_nofree (&i); return expr; } return NULL; }
false
false
false
false
false
0
read_executable(File_list* files) { this->obj_ = this->make_object(NULL); unsigned int shnum = this->shnum(); this->is_compressed_.resize(shnum); this->shndx_map_.resize(shnum); unsigned int debug_info = 0; unsigned int debug_abbrev = 0; // Scan the section table and collect the debug sections we need....
false
false
false
false
false
0
jl_serialize_tag_type(ios_t *s, jl_value_t *v) { if (jl_is_struct_type(v)) { writetag(s, (jl_value_t*)jl_struct_kind); jl_serialize_value(s, jl_struct_kind); jl_serialize_value(s, ((jl_struct_type_t*)v)->name); jl_serialize_value(s, ((jl_struct_type_t*)v)->parameters); jl_ser...
false
false
false
false
false
0
pooldetails(char *param, char **url, char **user, char **pass) { char *ptr, *buf; ptr = buf = cgmalloc(strlen(param)+1); *url = buf; // copy url copyadvanceafter(',', &param, &buf); if (!(*param)) // missing user goto exitsama; *user = buf; // copy user copyadvanceafter(',', &param, &buf); if (!*para...
false
false
false
false
false
0
NP_unmarshalComplexParams(cdrStream &s, TypeCode_offsetTable* otbl) { TypeCode_alias* _ptr = new TypeCode_alias; otbl->addEntry(otbl->currentOffset(), _ptr); _ptr->pd_repoId = s.unmarshalRawString(); _ptr->pd_name = s.unmarshalRawString(); _ptr->pd_content = TypeCode_marshaller::unmarshal(s, otbl);...
false
false
false
false
false
0
lockFile(int fd, StgWord64 dev, StgWord64 ino, int for_writing) { Lock key, *lock; ACQUIRE_LOCK(&file_lock_mutex); key.device = dev; key.inode = ino; lock = lookupHashTable(obj_hash, (StgWord)&key); if (lock == NULL) { lock = stgMallocBytes(sizeof(Lock), "lockFile"); loc...
false
false
false
false
false
0
gw_status_bar_put_msg_catalog ( GtkWindow *w, GtkCTree *ctree, GtkCTreeNode *root, gint num, gdouble size) { GWDBContext *context = gw_am_get_current_catalog_context ( ); GWCatalogPlugin *plugin = (GWCatalogPlugin*)gw_db_context_get_plugin ( context); GWDBCatalog *catalog = NULL; gchar *msg1, *msg2; gchar *tmp = N...
false
false
false
false
false
0
processYUVImage(imageStruct &image) { int h,w; long src = 0; //format is U Y V Y for (h=0; h<image.ysize; h++){ for(w=0; w<image.xsize/2; w++){ image.data[src+chU ] = CLAMP( image.data[src+chU] + U ); image.data[src+chY0] = CLAMP( image.data[src+chY0]+ Y ); image.data[src+chV ] = CLAM...
false
false
false
false
false
0
get_parameter(int param) const { switch (param) { case 1: return center; case 2: return width; } return 0.0; }
false
false
false
false
false
0
mkencap_copy_file_to_fd(char *file1, int fd2) { char buf[10240]; int fd1, retval = 0; ssize_t sz; fd1 = open(file1, O_RDONLY); if (fd1 == -1) { fprintf(stderr, "mkencap: open(\"%s\"): %s\n", file1, strerror(errno)); return -1; } while ((sz = read(fd1, buf, sizeof(buf))) > 0) { if (write(fd2, buf, sz...
false
false
false
false
false
0
AVCBinWritePrj(AVCBinFile *psFile, char **papszPrj) { if (psFile->eFileType != AVCFilePRJ) return -1; CSLSave(papszPrj, psFile->pszFilename); if (CPLGetLastErrorNo() != 0) return -1; return 0; }
false
false
false
false
false
0
delayedInitialize() { if (hasError) return false; if (state != PluginSpec::Running) { return false; } if (!plugin) { errorString = QCoreApplication::translate("PluginSpec", "Internal error: have no plugin instance to perform delayedInitialize"); hasError = true; ...
false
false
false
false
false
0
get1byte() { if (input_stack_depth == 0) #ifdef LIBRARY { if (*getcharbuffer == '\0') return EOF; return (int) *getcharbuffer ++; } #else return getchar(); #endif /* LIBRARY */ else return input_stack[-- input_stack_depth]; }
true
true
false
false
true
1
SpinControl_Draw( menulist_s *s ) { char buffer[100]; if ( s->generic.name ) { Menu_DrawStringR2LDark( s->generic.x + s->generic.parent->x + LCOLUMN_OFFSET, s->generic.y + s->generic.parent->y, s->generic.name ); } if ( !strchr( s->itemnames[s->curvalue], '\n' ) ) { Menu_DrawString( RCOLUMN_O...
false
false
false
false
false
0
read(istream & is) { Lexer lexrc(lyxrcTags); lexrc.setStream(is); LYXERR(Debug::LYXRC, "Reading istream..."); return read(lexrc, false) == ReadOK; }
false
false
false
false
false
0
rdac_bus_attach(struct scsi_device *sdev) { struct rdac_dh_data *h; int err; char array_name[ARRAY_LABEL_LEN]; char array_id[UNIQUE_ID_LEN]; h = kzalloc(sizeof(*h) , GFP_KERNEL); if (!h) return -ENOMEM; h->lun = UNINITIALIZED_LUN; h->state = RDAC_STATE_ACTIVE; err = get_lun_info(sdev, h, array_name, array_...
true
true
false
false
false
1
summary_tags_menu_create(SummaryView *summaryview, gboolean refresh) { GtkWidget *label_menuitem; GtkWidget *menu; GtkWidget *item; GSList *cur = tags_get_list(); GSList *orig = NULL; gboolean existing_tags = FALSE; gchar *accel_path = NULL; cur = orig = g_slist_sort(cur, summary_tag_cmp_list); label_menuite...
false
false
false
false
false
0
unit_setdir(struct block_list *bl,int dir) { nullpo_retr( 0, bl ); if(bl->type == BL_PC) pc_setdir((struct map_session_data *)bl, dir, dir); else if(bl->type == BL_MOB) ((struct mob_data *)bl)->dir = dir; else if(bl->type == BL_PET) ((struct pet_data *)bl)->dir = dir; else if(bl->type == BL_HOM) ((struct ...
false
false
false
false
false
0
send_headers(Reply &r) { Reply::iterator i; for (i = r.begin(); i != r.end(); ) { int sent = safe_write(fd(), &(*i), distance(i, r.end())); if (sent <= 0) { Log::get(Log::DEBUG) << "Could not send response to client" << endl; return false; } i += sent;...
false
false
false
false
false
0
Execute(ParticleGroup *group) { // Must traverse list in reverse order so Remove will work for (int i = group->p_count-1; i >= 0; i--) { Particle &m = group->list[i]; if ((m.vel.length2() < speedLimitSqr) == kill_less_than) group->Remove(i); } }
false
false
false
false
false
0
mapvue_read_group1151(const guchar *p, gsize size, gpointer grpdata, GError **error) { enum { SIZE = 2*4 }; MapVueGroup1151 *group = (MapVueGroup1151*)grpdata; if (!(size = mapvue_group_size(&p, size, group->reftag, error))) return 0; if (err_TAG_SIZE(error, group->reftag...
false
false
false
false
false
0
qpol_cat_t_get_name(qpol_cat_t *self,qpol_policy_t *p){ const char *name; BEGIN_EXCEPTION if (qpol_cat_get_name(p, self, &name)) { {tcl_throw_error("Could not get category name"); goto fail;}; } END_EXCEPTION return name; fail: return NULL; }
false
false
false
false
false
0
registerPlugins (ggobid * gg, GList * plugins) { GList *el = plugins; gboolean ok = false; GGobiPluginInfo *plugin; while (el) { plugin = (GGobiPluginInfo *) el->data; ok = registerPlugin (gg, plugin) || ok; el = el->next; } return (ok); }
false
false
false
false
false
0
gt_ggc_mx_edge_def (void *x_p) { struct edge_def * const x = (struct edge_def *)x_p; if (ggc_test_and_set_mark (x)) { gt_ggc_m_15basic_block_def ((*x).src); gt_ggc_m_15basic_block_def ((*x).dest); switch (current_ir_type () == IR_GIMPLE) { case true: gt_ggc_m_12gimple...
false
false
false
false
false
0
snd_usbmidi_standard_output(struct snd_usb_midi_out_endpoint *ep, struct urb *urb) { int p; /* FIXME: lower-numbered ports can starve higher-numbered ports */ for (p = 0; p < 0x10; ++p) { struct usbmidi_out_port *port = &ep->ports[p]; if (!port->active) continue; while (urb->transfer_buffer_length + 3...
false
false
false
false
false
0
xorExpression() { Node *right, *result ; result = andExpression() ; for (;;) { if (match (CARET)) { right = andExpression() ; result = new Node (this,CARET, result, right) ; } else { return result ; } } }
false
false
false
false
false
0
sysctl_max_threads(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { struct ctl_table t; int ret; int threads = max_threads; int min = MIN_THREADS; int max = MAX_THREADS; t = *table; t.data = &threads; t.extra1 = &min; t.extra2 = &max; ret = proc_dointvec_minmax...
false
false
false
false
false
0
split(unsigned char token, mstring *left, mstring *remain) const { int i = fOffset; int e = fOffset + fCount; int c = 0; unsigned char ch; PRECONDITION(token < 128); while (i < e) { ch = fStr->fStr[i]; if (ch == token) { mstring l(fStr, fOffset, i - fOffset); ...
false
false
false
false
false
0
ipmi_destroy(struct ipmi *i) { ipmi_reap(i); if (i->i_user) { free(i->i_user); i->i_user = NULL; } if (i->i_password) { free(i->i_password); i->i_password= NULL; } if (i->i_host) { free(i->i_host); i->i_host = NULL; } i->i_config = 0; i->i_id = NOTIPMI; }
false
false
false
false
false
0
find_subtree(struct cache_tree *it, const char *path, int pathlen, int create) { struct cache_tree_sub *down; int pos = subtree_pos(it, path, pathlen); if (0 <= pos) return it->down[pos]; if (!create) return NULL; pos = -pos-1; if (it->subtree_alloc <= it->subtree_nr) { it->subtree_...
false
false
false
false
false
0
gc_item_focus_remove(GooCanvasItem *source_item, GooCanvasItem *target_item) { GooCanvasItem *highlight_item; if(!target_item) target_item = source_item; g_signal_handlers_disconnect_by_func(source_item, (GCallback) gc_item_focus_event, target_item); highlight_item = g_object_g...
false
false
false
false
false
0
yy_HtmlBlock() { int yypos0= yypos, yythunkpos0= yythunkpos; yyprintf((stderr, "%s\n", "HtmlBlock")); yyText(yybegin, yyend); if (!(YY_BEGIN)) goto l1277; { int yypos1278= yypos, yythunkpos1278= yythunkpos; if (!yy_HtmlBlockInTags()) goto l1279; goto l1278; l1279:; yypos= yypos1278; yythunkpos= yythunkpos...
false
false
false
false
false
0
Atalasify(const ExtendedOctree &tree, size_t index, const UINTVECTOR2& atlasSize, uint8_t* pData) { const TOCEntry& metaData = tree.GetBrickToCData(index); const UINTVECTOR3 maxBrickSize = t...
false
false
false
false
false
0
set_presence_info (const std::string _presence, const std::string _status) { presence = _presence; status = _status; set_presence (_presence); set_status (_status); updated (); }
false
false
false
false
false
0
AddCA(SSL_CTX* ctx, buffer der) { word32 ret; DecodedCert cert; Signer* signer = 0; CYASSL_MSG("Adding a CA"); InitDecodedCert(&cert, der.buffer, ctx->heap); ret = ParseCert(&cert, der.length, CA_TYPE, ctx->verifyPeer, 0); CYASSL_MSG(" Parsed new CA"); if (ret == 0) { ...
false
false
false
false
false
0
for_handler(char *begin, char *operand ) { char *ptr,*next,*line,string[MAX_LINE_LENGTH]; int start,end,i,done; int diff, incr=1; struct sym *sym; ptr=strtok(operand,"="); start= arg_decode(strtok(NULL,":"),0); end = arg_decode(strtok(NULL," \t"),0); ...
false
false
false
false
true
1
getPathPolyByPosition(const dtPolyRef* polyPath, uint32 polyPathSize, const float* point, float* distance) const { if (!polyPath || !polyPathSize) return INVALID_POLYREF; dtPolyRef nearestPoly = INVALID_POLYREF; float minDist2d = FLT_MAX; float minDist3d = 0.0f; for (uint32 i = 0; i < poly...
false
false
false
false
false
0
about_textview_uri_clicked(GtkTextTag *tag, GObject *obj, GdkEvent *event, GtkTextIter *iter, GtkWidget *textview) { GtkTextIter start_iter, end_iter; GdkEventButton *bevent; gchar *link = NULL; if (!event || !tag) { return FALSE; } if (event->type != GDK_BUTTON_PRESS && event->type != GDK_2BUTTON_P...
false
false
false
false
false
0
pushscope(scope, dont) int scope, dont; { currscope = malloc(sizeof(struct scope_el)); currscope->scope = scope; currscope->nline = nline; currscope->vars = NULL; if (!dont) currscope->id = scope_ids[scope]++; ppush(&scopestack, currscope); scopelevel++; }
false
false
false
false
false
0
amdmsOpenData(amdmsFITS *file, amdmsFITS_FLAGS flags, int nReads) { char *extName; amdmsDebug(__FILE__, __LINE__, "amdmsOpenData(%s, (%d, %d, %d), %d)", file->fileName, flags.content, flags.format, flags.type, nReads); switch (flags.content) { case amdmsIMAGING_DATA_CONTENT: extName = amdmsIMAG...
false
false
false
false
false
0
do_import(char *fname) { FILE *f; char *path, *name; struct imports *import; int ptr = import_stack_ptr; int ret, fd; import = first_import; while (import && strcmp(import->name, fname)) import = import->next; if (import) return 0; /* already imported */ import = xmalloc(sizeof(struct imports)); import->n...
false
false
false
false
true
1
_Csec_display_status_1(m, code, type, buf, bufsize) char *m; OM_uint32 code; int type; char *buf; int bufsize; { OM_uint32 maj_stat, min_stat; gss_buffer_desc msg; OM_uint32 msg_ctx; msg_ctx = 0; while (1) { maj_stat = gss_display_status(&min_stat, code, type, GSS_C_NULL_O...
false
false
false
false
false
0
cw1200_suspend_work(struct delayed_work *work) { int ret = cancel_delayed_work(work); long tmo; if (ret > 0) { /* Timer is pending */ tmo = work->timer.expires - jiffies; if (tmo < 0) tmo = 0; } else { tmo = -1; } return tmo; }
false
false
false
false
false
0
handle_cancel (GVfsDBusDaemon *object, GDBusMethodInvocation *invocation, guint arg_serial, gpointer user_data) { GVfsDaemon *daemon = G_VFS_DAEMON (user_data); GList *l; GVfsJob *job_to_cancel = NULL; g_mutex_lock (&daemon->lock); for (l = daemon->jobs; l != NULL...
false
false
false
false
false
0
addbddnodelist( BddSystem, HeadList, BddNode ) bddsystem *BddSystem; chain_list *HeadList; bddnode *BddNode; { chain_list **PrevList; chain_list *ScanList; chain_list *NewList; bddvar *IndexToVar; bddvar Variable; bddvar ScanVar; setbddlocalsystem( BddSystem ); NewList = ...
false
false
false
false
false
0
gfire_hex_str_to_bin(const gchar *p_str) { if(!p_str) return NULL; guint8 *ret = g_malloc0(strlen(p_str) / 2); if(!ret) return NULL; int bin_pos = 0; int i = 0; for(; i < strlen(p_str); i++) { int value = 0; switch(p_str[i]) { case '0': value += 0x00; break; case '1': value += 0x01; b...
false
false
false
false
false
0
read(DcmItem &dset) { OFCondition result = EC_Normal; DcmStack stack; READ_FROM_DATASET(DcmCodeString, graphicAnnotationLayer) if (result==EC_Normal) result = textObjectList.read(dset); if (result==EC_Normal) result = graphicObjectList.read(dset); if (result==EC_Normal) result = referencedImageList.read(ds...
false
false
false
false
false
0
er_stringarray_get ( er_stringarray_t *csa, int indx) { /* called very often ... ER_TRACE(__func__); */ if (csa == NULL) return NULL; if (csa->strings == NULL) return NULL; if ( (indx < 0) || (indx > csa->nstrings) ) return NULL; return csa->strings[indx]; }
false
false
false
false
false
0
set_xfer_rate(struct AdapterCtlBlk *acb, struct DeviceCtlBlk *dcb) { struct DeviceCtlBlk *i; /* set all lun device's period, offset */ if (dcb->identify_msg & 0x07) return; if (acb->scan_devices) { current_sync_offset = dcb->sync_offset; return; } list_for_each_entry(i, &acb->dcb_list, list) if (i->ta...
false
false
false
false
false
0
ini_comment_add(struct ini_comment *ic_to_add, struct ini_comment *ic) { int error = EOK; struct simplebuffer *sb = NULL; struct simplebuffer *sb_new = NULL; void *res = NULL; uint32_t len = 0; int i; TRACE_FLOW_ENTRY(); len = ref_array_len(ic_to_add->ra); for ...
false
false
false
false
false
0
s_hierarchy_setup_rename(TOPLEVEL * pr_current, NETLIST * head, char *uref, char *label, char *new_name) { NETLIST *nl_current; CPINLIST *pl_current; char *wanted_uref = NULL; int did_work = FALSE; /* this is questionable, because I'm not sure if it's exactly the */ /* same as the #if 0'ed ...
false
false
false
false
false
0
gulp_is_keyword(gchar *text) { gint i, n; if (!text) return(-1); i=0; while (gulp_keyword[i].label) { n = strlen(gulp_keyword[i].label); if (g_strncasecmp(text, gulp_keyword[i].label, n) == 0) return(gulp_keyword[i].code); i++; } return(-1); }
false
false
false
false
false
0
add_level(s_level *new_lev) { s_level *prev, *curr; prev = (s_level *) 0; for (curr = sp_levchn; curr; curr = curr->next) { if (curr->dlevel.dnum == new_lev->dlevel.dnum && curr->dlevel.dlevel > new_lev->dlevel.dlevel) break; prev = curr; } if (!prev)...
false
false
false
false
false
0
string_to_primary_list(char *str) { GSList *l = NULL; char **services; int i; if (str == NULL) return NULL; services = g_strsplit(str, " ", 0); if (services == NULL) return NULL; for (i = 0; services[i]; i++) { struct gatt_primary *prim; int ret; prim = g_new0(struct gatt_primary, 1); ret = ssca...
false
false
false
false
false
0
nfs41_sequence_handle_errors(struct rpc_task *task, struct nfs_client *clp) { switch(task->tk_status) { case -NFS4ERR_DELAY: rpc_delay(task, NFS4_POLL_RETRY_MAX); return -EAGAIN; default: nfs4_schedule_lease_recovery(clp); } return 0; }
false
false
false
false
false
0
last_at_before_slash(const char *sp) { const char *cp; for (cp = sp; *cp; cp++) if (*cp == '/') break; while (cp > sp && *--cp != '@'); return *cp == '@' ? (char *)cp : NULL; }
false
false
false
false
false
0
populate_popup_cb (GtkAppChooserWidget *widget, GtkMenu *menu, GAppInfo *app, gpointer user_data) { GtkWidget *item; NemoMimeApplicationChooser *chooser = user_data; if (g_app_info_can_remove_supports_type (app)) { item = gtk_menu_item_new_with_label (_("Forget association")); gtk_menu_shell_appe...
false
false
false
false
false
0
makepat(string,delim) char *string, delim; /* make up the pattern string for find -- ripped from 'Software Tools' */ { char *cp = 0, *oldcp; char *start = string; int inarg = FALSE; for(arg=0;arg<9;++arg) RE_start[arg] = RE_size[arg] = (-1); arg = 0; p = pattern; while ((*string != de...
false
false
false
false
false
0
indexNodes() { for (auto &I : Nodes) Lookup[I.Node.Index] = &I; }
false
false
false
false
false
0
gf_svg_get_modification_flags(SVG_Element *n, GF_FieldInfo *info) { // return 0xFFFFFFFF; switch (info->fieldType) { case SVG_Paint_datatype: if (info->fieldIndex == TAG_SVG_ATT_fill) return GF_SG_SVG_FILL_DIRTY; if (info->fieldIndex == TAG_SVG_ATT_stroke) return GF_SG_SVG_STROKE_DIRTY; if (info->fieldIndex ==...
false
false
false
false
false
0
gps_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct asus_laptop *asus = dev_get_drvdata(dev); int rv, value; int ret; rv = parse_arg(buf, count, &value); if (rv <= 0) return -EINVAL; ret = asus_gps_switch(asus, !!value); if (ret) return ret; rfkill_set_s...
false
false
false
false
false
0
mca_coll_ml_allreduce_small_unpack(mca_coll_ml_collective_operation_progress_t *coll_op) { int ret; /* need to put in more */ int count = coll_op->variable_fn_params.count; ompi_datatype_t *dtype = coll_op->variable_fn_params.dtype; void *dest = (void *)((uintptr_t)coll_op->full_message.dest_user_a...
false
false
false
false
false
0
utox(char *buffer, const size_t size, unsigned int value, unsigned int fixedlen, unsigned int fill0) { char *p; int digit; /* sanity checks */ if (buffer == NULL || size < 2) return (NULL); /* p points to last char */ p = buffer + size - 1; /* set terminating zero */ *p = '\0'; ...
false
false
false
false
false
0
make_source_pathname(PyObject *path) { Py_ssize_t left, right, dot0, dot1, len; Py_ssize_t i, j; PyObject *result; int kind; void *data; len = PyUnicode_GET_LENGTH(path); if (len > MAXPATHLEN) return NULL; /* Look back two slashes from the end. In between these two slashes ...
false
false
false
false
false
0
adv_calc_transform(const struct city *pcity, const struct tile *ptile) { int goodness; struct tile *vtile; struct terrain *old_terrain, *new_terrain; fc_assert_ret_val(ptile != NULL, -1) old_terrain = tile_terrain(ptile); new_terrain = old_terrain->transform_result; if (old...
false
false
false
false
false
0
start_board (GcomprisBoard *agcomprisBoard) { if(agcomprisBoard!=NULL) { gcomprisBoard=agcomprisBoard; /* disable im_context */ gcomprisBoard->disable_im_context = TRUE; gc_set_default_background(goo_canvas_get_root_item(gcomprisBoard->canvas)); gcomprisBoard->level=1; gcomprisBoard->maxl...
false
false
false
false
false
0
mca_io_ompio_file_get_byte_offset (ompi_file_t *fh, OMPI_MPI_OFFSET_TYPE offset, OMPI_MPI_OFFSET_TYPE *disp) { mca_io_ompio_data_t *data; int i, k, index; size_t position; size_t total_bytes; size_t temp_offset; data = (mca_i...
false
false
false
false
false
0
parse_target_attribute(const char *value, bool tidy, GtStr *target_id, GtRange *target_range, GtStrand *target_strand, GtStrArray *target_ids, GtArray *target_ranges, ...
false
false
false
false
false
0
InstallNativeFunctions() { HandleScope scope; INSTALL_NATIVE(JSFunction, "CreateDate", create_date_fun); INSTALL_NATIVE(JSFunction, "ToNumber", to_number_fun); INSTALL_NATIVE(JSFunction, "ToString", to_string_fun); INSTALL_NATIVE(JSFunction, "ToDetailString", to_detail_string_fun); INSTALL_NATIVE(JSFunction...
false
false
false
false
false
0
generate_bash(const std::string& file, int debug) { index_jumps_labels(); if (connect_jumps()) { return 1; } if (debug) { for (std::vector<label>::iterator i = labels.labels.begin(); i != labels.labels.end(); ++i) { printf("%d:%s:\n", i->line, i->name.c_str()...
false
false
false
false
false
0
ps_bitreduce (unsigned char *buffer, PSL_LONG nx, PSL_LONG ny, PSL_LONG ncolors) { /* Reduce an 8-bit stream to 1-, 2- or 4-bit stream */ PSL_LONG in, out, i, j, nout, nbits; /* Number of colors determines number of bits */ if (ncolors <= 2) nbits = 1; else if (ncolors <= 4) nbits = 2; else if (ncolors <= 16...
false
false
false
false
false
0
pdfapp_oncopy(pdfapp_t *app, unsigned short *ucsbuf, int ucslen) { fz_bbox hitbox; fz_matrix ctm; fz_text_page *page = app->page_text; fz_text_block *block; fz_text_line *line; fz_text_span *span; int c, i, p; int seen = 0; int x0 = app->selr.x0; int x1 = app->selr.x1; int y0 = app->selr.y0; int y1 = app->...
false
false
false
false
false
0
_ipmi_kcs_cmd_read (ipmi_kcs_ctx_t ctx, fiid_obj_t obj_cmd_rs) { uint8_t *pkt = NULL; unsigned int pkt_len; int hdr_len, cmd_len, read_len, ret, rv = -1; fiid_obj_t obj_hdr = NULL; fiid_field_t *tmpl = NULL; assert (ctx); assert (ctx->magic == IPMI_KCS_CTX_MAGIC); assert (fiid_obj_v...
false
false
false
false
false
0
retrieve_arg(DBusMessageIter *iter, RETRIEVE_CALLBACK cb, void *param) { char *signature = dbus_message_iter_get_signature(iter); GB_TYPE gtype = from_dbus_type(signature); int type = dbus_message_iter_get_arg_type(iter); dbus_free(signature); if (dbus_type_is_basic(type)) { char val[16]; dbus_message_iter_...
false
false
false
false
false
0
do_qr_rpqnames(void) { #define TERM_PREFIX_SIZE 2 /* Each term has 1 byte length and 1 byte id */ unsigned char *rpql, *p_term; unsigned j; int term_id,i,x; int remaining = 254; /* maximum data area for rpqname reply */ Boolean omit_due_space_limit; trace_ds("> QueryReply(RPQNames)\n"); /* * Alloca...
false
false
false
false
false
0
a3c90x_transmit(struct net_device *netdev, struct io_buffer *iob) { struct INF_3C90X *inf_3c90x = netdev_priv(netdev); struct TXD *tx_cur_desc; struct TXD *tx_prev_desc; unsigned int len; unsigned int downlist_ptr; DBGP("a3c90x_transmit\n"); if (inf_3c90x->tx_cnt == TX_RING_SIZE) { DBG("TX-Ring overfl...
false
false
false
false
false
0
gen_absv2di2 (rtx operand0, rtx operand1) { rtx operand2; rtx operand3; rtx operand4; rtx _val = 0; start_sequence (); { rtx operands[5]; operands[0] = operand0; operands[1] = operand1; #line 2497 "../../src/gcc/config/rs6000/altivec.md" { int i, n_elt = GET_MODE_NUNITS (V2DImode); rtvec v ...
false
false
false
false
true
1
loadPixels(FXStream & store){ if(options&CURSOR_OWNED){FXFREE(&data);} if(fxloadICO(store,data,width,height,hotx,hoty)){ options|=CURSOR_OWNED; return true; } return false; }
false
false
false
false
false
0
pkinit_sign_data_fs(krb5_context context, pkinit_identity_crypto_context id_cryptoctx, unsigned char *data, unsigned int data_len, unsigned char **sig, unsigned int *sig_len) { if (create_signature(sig, sig_len, data...
false
false
false
false
false
0
hfs_mdb_close(struct super_block *sb) { /* update volume attributes */ if (sb->s_flags & MS_RDONLY) return; HFS_SB(sb)->mdb->drAtrb |= cpu_to_be16(HFS_SB_ATTRIB_UNMNT); HFS_SB(sb)->mdb->drAtrb &= cpu_to_be16(~HFS_SB_ATTRIB_INCNSTNT); mark_buffer_dirty(HFS_SB(sb)->mdb_bh); }
false
false
false
false
false
0
JS_GetFrameAnnotation(JSContext *cx, JSStackFrame *fp) { if (fp->annotation && fp->script) { JSPrincipals *principals = JS_StackFramePrincipals(cx, fp); if (principals && principals->globalPrivilegesEnabled(cx, principals)) { /* * Give out an annotation only if privileges h...
false
false
false
false
false
0
show_axesCmd() { double tmp; if (get_var("..xsize..", &tmp)) { sprintf(_grTempString, "Plot is %.1f cm wide, ", tmp); ShowStr(_grTempString); } if (get_var("..ysize..", &tmp)) { sprintf(_grTempString, "%.1f cm tall; margins ", tmp); ShowStr(_grTempString); } if (get_var("..xmargin..", &tmp)) { ...
false
false
false
false
false
0
palman_is_nondarkening(int r,int g, int b) { int i; for (i=0; i<Palman_num_nondarkening; i++ ) { if ( (r==Palman_non_darkening[i][0]) && (g==Palman_non_darkening[i][1]) && (b==Palman_non_darkening[i][2]) ) { return 1; } } return 0; }
false
false
false
false
false
0
setRowColumnCount(GeometryWindowItemList& rInfo) { int maxRow = 0, maxColumn = 0; for (GeometryWindowItemList::iterator itr = rInfo.begin(); itr != rInfo.end(); ++itr) { int row = (*itr).row(); int col = (*itr).column(); if (row > maxRow) maxRow = row; if (col > maxColumn) maxColumn = col; ...
false
false
false
true
false
1
byteReverse (unsigned char *buf, unsigned longs){ uint32 t; do { t = (uint32)((unsigned)buf[3]<<8 | buf[2]) << 16 | ((unsigned)buf[1]<<8 | buf[0]); *(uint32 *)buf = t; buf += 4; } while (--longs); }
false
false
false
false
false
0
gpio_flash_probe(struct platform_device *pdev) { size_t i, arr_size; struct physmap_flash_data *pdata; struct resource *memory; struct resource *gpios; struct async_state *state; pdata = dev_get_platdata(&pdev->dev); memory = platform_get_resource(pdev, IORESOURCE_MEM, 0); gpios = platform_get_resource(pdev, I...
false
false
false
false
false
0
validate_border (const GtkBorder *border, const char **bad) { *bad = NULL; if (border->top < 0) *bad = _("top"); else if (border->bottom < 0) *bad = _("bottom"); else if (border->left < 0) *bad = _("left"); else if (border->right < 0) *bad = _("right"); return *bad =...
false
false
false
false
false
0
_cmsRegisterParametricCurvesPlugin(cmsContext ContextID, cmsPluginBase* Data) { _cmsCurvesPluginChunkType* ctx = ( _cmsCurvesPluginChunkType*) _cmsContextGetClientChunk(ContextID, CurvesPlugin); cmsPluginParametricCurves* Plugin = (cmsPluginParametricCurves*) Data; _cmsParametricCurvesCollection* fl; i...
false
false
false
false
false
0
_init_event_queue(BLURAY *bd) { if (!bd->event_queue) { bd->event_queue = calloc(1, sizeof(struct bd_event_queue_s)); bd_mutex_init(&bd->event_queue->mutex); } else { bd_mutex_lock(&bd->event_queue->mutex); bd->event_queue->in = 0; bd->event_queue->out = 0; memse...
false
false
false
false
false
0
handleGetMonthLength(int32_t extendedYear, int32_t month) const { // If the month is out of range, adjust it into range, and // modify the extended year value accordingly. if (month < 0 || month > 11) { extendedYear += ClockMath::floorDivide(month, 12, month); } return isLeapYear(extendedY...
false
false
false
false
false
0