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
toshiba_acpi_report_hotkey(struct toshiba_acpi_dev *dev, int scancode) { if (scancode == 0x100) return; /* Act on key press; ignore key release */ if (scancode & 0x80) return; if (!sparse_keymap_report_event(dev->hotkey_dev, scancode, 1, true)) pr_info("Unknown key %x\n", scancode); }
false
false
false
false
false
0
project_op(PROJECT& project, const char* op) { int retval; SET_LOCALE sl; char buf[512]; const char *tag; RPC rpc(this); if (!strcmp(op, "reset")) { tag = "project_reset"; } else if (!strcmp(op, "detach")) { tag = "project_detach"; } else if (!strcmp(op, "update")) { ...
false
false
false
false
false
0
intersectRay(const G3D::Ray& pRay, float& pMaxDist, bool pStopAtFirstHit) const { if (!iModel) { #ifdef VMAP_DEBUG DEBUG_LOG("<object not loaded>"); #endif return false; } float time = pRay.intersectionTime(iBound); if (time == G3D::inf()) { #i...
false
false
false
false
false
0
montgomery_setup(void *a, void **b) { int err; LTC_ARGCHK(a != NULL); LTC_ARGCHK(b != NULL); *b = XCALLOC(1, sizeof(mp_digit)); if (*b == NULL) { return CRYPT_MEM; } if ((err = mpi_to_ltc_error(mp_montgomery_setup(a, (mp_digit *)*b))) != CRYPT_OK) { XFREE(*b); } return err; }
false
false
false
true
false
1
print(String *str, enum_query_type query_type) { str->append(func_name()); str->append('('); switch (type) { case MYSQL_TIMESTAMP_DATE: str->append(STRING_WITH_LEN("DATE, ")); break; case MYSQL_TIMESTAMP_DATETIME: str->append(STRING_WITH_LEN("DATETIME, ")); break; case MYSQL_TIMESTAMP_TIME:...
false
false
false
false
false
0
SplitVectorStore(SDValue Op, SelectionDAG &DAG) const { StoreSDNode *Store = cast<StoreSDNode>(Op); SDValue Val = Store->getValue(); EVT VT = Val.getValueType(); // If this is a 2 element vector, we really want to scalarize and not create // weird 1 element vect...
false
false
false
false
false
0
wxColStr ( wxColour c ) { unsigned char r, g, b ; r = c.Red (); g = c.Green (); b = c. Blue (); // possible Unicode bug here wxString s = wxDecToHex(r) + wxDecToHex(g) + wxDecToHex(b) ; return s ; }
false
false
false
false
false
0
if_findCompare(const Token * const tokBack) { const Token *tok = tokBack; while (tok && tok->str() == ")") { tok = tok->next(); if (Token::Match(tok,",|==|!=")) return true; if (Token::Match(tok, ") !!{") && tok->link()->previous() && (Token::Match(tok...
false
false
false
false
false
0
printcursor (int both) { int i; flushdatabuffer (); printf ("%8s ", ""); for (i=0; i < sizeof (databuffer); i++) { if (i == 8) putchar (' '); if (i+1 == nbytesprinted) { fputs (" ^ ", stdout); if (!both) break; } else fputs (...
false
false
false
false
false
0
xmpp_stream_get_roster(XmppStream *stream) { xmlnode *node; IqRequest *iq; g_return_if_fail(stream != NULL); xmpp_stream_iqid_increase(stream); iq = iq_request_create(stream, IQ_TYPE_GET); iq_request_set_callback(iq, request_roster_cb, NULL); node = xmlnode_new_child(iq->node, "query")...
false
false
false
false
false
0
RequestData( vtkInformation *vtkNotUsed(request), vtkInformationVector **vtkNotUsed(inputVector), vtkInformationVector *outputVector) { // get the info objects vtkInformation *outInfo = outputVector->GetInformationObject(0); vtkHyperOctree *output = vtkHyperOctree::SafeDownCast( outInfo->Get(vtkDataO...
false
false
false
false
false
0
get_algorithm(void) { if (pos.algorithm!= -1) { const lListElem *sc_ep = lFirst(*(object_type_get_master_list(SGE_TYPE_SCHEDD_CONF))); return lGetPosString(sc_ep, pos.algorithm); } else { return "default"; } }
false
false
false
false
false
0
bsd_alloc (unsigned char *options, int opt_len, int decomp) { int bits; unsigned int hsize, hshift, maxmaxcode; struct bsd_db *db; if (opt_len != 3 || options[0] != CI_BSD_COMPRESS || options[1] != 3 || BSD_VERSION(options[2]) != BSD_CURRENT_VERSION) { return NULL; } bits = BSD_NBI...
false
false
false
false
false
0
FILE_set_owner(const char *path, const char *template) { struct stat info; if (geteuid()) return; if (stat(template, &info)) goto __ERROR; if (chown(path, info.st_uid, info.st_gid)) goto __ERROR; return; __ERROR: unlink(path); THROW("Cannot set file owner: &1: &2", path, strerror(errno)); }
false
false
false
false
true
1
xfs_ialloc_inode_init( struct xfs_mount *mp, struct xfs_trans *tp, struct list_head *buffer_list, int icount, xfs_agnumber_t agno, xfs_agblock_t agbno, xfs_agblock_t length, unsigned int gen) { struct xfs_buf *fbuf; struct xfs_dinode *free; int nbufs, blks_per_cluster, inodes_per_cluster; int ver...
false
false
false
false
false
0
isFormExists(XmlFormName &form, const int type, QString modeName) { // Form info already available bool exists = false; if (modeName.isEmpty()) modeName = "central"; if (form.isAvailableFromDatabase && form.databaseAvailableContents.contains(type)) { if (form.databaseAvailableContents.va...
false
false
false
false
false
0
register_logger(private_bus_t *this, debug_t group, log_entry_t *entry) { enumerator_t *enumerator; linked_list_t *loggers; log_entry_t *current; level_t level; loggers = this->loggers[group]; level = entry->levels[group]; enumerator = loggers->create_enumerator(loggers); while (enumerator->enumera...
false
false
false
false
false
0
ci_otg_del_timer(struct ci_hdrc *ci, enum otg_fsm_timer t) { unsigned long flags, enabled_timer_bits; enum otg_fsm_timer cur_timer, next_timer = NUM_OTG_FSM_TIMERS; if ((t >= NUM_OTG_FSM_TIMERS) || !(ci->enabled_otg_timer_bits & (1 << t))) return; spin_lock_irqsave(&ci->lock, flags); ci->enabled_otg_timer_b...
false
false
false
false
false
0
setNumColumns(FXint nc){ if(nc<1 || nc>=MAXNUM){ fxerror("%s::setNumColumns: bad number of columns specified.\n",getClassName()); } if((options&MATRIX_BY_COLUMNS) && num!=nc){ num=nc; recalc(); } }
false
false
false
false
false
0
cubic_peak( FT_Pos q1, FT_Pos q2, FT_Pos q3, FT_Pos q4 ) { FT_Pos peak = 0; FT_Int shift; /* This function finds a peak of a cubic segment if it is above 0 */ /* using iterative bisection of the segment, or returns 0. */ /* The fixed-p...
false
false
false
false
false
0
move_stars(frame *my_frame) { int i, j; move_object *my_move = NULL; gc_sound_play_ogg ("sounds/level.wav", NULL); for (i = 0 ; i < nb_list() ; i++) { for (j = 0 ; j < my_frame->nb_stars[i] ; j++) { if ((my_move = g_malloc(sizeof(move_object))) == NULL) { // Freed in function smooth_move g_error...
false
false
false
false
false
0
setRootPixmap(int screen_num, Pixmap pm) { if (s_root_pixmaps.empty()) { int i; for (i = 0; i < ScreenCount(display()); ++i) s_root_pixmaps.push_back(None); } if (s_root_pixmaps[screen_num] != pm) { s_root_pixmaps[screen_num] = pm; FbWindow::updatedAlphaBackgrou...
false
false
false
false
false
0
stdp_dump(GF_Box *a, FILE * trace) { GF_DegradationPriorityBox *p; u32 i; p = (GF_DegradationPriorityBox *)a; fprintf(trace, "<DegradationPriorityBox EntryCount=\"%d\">\n", p->nb_entries); DumpBox(a, trace); gf_full_box_dump(a, trace); if (!p->priorities) { fprintf(trace, "<!--Warning: No Degradation Priorit...
false
false
false
false
false
0
shared_object_dlsym(s48_call_t call, s48_ref_t handle, s48_ref_t name) { const char *error; void *entry; void *native_handle; s48_ref_t res; char *native_name; native_handle = s48_extract_value_2(call, handle, void *); native_name = s48_extract_byte_vector_readonly_2(call, name); entry = dlsym(nati...
false
false
false
false
false
0
jswrap_net_server_listen(JsVar *parent, int port) { JsNetwork net; if (!networkGetFromVarIfOnline(&net)) return; serverListen(&net, parent, port); networkFree(&net); }
false
false
false
false
false
0
static_name (gamgi_window *window, char *name) { gamgi_orbital *orbital; GtkWidget *dialog = window->dialog0; GtkWidget *entry; GtkWidget *button; char string[GAMGI_ENGINE_STRING]; int active; entry = (GtkWidget *) g_object_get_data (G_OBJECT (dialog), "entry_orbital"); orbital = GAMGI_CAST_ORBITAL gamgi_gtk_object_n...
false
false
false
false
false
0
GenerateIsObject(ZoneList<Expression*>* args) { // This generates a fast version of: // (typeof(arg) === 'object' || %_ClassOf(arg) == 'RegExp') ASSERT(args->length() == 1); Load(args->at(0)); Result obj = frame_->Pop(); obj.ToRegister(); Condition is_smi = masm_->CheckSmi(obj.reg()); destination()->fal...
false
false
false
false
false
0
opt_determine_and_normalize_test_conds( /*===================================*/ sel_node_t* sel_node, /*!< in: select node */ ulint i) /*!< in: ith table in the join */ { plan_t* plan; plan = sel_node_get_nth_plan(sel_node, i); UT_LIST_INIT(plan->end_conds); UT_LIST_INIT(plan->other_conds); /* Recursively g...
false
false
false
false
false
0
register_one_ns( HashStringValue::key_type key, HashStringValue::value_type value, Register_one_ns_info* info) { if(const String* svalue=value->get_string()) xmlXPathRegisterNs(info->ctxt, info->r->transcode(key), info->r->transcode(*svalue)); else throw Exception(PARSER_RU...
false
false
false
false
false
0
onCmdItemDeselected(FXObject*,FXSelector,void*){ register FXint i; FXString text,file; if(selectmode==SELECTFILE_MULTIPLE){ for(i=0; i<filebox->getNumItems(); i++){ if(filebox->isItemSelected(i) && !filebox->isItemDirectory(i)){ if(!text.empty()) text+=' '; text+="\""+filebox->getItemFil...
false
false
false
false
false
0
gkm_template_find (GArray *template, CK_ATTRIBUTE_TYPE type) { g_return_val_if_fail (template, NULL); return gkm_attributes_find ((CK_ATTRIBUTE_PTR)template->data, template->len, type); }
false
false
false
false
false
0
mono_class_get_exception_for_failure (MonoClass *klass) { gpointer exception_data = mono_class_get_exception_data (klass); switch (klass->exception_type) { #ifndef DISABLE_SECURITY case MONO_EXCEPTION_SECURITY_INHERITANCEDEMAND: { MonoDomain *domain = mono_domain_get (); MonoSecurityManager* secman = mono_secur...
false
false
false
false
false
0
hostmasktoregex(const char *str) { char *tempstr; int i,j; int maxlen; updatecontext(); if (!str) return NULL; maxlen = 2 + (strlen(str) * 11); tempstr = mycalloc(maxlen+1); tempstr[0] = '^'; for (i=0,j=1; i<sstrlen(str); i++,j++) { if ( (str[i] >= 'a' && str[i] <= ...
false
false
false
false
false
0
go_plugin_service_get_description (GOPluginService *service) { g_return_val_if_fail (GO_IS_PLUGIN_SERVICE (service), NULL); if (service->saved_description == NULL) { service->saved_description = GO_PLUGIN_SERVICE_GET_CLASS (service)->get_description (service); } return service->saved_description; }
false
false
false
false
false
0
draw_tempo(double x_init, double y_init, struct atempo* t) /* print out tempo as specified in Q: field */ /* this goes to the left of the tune's title */ { int base, base_exp, dots; double x, y; char ticks[30]; if (t != NULL) { x = x_init; y = y_init; /* fprintf(f, "gsave 0.7 0.7 scale\n...
false
false
false
false
false
0
z_erase_line (void) { int i; if (gos_upper && gos_curwin == gos_upper) { for (i = 0; i < h_screen_cols + 1 - curx; i++) glk_put_char(' '); glk_window_move_cursor(gos_curwin, curx - 1, cury - 1); } }
false
false
false
false
false
0
compute_factor_base(QS_t * qs_inf) { unsigned long fb_prime = 2; unsigned long multiplier = qs_inf->k; prime_t * factor_base = qs_inf->factor_base; uint32_t * sqrts = qs_inf->sqrts; unsigned long num_primes = num_FB_primes(qs_inf->bits); unsigned long prime, nmod; double pinv; fmpz_t n ...
false
false
false
false
false
0
path_unregister(void *data) { struct serial_device *device = data; DBG("Unregistered interface %s on path %s", SERIAL_PORT_INTERFACE, device->path); devices = g_slist_remove(devices, device); serial_device_free(device); }
false
false
false
false
false
0
writeWithoutVersion(std::ostream &oStream) const { oStream << "BoundingBox "; oStream << m_bBoxMin.X() << " " << m_bBoxMin.Y() << " " << m_bBoxMin.Z() << " "; oStream << m_bBoxMax.X() << " " << m_bBoxMax.Y() << " " << m_bBoxMax.Z() << "\n"; ...
false
false
false
false
false
0
From_Alias_To_Stream_2(WamWord alias_word, WamWord stm_word) { int stm; stm = Find_Stream_By_Alias(Rd_Atom_Check(alias_word)); return stm >= 0 && Get_Integer(stm, stm_word); }
false
false
false
false
false
0
__add_hash_entry(struct ftrace_hash *hash, struct ftrace_func_entry *entry) { struct hlist_head *hhd; unsigned long key; if (hash->size_bits) key = hash_long(entry->ip, hash->size_bits); else key = 0; hhd = &hash->buckets[key]; hlist_add_head(&entry->hlist, hhd); hash->count++; }
false
false
false
false
false
0
j2k_destroy (opj_j2k_t *p_j2k) { if (p_j2k == 00) { return; } if (p_j2k->m_is_decoder) { if (p_j2k->m_specific_param.m_decoder.m_default_tcp != 00) { j2k_tcp_destroy(p_j2k->m_specific_param.m_decoder.m_default_tcp); opj_free(p_j2k->m_specific_param.m_decoder.m_default_tc...
false
false
false
false
false
0
mpc_probe(AVProbeData *p) { const uint8_t *d = p->buf; if (ff_id3v2_match(d)) { d += ff_id3v2_tag_len(d); } if (d+3 < p->buf+p->buf_size) if (d[0] == 'M' && d[1] == 'P' && d[2] == '+' && (d[3] == 0x17 || d[3] == 0x7)) return AVPROBE_SCORE_MAX; return 0; }
false
false
false
false
false
0
uca_file_camera_start_recording(UcaCamera *camera, GError **error) { UcaFileCameraPrivate *priv; g_return_if_fail (UCA_IS_FILE_CAMERA (camera)); priv = UCA_FILE_CAMERA_GET_PRIVATE (camera); if (priv->fnames == NULL) { g_set_error (error, UCA_CAMERA_ERROR, UCA_CAMERA_ERROR_END_OF_STREAM, ...
false
false
false
false
false
0
pick() { int score = -INFTY; int m = -1; for (unsigned int i=current_move_no+1; i<movelist.size(); i++) { if (movelist[i] == hashmv) { /* Hash move was already returned by first() */ continue; } else if (movelist.get_score(i) > score) { score = movelist.get_score(i); m = i; } } if (m == -1) { ...
false
false
false
false
false
0
eth_rx_overrun(struct nic *nic) { int start_time; #ifdef INCLUDE_WD if (eth_flags & FLAG_790) outb(D8390_COMMAND_PS0 | D8390_COMMAND_STP, eth_nic_base+D8390_P0_COMMAND); else #endif outb(D8390_COMMAND_PS0 | D8390_COMMAND_RD2 | D8390_COMMAND_STP, eth_nic_base+D8390_P0_COMMAND); /* wait for at least 1.6ms - ...
false
true
false
false
false
1
complex4_p1(Term s, Term t, int *n) { BOOL dummy; int i; for (i = 0; i < ARITY(s); i++) complex4_p1(ARG(s,i), t, n); dummy = complex4_p2(s, t, n); }
false
false
false
false
false
0
exofs_last_byte(struct inode *inode, unsigned long page_nr) { loff_t last_byte = inode->i_size; last_byte -= page_nr << PAGE_CACHE_SHIFT; if (last_byte > PAGE_CACHE_SIZE) last_byte = PAGE_CACHE_SIZE; return last_byte; }
false
false
false
false
false
0
crash_load_segments(struct kimage *image) { unsigned long src_start, src_sz, elf_sz; void *elf_addr; int ret; /* * Determine and load a segment for backup area. First 640K RAM * region is backup source */ ret = walk_system_ram_res(KEXEC_BACKUP_SRC_START, KEXEC_BACKUP_SRC_END, image, determine_backup_re...
false
false
false
false
false
0
operator<< (std::ostream &os, const DeviceEntry &de) { os << setfill(' ') << setw(8) << de.GetPin().Str(); os << "|" << setfill(' ') << setw(35) << de.GetDeviceName(); os << "|" << setfill(' ') << setw(4) << (de.IsConnected() ? _C("yes") : _C("no")); os << "|" << setfill(' ') << setw(4) << (de.IsConfigured() ? _C("...
false
false
false
false
false
0
is_arcadia_rom (const TCHAR *path) { struct arcadiarom *rom; rom = is_arcadia (path, 0); if (!rom || rom->type == NO_ARCADIA_ROM) return NO_ARCADIA_ROM; if (rom->type == ARCADIA_BIOS) { arcadia_bios = rom; return ARCADIA_BIOS; } arcadia_game = rom; return ARCADIA_GAME; }
false
false
false
false
false
0
shell_command_output_string(String cmdline, const String &input, ErrorHandler *errh) { FILE *f; int pfd[2] = {-1, -1}; pid_t child = -1; StringAccum sa; if (!(f = tmpfile())) { errh->error("%<%s%>: tmpfile: %s", cmdline.c_str(), strerror(errno)); goto out; } ignore_result(fwrite(input.dat...
false
false
false
false
true
1
Do() { if(!c) return STALL; if(!fg_data) fg_data=c->GetFgData(fg); if(done) return STALL; if(c->Error()) { const char *error=c->ErrorText(); const char *name=GetDispName(); if(!strstr(error,name)) error=xstring::cat(name,": ",error,NULL); eprintf("%s: %s\n",op....
false
false
false
false
false
0
fft(GwyContainer *data, GwyRunType run) { GwyDataField *dfield, *tmp, *raout, *ipout; FFTArgs args; gboolean ok; gint id; g_return_if_fail(run & FFT_RUN_MODES); gwy_app_data_browser_get_current(GWY_APP_DATA_FIELD, &dfield, GWY_APP_DATA_FIELD_ID, &id, ...
false
false
false
false
false
0
efichar_from_char(efi_char16_t *dest, const char *src, size_t dest_len) { int i, src_len = strlen(src); for (i=0; i < src_len && i < (dest_len/sizeof(*dest)) - 1; i++) { dest[i] = src[i]; } dest[i] = 0; return i * sizeof(*dest); }
false
false
false
false
false
0
transcriptNewCpyFeatures(EnsPTranscript transcript) { AjIList iter = NULL; EnsPBasealignfeature newbaf = NULL; EnsPBasealignfeature oldbaf = NULL; EnsPExon newexon = NULL; EnsPExon oldexon = NULL; EnsPIntronsupportingevidence newise = NULL; EnsPIntronsupportingevidence oldise = NULL; ...
false
false
false
false
false
0
get_bg2_tile_info( int offset ) { int tile_number = grchamp_videoram[offset+0x800*2]+256*2; SET_TILE_INFO( 1, tile_number, 0, 0) }
false
false
false
false
false
0
db185_put(db185p, key185, data185, flags) const DB185 *db185p; DBT185 *key185; const DBT185 *data185; u_int flags; { DB *dbp; DBC *dbcp_put; DBT key, data; int ret, t_ret; dbp = db185p->dbp; memset(&key, 0, sizeof(key)); key.data = key185->data; key.size = key185->size; memset(&data, 0, sizeof(data)); d...
false
false
false
false
false
0
gru_alloc_locked_gts(unsigned long vaddr) { struct mm_struct *mm = current->mm; struct vm_area_struct *vma; struct gru_thread_state *gts = ERR_PTR(-EINVAL); down_write(&mm->mmap_sem); vma = gru_find_vma(vaddr); if (!vma) goto err; gts = gru_alloc_thread_state(vma, TSID(vaddr, vma)); if (IS_ERR(gts)) goto ...
false
false
false
false
false
0
job_abort(void *prv) { struct g2d_ctx *ctx = prv; struct g2d_dev *dev = ctx->dev; if (dev->curr == NULL) /* No job currently running */ return; wait_event_timeout(dev->irq_queue, dev->curr == NULL, msecs_to_jiffies(G2D_TIMEOUT)); }
false
false
false
false
false
0
miSubtractO (GeglRegion *pReg, GeglRegionBox *r1, GeglRegionBox *r1End, GeglRegionBox *r2, GeglRegionBox *r2End, gint y1, gint y2) { GeglRegionBox *pNextRect; int x1; x1 = r1->x1; g_assert (y1 < y2)...
false
false
false
false
false
0
vl_kdforest_new (vl_type dataType, vl_size dimension, vl_size numTrees, VlVectorComparisonType distance) { VlKDForest * self = vl_calloc (sizeof(VlKDForest), 1) ; assert(dataType == VL_TYPE_FLOAT || dataType == VL_TYPE_DOUBLE) ; assert(dimension >= 1) ; assert(numTrees >= 1) ; self -> rand ...
false
false
false
false
false
0
reboot_setup(char *str) { for (;;) { /* * Having anything passed on the command line via * reboot= will cause us to disable DMI checking * below. */ reboot_default = 0; switch (*str) { case 'w': reboot_mode = REBOOT_WARM; break; case 'c': reboot_mode = REBOOT_COLD; break; case 'h...
false
false
false
false
false
0
search_same_name_module_table(module_kind kind, char * name) { Module_table *module; int entry; int max; max = get_max_module_entry(kind); if (kind == MODULE_MAIN) { entry = 0; } else { entry = 1; } for (; entry <= max; entry++) { module = get_module_table(kind...
false
false
false
false
false
0
FIDIVR_DWORD_INTEGER(bxInstruction_c *i) { #if BX_SUPPORT_FPU BX_CPU_THIS_PTR prepareFPU(i); RMAddr(i) = BX_CPU_CALL_METHODR(i->ResolveModrm, (i)); Bit32s load_reg = (Bit32s) read_virtual_dword(i->seg(), RMAddr(i)); BX_CPU_THIS_PTR FPU_update_last_instruction(i); clear_C1(); if (IS_TAG_EMPTY(0)) { ...
false
false
false
false
false
0
add_constituents ( const PseudoJet & jet, vector<PseudoJet> & subjet_vector) const { // find out position in cluster history int i = jet.cluster_hist_index(); int parent1 = _history[i].parent1; int parent2 = _history[i].parent2; if (parent1 == InexistentParent) { // It is an original particle ...
false
false
false
false
false
0
type_not_soa_nor_ns_p(dns_rdata_t *update_rr, dns_rdata_t *db_rr) { UNUSED(update_rr); return ((db_rr->type != dns_rdatatype_soa && db_rr->type != dns_rdatatype_ns && db_rr->type != dns_rdatatype_nsec3param && db_rr->type != dns_rdatatype_rrsig && db_rr->type != dns_rdatatype_nsec) ? ISC_TRUE : ISC_FALS...
false
false
false
false
false
0
find_key(object *pl, object *container, object *door) { object *tmp, *key; /* Should not happen, but sanity checking is never bad */ if (container->inv == NULL) return NULL; /* First, lets try to find a key in the top level inventory */ tmp = NULL; if (door->type == DOOR) { tmp...
false
false
false
false
false
0
zero(const problem *ego_) { const problem_mpi_dft *ego = (const problem_mpi_dft *) ego_; R *I = ego->I; INT i, N; int my_pe; MPI_Comm_rank(ego->comm, &my_pe); N = 2 * ego->vn * XM(total_block)(ego->sz, IB, my_pe); for (i = 0; i < N; ++i) I[i] = K(0.0); }
false
false
false
false
false
0
subCost(int idx) { if (idx<0) return 0; /* update if needed as cost could be calculated dynamically in subclasses * this can change _count !! */ if (_dirty) update(); if (idx>=_count) return 0; return _cost[idx]; }
false
false
false
false
false
0
Resize(int length) { // Check if length is valid assert(length >= nentries); assert(nentries <= nallocated); // Check if are growing array if (length > nallocated) { // Adjust length to be next greater power of 2 int tmplength = RN_ARRAY_MIN_ALLOCATED; while (tmplength < length) tmplength *= 2; ...
false
false
false
false
false
0
toaplan2_irq(int irq_line) { if (cpu_getiloops() == 0) current_scanline = 255; if(current_scanline == 245) { cpu_set_irq_line(0, irq_line, HOLD_LINE); vblank_irq = 1; } current_scanline++; if(current_scanline > 261) { current_scanline = 0; vblank_irq = 0; } }
false
false
false
false
false
0
lt_extension_compare(const lt_extension_t *v1, const lt_extension_t *v2) { int i; char *s1 = NULL, *s2 = NULL; lt_ext_module_t *m = NULL; lt_bool_t retval = TRUE; if (v1 == v2) return TRUE; /* matching the wildcard each other */ if ((v1 && v1->extensions[LT_MAX_EXT_MODULES - 1]) || (v2 && v2->exte...
false
false
false
false
false
0
seahorse_object_set_preferred (SeahorseObject *self, SeahorseObject *value) { g_return_if_fail (SEAHORSE_IS_OBJECT (self)); if (self->pv->preferred == value) return; if (self->pv->preferred) g_object_remove_weak_pointer (G_OBJECT (self->pv->preferred), (gpointer*)&self->pv->preferred); self->pv->preferred =...
false
false
false
false
false
0
CamLoad(Camera *cam, char *name) { IOBFILE *f; if((f = iobfopen(name,"r")) == NULL) { perror(name); return NULL; } cam = CamFLoad(cam, f, name); iobfclose(f); return cam; }
false
false
false
false
false
0
ConvertToNative(const std::string& strRawFilename, const std::string& strTargetFilename, uint64_t iHeaderSkip, uint64_t iComponentSize, uint64_t iComponentCount, bool bSigned, bool bFloatingPoint, UINT64VECTOR3 vVolumeSize,FLOATVECTOR3 vVolumeAspect, bool bNoUse...
false
false
false
false
false
0
final_value_is_known() const { // If we are not generating an executable, then no final values are // known, since they will change at runtime. if (parameters->options().output_is_position_independent() || parameters->options().relocatable()) return false; // If the symbol is not from an object file,...
false
false
false
false
false
0
matrix_get_colname (NODE *l, NODE *r, parser *p) { NODE *ret = aux_string_node(p); if (ret != NULL && starting(p)) { int c = node_get_int(r, p); ret->v.str = user_matrix_get_column_name(l->v.m, c, &p->err); } return ret; }
false
false
false
false
false
0
SetTimeStep( vtkIdType t ) { LSDynaMetaData* p = this->P; if ( p->CurrentState == t ) { return; } // If the time step is set before RequestInformation is called, we must // read the header information immediately in order to determine whether // the timestep that's been passed is valid. If it's n...
false
false
false
false
false
0
ves_icall_System_Threading_Monitor_Monitor_test_synchronised (MonoObject *obj) { MonoThreadsSync *mon; LOCK_DEBUG (g_message("%s: (%d) Testing if %p is owned by any thread", __func__, GetCurrentThreadId (), obj)); mon = obj->synchronisation; #ifdef HAVE_MOVING_COLLECTOR { LockWord lw; lw.sync = mon; if (lw...
false
false
false
false
false
0
p_ac_position(Ac_position ac, int n) { if (!ac) printf("\nac_position is NULL.\n"); else { printf("\nac_position, context c3:\n"); p_context(ac->c3); printf("\nSub problems:\n"); if (!ac->sub_position) printf("none.\n"); else { Btu_state bt; /* Get to the beginning of the l...
false
false
false
false
false
0
lookhost(netid_t hid) { static char buf[100]; struct hostent *hp; if (hid == 0L) return ""; if (!(hp = gethostbyaddr((char *) &hid, sizeof(hid), AF_INET))) { struct in_addr addr; addr.s_addr = hid; sprintf(buf, "%s:", inet_ntoa(addr)); } else sprintf(buf, "%s:", hp->h_name); return buf; }
true
true
false
false
false
1
make_revoked(X509_REVOKED *rev, const char *str) { char *tmp = NULL; int reason_code = -1; int i, ret = 0; ASN1_OBJECT *hold = NULL; ASN1_GENERALIZEDTIME *comp_time = NULL; ASN1_ENUMERATED *rtmp = NULL; ASN1_TIME *revDate = NULL; i = unpack_revinfo(&revDate, &reason_code, &hold, &comp_time, str); if (i == ...
false
false
false
false
false
0
fileio_scandir(const fn_call& fn) { // GNASH_REPORT_FUNCTION; // TODO: Check optional second parameter and sort array if it's true // or missing. if (!fn.nargs) return as_value(false); const std::string& dir = fn.arg(0).to_string(); struct dirent **namelist; const int n = ::scandir(di...
false
false
false
false
false
0
create_helix_filter(BI_helix *helix,AP_filter *filter){ long *result = (long *)calloc(sizeof(long),(size_t)filter->real_len); long *temp = (long *)calloc(sizeof(long),(size_t)filter->real_len); int i,count; count = 0; for (i=0;i<filter->filter_len;i++) { if (filter->filter_mask[i]) { ...
false
false
false
false
false
0
frecencyScore(const QModelIndex &sourceIndex) const { QDateTime loadTime = sourceModel()->data(sourceIndex, HistoryModel::DateTimeRole).toDateTime(); int days = loadTime.daysTo(m_scaleTime); if (days <= 1) { return 100; } else if (days < 5) { // within the last 4 days return 90; } e...
false
false
false
false
false
0
sigset_op(sigset_t *s1, sigset_t *s2, int delp) { struct sigdesc *desc = sigDesc; for (; desc->name; desc++) { if (sigismember(s2, desc->num)) { if (!delp) sigaddset(s1, desc->num); else sigdelset(s1, desc->num); } } }
false
false
false
false
false
0
unbind() { CanvasRep& c = *this; if (c.display_ != nil) { XDisplay* dpy = c.dpy(); if (c.copybuffer_ != CanvasRep::unbound) { XFreePixmap(dpy, c.drawbuffer_); c.xdrawable_ = c.copybuffer_; c.copybuffer_ = CanvasRep::unbound; if (c.copygc_ != nil) { XFreeGC(dpy, c.copygc_); c.copygc_ = ...
false
false
false
false
false
0
add_pkcs_padding( unsigned char *output, size_t output_len, size_t data_len ) { size_t padding_len = output_len - data_len; unsigned char i = 0; for( i = 0; i < padding_len; i++ ) output[data_len + i] = (unsigned char) padding_len; }
false
false
false
false
false
0
camel_session_authenticate_sync (CamelSession *session, CamelService *service, const gchar *mechanism, GCancellable *cancellable, GError **error) { CamelSessionClass *class; gboolean suc...
false
false
false
true
false
1
setup( bool messageLine, const PG_Rect& mapView ) { displayLogMessage ( 5, "MainScreenWidget: initializing panels:\n"); dataLoaderTicker(); displayLogMessage ( 7, " Mapdisplay "); mapDisplay = new MapDisplayPG( this, mapView ); mapDisplay->SetID( ASC_PG_App::mapDisplayID ); dataLoaderTicker(); ...
false
false
false
false
false
0
glade_base_editor_project_add_widget (GladeProject * project, GladeWidget * widget, GladeBaseEditor * e) { if (e->priv->updating_treeview) return; if (glade_base_editor_is_child (e, widget, TRUE)) { e->priv->updating_treeview = TRUE; g_idle_add (glade_base_...
false
false
false
false
false
0
NC3_inq_typeid(int ncid, const char *name, nc_type *typeidp) { int i; for (i = 0; i <= ATOMICTYPEMAX; i++) if (!strcmp(name, NC_atomictypename(i))) { if (typeidp) *typeidp = i; return NC_NOERR; } return NC_ENOTNC4; }
false
false
false
false
false
0
DeleteChunkList() { if (pSubChunks) { ChunkList::iterator iter = pSubChunks->begin(); ChunkList::iterator end = pSubChunks->end(); while (iter != end) { delete *iter; iter++; } delete pSubChunks; pSubChunks ...
false
false
false
false
false
0
operator= (const FileNode &node) { logger.msg(Arc::VERBOSE, "FileNode: operator= (%s <- %s) %lu <- %lu", point, node.point, (unsigned long int)this, (unsigned long int)(&node)); if(plug) if(plug->release() == 0) { logger.msg(Arc::VERBOSE, "Copying with dlclose"); delete plug; dlclose(handle); handle=NULL; i...
false
false
false
false
false
0
settings_set_size(const char *key, const char *value) { int size; if (!parse_size(value, &size)) return FALSE; iconfig_node_set_str(settings_get_node(key), key, value); return TRUE; }
false
false
false
false
false
0
create_text_legend(int nlines, char **text_per_line, int do_separator) { int status; TextLegend_t *tl; int i; ESL_ALLOC(tl, sizeof(TextLegend_t)); /* initialize */ tl->text_per_line = NULL; /* set caller specified values */ tl->nlines = nlines; tl->do_separator = do_separator; ESL_ALLOC(tl->text...
false
false
false
false
false
0
mulMPP(polynomial1 mi, polynomial1 P1, polynomial1 P2) { polynomial1 p,m=mi; int i,free_m=0; m->R=P1->R; if (P1==0||m==0) { if (P2!=0) freeP(P2); return 0;} if (P1->R!=m->R){ printf("\nRings must be equal in mulMPP"); if (P2!=0) freeP(P2); retur...
false
false
false
false
false
0
find_line(const char *ptr, const char * const *lines, size_t line_count) { const char * const *orig = lines; const char * const *orig_e = lines+line_count; while (line_count > 1) { size_t middle = line_count>>1; if (ptr < lines[middle]) line_count = middle; else { lines += middle; line_count -= midd...
false
false
false
false
false
0
event(QEvent * e) { switch (e->type()) { case QEvent::WindowActivate: emit changeActivationSignal(true, this); break; case QEvent::WindowDeactivate: emit changeActivationSignal(false, this); break; default: break; } return FritzingWindow::event(e); }
false
false
false
false
false
0