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
WRITEWORD(offs_t address, data16_t data) { /* aligned writes are easy */ if (!(address & 1)) { cpu_writemem32ledw_word(address, data); return; } /* misaligned writes are tricky */ if (!(address & 2)) { cpu_writemem32ledw(address + 1, data); cpu_writemem32ledw(address + 2, data >> 8); } ...
false
false
false
false
false
0
blksync() { int i; for (i = 0; i < NBUFS; i++) { /* blk[i].dirty = TRUE; */ blkflush(&blk[i]); } if (*o_sync) { sync(); } }
false
false
false
false
false
0
isInnerBoundary() { if ( ( (getObjectType() == OT_EDGE && model->getDimension() == ECIF_2D) || (getObjectType() == OT_FACE && model->getDimension() == ECIF_3D) ) && modelData != NULL && modelData->parent1Id != NO_INDEX && modelData->parent2Id != NO_INDEX && !isIntraLayerBou...
false
false
false
false
false
0
gnumeric_quotient (GnmFuncEvalInfo *ei, GnmValue const * const *argv) { gnm_float num = value_get_as_float (argv[0]); gnm_float den = value_get_as_float (argv[1]); if (den == 0) return value_new_error_DIV0 (ei->pos); else return value_new_float (gnm_trunc (num / den)); }
false
false
false
false
false
0
sendPlayerResources( GenericPlayer * player ) { AttalPlayerSocket * socket = findSocket( player ); for( int i = 0; i < DataTheme.resources.count(); i++ ) { if( socket ) { if( DataTheme.resources.get( i )->isGlobal() ) { socket->sendPlayerResource( i, player->getResourceList()->getValue( i ) ); } } } }
false
false
false
false
false
0
SetProjCS( const char * pszName ) { OGR_SRSNode *poGeogCS = NULL; OGR_SRSNode *poProjCS = GetAttrNode( "PROJCS" ); if( poRoot != NULL && EQUAL(poRoot->GetValue(),"GEOGCS") ) { poGeogCS = poRoot; poRoot = NULL; } if( poProjCS == NULL && GetRoot() != NULL ) { CPLDebu...
false
false
false
false
false
0
acpi_ut_delete_generic_state(union acpi_generic_state *state) { ACPI_FUNCTION_ENTRY(); /* Ignore null state */ if (state) { (void)acpi_os_release_object(acpi_gbl_state_cache, state); } return; }
false
false
false
false
false
0
gw_string_buffer_resize ( GWStringBuffer *p, gulong newsize) { gchar *ptr = NULL; gulong result = 0; #ifdef GW_DEBUG_DATA_COMPONENT g_print ( "*** GW - %s (%d) :: %s()\n", __FILE__, __LINE__, __PRETTY_FUNCTION__); #endif if ( p != NULL ) { /* This function can only increase the string capacity, not decrease....
false
false
false
false
false
0
vs_get_node(unsigned int node_id, VNodeType type) { if(VSNodeStorage.node_length > node_id) { VSNodeHead *node = VSNodeStorage.nodes[node_id]; if(node != NULL && node->type == type) return node; } return NULL; }
false
false
false
false
false
0
find_field(char *ptr, int field) { int i; char *init = ptr; if (field == NETSNMP_LASTFIELD) { /* * skip to end */ while (*ptr++); ptr = ptr - 2; /* * rewind a field length */ while (*ptr != 0 && isspace((uns...
false
false
false
false
true
1
rsvg_filter_primitive_blend_render (RsvgFilterPrimitive * self, RsvgFilterContext * ctx) { RsvgIRect boundarys; RsvgFilterPrimitiveBlend *upself; cairo_surface_t *output, *in, *in2; upself = (RsvgFilterPrimitiveBlend *) self; boundarys = rsvg_filter_primitive_get_bounds (self, ctx); in = rsv...
false
false
false
false
false
0
gclue_service_location_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GClueServiceLocation *self = GCLUE_SERVICE_LOCATION (object); GClue...
false
false
false
false
false
0
deinit_pollers() { struct poller *bp; int p; for (p = 0; p < nbpollers; p++) { bp = &pollers[p]; if (bp && bp->pref) bp->term(bp); } }
false
false
false
false
false
0
opMULirg_B_AA (int opcode) { CINEWORD temp_word = CCPU_RAM_RDMEM(register_I); cmp_new = temp_word; cmp_old = register_B; SETA0 (register_A & 0xFF); register_B <<= 4; register_B = SAR(register_B,5); if (register_A & 0x01) { register_B += temp_word; SETFC (register_B); register_B &= 0x0F...
false
false
false
false
false
0
findServiceTypeByName(const QString &_name) { if (!sycocaDict()) return KServiceType::Ptr(); // Error! assert (!KSycoca::self()->isBuilding()); int offset = sycocaDict()->find_string( _name ); if (!offset) return KServiceType::Ptr(); // Not found KServiceType::Ptr newServiceType(createEntry(offset)); ...
false
false
false
false
false
0
_deserialize_list_from_json_array (JsonArray *array, GType g_type) { JsonNode *json_node = NULL; GSList *result_list = NULL; gpointer element = NULL; guint n_elements = 0; guint i = 0; n_elements = json_array_get_length (array); if (!n_elements) return NULL; for (i = 0; i < n_elements; i++) { ...
false
false
false
false
false
0
gen_lexical_block_die (stmt, context_die, depth) tree stmt; dw_die_ref context_die; int depth; { dw_die_ref stmt_die = new_die (DW_TAG_lexical_block, context_die, stmt); char label[MAX_ARTIFICIAL_LABEL_BYTES]; if (! BLOCK_ABSTRACT (stmt)) { if (BLOCK_FRAGMENT_CHAIN (stmt)) { tree cha...
false
false
false
false
false
0
GetNumberOfEdgePoints(vtkIdType e) { if (vtkDistributedGraphHelper *helper = this->GetDistributedGraphHelper()) { int myRank = this->Information->Get(vtkDataObject::DATA_PIECE_NUMBER()); if (myRank != helper->GetEdgeOwner(e)) { vtkErrorMacro("vtkGraph cannot retrieve edge points for a non-loca...
false
false
false
false
false
0
prvAllocateTCBAndStack( const uint16_t usStackDepth, StackType_t * const puxStackBuffer ) { TCB_t *pxNewTCB; /* If the stack grows down then allocate the stack then the TCB so the stack does not grow into the TCB. Likewise if the stack grows up then allocate the TCB then the stack. */ #if( portSTACK_GROWTH...
false
false
false
false
false
0
xdr_gfs3_dirplist (XDR *xdrs, gfs3_dirplist *objp) { register int32_t *buf; buf = NULL; if (!xdr_u_quad_t (xdrs, &objp->d_ino)) return FALSE; if (!xdr_u_quad_t (xdrs, &objp->d_off)) return FALSE; if (!xdr_u_int (xdrs, &objp->d_len)) return FALSE; if (!xdr_u_int (xdrs, &objp->d_type)) retur...
false
false
false
false
false
0
goo_canvas_pointer_grab (GooCanvas *canvas, GooCanvasItem *item, GdkEventMask event_mask, GdkCursor *cursor, guint32 time) { GdkGrabStatus status = GDK_GRAB_SUCCESS; g_return_val_if_fail (GOO_IS_CANVAS (canvas), GDK_GRAB_NOT_VIEWABLE); g_return_val_if_fail (GOO_IS_CANVAS_ITEM (it...
false
false
false
false
false
0
enumerate_glob_enum(glob_enum_t *this, char **file, struct stat *st) { char *match; if (this->pos >= this->glob.gl_pathc) { return FALSE; } match = this->glob.gl_pathv[this->pos++]; if (file) { *file = match; } if (st) { if (stat(match, st)) { DBG1(DBG_LIB, "stat() on '%s' failed: %s", match, ...
false
false
false
false
false
0
ajGraphdataCalcXY(AjPGraphdata graphdata, ajuint numofpoints, float start, float incr, const float* y) { ajuint i; PLFLT x = 0.0; if(!graphdata->xcalc) AJFREE(graphdata->x); if(!graphdata->ycalc) AJFREE(graphdata->y); graphdata->xcalc = ajFalse; /* i.e. OK to delete at t...
false
false
false
false
false
0
vpaccess(char *path, mode_t amode) { char buf[MAXPATH + 1]; int returncode; int i; if ((returncode = access(path, amode)) == -1 && path[0] != '/') { vpinit(NULL); for (i = 1; i < vpndirs; i++) { (void) snprintf(buf, sizeof(buf), "%s/%s", vpdirs[i], path); if ((returncode = access(buf, amode)) != -1) { ...
true
true
false
false
true
1
initialize_libpthread_wrappers() { if (!_libpthread_wrappers_initialized) { dmtcp_setThreadPerformingDlopenDlsym(); void *pthread_handle = _real_dlopen(LIBPTHREAD_FILENAME, RTLD_NOW); dmtcp_unsetThreadPerformingDlopenDlsym(); if (pthread_handle == NULL) { fprintf(stderr, "*** DMTCP: Error: coul...
false
false
false
false
true
1
wm8994_gpio_probe(struct platform_device *pdev) { struct wm8994 *wm8994 = dev_get_drvdata(pdev->dev.parent); struct wm8994_pdata *pdata = dev_get_platdata(wm8994->dev); struct wm8994_gpio *wm8994_gpio; int ret; wm8994_gpio = devm_kzalloc(&pdev->dev, sizeof(*wm8994_gpio), GFP_KERNEL); if (wm8994_gpio == NU...
false
false
false
false
false
0
make_object(struct cave *c, object_type *j_ptr, int lev, bool good, bool great, s32b *value) { int base; object_kind *kind; /* Try to make a special artifact */ if (one_in_(good ? 10 : 1000)) { if (make_artifact_special(j_ptr, lev)) { if (value) *value = object_value_real(j_ptr, 1, FALSE, TRUE); return TRU...
false
false
false
false
false
0
load_from_file (TextEditor *te, gchar *uri, gchar **err) { GFile *gio_uri; GFileInputStream *stream; gboolean result; GFileInfo *info; gsize nchars; gint dos_filter, editor_mode; gchar *file_content = NULL; gchar *buffer = NULL; guint64 size; scintilla_send_message (SCINTILLA (te->scintilla), SCI_CLEARALL, ...
false
false
false
false
false
0
gftp_config_file_write_intcombo (gftp_config_vars * cv, char *buf, size_t buflen, int to_config_file) { char **clist; clist = cv->listdata; if (clist != NULL) g_snprintf (buf, buflen, "%s", clist[GPOINTER_TO_INT(cv->value)]); else g_snprintf (buf, buflen, _("<unknown>")...
false
false
false
false
false
0
jvp_dtoa_context_free(struct dtoa_context* C) { int k; while (C->p5s) { Bigint* p5 = C->p5s; C->p5s = p5->next; Bfree(C, p5); } for (k=0; k<(int)(sizeof(C->freelist)/sizeof(C->freelist[0])); k++) { while (C->freelist[k]) { Bigint* v = C->freelist[k]; C->freelist[k] = v->next; F...
false
false
false
false
false
0
copyRow(row_type row) { addRow(row); for (col_type col = 0; col < ncols(); ++col) cells_[(row + 1) * ncols() + col] = cells_[row * ncols() + col]; }
false
false
false
false
false
0
sd_init_controls(struct gspca_dev *gspca_dev) { struct sd *sd = (struct sd *) gspca_dev; struct v4l2_ctrl_handler *hdl = &gspca_dev->ctrl_handler; gspca_dev->vdev.ctrl_handler = hdl; v4l2_ctrl_handler_init(hdl, 4); gspca_dev->exposure = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, /* Mostly limited by URB timeouts */ ...
false
false
false
false
false
0
gth_backtrace_path_append(GthBacktracePath *out_bp, const GthBacktracePath *in_bp) { gt_assert(out_bp && in_bp); gt_assert(!backtrace_path_end_cutoffs_are_set(out_bp)); gt_assert(!backtrace_path_cutoffs_are_set(in_bp)); gt_assert(out_bp->gen_dp_start+out_bp->gen_dp_length == in_bp...
false
false
false
false
false
0
add_action(ActionNode* actionNode, int immediateProcess) { //----------- reset some vars -----------// actionNode->add_date = info.game_date; actionNode->action_id = ++last_action_id; actionNode->retry_count = STD_ACTION_RETRY_COUNT; actionNode->processing_instance_count = 0; actionNode->processed_instance...
false
false
false
false
false
0
preorder_string(num *t) { list<st_el*> l; l.push_back(new st_el(t, t->to_string())); return l; }
false
false
false
false
false
0
GLEInitShapeFillColor(GLEPropertyStore* prop) { GLERC<GLEColor> gcolor(g_get_fill()); prop->setColorProperty(GLEDOPropertyFillColor, gcolor->clone()); }
false
false
false
false
false
0
GDinqdims(int32 gridID, char *dimnames, int32 dims[]) { intn status; /* routine return status variable */ int32 fid; /* HDF-EOS file ID */ int32 sdInterfaceID; /* HDF SDS interface ID */ int32 gdVgrpID; /* Grid root Vgroup ID */ int32 size; /* Dime...
false
false
false
false
false
0
VSM_Init(void) { uint32_t *vsl_log_start; pthread_t tp; AZ(pthread_mutex_init(&vsl_mtx, NULL)); AZ(pthread_mutex_init(&vsm_mtx, NULL)); vsl_log_start = VSM_Alloc(cache_param->vsl_space, VSL_CLASS, "", ""); AN(vsl_log_start); vsl_log_start[1] = VSL_ENDMARKER; VWMB(); do *vsl_log_start = random() & 0xffff; ...
false
false
false
true
false
1
onMotion(FXObject*,FXSelector,void* ptr){ register FXEvent *event=(FXEvent*)ptr; register FXint p; if(!isEnabled()) return 0; if(flags&FLAG_PRESSED){ p=calcValue(event->win_x,event->win_y); if(pos!=p){ setValue(p); flags|=FLAG_CHANGED; if(target) target->tryHandle(this,FXSEL(SEL_CHANGE...
false
false
false
false
false
0
_AuRead (AuServer *aud, char *data, AuInt32 size) { AuInt32 bytes_read; if ((aud->flags & AuServerFlagsIOError) || size == 0) return; errno = 0; while ((bytes_read = ReadFromServer(aud->fd, data, (int)size)) != size) { if (bytes_read > 0) { size -= bytes_read; data += bytes_re...
false
false
false
false
false
0
wrapType(PyTypeObject *type, const jobject& obj) { static PyObject *wrapfn_ = PyString_FromString("wrapfn_"); PyObject *cobj = PyObject_GetAttr((PyObject *) type, wrapfn_); PyObject *(*wrapfn)(const jobject&); if (cobj == NULL) return NULL; wrapfn = (PyObject *(*)(const jobject &)) PyC...
false
false
false
false
false
0
Perl_sv_does_sv(pTHX_ SV *sv, SV *namesv, U32 flags) { SV *classname; bool does_it; SV *methodname; dSP; PERL_ARGS_ASSERT_SV_DOES_SV; PERL_UNUSED_ARG(flags); ENTER; SAVETMPS; SvGETMAGIC(sv); if (!SvOK(sv) || !(SvROK(sv) || (SvPOK(sv) && SvCUR(sv)))) { LEAVE; return FALSE; ...
false
false
false
false
false
0
init_logger(void) { /* auto rotate if sig SIGXFSZ comes a-knockin */ sigaction(SIGXFSZ, &handle_SIGXFSZ, NULL); /* Re-initialize the logmsgs mutex. The recursive mutex can be accessed prior * to Asterisk being forked into the background, which can cause the thread * ID tracked by the underlying pthread mutex...
false
false
false
false
false
0
XLS(const uint8_t isDirect, uint8_t message[], const uint32_t s, uint8_t* tweak, const uint8_t* key, const uint32_t l, uint8_t* cipher) { uint8_t M1[16]; uint8_t M2[16]; uint8_t X1[16]; uint8_t X1ns[16]; uint8_t X1s[16]; uint8_t Xp1ns[16]; uint8_t...
false
true
false
false
false
1
crypto_pcbc_encrypt_inplace(struct blkcipher_desc *desc, struct blkcipher_walk *walk, struct crypto_cipher *tfm) { void (*fn)(struct crypto_tfm *, u8 *, const u8 *) = crypto_cipher_alg(tfm)->cia_encrypt; int bsize = crypto_cipher_blocksize(tfm); unsigned int nbytes = walk->nbytes; u8 *src = ...
false
false
false
false
false
0
copy_n_bytes_from_file_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Read read_cb, FLAC__IOHandle temp_handle, FLAC__IOCallback_Write temp_write_cb, FLAC__off_t bytes, FLAC__Metadata_SimpleIteratorStatus *status) { FLAC__byte buffer[8192]; size_t n; FLAC__ASSERT(bytes >= 0); while(bytes > 0) { n = flac_min(sizeof(...
false
false
false
false
false
0
gva_nplayers_init (GError **error) { gboolean success = FALSE; #ifdef NPLAYERS_FILE gchar *contents, *cp; gsize length; #endif keyfile = g_key_file_new (); #ifdef NPLAYERS_FILE if (!g_file_get_contents (NPLAYERS_FILE, &contents, &length, error)) return FALSE; ...
false
false
false
false
false
0
emitInitialization() { std::string InstrProfileOutput = Options.InstrProfileOutput; Constant *RegisterF = M->getFunction(getInstrProfRegFuncsName()); if (!RegisterF && InstrProfileOutput.empty()) return; // Create the initialization function. auto *VoidTy = Type::getVoidTy(M->getContext()); auto *F = Func...
false
false
false
false
false
0
_gck_module_info_from_pkcs11 (CK_INFO_PTR info) { GckModuleInfo *modinfo; modinfo = g_new0 (GckModuleInfo, 1); modinfo->flags = info->flags; modinfo->library_description = gck_string_from_chars (info->libraryDescription, sizeof (info->libraryDescription)); m...
false
false
false
false
false
0
searchsmallestgeq(const GtPairBwtidx *left, const GtPairBwtidx *right, unsigned long key) { const GtPairBwtidx *leftptr, *midptr, *rightptr, *found = NULL; unsigned long len; gt_assert(left != NULL); gt_assert(right != NULL); leftptr = left; r...
false
false
false
false
false
0
qh_freeqhull (boolT allmem) { facetT *facet; vertexT *vertex; ridgeT *ridge, **ridgep; mergeT *merge, **mergep; trace1((qh ferr, "qh_freeqhull: free global memory\n")); qh NOerrexit= True; /* no more setjmp */ if (allmem) { qh_clearcenters (qh_none); while ((vertex= qh vertex_list)) { if (...
false
false
false
false
false
0
parse_theme_file (EyesApplet *eyes_applet, FILE *theme_file) { gchar line_buf [512]; /* prolly overkill */ gchar *token; fgets (line_buf, 512, theme_file); while (!feof (theme_file)) { token = strtok (line_buf, "="); if (strncmp (token, "wall-thickness", ...
false
false
false
false
false
0
cancel_on_dsm_detach(dsm_segment *seg, on_dsm_detach_callback function, Datum arg) { slist_mutable_iter iter; slist_foreach_modify(iter, &seg->on_detach) { dsm_segment_detach_callback *cb; cb = slist_container(dsm_segment_detach_callback, node, iter.cur); if (cb->function == function && cb->arg == arg)...
false
false
false
false
false
0
cm_store_ca_save(struct cm_store_ca *ca) { FILE *fp; char timestamp[15], path[PATH_MAX]; int i, fd = -1, give_up; const char *directory, *dest; if (ca->cm_store_private == NULL) { cm_store_timestamp_from_time(cm_time(NULL), timestamp); directory = cm_env_ca_dir(); if (directory != NULL) { snprintf(path, ...
false
false
false
false
false
0
replaceZero(Instruction *i) { for (int s = 0; i->srcExists(s); ++s) { if (s == 2 && i->op == OP_SUCLAMP) continue; ImmediateValue *imm = i->getSrc(s)->asImm(); if (imm && imm->reg.data.u64 == 0) i->setSrc(s, rZero); } }
false
false
false
false
false
0
SetNodePosition(uint32 id, uint32 point, float x, float y, float z) { WorldDatabase.PExecuteLog("UPDATE creature_movement SET position_x=%f, position_y=%f, position_z=%f WHERE id=%u AND point=%u", x, y, z, id, point); WaypointPathMap::iterator itr = m_pathMap.find(id); if (itr == m_pathMap.end()) { ...
false
false
false
false
false
0
hfi1_free_lkey(struct hfi1_mregion *mr) { unsigned long flags; u32 lkey = mr->lkey; u32 r; struct hfi1_ibdev *dev = to_idev(mr->pd->device); struct hfi1_lkey_table *rkt = &dev->lk_table; int freed = 0; spin_lock_irqsave(&rkt->lock, flags); if (!mr->lkey_published) goto out; if (lkey == 0) RCU_INIT_POINTER...
false
false
false
false
false
0
fm_set_busy_cursor(GtkWidget* widget) { if(gtk_widget_get_realized(widget)) { GdkWindow* window = gtk_widget_get_window(widget); GdkCursor* cursor = gdk_cursor_new(GDK_WATCH); gdk_window_set_cursor(window, cursor); } else { /* FIXME: how to handle this case? */ ...
false
false
false
false
false
0
vector_used_by_percpu_irq(unsigned int vector) { int cpu; for_each_online_cpu(cpu) { if (!IS_ERR_OR_NULL(per_cpu(vector_irq, cpu)[vector])) return 1; } return 0; }
false
false
false
false
false
0
gyrus_admin_mailbox_new (GyrusAdmin *admin, const gchar *mailbox, const gchar *path, gint quota, gchar **error) { GyrusImapStatus status; gchar *new_mailbox; gchar *msg; if (!gyrus_admin_mailbox_name_is_valid (admin, mailbox)) { *error = g_strdup_printf (_("'%s' is not a valid " "mailbox name. Pleas...
false
false
false
false
false
0
wa_add_delayed_rpipe(struct wahc *wa, struct wa_rpipe *rpipe) { unsigned long flags; spin_lock_irqsave(&wa->rpipe_lock, flags); /* add rpipe to the list if it is not already on it. */ if (list_empty(&rpipe->list_node)) { pr_debug("%s: adding RPIPE %d to the delayed list.\n", __func__, le16_to_cpu(rpipe->descr...
false
false
false
false
false
0
ffwopen(char *fn, int readonly) { extern FIOINFO g_pico_fio; #ifndef _WINDOWS int fd; EML eml; #endif #ifndef MODE_READONLY #define MODE_READONLY (0600) #endif /* * Call open() by hand since we don't want O_TRUNC -- it'll * screw over-quota users. The strategy is to overwrite the ...
false
false
false
false
false
0
server_resolve_entry (call_frame_t *frame) { server_state_t *state = NULL; int ret = 0; loc_t *loc = NULL; state = CALL_STATE (frame); loc = state->loc_now; ret = resolve_entry_simple (frame); if (ret > 0) { loc...
false
false
false
false
false
0
_e_smart_del(Evas_Object *obj) { Smart_Data *sd = evas_object_smart_data_get(obj); if (sd->idle_enter) ecore_idle_enterer_del(sd->idle_enter); free(sd); evas_object_smart_data_set(obj, NULL); }
false
false
false
false
false
0
shadow_draw_glyph(FT_Bitmap *bitmap, int sx, int sy) { unsigned char *src,*dst; unsigned int bit; int x,y; src = bitmap->buffer; for (y = 0; y < bitmap->rows; y++, src += bitmap->pitch) { if (sy+y < 0) continue; if (sy+y >= sheight) continue; sdirty[sy+y]++; dst = shadow[sy+y] + sx*3;...
false
false
false
false
false
0
nilfs_rename(struct inode *old_dir, struct dentry *old_dentry, struct inode *new_dir, struct dentry *new_dentry) { struct inode *old_inode = d_inode(old_dentry); struct inode *new_inode = d_inode(new_dentry); struct page *dir_page = NULL; struct nilfs_dir_entry *dir_de = NULL; struct page *old_page; struct nil...
false
false
false
false
false
0
device_status(snd_use_case_mgr_t *uc_mgr, const char *device_name) { struct use_case_device *dev; struct list_head *pos; list_for_each(pos, &uc_mgr->active_devices) { dev = list_entry(pos, struct use_case_device, active_list); if (strcmp(dev->n...
false
false
false
false
false
0
p7_oprofile_CreateBlock(int count) { int i = 0; P7_OM_BLOCK *block = NULL; int status = eslOK; ESL_ALLOC(block, sizeof(*block)); block->count = 0; block->listSize = 0; block->list = NULL; ESL_ALLOC(block->list, sizeof(P7_OPROFILE *) * count); block->listSize = count; for (i = 0; i < count; ++i...
false
true
false
false
false
1
intersect(const SbXfBox3f & xfbb) const { const SbBox3f & bbr = xfbb; SbBox3f bb(bbr); SbXfBox3f me(*this); me.transform(xfbb.getInverse()); return me.intersect(bb); }
false
false
false
false
false
0
makedir (newdir) const char *newdir; { char *buffer ; char *p; int len = (int)strlen(newdir); if (len <= 0) return 0; buffer = (char*)gf_malloc(len+1); strcpy(buffer,newdir); if (buffer[len-1] == '/') { buffer[len-1] = '\0'; } if (mymkdir(buffer) == 0) { gf_free(buffer); ...
true
true
false
false
true
1
CreateGCRelocates(ArrayRef<Value *> LiveVariables, const int LiveStart, ArrayRef<Value *> BasePtrs, Instruction *StatepointToken, IRBuilder<> Builder) { if (LiveVariables.empty()) return; aut...
false
false
false
false
false
0
convert_row( DCELL *raster, unsigned char *in_buf, int ncols, int is_fp, int is_signed, int bytes, int swap_flag, double null_val) { unsigned char *ptr = in_buf; int i; for (i = 0; i < ncols; i++) { DCELL x; convert_cell(&x, ptr, is_fp, is_signed, bytes, swap_flag); if (x == null_val) G...
false
false
false
false
false
0
getType()const { if (selection>=possibleTypes.size()) THROW_EXCEPTION("current selection index is out of bounds!"); return possibleTypes[selection]; }
false
false
false
false
false
0
jbg_dppriv2int(char *internal, const unsigned char *dptable) { int i, j, k; int trans0[ 8] = { 1, 0, 3, 2, 7, 6, 5, 4 }; int trans1[ 9] = { 1, 0, 3, 2, 8, 7, 6, 5, 4 }; int trans2[11] = { 1, 0, 3, 2, 10, 9, 8, 7, 6, 5, 4 }; int trans3[12] = { 1, 0, 3, 2, 11, 10, 9, 8, 7, 6, 5, 4 }; #define FILL_TABLE2(offs...
false
false
false
false
false
0
styleRowChanged(void) { GtkTreeSelection* selection; GtkTreeModel* model; GtkTreeIter iter; gint rowNumber; GtkTreePath* path; selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(m_styleList)); if ( gtk_tree_selection_get_selected (selection, &model, &iter) ) { path = gtk_tree_model_get_path(model, &iter);...
false
false
false
false
false
0
HtmlStyleCounter(pTree, zName) HtmlTree *pTree; const char *zName; { int ii; StyleApply *p = (StyleApply *)(pTree->pStyleApply); for (ii = p->nCounter - 1; ii >= 0; ii--) { if (0 == strcmp(zName, p->apCounter[ii]->zName)) { return p->apCounter[ii]->iValue; } } r...
false
false
false
false
false
0
Fd_Add_List_Dependency(WamWord *array, int chain_nb, WamWord *CF) { int n = *array++; while (n--) Fd_Add_Dependency((WamWord *) (*array++), chain_nb, CF); }
false
false
false
false
false
0
MPI_Gatherv_prolog(CONST void *sendbuf __attribute__((unused)), int sendcnt, MPI_Datatype sendtype, void *recvbuf __attribute__((unused)), CONST int *recvcnts __attribute__((unused)), CONST int *displs __attribute__((unused)), MPI_Datatype recvtype, ...
false
false
false
false
false
0
pt_sendto_cont(pt_Continuation *op, PRInt16 revents) { PRIntn bytes = sendto( op->arg1.osfd, op->arg2.buffer, op->arg3.amount, op->arg4.flags, (struct sockaddr*)op->arg5.addr, PR_NETADDR_SIZE(op->arg5.addr)); op->syserrno = errno; if (bytes >= 0) /* this is progress */ { char *b...
false
false
false
false
false
0
readdir_search_pagecache(nfs_readdir_descriptor_t *desc) { int res; if (desc->page_index == 0) { desc->current_index = 0; desc->last_cookie = 0; } do { res = find_cache_page(desc); } while (res == -EAGAIN); return res; }
false
false
false
false
false
0
init(const tstring& filename_, LOG4CPLUS_OPEN_MODE_TYPE mode) { this->filename = filename_; if (bufferSize != 0) { delete[] buffer; buffer = new tchar[bufferSize]; out.rdbuf ()->pubsetbuf (buffer, bufferSize); } open(mode); if(!out.good()) { ...
false
false
false
false
false
0
fop_truncate_cbk_stub (call_frame_t *frame, fop_truncate_cbk_t fn, int32_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { call_stub_t *stub = NULL; G...
false
false
false
false
false
0
mapchars(char** wlst, const char * word, int ns, int cpdsuggest) { char candidate[MAXSWUTF8L]; clock_t timelimit; int timer; candidate[0] = '\0'; int wl = strlen(word); if (wl < 2 || ! pAMgr) return ns; int nummap = pAMgr->get_nummap(); struct mapentry* maptable = pAMgr->get_maptable(); if (maptable...
false
false
false
false
false
0
git_config_parse_int64(int64_t *out, const char *value) { const char *num_end; int64_t num; if (git__strtol64(&num, value, &num_end, 0) < 0) goto fail_parse; switch (*num_end) { case 'g': case 'G': num *= 1024; /* fallthrough */ case 'm': case 'M': num *= 1024; /* fallthrough */ case 'k': case '...
false
false
false
false
false
0
_LUTeval16(register const cmsUInt16Number In[], register cmsUInt16Number Out[], register const void* D) { cmsPipeline* lut = (cmsPipeline*) D; cmsStage *mpe; cmsFloat32Number Storage[2][MAX_STAGE_CHANNELS]; int Phase = 0, NextPhase; From16ToFloat(In, &Storage[Phase][0], lut ->InputChannels)...
false
false
false
false
false
0
nifti_read_extensions( nifti_image *nim, znzFile fp, int remain ) { nifti1_extender extdr; /* defines extension existence */ nifti1_extension extn; /* single extension to process */ nifti1_extension * Elist; /* list of processed extensions */ int posn, count; if( !n...
false
false
false
false
false
0
encodings_check_regexes(const gchar *buffer, gsize size) { guint i; for (i = 0; i < G_N_ELEMENTS(pregs); i++) { gchar *charset; if ((charset = regex_match(pregs[i], buffer, size)) != NULL) return charset; } return NULL; }
false
false
false
false
false
0
solvePDE (fcts * param, int how) { long nsl = ((long) ns) * (2 * ((long) bdth) + 1); int factorize = 1; if (how > nhowmax) erreur ("Too many linear systems"); if (how < 0) { factorize = 0; how = -how; if (((how > nhow1) && (N == 1)) || ((how > nhow2) && (N =...
false
false
false
false
false
0
ajStrFromLong(AjPStr* Pstr, ajlong val) { AjBool ret = ajFalse; ajlong i; if(val) i = ajNumLengthUint(val) + 2; else i = 2; if(val < 0) i++; ret = ajStrSetResRound(Pstr, (size_t) i); ajFmtPrintS(Pstr, "%ld", (long)val); return ret; }
false
false
false
false
false
0
mock_object_dirty( const QofCollection *col ) { QofObject *obj = NULL; g_assert( col ); obj = object_dirty_struct.objects->data; object_dirty_struct.objects = object_dirty_struct.objects->next; g_assert( obj ); g_assert_cmpstr( qof_collection_get_type( col ), == , obj->e_type ); object_dirt...
false
false
false
false
false
0
WebPDecodeYUVInto(const uint8_t* data, size_t data_size, uint8_t* luma, size_t luma_size, int luma_stride, uint8_t* u, size_t u_size, int u_stride, uint8_t* v, size_t v_size, int v_stride) { WebPDecParams params; WebPDecBuffer output; ...
false
false
false
false
false
0
slapi_mods_insert_before(Slapi_Mods *smods, LDAPMod *mod) { if ((NULL == smods) || (NULL == mod)) { return; } slapi_mods_insert_at(smods, mod, smods->iterator); smods->iterator++; }
false
false
false
false
false
0
parse_fcall_arguments_20(StringInfo msgBuf, struct fp_info * fip, FunctionCallInfo fcinfo) { int nargs; int i; StringInfoData abuf; nargs = pq_getmsgint(msgBuf, 4); /* # of arguments */ if (fip->flinfo.fn_nargs != nargs || nargs > FUNC_MAX_ARGS) ereport(ERROR, (errcode(ERRCODE_PROTOCOL_VIOLATION...
false
false
false
false
false
0
eeprom_93cx6_write(struct eeprom_93cx6 *eeprom, u8 addr, u16 data) { int timeout = 100; u16 command; /* start the command */ eeprom_93cx6_startup(eeprom); command = PCI_EEPROM_WRITE_OPCODE << eeprom->width; command |= addr; /* send write command */ eeprom_93cx6_write_bits(eeprom, command, PCI_EEPROM_WIDT...
false
false
false
false
false
0
ibus_im_context_class_init (IBusIMContextClass *class) { IDEBUG ("%s", __FUNCTION__); GtkIMContextClass *im_context_class = GTK_IM_CONTEXT_CLASS (class); GObjectClass *gobject_class = G_OBJECT_CLASS (class); parent_class = (GtkIMContextClass *) g_type_class_peek_parent (class); im_context_class->...
false
false
false
false
false
0
on_listitem_button_press (GtkWidget * widget, GdkEvent * event, tListItem * parent) { if (!parent->selected) { playsound (SND_BUTTONDOWN); } return TRUE; }
false
false
false
false
false
0
sys_set_trip_temp(struct thermal_zone_device *tzd, int trip, int temp) { u32 l, h; struct phy_dev_entry *phy_dev_entry; u32 mask, shift, intr; int ret; phy_dev_entry = tzd->devdata; if (trip >= MAX_NUMBER_OF_TRIPS || temp >= phy_dev_entry->tj_max) return -EINVAL; ret = rdmsr_on_cpu(phy_dev_entry->fir...
false
false
false
false
false
0
apol_ipv4_addr_render_new(const apol_policy_t * policydb, uint32_t addr[4]) { char buf[40], *b; unsigned char *p = (unsigned char *)&(addr[0]); snprintf(buf, sizeof(buf), "%d.%d.%d.%d", p[0], p[1], p[2], p[3]); if ((b = strdup(buf)) == NULL) { ERR(policydb, "%s", strerror(ENOMEM)); } return b; }
false
false
false
false
false
0
limit_bad_template_recursion (tree decl) { struct tinst_level *lev = current_tinst_level; int errs = errorcount + sorrycount; if (lev == NULL || errs == 0 || !neglectable_inst_p (decl)) return false; for (; lev; lev = lev->next) if (neglectable_inst_p (lev->decl)) break; return (lev && errs > ...
false
false
false
false
false
0
dib0090_get_current_gain(struct dvb_frontend *fe, u16 * rf, u16 * bb, u16 * rf_gain_limit, u16 * rflt) { struct dib0090_state *state = fe->tuner_priv; if (rf) *rf = state->gain[0]; if (bb) *bb = state->gain[1]; if (rf_gain_limit) *rf_gain_limit = state->rf_gain_limit; if (rflt) *rflt = (state->rf_lt_def >>...
false
false
false
false
false
0