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
ntfs_flush_dcache_pages(struct page **pages, unsigned nr_pages) { BUG_ON(!nr_pages); /* * Warning: Do not do the decrement at the same time as the call to * flush_dcache_page() because it is a NULL macro on i386 and hence the * decrement never happens so the loop never terminates. */ do { --nr_pages; f...
false
false
false
false
false
0
Java_org_gdal_osr_osrJNI_GetWellKnownGeogCSAsWKT_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jstring jarg1, jobjectArray jarg2) { jint jresult = 0 ; char *arg1 = (char *) 0 ; char **arg2 = (char **) 0 ; char *argout2 = 0 ; OGRErr result; (void)jenv; (void)jcls; arg1 = 0; if (jarg1) { arg1 = (char *)j...
false
false
false
false
false
0
chain_new_from_iterable(PyTypeObject *type, PyObject *arg) { PyObject *source; source = PyObject_GetIter(arg); if (source == NULL) return NULL; return chain_new_internal(type, source); }
false
false
false
false
false
0
CopyTABFeatureBase(TABFeature *poDestFeature) { /*----------------------------------------------------------------- * Copy fields only if OGRFeatureDefn is the same *----------------------------------------------------------------*/ OGRFeatureDefn *poThisDefnRef = GetDefnRef(); if (poThisDefnRef ...
false
false
false
false
false
0
_PLfuse_setxattr (const char *file, const char *name, const char *buf, size_t buflen, int flags) { #endif int rv; FUSE_CONTEXT_PRE; DEBUGf("setxattr begin\n"); ENTER; SAVETMPS; PUSHMARK(SP); XPUSHs(sv_2mortal(newSVpv(file,0))); XPUSHs(sv_2mortal(newSVpv(name,0))); XPUSHs(sv_2mortal(newSVpvn(buf,buflen))); XPU...
false
false
false
false
false
0
AddMark(int line, int markerNum, int lines) { handleCurrent++; if (!markers.Length()) { // No existing markers so allocate one element per line markers.InsertValue(0, lines, 0); } if (line >= markers.Length()) { return -1; } if (!markers[line]) { // Need new structure to hold marker handle markers[line]...
false
false
false
false
false
0
multiplexer_setWakeupThreshold (Multiplexer* self, guint seconds, guint waitms, GError** error) { guint _tmp0_ = 0U; guint _tmp4_ = 0U; guint _tmp5_ = 0U; g_return_if_fail (self != NULL); _tmp0_ = seconds; if (_tmp0_ == ((guint) 0)) { _g_timer_destroy0 (self->priv->idle_wakeup_timer); self->priv->idle_wakeup_...
false
false
false
false
false
0
set_toolbar_hide(bool hide) { toolbar_hide = hide; if(toolbar_hide){ toolbar->hide(); menu_tool_box->hide(); } else{ toolbar->show(); menu_tool_box->show(); } Glib::RefPtr<Gtk::ToggleAction> menu = Glib::RefPtr<Gtk::ToggleAction>::cast_dynamic(action_group->get_action("ViewShowToolbar")); menu->set_a...
false
false
false
false
false
0
neb2_post_level_init() { int idx; // standalone servers can bail here if (Game_mode & GM_STANDALONE_SERVER) { return; } // if the mission is not a fullneb mission, skip if ( !((The_mission.flags & MISSION_FLAG_FULLNEB) || Nebula_sexp_used) ) { Neb2_render_mode = NEB2_RENDER_NONE; Neb2_awacs = -1.0f; ret...
false
false
false
false
false
0
bdrv_pwrite_em(BlockDriverState *bs, int64_t offset, const uint8_t *buf, int count1) { uint8_t tmp_buf[SECTOR_SIZE]; int len, nb_sectors, count; int64_t sector_num; count = count1; /* first write to align to sector start */ len = (SECTOR_SIZE - offset) & (SECTOR_SIZE -...
false
true
false
false
false
1
a8293_probe(struct i2c_client *client, const struct i2c_device_id *id) { struct a8293_dev *dev; struct a8293_platform_data *pdata = client->dev.platform_data; struct dvb_frontend *fe = pdata->dvb_frontend; int ret; u8 buf[2]; dev = kzalloc(sizeof(*dev), GFP_KERNEL); if (!dev) { ret = -ENOMEM; goto ...
false
false
false
false
false
0
mxt_get_object(struct mxt_data *data, u8 type) { struct mxt_object *object; int i; for (i = 0; i < data->info.object_num; i++) { object = data->object_table + i; if (object->type == type) return object; } dev_warn(&data->client->dev, "Invalid object type T%u\n", type); return NULL; }
false
false
false
false
false
0
cr_statement_at_page_rule_set_declarations (CRStatement * a_this, CRDeclaration * a_decl_list) { g_return_val_if_fail (a_this && a_this->type == AT_PAGE_RULE_STMT && a_this->kind.page_rule, CR_BAD_PARAM_ERROR...
false
false
false
false
false
0
autodir_option_timeout( char ch, char *arg, int valid ) { if( ! valid ) autodir.time_out = DFLT_TIME_OUT; else if( ! string_to_number( arg, &autodir.time_out ) ) msglog( MSG_FATAL, "invalid argument for timeout -%c option", ch ); }
false
false
false
false
false
0
convert_schema_name(text *schemaname) { char *nspname; Oid oid; nspname = DatumGetCString(DirectFunctionCall1(textout, PointerGetDatum(schemaname))); oid = GetSysCacheOid(NAMESPACENAME, CStringGetDatum(nspname), 0, 0, 0); if (!OidIsValid(oid)) ereport(ERROR, (errcode(ERRCOD...
false
false
false
false
false
0
init_timer (Uint32 dt) { inittimer_gl117 += dt; initsynchrotimer += dt; if (initsynchrotimer > 20) { initsynchrotimer -= 20; dt = 20; } else return; int r = myrandom (100); if (r == 50) r = myrandom (100); // do not optimize this: random number generator initialization tl.x = 6.0 * pow (1.5,...
false
false
false
false
false
0
print_ni_name(struct iface_data *idata, const u_char *pktdata, struct pcap_pkthdr * pkthdr){ struct ether_header *pkt_ether; struct ip6_hdr *pkt_ipv6; struct icmp6_nodeinfo *pkt_ni; unsigned char *pkt_end; struct ni_reply_name *pkt_nidata; unsigned char *start, *next; pkt_ether = (struct ether_header *)...
false
false
false
false
false
0
savenwgame( tnstream* strm, const GameMap* gamemap ) { PackageManager::storeData( gamemap ); spfld = const_cast<GameMap*>(gamemap); // yes, this is bad, but spfld can't be made constant because it is also used for loading stream = strm; stream->writepchar ( getFullVersionString() ); // description is n...
false
false
false
false
false
0
gmbus_wait_hw_status(struct drm_i915_private *dev_priv, u32 gmbus2_status, u32 gmbus4_irq_en) { int i; u32 gmbus2 = 0; DEFINE_WAIT(wait); if (!HAS_GMBUS_IRQ(dev_priv->dev)) gmbus4_irq_en = 0; /* Important: The hw handles only the first bit, so set only one! Since * we also need to check for NAK...
false
false
false
false
false
0
gtf_visitor_feature_node(GtNodeVisitor *nv, GtFeatureNode *fn, GtError *err) { GtGTFVisitor *gtf_visitor; int had_err; gt_error_check(err); gtf_visitor = gtf_visitor_cast(nv); had_err = gt_feature_node_traverse_children(fn, gtf_visitor, ...
false
false
false
false
false
0
list_all_inner_loop_index(Block *block, IntSet index_list){ Block *bpt; for(bpt = block; bpt != NULL; bpt = bpt->next){ if (bpt->inner != NULL){ list_all_inner_loop_index(bpt->inner, index_list); } if (bpt->kind == LOOP || bpt->kind == DOALL || bpt->...
false
false
false
false
false
0
buildPreBlockStatements(vector<const string*>* preBlockStatements, int fileType) { preBlockStatements->push_back(&AS_CLASS); if (fileType == C_TYPE) { preBlockStatements->push_back(&AS_STRUCT); preBlockStatements->push_back(&AS_UNION); preBlockStatements->push_back(&AS_NAMESPACE); } if (fileType == JAVA_TYPE...
false
false
false
false
false
0
k_version(const char** extra, const char** git) { uint32_t maj = 0, min = 0, plev = 0; const char* s = __libk_version_string; const char* e = 0, *g = 0; while (*s) { if (*s == '-') e = s+1; if (*s == '+') g = s+1; s++; } if (git) { memset(__libk_git_ver, 0, 256); if (g) strncpy(__libk_git_ver...
false
false
false
false
false
0
CollectGarbage(AllocationSpace space, GarbageCollector collector) { // The VM is in the GC state until exiting this function. VMState state(GC); #ifdef DEBUG // Reset the allocation timeout to the GC interval, but make sure to // allow at least a few allocations after a collection. The reason // for this is ...
false
false
false
false
false
0
send_blast(unsigned int delay ) { common_flow_header_t *header; nfprof_t profile_data; int i, ret; u_long usec, sec; double fps; peer.send_buffer = malloc(1400); if ( !peer.send_buffer ) { perror("Memory allocation error"); close(peer.sockfd); return; } header = (common_flow_header_t *)p...
false
false
false
false
true
1
score_full_house_kismet(int field) { int i = find_n_of_a_kind (3, 0); if (i) { if (find_n_of_a_kind (2, i) || find_n_of_a_kind (5, 0)) return 15 + add_dice (); } return 0; }
false
false
false
false
false
0
LogAllLocked() { RAW_CHECK(LockIsHeld(), "should be held (by this thread)"); RAW_LOG(INFO, "List of regions:"); uintptr_t previous = 0; for (RegionSet::const_iterator r = regions_->begin(); r != regions_->end(); ++r) { RAW_LOG(INFO, "Memory region 0x%" PRIxPTR "..0x%" PRIxPTR " " "f...
false
false
false
false
false
0
_e_smart_reconfigure(Evas_Object *obj) { Smart_Data *sd = evas_object_smart_data_get(obj); if (sd->idle_enter) return; sd->idle_enter = ecore_idle_enterer_before_add(_e_smart_reconfigure_do, obj); }
false
false
false
false
false
0
liblo10k1_con_del(liblo10k1_connection_t *conn, int type, int patch, int io, int *ci) { ld10k1_fnc_connection_t connection_fnc; int err; int conn_id; connection_fnc.what = FNC_CONNECTION_DEL; connection_fnc.from_type = type; connection_fnc.from_patch = patch; connection_fnc.from_io = io; connection_fnc.to_type...
false
false
false
false
false
0
Getlogin(void) { #ifdef HAVE_GETLOGIN { char *user; if ((user = getlogin()) != NULL) return user; } #endif #ifdef HAVE_GETPWUID { struct passwd *pw; if ((pw = getpwuid(getuid())) == NULL) return NULL; else return pw->pw_name; } #endif return NULL; }
false
false
false
false
false
0
cx18_streams_register(struct cx18 *cx) { int type; int err; int ret = 0; /* Register V4L2 devices */ for (type = 0; type < CX18_MAX_STREAMS; type++) { err = cx18_reg_dev(cx, type); if (err && ret == 0) ret = err; } if (ret == 0) return 0; /* One or more streams could not be initialized. Clean 'em al...
false
false
false
false
false
0
dapodometerpoints(Dapodometer* odom) { unsigned int i,rank = odom->rank; size_t count = 1; DCEslice* slice = odom->slices; for(i=0;i<rank;i++,slice++) { size_t slicecount = (slice->length/slice->stride); count *= slicecount; } return count; }
false
false
false
false
false
0
WriteVarint32(uint32 value) { if (buffer_size_ >= kMaxVarint32Bytes) { // Fast path: We have enough bytes left in the buffer to guarantee that // this write won't cross the end, so we can skip the checks. uint8* target = buffer_; uint8* end = WriteVarint32FallbackToArrayInline(value, target); int...
false
false
false
false
false
0
sample_endpoints(ESL_RANDOMNESS *r, const P7_PROFILE *gm, int *ret_kstart, int *ret_kend) { float *pstart = NULL; int k; int kstart, kend; int status; /* We have to backcalculate a probability distribution from the * lod B->Mk scores in a local model; this is a little time consuming, * but we ...
false
false
false
false
false
0
xsh_irplib_imagelist_get_clean_mean_levels(const cpl_imagelist* iml, const double kappa, const int nclip, const double tolerance) { const cpl_image* img=NULL; int size=0; int i=0; cpl_vecto...
false
false
false
false
false
0
GetConfigurations(std::vector<std::string>& configs, bool single) const { if(this->LocalGenerator->GetGlobalGenerator()->IsMultiConfig()) { if(const char* configTypes = this->GetDefinition("CMAKE_CONFIGURATION_TYPES")) { cmSystemTools::ExpandListArgument(config...
false
false
false
false
false
0
xmlSchemaCheckGroupDefCircular(xmlSchemaModelGroupDefPtr item, xmlSchemaParserCtxtPtr ctxt) { /* * Schema Component Constraint: Model Group Correct * 2 Circular groups are disallowed. That is, within the {particles} * of a group there must not be at any depth a particle wh...
false
false
false
false
false
0
dump() const { return "<number>" + QString::number( m_value ) + "</number>"; }
false
false
false
false
false
0
mmc_send_app_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr) { struct mmc_command cmd = {0}; int i, err = 0; BUG_ON(!host); cmd.opcode = SD_APP_OP_COND; if (mmc_host_is_spi(host)) cmd.arg = ocr & (1 << 30); /* SPI only defines one bit */ else cmd.arg = ocr; cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R3 | MMC_...
false
false
false
false
false
0
PKIX_PL_X500Name_CreateFromCERTName( SECItem *derName, CERTName *name, PKIX_PL_X500Name **pName, void *plContext) { PLArenaPool *arena = NULL; SECStatus rv = SECFailure; PKIX_PL_X500Name *x500Name = NULL; PKIX_ENTER(X500NAME, "PKIX_PL_X500Name_CreateFrom...
false
false
false
false
false
0
copytoks (int tindex, int ntokens) { int i; for (i = 0; i < ntokens; ++i) { addtok(dfa->tokens[tindex + i]); /* Update index into multibyte csets. */ if (MB_CUR_MAX > 1 && dfa->tokens[tindex + i] == MBCSET) dfa->multibyte_prop[dfa->tindex - 1] = dfa->multibyte_prop[tindex + i]; }...
false
false
false
false
false
0
handle_vector_size_attribute (tree *node, tree name, tree args, int ARG_UNUSED (flags), bool *no_add_attrs) { unsigned HOST_WIDE_INT vecsize, nunits; enum machine_mode orig_mode; tree type = *node, new_type, size; *no_add_attrs = true; size = TREE_VALUE (args); if (!host_integerp (size,...
false
false
false
false
false
0
tio_flush_nonblock(TFILE *fp) { struct timeval tv; fd_set fdset; int rv; /* prepare our filedescriptorset */ FD_ZERO(&fdset); FD_SET(fp->fd,&fdset); /* set the timeout to 0 to poll */ tv.tv_sec=0; tv.tv_usec=0; /* wait for activity */ rv=select(FD_SETSIZE,NULL,&fdset,NULL,&tv); /* check if any f...
false
false
false
false
false
0
init_mad_qp(struct ib_mad_port_private *port_priv, struct ib_mad_qp_info *qp_info) { qp_info->port_priv = port_priv; init_mad_queue(qp_info, &qp_info->send_queue); init_mad_queue(qp_info, &qp_info->recv_queue); INIT_LIST_HEAD(&qp_info->overflow_list); spin_lock_init(&qp_info->snoop_lock); qp_info->snoop_table ...
false
false
false
false
false
0
getDocDefaultLangDescription(std::string & s) { const XAP_StringSet * pSS = XAP_App::getApp()->getStringSet(); UT_return_if_fail(pSS); pSS->getValueUTF8(XAP_STRING_ID_DLG_ULANG_DefaultLangLabel, s); s += m_docLang; }
false
false
false
false
false
0
__pci_complete_power_transition(struct pci_dev *dev, pci_power_t state) { int ret; if (state <= PCI_D0) return -EINVAL; ret = pci_platform_power_transition(dev, state); /* Power off the bridge may power off the whole hierarchy */ if (!ret && state == PCI_D3cold) __pci_bus_set_current_state(dev->subordinate, P...
false
false
false
false
false
0
encode(const std::string &uri) { string ret; const unsigned char *ptr = (const unsigned char *)uri.c_str(); ret.reserve(uri.length()); for (; *ptr ; ++ptr) { if (!safe[*ptr]) { char buf[5]; memset(buf, 0, 5); snprintf(buf, 5, "%%%X", (*ptr)); ret.append(buf); } else { ret += *ptr; ...
false
false
false
false
false
0
prot_resettimeout(struct protstream *s) { assert(!s->write); s->timeout_mark = time(NULL) + s->read_timeout; return 0; }
false
false
false
false
false
0
mwifiex_ret_tx_rate_cfg(struct mwifiex_private *priv, struct host_cmd_ds_command *resp) { struct host_cmd_ds_tx_rate_cfg *rate_cfg = &resp->params.tx_rate_cfg; struct mwifiex_rate_scope *rate_scope; struct mwifiex_ie_types_header *head; u16 tlv, tlv_buf_len, tlv_buf_left; u8 *tlv_buf; u32 i; tlv_buf = ((...
false
false
false
false
false
0
av_md5_update(AVMD5 *ctx, const uint8_t *src, const int len){ int i, j; j= ctx->len & 63; ctx->len += len; for( i = 0; i < len; i++ ){ ctx->block[j++] = src[i]; if( 64 == j ){ body(ctx->ABCD, (uint32_t*) ctx->block); j = 0; } } }
false
false
false
false
false
0
nn_SpatialConvolution_forward(lua_State *L) { THTensor *input = luaT_checkudata(L, 2, torch_Tensor_id); int kW = luaT_getfieldcheckint(L, 1, "kW"); int kH = luaT_getfieldcheckint(L, 1, "kH"); int dW = luaT_getfieldcheckint(L, 1, "dW"); int dH = luaT_getfieldcheckint(L, 1, "dH"); int nInputPlane = luaT_get...
false
false
false
false
false
0
cui_agent_set_selected_service(const char *path, const char *name) { g_free(service.path); service.path = g_strdup(path); g_free(service.name); if (name == NULL) service.name = g_strdup("Hidden"); else service.name = g_strdup(name); }
false
false
false
false
false
0
sanei_write_tiff_header (SANE_Frame format, int width, int height, int depth, int resolution, const char *icc_profile, FILE *ofp) { #ifdef __EMX__ /* OS2 - write in binary mode. */ _fsetmode(ofp, "b"); #endif switch (format) { case SANE_FRAME_RED: case SANE_FRAME_GREEN: case SANE_FRAME_BLUE:...
false
false
false
false
false
0
main(void) { int gridID, zaxisID1, zaxisID2, taxisID; int vlistID, varID1, varID2, streamID, tsID; int i, nmiss = 0; double lons[nlon] = {0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330}; double lats[nlat] = {-75, -45, -15, 15, 45, 75}; double levs[nlev] = {101300, 92500, 85000, 50000, 20000}; doubl...
false
false
false
false
false
0
master(int m, ErrorHandler *errh) { AmfmMaster &master = _masters[m]; if (!master.loaded) { master.loaded = true; DirectoryMetricsFinder directory_finder(_directory); _finder->add_finder(&directory_finder); Metrics *afm = _finder->find_metrics(master.font_name); if (!afm) { if (errh) errh->error("...
false
false
false
false
false
0
method_84(const int *account, int *weight) { // exception "Ausnahme f. Sachkonten" if (9 == account[2]) return method_51_exception(account,weight); // Methode A number2Array("0000654320", weight); if (AccountNumberCheck::OK == algo01(11, weight, false, 10, account)) return AccountNumberCheck::OK;...
false
false
false
false
false
0
setoption(int flag, int val) { int i; for (i = 0; i < NOPTS; i++) if (optletters[i] == flag) { optlist[i] = val; if (val) { /* #%$ hack for ksh semantics */ if (flag == 'V') Eflag = 0; else if (flag == 'E') Vflag = 0; } return; } sh_error("Illegal option -%c", flag); /* NOTREA...
false
false
false
false
false
0
via_set_state(u32 devices, u8 state) { /* TODO: Can we enable/disable these devices? How? if (devices & VIA_LDVP0) if (devices & VIA_LDVP1) */ if (devices & VIA_DVP0) set_dvp0_state(state); if (devices & VIA_CRT) set_crt_state(state); if (devices & VIA_DVP1) set_dvp1_state(state); if (devices & VIA_LVDS1...
false
false
false
false
false
0
analyse_status(struct gnutella_node *n, int *code) { struct gnutella_socket *s = n->socket; const char *status; int ack_code; uint major = 0, minor = 0; const char *ack_message = ""; bool ack_ok = FALSE; bool incoming = (n->flags & NODE_F_INCOMING) ? TRUE : FALSE; const char *what = incoming ? "acknowledgment" ...
false
false
false
false
false
0
git_attr_file__free(git_attr_file *file) { unsigned int i; git_attr_rule *rule; if (!file) return; git_vector_foreach(&file->rules, i, rule) git_attr_rule__free(rule); git_vector_free(&file->rules); if (file->pool_is_allocated) { git_pool_clear(file->pool); git__free(file->pool); } file->pool = NULL...
false
false
false
false
false
0
event_base_loopbreak(struct event_base *event_base) { if (event_base == NULL) return (-1); EVBASE_ACQUIRE_LOCK(event_base, th_base_lock); event_base->event_break = 1; EVBASE_RELEASE_LOCK(event_base, th_base_lock); if (!EVBASE_IN_THREAD(event_base)) { return evthread_notify_base(event_base); } else { retur...
false
false
false
false
false
0
wb_view_detach_from_workbook (WorkbookView *wbv) { g_return_if_fail (IS_WORKBOOK_VIEW (wbv)); if (wbv->wb) { workbook_detach_view (wbv); wbv->wb = NULL; wbv->current_sheet = NULL; } }
false
false
false
false
false
0
nautilus_icon_info_get_pixbuf_at_size (NautilusIconInfo *icon, gsize forced_size) { GdkPixbuf *pixbuf, *scaled_pixbuf; int w, h, s; double scale; pixbuf = nautilus_icon_info_get_pixbuf (icon); w = gdk_pixbuf_get_width (pixbuf) / icon->orig_scale; h = gdk_pixbuf_get_height (pixbuf) / ico...
false
false
false
false
false
0
constant_pool_add_NameAndType(struct ClassFile *cf, const char *name, const char *descriptor) { struct Pair t; struct ConstantPool **p = &cf->constant_pool; int index = 1; t.i = constant_pool_add_Utf8(cf, name); t.j = constant_pool_add_Utf8(cf, descriptor); while (*p != NULL) { if ((*p)->tag == CONSTANT_Name...
false
false
false
false
false
0
xmlSecNssAppKeyLoadSECItem(SECItem* secItem, xmlSecKeyDataFormat format, const char *pwd, void* pwdCallback, void* pwdCallbackCtx) { xmlSecKeyPtr key = NULL; xmlSecAssert2(secItem != NULL, NULL); xmlSecAssert2(format != xmlSecKeyDataFormatUnknown, NULL); switch(format) { #ifndef XMLS...
false
false
false
false
false
0
SendPointOfInterest(uint32 poi_id) { PointOfInterest const* poi = sObjectMgr.GetPointOfInterest(poi_id); if (!poi) { sLog.outErrorDb("Requested send nonexistent POI (Id: %u), ignore.", poi_id); return; } std::string icon_name = poi->icon_name; int loc_idx = GetMenuSession()->Ge...
false
false
false
false
false
0
ReleaseListToSpans(void* start) { while (start) { void *next = SLL_Next(start); ReleaseToSpans(start); start = next; } }
false
false
false
false
false
0
genie_times_int_string (NODE_T * p) { A68_INT k; A68_REF a; POP_REF (p, &a); POP_OBJECT (p, &k, A68_INT); PRELUDE_ERROR (VALUE (&k) < 0, p, ERROR_INVALID_ARGUMENT, MODE (INT)); PUSH_REF (p, empty_string (p)); while (VALUE (&k)--) { PUSH_REF (p, a); genie_add_string (p); } }
false
false
false
false
false
0
map_excludes(__isl_keep isl_map *map, void *user) { struct isl_union_map_involves_dims_data *data = user; int involves; involves = isl_map_involves_dims(map, isl_dim_param, data->first, data->n); if (involves < 0) return -1; return !involves; }
false
false
false
false
false
0
addTerm(const FbTk::FbString &str, WinProperty prop, bool negate, const FbTk::FbString& xprop) { bool rc = false; Term* term = new Term(str, prop, negate, xprop); if (!term) return rc; if ((rc = !term->regexp.error())) { m_terms.push_back(term); } else { delete term; }...
false
false
false
false
false
0
setTransientFor(w, win) Widget w; Window win; { if (!XtIsRealized(w)) XtRealizeWidget(w); XSetTransientForHint(XtDisplay(w), XtWindow(w), win); }
false
false
false
false
false
0
dspam_addattribute (DSPAM_CTX * CTX, const char *key, const char *value) { int i, j = 0; if (_ds_find_attribute(CTX->config->attributes, key)) return _ds_add_attribute(CTX->config->attributes, key, value); ...
false
false
false
false
false
0
smi_read_eeprom(struct i2c_adapter *i2c, u16 reg, u8 *data, u16 size) { int ret; u8 b0[2] = { (reg >> 8) & 0xff, reg & 0xff }; struct i2c_msg msg[] = { { .addr = 0x50, .flags = 0, .buf = b0, .len = 2 }, { .addr = 0x50, .flags = I2C_M_RD, .buf = data, .len = size } }; ret = i2c_transfer(i2c, msg, 2); ...
false
false
false
false
false
0
window_print_items(WINDOW_REC *win) { GSList *tmp; const char *type; printformat_window(win, MSGLEVEL_CLIENTCRAP, TXT_WINDOW_INFO_ITEMS_HEADER); for (tmp = win->items; tmp != NULL; tmp = tmp->next) { WI_ITEM_REC *item = tmp->data; type = module_find_id_str("WINDOW ITEM TYPE", item->type); print...
false
false
false
false
false
0
mmio_74xx_gpio_probe(struct platform_device *pdev) { const struct of_device_id *of_id; struct mmio_74xx_gpio_priv *priv; struct resource *res; void __iomem *dat; int err; of_id = of_match_device(mmio_74xx_gpio_ids, &pdev->dev); if (!of_id) return -ENODEV; priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_K...
false
false
false
false
false
0
prepare_convdata(IR * ir) { if (!ir->resampled_samples || !ir->ir_nfram || !ir->nchan) { return; } free_ir_samples(ir); ir->ir_samples = (float**)malloc((1 + ir->nchan) * sizeof(float*)); for (int i = 0; i < ir->nchan; i++) { ir->ir_samples[i] = (float*)malloc(ir->ir_nfram * sizeof(float)); } ir->ir_sample...
false
false
false
false
false
0
mpz_poly_realloc(mpz_poly_t poly, unsigned long alloc) { if ((long) alloc <= 0) alloc = 1; // clear any mpz_t's beyond the new array length for (unsigned long i = alloc; i < poly->alloc; i++) mpz_clear(poly->coeffs[i]); poly->coeffs = (mpz_t*) flint_heap_realloc(poly->coeffs, ...
false
false
false
false
false
0
node_create(const node_id_t * node_id) { node_t *node; gchar *name; guint i; g_assert(node_id); node = g_malloc (sizeof (node_t)); g_assert(node); node->node_id = *node_id; name = node_id_str(node_id); node->name = g_string_new(name); node->numeric_name = g_string_new(name); g_free(name); ...
false
false
false
false
false
0
svc_is_mapped (rpcprog_t prog, rpcvers_t vers) { struct svc_callout *prev; register struct svc_callout *s; s = svc_find (prog, vers, &prev); return s!= NULL_SVC && s->sc_mapped; }
false
false
false
false
false
0
at76_calc_padding(int wlen) { /* add the USB TX header */ wlen += AT76_TX_HDRLEN; wlen = wlen % 64; if (wlen < 50) return 50 - wlen; if (wlen >= 61) return 64 + 50 - wlen; return 0; }
false
false
false
false
false
0
skip_comment(line, process, include_space, is_comment) char_u *line; int process; int include_space; int *is_comment; { char_u *comment_flags = NULL; int lead_len; int leader_offset = get_last_leader_offset(line, &comment_flags); *is_comment = FALSE; if (leade...
false
false
false
false
false
0
flac__utils_set_channel_mask_tag(FLAC__StreamMetadata *object, FLAC__uint32 channel_mask) { FLAC__StreamMetadata_VorbisComment_Entry entry = { 0, 0 }; char tag[128]; FLAC__ASSERT(object); FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT); FLAC__ASSERT(strlen(CHANNEL_MASK_TAG+1+2+16+1) <= sizeof(tag...
false
false
false
false
false
0
insert_name_tags(RESULT& result, WORKUNIT const& wu) { char buf[256]; int retval; sprintf(buf, "<name>%s</name>\n", result.name); retval = insert_after(result.xml_doc_in, "<result>\n", buf); if (retval) return retval; sprintf(buf, "<wu_name>%s</wu_name>\n", wu.name); retval = insert_after(r...
false
false
false
false
false
0
on_secret_info_query (GdmDBusUserVerifier *user_verifier, const char *service_name, const char *query_text) { char answer[1024]; char *res; struct termios ts0; struct termios ts1; tcgetattr (fileno ...
false
false
false
false
false
0
main() { set<fraction> happy_joy; for(auto tens : digits) for(auto ones : digits) for(auto filler : digits) { //BRUTE FORCE YEEEAAAAHHHH fraction f1 = make_pair(tens * 10 + ones, filler * 10 + tens), f2 = make_pair(tens * 10 + ones, ones * 10 + filler), cancel_f1 = make_pair(ones, filler), can...
false
false
false
false
false
0
uv__stream_init(uv_loop_t* loop, uv_stream_t* stream, uv_handle_type type) { uv__handle_init(loop, (uv_handle_t*)stream, type); stream->read_cb = NULL; stream->read2_cb = NULL; stream->alloc_cb = NULL; stream->close_cb = NULL; stream->connection_cb = NULL; stream-...
false
false
false
false
false
0
dumpCommand(redisClient *c) { char buf[64]; FILE *fp; robj *o, *dumpobj; sds dump = NULL; off_t payload_len; unsigned int type; /* Check if the key is here. */ if ((o = lookupKeyRead(c->db,c->argv[1])) == NULL) { addReply(c,shared.nullbulk); return; } /* Cre...
true
true
false
false
true
1
ggc_free (void *p) { page_entry *pe = lookup_page_table_entry (p); size_t order = pe->order; size_t size = OBJECT_SIZE (order); #ifdef GATHER_STATISTICS ggc_free_overhead (p); #endif if (GGC_DEBUG_LEVEL >= 3) fprintf (G.debug_file, "Freeing object, actual size=%lu, at %p on %p\n", (unsigned ...
false
false
false
false
false
0
printNamedMDNode(const NamedMDNode *NMD) { Out << '!'; printMetadataIdentifier(NMD->getName(), Out); Out << " = !{"; for (unsigned i = 0, e = NMD->getNumOperands(); i != e; ++i) { if (i) Out << ", "; int Slot = Machine.getMetadataSlot(NMD->getOperand(i)); if (Slot == -1) Out << "<badref>...
false
false
false
false
false
0
tio_goto_column(column) int column; /* Move cursor to column `column'. */ { if (column > hx_columns - 1) column = column - 1; if (t_column >= 0) if (abs(t_column - column) <= column) { tio_rel_move(0, column - t_column); return; } if (t_goto_column) tio_command(t_goto_column, 1, col...
false
false
false
false
false
0
compute_luids (start, end, prev_luid) rtx start, end; int prev_luid; { int i; rtx insn; for (insn = start, i = prev_luid; insn != end; insn = NEXT_INSN (insn)) { if (INSN_UID (insn) >= max_uid_for_loop) continue; /* Don't assign luids to line-number NOTEs, so that the distance in lui...
false
false
false
false
false
0
Transport_StirRandom(TSS_HCONTEXT tspContext, /* in */ UINT32 inDataSize, /* in */ BYTE * inData) /* in */ { TSS_RESULT result; UINT64 offset; UINT32 dataLen; TCS_HANDLE handlesLen = 0; BYTE *data; if ((result = obj_context_transport_init(tspContext))) return result; LogDeb...
false
false
false
false
false
0
jpu_g_fmt(struct file *file, void *priv, struct v4l2_format *f) { struct jpu_q_data *q_data; struct jpu_ctx *ctx = fh_to_ctx(priv); if (!v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type)) return -EINVAL; q_data = jpu_get_q_data(ctx, f->type); f->fmt.pix_mp = q_data->format; return 0; }
false
false
false
false
false
0
update_pool(prng_ctx ctx[1]) { unsigned int i = 0; /* transfer random pool data to the output buffer */ memcpy(ctx->obuf, ctx->rbuf, PRNG_POOL_SIZE); /* enter entropy data into the pool */ while(i < PRNG_POOL_SIZE) i += ctx->entropy(ctx->rbuf + i, PRNG_POOL_SIZE - i); /* ...
false
false
false
false
false
0
subs(const map_basic_basic &subs_dict) const { RCP<const Mul> self = rcp_const_cast<Mul>(rcp(this)); auto it = subs_dict.find(self); if (it != subs_dict.end()) return it->second; RCP<const Number> coef = coef_; map_basic_basic d; for (auto &p: dict_) { RCP<const Basic> factor_ol...
false
false
false
false
false
0
real_execute() { int num = m_head; int total = fbwindow().screen().numHeads(); if (num < 0) num += total + 1; num = FbTk::Util::clamp(num, 1, total); fbwindow().setOnHead(num); }
false
false
false
false
false
0
cmd_hyperlink_redo (GnmCommand *cmd, WorkbookControl *wbc) { CmdHyperlink *me = CMD_HYPERLINK (cmd); GSList *l; Workbook *wb = wb_control_get_workbook (wbc); g_return_val_if_fail (me != NULL, TRUE); /* Check for locked cells */ if (cmd_selection_is_locked_effective (me->cmd.sheet, me->selection, wbc...
false
false
false
false
false
0
insert(uint field, long long value) { UDSEntryPrivate::Field f; f.m_long = value; d->fields.insert(field, f); }
false
false
false
false
false
0
parseAttribute(XMLNode_as* node, xml_iterator& it, const xml_iterator end, Attributes& attributes) { const std::string terminators("\r\t\n >="); xml_iterator ourend = std::find_first_of(it, end, terminators.begin(), terminators.end()); if (ourend == end) { _status = XML_UNTERMI...
false
false
false
false
false
0
countParts(QDir & dir, QStringList & nameFilters, int & partCount) { QStringList list = dir.entryList(nameFilters, QDir::Files | QDir::NoSymLinks); partCount += list.size(); QStringList dirs = dir.entryList(QDir::AllDirs | QDir::NoSymLinks | QDir::NoDotAndDotDot); for (int i = 0; i < dirs.size(); ++i) { ...
false
false
false
false
false
0