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
glmLinearTexture(GLMmodel* model, float h, float w) { GLMgroup *group; GLfloat dimensions[3]; GLfloat x, y, scalefactor; GLuint i; if (!(model))return; if (model->texcoords) free(model->texcoords); model->numtexcoords = model->numvertices; model->texcoords=(GLfloat*)malloc(sizeof(GLfloat)*2*(model...
false
true
false
false
true
1
rescale(int newsqside) { float factor; int i; factor=((float)newsqside)/((float)orig_sqside); for(i=0;i<376;i++) { vec[i].x = (int) ( ( (float) (srcpiece[i].x) ) * factor); vec[i].y = (int) ( ( (float) (srcpiece[i].y) ) * factor); } cur_sqside=newsqside; }
false
false
false
false
false
0
pickup_by_group(struct ast_channel *chan) { struct ast_channel *target;/*!< Potential pickup target */ int res = -1; /* The found channel is already locked. */ target = ast_pickup_find_by_group(chan); if (target) { ast_log(LOG_NOTICE, "pickup %s attempt by %s\n", ast_channel_name(target), ast_channel_name(chan)...
false
false
false
false
false
0
ibus_attr_underline_new (guint underline_type, guint start_index, guint end_index) { g_return_val_if_fail ( underline_type == IBUS_ATTR_UNDERLINE_NONE || underline_type == IBUS_ATTR_UNDERLINE_SINGLE || underline_type == IBUS_ATTR_UNDERLINE_...
false
false
false
false
false
0
checkListReplaceCurrent() { // go back to misspelled word wlIt--; QString s = *wlIt; s.replace(posinline+offset,orig.length(),replacement()); offset += replacement().length()-orig.length(); wordlist->insert (wlIt, s); wlIt = wordlist->erase (wlIt); // wlIt now points to the word after the repalced one...
false
false
false
false
false
0
ndmca_tape_read_partial (struct ndm_session *sess, char *buf, unsigned count, int *read_count) { struct ndmconn * conn = sess->plumb.tape; int rc; NDMC_WITH(ndmp9_tape_read, NDMP9VER) request->count = count; rc = NDMC_CALL(conn); if (rc == 0) { *read_count = reply->data_in.data_in_len; bcopy (reply->d...
false
true
false
false
false
1
update(const std::string&) { if (World::menu()) _sequence = 1; else if (_sequence == 1) _sequence = 2; }
false
false
false
false
false
0
getUncompressedFrame( DcmItem *dataset, Uint32 frameNo, Uint32& startFragment, void *buffer, Uint32 bufSize, OFString& decompressedColorModel, DcmFileCache *cache) { if ((dataset == NULL) || (buffer == NULL)) return EC_IllegalCall; Sint32 numberOfFrames = 1; dataset->findAndGetS...
false
false
false
false
false
0
soup_cookie_free (SoupCookie *cookie) { g_return_if_fail (cookie != NULL); g_free (cookie->name); g_free (cookie->value); g_free (cookie->domain); g_free (cookie->path); g_clear_pointer (&cookie->expires, soup_date_free); g_slice_free (SoupCookie, cookie); }
false
false
false
false
false
0
HSVtoRGB(HSV hsv) { RGB rgb; float h, f, p, q, t; int i; rgb.r = 0.0; rgb.g = 0.0; rgb.b = 0.0; if (hsv.s == 0.0) { rgb.r = rgb.g = rgb.b = hsv.v; return (rgb); } else { if (hsv.h == 360.0) { hsv.h = 0.0; } h = hsv.h / 60; ...
false
false
false
false
false
0
isc_sockaddr_fromnetaddr(isc_sockaddr_t *sockaddr, const isc_netaddr_t *na, in_port_t port) { memset(sockaddr, 0, sizeof(*sockaddr)); sockaddr->type.sin.sin_family = na->family; switch (na->family) { case AF_INET: sockaddr->length = sizeof(sockaddr->type.sin); #ifdef ISC_PLATFORM_HAVESALEN sockaddr->type....
false
true
false
false
false
1
ensMarkermaplocationTrace(const EnsPMarkermaplocation mml, ajuint level) { AjPStr indent = NULL; if (!mml) return ajFalse; indent = ajStrNew(); ajStrAppendCountK(&indent, ' ', level * 2); ajDebug("%SensMarkermaplocationTrace %p\n" "%S Markers...
false
false
false
false
false
0
sqlite_update_value(MetaDataType type,const char *key_a,const char *key_b, MetaDataContentType content_type, const char *content) { sqlite3_stmt *const stmt = meta_data_sqlite_stmt[META_DATA_SQL_UPDATE]; int ret; sqlite3_reset(stmt); ret = sqlite3_bind_int(stmt, 1, content_type); if (ret != SQLITE_OK) { g_log(M...
false
false
false
false
false
0
update_primary_region_config( CoreLayerContext *context, CoreLayerRegionConfig *config, CoreLayerRegionConfigFlags flags ) { DFBResult ret = DFB_OK; D_ASSERT( context != NULL ); D_ASSERT( config != NULL ); if (context->pri...
false
false
false
false
false
0
setDragMovingEnabled(bool setting) { if (d_dragMovable != setting) { d_dragMovable = setting; getTitlebar()->setDraggingEnabled(setting); } }
false
false
false
false
false
0
bfa_ablk_pf_create(struct bfa_ablk_s *ablk, u16 *pcifn, u8 port, enum bfi_pcifn_class personality, u16 bw_min, u16 bw_max, bfa_ablk_cbfn_t cbfn, void *cbarg) { struct bfi_ablk_h2i_pf_req_s *m; if (!bfa_ioc_is_operational(ablk->ioc)) { bfa_trc(ablk->ioc, BFA_STATUS_IOC_FAILURE); return BFA_STATUS_IOC_FAILUR...
false
false
false
false
false
0
ng_attr_parse_int(struct ng_attribute *attr, char *str) { int value,n; if (0 == sscanf(str,"%d%n",&value,&n)) /* parse error */ return attr->defval; if (str[n] == '%') value = ng_attr_percent2int(attr,value); if (value < attr->min) value = attr->min; if (value > attr->max) value = attr->max; ...
false
false
false
false
false
0
init_base() { DBUG_ASSERT(inited == 0); inited= 1; /* Here we create file log handler. We don't do it for the table log handler here as it cannot be created so early. The reason is THD initialization, which depends on the system variables (parsed later). */ if (!file_log_handler) file_log_han...
false
false
false
false
false
0
atanhf(float x) { float t; int32_t hx,ix; GET_FLOAT_WORD(hx,x); ix = hx&0x7fffffff; if (ix>0x3f800000) /* |x|>1 */ return (x-x)/(x-x); if(ix==0x3f800000) return x/zero; if(ix<0x31800000&&(huge+x)>zero) return x; /* x<2**-28 */ SET_FLOAT_WORD(x,ix); if(ix<0x3f000000) { /* x < 0.5 */ t = x+x; ...
false
false
false
false
false
0
fso_framework_abstract_command_queue_enqueueCommand (FsoFrameworkAbstractCommandQueue* self, FsoFrameworkAbstractCommandHandler* command) { GeeLinkedList* _tmp0_ = NULL; FsoFrameworkAbstractCommandHandler* _tmp1_ = NULL; g_return_if_fail (self != NULL); g_return_if_fail (command != NULL); _tmp0_ = self->priv->q; ...
false
false
false
false
false
0
proctrack_p_plugin_get_pids(uint64_t cont_id, pid_t **pids, int *npids) { DIR *dir; struct dirent *de; char path[PATH_MAX], *endptr, *num, rbuf[1024]; char cmd[1024]; char state; int fd, rc = SLURM_SUCCESS; long pid, ppid, pgid, ret_l; pid_t *pid_array = NULL; int pid_count = 0; if ((dir = opendir("/proc")) ...
false
false
false
false
false
0
AppendFlags(std::string& flags, const char* newFlags) { if(this->WatcomWMake && newFlags && *newFlags) { std::string newf = newFlags; if(newf.find("\\\"") != newf.npos) { cmSystemTools::ReplaceString(newf, "\\\"", "\""); this->cmLocalGenera...
false
false
false
false
false
0
proc_lookupfd_common(struct inode *dir, struct dentry *dentry, instantiate_t instantiate) { struct task_struct *task = get_proc_task(dir); int result = -ENOENT; unsigned fd = name_to_int(&dentry->d_name); if (!task) goto out_no_task; if (fd == ~0U) goto out; result = instantiate(dir, dentry,...
false
false
false
false
false
0
__glXBindTexImageEXT(Display * dpy, GLXDrawable drawable, int buffer, const int *attrib_list) { struct glx_context *gc = __glXGetCurrentContext(); if (gc == NULL || gc->vtable->bind_tex_image == NULL) return; gc->vtable->bind_tex_image(dpy, drawable, buffer, attrib_list); }
false
false
false
false
false
0
dewarpaDestroy(L_DEWARPA **pdewa) { l_int32 i; L_DEWARP *dew; L_DEWARPA *dewa; PROCNAME("dewarpaDestroy"); if (pdewa == NULL) { L_WARNING("ptr address is null!\n", procName); return; } if ((dewa = *pdewa) == NULL) return; for (i = 0; i < dewa->nalloc; i++) { ...
false
false
false
false
false
0
create_stack( u_64 thispid, unsigned int thiscpu, u_64 stack_start_time ) { struct stack_item *stack; fprintf(stdbug, "create_stack for pid %"PRId64", cpu %u, rel time %"PRIu64"\n", thispid, thiscpu, stack_start_time); MALLOC(stack,"stack for pid %"PRId64"", thispid); stack->pid = thispid; stack->cpu = thisc...
false
false
false
false
false
0
ctlr_erase(Boolean alt) { int newROWS, newCOLS; kybd_inhibit(False); ctlr_clear(True); /* Let a script go. */ sms_host_output(); if (alt) { newROWS = altROWS; newCOLS = altCOLS; } else { newROWS = defROWS; newCOLS = defCOLS; } if (alt == screen_alt && ROWS == newROWS && COLS == newCOLS...
false
false
false
false
false
0
notifyCloudObservers( const QVariantMap &cloudMap ) const { foreach( InfoObserver *observer, m_cloudObservers ) observer->infoChanged( cloudMap ); }
false
false
false
false
false
0
execute(CMD_Args *args, CMD_Context context) { DBG(0, form("KCemu/CMD/warning", "*** Warning: CMD without execute() function called!\n" "*** command is: '%s' [%p]\n" "*** context is: %d [0x%08x]\n", get_name(), this, context, context)); }
false
false
false
false
false
0
__clear_close_on_exec(int fd, struct fdtable *fdt) { if (test_bit(fd, fdt->close_on_exec)) __clear_bit(fd, fdt->close_on_exec); }
false
false
false
false
false
0
doinit() { HardProcessConstructor::doinit(); if(processOption_==2&&outgoing_.size()!=2) throw InitException() << "Exclusive processes require exactly" << " two outgoing particles but " << outgoing_.size() << "have been inserted in ResonantProcessConstructor::doinit()." << Exception::run...
false
false
false
false
false
0
sizeHint() const { return fontMetrics().size(0, d->m_Text); }
false
false
false
false
false
0
scsi_ioctl_pathinfo (struct path * pp, int mask) { if (mask & DI_SERIAL) { get_serial(pp->serial, SERIAL_SIZE, pp->fd); condlog(3, "%s: serial = %s", pp->dev, pp->serial); } return 0; }
false
false
false
false
false
0
handleUnencodable(Char c, OutputByteStream *) { EncodeOutputCharStream tem(byteStream_, encoder_); if (escaper_) (*escaper_)(tem, c); }
false
false
false
false
false
0
am335x_phy_suspend(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct am335x_phy *am_phy = platform_get_drvdata(pdev); /* * Enable phy wakeup only if dev->power.can_wakeup is true. * Make sure to enable wakeup to support remote wakeup in * standby mode ( same is not supported...
false
false
false
false
false
0
displayVersionInfo( ) { char cmd[20]; char rcv_status0,rcv_status1; char rcv_data[2000]; size_t toWrite; int rcv_dataLength; if (!checkCOMisOpen()) return false; printf_debug("[CHokuyoURG::displayVersionInfo] Asking info..."); // Send command: os::sprintf(cmd,20, "VV\x0A"); toWrite = 3; m_stre...
false
false
false
false
false
0
do_cram_md5 (int sock, const char *command, struct query *ctl, const char *strip) /* authenticate as per RFC2195 */ { int result; int len; char buf1[1024]; char msg_id[768]; unsigned char response[16]; char reply[1024]; char *respdata; gen_send (sock, "%s CRAM-MD5", command); /* Fr...
false
false
false
false
false
0
amdlibGetOiTargetFromRawData(amdlibRAW_DATA *rawData, amdlibOI_TARGET *target) { int i; int cIndex = 0; char targVal[amdlibKEYW_VAL_LEN]; amdlibLogTrace("amdlibFillOiTargetTableEntry()"); target->element[cIndex].targetId = 1; /* Retrieve from Co...
false
false
false
false
false
0
debug(bool calledFromBreakpoint, int line, int fileNumber) { saveInfo(); #ifdef HAVE_GLK glk_set_style(style_Preformatted); #endif if (calledFromBreakpoint) displaySourceLocation(line, fileNumber); while (TRUE) { char commandLine[200]; readCommand(commandLine); char *...
false
false
false
false
false
0
csio_hw_intr_enable(struct csio_hw *hw) { uint16_t vec = (uint16_t)csio_get_mb_intr_idx(csio_hw_to_mbm(hw)); uint32_t pf = SOURCEPF_G(csio_rd_reg32(hw, PL_WHOAMI_A)); uint32_t pl = csio_rd_reg32(hw, PL_INT_ENABLE_A); /* * Set aivec for MSI/MSIX. PCIE_PF_CFG.INTXType is set up * by FW, so do nothing for INTX. ...
false
false
false
false
false
0
hmm_delete_data(hmm_data_t *hd) { int i; if (hd == 0) return; for (i = 0; i <= hd->L; ++i) { if (hd->f) free(hd->f[i]); if (hd->b) free(hd->b[i]); } free(hd->f); free(hd->b); free(hd->s); free(hd->v); free(hd->p); free(hd->seq); free(hd); }
false
false
false
false
false
0
init(jk_worker_t *pThis, jk_map_t *props, jk_worker_env_t *we, jk_logger_t *l) { ajp_worker_t *aw; ajp_endpoint_t *ae; jk_endpoint_t *je; int rc; JK_TRACE_EXIT(l); if (ajp_init(pThis, props, we, l, AJP14_PROTO) == JK_FALSE) { JK_TRACE...
false
false
false
false
false
0
decompress420NoMMXOV518(unsigned char *pIn, unsigned char *pOut, unsigned char *pTmp, const int w, const int h, const int numpix, struct comp_info *cinfo, int yvu) { unsigned char *pOutU, *pOutV; int iOutY, iOutU, iOutV, x, y; int lastYDC = 0; int lastUDC = 0; int lastVDC = 0; if (yvu) { pO...
false
false
false
false
false
0
spl_fixedarray_it_rewind(zend_object_iterator *iter TSRMLS_DC) /* {{{ */ { spl_fixedarray_it *iterator = (spl_fixedarray_it *)iter; spl_fixedarray_object *intern = iterator->object; if (intern->flags & SPL_FIXEDARRAY_OVERLOADED_REWIND) { zend_user_it_rewind(iter TSRMLS_CC); } else { iterator->object->cur...
false
false
false
false
false
0
gretl_model_set_full_vcv_info (MODEL *pmod, int vmaj, int vmin, int order, int flags, double bw) { VCVInfo *vi; int prev = 0; int err = 0; vi = gretl_model_get_data(pmod, "vcv_info"); if (vi == NULL) { vi = vcv_info_new(); if (vi == NULL) { return E_ALLOC; } } else { prev =...
false
false
false
false
false
0
get_expr_register() { char_u *new_line; new_line = getcmdline('=', 0L, 0); if (new_line == NULL) return NUL; if (*new_line == NUL) /* use previous line */ vim_free(new_line); else set_expr_line(new_line); return '='; }
false
false
false
false
false
0
null_put_params(gx_device * dev, gs_param_list * plist) { /* * If this is not a page device, we must defeat attempts to reset * the size; otherwise this is equivalent to gx_forward_put_params. */ int code = gx_forward_put_params(dev, plist); if (code < 0 || dev_proc(dev, get_page_device)(dev...
false
false
false
false
false
0
marshalReturnedValues(cdrStream& s) { pd_result.NP_marshalDataOnly(s); for( CORBA::ULong j = 0; j < pd_params->count(); j++ ){ CORBA::NamedValue_ptr arg = pd_params->item(j); if( arg->flags() & CORBA::ARG_OUT ) arg->value()->NP_marshalDataOnly(s); } }
false
false
false
false
false
0
ClientTeam (edict_t * ent) { char *p; static char value[128]; value[0] = 0; if (!ent->client) return value; Q_strncpyz(value, Info_ValueForKey (ent->client->pers.userinfo, "skin"), sizeof(value)); p = strchr (value, '/'); if (!p) return value; if ((int) (dmflags->value) & DF_MODELTEAMS) { *p = 0; r...
false
false
false
false
false
0
crash_reset_signals(void) { unsigned i; /* * The signal mask is preserved across execve(), therefore it is * important to also unblock all the signals we trap in case we * are about to re-exec() ourselves from a signal handler! */ for (i = 0; i < G_N_ELEMENTS(signals); i++) { signal_set(signals[i], SIG_D...
false
false
false
false
false
0
Comb(const BitField &bf) { size_t i; if( !_isempty_sp(bf) && !_isfull() ){ if( _isfull_sp(bf) ){ SetAll(); }else if( _isempty() ){ memcpy(b, bf.b, nbytes); nset = bf.nset; }else{ for(i = 0; i < nbytes; i++) b[i] |= bf.b[i]; _recalc(); } } }
false
false
false
false
false
0
list_backups(ext2_filsys fs, unsigned int *three, unsigned int *five, unsigned int *seven) { unsigned int *min = three; int mult = 3; unsigned int ret; if (!(fs->super->s_feature_ro_compat & EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER)) { ret = *min; *min += 1; return ret; } if (*five < *min) { min ...
false
false
false
false
false
0
glf3_header_write(glfFile fp, const glf3_header_t *h) { int32_t x; bgzf_write(fp, "GLF\3", 4); x = glf3_is_BE? bam_swap_endian_4(h->l_text) : h->l_text; bgzf_write(fp, &x, 4); if (h->l_text) bgzf_write(fp, h->text, h->l_text); }
false
false
false
false
false
0
make_pass_instance (struct opt_pass *pass, bool track_duplicates) { /* A nonzero static_pass_number indicates that the pass is already in the list. */ if (pass->static_pass_number) { struct opt_pass *new_pass; if (pass->type == GIMPLE_PASS || pass->type == RTL_PASS || pass...
false
false
false
false
false
0
lookup(Table *table, Sym *sym) { unsigned key; Entry *entry; key = symToStamp(sym); while (table != NULL) { entry = lookupBintree(table->bintree, key); if (entry != NULL) { return entry; } table = table->upperLevel; } return NULL; }
false
false
false
false
false
0
initializefixed(struct filter *f, struct initdata *i) { struct fixeddata *s = (struct fixeddata *) f->data; struct palette *palette; int r, g; inhermisc(f, i); if (i->image->palette->type == FIXEDCOLOR && !(f->req.supportedmask & FIXEDCOLOR)) { int red, green, blue; i->image->palette->alloccolor ...
false
false
false
false
false
0
omega_query_variable (omega_pb pb, int i, int *lower_bound, int *upper_bound) { int n_vars = pb->num_vars; int e, j; bool is_simple; bool coupled = false; *lower_bound = neg_infinity; *upper_bound = pos_infinity; i = pb->forwarding_address[i]; if (i < 0) { i = -i - 1; for (j = 1; j <=...
false
false
false
false
false
0
ecore_con_event_client_write(Ecore_Con_Client *cl, int num) { Ecore_Con_Event_Client_Write *e; e = ecore_con_event_client_write_alloc(); EINA_SAFETY_ON_NULL_RETURN(e); cl->event_count = eina_list_append(cl->event_count, e); cl->host_server->event_count = eina_list_append(cl->host_server->event_count, e...
false
false
false
false
false
0
lowestEndPoint(const IntervalInfo &I1, const IntervalInfo &I2) { SlotIndex E1 = getEndPoint(I1); SlotIndex E2 = getEndPoint(I2); if (E1 < E2) return true; if (E1 > E2) return false; // If two intervals end at the same point, we need a way to break the tie ...
false
false
false
false
false
0
of_match_bus(struct device_node *np) { int i; for (i = 0; i < ARRAY_SIZE(of_busses); i++) if (!of_busses[i].match || of_busses[i].match(np)) return &of_busses[i]; BUG(); return NULL; }
false
false
false
false
false
0
StringToMultifield( void *theEnv, char *theString) { struct token theToken; struct multifield *theSegment; struct field *theFields; unsigned long numberOfFields = 0; struct expr *topAtom = NULL, *lastAtom = NULL, *theAtom; /*====================================================*/ /* Open the ...
false
false
false
false
false
0
ipw2100_reset_adapter(struct work_struct *work) { struct ipw2100_priv *priv = container_of(work, struct ipw2100_priv, reset_work.work); unsigned long flags; union iwreq_data wrqu = { .ap_addr = { .sa_family = ARPHRD_ETHER} }; int associated = priv->status & STATUS_ASSOCIATED; spin_lock_irqsave(&priv->...
false
false
false
false
false
0
gee_concurrent_set_sub_iterator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, GeeConcurrentSetRange* range) { GeeConcurrentSetSubIterator * self = NULL; GeeConcurrentSetRange* _tmp0_ = NULL; GeeConcurrentSetRange* _tmp1_ = NULL; GeeConcurrentSetRange* _tmp2_ =...
false
false
false
false
false
0
_gcry_pk_map_name (const char *string) { gcry_pk_spec_t *spec; if (!string) return 0; spec = spec_from_name (string); if (!spec) return 0; if (spec->flags.disabled) return 0; return spec->algo; }
false
false
false
false
false
0
ubi_debugfs_init(void) { if (!IS_ENABLED(CONFIG_DEBUG_FS)) return 0; dfs_rootdir = debugfs_create_dir("ubi", NULL); if (IS_ERR_OR_NULL(dfs_rootdir)) { int err = dfs_rootdir ? PTR_ERR(dfs_rootdir) : -ENODEV; pr_err("UBI error: cannot create \"ubi\" debugfs directory, error %d\n", err); return err; ...
false
false
false
false
false
0
findsubquery(QTNode *root, QTNode *ex, QTNode *subs, bool *isfind) { bool DidFind = false; root = dofindsubquery(root, ex, subs, &DidFind); if (!subs && DidFind) root = dropvoidsubtree(root); if (isfind) *isfind = DidFind; return root; }
false
false
false
false
false
0
ProcessTicks(unsigned dequeue_order) { while (true) { const TickSampleEventRecord* rec = reinterpret_cast<TickSampleEventRecord*>(ticks_buffer_.StartDequeue()); if (rec == NULL) return false; if (rec->order == dequeue_order) { generator_->RecordTickSample(rec->sample); ticks_buffer_.Fi...
false
false
false
false
false
0
sk_set(_STACK *st, int i, void *value) { if(!st || (i < 0) || (i >= st->num)) return NULL; return (st->data[i] = value); }
false
false
false
false
false
0
dht_fsync2 (xlator_t *this, call_frame_t *frame, int op_ret) { dht_local_t *local = NULL; xlator_t *subvol = NULL; uint64_t tmp_subvol = 0; int ret = -1; local = frame->local; ret = fd_ctx_get (local->fd, this, &tmp_subvol); if (!ret) ...
false
false
false
false
false
0
PyvtkVolumeProperty_GetScalarOpacityMTime_s2(PyObject *self, PyObject *args) { vtkPythonArgs ap(self, args, "GetScalarOpacityMTime"); vtkObjectBase *vp = ap.GetSelfPointer(self, args); vtkVolumeProperty *op = static_cast<vtkVolumeProperty *>(vp); PyObject *result = NULL; if (op && ap.CheckArgCount(0)) {...
false
false
false
false
false
0
oggpack_look(oggpack_buffer *b, int bits) { unsigned long ret; unsigned long m=mask[bits]; bits+=b->endbit; if (b->endbyte+4>=b->storage) { if (b->endbyte+(bits-1)/8>=b->storage) return -1; } ret=b->ptr[0]>>b->endbit; if (bits>8) { ret|=b->ptr[1]<<(8-b->endbit); if (bits>16) { ret|=b-...
false
false
false
false
false
0
ptr_from_index(Py_buffer *view, Py_ssize_t index) { char *ptr; Py_ssize_t nitems; /* items in the first dimension */ assert(view->shape); assert(view->strides); nitems = view->shape[0]; if (index < 0) { index += nitems; } if (index < 0 || index >= nitems) { PyErr_SetStr...
false
false
false
false
false
0
ResearchGraph( PG_Widget *parent, const PG_Rect& rect, ContainerBase* container ) : GraphWidget( parent, rect ), cont( container ) { setRange( cont->maxresearchpoints+1, returnResourcenUseForResearch( cont, cont->maxresearchpoints ).energy ); addCurve( 0x00ff00 ); recalc(); }
false
false
false
false
false
0
scif_fixup_aper_base(struct scif_dev *dev, struct scif_window *window) { int j; struct scif_hw_dev *sdev = dev->sdev; phys_addr_t apt_base = 0; /* * Add the aperture base if the DMA address is not card relative * since the DMA addresses need to be an offset into the bar */ if (!scifdev_self(dev) && window->...
false
false
false
false
false
0
dw_mci_pull_part_bytes(struct dw_mci *host, void *buf, int cnt) { cnt = min_t(int, cnt, host->part_buf_count); if (cnt) { memcpy(buf, (void *)&host->part_buf + host->part_buf_start, cnt); host->part_buf_count -= cnt; host->part_buf_start += cnt; } return cnt; }
false
false
false
false
false
0
dircopy( const KUrl & src, const KUrl & target, QWidget* window ) { KUrl::List srcList; srcList.append( src ); return NetAccess::dircopy( srcList, target, window ); }
false
false
false
false
false
0
send_file(socket_struct *ns, const char *file) { char buf[MAX_BUF]; FILE *fp; SockList sl; if (!strcmp(file,"motd")) snprintf(buf, sizeof(buf), "%s/%s", settings.confdir, settings.motd); else if (!strcmp(file,"rules")) snprintf(buf, sizeof(buf), "%s/%s", settings.confdir, settings.r...
false
false
false
false
false
0
git_odb_read_header(size_t *len_p, git_otype *type_p, git_odb *db, const git_oid *id) { unsigned int i; int error = GIT_ENOTFOUND; git_odb_object *object; assert(db && id); if ((object = git_cache_get(&db->cache, id)) != NULL) { *len_p = object->raw.len; *type_p = object->raw.type; git_odb_object_close(obj...
false
false
false
false
false
0
evhttp_handle_request(struct evhttp_request *req, void *arg) { struct evhttp *http = arg; struct evhttp_cb *cb = NULL; const char *hostname; if (req->uri == NULL) { evhttp_send_error(req, HTTP_BADREQUEST, "Bad Request"); return; } /* handle potential virtual hosts */ hostname = evhttp_find_header(req->inpu...
false
false
false
false
false
0
changeActivation(bool activate, QWidget * originator) { if (!activate) return; //DebugDialog::debug(QString("change activation %1 %2").arg(activate).arg(originator->metaObject()->className())); FritzingWindow * fritzingWindow = qobject_cast<FritzingWindow *>(originator); if (fritzingWindow == NULL) { fritzingWi...
false
false
false
false
false
0
gdl_dock_paned_dock (GdlDockObject *object, GdlDockObject *requestor, GdlDockPlacement position, GValue *other_data) { GtkPaned *paned; GtkWidget *child1, *child2; gboolean done = FALSE; gboolean hresize = FALSE; gbool...
false
false
false
false
false
0
write(ostream &os) const { if (m_col >= 0 && m_line > 0) { os << m_line << ":" << (m_col-1); } else if (m_line > 0) { os << "line " << m_line; } else if (m_col >= 0) { os << "column " << (m_col-1); } return os; }
false
false
false
false
false
0
AddNextElementInternal(const Element *e) { Element::ConstPointer p(e); this->m_Element.push_back(p); }
false
false
false
false
false
0
pack_yuv(TiffEncoderContext * s, uint8_t * dst, int lnum) { AVFrame *p = &s->picture; int i, j, k; int w = (s->width - 1) / s->subsampling[0] + 1; uint8_t *pu = &p->data[1][lnum / s->subsampling[1] * p->linesize[1]]; uint8_t *pv = &p->data[2][lnum / s->subsampling[1] * p->linesize[2]]; for (i = ...
false
false
false
false
false
0
update_lineno (const char *l, size_t len) { while (len-- > 0) if (*l++ == '\n') lexer_line.line++; }
false
false
false
false
false
0
main(int argc, char **argv) { MdbHandle *mdb; MdbTableDef *table; gchar name[256]; gchar *propColName; void *buf; int col_num; int found = 0; if (argc < 3) { fprintf(stderr,"Usage: %s <file> <object name> [<prop col>]\n", argv[0]); return 1; } if (argc < 4) propColName = "LvProp"; else propColNam...
false
false
false
false
false
0
isbinarystream(fz_buffer *buf) { int i; for (i = 0; i < buf->len; i++) if (isbinary(buf->data[i])) return 1; return 0; }
false
false
false
false
false
0
abiword_storage_terminate(librdf_storage* storage) { abiwordContext* c = abiwordContext::get( storage ); delete c; }
false
false
false
false
false
0
adjacent_another_plane(struct xy rc, int alt, bool imjet, const struct op_courses *opc) { for ( ; opc; opc = opc->next) { if (!opc->c || opc->c->at_exit) continue; struct xyz pos = opc->c->pos; if (pos_adjacent(pos, rc, alt)) { ...
false
false
false
false
false
0
read_8bit_data () { // these are sizes for the final image const unsigned int ncomp = grayscale ? 1 : 3; const unsigned int line_size = info_header.width * ncomp; const unsigned int image_size = info_header.height * line_size; // seek to the data stream.seekg( file_header.offset, std::ios::beg ...
false
false
false
false
false
0
addLemma(Theorem thm, CNF_Formula& cnf) { vector<Theorem> clauses; d_rules->learnedClauses(thm, clauses, true); DebugAssert(clauses.size() == 1, "expected single clause"); Lit l = translateExpr(clauses[0], cnf); cnf.newClause(); cnf.addLiteral(l); cnf.registerUnit(); // if(concreteLit(l) != clause...
false
false
false
false
false
0
usb_stor_bulk_transfer_buf(struct us_data *us, unsigned int pipe, void *buf, unsigned int length, unsigned int *act_len) { int result; usb_stor_dbg(us, "xfer %u bytes\n", length); /* fill and submit the URB */ usb_fill_bulk_urb(us->current_urb, us->pusb_dev, pipe, buf, length, usb_stor_blocking_completio...
false
false
false
false
false
0
w5300_probe(struct platform_device *pdev) { struct w5300_priv *priv; struct net_device *ndev; int err; ndev = alloc_etherdev(sizeof(*priv)); if (!ndev) return -ENOMEM; SET_NETDEV_DEV(ndev, &pdev->dev); platform_set_drvdata(pdev, ndev); priv = netdev_priv(ndev); priv->ndev = ndev; ndev->netdev_ops = &w5300...
false
false
false
false
false
0
gth_contact_sheet_theme_unref (GthContactSheetTheme *theme) { if (theme == NULL) return; theme->ref--; if (theme->ref > 0) return; _g_object_unref (theme->file); g_free (theme->display_name); g_free (theme->header_font_name); g_free (theme->footer_font_name); g_free (theme->caption_font_name); g_free (th...
false
false
false
false
false
0
Mat4AddDiagonal(chfac*sf, double *b,int n){ int i,*invp=sf->invp; double *diag=sf->diag; for (i=0; i<n; i++){ diag[invp[i]]+=b[i]; } return 0; }
false
false
false
false
false
0
next() { m_position++; if (m_position >= m_buffer.size()) { m_buffer.resize(8192); int size = m_device->read(m_buffer.data(), m_buffer.size()); if (size < 1) { throw tr("Unexpectedly reached end of file."); } m_buffer.resize(size); m_position = 0; QApplication::processEvents(); } return m_buffer.at...
false
false
false
false
false
0
prfscore(sint n, sint m) { sint ix; lint score; score = 0.0; for (ix = 0; ix <= max_aa; ix++) { score += (profile1[n][ix] * profile2[m][ix]); } score += (profile1[n][gap_pos1] * profile2[m][gap_pos1]); score += (profile1[n][gap_pos2] * profile2[m][gap_pos2]); return (score / 10); }
false
false
false
false
false
0
ATL_drefgemv ( const enum ATLAS_TRANS TRANS, const int M, const int N, const double ALPHA, const double * A, const int LDA, const double * X, const int INCX, const double ...
false
false
false
false
false
0
vtkJPEGWriteToMemoryEmpty(j_compress_ptr cinfo) { // Even if (cinfo->dest->free_in_buffer != 0) we still need to write on the // new array and not at (arraySize - nbFree) vtkJPEGWriter *self = vtkJPEGWriter::SafeDownCast( static_cast<vtkObject *>(cinfo->client_data)); if (self) { vtk...
false
false
false
false
false
0
interpret_date_string(const char *date_opt, time_t * const time_p) { FILE *date_child_fp; char date_resp[100]; const char magic[] = "seconds-into-epoch="; char date_command[100]; int retcode; /* our eventual return code */ int rc; /* local return code */ if (date_opt == NULL) { warnx(_("No --date option sp...
false
false
false
false
false
0