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
cb_dialog_doc_metadata_ppt_changed (G_GNUC_UNUSED GtkEntry *entry, G_GNUC_UNUSED GdkEventFocus *event, DialogDocMetaData *state) { const gchar *name; const gchar *value; gchar *name_trimmed; gboolean enable = FALSE; gchar *str = NULL; GsfDocProp *prop = NULL; GtkTreeIter iter; name...
false
false
false
false
false
0
af9005_pid_filter(struct dvb_usb_adapter *adap, int index, u16 pid, int onoff) { u8 cmd = index & 0x1f; int ret; deb_info("set pid filter, index %d, pid %x, onoff %d\n", index, pid, onoff); if (onoff) { /* cannot use it as pid_filter_ctrl since it has to be done before setting the first pid */ i...
false
false
false
false
false
0
data(const QModelIndex& index, int role) const { Q_D(const KCheckableProxyModel); if (role == Qt::CheckStateRole) { if (index.column() != 0) return QVariant(); if (!d->m_itemSelectionModel) return Qt::Unchecked; return d->m_itemSelectionModel->selection().contains(mapToSource(index)) ? Q...
false
false
false
false
false
0
of_unittest_destroy_tracked_overlays(void) { int id, ret, defers; if (overlay_first_id < 0) return; /* try until no defers */ do { defers = 0; /* remove in reverse order */ for (id = MAX_UNITTEST_OVERLAYS - 1; id >= 0; id--) { if (!(overlay_id_bits[BIT_WORD(id)] & BIT_MASK(id))) continue; ret =...
false
false
false
false
false
0
getWindowIDFromCache(char *tag) { Private p = NULL; char *tmp, *p_data; p = (Private)DXGetCacheEntry(tag, 0, 0); if (! p) return NULL; p_data = (char *)DXGetPrivateData(p); tmp = (char *)DXAllocate(strlen(p_data) + 1); if (! tmp) goto error; strcpy(tmp, p_data); DXDele...
false
false
false
false
false
0
JimInfoReferences(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { Jim_Obj *listObjPtr; Jim_HashTableIterator htiter; Jim_HashEntry *he; listObjPtr = Jim_NewListObj(interp, NULL, 0); JimInitHashTableIterator(&interp->references, &htiter); while ((he = Jim_NextHashEntry(&htiter)) != NULL) ...
true
true
false
false
false
1
hdp_update_sdp_record(struct hdp_adapter *adapter, GSList *app_list) { sdp_record_t *sdp_record; bdaddr_t addr; if (adapter->sdp_handler > 0) remove_record_from_server(adapter->sdp_handler); if (app_list == NULL) { adapter->sdp_handler = 0; return TRUE; } sdp_record = sdp_record_alloc(); if (sdp_record ...
false
false
false
false
false
0
legalKeyType(const TypePtr& type) { BuiltinPtr bp = BuiltinPtr::dynamicCast(type); if(bp) { switch(bp->kind()) { case Builtin::KindByte: case Builtin::KindBool: case Builtin::KindShort: case Builtin::KindInt: case Builtin::KindLong:...
false
false
false
false
false
0
ParseSourceElements(int end_token, bool* ok) { // SourceElements :: // (Statement)* <end_token> while (peek() != end_token) { ParseStatement(CHECK_OK); } return kUnknownSourceElements; }
false
false
false
false
false
0
main(int argc,char *argv[]) { char *name = NULL; char *src,*dest; int c,ret; int oflag = NXT_OWLINE; while ((c = getopt(argc,argv,":hmfn:"))!=-1) { switch(c) { case 'h': usage(argv[0],0); break; case 'n': name = strdup(optarg); break; case ':': fp...
false
false
false
false
false
0
handle_file_events(GVJ_t *job, int inotify_fd) { int avail, ret, len, ln, rc = 0; static char *buf; char *bf, *p; struct inotify_event *event; ret = ioctl(inotify_fd, FIONREAD, &avail); if (ret < 0) { fprintf(stderr,"ioctl() failed\n"); return -1;; } if (avail) { buf = reallo...
false
false
false
false
false
0
dosageModel(const QModelIndex &drugIndex) { if (!drugIndex.isValid()) return 0; if (drugIndex.column() != Constants::Drug::DrugId) return 0; return dosageModel(drugIndex.data()); }
false
false
false
false
false
0
setCurrentSegment(FXint index,FXbool notify){ if(index<-1 || nsegs<=index){ fxerror("%s::setCurrentSegment: index out of range.\n",getClassName()); } if(index!=current){ current=index; if(notify && target){target->tryHandle(this,FXSEL(SEL_CHANGED,message),(void*)(FXival)current);} } }
false
false
false
false
false
0
iwl_within_ct_kill_margin(struct iwl_priv *priv) { s32 temp = priv->temperature; /* degrees CELSIUS except specified */ bool within_margin = false; if (!priv->thermal_throttle.advanced_tt) within_margin = ((temp + IWL_TT_CT_KILL_MARGIN) >= CT_KILL_THRESHOLD_LEGACY) ? true : false; else within_margin = ((te...
false
false
false
false
false
0
gx_final_CIEABC(const gs_color_space * pcs) { gs_color_space *pcs_noconst = (gs_color_space *)pcs; if (pcs->icc_equivalent != NULL) { rc_decrement(pcs_noconst->icc_equivalent,"gx_final_CIEABC"); } if (pcs->cmm_icc_profile_data != NULL) { rc_decrement(pcs_noconst->cmm_icc_profile_data, "...
false
false
false
false
false
0
percent_sorted(void) { /* * C-client's sort routine exports two types of status * indicators. One's the progress thru loading the cache (typically * the elephantine bulk of the delay, and the progress thru the * actual sort (typically qsort). Our job is to balance the two */ retu...
false
false
false
false
false
0
rightRelOffset(int y, int fixedOffset, bool applyTextIndent, int *heightRemaining, bool *canClearLine ) const { int right = fixedOffset; if (canClearLine) *canClearLine = true; if (m_floatingObjects) { if (heightRemaining) *heightRemaining = 1; FloatingObject* r; QListIterator<Float...
false
false
false
false
false
0
getWidthForHeight(FXint givenheight){ register FXint space,total,galh,galw,any,w,h; register FXWindow *child; register FXuint hints; total=galh=galw=any=0; space=givenheight-padtop-padbottom-(border<<1); for(child=getFirst(); child; child=child->getNext()){ if(child->shown()){ hints=child->getLayo...
false
false
false
false
false
0
_gcry_rngcsprng_update_seed_file (void) { unsigned long *sp, *dp; int fd, i; /* We do only a basic initialization so that we can lock the pool. This is required to cope with the case that this function is called by some cleanup code at a point where the RNG has never been initialized. */ initia...
false
false
false
false
true
1
show_pwm_sensor(struct device *dev, struct device_attribute *devattr, char *buf) { struct sensor_device_attribute_2 *attr = to_sensor_dev_attr_2(devattr); struct abituguru_data *data = dev_get_drvdata(dev); int i; /* * We need to walk to the temp sensor addresses to find what * the userspace id of the configur...
false
false
false
false
false
0
check_tcl_joinspltrejn(char *nick, char *uhost, struct userrec *u, char *chname, p_tcl_bind_list table) { struct flag_record fr = { FR_GLOBAL | FR_CHAN, 0, 0, 0, 0, 0 }; char args[1024]; simple_sprintf(args, "%s %s!%s", chname, nick, uhost); get_user_flagrec(u, &fr, chname); ...
true
true
false
false
false
1
field_length(DB_RESULT result, int field) { MYSQL_FIELD *f = mysql_fetch_field_direct((MYSQL_RES *)result, field); GB_TYPE type = conv_type(f->type, f->length); if (type != GB_T_STRING) return 0; else return f->length; }
false
false
false
false
false
0
likereg(coef, lk0, f1, Z) double *coef, *lk0, *f1, *Z; { INT i, ii, j, p, *mi; double lk, ww, link[LLEN], *X; lf_status = LF_OK; lk = 0.0; p = lf_des->p; mi = lf_lf->mi; setzero(Z,p*p); setzero(f1,p); for (i=0; i<lf_des->n; i++) { ii = lf_des->ind[i]; X = d_xi(lf_des,i); ...
false
false
false
false
false
0
crut_pipes_fork(struct crut_pipes *pipes) { int fds1[2], fds2[2]; int retval; pipes->parent = getpid(); CRUT_DEBUG("Creating pipes."); retval = pipe(fds1); if (retval < 0) { CRUT_FAIL("Error initializing pipes."); goto out; } retval = pipe(fds2); if (retval < 0) { CRUT_FAIL("Err...
false
false
false
false
false
0
sgmlExtensionHtmlInitialize(SGML_PARSER *parser, void *userContext) { SGML_EXTENSION_HTML *ext = (SGML_EXTENSION_HTML *)userContext; if (ext->document) domDocumentDestroy(ext->document); ext->currElement = NULL; ext->document = domDocumentNew(); ext->skipNextAttribute = 0; }
false
false
false
false
false
0
getElementLoop(int layer, int index) { if (!checkLayerIndex(layer)) return NULL; if (index >= nofElementLoops[layer]) return NULL; int bel_id = getElementLoopId(layer, index); return model->getBodyElementLoopById(bel_id); }
false
false
false
false
false
0
expand_vector_operation (gimple_stmt_iterator *gsi, tree type, tree compute_type, gimple assign, enum tree_code code) { enum machine_mode compute_mode = TYPE_MODE (compute_type); /* If the compute mode is not a vector mode (hence we are not decomposing a BLKmode vector to smaller, hardware-supported vecto...
false
false
false
false
false
0
gtk_meta_size_allocate (GtkWidget *widget, GtkAllocation *allocation) { GtkMeta *meta; static short count = 1; g_return_if_fail (widget != NULL); g_return_if_fail (GTK_IS_META (widget)); g_return_if_fail (allocation != NULL); widget->allocation = *allocation; if (GTK_WIDGET_REALIZED(widget)) { int newsize...
false
false
false
false
false
0
nautilus_floating_bar_set_primary_label (NautilusFloatingBar *self, const gchar *label) { if (g_strcmp0 (self->priv->primary_label, label) != 0) { g_free (self->priv->primary_label); self->priv->primary_label = g_strdup (label); g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_PRIMARY_LABEL]); ...
false
false
false
false
false
0
tdb_traverse_read(struct tdb_context *tdb, tdb_traverse_func fn, void *private_data) { struct tdb_traverse_lock tl = { NULL, 0, 0, F_RDLCK }; int ret; /* we need to get a read lock on the transaction lock here to cope with the lock ordering semantics of solaris10 */ if (tdb_transaction_lock(tdb, F_RDL...
false
false
false
false
false
0
topmostMouseEntity(boost::int32_t x, boost::int32_t y) { if (!visible()) return 0; // point is in parent's space, we need to convert it in world space point wp(x, y); DisplayObject* p = parent(); if (p) { // WARNING: if we have NO parent, our parent is the Stage (movie_root) // ...
false
false
false
false
false
0
initDragCurve(QPointF scenePos) { if (m_bezier == NULL) { m_bezier = new Bezier(); } UndoBezier.copy(m_bezier); m_dragCurve = true; m_dragEnd = false; QPointF p0 = connector0()->sceneAdjustedTerminalPoint(NULL); QPointF p1 = connector1()->sceneAdjustedTerminalPoint(NULL); if (m_bezier->isEmpty()) { m_bez...
false
false
false
false
false
0
mo_kline(struct Client *client_p, struct Client *source_p, int parc, char **parv) { char *reason = NULL; char *oper_reason; char *user = NULL; char *host = NULL; const char *current_date; char *target_server = NULL; struct ConfItem *conf; struct AccessItem *aconf; time_t tkline_time = 0; ti...
false
false
false
false
false
0
getRGBLine(Guchar *in, unsigned int *out, int length) { Guchar *p; int i; for (i = 0, p = in; i < length; i++, p += 3) out[i] = (p[0] << 16) | (p[1] << 8) | (p[2] << 0); }
false
false
false
false
false
0
File_splitpath(char *pSrcFileName, char *pDir, char *pName, char *pExt) { char *ptr1, *ptr2; /* Build pathname: */ ptr1 = strrchr(pSrcFileName, '/'); if( ptr1 ) { strcpy(pDir, pSrcFileName); strcpy(pName, ptr1+1); pDir[ptr1-pSrcFileName+1] = 0; } else { strcpy(pDir, ""); strcpy(pNam...
false
false
false
false
false
0
rng_poisson( const double mu ) const { if ( mu >= 25.0 ) { double v = rng_gaussian( mu, sqrt( mu ) ); return ( v < 0.0 ) ? 0 : (quint32)v; } const double emu = exp( -mu ); double prod = 1.0; quint32 k = 0; do { prod *= rng_uniform(); k++; } while ( prod ...
false
false
false
false
false
0
add_object_to_tracks (GESTimeline * timeline, GESTimelineObject * object) { GList *tmp; for (tmp = timeline->priv->tracks; tmp; tmp = g_list_next (tmp)) { TrackPrivate *tr_priv = (TrackPrivate *) tmp->data; GESTrack *track = tr_priv->track; GST_LOG ("Trying with track %p", track); add_object_to_tr...
false
false
false
false
false
0
dcc_resume_file_check(FILE_DCC_REC *dcc, IRC_SERVER_REC *server, uoff_t size) { if (size >= dcc->size) { /* whole file sent */ dcc->starttime = time(NULL); dcc_reject(DCC(dcc), server); } else if (lseek(dcc->fhandle, (off_t)size, SEEK_SET) != (off_t)size) { /* error */ dcc_reject(DCC(dcc), server); } ...
false
false
false
false
false
0
dca3_tag_map_invalid(u8 *tag_map) { /* * If the tag map is not programmed by the BIOS the default is: * 0x80 0x80 0x80 0x80 0x80 0x00 0x00 0x00 * * This an invalid map and will result in only 2 possible tags * 0x1F and 0x00. 0x00 is an invalid DCA tag so we know that * this entire definition is invalid. ...
false
false
false
false
false
0
pixelsCollide(QImage * image1, QImage * image2, QImage * image3, int x1, int y1, int x2, int y2, uint clr, QList<QPointF> & points) { bool result = false; const uchar * bits1 = image1->constScanLine(0); const uchar * bits2 = image2->constScanLine(0); int bytesPerLine = image1->bytesPerLine(); for (int ...
false
false
false
false
false
0
profileMatches( SVGICCColor const* first, SVGICCColor const* second ) { bool match = false; if ( !first && !second ) { match = true; } else { match = first && second && (first->colorProfile == second->colorProfile) && (first->colors.size() == second->colors.size()); ...
false
false
false
false
false
0
facet_vector_integral_q_grad(f_info) struct qinfo *f_info; { int m,i,j,k; REAL value = 0.0; REAL val; REAL derivs[MAXCOORD]; REAL sign = (get_fattr(f_info->id) & NEGBOUNDARY) ? -1.0 : 1.0; for ( k = 0 ; k < FACET_CTRL ; k++ ) for ( j = 0 ; j < SDIM ; j++ ) f_info->grad[k][j] = 0.0; for ( m =...
false
false
false
false
false
0
_match_identifier(const Lexer* lex) { char c = lex->curr[0]; return isalpha(c) || c == '_'; }
false
false
false
false
false
0
ssl_locking_cb(int mode, int n, const char * s_, int n_){ if(!ssl_locks) { logger().msg(FATAL, "SSL locks not initialized"); _exit(-1); }; if((n < 0) || (n >= ssl_locks_num)) { logger().msg(FATAL, "wrong SSL lock requested: %i of %i: %i - %s",n,ssl_locks_num,n_,s_); _exit(-1); };...
false
false
false
false
false
0
gwy_gl_material_parse(const gchar *text, gboolean is_const) { GwyGLMaterial *gl_material = NULL; GwyRGBA ambient, diffuse, specular, emission; gdouble shininess; GwyGLMaterialClass *klass; gchar *str, *p, *line, *end; g_return_val_if_fail(text, NULL); klass = g_type_cl...
false
false
false
false
false
0
nxp_nci_fw_read_status(u8 stat) { switch (stat) { case NXP_NCI_FW_RESULT_OK: return 0; case NXP_NCI_FW_RESULT_INVALID_ADDR: return -EINVAL; case NXP_NCI_FW_RESULT_UNKNOWN_CMD: return -EINVAL; case NXP_NCI_FW_RESULT_ABORTED_CMD: return -EMSGSIZE; case NXP_NCI_FW_RESULT_ADDR_RANGE_OFL_ERROR: return -EADDR...
false
false
false
false
false
0
dhcp_host_signal_handler (omapi_object_t *h, const char *name, va_list ap) { struct host_decl *host; isc_result_t status; int updatep = 0; if (h -> type != dhcp_type_host) return DHCP_R_INVALIDARG; host = (struct host_decl *)h; if (!strcmp (name, "updated")) { /* There must be a client identifier...
true
true
true
false
false
1
epr_free_dataset_id(EPR_SDatasetId* dataset_id) { if (dataset_id == NULL) return; /* Don't free the product ID, it is NOT owned by a dataset ID */ dataset_id->product_id = NULL; /* Don't free the record information, it is NOT owned by a dataset ID */ dataset_id->record_info = NULL; /* D...
false
false
false
false
false
0
rv770_program_display_gap(struct radeon_device *rdev) { u32 tmp = RREG32(CG_DISPLAY_GAP_CNTL); tmp &= ~(DISP1_GAP_MCHG_MASK | DISP2_GAP_MCHG_MASK); if (rdev->pm.dpm.new_active_crtcs & 1) { tmp |= DISP1_GAP_MCHG(R600_PM_DISPLAY_GAP_VBLANK); tmp |= DISP2_GAP_MCHG(R600_PM_DISPLAY_GAP_IGNORE); } else if (rdev->pm....
false
false
false
false
false
0
match_next_nomagic(const str* part, str* result, unsigned options) { striter path; int count = 0; if (!fnmatch(part->s, part->s, options)) return 0; if (!str_copy(&tmplist, result)) return -1; if (!str_truncate(result, 0)) return -1; striter_loop(&path, &tmplist, 0) { if (!str_copyiter(&tmpitem, &path) ...
false
false
false
false
false
0
RemoveSplash(GtkWidget * Win) { if (GTK_WIDGET_VISIBLE(SplashWindow)) { gtk_timeout_remove(splashRemoveHandler); gtk_widget_hide(SplashWindow); gtk_widget_destroy(SplashWindow); return TRUE; } return FALSE; }
false
false
false
false
false
0
io_done(struct io *io) { pid_t pid = io->pid; if (io->pipe != -1) close(io->pipe); free(io->buf); io_reset(io); while (pid > 0) { int status; pid_t waiting = waitpid(pid, &status, 0); if (waiting < 0) { if (errno == EINTR) continue; io->error = errno; return FALSE; } return waiting == ...
false
false
false
false
false
0
ftrace_free_entry(struct ftrace_func_probe *entry) { if (entry->ops->free) entry->ops->free(entry->ops, entry->ip, &entry->data); kfree(entry); }
false
false
false
false
false
0
authsaslclient_cramsha1(const struct authsaslclientinfo *info) { const char *p=(*info->start_conv_func)("CRAM-SHA1", NULL, info->conv_func_arg); if (!p) return (AUTHSASL_CANCELLED); return ( authsaslclient_cram(info, p, &hmac_sha1)); }
false
false
false
false
false
0
header_references_decode_single (const gchar **in, struct _camel_header_references **head) { struct _camel_header_references *ref; const gchar *inptr = *in; gchar *id, *word; while (*inptr) { header_decode_lwsp (&inptr); if (*inptr == '<') { id = header_msgid_decode_internal...
false
false
false
false
false
0
write(hsStream* S, plResManager* mgr) { plMultiModifier::write(S, mgr); S->writeInt(fPythonSize); S->write(fPythonSize, fPythonCode); S->writeInt(fReceivers.getSize()); for (size_t i=0; i<fReceivers.getSize(); i++) mgr->writeKey(S, fReceivers[i]); S->writeInt(fAnimNotetracks.getSize()...
false
false
false
false
false
0
remove_leading_zeroes(const decimal_t *from, int *intg_result) { int intg= from->intg, i; dec1 *buf0= from->buf; i= ((intg - 1) % DIG_PER_DEC1) + 1; while (intg > 0 && *buf0 == 0) { intg-= i; i= DIG_PER_DEC1; buf0++; } if (intg > 0) { for (i= (intg - 1) % DIG_PER_DEC1; *buf0 < powers10[i...
false
false
false
false
false
0
xml_get_endobs (xmlNodePtr node, char *endobs, int caldata) { xmlChar *tmp = xmlGetProp(node, (XUC) "endobs"); int err = 0; if (tmp != NULL) { if (caldata) { long ed = get_epoch_day((char *) tmp); if (ed < 0) err = 1; } else { double x; if (sscanf((char *) tmp, "%lf", &x) != 1) { ...
false
false
false
false
false
0
ves_icall_System_IO_MonoIO_Unlock (HANDLE handle, gint64 position, gint64 length, gint32 *error) { gboolean ret; MONO_PREPARE_BLOCKING; *error=ERROR_SUCCESS; ret=UnlockFile (handle, position & 0xFFFFFFFF, position >> 32, length & 0xFFFFFFFF, length >> 32); if (ret == FALSE) { *error = GetLastError ()...
false
false
false
false
false
0
actualitzaRellotge(){ segons=segons+1; if (segons>=60){ segons=segons-60; minuts=minuts+1; } if (minuts>=60){ minuts=minuts-60; hores=hores+1; } setText(retornaTemps()); }
false
false
false
false
false
0
erbtree_replace_internal(erbtree_t *tree, rbnode_t *parent, rbnode_t *old, rbnode_t *new) { if (parent != NULL) set_child(parent, new, parent->left == old); else tree->root = new; if (old->left != NULL) set_parent(old->left, new); if (old->right != NULL) set_parent(old->right, new); if (tree->first == o...
false
false
false
false
false
0
_PrintTocData(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt) { lclContext *ctx = (lclContext *) AH->formatData; lclTocEntry *tctx = (lclTocEntry *) te->formatData; char *tmpCopy; size_t i, pos1, pos2; if (!tctx->filename) return; if (ctx->isSpecialScript) { if (!te->copyStmt) return;...
false
false
false
false
false
0
parse_event_alloc (Event **ev, char *s) { Event tmp; int ret; *ev = NULL; ret = parse_event (&tmp, s); if (ret == 1) { *ev = malloc (sizeof (**ev)); if (*ev == NULL) krb5_errx (context, 1, "malloc: out of memory"); **ev = tmp; } return ret; }
false
false
false
false
false
0
reset() { delete addr; addr = new InvalidAddress; cur_out_addr = NULL; out_addrs->delAll(); }
false
false
false
false
false
0
orderBy( qint64 value, bool descending ) { Q_UNUSED( value ); if ( d->queryOrderBy.isEmpty() ) d->queryOrderBy = " ORDER BY name "; //TODO FIX!! d->queryOrderBy += QString( " %1 " ).arg( descending ? "DESC" : "ASC" ); return this; }
false
false
false
false
false
0
snip_confline(CONF_S **p) { CONF_S *q; /* * Be careful. We need this line because the * q->prev->next = ... * may change q itself if &q == &q->prev->next. * Then the use of q in the next line is wrong. * That's what happens if we pass in the address of * some ->next and use *p ...
false
false
false
false
false
0
vg_error_pop (VgErrorParser *parser, pid_t pid) { VgErrorListNode *n; if (!(n = g_hash_table_lookup (parser->pid_hash, GINT_TO_POINTER (pid)))) return; if (n->err_cur) { if (n->err_cur->summary) { parser->error_cb (parser, n->err_cur, parser->user_data); } else { d(fprintf (stderr, "Incomplete valgri...
false
false
false
false
false
0
generate_cfg(Declr* declr) { Block* block = declr->u.func.block; if (block) { CFG* cfg = new CFG(declr->u.func.name); DeclrListNode *node = declr->u.func.params; while (node) { Declr* declr = node->declr; cfg->params.push_back(string(declr->u.name)); node = node->next; } ...
false
false
false
false
false
0
load_subs (const char *path) { GMappedFile *map; char *contents, **lines; guint i; map = g_mapped_file_new (path, FALSE, NULL); if (map == NULL) return FALSE; contents = g_strdup (g_mapped_file_get_contents (map)); g_mapped_file_free (map); lines = g_strsplit (contents, "\n", -1); g_free (contents); has...
false
false
false
false
false
0
compareByImageNum(QUERY_LIST_ITEM* q1, QUERY_LIST_ITEM* q2) { int q1Num = 0; int q2Num = 0; q1Num = atoi(q1->query.image.ImaNum); q2Num = atoi(q2->query.image.ImaNum); if (q1Num < q2Num) return -1; if (q1Num > q2Num) return 1; return 0; }
false
false
false
false
false
0
glist_connection_count( struct glist *list_p ) { struct group *iter; int size = 0; if ( list_p->size == 0 ) return 0; iter = list_p->head; while( iter != NULL ) { size = size + group_get_size( iter ); iter = iter->next; ...
false
false
false
false
false
0
load_localauth_modules(krb5_context context) { krb5_error_code ret; struct localauth_module_handle **list = NULL, *handle; krb5_plugin_initvt_fn *modules = NULL, *mod; size_t count; ret = get_modules(context, &modules); if (ret != 0) goto cleanup; /* Allocate a large enough list of...
false
false
false
false
false
0
slotMetaData( const KIO::MetaData &_metaData ) { Q_D(SimpleJob); QMapIterator<QString,QString> it (_metaData); while (it.hasNext()) { it.next(); if (it.key().startsWith(QLatin1String("{internal~"), Qt::CaseInsensitive)) d->m_internalMetaData.insert(it.key(), it.value()); ...
false
false
false
false
false
0
XmtRegisterStandardColors(XmtColorTable ct, Widget w, Pixel foreground, Pixel background) #else void XmtRegisterStandardColors(ct, w, foreground, background) XmtColorTable ct; Widget w; Pixel foreground; Pixel background; #endif { Display *dpy = XtDisplay(w); Screen *screen; Colormap cmap; Pix...
false
false
false
false
false
0
clearRecords(UErrorCode &status) { if (U_SUCCESS(status) && inputList_ != NULL && !inputList_->isEmpty()) { inputList_->removeAllElements(); clearBuckets(); } return *this; }
false
false
false
false
false
0
IReadBlock( int nBlockXOff, int nBlockYOff, void* pImage ) { CPLAssert( sizeof(float) == sizeof(GInt32) ); CPLAssert( nBlockXOff == 0 ); CPLAssert( pImage != NULL ); LevellerDataset *poGDS = (LevellerDataset *) poDS; /* -----------------------------------------...
false
false
false
false
false
0
ipmi_oem_active(struct ipmi_intf * intf, const char * oemtype) { if (intf->oem == NULL) return 0; if (strncmp(intf->oem->name, oemtype, strlen(oemtype)) == 0) return 1; return 0; }
false
false
false
false
false
0
String_create(char * cStr) { String * string; List * characters; int i = 0; int length; if(cStr == NULL) return NULL; characters = List_create(); if(characters == NULL) return NULL; string = malloc(sizeof(String)); if(string == NULL) return NULL; string->characters = characters; string->cString = N...
false
false
false
false
false
0
generateFFun(Tree sig, Tree ff, Tree largs) { addIncludeFile(ffincfile(ff)); //printf("inc file %s\n", ffincfile(ff)); addLibrary(fflibfile(ff)); //printf("lib file %s\n", fflibfile(ff)); string code = ffname(ff); code += '('; string sep = ""; for (int i = 0; i< ffarity(ff); i++) { code += ...
false
false
false
false
false
0
song_set_repeats ( song * s, song * original ) { char * path, * fname; song * ll; path = s->path; fname = s->fname; g_free(s->artist); g_free(s->title); g_free(s->album); memcpy(s, original, sizeof(song)); if (original->title) s->title = g_strdup(original->title); ...
false
true
false
false
false
1
word_vec_free(word_vec_t *wovec, uint n) { uint i; for (i = 0; i < n; i++) wfree(wovec[i].word, wovec[i].len + 1); if (n > WOVEC_DFLT) HFREE_NULL(wovec); else zfree(wovec_zone, wovec); }
false
false
false
false
false
0
native_clone_CMPIValue ( CMPIType type, CMPIValue * val, CMPIStatus * rc ) { CMPIValue v; v.uint64 = 0LL; /* Necessary, don't delete */ if ( type & CMPI_ARRAY ) { CMPIArray *array = val->array; if (array) v.array = CMClone ( array, rc ); } else if ( (type & CMPI_ENC) &&...
true
true
false
false
false
1
get_test_stat_string (const ModelTest *test, char *str, PRN *prn) { int tex = tex_format(prn); switch (test->teststat) { case GRETL_STAT_LM: sprintf(str, "LM = %g", test->value); break; case GRETL_STAT_F: case GRETL_STAT_RESET: if (tex) { sprintf(str, "$F(%d, %d)$ = %g", test->dfn, test->df...
false
false
false
false
false
0
gf_font_manager_del(GF_FontManager *fm) { GF_Font *font; if (fm->reader) { fm->reader->shutdown_font_engine(fm->reader); gf_modules_close_interface((GF_BaseInterface *)fm->reader); } font = fm->font; while (font) { GF_Font *next = font->next; gf_font_del(font); font = next; } gf_free(fm->id_buffer); ...
false
false
false
false
false
0
rb_file_size(VALUE obj) { rb_io_t *fptr; struct stat st; GetOpenFile(obj, fptr); if (fptr->mode & FMODE_WRITABLE) { rb_io_flush(obj); } if (fstat(fptr->fd, &st) == -1) { rb_sys_fail_path(fptr->pathv); } return OFFT2NUM(st.st_size); }
false
false
false
false
false
0
lagdepvar (const int *list, const DATASET *dset) { char depvar[VNAMELEN], othervar[VNAMELEN]; char *p; int i, t, ret = 0; strcpy(depvar, dset->varname[list[1]]); for (i=2; i<=list[0]; i++) { if (list[i] == LISTSEP) { break; } strcpy(othervar, dset->varname[list[i]]); p = strrchr(othervar...
true
true
false
false
false
1
chanopt_save_one_channel (chanopt_in_memory *co, int fh) { int i; char buf[256]; guint8 val; snprintf (buf, sizeof (buf), "%s = %s\n", "network", co->network); write (fh, buf, strlen (buf)); snprintf (buf, sizeof (buf), "%s = %s\n", "channel", co->channel); write (fh, buf, strlen (buf)); i = 0; while (i < s...
true
true
false
false
false
1
PyNumber_Positive(PyObject *o) { PyNumberMethods *m; if (o == NULL) return null_error(); m = o->ob_type->tp_as_number; if (m && m->nb_positive) return (*m->nb_positive)(o); return type_error("bad operand type for unary +: '%.200s'", o); }
false
false
false
false
false
0
edialign_succFrontier(edialignCLOSURE *clos, ajint x, ajint i, ajint y) { ajint n; ajint k; n = clos->seq[x].aligSetNbr[i]; if(n == 0) { k = clos->seq[x].succAligSetPos[i]; if(k > 0) n = clos->seq[x].aligSetNbr[k]; } if(n > 0) return(clos->succFrontier[n][y]); return(c...
false
false
false
false
false
0
parentWidget() { QObject *obj = parent(); if ( obj && obj->isWidgetType() ) return static_cast<QWidget *>( obj ); return NULL; }
false
false
false
false
false
0
krb5_make_context (kx_context *kc) { krb5_kx_context *c; krb5_error_code ret; kc->authenticate = krb5_authenticate; kc->userok = krb5_userok; kc->read = krb5_read; kc->write = krb5_write; kc->copy_encrypted = krb5_copy_encrypted; kc->destroy = krb5_destroy; kc->user = NULL; ...
false
false
false
false
false
0
gtksharp_unichar_to_utf8_string (gunichar chr) { gchar *buf = g_new0 (gchar, 7); gint cnt = g_unichar_to_utf8 (chr, buf); buf [cnt] = 0; return buf; }
false
false
false
false
false
0
ir_remove_tree(TIntermNode* root) { if (!root) return; TIntermTraverser it; it.visitAggregate = RemoveAggregate; it.visitBinary = RemoveBinary; it.visitConstant = RemoveConstant; it.visitSelection = RemoveSelection; it.visitSymbol = RemoveSymbol; it.visitUnary = ...
false
false
false
false
false
0
conv_r23(const int ifd) { struct spptr old; lseek(ifd, 0L, 0); while (read(ifd, (char *) &old, sizeof(old)) == sizeof(old)) { if (!fldsok23(&old)) continue; printf("gspl-padd -%c -%c -C %s -l \'%s\'", old.spp_netflags & SPP_LOCALONLY? 's': 'w', old.spp_netflags & SPP_LOCALNET? 'N': 'L',...
false
false
false
false
false
0
gregorio_gabc_add_text (char *mbcharacters) { if (current_character) { current_character->next_character = gregorio_build_char_list_from_buf (mbcharacters); current_character->next_character->previous_character = current_character; } else { current_character = gregorio_build_char_list_...
false
false
false
false
false
0
gdl_dock_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GdlDock *dock = GDL_DOCK (object); switch (prop_id) { case PROP_FLOATING: g_value_set_boolean (value, dock...
false
false
false
false
false
0
check_stats(const H5HF_t *fh, const fheap_heap_state_t *state) { H5HF_stat_t heap_stats; /* Statistics about the heap */ /* Get statistics for heap and verify they are correct */ if(H5HF_stat_info(fh, &heap_stats) < 0) FAIL_STACK_ERROR if(heap_stats.man_nobjs != state->man_nobjs) { ...
false
false
false
false
false
0
php_ini_get_option(zend_ini_entry *ini_entry TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */ { zval *ini_array = va_arg(args, zval *); int module_number = va_arg(args, int); int details = va_arg(args, int); zval *option; if (module_number != 0 && ini_entry->module_number != module_number...
false
false
false
false
false
0
meh_get_hash(const meh_hash_id hash_id) { MehHash r = malloc(sizeof (meh_hash_t)); if (NULL == r) { meh_warn("could not allocate hash context in meh_get_hash"); return NULL; } r->id = hash_id; switch (hash_id) { case MEH_MD5: r->state.md5...
false
false
false
false
false
0
__rpipe_get_descr(struct wahc *wa, struct usb_rpipe_descriptor *descr, u16 index) { ssize_t result; struct device *dev = &wa->usb_iface->dev; /* Get the RPIPE descriptor -- we cannot use the usb_get_descriptor() * function because the arguments are different. */ result = usb_control_msg( wa->usb_dev,...
false
false
false
false
false
0