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
gn_file_bitmap_save(char *filename, gn_bmp *bitmap, gn_phone *info) { FILE *file; bool done = false; /* XPMs are a bit messy because we have to pass it the filename */ #ifdef XPM if (strstr(filename, ".xpm")) { file_xpm_save(filename, bitmap); } else { #endif file = fopen(filename, "wb"); if (!file) retu...
false
false
false
false
true
1
StopWindowLevel() { if ( this->State == vtkImagePlaneWidget::Outside || this->State == vtkImagePlaneWidget::Start ) { return; } this->State = vtkImagePlaneWidget::Start; this->HighlightPlane(0); this->ActivateText(0); this->EventCallbackCommand->SetAbortFlag(1); this->EndInteraction(); ...
false
false
false
false
false
0
first_taline(TA_S *q) { TA_S *first; if(q == NULL) return NULL; first = NULL; /* back up to the head of the list */ while(q){ first = q; q = pre_taline(q); } /* * If first->skip_it, that means we were already past the first * legitimate line, so we have to look in the ot...
false
false
false
false
false
0
cb_location_menu(GtkOptionMenu *om, gpointer data) { GList *list; Sensor *sr, *s; gchar *pname = NULL; gint location; location = gtk_option_menu_get_history(om); sr = get_referenced_sensor(); if (!sr || !sr->enabled || sr->location == location) return; /* If trying to relocate, get a dst panel name so ...
false
false
false
false
false
0
fluid_settings_str_equal (fluid_settings_t* settings, const char *name, const char *s) { fluid_setting_node_t *node; int retval = 0; fluid_return_val_if_fail (settings != NULL, 0); fluid_return_val_if_fail (name != NULL, 0); fluid_return_val_if_fail (name[0] != '\0', 0); fluid_return_val_if_fai...
false
false
false
false
false
0
MovePositionTo(SelectionPosition newPos, Selection::selTypes selt, bool ensureVisible) { bool simpleCaret = (sel.Count() == 1) && sel.Empty(); SelectionPosition spCaret = sel.Last(); int delta = newPos.Position() - sel.MainCaret(); newPos = ClampPositionIntoDocument(newPos); newPos = MovePositionOutsideChar(newPo...
false
false
false
false
false
0
initialize() { JT_DiscoInfo *jt = new JT_DiscoInfo(client_->rootTask()); connect(jt, SIGNAL(finished()), SLOT(disco_finished())); jt->get(client_->jid().domain()); jt->go(true); }
false
false
false
false
false
0
btreeNumbucketBthitreflist(AjPBtcache cache, ajulong pagepos, AjPList hitlist) { AjPBtHitref bthitref = NULL; AjPBtpage page = NULL; unsigned char *buf = NULL; unsigned char *pptr = NULL; ajuint nodetype = 0U; ajuint nentries = 0U; ajulong ...
false
false
false
false
false
0
dequeue(PQueue &CurQueue) { if (CurQueue.empty()) return nullptr; LiveInterval *LI = &LIS->getInterval(~CurQueue.top().second); CurQueue.pop(); return LI; }
false
false
false
false
false
0
nonlin_test_header (int code, PRN *prn) { pputc(prn, '\n'); if (code == AUX_SQ) { pputs(prn, _("Non-linearity test (squared terms)")); } else { pputs(prn, _("Non-linearity test (log terms)")); } pputs(prn, "\n\n"); }
false
false
false
false
false
0
create_directories(const Twine &Path, bool IgnoreExisting, perms Perms) { SmallString<128> PathStorage; StringRef P = Path.toStringRef(PathStorage); // Be optimistic and try to create the directory std::error_code EC = create_directory(P, IgnoreExisting, Perms); // If we su...
false
false
false
false
false
0
ips_issue_i2o_memio(ips_ha_t * ha, ips_scb_t * scb) { METHOD_TRACE("ips_issue_i2o_memio", 1); if (scb->scsi_cmd) { DEBUG_VAR(2, "(%s%d) ips_issue: cmd 0x%X id %d (%d %d %d)", ips_name, ha->host_num, scb->cdb[0], scb->cmd.basic_io.command_id, scb->bus, scb->target_id, scb->lun); } else { ...
false
false
false
false
false
0
HandlerSlotPutFunction( void *theEnv, void *theValue, DATA_OBJECT *theResult) { HANDLER_SLOT_REFERENCE *theReference; DEFCLASS *theDefclass; INSTANCE_TYPE *theInstance; INSTANCE_SLOT *sp; unsigned instanceSlotIndex; DATA_OBJECT theSetVal; theReference = (HANDLER_SLOT_REFERENCE *) ValueToBi...
false
false
false
false
false
0
StyleSetCharacterSet(int style, int characterSet) { wxFontEncoding encoding; // Translate the Scintilla characterSet to a wxFontEncoding switch (characterSet) { default: case wxSCI_CHARSET_ANSI: case wxSCI_CHARSET_DEFAULT: encoding = wxFONTENCODING_DEFAULT; b...
false
false
false
false
false
0
GetObjectCoords(int *x, int *y, int *w, int *h) { int rval = CIE_GC_NONE_SET; if (Coords[0] != INT_MAX && x != NULL) { *x = Coords[0]; rval |= CIE_GC_X_SET; } if (Coords[1] != INT_MAX && y != NULL) { *y = Coords[1]; rval |= CIE_GC_Y_SET; } if (Coords[2] != INT_MAX && w != NULL) { *w = Coords[2]; rval ...
false
false
false
false
false
0
v_midi_close (int dev) { vmidi_devc *devc = midi_devs[dev]->devc; unsigned long flags; if (devc == NULL) return; spin_lock_irqsave(&devc->lock,flags); devc->intr_active = 0; devc->input_opened = 0; devc->opened = 0; spin_unlock_irqrestore(&devc->lock,flags); }
false
false
false
false
false
0
raid56_rmw_stripe(struct btrfs_raid_bio *rbio) { int bios_to_read = 0; struct bio_list bio_list; int ret; int nr_pages = DIV_ROUND_UP(rbio->stripe_len, PAGE_CACHE_SIZE); int pagenr; int stripe; struct bio *bio; bio_list_init(&bio_list); ret = alloc_rbio_pages(rbio); if (ret) goto cleanup; index_rbio_pag...
false
false
false
false
false
0
gretl_matrix_trace (const gretl_matrix *m) { double tr = 0.0; int i; if (gretl_is_null_matrix(m) || m->rows != m->cols) { return NADBL; } for (i=0; i<m->rows; i++) { tr += gretl_matrix_get(m, i, i); } return tr; }
false
false
false
false
false
0
put_file(int fd) { int rc = 0; fsync(fd); /* release the file lock */ fl.l_type = F_UNLCK; if ((rc = fcntl(fd, F_SETLKW, &fl))) { LogDebug("USER PS: failed to unlock file: %s", strerror(errno)); rc = -1; } MUTEX_UNLOCK(user_ps_lock); return rc; }
false
false
false
false
false
0
main(int argc, char **argv) { struct sockaddr_un mysun; int sock; u_char buf[1024]; int n; if (argc != 2) { fprintf(stderr,"Usage: %s file\n", argv[0]); exit(1); } bzero(&mysun,sizeof(mysun)); mysun.sun_family = AF_UNIX; strncpy(mysun.sun_path,argv[1],sizeof(mysun.sun_path)); if ((sock = s...
false
false
false
false
false
0
gx_regler_cp_configure(GxControlParameter *self, gchar* group, gchar *name, gdouble lower, gdouble upper, gdouble step) { g_return_if_fail(GX_IS_REGLER(self)); GxRegler *regler = GX_REGLER(self); if (regler->label) { gtk_label_set_text(regler->label, name); } GtkRange *range = GTK_RANGE(self); gtk_range_set_ran...
false
false
false
false
false
0
tile_really_has_any_specials(const struct tile *ptile) { bv_special specials; if (!ptile) { return FALSE; } specials = tile_specials(ptile); BV_CLR(specials, S_RESOURCE_VALID); return BV_ISSET_ANY(specials); }
false
false
false
false
false
0
mo_modrestart(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { unsigned int modnum = 0; dlink_node *ptr = NULL, *ptr_next = NULL; if (!IsAdmin(source_p)) { sendto_one(source_p, form_str(ERR_NOPRIVILEGES), me.name, source_p->name); return; } s...
false
false
false
false
false
0
scaSetFlags( SCACHE * pSCache, FLMUINT16 ui16FlagsToSet ) { flmAssert( ui16FlagsToSet); if( !pSCache->ui16Flags) { ScaUnlinkFromReplaceList( pSCache); } pSCache->ui16Flags |= ui16FlagsToSet; }
false
false
false
false
false
0
checkRemove(const PatPile * pile, const QList<KCard*> & cards) const { return pile->pileRole() == PatPile::Tableau && isSameSuitDescending(cards); }
false
false
false
false
false
0
CERT_GetConstrainedCertificateNames(const CERTCertificate *cert, PLArenaPool *arena, PRBool includeSubjectCommonName) { CERTGeneralName *DN; CERTGeneralName *SAN; PRUint32 numDNSNames = 0; SECStatus rv; if (!ar...
false
false
false
false
false
0
rb_num_coerce_relop(VALUE x, VALUE y, ID func) { VALUE c, x0 = x, y0 = y; if (!do_coerce(&x, &y, FALSE) || NIL_P(c = rb_funcall(x, func, 1, y))) { rb_cmperr(x0, y0); return Qnil; /* not reached */ } return c; }
false
false
false
false
false
0
soc_camera_dqbuf(struct file *file, void *priv, struct v4l2_buffer *p) { struct soc_camera_device *icd = file->private_data; struct soc_camera_host *ici = to_soc_camera_host(icd->parent); WARN_ON(priv != file->private_data); if (icd->streamer != file) return -EBUSY; if (ici->ops->init_videobuf) retur...
false
false
false
false
false
0
usbvision_write_reg(struct usb_usbvision *usbvision, unsigned char reg, unsigned char value) { int err_code = 0; if (!USBVISION_IS_OPERATIONAL(usbvision)) return 0; usbvision->ctrl_urb_buffer[0] = value; err_code = usb_control_msg(usbvision->dev, usb_sndctrlpipe(usbvision->dev, 1), USBVISION_OP_CODE,...
false
false
false
false
false
0
visit_decref(PyObject *op, void *data) { assert(op != NULL); if (PyObject_IS_GC(op)) { PyGC_Head *gc = AS_GC(op); /* We're only interested in gc_refs for objects in the * generation being collected, which can be recognized * because only they have positive gc_refs. */ ...
false
false
false
false
false
0
__ocfs2_find_empty_slot(struct ocfs2_slot_info *si, int preferred) { int i, ret = -ENOSPC; if ((preferred >= 0) && (preferred < si->si_num_slots)) { if (!si->si_slots[preferred].sl_valid) { ret = preferred; goto out; } } for(i = 0; i < si->si_num_slots; i++) { if (!si->si_slots[i].sl_valid) { ...
false
false
false
false
false
0
qrp_finalize_computation(htable_t *words) { struct qrp_context *ctx; g_assert(words != NULL); /* * Because QRP computation is possibly a CPU-intensive operation, it * is dealt with as a coroutine that will be scheduled at regular * intervals. */ WALLOC0(ctx); ctx->magic = QRP_MAGIC; ctx->rtp = &local_t...
false
false
false
false
false
0
output_sif(ostream& out, short indent_size, short indent_level, SifOutputControl& soc) { char QM = '\"'; // Parameter type and id if (soc.outputType) { LibFront::output_string(out, indent_size, indent_level++, getSifName(), false); if (soc.outputId) out << ' ' << ID(); out << endl; } else...
false
false
false
false
false
0
sbc_read_capacity(int host_no, struct scsi_cmd *cmd) { uint32_t *data; unsigned int bshift; uint64_t size; uint8_t *scb = cmd->scb; unsigned char key = ILLEGAL_REQUEST; uint16_t asc = ASC_LUN_NOT_SUPPORTED; if (!(scb[8] & 0x1) && (scb[2] | scb[3] | scb[4] | scb[5])) { asc = ASC_INVALID_FIELD_IN_CDB; goto se...
false
false
false
false
false
0
worker1(void *data) { worker1_t *w = (worker1_t*)data; int i; for (i = 0; i < w->n_seqs; ++i) ec_collect(w->e, w->opt, SUF_LEN, &w->top[w->seqs[i]], w->solid[i], w->cnt); return 0; }
false
false
false
false
false
0
last_always_executed_block (struct loop *loop) { unsigned i; vec<edge> exits = get_loop_exit_edges (loop); edge ex; basic_block last = loop->latch; FOR_EACH_VEC_ELT (exits, i, ex) last = nearest_common_dominator (CDI_DOMINATORS, last, ex->src); exits.release (); return last; }
false
false
false
false
false
0
hdhomerun_device_create_from_str(const char *device_str, struct hdhomerun_debug_t *dbg) { struct hdhomerun_device_t *device = hdhomerun_device_create_from_str_device_id(device_str, dbg); if (device) { return device; } device = hdhomerun_device_create_from_str_ip(device_str, dbg); if (device) { return device; ...
false
false
false
false
false
0
node_traverse_func (GNode *node, gpointer user_data) { struct NodeTraverseData *td = user_data; LTableEntry *lte = node->data; GList *tmp; tmp = lte->listeners; while (tmp != NULL) { Listener *l = tmp->data; (* td->func) (lte->full_name, l->cnxn,...
false
false
false
false
false
0
AddSlash(char *str) { char *sp, *sep = FILE_SEPARATOR_STR; int f = false ,b = false; if (str == NULL) { return; } // add root slash on Unix systems if(strlen(str) == 0) { if((VSYSTEMHARDCLASS != mingw) && (VSYSTEMHARDCLASS != cfnt)) { strcpy(str, "/"); } return; } /* Try to see what c...
false
false
false
false
false
0
json_object_set_string_member (JsonObject *object, const gchar *member_name, const gchar *value) { JsonNode *node; g_return_if_fail (object != NULL); g_return_if_fail (member_name != NULL); node = json_node_alloc (); if (value != NULL) json...
false
false
false
false
false
0
mx_window_x11_set_position (MxNativeWindow *self, gint x, gint y) { Window win; Display *dpy; ClutterStage *stage; MxWindowX11Private *priv; g_return_if_fail (MX_IS_WINDOW_X11 (self)); priv = MX_WINDOW_X11 (self)->priv; stage = mx_window_get_clutter_stage (priv->window); if (!stage) return; /...
false
false
false
false
false
0
notify_players_game_is_over(connection_data *connection) { int player_id; player_data *player; void* message = init_message(); set_opcode(message, OPCODE__GAME_STATUS); for (player_id = 0; player_id < MAX_CONNECTIONS; player_id++) { player = &(connection->players[player_id]); if (!...
false
false
false
false
false
0
gsd_wacom_device_set_next_mode (GsdWacomDevice *device, GsdWacomTabletButton *button) { GList *l; int current_idx; int num_modes; int num_switches; int group_id; g_return_val_if_fail (GSD_IS_WACOM_DEVICE (device), -1); group_id = button->group_id; current_idx = 0; num_switches = 0; num_modes = GPO...
false
false
false
false
false
0
qmonHostgroupCheckName(Widget w, XtPointer cld, XtPointer cad) { XmtInputFieldCallbackStruct *cbs = (XmtInputFieldCallbackStruct*) cad; static char unique[CL_MAXHOSTLEN]; int ret; DENTER(GUI_LAYER, "qmonHostgroupCheckName"); if (cbs->input && cbs->input[0] != '\0' && cbs->input[0] != ' ') { ...
false
false
false
false
false
0
fileExists(const std::string & fileName) { std::ifstream fileTest(fileName.c_str()); if (!fileTest) return false; fileTest.close(); return true; }
false
false
false
false
false
0
e_map_remove_point (EMap *map, EMapPoint *point) { g_ptr_array_remove (map->priv->points, point); if (!((EMapPrivate *) map->priv)->frozen) { /* FIXME: Re-scaling the whole pixbuf is more than a little * overkill when just one point is removed */ update_render_surface (map, TRUE); repa...
false
false
false
false
false
0
add_nocompress_suffixes(const char *str) { char *buf, *t; const char *f = str; if (!(buf = new_array(char, strlen(f) + 1))) out_of_memory("add_nocompress_suffixes"); while (*f) { if (*f == '/') { f++; continue; } t = buf; do { if (isUpper(f)) *t++ = toLower(f); else *t++ = *f; } w...
false
false
false
false
false
0
set_ips(struct ns_connection *nc, int is_rem) { struct connection *conn = (struct connection *) nc->user_data; struct mg_connection *c = &conn->mg_conn; char buf[100]; ns_sock_to_str(nc->sock, buf, sizeof(buf), is_rem ? 7 : 3); sscanf(buf, "%47[^:]:%hu", is_rem ? c->remote_ip : c->local_ip, ...
false
false
false
false
false
0
values_for_type(const glsl_type *type) { if (type->is_sampler()) { return 1; } else if (type->is_array() && type->fields.array->is_sampler()) { return type->array_size(); } else { return type->component_slots(); } }
false
false
false
false
false
0
edge_port_probe(struct usb_serial_port *port) { struct edgeport_port *edge_port; int ret; edge_port = kzalloc(sizeof(*edge_port), GFP_KERNEL); if (!edge_port) return -ENOMEM; spin_lock_init(&edge_port->ep_lock); edge_port->port = port; edge_port->edge_serial = usb_get_serial_data(port->serial); edge_port->b...
false
false
false
false
false
0
qede_config_debug(uint debug, u32 *p_dp_module, u8 *p_dp_level) { *p_dp_level = QED_LEVEL_NOTICE; *p_dp_module = 0; if (debug & QED_LOG_VERBOSE_MASK) { *p_dp_level = QED_LEVEL_VERBOSE; *p_dp_module = (debug & 0x3FFFFFFF); } else if (debug & QED_LOG_INFO_MASK) { *p_dp_level = QED_LEVEL_INFO; } else if (debug...
false
false
false
false
false
0
doisearch(dir, c, failing) register ZXchar c; register int dir; bool failing; { static Bufpos buf; Bufpos *bp; if (c != CTL('S') && c != CTL('R')) { if (failing) return NULL; DOTsave(&buf); if (dir == FORWARD) { if (ZXC(linebuf[curchar]) == c || (CaseIgnore && cind_eq(linebuf[curchar], c))) { b...
false
false
false
false
false
0
cp_parser_conversion_type_id (cp_parser* parser) { tree attributes; cp_decl_specifier_seq type_specifiers; cp_declarator *declarator; tree type_specified; /* Parse the attributes. */ attributes = cp_parser_attributes_opt (parser); /* Parse the type-specifiers. */ cp_parser_type_specifier_seq (parser,...
false
false
false
false
false
0
MarkRemove(cbStyledTextCtrl* pControl, int line) { if (line == -1) line = pControl->GetCurrentLine(); if (LineHasBrowseMarker(pControl, line)) //-pControl->MarkerDelete(line, BROWSETRACKER_MARKER); pControl->MarkerDelete(line, GetBrowseMarkerId()); }
false
false
false
false
false
0
debug_state (state_t state) { unsigned char *p; unsigned int i, size = dfa_state_size; sel_print ("state (%u):", size); for (i = 0, p = (unsigned char *) state; i < size; i++) sel_print (" %d", p[i]); sel_print ("\n"); }
false
false
false
false
false
0
jffs2_xattr_free_inode(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic) { /* It's called from jffs2_free_ino_caches() until unmounting FS. */ struct jffs2_xattr_datum *xd; struct jffs2_xattr_ref *ref, *_ref; down_write(&c->xattr_sem); for (ref = ic->xref; ref; ref = _ref) { _ref = ref->next; xd = ref->x...
false
false
false
false
false
0
ShowHideStartPage(bool forceHasProject, int forceState) { // Manager::Get()->GetLogManager()->LogWarning(_("Toggling start page")); if (Manager::IsBatchBuild()) return; // we use the 'forceHasProject' param because when a project is opened // the EVT_PROJECT_OPEN event is fired *before* ProjectM...
false
false
false
false
false
0
endpointInList(const char* ep, const orbServer::EndpointList& eps) { CORBA::ULong i; CORBA::ULong l = eps.length(); for (i=0; i < l; ++i) { if (omni::strMatch(ep, eps[i])) return 1; } return 0; }
false
false
false
false
false
0
exportfs_encode_inode_fh(struct inode *inode, struct fid *fid, int *max_len, struct inode *parent) { const struct export_operations *nop = inode->i_sb->s_export_op; if (nop && nop->encode_fh) return nop->encode_fh(inode, fid->raw, max_len, parent); return export_encode_fh(inode, fid, max_len, parent); }
false
false
false
false
false
0
gt_style_set_num(GtStyle *sty, const char *section, const char *key, double number) { #ifndef NDEBUG int stack_size; #endif int i = 0; gt_assert(sty && section && key); gt_rwlock_wrlock(sty->lock); #ifndef NDEBUG stack_size = lua_gettop(sty->L); #endif i = style_find_section_for_setting(...
false
false
false
false
false
0
Set( wxString const &dataName, wxString const &indepName, double idmin, double idmax, wxString const &errorName, wxString const &typeName, int nParams, wxString const &expression, std::vector<double> &fixed, std::vector<double> &start, ...
false
false
false
false
false
0
msvideo1_decode_init(AVCodecContext *avctx) { Msvideo1Context *s = avctx->priv_data; s->avctx = avctx; /* figure out the colorspace based on the presence of a palette */ if (s->avctx->palctrl) { s->mode_8bit = 1; avctx->pix_fmt = PIX_FMT_PAL8; } else { s->mode_8bit = 0; ...
false
false
false
false
false
0
updateText_WOSD(XMLSTR lpszNewValue, int i) { if (!d) { if (lpszNewValue) free(lpszNewValue); return NULL; } if (i>=d->nText) return addText_WOSD(lpszNewValue); XMLCSTR *p=d->pText+i; if (*p!=lpszNewValue) { free((void*)*p); *p=lpszNewValue; } return lpszNewValue; }
false
false
false
false
false
0
toki_adpcm_int (int data) { static int toggle=0; MSM5205_data_w (0,msm5205next); msm5205next>>=4; toggle ^= 1; if (toggle) cpu_set_nmi_line(1, PULSE_LINE); }
false
false
false
false
false
0
bfad_im_issue_fc_host_lip(struct Scsi_Host *shost) { struct bfad_im_port_s *im_port = (struct bfad_im_port_s *) shost->hostdata[0]; struct bfad_s *bfad = im_port->bfad; struct bfad_hal_comp fcomp; unsigned long flags; uint32_t status; init_completion(&fcomp.comp); spin_lock_irqsave(&bfad->bfad_lock, flags); ...
false
false
false
false
false
0
au_brinfo(struct super_block *sb, union aufs_brinfo __user *arg) { int err; int16_t brid; aufs_bindex_t bindex, bend; size_t sz; char *buf; struct seq_file *seq; struct au_branch *br; si_read_lock(sb, AuLock_FLUSH); bend = au_sbend(sb); err = bend + 1; if (!arg) goto out; err = -ENOMEM; buf = (void *)_...
false
false
false
false
false
0
rescap( BN_STRUCT* pBNS, Vertex u, Vertex v, EdgeIndex iuv ) { BNS_ST_EDGE *pst_edge; BNS_EDGE *pedge; int f; S_CHAR s_or_t; int bBackward = GetEdgePointer( pBNS, u, v, iuv, &pedge, &s_or_t ); if ( !IS_BNS_ERROR(bBackward) ) { if ( s_or_t ) { pst_edge =...
false
false
false
false
false
0
tor_listdir(const char *dirname) { smartlist_t *result; #ifdef _WIN32 char *pattern=NULL; TCHAR tpattern[MAX_PATH] = {0}; char name[MAX_PATH] = {0}; HANDLE handle; WIN32_FIND_DATA findData; tor_asprintf(&pattern, "%s\\*", dirname); #ifdef UNICODE mbstowcs(tpattern,pattern,MAX_PATH); #else strlcpy(tpat...
true
true
true
false
false
1
sinfo_new_convert_0_to_ZERO_for_cubes_range(cpl_imagelist * cube, const int z_min,const int z_max) { int i ; int inp=0; cpl_image* i_img=NULL; if ( cube == NULL ) { sinfo_msg_error("no input cube given!") ; return ; } inp=cpl_image...
false
false
false
false
false
0
parse_log(char *line) { char *log_name; do { log_name = line; line = CPS_SplitWord(line); if (*log_name) { if (!strcmp(log_name, "measurements")) { do_log_measurements = 1; } else if (!strcmp(log_name, "statistics")) { do_log_statistics = 1; } else if (!strcmp(log_name,...
false
false
false
false
false
0
strip(const string& in, const string& identifier) { string result; vector<string> parts; tokenize(in, parts, identifier); for (vector<string>::iterator it = parts.begin(); it != parts.end(); ++it) { result += *it; } return result; }
false
false
false
false
false
0
slam_pull_header ( struct slam_request *slam, struct io_buffer *iobuf ) { void *header = iobuf->data; int rc; /* If header matches cached header, just pull it and return */ if ( ( slam->header_len <= iob_len ( iobuf ) ) && ( memcmp ( slam->header, iobuf->data, slam->header_len ) == 0 )){ iob_pull ...
false
true
false
false
false
1
dir_make_exhash(struct gfs2_inode *dip) { struct gfs2_sbd *sdp = dip->i_sbd; struct gfs2_dirent *dent; struct gfs2_buffer_head *bh; struct gfs2_leaf *leaf; int y; uint32_t x; uint64_t *lp, bn; bn = meta_alloc(dip); bh = bget(sdp, bn); { struct gfs2_meta_header mh; mh.mh_magic = GFS2_MAGIC; mh.mh_type =...
false
false
false
false
false
0
dcs2_custom_start(const struct MachineSound *msound) { const char *names[] = { "DCS DAC R", "DCS DAC L" }; int vols[] = { MIXER(100, MIXER_PAN_RIGHT), MIXER(100, MIXER_PAN_LEFT) }; /* allocate a DAC stream */ dcs.stream = stream_init_multi(2, names, vols, Machine->sample_rate, 0, dcs2_dac_update); /* all...
false
false
false
false
false
0
main(int argc, char *argv[]) { #ifdef _MSC_VER // Memory leak checking _CrtSetDbgFlag(_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | _CRTDBG_ALLOC_MEM_DF | /*_CRTDBG_CHECK_CRT_DF | */_CRTDBG_DELAY_FREE_MEM_DF | _CRTDBG_LEAK_CHECK_DF); #endif // Parse the command line CommandLine *commandline = new CommandLine; Resul...
false
false
false
false
false
0
screenshot_dialog_get_filename (ScreenshotDialog *dialog) { const gchar *file_name; gchar *tmp; GError *error; file_name = gtk_entry_get_text (GTK_ENTRY (dialog->filename_entry)); error = NULL; tmp = g_filename_from_utf8 (file_name, -1, NULL, NULL, &error); if (error) { g_warning ("Unable to c...
false
false
false
false
false
0
SendGlobalSysMessage(const char* str) { // Chat output WorldPacket data; // need copy to prevent corruption by strtok call in LineFromMessage original string char* buf = mangos_strdup(str); char* pos = buf; while (char* line = LineFromMessage(pos)) { ChatHandler::BuildChatPacket(da...
false
false
false
false
false
0
tp_tests_simple_account_manager_finalize (GObject *object) { TpTestsSimpleAccountManager *self = SIMPLE_ACCOUNT_MANAGER (object); g_ptr_array_unref (self->priv->valid_accounts); g_ptr_array_unref (self->priv->invalid_accounts); tp_clear_pointer (&self->create_cm, g_free); tp_clear_pointer (&self->create_pro...
false
false
false
false
false
0
prefs_toolbar_unregister_plugin_item(ToolbarType toolbar_type, const gchar *plugin_name, const gchar *item_name) { GHashTable **hash; hash = get_plugin_hash_from_toolbar_type(toolbar_type); if (hash) toolbar_unregister_plugin_item_real(*hash, plugin_name, item_name); }
false
false
false
false
false
0
restore(void) { if (!myTookKeys) return; #ifndef WIN32 if (myStream == NULL) tcsetattr(fileno(stdin), TCSANOW, &myOriginalTermios); else tcsetattr(fileno(myStream), TCSANOW, &myOriginalTermios); #endif myRestored = true; myTookKeys = false; }
false
false
false
false
false
0
pdec(io *f, int n) { if(n<0){ n=-n; if(n>=0){ pchr(f, '-'); pdec(f, n); return; } /* n is two's complement minimum integer */ n = 1-n; pchr(f, '-'); pdec(f, n/10); pchr(f, n%10+'1'); return; } if(n>9) pdec(f, n/10); pchr(f, n%10+'0'); }
false
false
false
false
false
0
clear_trusted_dir_servers(void) { if (trusted_dir_servers) { SMARTLIST_FOREACH(trusted_dir_servers, trusted_dir_server_t *, ent, trusted_dir_server_free(ent)); smartlist_clear(trusted_dir_servers); } else { trusted_dir_servers = smartlist_new(); } router_dir_info_changed(); }
false
false
false
false
false
0
finalize (GObject *gobject) { GeglPath *self = GEGL_PATH (gobject); GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (self); self = NULL; if (priv->path) gegl_path_list_destroy (priv->path); if (priv->flat_path) gegl_path_list_destroy (priv->flat_path); priv = NULL; G_OBJECT_CLASS (gegl_path...
false
false
false
false
false
0
visitInsertElementInst(InsertElementInst &I) { Type *EltTy = I.getType()->getElementType(); writeOperand(I.getOperand(0)); Out << ";\n "; Out << "(("; printType(Out, PointerType::getUnqual(EltTy)); Out << ")(&" << GetValueName(&I) << "))["; writeOperand(I.getOperand(2)); Out << "] = ("; writeOperand(...
false
false
false
false
false
0
K007232_ReadReg( int r, int chip ) { int ch = 0; if( r == 0x0005 || r == 0x000b ){ ch = r/0x0006; r = ch * 0x0006; kpcm[chip].start[ch] = ((((unsigned int)kpcm[chip].wreg[r + 0x04]<<16)&0x00010000) | (((unsigned int)kpcm[chip].wreg[r + 0x03]<< 8)&0x0000ff00) | (((unsig...
false
false
false
false
false
0
check_zone_nr2 (unsigned int *nr, int *corrected) { if (!*nr) return 0; if (*nr < get_first_zone()) { get_current_name(); printf (_("Zone nr < FIRSTZONE in file `%s'."), current_name); } else if (*nr >= get_nzones()) { get_current_name(); printf (_("Zone nr >= ZONES in file `%s'."), current_name); ...
false
false
false
false
false
0
e820_print_type(u32 type) { switch (type) { case E820_RAM: case E820_RESERVED_KERN: printk(KERN_CONT "usable"); break; case E820_RESERVED: printk(KERN_CONT "reserved"); break; case E820_ACPI: printk(KERN_CONT "ACPI data"); break; case E820_NVS: printk(KERN_CONT "ACPI NVS"); break; case E820_UNUSA...
false
false
false
false
false
0
CLASS_get_inheritance(CLASS *class, CLASS **her) { int nher = 0; while ((nher < MAX_INHERITANCE) && (class != NULL)) { *her++ = class; nher++; class = class->parent; } return nher; }
false
false
false
false
false
0
vga_init_io() { if (iopl(3) < 0) { fprintf(stderr, _("resizecons: cannot get I/O permissions.\n")); exit(1); } crtcport = 0x3d4; if ((my_inb(0x3cc) & 0x01) == 0) crtcport = 0x3b4; }
false
false
false
false
false
0
_secret_session_encode_secret (SecretSession *session, SecretValue *value) { GVariantBuilder *builder; GVariant *result = NULL; GVariantType *type; gboolean ret; g_return_val_if_fail (session != NULL, NULL); g_return_val_if_fail (value != NULL, NULL); type = g_variant_type_new ("...
false
false
false
false
false
0
blkid_probe_vsprintf_value(blkid_probe pr, const char *name, const char *fmt, va_list ap) { struct blkid_prval *v; size_t len; v = blkid_probe_assign_value(pr, name); if (!v) return -1; len = vsnprintf((char *) v->data, sizeof(v->data), fmt, ap); if (len <= 0) { blkid_probe_reset_last_value(pr); return...
false
false
false
false
true
1
type_hash_list (const_tree list, hashval_t hashcode) { const_tree tail; for (tail = list; tail; tail = TREE_CHAIN (tail)) if (TREE_VALUE (tail) != error_mark_node) hashcode = iterative_hash_object (TYPE_HASH (TREE_VALUE (tail)), hashcode); return hashcode; }
false
false
false
false
false
0
sh_mmcif_intr(int irq, void *dev_id) { struct sh_mmcif_host *host = dev_id; struct device *dev = sh_mmcif_host_to_dev(host); u32 state, mask; state = sh_mmcif_readl(host->addr, MMCIF_CE_INT); mask = sh_mmcif_readl(host->addr, MMCIF_CE_INT_MASK); if (host->ccs_enable) sh_mmcif_writel(host->addr, MMCIF_CE_INT, ~...
false
false
false
false
false
0
cik_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib) { struct radeon_ring *ring = &rdev->ring[ib->ring]; unsigned vm_id = ib->vm ? ib->vm->ids[ib->ring].id : 0; u32 header, control = INDIRECT_BUFFER_VALID; if (ib->is_const_ib) { /* set switch buffer packet before const IB */ radeon_ring_write(...
false
false
false
false
false
0
spi_register_board_info(struct spi_board_info const *info, unsigned n) { struct boardinfo *bi; int i; if (!n) return -EINVAL; bi = kzalloc(n * sizeof(*bi), GFP_KERNEL); if (!bi) return -ENOMEM; for (i = 0; i < n; i++, bi++, info++) { struct spi_master *master; memcpy(&bi->board_info, info, sizeof(*inf...
false
false
false
false
false
0
bt_ctf_stream_class_create(const char *name) { struct bt_ctf_stream_class *stream_class = NULL; if (!name || !strlen(name)) { goto error; } stream_class = g_new0(struct bt_ctf_stream_class, 1); if (!stream_class) { goto error; } stream_class->name = g_string_new(name); stream_class->event_classes = g_ptr...
false
false
false
false
false
0
inflatePrime(strm, bits, value) z_streamp strm; int bits; int value; { struct inflate_state FAR *state; if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; state = (struct inflate_state FAR *)strm->state; if (bits > 16 || state->bits + bits > 32) return Z_STREAM_ERROR; value &= (1L ...
false
false
false
false
false
0
tps65910_set_mode(struct regulator_dev *dev, unsigned int mode) { struct tps65910_reg *pmic = rdev_get_drvdata(dev); struct tps65910 *mfd = pmic->mfd; int reg, value, id = rdev_get_id(dev); reg = pmic->get_ctrl_reg(id); if (reg < 0) return reg; switch (mode) { case REGULATOR_MODE_NORMAL: return tps65910_re...
false
false
false
false
false
0
rd_meta_is_broken(FILE *fp) { char buf[MAILTMPLEN]; if(fp == (FILE *)NULL) return -1; if(fp_file_size(fp) < (long)(SIZEOF_PMAGIC + SIZEOF_SPACE + SIZEOF_VERSION_NUM)) return -1; if(fseek(fp, (long)TO_FIND_HDR_PMAGIC, 0)) return -1; /* check for magic */ if(fread(b...
true
true
true
false
true
1
eval_bezier( struct curve_points *cp, int first_point, /* where to start in plot->points (to find x-range) */ int num_points, /* to determine end in plot->points */ double sr, /* position inside curve, range [0:1] */ coordval *px, /* OUTPUT: x and y */ coordval *py, double *c) /* Bezi...
false
false
false
false
false
0