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
getJumpThreadDuplicationCost(const BasicBlock *BB, unsigned Threshold) { /// Ignore PHI nodes, these will be flattened when duplication happens. BasicBlock::const_iterator I(BB->getFirstNonPHI()); // FIXME: THREADING will delete values that are just used to compute th...
false
false
false
false
false
0
activate_alpm(void) { DIR *dir; struct dirent *dirent; FILE *file; char filename[PATH_MAX]; dir = opendir("/sys/class/scsi_host"); if (!dir) return; while ((dirent = readdir(dir))) { if (dirent->d_name[0]=='.') continue; sprintf(filename, "/sys/class/scsi_host/%s/link_power_management_policy", dirent-...
false
false
false
false
false
0
printtable(const short *table, int limit) { int i; printf("# This is the distribution table for the experimental distribution.\n"); for (i=0 ; i < limit; ++i) { printf("%d%c", table[i], (i % 8) == 7 ? '\n' : ' '); } }
false
false
false
false
false
0
initialize() { if(!checkIsConnected()) { THROW_EXCEPTION("Can't connect to LMS100 Ethernet Sensor check your configuration file."); } turnOn(); }
false
false
false
false
false
0
lyricsNotFound( const QString& notfound ) { DEBUG_BLOCK if( !showCached() ) sendLyricsMessage( "notfound", notfound ); }
false
false
false
false
false
0
queuePop(int id) { if (id >=0 && id < Q_MAX && _queues[id] != NULL) { return g_async_queue_try_pop(_queues[id]); } return NULL; }
false
false
false
false
false
0
setText(const QString &text, Qt::Alignment alignment) { d->textLabel->setVisible(!text.isNull()); if (!Qt::mightBeRichText(text)) { d->textLabel->setStyleSheet(d->textStyleSheet()); } d->textLabel->setText(text); d->textLabel->setAlignment(alignment); show(); }
false
false
false
false
false
0
CM_InitBoxHull (void) { int i; int side; cnode_t *c; cplane_t *p; cbrushside_t *s; box_headnode = numnodes; box_planes = &map_planes[numplanes]; if (numnodes+6 > MAX_MAP_NODES || numbrushes+1 > MAX_MAP_BRUSHES || numleafbrushes+1 > MAX_MAP_LEAFBRUSHES || numbrushsides+6 > MAX_MAP_BRUSHSIDES || num...
false
false
false
false
false
0
wave_get_register(struct es1968 *chip, u16 reg) { unsigned long flags; u16 value; spin_lock_irqsave(&chip->reg_lock, flags); outw(reg, chip->io_port + WC_INDEX); value = inw(chip->io_port + WC_DATA); spin_unlock_irqrestore(&chip->reg_lock, flags); return value; }
false
false
false
false
false
0
window_configure_event_cb (GtkWidget *widget, GdkEventConfigure *event) { if (!window_is_maximized && !window_is_fullscreen) { window_width = event->width; window_height = event->height; } return FALSE; }
false
false
false
false
false
0
moveUp() { int newRow = LayoutManager::instance()->moveUp( m_layoutName ); layoutListWidget->clear(); layoutListWidget->addItems( LayoutManager::instance()->layouts() ); layoutListWidget->setCurrentRow( newRow ); }
false
false
false
false
false
0
free_mgtmp(mgtmp *m) { int e, di = m->s->di, gno = m->g.no; for (e = 0; e < m->s->di; e++) { if (m->g.ipos[e] != NULL) free(m->g.ipos[e]); } if (m->q.ccv != NULL) free_dmatrix(m->q.ccv,0,gno-1,0,di-1); free_dvector(m->q.x,0,gno-1); free_dvector(m->q.b,0,gno-1); free((void *)m->q.ixcol); free_dmatrix(m-...
false
false
false
false
false
0
torture(int s) { static unsigned long done[MAX_SDU*MAX_OFFSET/8/sizeof(unsigned long)]; unsigned char in[MAX_SDU],out[MAX_SDU]; unsigned char ch; int todo; todo = MAX_SDU*MAX_OFFSET-(MAX_OFFSET+1)*MAX_OFFSET/2; handler(0); while (todo) { int length,offset; int word,bit; int i,sent,got; ...
true
true
false
false
true
1
Cmd_TogglePause_f(edict_t * ent, qboolean pause) { static int lastPaused = 0; if (!matchmode->value) { gi.cprintf(ent, PRINT_HIGH, "This command need matchmode to be enabled\n"); return; } if ((int)mm_pausecount->value < 1) { gi.cprintf(ent, PRINT_HIGH, "Pause is disabled\n"); return; } if (ent->client...
false
false
false
false
false
0
rc_console_addstr(const char *t) { for (; *t; t++) { if (*t == '\n') { rc_cursor_x = 0; rc_cursor_y++; } else { rc_console_addch(*t); } } }
false
false
false
false
false
0
tp_run_connection_manager (const char *prog_name, const char *version, TpBaseConnectionManager *(*construct_cm) (void), int argc, char **argv) { DBusConnection *connection = NULL; TpDBusDaemon *bus_daemon = N...
false
false
false
false
false
0
grl_registry_register_metadata_key (GrlRegistry *registry, GParamSpec *param_spec, GError **error) { GrlKeyID key; key = grl_registry_register_metadata_key_full (registry, param_spec, ...
false
false
false
false
false
0
show_info(struct cpudata *cpu) { if (silent) return; if (show_registers) { dumpregs (cpu->number, 0, cpu->maxi); if (cpu->maxei >=0x80000000) dumpregs (cpu->number, 0x80000000, cpu->maxei); if (cpu->maxei2 >=0xC0000000) dumpregs (cpu->number, 0xC0000000, cpu->maxei2); } switch (cpu->vendor) { case...
false
false
false
false
false
0
so_get_ref (SheetObject const *so, GnmCellRef *res, gboolean force_sheet) { GnmValue *target; GnmDependent *dep = NULL; g_return_val_if_fail (so != NULL, NULL); /* Let's hope there's just one. */ sheet_object_foreach_dep ((SheetObject*)so, cb_so_get_ref, &dep); g_return_val_if_fail (dep, NULL); if (dep->texp...
false
false
false
false
false
0
gdome_xml_dt_name (GdomeDocumentType *self, GdomeException *exc) { Gdome_xml_DocumentType *priv = (Gdome_xml_DocumentType *)self; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_DT (priv), NULL); g_return_val_if_fail (exc != NULL, NULL); return gdome_xml_str_mkref_dup((gchar *)gdome...
false
false
false
false
false
0
merge_if_block (ce_info) struct ce_if_block * ce_info; { basic_block test_bb = ce_info->test_bb; /* last test block */ basic_block then_bb = ce_info->then_bb; /* THEN */ basic_block else_bb = ce_info->else_bb; /* ELSE or NULL */ basic_block join_bb = ce_info->join_bb; /* join block */ basic_block combo_b...
false
false
false
false
false
0
export_dialog_response_cb (GtkDialog *dialog, int response_id, gpointer user_data) { DialogData *data = user_data; switch (response_id) { case GTK_RESPONSE_HELP: show_help_dialog (GTK_WINDOW (data->browser), "gthumb-export-social"); break; case GTK_RESPONSE_DELETE_EVENT: case GTK_RESPONS...
false
false
false
false
false
0
exif_find_tag(exif_app_t* app, const gbuint16 ifd_nr, const gbuint16 tag_id) { exif_ifd_t* ifd = exif_find_ifd(app, ifd_nr); if (ifd != NULL) { queue* elem, *tmp; QUEUE_FOR_EACH(&ifd->tags, elem, tmp) { exif_tag_t* tag = (exif_tag_t*)elem; if (tag->id == tag_id) { return tag; } ...
false
false
false
false
false
0
icmTextDescription_read( icmBase *pp, unsigned int len, /* tag length */ unsigned int of /* start offset within file */ ) { icmTextDescription *p = (icmTextDescription *)pp; icc *icp = p->icp; int rv; char *bp, *buf, *end; #ifdef ICM_STRICT if (len < (8 + 4 + 8 + 3 /* + 67 */)) { #else if (len < (8 + 4 + 8 ...
false
true
false
false
true
1
applyOptions() { if ( !w ) return; OptAppearanceMiscUI *d = (OptAppearanceMiscUI *)w; PsiOptions::instance()->setOption("options.ui.look.contactlist.use-slim-group-headings", d->ck_newHeadings->isChecked()); PsiOptions::instance()->setOption("options.ui.look.contactlist.use-outlined-group-headings", d->ck_outli...
false
false
false
false
false
0
select_age (void) { gint num = sat_cfg_get_int (SAT_CFG_INT_LOG_CLEAN_AGE); switch (num) { case SEC_PER_DAY: gtk_combo_box_set_active (GTK_COMBO_BOX (age), 1); break; case SEC_PER_WEEK: gtk_combo_box_set_active (GTK_COMBO_BOX (age), 2); break; case SE...
false
false
false
false
false
0
pcre_regexec(CTX ctx, kregex_t *reg, const char *str, size_t nmatch, kregmatch_t p[], int eflags) { PCRE_regex_t *preg = (PCRE_regex_t*)reg; int res, nm_count, nvector[nmatch*3]; nvector[0] = 0; size_t idx, matched = nmatch; if (strlen(str) == 0) return -1; if ((res = _pcre_exec(preg->re, NULL, str, strlen(str), ...
false
false
false
false
false
0
frame() { SDL_Event ev; while(SDL_PollEvent(&ev)) { if(ev.type == SDL_KEYDOWN) if(ev.key.keysym.sym == SDLK_ESCAPE) stop(); } }
false
false
false
false
false
0
m_Reduce(Object *in, Object *out) { Object data; int nFactors; float *factors, maxFactor; int i; int nDim; Type type; Category cat; int rank, shape[32]; if ((data = in[0]) == NULL) DXErrorReturn(ERROR_MISSING_DATA, "data argument missing"); ...
false
false
false
false
false
0
bld_case_evxlst(struct st_t *stp) { register struct csitem_t *csip; register struct exprlst_t *xplp; struct csitem_t *dflt_csip; /* first build expr list element for case select */ bld_rhs_impl_evxlst(stp->st.scs.csx); dflt_csip = stp->st.scs.csitems; csip = dflt_csip->csinxt; for (;csip != NULL; csip = csip-...
false
false
false
false
false
0
lpfc_mbx_cmpl_rdp_page_a0(struct lpfc_hba *phba, LPFC_MBOXQ_t *mbox) { int rc; struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *) (mbox->context1); struct lpfc_rdp_context *rdp_context = (struct lpfc_rdp_context *)(mbox->context2); if (bf_get(lpfc_mqe_status, &mbox->u.mqe)) goto error; lpfc_sli_bemem_bcopy(mp-...
false
false
false
false
false
0
maybe_print_panel_info (const DATASET *dset, FILE *fp, gzFile fz) { int names = panel_group_names_ok(dset); int pd = dset->panel_pd; double sd0 = dset->panel_sd0; int times = pd > 0 && sd0 > 0.0; if (names || times) { alt_puts("<panel-info\n", fp, fz); if (names) { if (fz) { gzprin...
false
false
false
false
false
0
__ecereMethod_CompilersDetectionDialog_OnPostCreate(struct __ecereNameSpace__ecere__com__Instance * this) { struct CompilersDetectionDialog * __ecerePointer_CompilersDetectionDialog = (struct CompilersDetectionDialog *)(this ? (((char *)this) + __ecereClass_CompilersDetectionDialog->offset) : 0); int compilerType; char...
true
true
false
true
false
1
load_subcomponent_section(modcallable *parent, CONF_SECTION *cs, rbtree_t *components, int attr, int comp) { indexed_modcallable *subcomp; modcallable *ml; DICT_VALUE *dval; const char *name2 = cf_section_name2(cs); rad_assert(comp >= RLM_COMPONENT_AUTH); rad_assert(comp < RLM_COMPONENT_COUNT); /* *...
false
false
false
false
false
0
call_static_prop(VMG_ vm_val_t *result, const uchar **pc_ptr, uint idx, uint *argc, vm_prop_id_t prop) { /* make sure the entry is defined */ if (idx >= count_) err_throw(VMERR_BAD_METACLASS_INDEX); /* invoke the appropri...
false
false
false
false
false
0
test_network_remote_local__shorthand_fetch_refspec1(void) { const char *refspec = "master"; const char *refspec2 = "hard_tag"; git_reference *ref; connect_to_local_repository(cl_fixture("testrepo.git")); git_remote_clear_refspecs(remote); cl_git_pass(git_remote_add_fetch(remote, refspec)); cl_git_pass(git_remo...
false
false
false
false
false
0
main(int argc, char *argv[]) { int n, i, l; big_digit *xp, *zp, k; if(argc < 2) return EXIT_FAILURE; five_tab[0].l = l = 0; five_tab[0].d[0] = 5; for(n = 0; n < MAX_FIVE - 1; n++) { xp = &five_tab[n].d[0]; zp = &five_tab[n + 1].d[0]; for(i = l, k = 0; i >= 0; i--) MUL_BIG(*xp++, 5, *zp++, k); if...
false
false
false
false
false
0
identifier_to_new_filename (GkmSecretModule *self, const gchar *identifier) { gchar *filename; gint i; int fd; for (i = 0; i < G_MAXINT; ++i) { if (i == 0) filename = g_strdup_printf ("%s/%s.keyring", self->directory, identifier); else filename = g_strdup_printf ("%s/%s_%d.keyring", self->directory, iden...
false
false
false
false
false
0
v_bignum_mul(VBigDig *x, const VBigDig *y) { int n = *x, t = *y, i, j; VBigDigs uv = 0, c, w[2048]; memset(w, 0, (n + t + 1) * sizeof *w); for(i = 0; i < t; i++) { c = 0; for(j = 0; j < n; j++) { uv = w[i + j] + x[1 + j] * y[1 + i] + c; w[i + j] = uv & ((1 << V_BIGBITS) - 1); c = uv >> V_BIGBITS; ...
false
false
false
false
false
0
ioc_writev_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf) { ioc_local_t *local = NULL; uint64_t ioc_inode = 0; local = frame->local; inode_ctx_get (local->fd->in...
false
false
false
false
false
0
addSegment(const float* p, const float* q) { if (m_nsegments > m_maxSegments) return; dtObstacleSegment* seg = &m_segments[m_nsegments++]; dtVcopy(seg->p, p); dtVcopy(seg->q, q); }
false
false
false
false
false
0
readFromStream(mrpt::utils::CStream &in,int version) { switch (version) { case 0: { readFromStreamRender(in); vector<TPoint3D> a; in>>a>>generatrix; generatePoses(a,axis); meshUpToDate=false; polysUpToDate=false; break; } case 1: readFromStreamRender(in); //version 0 in>>axis>>generat...
false
false
false
false
false
0
set_object_property (DBusConnection *connection, DBusMessage *message, DBusMessageIter *iter, GObject *object, GParamSpec *pspec) { GValue value = { 0, }; DBusMessage *ret; DBusMessageIter sub; DBusGValueMarsha...
false
false
false
false
false
0
vnic_wq_copy_alloc(struct vnic_dev *vdev, struct vnic_wq_copy *wq, unsigned int index, unsigned int desc_count, unsigned int desc_size) { int err; wq->index = index; wq->vdev = vdev; wq->to_use_index = wq->to_clean_index = 0; wq->ctrl = vnic_dev_get_res(vdev, RES_TYPE_WQ, index); if (!wq->ctrl)...
false
false
false
false
false
0
yajl_string_decode(yajl_buf buf, const unsigned char * str, unsigned int len) { unsigned int beg = 0; unsigned int end = 0; while (end < len) { if (str[end] == '\\') { char utf8Buf[5]; const char * unescaped = "?"; yajl_buf_append(buf,...
false
false
false
false
false
0
__ext4_journalled_invalidatepage(struct page *page, unsigned int offset, unsigned int length) { journal_t *journal = EXT4_JOURNAL(page->mapping->host); trace_ext4_journalled_invalidatepage(page, offset, length); /* * If it's a full truncate we just forget about the pending dirtying */ if (of...
false
false
false
false
false
0
svn_diff_command_run (AnjutaCommand *command) { SvnDiffCommand *self; SvnCommand *svn_command; svn_opt_revision_t revision1; svn_opt_revision_t revision2; apr_array_header_t *options; apr_file_t *diff_file; gchar file_template[] = "anjuta-svn-diffXXXXXX"; gchar *line; svn_error_t *error; apr_off_t offset; ...
false
false
false
false
false
0
_GD_SetEncodedName(DIRFILE* D, struct _gd_raw_file* file, const char* base, int temp) { dtrace("%p, %p, \"%s\", %i", D, file, base, temp); if (file->name == NULL) { file->name = (char *)malloc(FILENAME_MAX); if (file->name == NULL) { _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL); dreturn("%...
false
false
false
false
false
0
bitmap_hash (const_bitmap head) { const bitmap_element *ptr; BITMAP_WORD hash = 0; int ix; for (ptr = head->first; ptr; ptr = ptr->next) { hash ^= ptr->indx; for (ix = 0; ix != BITMAP_ELEMENT_WORDS; ix++) hash ^= ptr->bits[ix]; } return (hashval_t)hash; }
false
false
false
false
false
0
piix_set_dma_mode(ide_hwif_t *hwif, ide_drive_t *drive) { struct pci_dev *dev = to_pci_dev(hwif->dev); u8 maslave = hwif->channel ? 0x42 : 0x40; int a_speed = 3 << (drive->dn * 4); int u_flag = 1 << drive->dn; int v_flag = 0x01 << drive->dn; int w_flag = 0x10 << drive->dn; int u_speed = 0; int sitre; u...
false
false
false
false
false
0
ladish_js_save_app_complete(void * context, const char * commandline) { int iret; unsigned int delay; if (commandline == NULL) { goto call; } log_info("JS app save complete. commandline='%s'", commandline); if (!conf_get_uint(LADISH_CONF_KEY_DAEMON_JS_SAVE_DELAY, &delay)) { delay = LADISH_CON...
false
false
false
false
false
0
vtkWrapPython_GetSuperClass( ClassInfo *data, HierarchyInfo *hinfo) { int i; const char *supername = NULL; const char *name; const char **args; const char *defaults[2] = { NULL, NULL }; for (i = 0; i < data->NumberOfSuperClasses; i++) { supername = data->SuperClasses[i]; if (strncmp(supernam...
false
false
false
false
false
0
add_durable_v2_context(struct kvec *iov, unsigned int *num_iovec, struct cifs_open_parms *oparms) { struct smb2_create_req *req = iov[0].iov_base; unsigned int num = *num_iovec; iov[num].iov_base = create_durable_v2_buf(oparms->fid); if (iov[num].iov_base == NULL) return -ENOMEM; iov[num].iov_len = sizeof...
false
false
false
false
false
0
qtdemux_inflate (void *z_buffer, guint z_length, guint length) { guint8 *buffer; z_stream *z; int ret; z = g_new0 (z_stream, 1); z->zalloc = qtdemux_zalloc; z->zfree = qtdemux_zfree; z->opaque = NULL; z->next_in = z_buffer; z->avail_in = z_length; buffer = (guint8 *) g_malloc (length); ret = in...
false
false
false
false
false
0
example_contact_list_remove_group_async (TpBaseContactList *contact_list, const gchar *group, GAsyncReadyCallback callback, gpointer user_data) { ExampleContactList *self = EXAMPLE_CONTACT_LIST (contact_list); TpIntsetFastIter iter; TpHandle member; /* signal the deletion */ g_message ("deleting ...
false
false
false
false
false
0
yes_new_cb(GtkWidget *widget, gpointer data) { destroy_yesno_dialog(widget); if (!gtk_term_is_named(term)) file_select(GTK_FILE_CHOOSER_ACTION_SAVE, "Save Notebook As ...", "*.en", "untitled", G_CALLBACK(save_as_new_cb), term_window); else { gtk_term_save(term,NULL); gtk_term_clear_new(term); is_...
false
false
false
false
false
0
pci_pm_runtime_suspend(struct device *dev) { struct pci_dev *pci_dev = to_pci_dev(dev); const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL; pci_power_t prev = pci_dev->current_state; int error; /* * If pci_dev->driver is not set (unbound), the device should * always remain in D0 regardless of ...
false
false
false
false
false
0
nis_clone_object (const nis_object *src, nis_object *dest) { char *addr; unsigned int size; XDR xdrs; nis_object *res = NULL; if (src == NULL) return (NULL); size = xdr_sizeof ((xdrproc_t)_xdr_nis_object, (char *) src); if ((addr = calloc (1, size)) == NULL) return NULL; if (dest == NULL) ...
false
false
false
false
false
0
archive_write_open_fd(struct archive *a, int fd) { struct write_fd_data *mine; mine = (struct write_fd_data *)malloc(sizeof(*mine)); if (mine == NULL) { archive_set_error(a, ENOMEM, "No memory"); return (ARCHIVE_FATAL); } mine->fd = fd; #if defined(__CYGWIN__) || defined(_WIN32) setmode(mine->fd, O_BINARY); ...
false
false
false
false
false
0
t30_hdlc_accept(void *user_data, const uint8_t *msg, int len, int ok) { t30_state_t *s; s = (t30_state_t *) user_data; if (len < 0) { /* Special conditions */ switch (len) { case PUTBIT_TRAINING_IN_PROGRESS: break; case PUTBIT_TRAINING_FAILED: ...
false
false
false
false
false
0
weekday_from_date (const char *date) { int yr, mo, day; if (sscanf(date, YMD_READ_FMT, &yr, &mo, &day) != 3) { return -1; } if (yr < 100) { yr = FOUR_DIGIT_YEAR(yr); } return day_of_week_from_ymd(yr, mo, day); }
false
false
false
false
false
0
new_field(MEM_ROOT *root, TABLE *new_table, bool keep_type) { Field_enum *res= (Field_enum*) Field::new_field(root, new_table, keep_type); if (res) res->typelib= copy_typelib(root, typelib); return res; }
false
false
false
false
false
0
cdv_intel_lvds_commit(struct drm_encoder *encoder) { struct drm_device *dev = encoder->dev; struct drm_psb_private *dev_priv = dev->dev_private; struct psb_intel_mode_device *mode_dev = &dev_priv->mode_dev; if (mode_dev->backlight_duty_cycle == 0) mode_dev->backlight_duty_cycle = cdv_intel_lvds_get_max_bac...
false
false
false
false
false
0
_check_thin_parameters(struct volume_group *vg, struct lvcreate_params *lp, struct lvcreate_cmdline_params *lcp) { struct lv_list *lvl; if (!lp->thin && !lp->create_thin_pool) { log_error("Please specify device size(s)."); return 0; } if (lp->thin && !lp->create_thin_pool) { if (arg_count(vg->cmd, chu...
false
false
false
false
false
0
rewriteListObject(rio *r, robj *key, robj *o) { long long count = 0, items = listTypeLength(o); if (o->encoding == REDIS_ENCODING_ZIPLIST) { unsigned char *zl = o->ptr; unsigned char *p = ziplistIndex(zl,0); unsigned char *vstr; unsigned int vlen; long long vlong; ...
false
false
false
false
false
0
_e2p_unpack_clean_dir (E2P_Unpackdata *data) { if (e2_command_find_process ((guint)data->thispid)) return TRUE; //wait some more //now we're ready for cleanup // g_source_remove (data->pack_id); // if (_e2p_unpack_delete_dir (data)) //keep trying until the deletion is done g_idle_add_full (G_PRIORITY_LOW, (G...
false
false
false
false
false
0
usdlg_tab_update(struct unit_select_dialog *pdialog, struct usdata_hash *ushash, enum unit_select_location_mode loc) { bool show = FALSE; GtkTreeStore *store; fc_assert_ret_val(ushash, FALSE); fc_assert_ret_val(pdialog != NULL, FALSE); store = pdialo...
false
false
false
false
false
0
gst_camerabin_have_src_buffer (GstPad * pad, GstBuffer * buffer, gpointer u_data) { GstCameraBin *camera = (GstCameraBin *) u_data; GstMessage *msg; GST_LOG_OBJECT (camera, "got image buffer %p with size %d", buffer, GST_BUFFER_SIZE (buffer)); g_mutex_lock (camera->capture_mutex); camera->capturin...
false
false
false
false
false
0
mx_menu_dispose (GObject *object) { MxMenu *menu = MX_MENU (object); MxMenuPrivate *priv = menu->priv; if (priv->children) { gint i; for (i = 0; i < priv->children->len; i++) mx_menu_free_action_at (menu, i, FALSE); g_array_free (priv->children, TRUE); priv->children = NULL; ...
false
false
false
false
false
0
readSBits( int numBits ) throw ( exception ) { // Get the number as an unsigned value. long uBits = readUBits( numBits ); if( numBits > 0 ) { // Is the number negative? if( ( uBits & ( 1L << (numBits - 1 ) ) ) != 0 ) { // Yes. Extend the sign. uBits |= -1L << numBits; } } return static_cast< int >(...
false
false
false
false
false
0
SetOutputNumber(int num) { if (num == this->GetOutputNumber()) return; if (num < 0) { btkWarningMacro("Attempt to set the number of outputs to the negative value" + ToString(num) + ". The number of outputs is set to 0."); num = 0; } for (int inc = num ; inc < this->GetOutputNumbe...
false
false
false
false
false
0
newEndMRMLElement(void *inUserData, const char *inElementName){ cout << "ENDING:" << inElementName << endl; CXMLElement* lDocumentTree=(CXMLElement*)inUserData; lDocumentTree->moveUp(); if(string(inElementName)==mrml_const::mrml){ lDocumentTree->moveUp(); } }
false
false
false
false
false
0
do_enroll(DBusGProxy *dev) { GError *error = NULL; gboolean enroll_completed = FALSE; dbus_g_proxy_add_signal(dev, "EnrollStatus", G_TYPE_STRING, G_TYPE_BOOLEAN, NULL); dbus_g_proxy_connect_signal(dev, "EnrollStatus", G_CALLBACK(enroll_result), &enroll_completed, NULL); g_print("Enrolling %s finger.\n", ...
false
false
false
false
false
0
glue_close ( BackendInfo *bi ) { static int glueClosed = 0; int rc = 0; if (glueClosed) return 0; glueClosed = 1; if (slapMode & SLAP_TOOL_MODE) { rc = backend_shutdown( NULL ); } return rc; }
false
false
false
false
false
0
setCountFromActiveFrame(void) { if(!getActiveFrame()) return; FV_View * pview = static_cast<FV_View *>(getActiveFrame()->getCurrentView()); if(!pview->isLayoutFilling()) { setCount(pview->countWords(true)); } }
false
false
false
false
false
0
attnumCollationId(Relation rd, int attid) { if (attid <= 0) { /* All system attributes are of noncollatable types. */ return InvalidOid; } if (attid > rd->rd_att->natts) elog(ERROR, "invalid attribute number %d", attid); return rd->rd_att->attrs[attid - 1]->attcollation; }
false
false
false
false
false
0
mprCreateWorkerService() { MprWorkerService *ws; ws = mprAllocObj(MprWorkerService, manageWorkerService); if (ws == 0) { return 0; } ws->mutex = mprCreateLock(); ws->minThreads = MPR_DEFAULT_MIN_THREADS; ws->maxThreads = MPR_DEFAULT_MAX_THREADS; /* Presize the list...
false
false
false
false
false
0
tftp_option_get(const char *buf, size_t len, const char **option, const char **value) { size_t loc; loc = Curl_strnlen( buf, len ); loc++; /* NULL term */ if(loc >= len) return NULL; *option = buf; loc += Curl_strnlen( buf+loc, len-loc ); loc++; /* NULL term */ ...
false
false
false
false
false
0
ebitmap_get_bit(struct ebitmap *e, unsigned long bit) { struct ebitmap_node *n; if (e->highbit < bit) return 0; n = e->node; while (n && (n->startbit <= bit)) { if ((n->startbit + EBITMAP_SIZE) > bit) return ebitmap_node_get_bit(n, bit); n = n->next; } return 0; }
false
false
false
false
false
0
saveMolproBasis() { gchar *filename = g_strdup_printf("%s/molprobasis",gabedit_directory()); FILE* file; gint i,j,k; if(molproBasis.numberOfAtoms<0) return; file = fopen(filename,"w"); fprintf(file,"Natoms = %d\n",molproBasis.numberOfAtoms); for(i=0;i<molproBasis.numberOfAtoms;i++) { fprintf(fil...
false
false
false
false
true
1
snd_pdacf_resume(struct snd_pdacf *chip) { int timeout = 40; pdacf_reinit(chip, 1); /* wait for AK4117's PLL */ while (timeout-- > 0 && (snd_ak4117_external_rate(chip->ak4117) <= 0 || !check_signal(chip))) mdelay(1); chip->chip_status &= ~PDAUDIOCF_STAT_IS_SUSPENDED; snd_power_change_state(chip->card, ...
false
false
false
false
false
0
physmem_copy_from_vm(vm_instance_t *vm,void *real_buffer, m_uint64_t paddr,size_t len) { m_uint64_t dummy; m_uint32_t r; u_char *ptr; while(len > 0) { r = m_min(VM_PAGE_SIZE - (paddr & VM_PAGE_IMASK), len); ptr = physmem_get_hptr(vm,paddr,0,MTS_READ,&dummy); ...
false
false
false
false
false
0
udp_bind_connect(char *src, int sport, char *dest, int dport, struct sockaddr_in *serv) { int sock; sock = udp_bind(src, sport); if (sock < 0) return sock; fill_sockaddr(serv, dest, dport); if (connect(sock, (struct sockaddr *) serv, sizeof(*serv)) < 0) { LOGL(0, "udp_bind_connect: failed: bind(): %s", stre...
false
false
false
false
false
0
find(const std::string& name) const { Container::const_iterator i; size_t level=0; for (; level<=__blockLevel;++level) { i = __variableList[level].find(name); if (i != __variableList[level].end()) break; } if (level>__blockLevel) return 0; if (i == __variableList[level].end()) return 0; else { ...
false
false
false
false
false
0
loadDefaultArguments(int position) { std::list<std::string>::iterator it; std::list<bool>::iterator bIt; const char *str; char *argumentsPtr; char arguments[1024]; if (!myUsingBuilder) { myBuilder = new ArArgumentBuilder; myBuilder->addStringsAsIs(*myArgc, myArgv); myOwnBuilder = true...
false
false
false
false
false
0
m68hc11_strip_name_encoding (str) const char *str; { return str + (*str == '*' || *str == '@' || *str == '&'); }
false
false
false
false
false
0
gdt_table_element_get_string(const gdt_table *t, const gdt_element *e) { if (elem_is_string(e)) return gdt_index_get(t->strings, e->word.lo); return NULL; }
false
false
false
false
false
0
CDB___ham_metagroup_log(dbenv, txnid, ret_lsnp, flags, fileid, bucket, pgno, metalsn, pagelsn) DB_ENV *dbenv; DB_TXN *txnid; DB_LSN *ret_lsnp; u_int32_t flags; int32_t fileid; u_int32_t bucket; db_pgno_t pgno; DB_LSN * metalsn; DB_LSN * pagelsn; { DBT logrec; DB_LSN *lsnp, null_lsn; u_int32_t rectype, txn_...
false
false
false
false
false
0
evaluateProduction( const ContainerBaseType* potentialFactory, const VehicleType* vt, GameMap* gamemap ) { if ( potentialFactory->vehicleFit( vt ) && potentialFactory->hasFunction( ContainerBaseType::InternalVehicleProduction)) { if ( potentialFactory->vehicleCategoriesProduceable & (1 << vt->movemalustyp)) ...
false
false
false
false
false
0
bcm50610_a0_workaround(struct phy_device *phydev) { int err; err = bcm_phy_write_exp(phydev, MII_BCM54XX_EXP_AADJ1CH0, MII_BCM54XX_EXP_AADJ1CH0_SWP_ABCD_OEN | MII_BCM54XX_EXP_AADJ1CH0_SWSEL_THPF); if (err < 0) return err; err = bcm_phy_write_exp(phydev, MII_BCM54XX_EXP_AADJ1CH3, MII_BCM54XX_EXP_AADJ...
false
false
false
false
false
0
event(const char state) { // If the new event is different the most recently logged one // then we need to log this event. (Note that the event is implicitly // logged in the "index". I.e. 1 events are at odd indices. if(state != pEventBuffer[index]) { index = (index + 1) & max_events; pTimeBuffer[inde...
false
false
false
false
false
0
dpruneL( const int jcol, /* in */ const int *perm_r, /* in */ const int pivrow, /* in */ const int nseg, /* in */ const int *segrep, /* in */ const int *repfnz, /* in */ int *xprune, /* out */ GlobalLU_t *Glu /* modified - g...
false
false
false
false
false
0
mlx4_init_quotas(struct mlx4_dev *dev) { struct mlx4_priv *priv = mlx4_priv(dev); int pf; /* quotas for VFs are initialized in mlx4_slave_cap */ if (mlx4_is_slave(dev)) return; if (!mlx4_is_mfunc(dev)) { dev->quotas.qp = dev->caps.num_qps - dev->caps.reserved_qps - mlx4_num_reserved_sqps(dev); dev->quot...
false
false
false
false
false
0
recogProcessToIdentify(L_RECOG *recog, PIX *pixs, l_int32 pad) { l_int32 canclip; PIX *pix1, *pix2, *pixd; PROCNAME("recogProcessToIdentify"); if (!recog) return (PIX *)ERROR_PTR("recog not defined", procName, NULL); if (!pixs) ret...
false
false
false
false
false
0
flmLogError( RCODE rc, const char * pszDoing, const char * pszFileName, FLMINT iLineNumber) { flmLogMessage( F_DEBUG_MESSAGE, FLM_YELLOW, FLM_BLACK, pszFileName ? "Error %s: 0x%04X (%s), File=%s, Line=%d." : "Error %s: 0x%04X (%s).", pszDoing, (unsigned)rc, FlmErrorString( rc), pszFileName...
false
false
false
false
false
0
declarator (type_p ty, const char **namep, options_p *optsp, bool in_struct = false) { *namep = 0; *optsp = 0; while (token () == '*') { advance (); ty = create_pointer (ty); } return direct_declarator (ty, namep, optsp, in_struct); }
false
false
false
false
false
0
KMP_Find(const wxChar* text, const wxChar* pattern, const int patternLen) { if (!text || !pattern || pattern[0] == _T('\0') || text[0] == _T('\0')) return -1; if (patternLen > 1024) { if (patternLen < 5012) TRACE(_T("KMP_Find() : %s - %s"), text, pattern); else {...
false
false
false
false
false
0
drawSymbol(void) { if (owner()->mapped()==MSTrue && (showDisarmState()==MSTrue || armed()==MSTrue) ) { int offset=highlightThickness()+shadowThickness(); int x=x_origin()+marginWidth()+offset; int size=fontObject()->textHeight(); if (size%2==0) size--; int delta=(height()-2*(of...
false
false
false
false
false
0
device_state_changed (DBusGProxy *proxy, NMDeviceState new_state, NMDeviceState old_state, NMDeviceStateReason reason, gpointer user_data) { NMDevice *self = NM_DEVICE (user_data); NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (se...
false
false
false
false
false
0
lane_print(const u_char *p, u_int length, u_int caplen) { struct lane_controlhdr *lec; if (caplen < sizeof(struct lane_controlhdr)) { printf("[|lane]"); return; } lec = (struct lane_controlhdr *)p; if (EXTRACT_16BITS(&lec->lec_header) == 0xff00) { /* * LE Control. */ printf("lec: proto %x vers %x %...
false
false
false
false
false
0