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
clone(ClonePolicy<Function>& pol, Instruction *i) const { TexInstruction *tex = (i ? static_cast<TexInstruction *>(i) : new_TexInstruction(pol.context(), op)); Instruction::clone(pol, tex); tex->tex = this->tex; if (op == OP_TXD) { for (unsigned int c = 0; c < tex->tex.tar...
false
false
false
false
false
0
print_results(double x) { if (!IO::plotout.any()) { _out.setfloatwidth(OPT::numdgt, OPT::numdgt+6); assert(x != NOT_VALID); _out << x; for (PROBELIST::const_iterator p=printlist().begin(); p!=printlist().end(); ++p) { _out << p->value(); } _out << '\n'; }else{ } }
false
false
false
false
false
0
set_cr4_guest_host_mask(struct vcpu_vmx *vmx) { vmx->vcpu.arch.cr4_guest_owned_bits = KVM_CR4_GUEST_OWNED_BITS; if (enable_ept) vmx->vcpu.arch.cr4_guest_owned_bits |= X86_CR4_PGE; if (is_guest_mode(&vmx->vcpu)) vmx->vcpu.arch.cr4_guest_owned_bits &= ~get_vmcs12(&vmx->vcpu)->cr4_guest_host_mask; vmcs_writel(C...
false
false
false
false
false
0
remember_source_file(const nstring &path) { nstring prog = path.first_dirname(); if (prog != "lib") prog = "bin/" + prog; nstring_list *source_file_list = source_list.query(prog); if (!source_file_list) { source_file_list = new nstring_list(); source_list.assign(prog, source_file_list); ...
false
false
false
false
false
0
afHashval (symbol, size) /* from Aho/Ullman */ char *symbol; int size; { register char *p; register unsigned long hval, g; hval = 0; for (p = symbol; *p != '\0'; p++) { hval = (hval << 4) ^ (*p); if ((g = hval & 0xf0000000)) { hval = hval ^ (g >> 24); hval = hval ^ g; } } ...
false
false
false
false
false
0
globus_object_cache_remove (globus_object_cache_t * cache, void * handle) { globus_object_t * object; if ( cache == NULL ) return NULL; object = globus_hashtable_remove (&(cache->handlemap), handle); globus_fifo_remove (&(cache->handles), handle); if ( object != NULL ) cache->entry_c...
false
false
false
false
false
0
json_print_pwr_in_stats(struct activity *a, int curr, int tab, unsigned long long itv) { int i; struct stats_pwr_in *spc; int sep = FALSE; if (!IS_SELECTED(a->options) || (a->nr <= 0)) goto close_json_markup; json_markup_power_management(tab, OPEN_JSON_MARKUP); tab++; xprintf(tab++, "\"voltage-input\":...
false
false
false
false
false
0
getOdometry(poses::CPose2D &out_odom) { #if MRPT_HAS_ARIA ASSERTMSG_(THE_ROBOT!=NULL, "Robot is not connected") THE_ROBOT->lock(); ArPose pose = THE_ROBOT->getEncoderPose(); out_odom.x( pose.getX() * 0.001 ); out_odom.y( pose.getY() * 0.001 ); out_odom.phi( DEG2RAD( pose.getTh() ) ); THE_ROBOT->unlock(); #else...
false
false
false
false
false
0
_backup_audio_convert_orc_unpack_s32_swap (OrcExecutor * ORC_RESTRICT ex) { int i; int n = ex->n; orc_union32 * ORC_RESTRICT ptr0; const orc_union32 * ORC_RESTRICT ptr4; orc_union32 var33; orc_union32 var34; orc_union32 var35; ptr0 = (orc_union32 *)ex->arrays[0]; ptr4 = (orc_union32 *)ex->arrays[4]; ...
false
false
false
false
false
0
vsyscall_setup(char *str) { if (str) { if (!strcmp("emulate", str)) vsyscall_mode = EMULATE; else if (!strcmp("native", str)) vsyscall_mode = NATIVE; else if (!strcmp("none", str)) vsyscall_mode = NONE; else return -EINVAL; return 0; } return -EINVAL; }
false
false
false
false
false
0
current_token_is_not_variable(int tok) { if (tok == T_WORD) word_is_not_variable(&(yylval.word), yylloc); else if (tok == T_CWORD) cword_is_not_variable(&(yylval.cword), yylloc); else yyerror("syntax error"); }
false
false
false
false
false
0
log_energies(short **x, int *N, int Fs, int normalize_energies, float silence_floor, float scaling_factor) { int nframes = 0; int fwin = DEFAULT_SHORTTERM_WINLEN_MS * Fs; int fstep = DEFAULT_SHORTTERM_WINSHIFT_MS * Fs; int add_samp = 0; short *frames = sconstruct_frames(x, N, fwin, fwin - fstep, &n...
false
false
false
false
false
0
setCursiveGlyph() { if (direction < 0) { if (position <= nextLimit || position >= prevLimit) { return; } } else { if (position <= prevLimit || position >= nextLimit) { return; } } glyphPositionAdjustments->setCursiveGlyph(position, baselineIsLogic...
false
false
false
false
false
0
free_blacklist (vector blist) { struct blentry * ble; int i; if (!blist) return; vector_foreach_slot (blist, ble, i) { if (ble) { regfree(&ble->regex); FREE(ble->str); FREE(ble); } } vector_free(blist); }
false
false
false
false
false
0
calc_asincos(VMG_ vm_obj_id_t self, vm_val_t *retval, uint *argc, int is_acos) { char *new_ext; /* check arguments and set up the result */ if (setup_getp_0(vmg_ self, retval, argc, &new_ext)) return TRUE; /* calculate the arcsin/arccos into the result *...
false
false
false
false
false
0
innerHeight(void) const { return (label()->mapped()==MSTrue)?label()->height():0; }
false
false
false
false
false
0
sym_find_initial_bounds(sym_environment *env) { double total_time = 0; int termcode = 0; /* Finds the upper and lower bounds for the problem */ CALL_WRAPPER_FUNCTION( start_heurs_u(env) ); if (!env->par.do_branch_and_cut){ printf("\n****************************************************\n"); ...
false
false
false
false
false
0
getZoneIdByMetazone(const UnicodeString &mzid, const UnicodeString &region, UnicodeString &result) { UErrorCode status = U_ZERO_ERROR; const UChar *tzid = NULL; int32_t tzidLen = 0; char keyBuf[ZID_KEY_MAX + 1]; int32_t keyLen = 0; if (mzid.isBogus() || mzid.length() > ZID_KEY_MAX) { re...
false
false
false
false
false
0
getKeypoints(const char* szImageFile, Image& rImage) { FILE* pf = fopen(szImageFile, "rb"); if (!pf) { std::cout << "Cannot open " << szImageFile << std::endl; return std::vector<Key>(); } rImage = ReadPGM(pf); KeyList keys = GetKeypoints(rImage); fclose(pf); return keys; }
false
false
false
false
false
0
eval_pos_init_sheet (GnmEvalPos *ep, Sheet const *sheet) { g_return_val_if_fail (ep != NULL, NULL); g_return_val_if_fail (IS_SHEET (sheet), NULL); ep->eval.col = ep->eval.row = 0; ep->sheet = (Sheet *)sheet; ep->dep = NULL; ep->array = NULL; return ep; }
false
true
false
false
false
1
bdisp_hw_alloc_nodes(struct bdisp_ctx *ctx) { struct device *dev = ctx->bdisp_dev->dev; unsigned int i, node_size = sizeof(struct bdisp_node); void *base; dma_addr_t paddr; DEFINE_DMA_ATTRS(attrs); /* Allocate all the nodes within a single memory page */ dma_set_attr(DMA_ATTR_WRITE_COMBINE, &attrs); base = dma...
false
false
false
false
false
0
ReadTables(void) { if(m_FinalBlock) // test it throw E_INVALIDDATA; m_FinalBlock = (m_InBitStream.ReadBits(kFinalBlockFieldSize) == NFinalBlockField::kFinalBlock); int aBlockType = m_InBitStream.ReadBits(kBlockTypeFieldSize); switch(aBlockType) { case NBlockType::kStored: { m_StoredMo...
false
false
false
false
false
0
send_antispy(struct uo_client *client) { struct uo_packet_hardware p; memset(&p, 0, sizeof(p)); p = (struct uo_packet_hardware){ .cmd = PCK_Hardware, .unknown0 = 2, .instance_id = htonl(0xdeadbeef), .os_major = htonl(5), .os_minor = 0, .os_revision = 0, ...
false
false
false
false
false
0
ASN1_TYPE_cmp(ASN1_TYPE *a, ASN1_TYPE *b) { int result = -1; if (!a || !b || a->type != b->type) return -1; switch (a->type) { case V_ASN1_OBJECT: result = OBJ_cmp(a->value.object, b->value.object); break; case V_ASN1_NULL: result = 0; /* They do not have content. */ break; case V_ASN1_INTEGER: case...
false
false
false
false
false
0
ScrBarSetLengthsAndPos(Widget gw, long c_l, long s_l, long s_p) { ScrBarWidget w = (ScrBarWidget)gw; w->scrbar.canvas_length = c_l; w->scrbar.slider_length = s_l; w->scrbar.slider_position = s_p; fit_scrbar(w); calc_scrbar_coords(w); if (XtIsRealized((Widget)w)) draw_thumb(w, NULL); }
false
false
false
false
false
0
xmpp_reset_stream (struct vink_xmpp_state *state) { XML_ParserReset (state->xml_parser, "utf-8"); XML_SetUserData (state->xml_parser, state); XML_SetElementHandler (state->xml_parser, xmpp_start_element, xmpp_end_element); XML_SetCharacterDataHandler (state->xml_parser, xmpp_character_data); XML_SetStartNames...
false
false
false
false
false
0
new_fine_window(OldX,OldY,X,Y) int OldX,OldY,X,Y; { int NewWindowWidth, Hei, Wid, Tmp, CenterX, CenterY; if (Parameters.kpRedisplayControl == COARSEVIEWPORTONLY) { SaveLastView(); Wid = X - OldX; Hei = Y - OldY; if (Wid < 0) Wid = -Wid; if (Hei < 0) Hei = -Hei; ...
false
false
false
false
false
0
app_temp_file(GSview *app, TCHAR *fname, int len) { TCHAR *temp; #if defined(UNIX) || defined(OS2) long fd; #endif memset(fname, 0, len*sizeof(TCHAR)); if ( (temp = csgetenv(TEXT("TEMP"))) == NULL ) #ifdef UNIX csncpy(fname, "/tmp", len-1); #else csgetcwd(fname, len-1); #endif else csncpy(fna...
false
false
false
false
false
0
val_acq_cred_pw_args( OM_uint32 *minor_status, const gss_name_t desired_name, const gss_buffer_t password, OM_uint32 time_req, const gss_OID_set desired_mechs, int cred_usage, gss_cred_id_t *output_cred_handle, gss_OID_set *actual_mechs, OM_uint32 *time_rec) { /* Initialize outp...
false
false
false
false
false
0
bluetooth_init(struct ibm_init_struct *iibm) { int res; int status = 0; vdbg_printk(TPACPI_DBG_INIT | TPACPI_DBG_RFKILL, "initializing bluetooth subdriver\n"); TPACPI_ACPIHANDLE_INIT(hkey); /* bluetooth not supported on 570, 600e/x, 770e, 770x, A21e, A2xm/p, G4x, R30, R31, R40e, R50e, T20-22, X20-21 */ ...
false
false
false
false
false
0
updateTOCsOnBookmarkChange(const gchar * pBookmark) { UT_return_val_if_fail( pBookmark && !isLayoutFilling(), false ); bool bChange = false; for(UT_sint32 i = 0; i < getNumTOCs(); ++i) { fl_TOCLayout * pTOC = getNthTOC(i); UT_return_val_if_fail( pTOC, false ); if(pTOC->getRangeBookmarkName().size() && !str...
false
false
false
false
false
0
extend_clear_callback(int majorID, int minorID, void *serverarg, void *clientarg) { extend_registration_block *eptr, *enext = NULL; for ( eptr=ereg_head; eptr; eptr=enext ) { enext=eptr->next; netsnmp_unregister_handler( eptr->reg[0] ); netsnmp_unregister_handler( ep...
false
false
false
false
false
0
add_phi(string name) { if (phis.count(name) == 0) { set<pair<string, BasicBlock*> > aux; for (vector<BasicBlock*>::iterator it = preds.begin(); it < preds.end(); it++) { aux.insert(make_pair(name, *it)); } phis.insert(make_pair(name, aux)); return true; } return false; }
false
false
false
false
false
0
precalc_first() { CARD::precalc_first(); if (has_common()) { try { mutable_common()->precalc_first(scope()); }catch (Exception_Precalc& e) { error(bWARNING, long_label() + ": " + e.message()); } _mfactor = common()->mfactor(); }else{ } _mfactor.e_val(1, scope()); _value.e_val(...
false
false
false
false
false
0
pgetc2() { int c; do { c = pgetc_macro(); } while (c == PEOA); return c; }
false
false
false
false
false
0
_e_menu_unrealize(E_Menu *m) { Eina_List *l; E_Menu_Item *mi; if (!m->realized) return; evas_event_freeze(m->evas); e_container_shape_hide(m->shape); e_object_del(E_OBJECT(m->shape)); m->shape = NULL; e_box_freeze(m->container_object); EINA_LIST_FOREACH(m->items, l, mi) _e_menu_item_unr...
false
false
false
false
false
0
operator= ( const Usecode_value& v2 ) { if (&v2 == this) return *this; if (type == array_type) delete [] value.array; else if (type == string_type) delete [] value.str; type = v2.type; // Assign new values. if (type == int_type) value.intval = v2.value.intval; else if (type == pointer_type) value....
false
false
false
false
false
0
miner_finished_cb (TrackerMinerFS *fs, gdouble seconds_elapsed, guint total_directories_found, guint total_directories_ignored, guint total_files_found, guint total_files_ignore...
false
false
false
false
false
0
gst_dvd_spu_handle_dvd_event (GstDVDSpu * dvdspu, GstEvent * event) { gboolean hl_change = FALSE; GST_INFO_OBJECT (dvdspu, "DVD event of type %s on subp pad OOB=%d", gst_structure_get_string (event->structure, "event"), (GST_EVENT_TYPE (event) == GST_EVENT_CUSTOM_DOWNSTREAM_OOB)); switch (dvdspu->sp...
false
false
false
false
false
0
cb_begin(GtkPrintOperation *operation, GtkPrintContext *context, gPrinter *printer) { #if DEBUG_ME fprintf(stderr, "cb_begin\n"); #endif printer->defineSettings(); //gtk_print_settings_to_file(gtk_print_operation_get_print_settings(operation), "/home/benoit/settings-begin-before.txt", NULL); if (printer->onBegin)...
false
false
false
false
false
0
FactJNGetVar2( void *theEnv, void *theValue, DATA_OBJECT_PTR returnValue) { struct fact *factPtr; struct factGetVarJN2Call *hack; struct field *fieldPtr; /*==========================================*/ /* Retrieve the arguments for the function. */ /*==========================================*...
false
false
false
false
false
0
wl1273_get_format(struct snd_soc_codec *codec, unsigned int *fmt) { struct wl1273_priv *wl1273; if (codec == NULL || fmt == NULL) return -EINVAL; wl1273 = snd_soc_codec_get_drvdata(codec); switch (wl1273->mode) { case WL1273_MODE_FM_RX: case WL1273_MODE_FM_TX: *fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_...
false
false
false
false
false
0
test_object_blob_fromchunks__can_create_a_blob_from_a_in_memory_chunk_provider(void) { git_oid expected_oid, oid; git_object *blob; int howmany = 7; cl_git_pass(git_oid_fromstr(&expected_oid, "321cbdf08803c744082332332838df6bd160f8f9")); cl_git_fail_with( git_object_lookup(&blob, repo, &expected_oid, GIT_OBJ_A...
false
false
false
false
false
0
is_reject_ip(struct sockaddr *addr) { rb_patricia_node_t *pnode; reject_t *rdata; int duration; /* Reject is disabled */ if(ConfigFileEntry.reject_after_count == 0 || ConfigFileEntry.reject_duration == 0) return 0; pnode = rb_match_ip(reject_tree, addr); if(pnode != NULL) { rdata = pnode->data; if(rd...
false
false
false
false
false
0
wig_bmap(double x0, double y0, float data0, float data1, double z0, double z1, double dev_x, double dev_y) /* apply current sample with all options to bitmap */ { double xp0, xp1, yp0, yp1, slope; int px0, px1, py0, py1, ix, iy; GMT_geoz_to_xy (x0+(double)data0*dev_x, y0+(double)data0*dev_y, z0, &xp0, &yp0); /* ret...
false
false
false
false
false
0
HandleReclaimCorpseOpcode(WorldPacket& recv_data) { DETAIL_LOG("WORLD: Received opcode CMSG_RECLAIM_CORPSE"); ObjectGuid guid; recv_data >> guid; if (GetPlayer()->IsAlive()) { return; } // body not released yet if (!GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST)) { ret...
false
false
false
false
false
0
EvalFunccall3args ( Expr call ) { Obj result; /* value of function call, result */ Obj func; /* function */ Obj arg1; /* first argument */ Obj arg2; ...
false
false
false
false
false
0
arglisttail(CS& File) { if (File.skip1b(",")) { expression(File); arglisttail(File); }else{ } }
false
false
false
false
false
0
DoLowerHakkarHitPoints() { if (Creature* pHakkar = GetSingleCreatureFromStorage(NPC_HAKKAR)) { if (pHakkar->IsAlive() && pHakkar->GetMaxHealth() > HP_LOSS_PER_PRIEST) { pHakkar->SetMaxHealth(pHakkar->GetMaxHealth() - HP_LOSS_PER_PRIEST); pHakkar->SetHealth(pHakkar->GetHea...
false
false
false
false
false
0
PR_alias_tc(const char* id, const char* name, CORBA::TypeCode_ptr original_type, CORBA::TypeCode::_Tracker* tracker) { check_static_data_is_initialised(); CORBA::TypeCode_ptr r = the_typecodes->find(id); if (r) return r; r = new TypeCode_alias(id, name, ToTcBase(original_type)); tracker->add...
false
false
false
false
false
0
process_note (Elf_Internal_Note * pnote) { const char * name = pnote->namesz ? pnote->namedata : "(NONE)"; const char * nt; if (pnote->namesz == 0) /* If there is no note name, then use the default set of note type strings. */ nt = get_note_type (pnote->type); else if (const_strneq (pnote->nam...
false
false
false
false
false
0
i7core_remove(struct pci_dev *pdev) { struct i7core_dev *i7core_dev; edac_dbg(0, "\n"); /* * we have a trouble here: pdev value for removal will be wrong, since * it will point to the X58 register used to detect that the machine * is a Nehalem or upper design. However, due to the way several PCI * devices ...
false
false
false
false
false
0
nm_gconf_migrate_0_7_keyring_items (GConfClient *client) { GSList *connections, *iter; connections = gconf_client_all_dirs (client, GCONF_PATH_CONNECTIONS, NULL); for (iter = connections; iter; iter = iter->next) { GnomeKeyringResult ret; GList *found_list = NULL, *found_iter; char *uuid = NULL; char *old_i...
false
false
false
false
false
0
repository_alloc(void) { git_repository *repo = git__calloc(1, sizeof(git_repository)); if (!repo) return NULL; if (git_cache_init(&repo->objects) < 0) { git__free(repo); return NULL; } /* set all the entries in the cvar cache to `unset` */ git_repository__cvar_cache_clear(repo); return repo; }
false
false
false
false
false
0
gstspu_vobsub_render_line_with_chgcol (SpuState * state, guint8 * planes[3], guint16 * rle_offset) { SpuVobsubLineCtrlI *chg_col = state->vobsub.cur_chg_col; gint16 x, next_x, disp_end, rle_code, run_end, run_draw_end; SpuColour *colour; SpuVobsubPixCtrlI *cur_pix_ctrl; SpuVobsubPixCtrlI *next_pix_ctrl; ...
false
false
false
false
false
0
xaccInitTransaction (Transaction * trans, QofBook *book) { ENTER ("trans=%p", trans); qof_instance_init_data (&trans->inst, GNC_ID_TRANS, book); LEAVE (" "); }
false
false
false
false
false
0
parse_statusfield(StatusField *field, const char *s) { const char *t; memset(field, 0, sizeof(*field)); field->internal = -1; if (is_quote(*s)) { /* string literal */ STATIC_BUFFER(buffer); if (!stringliteral(buffer, &s)) { eprintf("%S", buffer); return NULL;...
false
false
false
false
false
0
led_trigger_blink_setup(struct led_trigger *trig, unsigned long *delay_on, unsigned long *delay_off, int oneshot, int invert) { struct led_classdev *led_cdev; if (!trig) return; read_lock(&trig->leddev_list_lock); list_for_each_entry(led_cdev, &trig->led_cdevs, trig_list) { if ...
false
false
false
false
false
0
freeGroup(bdescr *p) { nat ln; // Todo: not true in multithreaded GC // ASSERT_SM_LOCK(); ASSERT(p->free != (P_)-1); p->free = (void *)-1; /* indicates that this block is free */ p->gen = NULL; p->gen_no = 0; /* fill the block group with garbage if sanity checking is on */ IF_DEBUG(sanity,memset(p...
false
false
false
false
false
0
flush_rect(SDL_Rect rect, bool force_flush) { if (is_flush_queued && !force_flush) { sdl_dirty_rect(rect); } else { static SDL_Rect src, dst; if (correct_rect_region(&rect)) { static int i = 0; dst = rect; if (C_S_RUNNING == client_state()) { flush_mapcanvas(dst.x, ds...
false
false
false
false
false
0
aboutDialog( void ) { static GdkPixbuf *psAboutLogo = NULL; GtkWidget *psDialog = NULL;; const gchar *apnAuthors[] = { "Jan-Michael Brummer <jan.brummer@tabos.org>", "", "Patches by:", "Christian von Behren <admin@grizzlysoft.de>", "Whoopie", "Michael Burkhard", "Bastian Kleineidam", "Louis Lagendijk...
true
true
false
false
false
1
lpfc_sli4_mbox_rsrc_extent(struct lpfc_hba *phba, struct lpfcMboxq *mbox, uint16_t exts_count, uint16_t rsrc_type, bool emb) { uint8_t opcode = 0; struct lpfc_mbx_nembed_rsrc_extent *n_rsrc_extnt = NULL; void *virtaddr = NULL; /* Set up SLI4 ioctl command header fields */ if (emb == LPFC_SLI4_MBX_NEMBED) { ...
false
false
false
true
false
1
process_left_cb(fetion_account *ac, const gchar *sipmsg) { extern GSList *channel_list; GSList *pos; g_return_if_fail(ac != NULL); g_return_if_fail(sipmsg != NULL); hybrid_debug_info("fetion", "buddy left, recv:\n%s", sipmsg); for (pos = channel_list; pos; pos = pos->next) { if...
false
false
false
false
false
0
confchar(u_int status) { static char letrs[] = "QIicNCoOMKARYSLPHV"; char *s = letrs; status &= ~(CONF_MATCH|CONF_ILLEGAL); for (; *s; s++, status >>= 1) if (status & 1) return *s; return '-'; }
false
false
false
false
false
0
visit(node& n, bool enter) { if (enter) { assert(n.subtype == NST_PSI); try_inline(n); // TODO eliminate predication until there is full support in all passes // unpredicate instructions and replace psi-nodes with conditional moves eliminate(n); } return false; }
false
false
false
false
false
0
b2D_set_bind(GF_Node *node, GF_Route *route) { Background2DStack *stack = (Background2DStack *)gf_node_get_private(node); Bindable_OnSetBind(node, stack->reg_stacks, NULL); if (stack->drawable->flags & DRAWABLE_IS_OVERLAY) { stack->txh.compositor->video_out->Blit(stack->txh.compositor->video_out, NULL, NULL, NULL...
false
false
false
false
false
0
dv_offset_reset(DVDemuxContext *c, int64_t frame_offset) { c->frames= frame_offset; if (c->ach) c->abytes= av_rescale_q(c->frames, c->sys->time_base, (AVRational){8, c->ast[0]->codec->bit_rate}); c->audio_pkt[0].size = c->audio_pkt[1].size = 0; c->audio_pkt[2].siz...
false
false
false
false
false
0
globus_rw_cond_wait( globus_cond_t * cond, globus_rw_mutex_t * rw_lock) { int rc; globus_bool_t reading; globus_mutex_lock(&rw_lock->mutex); { reading = (rw_lock->readers > 0); if(reading)...
false
false
false
false
false
0
battery_scale(int log) { int scale = 1; while (log--) scale *= 10; return scale; }
false
false
false
false
false
0
scanLineForAllMacros(char *buffer, MACRO_STRUCT **m) { int i; for (i=0; ; i++) { if (macroDefs[i].macroName==0) return 0; if (scanLine(&macroDefs[i], buffer, m)==1) return 1; } return 0; }
true
true
false
false
true
1
xdr_simx_session_handle (XDR *xdrs, simx_session_handle *objp) { register int32_t *buf; int i; if (!xdr_opaque (xdrs, objp->data, 4)) return FALSE; if (!xdr_dis_simulation_addr (xdrs, &objp->address)) return FALSE; return TRUE; }
false
false
false
false
false
0
mod_output_result (dico_result_t rp, size_t n, dico_stream_t str) { struct result *res = (struct result *) rp; const struct index_entry *ep; if (!res->itr) { res->itr = dico_list_iterator(res->list); if (!res->itr) return 1; } ep = dico_iterator_item(res->itr, n); switch (res->...
false
false
false
false
false
0
cfg_trim_line(char *buf) { char *start, *end; /* * Leading and trailing white space is eliminated completely */ start = buf; while (apr_isspace(*start)) ++start; /* blast trailing whitespace */ end = &start[strlen(start)]; while (--end >= start && apr_isspace(*end)) ...
false
false
false
false
true
1
tspDoEchoRequest(char *address, tBrokerAddressType address_type, tConf *conf, uint32_t *distance) { rttengine_stat_t *engine = NULL; struct addrinfo *address_info = NULL; struct addrinfo *address_info_root = NULL; pal_socket_t sfd; tSocketAddressStatus socket_address_status = SOCKET_ADDRESS_OK; tRedirectSta...
false
false
false
false
false
0
factor_sum(int num) { int i; int limit = sqrt(num); int sum = 0; for (i = 1; i <= limit; i++) { if (num % i == 0) { sum += (i + (num / i)); } } //remove the number from the sum since we added when //i = 1; a number is not a factor with itself return sum - num; }
false
false
false
false
false
0
AddPrimitiveStructures() { // NOTE: these are just dummies. Their presence enforces // Structure::Convert<target_type> to be called on these // empty structures. These converters are special // overloads which scan the name of the structure and // perform the required data type conversion if one // of these spec...
false
false
false
false
false
0
SetIP(uint32 ip_as_host_order_integer) { hostname_.clear(); literal_ = false; ip_ = IPAddress(ip_as_host_order_integer); }
false
false
false
false
false
0
read_fake_keyfile (const char *path) { const char *fake_group = "[mpid-data]\n"; char *data; char *munged; gsize data_size; gsize munged_data_size; GKeyFile *keyfile; GError *error = NULL; if (g_file_get_contents (path, &data, &data_size, &error) == FALSE) { mpid_debug ("unable to read contents of file %s: %...
false
false
false
false
false
0
disconnect_dest (edge e) { basic_block dest = e->dest; unsigned int dest_idx = e->dest_idx; dest->preds->unordered_remove (dest_idx); /* If we removed an edge in the middle of the edge vector, we need to update dest_idx of the edge that moved into the "hole". */ if (dest_idx < EDGE_COUNT (dest->preds)...
false
false
false
false
false
0
ai_amphibious_goto_constrained(struct unit *ferry, struct unit *passenger, struct tile *ptile, struct pft_amphibious *parameter) { bool alive = TRUE; struct player *pplayer = unit_owner(passenger); struct pf_map *pfm; struct pf_path *path; fc_assert_ret_val(pplayer->ai_controlled, TRU...
false
false
false
false
false
0
type_from_string(const char *type_str, TwType & type) { // first check default types for(int j = 0; j < RETW_NUM_DEFAULT_TYPE_STRINGS; j++) { if(strcmp(type_str,ReTwDefaultTypeStrings[j].type_str) == 0) { type = ReTwDefaultTypeStrings[j].type; return true; break; } } // then che...
false
false
false
false
false
0
s_error_cache_init (void) { char * tmp_string; if(globus_module_activate(GLOBUS_OBJECT_MODULE) != GLOBUS_SUCCESS) { return GLOBUS_FAILURE; } globus_thread_key_create(&s_peek_key, s_key_destructor_func); globus_object_cache_init (&s_result_to_object_mapper); lo...
false
false
false
false
false
0
send(const std::string &packet_channel, const CL_NetPacket &packet, bool reliable) { if (impl == NULL) throw CL_Error("CL_NetComputer::send not allowed on an unattached netcomputer object"); if (reliable) { impl->send_packet(packet_channel, packet.impl); } else { impl->send_packet_udp(packet_channel, packe...
false
false
false
false
false
0
main(int argc, char **argv) { isc_result_t result; tries = 2; ISC_LIST_INIT(lookup_list); ISC_LIST_INIT(server_list); ISC_LIST_INIT(search_list); fatalexit = 1; #ifdef WITH_IDN idnoptions = IDN_ASCCHECK; #endif debug("main()"); progname = argv[0]; pre_parse_args(argc, argv); result = isc_app_start(); ch...
false
false
false
false
false
0
ecurve2_add(_MIPD_ epoint *p,epoint *pa) { /* pa=pa+p; */ /* An ephemeral pointer to the line slope is returned * * only if curve is super-singular */ #ifdef MR_OS_THREADS miracl *mr_mip=get_mip(); #endif if (mr_mip->ERNUM) return NULL; MR_IN(129) if (p==pa) { e...
false
false
false
false
false
0
read() { DBG(cerr << "Entering TestSequence::read for " << name() << endl); if (read_p()) return true; DBG(cerr << "current: " << d_current << ", length: " << d_len << endl); // When we get to the end of a Sequence, reset the row number counter so // that, in case this is an in...
false
false
false
false
false
0
_dirreq_map_put(dirreq_map_entry_t *entry, dirreq_type_t type, uint64_t dirreq_id) { dirreq_map_entry_t *old_ent; tor_assert(entry->type == type); tor_assert(entry->dirreq_id == dirreq_id); /* XXXX we could switch this to HT_INSERT some time, since it seems that * this bug doesn't happen. But...
false
false
false
false
false
0
DspInitTables(void) { if (!tables_ok) { int i; for (i = -255; i <= 255; ++i) { abs0[255 + i] = (i < 0) ? -i : i; abs1[255 + i] = abs0[255 + i] >> 1; } for (i = -1020; i <= 1020; ++i) { sclip1[1020 + i] = (i < -128) ? -128 : (i > 127) ? 127 : i; } for (i = -112; i <= 112; ++i)...
false
false
false
false
false
0
zip_read_data_none(struct archive_read *a, const void **_buff, size_t *size, int64_t *offset) { struct zip *zip; const char *buff; ssize_t bytes_avail; (void)offset; /* UNUSED */ zip = (struct zip *)(a->format->data); if (zip->entry->flags & ZIP_LENGTH_AT_END) { const char *p; /* Grab at least 16 byte...
false
false
false
false
false
0
linemap_add (struct line_maps *set, enum lc_reason reason, unsigned int sysp, source_location from_line, const char *to_file, unsigned int to_line) { struct line_map *map; if (set->used && from_line < set->maps[set->used - 1].from_line) abort (); if (set->used == set->allocated) { set-...
false
false
false
false
false
0
column (const String& colName, bool caseSensitive) const { bool isFound = false; std::map<String,Column*>::const_iterator key = m_column.begin(); if (caseSensitive) { key = m_column.find(colName); isFound = (key != m_column.end()); } else { const string lcColName = FITSUtil::lowerCase(col...
false
false
false
false
false
0
tree_prev(struct tree *pos) { struct tree *node = NULL; if (pos != pos->parent->children) { for (node = pos->parent->children; node->next != pos; node = node->next); } return node; }
false
false
false
false
false
0
gog_object_get_parent_typed (GogObject const *obj, GType t) { g_return_val_if_fail (GOG_IS_OBJECT (obj), NULL); for (; obj != NULL ; obj = obj->parent) if (G_TYPE_CHECK_INSTANCE_TYPE (obj, t)) return GOG_OBJECT (obj); /* const cast */ return NULL; }
false
false
false
false
false
0
FGettext(char *str) { flist *l = FGPathList; const char *s; if (!HaveNLSSupport || !FGettextInitOk || FGPathList == NULL || str == NULL) { return str; } if (FGLastPath != l->object) { (void)bindtextdomain (FGP_DOMAIN(l), FGP_DIR(l)); (void)textdomain (FGP_DOMAIN(l)); FGLastPath = l->object; } s ...
false
false
false
false
false
0
Draw () { gcp::Theme *pTheme = m_pView->GetDoc ()->GetTheme (); if (m_Item) { static_cast <Line *> (m_Item)->SetPosition (m_x0, m_y0, m_x1, m_y1); } else { m_Item = new gccv::Line (m_pView->GetCanvas (), m_x0, m_y0, m_x1, m_y1); static_cast <LineItem *> (m_Item)->SetLineColor (gcp::AddColor); static_cast <Li...
false
false
false
false
false
0
refresh_fc_eg_slot(FM_SLOT *SLOT , int fc , int kc ) { int ksr; /* (frequency) phase increment counter */ SLOT->Incr = ((fc+SLOT->DT[kc])*SLOT->mul) >> 1; ksr = kc >> SLOT->KSR; if( SLOT->ksr != ksr ) { SLOT->ksr = ksr; /* calculate envelope generator rates */ if ((SLOT->ar + SLOT->ksr) < 32...
false
false
false
false
false
0
setBase(const Location &loc) { if (loc.origin().isNull()) haveCurrentBase_ = 0; else { haveCurrentBase_ = 1; base_.push_back(loc); } }
false
false
false
false
false
0
gdImageCreateFromJpegEx(FILE *inFile, int ignore_warning) { gdImagePtr im; gdIOCtx *in = gdNewFileCtx(inFile); if (in == NULL) return NULL; im = gdImageCreateFromJpegCtxEx(in, ignore_warning); in->gd_free(in); return im; }
false
false
false
false
false
0
test_status_worktree__conflict_with_diff3(void) { git_repository *repo = cl_git_sandbox_init("status"); git_index *index; unsigned int status; git_index_entry ancestor_entry, our_entry, their_entry; memset(&ancestor_entry, 0x0, sizeof(git_index_entry)); memset(&our_entry, 0x0, sizeof(git_index_entry)); memset(&...
false
false
false
false
false
0
random_rayleigh_pdf (gnm_float x, gnm_float sigma) { if (x < 0) return 0; else { gnm_float u = x / sigma; return (u / sigma) * gnm_exp (-u * u / 2.0); } }
false
false
false
false
false
0