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
fmt_pad(char* dest,const char* src,size_t srclen,size_t padlen,size_t maxlen) { long todo; char* olddest=dest; char* max=dest+maxlen; todo=padlen-srclen; if (dest==0) { unsigned long sum=srclen>padlen?srclen:padlen; return sum>maxlen?maxlen:sum; } for (; todo>0; --todo) { if (dest>max) break; ...
false
false
false
false
false
0
Uninit() { wxASSERT(ms_Tracer != NULL); wxMutexLocker mutexLocker(*ms_Tracer); if ( mutexLocker.IsOk() ) { if ( ms_Tracer != NULL ) { if ( ms_Tracer->IsOpened() == true ) { ms_Tracer->Close(); } delete ms_Tracer; ms_Tracer = NULL; } } }
false
false
false
false
false
0
ResolveIP(bool force, int* error) { if (hostname_.empty()) { // nothing to resolve } else if (!force && !IsAny()) { // already resolved } else { LOG_F(LS_VERBOSE) << "(" << hostname_ << ")"; int errcode = 0; if (hostent* pHost = SafeGetHostByName(hostname_.c_str(), &errcode)) { if (IPFro...
false
false
false
false
false
0
pr_tvals( const ncvar_t *vp, /* variable */ size_t len, /* number of values to print */ boolean more, /* true if more data for this row will * follow, so add trailing comma */ boolean lastrow, /* true if this is the last row for this * variable, so terminate with ";" instead * of ...
false
false
false
false
false
0
amsync(A a, A aflags) { #ifdef _AIX R 0; #else int bytes; unsigned long flags; if (SymbolsToMask(MsyncMasks, aflags, &flags) == -1) { (void)pa((V)aflags); q = ERR_DOMAIN; R 0; } bytes=mf_length(a); R bytes?msync((caddr_t)a, AH+Tt(a->t,a->n), (int)flags):0; #endif /* _AIX */ }
false
false
false
false
false
0
ena_close(struct net_device *netdev) { struct ena_adapter *adapter = netdev_priv(netdev); netif_dbg(adapter, ifdown, netdev, "%s\n", __func__); if (test_bit(ENA_FLAG_DEV_UP, &adapter->flags)) ena_down(adapter); return 0; }
false
false
false
false
false
0
tmpname(char *buf, const char *suffix) { struct stat st; unsigned int i; int ret; for (i = 0; ; i++) { sprintf(buf, "/tmp/faucc.%u.%u.%s", (unsigned int) getpid(), i, suffix); ret = lstat(buf, &st); if (ret < 0 && errno == ENOENT) { break; } } }
false
false
false
false
false
0
ReadTypeHeaderAndLength(uint8** pos, uint8* end, uint8 expected_tag, uint32* length) { if(!(*pos < end)) return false; if(!(**pos == expected_tag)) return false; (*...
false
false
false
false
false
0
contains_illegals(const char *string, const char *illegals, int len) { for(; *string && len--; string++) if((*string < ' ' && *string != '\005' && !(*string & 0x80)) || strchr(illegals, *string)) return 1; return 0; }
false
false
false
false
false
0
GetNextSample() { // FIXME: lazy und unsafe implementation, should be an autonomous iterator for (Sample* pSample = pFile->GetNextSample(); pSample; pSample = pFile->GetNextSample()) { if (pSample->GetGroup() == this) return pSample; } return NULL; }
false
false
false
false
false
0
update_domain(struct protection_domain *domain) { if (!domain->updated) return; update_device_table(domain); domain_flush_devices(domain); domain_flush_tlb_pde(domain); domain->updated = false; }
false
false
false
false
false
0
cm_tophits_GetMaxNameLength(CM_TOPHITS *h) { int i, max; for (max = 0, i = 0; i < h->N; i++) if (h->unsrt[i].name != NULL) { max = ESL_MAX(max, strlen(h->unsrt[i].name)); } return max; }
false
false
false
false
false
0
ipCidrRouteTable_index_from_oid(netsnmp_index * oid_idx, ipCidrRouteTable_mib_index * mib_idx) { int err = SNMP_ERR_NOERROR; /* * temp storage for parsing indexes */ /* * ipCidrRouteDest(1)/IPADDR/ASN_IPADDRESS/u_long(u_long)//l/A/w/e/r/d/h */...
false
false
false
false
false
0
ml_clearmarked() { bhdr_T *hp; DATA_BL *dp; linenr_T lnum; int i; if (curbuf->b_ml.ml_mfp == NULL) /* nothing to do */ return; /* * The search starts with line lowest_marked. */ for (lnum = lowest_marked; lnum <= curbuf->b_ml.ml_line_count; ) { /* * Find the data blo...
false
false
false
false
true
1
ft_invl_hw_context(struct ft_cmd *cmd) { struct fc_seq *seq; struct fc_exch *ep = NULL; struct fc_lport *lport = NULL; BUG_ON(!cmd); seq = cmd->seq; /* Cleanup the DDP context in HW if DDP was setup */ if (cmd->was_ddp_setup && seq) { ep = fc_seq_exch(seq); if (ep) { lport = ep->lp; if (lport && (ep-...
false
false
false
false
false
0
gftpui_common_cmd_site (void *uidata, gftp_request * request, void *other_uidata, gftp_request * other_request, const char *command) { gftpui_callback_data * cdata; if (!GFTP_IS_CONNECTED (request)) { request->logging_function (gftp_logging_error, request, ...
false
false
false
true
false
1
ConfigureInterfaces() { struct Interface *ifp; Banner("Network interface configuration"); if (GetLock("netconfig",VIFDEV[VSYSTEMHARDCLASS],VIFELAPSED,VEXPIREAFTER,VUQNAME,CFSTARTTIME)) { if (strlen(VNETMASK) != 0) { IfConf(VIFDEV[VSYSTEMHARDCLASS],VIPADDRESS,VNETMASK,VBROADCAST); } Set...
false
false
false
false
false
0
pseudo_laplace_average(GwyDataField *dfield, gint ximin, gint yimin, gint ximax, gint yimax) { gdouble *data, *disttable; gint i, j, k, rowstride, width, height; gwy_debug("pseudo_laplace: (%d,%d) x (%d,%d)", ximin, ximax, yimin, yimax); data = gwy_data_fie...
false
false
false
false
false
0
generalizable_or_pair(const Insn &x) const { uint32_t value_diff = value.u ^ x.value.u; if (offset && x.offset == offset && mask.u && x.mask.u == mask.u && (short_output || !x.short_output) && yes() == x.yes() && (value_diff & (value_diff - 1)) == 0) { Insn test(offset, value.u & ~value_diff, mask.u & ~value...
false
false
false
false
false
0
operator=(mypoint &p) { if (this == &p) return *this ; // but do nothing more x_ = p.x(); y_ = p.y(); z_ = p.z(); Rval_ = p.Rval(); Gval_ = p.Gval(); Bval_ = p.Bval(); nbraw_ = p.nbraw(); // coming from viewer radius_ = p.radius(); hasAnnotation_ = p.hasAnnotation(); ...
false
false
false
false
false
0
lp_build_emit_fetch_texoffset( struct lp_build_tgsi_context *bld_base, const struct tgsi_full_instruction *inst, unsigned tex_off_op, const unsigned chan_index) { const struct tgsi_texture_offset *off = &inst->TexOffsets[tex_off_op]; struct tgsi_full_src_register reg; unsigned swizzle; LLVMValue...
false
false
false
false
false
0
amdgpu_pp_late_init(void *handle) { int ret = 0; struct amdgpu_device *adev = (struct amdgpu_device *)handle; if (adev->powerplay.ip_funcs->late_init) ret = adev->powerplay.ip_funcs->late_init( adev->powerplay.pp_handle); #ifdef CONFIG_DRM_AMD_POWERPLAY if (adev->pp_enabled) amdgpu_pm_sysfs_init(adev); #...
false
false
false
false
false
0
vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *buf) { const struct v4l2_event ev = { .type = V4L2_EVENT_EOS }; struct s5p_mfc_ctx *ctx = fh_to_ctx(priv); int ret; if (ctx->state == MFCINST_ERROR) { mfc_err("Call on DQBUF after unrecoverable error\n"); return -EIO; } switch (buf->type) { ...
false
false
false
false
false
0
gfs_center_regular_2nd_derivative (FttCell * cell, FttComponent c, GfsVariable * v) { g_return_val_if_fail (cell != NULL, 0.); g_return_val_if_fail (c < FTT_DIMENSION, 0.); g_return_val_if_fail (v != NULL, 0.); FttCell * n1 = ftt_cell_neighbor (cell, 2*c); FttCell * n2 = ftt_cell_neighbor (...
false
false
false
false
false
0
quota_compare_and_update(quota_ctx_t qctx, int qtype, int *usage_inconsistent) { struct quota_handle qh; struct scan_dquots_data scan_data; struct dquot *dq; dnode_t *n; dict_t *dict = qctx->quota_dict[qtype]; errcode_t err = 0; if (!dict) goto out; err = quota_file_open(qctx, &qh, 0, qtype, -1, 0); ...
false
false
false
false
false
0
mca_pml_cm_isend_init(void* buf, size_t count, ompi_datatype_t* datatype, int dst, int tag, mca_pml_base_send_mode_t sendmode, ompi_communicator_t* comm, ...
false
false
false
false
false
0
WinFirQ(float LowOmega, float UppOmega, float *Shape, int Len, double (*Window)(double), float shift) { int i; double time,phase,shape; // printf("WinFirQ: %5.3f %5.3f %d\n",LowOmega,UppOmega,Len); for(i=0; i<Len; i++) { time=i+(1.0-shift)-(float)Len/2; phase=2*M_PI*time/Len; if(time==0) shape=0.0; e...
false
false
false
false
false
0
resolveRelocation(const Dumper::Context &Ctx, const coff_section *Section, uint64_t Offset, const coff_section *&ResolvedSection, uint64_t &ResolvedAddress)...
false
false
false
false
false
0
method_A7(const int *account, int *weight) { number2Array("2121212120", weight); if (AccountNumberCheck::OK == algo01(10, weight, true, 10, account)) return AccountNumberCheck::OK; return algo01(10, weight, false, 10, account); }
false
false
false
false
false
0
visitUMaxExpr(const SCEVUMaxExpr *S) { Value *LHS = expand(S->getOperand(S->getNumOperands()-1)); const Type *Ty = LHS->getType(); for (int i = S->getNumOperands()-2; i >= 0; --i) { // In the case of mixed integer and pointer types, do the // rest of the comparisons as integer. if (S->getOperand(i)->g...
false
false
false
false
false
0
updateTimerProgress() { if(mExecutionPaused) return; ActionTools::ActionInstance *actionInstance = currentActionInstance(); switch(mExecutionStatus) { case PrePause: if(mExecutionTime.elapsed() >= actionInstance->pauseBefore() + mPauseBefore) { mExecutionTimer.stop(); startActionExecution...
false
false
false
false
false
0
showAccessKeys() { QStringList supportedElement; supportedElement << QLatin1String("input") << QLatin1String("a") << QLatin1String("area") << QLatin1String("button") << QLatin1String("label") << QLatin1Strin...
false
false
false
false
false
0
fuse_register_module(struct fuse_module *mod) { mod->ctr = 0; mod->so = fuse_current_so; if (mod->so) mod->so->ctr++; mod->next = fuse_modules; fuse_modules = mod; }
false
false
false
false
false
0
searchReplyFinished() { if (searchReply->error() == QGeoSearchReply::NoError) { QList<QGeoPlace> searchReplyPlaces = searchReply->places(); for (int i = 0; i < searchReplyPlaces.size(); ++i) addPlace(searchReplyPlaces.at(i)); if (fetchRequests.size() == 0) emit finis...
false
false
false
false
false
0
cpath(struct plist *p, Object o) { Object child = NULL; char *name = NULL; int i; switch (DXGetObjectClass(o)) { case CLASS_GROUP: for (i=0; (child=DXGetEnumeratedMember((Group)o, i, &name)); i++) { if (pushchild(p, child) == ERROR) { DXAddMessage("member %d", i); return ERROR; } ...
false
false
false
false
false
0
item_show( Item *item ) { /* name */ item->font->align = item->nalign; item->hfont->align = item->nalign; stk_font_write( item->font, stk_display, item->x + item->nx, item->y + item->ny, item->alpha, item->name ); if ( item->halpha > 0 ) stk_font_write( item->hfont, stk_dis...
false
false
false
false
false
0
rtl8xxxu_start(struct ieee80211_hw *hw) { struct rtl8xxxu_priv *priv = hw->priv; struct rtl8xxxu_rx_urb *rx_urb; struct rtl8xxxu_tx_urb *tx_urb; unsigned long flags; int ret, i; ret = 0; init_usb_anchor(&priv->rx_anchor); init_usb_anchor(&priv->tx_anchor); init_usb_anchor(&priv->int_anchor); rtl8723a_enabl...
false
false
false
false
false
0
get_acl_rights_as_int( char * strValue) { if (strValue == NULL ) return -1; /* First strip out the leading and trailing spaces */ __acl_strip_leading_space( &strValue ); __acl_strip_trailing_space( strValue ); /* We have to do a strcasecmp (case insensitive cmp) becuase we should return only if it is ex...
false
false
false
false
false
0
getOppositeCondition(SystemZCC::CondCodes CC) const { switch (CC) { default: llvm_unreachable("Invalid condition!"); case SystemZCC::O: return SystemZCC::NO; case SystemZCC::H: return SystemZCC::NH; case SystemZCC::NLE: return SystemZCC::LE; case SystemZCC::L: return SystemZCC::NL; case SystemZC...
false
false
false
false
false
0
stmmac_cmdline_opt(char *str) { char *opt; if (!str || !*str) return -EINVAL; while ((opt = strsep(&str, ",")) != NULL) { if (!strncmp(opt, "debug:", 6)) { if (kstrtoint(opt + 6, 0, &debug)) goto err; } else if (!strncmp(opt, "phyaddr:", 8)) { if (kstrtoint(opt + 8, 0, &phyaddr)) goto err; } e...
false
false
false
false
false
0
_mirrored_set(Evas_Object *obj, Eina_Bool mirrored) { Widget_Data *wd = elm_widget_data_get(obj); Elm_Toolbar_Item *it; EINA_INLIST_FOREACH(wd->items, it) _mirrored_set_item(obj, it, mirrored); if (wd->more_item) _mirrored_set_item(obj, wd->more_item, mirrored); }
false
false
false
false
false
0
LATIN1_to_UNICODE(Uint16 *unicode, const char *text, int len) { int i; for ( i=0; i < len; ++i ) { unicode[i] = ((const unsigned char *)text)[i]; } unicode[i] = 0; return unicode; }
false
false
false
false
false
0
fm_module_callback_gtk_folder_col(const char *name, gpointer init, int ver) { if (fm_folder_model_add_custom_column(name, init) == FM_FOLDER_MODEL_COL_DEFAULT) return FALSE; return TRUE; }
false
false
false
false
false
0
utf8_check_full(const char *buffer, int size, int32_t *codepoint) { int i; int32_t value = 0; unsigned char u = (unsigned char)buffer[0]; if(size == 2) { value = u & 0x1F; } else if(size == 3) { value = u & 0xF; } else if(size == 4) { value = u & 0x7;...
false
false
false
false
false
0
setup(SoType inputType) // //////////////////////////////////////////////////////////////////////// { #ifdef DEBUG if (input != NULL) { SoDebugError::post("SoSelectOne::setup", "Already initialized!"); } #endif if (inputType.isDerivedFrom(SoMField::getClassTypeId())) { input = (SoMField *)inputType...
false
false
false
false
false
0
dundi_discover(struct dundi_transaction *trans) { struct dundi_ie_data ied; int x; if (!trans->parent) { ast_log(LOG_WARNING, "Tried to discover a transaction with no parent?!?\n"); return -1; } memset(&ied, 0, sizeof(ied)); dundi_ie_append_short(&ied, DUNDI_IE_VERSION, DUNDI_DEFAULT_VERSION); if (!dundi_eid...
false
false
false
false
false
0
HandlePlayedTime(WorldPacket& /*recv_data*/) { WorldPacket data(SMSG_PLAYED_TIME, 4 + 4); data << uint32(_player->GetTotalPlayedTime()); data << uint32(_player->GetLevelPlayedTime()); SendPacket(&data); }
false
false
false
false
false
0
setPointParameters(GLfloat *attenuation, float minSize, float maxSize) { if (minSize != mPointSizeMin) { mPointSizeMin = minSize; const Ogre::RenderSystemCapabilities* caps = dynamic_cast<GLRenderSystem*>(Root::getSingleton().getRenderSystem())->getCapabilities(); ...
false
false
false
false
false
0
ExecSupportsBackwardScan(Plan *node) { if (node == NULL) return false; switch (nodeTag(node)) { case T_Result: if (outerPlan(node) != NULL) return ExecSupportsBackwardScan(outerPlan(node)) && TargetListSupportsBackwardScan(node->targetlist); else return false; case T_Append: { ListC...
false
false
false
false
false
0
glh_find_hash_node(GlhHashBucket *bucket, const char *line, size_t n) { GlhHashNode *node; /* A node in the list of lines in the bucket */ /* * Compare each of the lines in the list of lines, against 'line'. */ for(node=bucket->lines; node; node=node->next) { if(_glh_is_line(node, line, n)) ...
false
false
false
false
false
0
gvc_mixer_ui_device_get_active_profile (GvcMixerUIDevice* device) { GvcMixerCardProfile *profile; g_return_val_if_fail (GVC_IS_MIXER_UI_DEVICE (device), NULL); if (device->priv->card == NULL) { g_warning ("Device did not have an appropriate card"); return NULL; ...
false
false
false
false
false
0
GWEN_XML_AddNameSpace(GWEN_STRINGLIST2 *sl, const char *prefix, const char *name){ GWEN_BUFFER *nbuf; int rv; nbuf=GWEN_Buffer_new(0, 32, 0, 1); if (prefix) GWEN_Buffer_AppendString(nbuf, prefix); GWEN_Buffer_AppendByte(nbuf, ':'); GWEN_Buffer_AppendS...
false
false
false
false
false
0
__ecereMethod___ecereNameSpace__ecere__gfx3D__Camera_TransformNormal(struct __ecereNameSpace__ecere__com__Instance * this, struct __ecereNameSpace__ecere__gfx3D__Vector3D * dest, struct __ecereNameSpace__ecere__gfx3D__Vector3D * src) { struct __ecereNameSpace__ecere__gfx3D__Camera * __ecerePointer___ecereNameSpace__ece...
false
false
false
false
false
0
SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { ::google::protobuf::uint8* raw_buffer = output->GetDirectBufferForNBytesAndAdvance(_cached_size_); if (raw_buffer != NULL) { MethodOptions::SerializeWithCachedSizesToArray(raw_buffer); return; } // repeated .goog...
false
false
false
false
false
0
TestCapability( const char * pszCap ) { if (!TouchLayer()) return FALSE; if( EQUAL(pszCap,OLCRandomRead) ) return TRUE; else if( EQUAL(pszCap,OLCSequentialWrite) || EQUAL(pszCap,OLCRandomWrite) ) return bUpdateAccess; else if( EQUAL(pszCap,OLCFastFeatureCount) )...
false
false
false
false
false
0
DCC_gottelnetconnection(dccrec *serv) { int sock; u_short port; IP ip; char s[MAXHOSTLENGTH]; char uh[HOSTLEN]; dccrec *d, *id; sock = net_accept(serv->socket, s, &ip, &port, 0); if(sock == -1) { Log_write(LOG_ERROR,"*","S%d %s %s - Bad connection on server: %s", serv->socket, serv->nick, serv->uh, net_e...
false
false
false
false
false
0
palette_color_picker ( guint palette ) { g_return_if_fail( palette < NUM_PALETTES ); color_dialog( &pallete_colors[palette], _("Select Color") ); pallete_show (palette); }
false
false
false
false
false
0
getTokenIndex(const char *const tokens[], int32_t countTokens, const char *s) { const char *t, *z; int32_t i, j; s=u_skipWhitespace(s); for(i=0; i<countTokens; ++i) { t=tokens[i]; if(t!=NULL) { for(j=0;; ++j) { if(t[j]!=0) { if(s[j]!=t[j])...
false
false
false
false
false
0
find_inode_file (ino_t node_num, unsigned long major_num, unsigned long minor_num) { struct inode_val sample; struct inode_val *ival; if (!hash_table) return NULL; sample.inode = node_num; sample.major_num = major_num; sample.minor_num = minor_num; ival = hash_lookup (hash_table, &sample); ...
false
false
false
false
false
0
read_from_child (Session *session, void *buf, size_t count) { ssize_t n_read; n_read = read (session->priv->from_child_output, buf, count); if (n_read < 0) l_warning (session, "Error reading from session: %s", strerror (errno)); return n_read; }
false
true
false
false
true
1
canReassign(LiveInterval &VirtReg, unsigned PrevReg) { AllocationOrder Order(VirtReg.reg, *VRM, RegClassInfo, Matrix); unsigned PhysReg; while ((PhysReg = Order.next())) { if (PhysReg == PrevReg) continue; MCRegUnitIterator Units(PhysReg, TRI); for (; Units.isValid(); ++Units) { // Instan...
false
false
false
false
false
0
gncBillTermReturnChild (GncBillTerm *term, gboolean make_new) { GncBillTerm *child = NULL; if (!term) return NULL; if (term->child) return term->child; if (term->parent || term->invisible) return term; if (make_new) { child = gncBillTermCopy (term); gncBillTermSetChild (term, ch...
false
false
false
false
false
0
append_to_buf(int fd, char *pbuf, int *buf_bytes) { int nread = 0; if (fd >= 0) { nread = read(fd, &pbuf[*buf_bytes], BUFSIZE-1-(*buf_bytes)); if (nread < 0 && (errno == EINTR || errno == EAGAIN)) { nread = 0; } else if (nread <= 0) { nread = -1; } else { *buf_...
false
false
false
false
false
0
Stmt_tail(CTX ctx, kStmtExpr *o) { kStmtExpr *tail = o; while(DP(tail)->nextNULL != NULL) { tail = DP(tail)->nextNULL; } return tail; }
false
false
false
false
false
0
fuse_parse_cmdline(struct fuse_args *args, char **mountpoint, int *multithreaded, int *foreground) { int res; struct helper_opts hopts; memset(&hopts, 0, sizeof(hopts)); res = fuse_opt_parse(args, &hopts, fuse_helper_opts, fuse_helper_opt_proc); if (res == -1) return -1; if (!hopts.nodefault_...
false
false
false
false
false
0
create_fs_device(const char *device, const char *mntpnt, const char *type, const char *opts, int passno) { struct fs_info *fs; fs = xzalloc(sizeof(*fs)); fs->device = xstrdup(device); fs->mountpt = xstrdup(mntpnt); if (strchr(type, ',')) type = (char *)"auto"; fs->type = xstrdup(type); fs->opts = xs...
false
false
false
false
false
0
nocase_strbegins(register char const*a, register char const *with) { while (*with!='\0') if ((USGE('Z'-'A',*a-'A') ? *a+++'a'-'A' : *a++) !=(USGE('Z'-'A',*with-'A') ? *with+++'a'-'A' : *with++) ) return FALSE; return TRUE; }
false
false
false
false
false
0
AnchorPointsRemoveName(AnchorPoint *alist,AnchorClass *an) { AnchorPoint *prev=NULL, *ap, *next; for ( ap=alist; ap!=NULL; ap=next ) { next = ap->next; if ( ap->anchor == an ) { if ( prev==NULL ) alist = next; else prev->next = next; ap->next = NULL; AnchorPointsFree(ap); if ( an...
false
false
false
false
false
0
license_write_preamble(STREAM* s, uint8 bMsgType, uint8 flags, uint16 wMsgSize) { /* preamble (4 bytes) */ stream_write_uint8(s, bMsgType); /* bMsgType (1 byte) */ stream_write_uint8(s, flags); /* flags (1 byte) */ stream_write_uint16(s, wMsgSize); /* wMsgSize (2 bytes) */ }
false
false
false
false
false
0
dfb_system_core_shutdown( DFBSystemCore *data, bool emergency ) { DFBResult ret; DFBSystemCoreShared *shared; D_DEBUG_AT( Core_System, "dfb_system_core_shutdown( %p, %semergency )\n", data, emergency ? "" : "no " ); D_MAGIC_ASSERT( data, DFBSystemCore );...
false
false
false
false
false
0
of_graph_get_next_endpoint(const struct device_node *parent, struct device_node *prev) { struct device_node *endpoint; struct device_node *port; if (!parent) return NULL; /* * Start by locating the port node. If no previous endpoint is specified * search for the first port node, otherwise get the previ...
false
false
false
false
false
0
ConnectCB(int status) { ostringstream osstr; if (status != 0) { osstr << "Could not connect to Kismet server '" << host << ":" << port << "' (" + string(strerror(status)) + ") will attempt to reconnect in 5 " "seconds."; _MSG(osstr.str(), MSGFLAG_ERROR); last_disconnect = globalreg->timestamp.tv_sec; r...
false
false
false
false
false
0
scroll_failure(object *op, int failure, int power) { if (abs(failure/4) > power) power = abs(failure/4); /* set minimum effect */ if (failure <= -1 && failure > -15) {/* wonder */ object *tmp; draw_ext_info(NDI_UNIQUE, 0, op, MSG_TYPE_APPLY, MSG_TYPE_APPLY_FAILURE, ...
false
false
false
false
false
0
dump_cfg_stats (FILE *file) { static long max_num_merged_labels = 0; unsigned long size, total = 0; long num_edges; basic_block bb; const char * const fmt_str = "%-30s%-13s%12s\n"; const char * const fmt_str_1 = "%-30s%13d%11lu%c\n"; const char * const fmt_str_2 = "%-30s%13ld%11lu%c\n"; const char * c...
false
false
false
false
true
1
Project(const R2Line& line) { // Project span onto line length *= Vector().Dot(line.Vector()); if (length < 0.0) length = -length; ray.Project(line); end.Project(line); }
false
false
false
false
false
0
rnd_pos(const void *pos) { PFS_events_waits *wait; uint limit; if (events_waits_history_long_size == 0) return HA_ERR_RECORD_DELETED; set_position(pos); if (events_waits_history_long_full) limit= events_waits_history_long_size; else limit= events_waits_history_long_index % events_waits_histor...
false
false
false
false
false
0
PrintSelf(ostream& os, vtkIndent indent) { this->Superclass::PrintSelf(os, indent); if (this->MedicalImageProperties) { os << indent << "Medical Image Properties:\n"; this->MedicalImageProperties->PrintSelf(os, indent.GetNextIndent()); } else { os << indent << "MedicalImageProperties: (no...
false
false
false
false
false
0
decode_utf8(unsigned char *buf, int nbytes) { unsigned long code; int i, j; if (nbytes <= 0) return INVALID_UTF8_CHAR; if (nbytes == 1) { if (buf[0] >= 0x80) return INVALID_UTF8_CHAR; return buf[0]; } i = high_bits_set(buf[0]); if (i != nbytes) return INVALID_UTF8_CHAR; code = buf[0] & (0xff >> i)...
false
false
false
false
false
0
pcifront_try_connect(struct pcifront_device *pdev) { int err = -EFAULT; int i, num_roots, len; char str[64]; unsigned int domain, bus; /* Only connect once */ if (xenbus_read_driver_state(pdev->xdev->nodename) != XenbusStateInitialised) goto out; err = pcifront_connect_and_init_dma(pdev); if (err && e...
true
true
false
false
false
1
isConstant()const { bool res= true; int i= 1; while(res&&i<size()){ res= res&&operator[](0)==operator[](i); i++; } return res; }
false
false
false
false
false
0
symbol_dump_resolved(int level, const char *symbol) { i32 value; struct expr *e; const char *p; p = find_symref(symbol, &e); if(p == NULL) { if(e != NULL) { value = resolve_expr(e); LOG(level, ("symbol \"%s\" resolves to %d ($%04X)\n", ...
false
false
false
false
false
0
opal_crs_base_cleanup_append(char* filename, bool is_dir) { if( NULL == filename ) { return OPAL_SUCCESS; } if( is_dir ) { opal_output_verbose(15, opal_crs_base_framework.framework_output, "opal:crs: cleanup_append: Append Dir <%s>\n", ...
false
false
false
false
false
0
writespeed_old() { int i, j, a, b; thisperson *WITH; int allele_count; /* for compatibility, when loops exist, speedfile.dat does not eliminate anything */ if (loop1 != NULL || loop2 != NULL) { for (i = 1; i <= totperson; i++) { WITH = person[i]; if (WITH->unknown && WITH->foff != NULL)...
false
false
false
false
false
0
add(const std::string & first, const std::string & second) { if (MathLib::isInt(first) && MathLib::isInt(second)) { return toString<bigint>(toLongNumber(first) + toLongNumber(second)); } double d1 = toDoubleNumber(first); double d2 = toDoubleNumber(second); int count = 0; while (d1 > 1...
false
false
false
false
false
0
token_check_object(memarea_t *area, const char *kwd, directory_token_t *tok, obj_syntax o_syn) { char ebuf[128]; switch (o_syn) { case NO_OBJ: /* No object is allowed for this token. */ if (tok->object_body) { tor_snprintf(ebuf, sizeof(ebuf), "Unexpected object for %s", kw...
false
false
false
false
false
0
gnibbles_warpmanager_new (void) { int i; GnibblesWarpManager *tmp; tmp = g_new (GnibblesWarpManager, 1); for (i = 0; i < MAXWARPS; i++) tmp->warps[i] = NULL; tmp->numwarps = 0; return tmp; }
false
false
false
false
false
0
InlineSub(ModuleVarInfo *caller, Operand *pOp) { Sub_data *op_sub = NULL; Var_table *vpt = NULL; Array_table *apt = NULL; int offset; Var_table *newVpt = NULL; int tsub = 0; for(op_sub = pOp->sub[0]; tsub < pOp->nsub; tsub++, op_sub = pOp->sub[tsub]) { if(op_sub->kind == KIND_VAR) {...
false
false
false
false
false
0
zend_activate_modules(TSRMLS_D) /* {{{ */ { zend_module_entry **p = module_request_startup_handlers; while (*p) { zend_module_entry *module = *p; if (module->request_startup_func(module->type, module->module_number TSRMLS_CC)==FAILURE) { zend_error(E_WARNING, "request_startup() for %s module failed", module-...
false
false
false
false
false
0
bdc_probe(struct platform_device *pdev) { struct bdc *bdc; struct resource *res; int ret = -ENOMEM; int irq; u32 temp; struct device *dev = &pdev->dev; dev_dbg(dev, "%s()\n", __func__); bdc = devm_kzalloc(dev, sizeof(*bdc), GFP_KERNEL); if (!bdc) return -ENOMEM; res = platform_get_resource(pdev, IORESOURC...
false
false
false
false
false
0
drag_data_received_cb(GtkWidget *widget, GdkDragContext *context, gint x, gint y, GtkSelectionData *data, guint info, guint time_, gpointer user_data UNUSED) { GdkModifierType state; /* Guard against trash */ if (data->data == NULL || data-...
false
false
false
false
false
0
LUBackSubst (double **a, int n, int *indx, double *b) { int i, ip, j, ii = -1; double sum; for (i = 0; i < n; i++) { ip = indx[i]; sum = b[ip]; b[ip] = b[i]; if (ii >= 0) { for (j = ii; j <= i - 1; j++) sum -= a[i][j] * b[j]; } else if (sum != 0.0) ...
false
false
false
false
false
0
terrains_free(void) { terrain_type_iterate(pterrain) { if (NULL != pterrain->helptext) { strvec_destroy(pterrain->helptext); pterrain->helptext = NULL; } if (pterrain->resources != NULL) { /* Server allocates this on ruleset loading, client when * ruleset packet is received. */ ...
false
false
false
false
false
0
on_ssdp_message (G_GNUC_UNUSED GSSDPClient *client, G_GNUC_UNUSED const gchar *from_ip, G_GNUC_UNUSED gushort from_port, _GSSDPMessageType type, SoupMessageHeaders *headers, G_GNUC_UNUSED gpointer user_data) { ...
false
false
false
false
false
0
Ketje_GetTag(Ketje_Instance *instance, unsigned char *tag, unsigned int tagSizeInBytes) { unsigned int tagSizePart; unsigned int i; if ((instance->phase & (Ketje_Phase_Wrapping | Ketje_Phase_Unwrapping)) == 0) return 1; Ket_StateXORByte(instance->state, instance->dataRemainderSize, FRAMEBITS10); Ket_Stat...
false
false
false
false
false
0
removeConnector() { QTreeWidgetItem * item = m_connectorListWidget->currentItem(); if (item == NULL) return; int index = item->data(0, Qt::UserRole).toInt(); QDomElement element = m_connectorList->at(index); emit removedConnector(element); }
false
false
false
false
false
0
ASN1_put_object(unsigned char **pp, int constructed, int length, int tag, int xclass) { unsigned char *p= *pp; int i, ttag; i=(constructed)?V_ASN1_CONSTRUCTED:0; i|=(xclass&V_ASN1_PRIVATE); if (tag < 31) *(p++)=i|(tag&V_ASN1_PRIMITIVE_TAG); else { *(p++)=i|V_ASN1_PRIMITIVE_TAG; for(i = 0, ttag = t...
false
false
false
false
false
0
__pyx_f_7sklearn_4tree_5_tree_23ClassificationCriterion_update(struct __pyx_obj_7sklearn_4tree_5_tree_ClassificationCriterion *__pyx_v_self, int __pyx_v_a, int __pyx_v_b, __pyx_t_7sklearn_4tree_5_tree_DTYPE_t *__pyx_v_y, int *__pyx_v_X_argsorted_i, __pyx_t_7sklearn_4tree_5_tree_BOOL_t *__pyx_v_sample_mask) { int __py...
false
false
false
false
false
0
_kill_procs(void) { int killed = 0, i, rc, status; for (i=0; i<PID_CNT; i++) { if (child_pid[i] == 0) continue; rc = waitpid(child_pid[i], &status, WNOHANG); if (rc == 0) { #ifdef POWER_SAVE_KILL_PROCS error("power_save: killing process %d", child_pid[i]); kill((0-child_pid[i]), SIGKILL); #...
false
false
false
false
false
0
interval( int axis ) const { if ( axis < 0 || axis >= QwtPlot::axisCnt ) return QwtInterval(); const QwtPlot *plt = plot(); const double v1 = plt->axisScaleDiv( axis )->lowerBound(); const double v2 = plt->axisScaleDiv( axis )->upperBound(); return QwtInterval( v1, v2 ).normalized(); }
false
false
false
false
false
0
printArray(unsigned char *array, unsigned int size, char *name) { int i; printf("%s: ", name); for (i = 0; i < size; i++) { printf("%2x|", array[i]); } printf("\n"); }
false
false
false
false
false
0