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
gl843_stop_action (Genesys_Device * dev) { SANE_Status status; uint8_t val40, val; unsigned int loop; DBG (DBG_proc, "%s\n", __FUNCTION__); status = sanei_genesys_get_status (dev, &val); if (DBG_LEVEL >= DBG_io) { sanei_genesys_print_status (val); } val40 = 0; status = sanei_genesys_rea...
false
false
false
false
true
1
Typeout(const char *fmt, ...) #else /*VARARGS1*/ void Typeout(fmt, va_alist) const char *fmt; va_dcl #endif { char string[MAX_TYPEOUT+1]; va_list ap; va_init(ap, fmt); format(string, sizeof string, fmt, ap); va_end(ap); if (UseBuffers) { ins_str(string); ins_str("\n"); } else { char outbuf[MAXCOLS + PPW...
false
false
false
false
false
0
CleanMetaData(MetaData::Pointer in) const { Acquisition::MetaDataIterator it = in->Begin(); while (it != in->End()) { this->CleanMetaData(*it); if (!(*it)->HasChildren() && !(*it)->HasInfo()) it = in->RemoveChild(it); else ++it; } }
false
false
false
false
false
0
qif_file_parse(QifContext ctx, gpointer ui_args) { g_return_val_if_fail(ctx, QIF_E_BADARGS); g_return_val_if_fail(!qif_file_needs_account(ctx), QIF_E_BADSTATE); qif_parse_all(ctx, ui_args); ctx->parsed = TRUE; return QIF_E_OK; }
false
false
false
false
false
0
do_scheduled_accept(int status, FdEventHandlerPtr event) { AcceptRequestPtr request = (AcceptRequestPtr)&event->data; int rc, done; unsigned len; struct sockaddr_in addr; if(status) { done = request->handler(status, event, request); if(done) return done; } len = sizeof(stru...
false
false
false
false
false
0
gst_rtp_buffer_get_csrc (GstRTPBuffer * rtp, guint8 idx) { guint8 *data; data = rtp->data[0]; g_return_val_if_fail (idx < GST_RTP_HEADER_CSRC_COUNT (data), 0); return GST_READ_UINT32_BE (GST_RTP_HEADER_CSRC_LIST_OFFSET (data, idx)); }
false
false
false
false
false
0
apol_infoflow_analysis_trans_further_next(const apol_policy_t * p, apol_infoflow_graph_t * g, apol_vector_t ** v) { apol_infoflow_node_t *start_node; int retval = -1; if (p == NULL || g == NULL || v == NULL) { ERR(p, "%s", strerror(EINVAL)); errno = EINVAL; return -1; } if (*v == NULL) { *v = apol_vector_c...
false
false
false
false
false
0
Maxent_donor_prob_revcomp (char *sequence) { double maxentscore, odds; if (sequence_okay(sequence,DONOR_MODEL_RIGHT_MARGIN+DONOR_MODEL_LEFT_MARGIN) == false) { return 0.0; } else { maxentscore = me2x3donor[hashseq_skip_revcomp(&(sequence[0]),4,2,3)]; odds = score_donor_dinucleotide_revcomp(sequence[D...
false
false
false
false
false
0
gtk_term_get_name(GtkWidget *widget) { GtkTerm *term; g_return_val_if_fail (widget != NULL,0); g_return_val_if_fail (GTK_IS_TERM (widget),0); term = GTK_TERM (widget); return term->name->str; }
false
false
false
false
false
0
Perl_ck_sort(pTHX_ OP *o) { dVAR; OP *firstkid; HV * const hinthv = GvHV(PL_hintgv); PERL_ARGS_ASSERT_CK_SORT; if (hinthv) { SV ** const svp = hv_fetchs(hinthv, "sort", FALSE); if (svp) { const I32 sorthints = (I32)SvIV(*svp); if ((sorthints & HINT_SORT_QUICKSORT) != 0) o->op_p...
false
false
false
false
false
0
snd_seq_oss_synth_sysex(struct seq_oss_devinfo *dp, int dev, unsigned char *buf, struct snd_seq_event *ev) { int i, send; unsigned char *dest; struct seq_oss_synth_sysex *sysex; if (! snd_seq_oss_synth_is_valid(dp, dev)) return -ENXIO; sysex = dp->synths[dev].sysex; if (sysex == NULL) { sysex = kzalloc(size...
false
false
false
false
false
0
infd_tcp_server_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfdTcpServer* server; InfdTcpServerPrivate* priv; server = INFD_TCP_SERVER(object); priv = INFD_TCP_SERVER_PRIVATE(server); ...
false
false
false
false
false
0
rhs (cs_complex_t *x, cs_complex_t *b, cs_long_t m) { cs_long_t i ; for (i = 0 ; i < m ; i++) b [i] = 1 + ((double) i) / m ; for (i = 0 ; i < m ; i++) x [i] = b [i] ; }
false
false
false
false
false
0
gms_graphics_restart (void) { if (gms_graphics_enabled && gms_graphics_are_displayed ()) { /* * If the picture is animated, we'll need to be able to re-get the * first animation frame so that the picture can be treated as if * it is a new one. So here, we'll try to re-extract th...
false
false
false
false
false
0
gnav_trl_write_trkpt(const waypoint* wpt) { gnav_trl_t rec; le_write32(&rec.time, wpt->creation_time); le_write_float(&rec.lat, wpt->latitude); le_write_float(&rec.lon, wpt->longitude); if (wpt->altitude != unknown_alt) { write_altitude(&rec.alt, wpt->altitude); } else { write_altitude(&rec.alt, 0)...
false
false
false
false
false
0
unused_rules(void) { register int i; register action *p; rules_used = (short *) MALLOC(nrules*sizeof(short)); if (rules_used == 0) no_space(); for (i = 0; i < nrules; ++i) rules_used[i] = 0; for (i = 0; i < nstates; ++i) { for (p = parser[i]; p; p = p->next) { ...
false
false
false
false
false
0
ShallowCopy(vtkProp *prop) { vtkActor *a = vtkActor::SafeDownCast(prop); if ( a != NULL ) { this->SetMapper(a->GetMapper()); this->SetProperty(a->GetProperty()); this->SetBackfaceProperty(a->GetBackfaceProperty()); this->SetTexture(a->GetTexture()); } // Now do superclass this->vtkProp3...
false
false
false
false
false
0
seat_xdmcp_session_create_display_server (Seat *seat, const gchar *session_type) { XAuthority *authority; gchar *host; XServerRemote *x_server; if (strcmp (session_type, "x") != 0) return NULL; authority = xdmcp_session_get_authority (SEAT_XDMCP_SESSION (seat)->priv->session); host = g...
false
false
false
false
false
0
StackOverflow() { HandleScope scope; Handle<String> key = factory()->stack_overflow_symbol(); Handle<JSObject> boilerplate = Handle<JSObject>::cast(GetProperty(js_builtins_object(), key)); Handle<Object> exception = Copy(boilerplate); // TODO(1240995): To avoid having to call JavaScript code to compute ...
false
false
false
false
false
0
makeLock( const char* /*lockName*/ ) { if ( singletonLock == NULL ) { singletonLock = _CLNEW NoLock(); } return singletonLock; }
false
false
false
false
false
0
ioh_irq_disable(struct irq_data *d) { struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); struct ioh_gpio *chip = gc->private; unsigned long flags; u32 ien; spin_lock_irqsave(&chip->spinlock, flags); ien = ioread32(&chip->reg->regs[chip->ch].ien); ien &= ~(1 << (d->irq - chip->irq_base)); iowrite32(ie...
false
false
false
false
false
0
pw_val2scheme( char *val, char **valpwdp, int first_is_default ) { struct pw_scheme *pwsp; int namelen, prefixlen; char *end, buf[ PWD_MAX_NAME_LEN + 1 ]; if ( *val != PWD_HASH_PREFIX_START || ( end = strchr( val, PWD_HASH_PREFIX_END )) == NULL || ( namelen = end - val - 1 ) > PWD_MAX_NAME_LEN...
false
false
false
false
false
0
qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { Q_ASSERT(staticMetaObject.cast(_o)); PgnImporter *_t = static_cast<PgnImporter *>(_o); switch (_id) { case 0: _t->databaseRead((*reinterpret_cast< PgnDatabase*(*)>(_...
false
false
false
false
false
0
dw210x_set_voltage(struct dvb_frontend *fe, enum fe_sec_voltage voltage) { static u8 command_13v[] = {0x00, 0x01}; static u8 command_18v[] = {0x01, 0x01}; static u8 command_off[] = {0x00, 0x00}; struct i2c_msg msg = { .addr = DW2102_VOLTAGE_CTRL, .flags = 0, .buf = command_off, .len = 2, }; stru...
false
false
false
false
false
0
main(int argc, char** argv) { long maxcount; if (argc < 2){ usage(argv[0]); return 1; } maxcount = atoi(argv[1]); cl_log_set_entity("logtest"); cl_log_set_facility(HA_LOG_FACILITY); cl_log_set_uselogd(TRUE); if(!cl_log_test_logd()){ return EXIT_FAIL; } cl_log_set_logd_channel_source(NULL, NUL...
false
false
false
false
true
1
wdtpci_stop(void) { unsigned long flags; /* Turn the card off */ spin_lock_irqsave(&wdtpci_lock, flags); inb(WDT_DC); /* Disable watchdog */ udelay(8); wdtpci_ctr_load(2, 0); /* 0 length reset pulses now */ spin_unlock_irqrestore(&wdtpci_lock, flags); return 0; }
false
false
false
false
false
0
remove_redundant_iv_tests (struct loop *loop) { struct nb_iter_bound *elt; bool changed = false; if (!loop->any_upper_bound) return false; for (elt = loop->bounds; elt; elt = elt->next) { /* Exit is pointless if it won't be taken before loop reaches upper bound. */ if (elt->is_exit && lo...
false
false
false
false
false
0
ov7660_set_auto_gain(struct gspca_dev *gspca_dev, __s32 val) { int err; u8 i2c_data; struct sd *sd = (struct sd *) gspca_dev; PDEBUG(D_CONF, "Set auto gain control to %d", val); err = m5602_read_sensor(sd, OV7660_COM8, &i2c_data, 1); if (err < 0) return err; i2c_data = ((i2c_data & 0xfb) | ((val & 0x01) << ...
false
false
false
false
false
0
any(c, s) int c; char *s; { while (*s) if (*s++ == c) return(1); return(0); }
false
false
false
false
false
0
find_unused(unsigned char *map) { int i, byte, bit, step; /* Scan down the combined bitmap to find an open CID */ #if LAM_WANT_IMPI step = 3; #else step = 1; #endif for (i = 0; i < map_size * 8; i += step) { byte = (i / (sizeof(char) * 8)); bit = (1 << (i % (sizeof(char) * 8))); if ((map[byte] ...
false
false
false
false
false
0
git_diff_find_init_options( git_diff_find_options *opts, unsigned int version) { GIT_INIT_STRUCTURE_FROM_TEMPLATE( opts, version, git_diff_find_options, GIT_DIFF_FIND_OPTIONS_INIT); return 0; }
false
false
false
false
false
0
ossl_engine_ctrl_cmd(int argc, VALUE *argv, VALUE self) { ENGINE *e; VALUE cmd, val; int ret; GetEngine(self, e); rb_scan_args(argc, argv, "11", &cmd, &val); StringValue(cmd); if (!NIL_P(val)) StringValue(val); ret = ENGINE_ctrl_cmd_string(e, RSTRING_PTR(cmd), NIL_P(val) ? NULL : R...
false
false
false
false
false
0
sinfo_new_vector_to_image( Vector * spectrum ) { cpl_image * returnIm ; int i ; float* podata=NULL; if ( spectrum == NULL ) { sinfo_msg_error(" no spectrum given!\n") ; return NULL ; } /* allocate memory */ if ( NULL == (returnIm = cpl_image_new(1, spectrum->n_ele...
false
false
false
false
false
0
stacktrace_chop_length(const struct stacktrace *st) { size_t i; /* * Until they called stacktrace_init(), we don't know whether we're * running as part of a statically linked program or whether the whole * program is held in shared libraries, the main() entry point being * just there to load the initial shar...
false
false
false
false
false
0
setPixmaps() { pl1timg.set_image( 80, 70, open_pixmap_from_file("board_N_2")); pl2timg.set_image( 80, 70, open_pixmap_from_file("board_N_1")); pl1img.set_image( 80, 70, open_pixmap_from_file("board_N_2")); pl2img.set_image( 80, 70, open_pixmap_from_file("board_N_1")); }
false
false
false
false
false
0
on_reposition(int pos_x, int pos_y) { menu->raise(); // make menu be on top of other components. int items_width = menu->get_items_width() + 4; if( items_width < 90 ) items_width = 90; int items_height = menu->get_items_height(); if( items_height < 20 ) items_height = 20; CL_Rect menu_rect( pos_x, pos_y,...
false
false
false
false
false
0
wrap_mode_checkbutton_toggled (GtkToggleButton *button, GeditPreferencesDialog *dlg) { GtkWrapMode mode; if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dlg->priv->wrap_text_checkbutton))) { mode = GTK_WRAP_NONE; gtk_widget_set_sensitive (dlg->priv->split_checkbutton, FALSE); gt...
false
false
false
false
false
0
fix_input_buffer(buf, len, script) char_u *buf; int len; int script; /* TRUE when reading from a script */ { int i; char_u *p = buf; /* * Two characters are special: NUL and K_SPECIAL. * When compiled With the GUI CSI is also special. * Replace NUL by K_SPECIAL KS_ZERO ...
false
false
false
false
false
0
js_script_filename_sweeper(JSHashEntry *he, intN i, void *arg) { ScriptFilenameEntry *sfe = (ScriptFilenameEntry *) he; if (!sfe->mark) return HT_ENUMERATE_REMOVE; sfe->mark = JS_FALSE; return HT_ENUMERATE_NEXT; }
false
false
false
false
false
0
vacm_parse_setaccess(const char *token, char *param) { char *name, *context, *viewname, *viewval; int imodel, ilevel, iprefix; int viewnum; char *st; struct vacm_accessEntry *ap; if (_vacm_parse_access_common(token, param, &st, &name, &context, &imodel, &i...
false
true
true
false
false
1
put_variable(const Variable *v, FILE *fp) { out_printf(fp, "\t"); print_type(fp, v->vtype, FALSE); out_printf(fp, "%s%s;", v->id, v->vtype->postfix? v->vtype->postfix:""); if(v->scope == PROTECTED_SCOPE) out_printf(fp, " /* protected */"); out_printf(fp, "\n"); }
false
false
false
false
false
0
cState_prepare_buffer(VALUE self) { FBuffer *buffer = fbuffer_alloc(); GET_STATE(self); if (state->object_delim) { fbuffer_clear(state->object_delim); } else { state->object_delim = fbuffer_alloc_with_length(16); } fbuffer_append_char(state->object_delim, ','); if (state->ob...
false
false
false
false
false
0
_comedi_dio_get_config(comedi_t *it,unsigned int subdev, unsigned int chan, unsigned int *io) { subdevice *s; comedi_insn insn; lsampl_t data[2]; int retval; if(!valid_chan(it,subdev,chan)) return -1; s=it->subdevices+subdev; if(s->type!=COMEDI_SUBD_DIO) return -1; if(it->has_insnlist_ioctl == 0) retur...
false
false
false
false
false
0
glade_gtk_menu_shell_delete_child (GladeBaseEditor * editor, GladeWidget * gparent, GladeWidget * gchild, gpointer data) { GObject *item = glade_widget_get_object (gparent); GtkWidget *submenu = NULL; GList list = { 0, }; gint n_children = 0;...
false
false
false
false
false
0
gst_text_renderer_image_to_argb (GstTextRender * render, guchar * pixbuf, int xpos, int ypos, int stride) { int i, j; guchar *p, *bitp; int width, height; width = render->image_width; height = render->image_height; for (i = 0; i < height && ypos + i < render->height; i++) { p = pixbuf + (ypos + i)...
false
false
false
false
false
0
gwy_widgets_type_init(void) { static guint types_initialized = FALSE; if (types_initialized) return; gwy_draw_type_init(); g_type_class_peek(GWY_TYPE_GRAPH_CURVE_MODEL); g_type_class_peek(GWY_TYPE_GRAPH_MODEL); g_type_class_peek(GWY_TYPE_3D_LABEL); g_type_class_peek(GWY_TYPE_3D_SE...
false
false
false
false
false
0
Allocate(int size_in_bytes, int* wasted_bytes) { ASSERT(0 < size_in_bytes); ASSERT(size_in_bytes <= kMaxBlockSize); ASSERT(IsAligned(size_in_bytes, kPointerSize)); if (needs_rebuild_) RebuildSizeList(); int index = size_in_bytes >> kPointerSizeLog2; // Check for a perfect fit. if (free_[index].head_node_...
false
false
false
false
false
0
stop_motions(int id) { Motion **s = &allMotions; Motion *n; while (*s) { if ((*s)->moving_id == id) { /* Should we finish partially-complete animations? */ n = (*s)->next; OOGLFree(*s); *s = n; } else { s = &(*s)->next; } } }
false
false
false
false
false
0
show_pci_irq(int argc __unused, char **argv __unused, struct s_hardware *hardware) { struct pci_device *pci_device; bool nopciids = false; reset_more_printf(); more_printf("%d PCI devices detected\n", hardware->nb_pci_devices); more_printf("IRQ : product\n"); more_printf("-------------\n");...
false
false
false
false
false
0
writeSettings() const { const ConnectionSettings settings; bool fRet(writeCommonSetting((settings.commonSettings(m_strConnectionName)))); if (fRet) fRet = writeIPsecSetting((settings.ipsecSettings(m_strConnectionName))); if (fRet) fRet = writeL2tpSettings((settings.l2tpSettings(m_strConnectionName))); i...
false
false
false
false
false
0
get_n_bits_from_tablesize(uint16_t *intable, struct UNSP *read_struct, uint32_t backsize) { if (!getbit_from_table(intable, read_struct)) return get_n_bits_from_table(&intable[(backsize<<3)+2], 3, read_struct); if (!getbit_from_table(&intable[1], read_struct)) return 8+get_n_bits_from_table(&intable[(...
false
false
false
false
false
0
getSelection() { std::list< PD_RDFStatement > ret; GtkTreeModel* model = GTK_TREE_MODEL(m_resultsModel); list_gtktreeiter_t l = getIterList( GTK_WIDGET(m_resultsView), true ); for( list_gtktreeiter_t::iterator iter = l.begin(); iter != l.end(); ++iter ) { GtkTreeIter giter = *iter; g...
false
false
false
false
false
0
mon_text_del(struct mon_bus *mbus) { debugfs_remove(mbus->dent_u); if (mbus->dent_t != NULL) debugfs_remove(mbus->dent_t); debugfs_remove(mbus->dent_s); }
false
false
false
false
false
0
composite(SplashBitmap *src, int xSrc, int ySrc, int xDest, int yDest, int w, int h, GBool noClip, GBool nonIsolated) { SplashPipe pipe; SplashColor pixel; Guchar alpha; Guchar *ap; int x, y; if (src->mode != bitmap->mode) { return splashErrModeMismatch; } if (src->alpha) { p...
false
false
false
false
false
0
find(string_ty *a_name) { static symtab_ty *stp; if (!stp) { stp = symtab_alloc(SIZEOF(table)); for (const request *const *tpp = table; tpp < ENDOF(table); ++tpp) { const request *rp = *tpp; string_ty *key = str_from_c(rp->name()); symtab_assign(stp, key, (void *)rp); str_free(key); ...
false
false
false
false
false
0
rsvg_new_filter (void) { RsvgFilter *filter; filter = g_new (RsvgFilter, 1); _rsvg_node_init (&filter->super, RSVG_NODE_TYPE_FILTER); filter->filterunits = objectBoundingBox; filter->primitiveunits = userSpaceOnUse; filter->x = _rsvg_css_parse_length ("-10%"); filter->y = _rsvg_css_parse_le...
false
false
false
false
false
0
istgt_lu_dvd_shutdown(ISTGT_Ptr istgt, ISTGT_LU_Ptr lu) { ISTGT_LU_DVD *spec; int rc; int i; ISTGT_TRACELOG(ISTGT_TRACE_DEBUG, "istgt_lu_dvd_shutdown\n"); ISTGT_TRACELOG(ISTGT_TRACE_DEBUG, "LU%d TargetName=%s\n", lu->num, lu->name); for (i = 0; i < lu->maxlun; i++) { if (lu->lun[i].type == ISTGT_LU_LUN...
false
false
false
false
false
0
fits_check_double_size(const qfits_header* header) { int doublesz; doublesz = qfits_header_getint(header, "DUBL_SZ", -1); if (sizeof(double) != doublesz) { fprintf(stderr, "File was written with sizeof(double)=%i, but currently sizeof(double)=%u.\n", doublesz, (uint)sizeof(double)); retur...
false
false
false
false
false
0
gp2ap020a00f_read_raw(struct iio_dev *indio_dev, struct iio_chan_spec const *chan, int *val, int *val2, long mask) { struct gp2ap020a00f_data *data = iio_priv(indio_dev); int err = -EINVAL; mutex_lock(&data->lock); switch (mask) { case IIO_CHAN_INFO_RAW: if (iio_buffer_enabled(indio_dev)) { ...
false
false
false
false
false
0
bnx2fc_vport_create(struct fc_vport *vport, bool disabled) { struct Scsi_Host *shost = vport_to_shost(vport); struct fc_lport *n_port = shost_priv(shost); struct fcoe_port *port = lport_priv(n_port); struct bnx2fc_interface *interface = port->priv; struct net_device *netdev = interface->netdev; struct fc_lport *v...
false
false
false
false
false
0
recoil(bool with_ammo) { if (!is_gun()) return 0; it_gun* gun = dynamic_cast<it_gun*>(type); int ret = gun->recoil; if (with_ammo && curammo != NULL) ret += curammo->recoil; for (int i = 0; i < contents.size(); i++) { if (contents[i].is_gunmod()) ret += (dynamic_cast<it_gunmod*>(contents[i].type))->recoil...
false
false
false
false
false
0
writeSettings() { settings()->saveState(this, DrugsWidget::Constants::S_STATEPREFIX); fileManager()->saveRecentFiles(); settings()->sync(); }
false
false
false
false
false
0
get_next_send_range(mca_pml_bfo_send_request_t* sendreq, mca_pml_bfo_send_range_t *range) { OPAL_THREAD_LOCK(&sendreq->req_send_range_lock); opal_list_remove_item(&sendreq->req_send_ranges, (opal_list_item_t *)range); OMPI_FREE_LIST_RETURN_MT(&mca_pml_bfo.send_ranges, &range->base); range = get_...
false
false
false
false
false
0
_getv(Object *args) { char *name; if (DXExtractString(args[0], &name)) if (! DXGetVariable(name, &args[1])) args[1] = NULL; return OK; }
false
false
false
false
false
0
handle_cli_database_showkey(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) { int counter = 0; switch (cmd) { case CLI_INIT: e->command = "database showkey"; e->usage = "Usage: database showkey <keytree>\n" " Shows Asterisk database contents, restricted to a given key.\n"; return NULL; ...
false
false
false
false
false
0
could_be_bitflip(u32 xor_val) { u32 sh = 0; if (!xor_val) return 1; /* Shift left until first bit set. */ while (!(xor_val & 1)) { sh++; xor_val >>= 1; } /* 1-, 2-, and 4-bit patterns are OK anywhere. */ if (xor_val == 1 || xor_val == 3 || xor_val == 15) return 1; /* 8-, 16-, and 32-bit patterns ar...
false
false
false
false
false
0
cy_cflags_changed(struct cyclades_port *info, unsigned long arg, struct cyclades_icount *cprev) { struct cyclades_icount cnow; unsigned long flags; int ret; spin_lock_irqsave(&info->card->card_lock, flags); cnow = info->icount; /* atomic copy */ spin_unlock_irqrestore(&info->card->card_lock, flags); ret = ((...
false
false
false
false
false
0
test2() { #define LIMIT 10000000 cout << "Calculating all primes below " << LIMIT << endl; for ( uint64_t n=0; n < LIMIT/10; n += 56789 ) { cout << "phi(" << n << ") = " << phi<LIMIT>(n) << endl; } for ( uint64_t n=1000000; n < LIMIT; n += 1122334/2 ) { cout << "phi(" << n << ") = " ...
false
false
false
false
false
0
test_slist_sort () { int i, j, mul; GSList *list = NULL; for (i = 0; i < N_ELEMS; ++i) list = g_slist_prepend (list, GINT_TO_POINTER (i)); list = g_slist_sort (list, intcompare); if (!verify_sort (list, N_ELEMS)) return FAILED ("decreasing list"); g_slist_free (list); list = NULL; for (i = 0; i < N_ELEMS...
false
false
false
false
false
0
is_owned_by_user_and_socket (const char *path) { struct stat s; if (stat (path, &s) == -1) return FALSE; if (s.st_uid != geteuid ()) return FALSE; if ((s.st_mode & S_IFSOCK) != S_IFSOCK) return FALSE; return TRUE; }
false
false
false
false
false
0
deleteRules(void) { delete fInitialRule; fInitialRule = NULL; if (fHistoricRules != NULL) { while (!fHistoricRules->isEmpty()) { delete (TimeZoneRule*)(fHistoricRules->orphanElementAt(0)); } delete fHistoricRules; fHistoricRules = NULL; } if (fFinalRules !...
false
false
false
false
false
0
e_table_field_chooser_dialog_response (GtkDialog *dialog, gint id) { if (id == GTK_RESPONSE_OK) gtk_widget_destroy (GTK_WIDGET (dialog)); }
false
false
false
false
false
0
get_not_associated_device(void *opaque, const char *last_seek, const enum device_type desired_type, const enum device_type not_desired_type) { struct media_devices *md = opaque; struct media_device_entry *md_ptr = md->md_entry; int i, skip = 0, found = 0; char *prev = "", *result = NUL...
false
false
false
false
false
0
main() { FileParser P(Stdin); IntegerVector v=P.parseIntegerVector(); for(int i=0;i<v.size();i++) if(v[i]!=0)printf("%i\n",i); return 0; }
false
false
false
false
false
0
swaptest() { union {unsigned short i; unsigned char c[2];} u; u.i = 1; if (u.c[0] == 1) swap_bytes = True; else swap_bytes = False; }
false
false
false
false
false
0
repeat_message() { if (State == ASKMORE) { msg_moremsg(TRUE); /* display --more-- message again */ msg_row = Rows - 1; } #ifdef FEAT_CON_DIALOG else if (State == CONFIRM) { display_confirm_msg(); /* display ":confirm" message again */ msg_row = Rows - 1; } #endif else if (State == EXTERN...
false
false
false
false
false
0
gst_rtp_session_event_recv_rtp_src (GstPad * pad, GstObject * parent, GstEvent * event) { GstRtpSession *rtpsession; gboolean forward = TRUE; gboolean ret = TRUE; const GstStructure *s; guint32 ssrc; guint pt; rtpsession = GST_RTP_SESSION (parent); switch (GST_EVENT_TYPE (event)) { case GST_EV...
false
false
false
false
false
0
DrawCloseButton(wxDC& dc, GtkWidget *widget, int button_state, wxRect const &in_rect, int orientation, GdkRectangle* clipRect) { GtkStyle *style_button = get_style_button(); int xthickness = style_...
false
false
false
false
false
0
refmpn_sqrtrem (mp_ptr sp, mp_ptr rp, mp_srcptr np, mp_size_t nsize) { mp_ptr tp, dp; mp_size_t ssize, talloc, tsize, dsize, ret, ilimbs; unsigned ibit; long i; mp_limb_t c; ASSERT (nsize >= 0); /* If n==0, then s=0 and r=0. */ if (nsize == 0) return 0; ASSERT (np[nsize - 1] != 0...
false
false
false
false
false
0
xmlSchemaCloneWildcardNsConstraints(xmlSchemaParserCtxtPtr ctxt, xmlSchemaWildcardPtr dest, xmlSchemaWildcardPtr source) { xmlSchemaWildcardNsPtr cur, tmp, last; if ((source == NULL) || (dest == NULL)) return(-1); dest->any = s...
false
false
false
false
false
0
done() { if(!k->isNull()) { if(!wasBlocking) { k->setParent(0); k->moveToThread(0); } dest->setKey(k); k = 0; key.change(dest); dest = 0; } else { delete k; k = 0; delete dest; dest = 0; } if(!wasBlocking) emit parent->finished(); }
false
false
false
false
false
0
list_fromwire(isccc_region_t *source, isccc_sexpr_t **listp) { isccc_sexpr_t *list, *value; isc_result_t result; list = NULL; while (!REGION_EMPTY(*source)) { value = NULL; result = value_fromwire(source, &value); if (result != ISC_R_SUCCESS) { isccc_sexpr_free(&list); return (result); } if (isccc_...
false
false
false
false
false
0
tp_weak_ref_destroy (TpWeakRef *self) { if (self->object != NULL) g_object_remove_weak_pointer (self->object, &self->object); if (self->destroy != NULL) (self->destroy) (self->user_data); g_slice_free (TpWeakRef, self); }
false
false
false
false
false
0
CreateRadianceProbesSurfaceIntegrator(const ParamSet &paramSet) { string filename = paramSet.FindOneFilename("filename", "probes.out"); return new UseRadianceProbes(filename); }
false
false
false
false
false
0
up_device_supply_refresh (UpDevice *device) { gboolean ret; GTimeVal timeval; UpDeviceSupply *supply = UP_DEVICE_SUPPLY (device); UpDeviceKind type; if (supply->priv->poll_timer_id > 0) { g_source_remove (supply->priv->poll_timer_id); supply->priv->poll_timer_id = 0; } g_object_get (device, "type", &type, ...
false
false
false
false
false
0
cmulex_dist_to_vowel(const cst_val *rest) { if (rest == 0) return 0; /* shouldn't get here */ else if (cmu_is_vowel(val_string(val_car(rest)))) return 0; else return 1+cmulex_dist_to_vowel(val_cdr(rest)); }
false
false
false
false
false
0
_dbus_connection_do_iteration_unlocked (DBusConnection *connection, DBusPendingCall *pending, unsigned int flags, int timeout_milliseconds) { _dbus_verbose ("start\n"); HAVE_LOCK...
false
false
false
false
false
0
bag_new(bag_t **bag) { bag_t *b = malloc(sizeof(*b)); if (!b) return -ENOMEM; INIT_LIST_HEAD(b); *bag = b; return 0; }
false
false
false
false
false
0
convert_mgmt_class(u8 mgmt_class) { /* Alias IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE to 0 */ return mgmt_class == IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE ? 0 : mgmt_class; }
false
false
false
false
false
0
Profile(FoldingSetNodeID &ID, const AttributeWithIndex *Attr, unsigned NumAttrs) { for (unsigned i = 0; i != NumAttrs; ++i) ID.AddInteger(uint64_t(Attr[i].Attrs) << 32 | unsigned(Attr[i].Index)); } }
false
false
false
false
false
0
cik_sdma_enable(struct radeon_device *rdev, bool enable) { u32 me_cntl, reg_offset; int i; if (enable == false) { cik_sdma_gfx_stop(rdev); cik_sdma_rlc_stop(rdev); } for (i = 0; i < 2; i++) { if (i == 0) reg_offset = SDMA0_REGISTER_OFFSET; else reg_offset = SDMA1_REGISTER_OFFSET; me_cntl = RREG32...
false
false
false
false
false
0
gfx_pixmap_free_index_data(gfx_pixmap_t *pixmap) { if (!pixmap->index_data) { GFXWARN("Attempt to free pixmap index data twice!\n"); return pixmap; } free(pixmap->index_data); pixmap->index_data = NULL; return pixmap; }
false
false
false
false
false
0
rect_list_node_pool_put(list_node_t *node) { if (list_node_pool.len < list_node_pool.max) { node->next = list_node_pool.node; list_node_pool.node = node; list_node_pool.len++; } else free(node); }
false
false
false
false
false
0
manifest_cache_insert(Manifest *p){ while( p ){ int i; Manifest *pBaseline = p->pBaseline; p->pBaseline = 0; for(i=0; i<MX_MANIFEST_CACHE; i++){ if( manifestCache.apManifest[i]==0 ) break; } if( i>=MX_MANIFEST_CACHE ){ int oldest = 0; int oldestAge = manifestCache.aAge[0]; ...
false
false
false
false
false
0
createRow(Mdb *mdb, MdbTable *table) { MdbRow *row; int ncols; ncols = max(table->schema->ncols, 1); if ((row = mprAllocMem(sizeof(MdbRow) + sizeof(EdiField) * ncols, MPR_ALLOC_MANAGER | MPR_ALLOC_ZERO)) == 0) { return 0; } mprSetManager(row, manageRow); row->table = ta...
false
false
false
false
false
0
_mesa_GetProgramBinary(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary) { struct gl_shader_program *shProg; GET_CURRENT_CONTEXT(ctx); shProg = _mesa_lookup_shader_program_err(ctx, program, "glGetProgramBinary"); if (!shProg) return; if...
false
false
false
false
false
0
read(std::istream& is) { if (ruleHeader.mParamCount == 0) return; is.read((char*)(&((this+1)->typeInfo)), sizeof(AST::ASTparameters*)); for (iterator it = iterator::begin(this), e = iterator::end(); it != e; ++it) { switch (it.type().mType) { case AST::ASTexpression::NumericType: ...
false
false
false
false
false
0
register_cmu_us_slt(const char *voxdir) { cst_voice *vox; cst_lexicon *lex; if (cmu_us_slt_cg) return cmu_us_slt_cg; /* Already registered */ vox = new_voice(); vox->name = "slt"; /* Sets up language specific parameters in the cmu_us_slt. */ usenglish_init(vox); /* Things th...
false
false
false
false
false
0
ConcreteConfigure(const ProcessingConfig& c) throw(ErrProcessingObj) { CopyAsConcreteConfig(mConfig, c); if (mpDevice) mpDevice->Unregister(*this); AudioManager *m; try { m = &(AudioManager::Current()); } catch (Err &e) { ErrProcessingObj ne("AudioOut::ConcreteConfigure(): No AudioManager found.",this);...
false
false
false
false
false
0
open_path(const char *path, const char* name, const char* subdir) { FILE *fp = NULL; char *pf = strdup(path); char *p = pf; while (NULL != p) { char *p1 = strchr(p, ENVSEP); if (NULL != p1) *p1 = '\0'; if (NULL != subdir) { char *pft = strdup_togethe...
false
false
false
false
false
0