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
bitmap_load(struct mddev *mddev) { int err = 0; sector_t start = 0; sector_t sector = 0; struct bitmap *bitmap = mddev->bitmap; if (!bitmap) goto out; /* Clear out old bitmap info first: Either there is none, or we * are resuming after someone else has possibly changed things, * so we should forget old c...
false
false
false
false
false
0
array_write(UNewDataMemory *mem, struct SResource *res, uint32_t usedOffset, UErrorCode *status) { uint32_t *resources = NULL; uint32_t i = 0; struct SResource *current = NULL; if (U_FAILURE(*status)) { return 0; } if (res->u.fArray.fCount > 0) { ...
false
false
false
false
false
0
lfind(unsigned char *s, int pos, FILE *fd, unsigned char *name) { int c, x; if (!s) s = vsmk(1024); loop: while (c = getc(fd), c == ' ' || c == '\t' || c == '#') do { c = getc(fd); } while (!(c == -1 || c == '\n')); if (c == -1) return s = vstrunc(s, pos); ungetc(c, fd); s = vstrunc(s, x = pos);...
false
false
false
false
false
0
setnodevector (lua_State *L, Table *t, int size) { int lsize; if (size == 0) { /* no elements to hash part? */ t->node = cast(Node *, dummynode); /* use common `dummynode' */ lsize = 0; } else { int i; lsize = ceillog2(size); if (lsize > MAXBITS) luaG_runerror(L, "table overflow"); ...
false
false
false
false
false
0
lp8788_buck_set_mode(struct regulator_dev *rdev, unsigned int mode) { struct lp8788_buck *buck = rdev_get_drvdata(rdev); enum lp8788_buck_id id = rdev_get_id(rdev); u8 mask, val; mask = BUCK_FPWM_MASK(id); switch (mode) { case REGULATOR_MODE_FAST: val = LP8788_FORCE_PWM << BUCK_FPWM_SHIFT(id); break; case R...
false
false
false
false
false
0
do_timers_per_nic_iface(nic_t *nic, nic_interface_t *nic_iface, struct timer *arp_timer) { packet_t *pkt; struct uip_stack *ustack = &nic_iface->ustack; int i; pkt = get_next_free_packet(nic); if (pkt == NULL) return -EIO; if (nic_iface->protocol == AF_INET) { for (i = 0; i < UIP_UDP_CONNS; i++) { ...
false
false
false
false
false
0
dae_xml_get_child_by_tagname(xmlNodePtr parent, const gchar *tag) { xmlNodePtr node; g_return_val_if_fail(parent != NULL, NULL); node = parent->children; while(node != NULL) { if((node->type == XML_ELEMENT_NODE) && (xmlStrcmp(node->name, (const xmlChar *)tag) == 0)) { return node; } node = node->next;...
false
false
false
false
false
0
drm_intel_bufmgr_gem_find(int fd) { drm_intel_bufmgr_gem *bufmgr_gem; DRMLISTFOREACHENTRY(bufmgr_gem, &bufmgr_list, managers) { if (bufmgr_gem->fd == fd) { atomic_inc(&bufmgr_gem->refcount); return bufmgr_gem; } } return NULL; }
false
false
false
false
false
0
omfs_count_free(struct super_block *sb) { unsigned int i; unsigned long sum = 0; struct omfs_sb_info *sbi = OMFS_SB(sb); int nbits = sb->s_blocksize * 8; for (i = 0; i < sbi->s_imap_size; i++) sum += nbits - bitmap_weight(sbi->s_imap[i], nbits); return sum; }
false
false
false
false
false
0
state_eval_encoder_ok(struct pvr2_hdw *hdw) { if (hdw->state_encoder_ok) return 0; if (hdw->flag_tripped) return 0; if (hdw->state_encoder_run) return 0; if (hdw->state_encoder_config) return 0; if (hdw->state_decoder_run) return 0; if (hdw->state_usbstream_run) return 0; if (hdw->pathway_state == PVR2_PATHWAY_D...
false
false
false
false
false
0
ipmi_sel_parse_output_inventec_sensor_name (ipmi_sel_parse_ctx_t ctx, struct ipmi_sel_parse_entry *sel_parse_entry, uint8_t sel_record_type, char *buf, unsigned int buflen, unsigned int flags, unsigned int *wlen, struct ipmi_sel_system_event_record_data *sy...
false
false
false
false
false
0
getTextureInstance(const String& name, size_t mrtIndex) { // try simple textures first LocalTextureMap::iterator i = mLocalTextures.find(name); if(i != mLocalTextures.end()) { return i->second; } // try MRTs - texture (rather than target) i = mLocalTextures.find(getMRTTexLocalName(n...
false
false
false
false
false
0
Java_org_gdal_gdal_gdalJNI_GetConfigOption_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jstring jarg1) { jstring jresult = 0 ; char *arg1 = (char *) 0 ; char *result = 0 ; (void)jenv; (void)jcls; arg1 = 0; if (jarg1) { arg1 = (char *)jenv->GetStringUTFChars(jarg1, 0); if (!arg1) return 0; } { ...
false
false
false
false
false
0
AddQueuedSession(WorldSession* sess) { sess->SetInQueue(true); m_QueuedSessions.push_back(sess); // [-ZERO] Possible wrong // The 1st SMSG_AUTH_RESPONSE needs to contain other info too. WorldPacket packet(SMSG_AUTH_RESPONSE, 1 + 4 + 1 + 4 + 4); packet << uint8(AUTH_WAIT_QUEUE); packet << ui...
false
false
false
false
false
0
HalManagerProxy(DBus::Connection &connection) : DBus::InterfaceProxy("org.freedesktop.Hal.Manager"), DBus::ObjectProxy(connection, "/org/freedesktop/Hal/Manager", "org.freedesktop.Hal") { connect_signal(HalManagerProxy, DeviceAdded, DeviceAddedCb); connect_signal(HalManagerProxy, DeviceRemoved, DeviceRemovedC...
false
false
false
false
false
0
getOpenUrl(const KUrl& startDir, const QString& filter, QWidget *parent, const QString& caption, QString *selectedFilter) { if (KFileDialogPrivate::isNative() && (!startDir.isValid() || startDir.isLocalFile())) { const QString fileName...
false
false
false
false
false
0
getLights(void) const { // N/A OGRE_DEFINE_STATIC_LOCAL(LightList, ll, ()); // static LightList ll; return ll; }
false
false
false
false
false
0
ks0127_read(struct v4l2_subdev *sd, u8 reg) { struct i2c_client *client = v4l2_get_subdevdata(sd); char val = 0; struct i2c_msg msgs[] = { { .addr = client->addr, .len = sizeof(reg), .buf = &reg }, { .addr = client->addr, .flags = I2C_M_RD | I2C_M_NO_RD_ACK, .len = sizeof(val), .buf = &val...
false
false
false
false
false
0
pass_strings(int handle, guint32 number, gint loop_pre_inc, gint post_inc) { guint16 length, i; for (i = 0; i < number; i++) { lseek(handle, loop_pre_inc, SEEK_CUR); read(handle, &length, 2); /*get the length of the string */ lseek(handle, length, SEEK_CUR); } lseek(handle, post_inc, SEEK_CUR); }
false
false
false
false
false
0
xkl_engine_get_toplevel_window_state(XklEngine * engine, Window toplevel_win, XklState * state_out) { Atom type_ret; int format_ret; unsigned long nitems, rest; CARD32 *prop = NULL; gboolean ret = FALSE; gint grp = -1; guint inds = 0; if ((XGetWindowProperty (xkl_engine_get_display(eng...
false
false
false
false
false
0
ProjectPointsToOrthoPlane() { double ctr[3]; for ( int i = 0; i < this->NumberOfHandles; ++i ) { this->HandleGeometry[i]->GetCenter(ctr); ctr[this->ProjectionNormal] = this->ProjectionPosition; this->HandleGeometry[i]->SetCenter(ctr); this->HandleGeometry[i]->Update(); } }
false
false
false
false
false
0
H5FD_stdio_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, void *buf/*out*/) { H5FD_stdio_t *file = (H5FD_stdio_t*)_file; static const char *func = "H5FD_stdio_read"; /* Function Name for error reporting */ /* Quiet the compiler */ type = type; dxpl_id = dxpl_...
false
false
false
false
false
0
port_ctr_out( libspectrum_byte val ) { int m; if( !( val & 0x02 ) && ( if1_ula.comms_clk ) ) { /* ~~\__ */ for( m = 7; m > 0; m-- ) { /* Rotate one drive */ microdrive[m].motor_on = microdrive[m - 1].motor_on; } microdrive[0].motor_on = (val & 0x01) ? 0 : 1; if( microdrive[0].motor_on...
false
false
false
false
false
0
flps_draw_text_beside( int align, int x, int y, int w, int h, FL_COLOR col, int style, int s...
false
false
false
false
false
0
generateSecStructurePixmaps() { QFontMetrics fontMetrics(displayFont); int lengthLongestSeq = alignObjPtr->getLengthLongestSequence(firstSeq,lastSeq); secStructPixmaps->clear(); secStructPixmaps->resize(lengthLongestSeq + 1); defaultGreyPixMap = QPixmap(boxWidth, boxSize); defaultGreyPixMap.fill...
false
false
false
false
false
0
igb_phy_hw_reset(struct e1000_hw *hw) { struct e1000_phy_info *phy = &hw->phy; s32 ret_val; u32 ctrl; ret_val = igb_check_reset_block(hw); if (ret_val) { ret_val = 0; goto out; } ret_val = phy->ops.acquire(hw); if (ret_val) goto out; ctrl = rd32(E1000_CTRL); wr32(E1000_CTRL, ctrl | E1000_CTRL_PHY_RS...
false
false
false
false
false
0
trim_spaces(char* buf) { char* e = buf = skip_spaces(buf); // move to the end of buffer while (*e) e++; while (e > buf && isspace((int)e[-1])) e--; *e = 0; return buf; }
false
false
false
false
false
0
update_image_transfer_state(struct gl_context *ctx) { GLuint mask = 0; if (ctx->Pixel.RedScale != 1.0F || ctx->Pixel.RedBias != 0.0F || ctx->Pixel.GreenScale != 1.0F || ctx->Pixel.GreenBias != 0.0F || ctx->Pixel.BlueScale != 1.0F || ctx->Pixel.BlueBias != 0.0F || ctx->Pixel.AlphaScale ...
false
false
false
false
false
0
ComputeScalarIndex(double val) { for (int i=0; i < (this->NumberOfClipValues-1); i++) { if ( val >= this->ClipValues[i] && val < this->ClipValues[i+1] ) { return i; } } return this->NumberOfClipValues - 1; }
false
false
false
false
false
0
__set_abort_with_changes_flags(struct dm_pool_metadata *pmd) { struct dm_thin_device *td; list_for_each_entry(td, &pmd->thin_devices, list) td->aborted_with_changes = td->changed; }
false
false
false
false
false
0
Copy () { return new Arrowhead(Vertices::x(), Vertices::y(), this); }
false
false
false
false
false
0
totem_pl_parser_cleanup_xml (char *contents) { char *needle; needle = contents; while ((needle = strstr (needle, "<!--")) != NULL) { char *end; /* Find end of comments */ end = strstr (needle, "-->"); /* Broken file? */ if (end == NULL) return; if (g_strstr_len (needle, end - needle, "]]>") != NULL)...
false
false
false
false
false
0
dquot_set_dqblk(struct super_block *sb, struct kqid qid, struct qc_dqblk *di) { struct dquot *dquot; int rc; dquot = dqget(sb, qid); if (IS_ERR(dquot)) { rc = PTR_ERR(dquot); goto out; } rc = do_set_dqblk(dquot, di); dqput(dquot); out: return rc; }
false
false
false
false
false
0
lv_raid_reshape(struct logical_volume *lv, const struct segment_type *new_segtype) { struct lv_segment *seg = first_seg(lv); if (!new_segtype) { log_error(INTERNAL_ERROR "New segtype not specified"); return 0; } if (!strcmp(seg->segtype->name, "mirror") && (!strcmp(new_segtype->name, "raid1"))) ...
false
false
false
false
false
0
read_ubyte(HMMIO rw, ubyte *i) { int rc = mmioRead( rw, (char *)i, sizeof(ubyte) ); IF_ERR(rc != sizeof(ubyte), 0); return 1; }
false
false
false
false
false
0
frame_transparency_warning(void) { static gint warned = -1; if (warned != _GK.theme_reload_count && _GK.command_line_theme) fprintf(stderr, "Warning: frame overlap transparency may not work. If any of the frame,\n" " chart, panel, spacer, or cap images have transparency, then all\n" " may n...
false
false
false
false
false
0
getMwmHints() { if (!prop.mwm_hints) return; int retFormat; Atom retType; unsigned long retCount, remain; if (fMwmHints) { XFree(fMwmHints); fMwmHints = 0; } union { MwmHints *ptr; unsigned char *xptr; } mwmHints = { 0 }; if (XGetWindowPrope...
false
false
false
false
false
0
ifconfig_pool_free (struct ifconfig_pool *pool) { if (pool) { int i; for (i = 0; i < pool->size; ++i) ifconfig_pool_entry_free (&pool->list[i], true); free (pool->list); free (pool); } }
false
false
false
false
false
0
ReadScanline(ILubyte *scanline, ILuint w) { ILubyte *runner; ILuint r, g, b, e, read, shift; r = igetc(); g = igetc(); b = igetc(); e = igetc(); //check if the scanline is in the new format //if so, e, r, g, g are stored separated and are //rle-compressed independently. if (r == 2 && g == 2) { ILuint leng...
false
true
false
false
true
1
sizeHint(Qt::SizeHint which, const QSizeF & constraint) const { QSizeF hint = QGraphicsWidget::sizeHint(which, constraint); if (d->orientation == Qt::Horizontal) { hint.setHeight(d->svg->elementSize("horizontal-line").height()); } else { hint.setWidth(d->svg->elementSize("vertical-line").wi...
false
false
false
false
false
0
_ReadByte(ArchiveHandle *AH) { lclContext *ctx = (lclContext *) AH->formatData; int res; res = getc(AH->FH); if (res == EOF) die_horribly(AH, modulename, "unexpected end of file\n"); ctx->filePos += 1; return res; }
false
false
false
false
false
0
handle_expose(event_t *ev) { PROF_INIT(handle_expose); D_EVENTS(("handle_expose(ev [%8p] on window 0x%08x)\n", ev, ev->xany.window)); REQUIRE_RVAL(XEVENT_IS_MYWIN(ev, &primary_data), 0); if (ev->xany.window == TermWin.vt #ifdef PIXMAP_SUPPORT && buffer_pixmap == None #endif ) { ...
false
false
false
false
false
0
NP_Initialize(NPNetscapeFuncs* aNPNFuncs, NPPluginFuncs* aNPPFuncs) { NPError rv = fillNetscapeFunctionTable(aNPNFuncs); if(rv != NPERR_NO_ERROR) { return rv; } rv = fillPluginFunctionTable(aNPPFuncs); if(rv != NPERR_NO_ERROR) { return rv; } return NS_PluginInitiali...
false
false
false
false
false
0
mdc_slave_config(struct dma_chan *chan, struct dma_slave_config *config) { struct mdc_chan *mchan = to_mdc_chan(chan); unsigned long flags; spin_lock_irqsave(&mchan->vc.lock, flags); mchan->config = *config; spin_unlock_irqrestore(&mchan->vc.lock, flags); return 0; }
false
false
false
false
false
0
cm_actor(int actnum,int actor) /* cmd: actnum, player entry: actor */ { if (aver<AGX00) return 1; /* Bit of AGT brain-deadness. */ if (actnum==1) return actor==0; /* No actor: just the player */ if (tcreat(actnum)) return (creat_fix[actor-first_creat]==creat_fix[actnum-first_creat]); if (actnum==2) ...
false
false
false
false
false
0
bindProgramParameters(GpuProgramParametersSharedPtr params, uint16 mask) { // only supports float constants GpuLogicalBufferStructPtr floatStruct = params->getFloatLogicalBufferStruct(); for (GpuLogicalIndexUseMap::const_iterator i = floatStruct->map.begin(); i != floatStruct->map.end(); ++i) {...
false
false
false
false
false
0
New(const char* file_name) { /* opens the binary file for writing with motorola byte order */ handle = imBinFileNew(file_name); if (!handle) return IM_ERR_OPEN; imBinFileByteOrder(handle, IM_BIGENDIAN); this->starttab = NULL; this->lengthtab = NULL; this->image_count = 1; return IM_ERR_NONE; }
false
false
false
false
false
0
Close() { close(ServerFd); ServerFd = -1; close(DataFd); DataFd = -1; close(DataListenFd); DataListenFd = -1; if (PasvAddr != 0) freeaddrinfo(PasvAddr); PasvAddr = 0; }
false
false
false
false
false
0
gdata_calendar_query_set_recurrence_expansion_start (GDataCalendarQuery *self, gint64 start) { g_return_if_fail (GDATA_IS_CALENDAR_QUERY (self)); g_return_if_fail (start >= -1); self->priv->recurrence_expansion_start = start; g_object_notify (G_OBJECT (self), "recurrence-expansion-start"); /* Our current ETag wi...
false
false
false
false
false
0
displayPages(OutputDev *out, int firstPage, int lastPage, double hDPI, double vDPI, int rotate, GBool useMediaBox, GBool crop, GBool printing, GBool (*abortCheckCbk)(void *data), void *abortCheckCbkData, GBool (*annotDisplayDecideCbk)(Annot *annot, void *user_data), ...
false
false
false
false
false
0
parse_tcp (packetinfo *pi) { update_asset(pi); if (TCP_ISFLAGSET(pi->tcph, (TF_SYN))) { if (!TCP_ISFLAGSET(pi->tcph, (TF_ACK))) { if (IS_COSET(&config,CO_SYN)) { vlog(0x3, "[*] - Got a SYN from a CLIENT: dst_port:%d\n",ntohs(pi->tcph->dst_port)); fp_tcp(pi, C...
false
false
false
false
false
0
list_op(char *arg, char * cp) { int cnt; *cp = '\0'; for (cnt = 0; cnt < sizeof(aolist) / sizeof(struct argop); cnt++) { struct argop *aop = &aolist[cnt]; unsigned long res; if (ncstrcmp(aop->name, arg) == 0) { *cp++ = '='; switch (aop->typ) { case AO_BOOL: switch (*cp) { case...
false
false
false
false
false
0
slotWriteActivity() { if (d->output && !d->output->isEmpty() && (state() == Connected || state() == Closing)) { mutex()->lock(); qint64 len = d->output->sendTo(socketDevice()); if (len == -1) { if (socketDevice()->error() != WouldBlock) { // nope, another error! cop...
false
false
false
false
false
0
nerr_passf (const char *func, const char *file, int lineno, NEOERR *err) { NEOERR *nerr; if (err == STATUS_OK) return err; nerr = _err_alloc(); if (nerr == INTERNAL_ERR) return err; nerr->error = NERR_PASS; nerr->func = func; nerr->file = file; nerr->lineno = lineno; nerr->next = err; re...
false
false
false
false
false
0
w5100_get_regs(struct net_device *ndev, struct ethtool_regs *regs, void *_buf) { struct w5100_priv *priv = netdev_priv(ndev); u8 *buf = _buf; u16 i; regs->version = 1; for (i = 0; i < W5100_COMMON_REGS_LEN; i++) *buf++ = w5100_read(priv, W5100_COMMON_REGS + i); for (i = 0; i < W5100_S0_REGS_LEN; i++) *...
false
false
false
false
false
0
NormalizeLangValue ( XMP_VarString * value ) { char * tagStart; char * tagEnd; // Find and process the primary subtag. tagStart = (char*) value->c_str(); for ( tagEnd = tagStart; (*tagEnd != 0) && (*tagEnd != '-'); ++tagEnd ) { if ( ('A' <= *tagEnd) && (*tagEnd <= 'Z') ) *tagEnd += 0x20; } // Find and pro...
false
false
false
false
false
0
sk_addrtype(SockAddr addr) { SockAddrStep step; int family; START_STEP(addr, step); family = SOCKADDR_FAMILY(addr, step); return (family == AF_INET ? ADDRTYPE_IPV4 : #ifndef NO_IPV6 family == AF_INET6 ? ADDRTYPE_IPV6 : #endif ADDRTYPE_NAME); }
false
false
false
false
false
0
init_misc(const char *title, const char *text, GCallback callback) { _dialog_result = GTK_RESPONSE_NONE; _window = get_widget("dialog_window"); if (_delete_handler_id != 0) { g_signal_handler_disconnect(_window, _delete_handler_id); } _delete_handler_id = g_signal_connect(_window, "delete_event", callb...
false
false
false
false
false
0
_nc_first_ext_name(TERMTYPE *tp, int token_type) { int first; switch (token_type) { case BOOLEAN: first = 0; break; case NUMBER: first = tp->ext_Booleans; break; case STRING: first = tp->ext_Booleans + tp->ext_Numbers; break; default: first = 0; break; } return first; }
false
false
false
false
false
0
ray_set_freq(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { ray_dev_t *local = netdev_priv(dev); int err = -EINPROGRESS; /* Call commit handler */ /* Reject if card is already initialised */ if (local->card_status != CARD_AWAITING_PARAM) return -EBUSY; /* Settin...
false
false
false
false
false
0
operator/(Real s, Random& rv) { ReciprocalRandom* r = new ReciprocalRandom(rv, s); if (!r) ErrorNoSpace(); return *r; }
false
false
false
false
false
0
finalize_big(void *cc, unsigned ub, unsigned n, void *dst, size_t dst_len) { sph_simd_big_context *sc; unsigned char *d; size_t u; sc = cc; if (sc->ptr > 0 || n > 0) { memset(sc->buf + sc->ptr, 0, (sizeof sc->buf) - sc->ptr); sc->buf[sc->ptr] = ub & (0xFF << (8 - n)); compress_big(sc, 0); } memset(sc->...
false
false
false
false
false
0
kwv_expand(Kwv *kwv) { int i, n; Kwv_pair **new_pairs; if (kwv == NULL) return(-1); VALIDATE(kwv, "before expand"); n = kwv->nalloc * 2; new_pairs = (Kwv_pair **) realloc(kwv->pairs, sizeof(Kwv_pair *) * n); if (new_pairs == NULL) { kwv->error_msg = "realloc failed"; return(-1); } kwv->pairs = n...
false
false
false
false
true
1
doNoop() { if(d->state == Active) { #ifdef XMPP_DEBUG qDebug("doPing\n"); #endif d->client.sendWhitespace(); processNext(); } }
false
false
false
false
false
0
ndmp_enum_from_str (int *valp, char *str, struct ndmp_enum_str_table *table) { for (; table->name; table++) { if (strcmp(table->name, str) == 0) { *valp = table->value; return 1; } } return 0; }
false
false
false
false
false
0
orderly_poweroff(bool force) { if (force) /* do not override the pending "true" */ poweroff_force = true; schedule_work(&poweroff_work); }
false
false
false
false
false
0
dewarpaUseBothArrays(L_DEWARPA *dewa, l_int32 useboth) { PROCNAME("dewarpaUseBothArrays"); if (!dewa) return ERROR_INT("dewa not defined", procName, 1); dewa->useboth = useboth; dewa->modelsready = 0; /* force validation */ return 0; }
false
false
false
false
false
0
gog_object_get_graph (GogObject const *obj) { g_return_val_if_fail (GOG_IS_OBJECT (obj), NULL); for (; obj != NULL ; obj = obj->parent) if (GOG_IS_GRAPH (obj)) return GOG_GRAPH (obj); return NULL; }
false
false
false
false
false
0
computeBWT(const void *T, sais_index_type *SA, sais_index_type *C, sais_index_type *B, sais_index_type n, sais_index_type k, int cs) { sais_index_type *b, i, j, pidx = -1; sais_index_type c0, c1; /* compute SAl */ if(C == B) { getCounts(T, C, n, k, cs); } getBuckets(C, B, k, 0); /* find ...
false
false
false
false
false
0
_eina_rbtree_iterator_build(const Eina_Rbtree *root, unsigned char mask) { Eina_Iterator_Rbtree_List *first; Eina_Iterator_Rbtree *it; eina_error_set(0); it = calloc(1, sizeof (Eina_Iterator_Rbtree)); if (!it) { eina_error_set(EINA_ERROR_OUT_OF_MEMORY); return NULL; } it->s...
false
false
false
false
false
0
slapi_sdn_isgrandparent( const Slapi_DN *parent, const Slapi_DN *child ) { Slapi_DN child_grandparent; slapi_sdn_get_ndn( child ); slapi_sdn_init( &child_grandparent ); dnParent( (struct berval *)&child->ndn, &child_grandparent.ndn ); if ( child_grandparent.ndn.bv_len == 0 ) { return 0; } dnParent( &child_g...
false
false
false
false
false
0
hts_isStringIDNA(const char *s, size_t size) { size_t i, startSeg; for(i = startSeg = 0 ; i <= size ; i++) { const unsigned char c = i < size ? s[i] : 0; if (c == 0 || c == '.' || c == ':' || c == '/' || c == '?') { const size_t segSize = i - startSeg; /* IDNA segment ? */ if (segSize > 4 ...
false
false
false
false
false
0
parse_emi_to_iso88591(char *from, char *to, int length, int alt_charset) { int hmtg = 0; unsigned int mychar; char tmpbuff[128]; for (hmtg = 0; hmtg <= (int)strlen(from); hmtg += 2) { strncpy(tmpbuff, from + hmtg, 2); sscanf(tmpbuff, "%x", &mychar); ...
true
true
false
false
false
1
vfs_parseList( /* RETURN: None */ TOPO_MAP *map, /* OUT: bit map */ char *input) /* IN: list text */ { char *term, c; int bounds[2], n; cfg_bitClear(map); for(term = strtok(input, ",");term != NULL;term = strtok(NULL, ",")) { n = bo...
false
false
false
false
false
0
grow_width(GObject *obj, GtkRequisition *req) { guint width = GPOINTER_TO_UINT(g_object_get_data(obj, "req-width")); if (width > req->width) gtk_widget_set_size_request(GTK_WIDGET(obj), width, -1); else if (width < req->width) g_object_set_data(obj, "req-width", GUINT_TO_POINTER(req->width))...
false
false
false
false
false
0
DefineView(ViewStmt *stmt, const char *queryString) { Query *viewParse; Oid viewOid; Oid namespaceId; RangeVar *view; /* * Run parse analysis to convert the raw parse tree to a Query. Note this * also acquires sufficient locks on the source table(s). * * Since parse analysis scribbles on its inp...
false
false
false
false
false
0
CopyStuff( Workspace const &rhs ) { while ( !codes_.empty() ) { delete codes_.back(); codes_.pop_back(); } std::deque<ExprCodes*>::const_iterator rhsEnd( rhs.codes_.end() ); for( std::deque<ExprCodes*>::const_iterator i(rhs.codes_.begin()); i!=rhsEnd; ++i ) { ExprCodes *e = new ExprCodes( **i );...
false
false
false
false
false
0
add_line_record(ulong linenum, ulong code_addr) { /* make sure we have enough space */ if (lines_cnt_ >= lines_alo_) { /* expand the line records array */ alloc_line_records(lines_alo_ + 1024); /* if that didn't create enough space, ignore the new record */ if (line...
false
false
false
false
false
0
gdb_util_parse_error_line (const gchar * line, gchar ** filename, guint *lineno) { gint i = 0; gint j = 0; gint k = 0; gchar *dummy; while (line[i++] != ':') { if (i >= strlen (line) || i >= 512 || line[i - 1] == ' ') { goto down; } } if (isdigit (line[i])) { j = i; while (isdigit (line[i++])) ; ...
false
false
false
false
false
0
test_config_multivar__add(void) { git_config *cfg; int n; cl_git_pass(git_config_open_ondisk(&cfg, "config/config11")); cl_git_pass(git_config_set_multivar(cfg, _name, "nonexistant", "git://git.otherplace.org/libgit2")); n = 0; cl_git_pass(git_config_get_multivar(cfg, _name, NULL, cb, &n)); cl_assert(n == 3); ...
false
false
false
false
false
0
oc_dec_headerin(oc_pack_buf *_opb,th_info *_info, th_comment *_tc,th_setup_info **_setup,ogg_packet *_op){ char buffer[6]; long val; int packtype; int ret; val=oc_pack_read(_opb,8); packtype=(int)val; /*If we're at a data packet and we have received all three headers, we're done.*/ if(!(packtype...
false
false
false
false
false
0
init_PCI(int boards_found) { struct pci_dev *dev = NULL; int count = 0; /* Work through the PCI device list, pulling out ours */ while ((dev = pci_get_device(PCI_VENDOR_ID_RP, PCI_ANY_ID, dev))) { if (register_PCI(count + boards_found, dev)) count++; } return (count); }
false
false
false
false
false
0
save( const string& fname) const { ofstream of (fname, ios_base::trunc); if ( not of.good() ) return CHypnogram::TError::nofile; of << _pagesize << endl; for ( size_t p = 0; p < _pages.size(); ++p ) of << operator[](p).NREM << '\t' << operator[](p).REM <<...
false
false
false
false
false
0
bridges(ConvexHull a, ConvexHull b) { map<int, int> abridges; map<int, int> bbridges; for(unsigned ia = 0; ia < a.boundary.size(); ia++) { for(unsigned ib = 0; ib < b.boundary.size(); ib++) { Point d = b[ib] - a[ia]; Geom::Coord e = cross(d, a[ia - 1] - a[ia]), f = cross(d, ...
false
false
false
false
false
0
main() { setlocale(LC_ALL, ""); HttpsMethod Mth; curl_global_init(CURL_GLOBAL_SSL) ; return Mth.Run(); }
false
false
false
false
false
0
menu_redraw_transparent_tear_off_menu(FvwmWindow *fw, Bool pr_only) { MenuRoot *mr; MenuStyle *ms = NULL; int cs; if (!(IS_TEAR_OFF_MENU(fw) && XFindContext(dpy, FW_W(fw), MenuContext,(caddr_t *)&mr) != XCNOENT && (ms = MR_STYLE(mr)) && ST_HAS_MENU_CSET(ms))) { return False; } cs ...
false
false
false
false
false
0
ET_Display_File_And_List_Status_To_UI (ET_File *ETFile) { GFile *file; gchar *text; gchar *cur_filename; GFileInfo *info; GError *error = NULL; g_return_if_fail (ETFile != NULL); cur_filename = ((File_Name *)((GList *)ETFile->FileNameCur)->data)->value; file = g_file_new_for_path (cur...
false
false
false
false
false
0
log_timming (GGTimingInfo *info) { //unsigned long stw_time, unsigned long bridge_time, gboolean is_overflow int num_major_sections = major_collector.get_num_major_sections (); char full_timing_buff [1024]; full_timing_buff [0] = '\0'; if (!info->is_overflow) sprintf (full_timing_buff, "total %.2fms, bri...
true
true
false
false
false
1
VisitCompareOperation(CompareOperation* node) { if (node->type()->IsKnown()) { // Propagate useful information down towards the leaves. node->left()->type()->SetAsLikelySmiIfUnknown(); node->right()->type()->SetAsLikelySmiIfUnknown(); } node->left()->set_no_negative_zero(true); // Only [[HasInstanc...
false
false
false
false
false
0
json_write_char(OutputStream * out, char ch) { unsigned n = ch & 0xff; if (n < ' ') { write_stream(out, '\\'); write_stream(out, 'u'); write_stream(out, '0'); write_stream(out, '0'); write_stream(out, hex_digit(n >> 4)); write_stream(out, hex_digit(n)); } ...
false
false
false
false
false
0
nv_findpar(cap) cmdarg_T *cap; { cap->oap->motion_type = MCHAR; cap->oap->inclusive = FALSE; cap->oap->use_reg_one = TRUE; curwin->w_set_curswant = TRUE; if (!findpar(&cap->oap->inclusive, cap->arg, cap->count1, NUL, FALSE)) clearopbeep(cap->oap); else { #ifdef FEAT_VIRTUALEDIT curwin-...
false
false
false
false
false
0
usesTextureCache(const MachineInstr *MI) const { const MachineFunction *MF = MI->getParent()->getParent(); const R600MachineFunctionInfo *MFI = MF->getInfo<R600MachineFunctionInfo>(); return (MFI->getShaderType() == ShaderType::COMPUTE && usesVertexCache(MI->getOpcode())) || usesTextureCache(MI->get...
false
false
false
false
false
0
editConnection() { if (m_pConnectionsModel->isWriteable()) { const QModelIndex index = m_Widget.m_pConnections->currentIndex(); if (index.row() >= 0) { const QString strName = m_pConnectionsModel->data(index, Qt::DisplayRole).toString(); ConnectionSettingsDialog settings(strN...
false
false
false
false
false
0
grab_data (void *container, gchar *data, content_type ct) { gint offset; gint data_size; offset = DMAP_CC_SZ; memcpy (&data_size, data + offset, DMAP_INT_SZ); endian_swap_int32 ((gint32 *)&data_size); offset += DMAP_INT_SZ; switch (ct) { case DMAP_CTYPE_BYTE: case DMAP_CTYPE_UNSIGNEDBYTE: memcpy (contai...
false
true
false
false
false
1
Pgq() const { assert(abs(parton->id()) < 6); if ( z < x ) return 0.0; return 0.5 * ( sqr(z) + sqr(1.-z) ) * PDFxByz(getParticleData(ParticleID::g)) / z; }
false
false
false
false
false
0
proc_projid_map_write(struct file *file, const char __user *buf, size_t size, loff_t *ppos) { struct seq_file *seq = file->private_data; struct user_namespace *ns = seq->private; struct user_namespace *seq_ns = seq_user_ns(seq); if (!ns->parent) return -EPERM; if ((seq_ns != ns) && (seq_ns != ns->pare...
false
false
false
false
false
0
cheese_preferences_dialog_finalize (GObject* obj) { CheesePreferencesDialog * self; self = G_TYPE_CHECK_INSTANCE_CAST (obj, CHEESE_TYPE_PREFERENCES_DIALOG, CheesePreferencesDialog); _g_object_unref0 (self->priv->camera); _g_object_unref0 (self->priv->settings); _g_object_unref0 (self->priv->dialog); _g_object_unr...
false
false
false
false
false
0
parseVhdlFile (tokenInfo * const token) { do { readToken (token); parseKeywords (token, FALSE); } while (!isKeyword (token, KEYWORD_END)); }
false
false
false
false
false
0
load_module(void) { if (!ast_module_check("res_curl.so")) { if (ast_load_resource("res_curl.so") != AST_MODULE_LOAD_SUCCESS) { ast_log(LOG_ERROR, "Cannot load res_curl, so res_config_curl cannot be loaded\n"); return AST_MODULE_LOAD_DECLINE; } } if (!ast_module_check("func_curl.so")) { if (ast_load_reso...
false
false
false
false
false
0
__of_changeset_entry_invert(struct of_changeset_entry *ce, struct of_changeset_entry *rce) { memcpy(rce, ce, sizeof(*rce)); switch (ce->action) { case OF_RECONFIG_ATTACH_NODE: rce->action = OF_RECONFIG_DETACH_NODE; break; case OF_RECONFIG_DETACH_NODE: rce->action = OF_RECONFIG_ATTACH_NODE; break; c...
false
false
false
false
false
0