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
Rivetparser_Init( Tcl_Interp *interp ) { #ifdef USE_TCL_STUBS if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) #else if (Tcl_PkgRequire(interp, "Tcl", TCL_VERSION, 0) == NULL) #endif { return TCL_ERROR; } RIVET_OBJ_CMD("parserivet",Parse_Rivet); RIVET_OBJ_CMD("parserivetdata",Parse...
false
false
false
false
false
0
_ecore_con_socks_svr_init_v4(Ecore_Con_Server *svr, Ecore_Con_Socks_v4 *v4) { size_t addrlen, buflen, ulen = 1; unsigned char *sbuf; addrlen = v4->lookup ? strlen(svr->name) + 1 : 0; if (v4->username) ulen += v4->ulen; buflen = sizeof(char) * (8 + ulen + addrlen); sbuf = malloc(buflen); if (!sbuf...
false
true
false
false
false
1
mcxUsage ( FILE* fp , const char* caller , const char** lines ) { int i = 0 ; while(lines[i]) { fprintf(fp, "%s\n", lines[i]) ; i++ ; } fprintf(fp, "[%s] Printed %d lines\n", caller, i+1) ; }
false
false
false
false
false
0
ieee80211_frequency_to_channel(int freq) { int base; if (freq == 2484) return 14; if (freq < 2484) base = 2407; else if (freq >= 4910 && freq <= 4980) base = 4000; else base = 5000; return (freq - base) / 5; }
false
false
false
false
false
0
student_critval (double df, double a) { double x; if (df < 0) { return NADBL; } if (a > .10) { x = stdtri(df, 1 - a); } else { x = -stdtri(df, a); } if (get_cephes_errno()) { x = NADBL; } return x; }
false
false
false
false
false
0
compute_plussi_length (rtx *operands) { enum machine_mode mode = GET_MODE (operands[0]); if (mode != SImode) abort (); if (TARGET_H8300) { if (GET_CODE (operands[2]) == REG) return 6; if (GET_CODE (operands[2]) == CONST_INT) { HOST_WIDE_INT n = INTVAL (operands[2]); if ((n & 0xffff...
false
false
false
false
false
0
SubstParallelEquiv ( CNet* net, CNet* nwa, CNet* nwb, CNet*& equiv, boolean& reversed, Orientation orient ) { CCnxn* ca = nwa->Cnxn(); CCnxn* cb = nwb->Cnxn(); reversed = IsCrossover(ca, cb); if (reversed) { ca->Reverse(); } equiv = net->CreateNetwork( net->CreateCnxn( ...
false
false
false
false
false
0
add_huff_table (j_decompress_ptr dinfo, JHUFF_TBL ** htblptr, const UINT8 * bits, const UINT8 * val) /* Define a Huffman table */ { int nsymbols, len; if (*htblptr == NULL) *htblptr = jpeg_alloc_huff_table ((j_common_ptr) dinfo); g_assert (*htblptr); /* Copy the number-of-symbols-of-each-code-length ...
false
false
false
false
false
0
ips_issue_copperhead(ips_ha_t * ha, ips_scb_t * scb) { uint32_t TimeOut; uint32_t val; METHOD_TRACE("ips_issue_copperhead", 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, s...
false
false
false
false
false
0
EstimateNewtonStep() { IndexRangeType fullrange; fullrange[0] = 0; fullrange[1] = this->m_Gradient.GetSize()-1; //range is inclusive /* Perform the modification either with or without threading */ if( this->m_Gradient.GetSize() > 10000 ) { /* This ends up calling EstimateNewtonStepOverSubRange from e...
false
false
false
false
false
0
udp_connect(int local_port,char *remote_host,int remote_port) { struct addrinfo hints,*res,*res0; struct sockaddr_storage st; int error, sck = -1; char port_str[20]; memset(&hints,0,sizeof(hints)); hints.ai_family = PF_UNSPEC; hints.ai_socktype = SOCK_DGRAM; snprintf(port_str,sizeof(port_str),...
true
true
false
false
false
1
_bfd_elf_set_osabi (bfd * abfd, struct bfd_link_info * link_info ATTRIBUTE_UNUSED) { Elf_Internal_Ehdr * i_ehdrp; /* ELF file header, internal form. */ i_ehdrp = elf_elfheader (abfd); i_ehdrp->e_ident[EI_OSABI] = get_elf_backend_data (abfd)->elf_osabi; /* To make things simpler for the loader on Linux...
false
false
false
false
false
0
EmitSLEB128IntValue(int64_t Value) { SmallString<128> Tmp; raw_svector_ostream OSE(Tmp); encodeSLEB128(Value, OSE); EmitBytes(OSE.str()); }
false
false
false
false
false
0
ubifs_unlink(struct inode *dir, struct dentry *dentry) { struct ubifs_info *c = dir->i_sb->s_fs_info; struct inode *inode = d_inode(dentry); struct ubifs_inode *dir_ui = ubifs_inode(dir); int sz_change = CALC_DENT_SIZE(dentry->d_name.len); int err, budgeted = 1; struct ubifs_budget_req req = { .mod_dent = 1, .dir...
false
false
false
false
false
0
lm87_detect(struct i2c_client *client, struct i2c_board_info *info) { struct i2c_adapter *adapter = client->adapter; const char *name; u8 cid, rev; if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) return -ENODEV; if (lm87_read_value(client, LM87_REG_CONFIG) & 0x80) return -ENODEV; /* Now, w...
false
false
false
false
false
0
watchdog_write(struct file *filp, const char __user *buf, size_t count, loff_t *offset) { int ret; struct fschmd_data *data = filp->private_data; if (count) { if (!nowayout) { size_t i; /* Clear it in case it was set with a previous write */ data->watchdog_expect_close = 0; for (i = 0; i != count; ...
false
false
false
false
false
0
slapi_mtn_set_referral(const Slapi_DN *sdn, char ** referral) { Slapi_PBlock pb; Slapi_Mods smods; int rc = LDAP_SUCCESS,i = 0, j = 0; Slapi_DN* node_sdn; char **values = NULL; int do_modify = 0; slapi_mods_init (&smods, 0); node_sdn = slapi_get_mapping_tree_node_configsdn(sdn); if(...
false
false
false
false
false
0
xfs_next_bit(uint *map, uint size, uint start_bit) { uint * p = ((unsigned int *) map) + (start_bit >> BIT_TO_WORD_SHIFT); uint result = start_bit & ~(NBWORD - 1); uint tmp; size <<= BIT_TO_WORD_SHIFT; if (start_bit >= size) return -1; size -= result; start_bit &= (NBWORD - 1); if (start_bit) { tmp = *p++...
false
false
false
false
false
0
fill_cmd_set_power_cycle_interval (uint8_t interval, fiid_obj_t obj_cmd_rq) { if (!fiid_obj_valid (obj_cmd_rq)) { SET_ERRNO (EINVAL); return (-1); } if (FIID_OBJ_TEMPLATE_COMPARE (obj_cmd_rq, tmpl_cmd_set_power_cycle_interval_rq) < 0) { ERRNO_TRACE (...
false
false
false
false
false
0
try_scatter_io(struct device *dev, int tries, int scatter_order, int scatter_span, int blocksize, FILE *out) { int i, j; const int count = 1 << scatter_order; ns_t time; ns_t min[count]; unsigned long pos; memset(min, 0, sizeof(min)); for (i = 0; i < tries; i++) { pos = 0; for (j = 0; j < count; j++) { ...
false
false
false
false
false
0
readline(FILE *fd, char *line) { while (fread(line, 1, 1, fd)) { if (*line == '\n') { *line = '\0'; return 1; } line++; } *line = '\0'; return 0; }
false
false
false
false
false
0
CollapseFullPath(const std::string& in_path, const char* in_base) { // Collect the output path components. std::vector<std::string> out_components; // Split the input path components. std::vector<std::string> path_components; SystemTools::SplitPath(in_path, path_comp...
false
false
false
false
false
0
get_random_number () { int rv, pid; /* Reset for command and process substitution. */ pid = getpid (); if (subshell_environment && seeded_subshell != pid) { seedrand (); seeded_subshell = pid; } do rv = brand (); while (rv == last_random_value); return rv; }
false
false
false
false
false
0
_cx_deque_sorted(const cx_deque *deque, cx_compare_func compare) { cxsize i = 0; for (i = 0; i < deque->size - 1; ++i) { register cxsize current = deque->front + i; if (compare(deque->members[current], deque->members[current + 1]) > 0) { return 0; } } return 1; ...
false
false
false
false
false
0
_gcry_ac_key_test (gcry_ac_handle_t handle, gcry_ac_key_t key) { gcry_sexp_t key_sexp; gcry_error_t err; if (fips_mode ()) return gpg_error (GPG_ERR_NOT_SUPPORTED); key_sexp = NULL; err = ac_data_construct (ac_key_identifiers[key->type], 0, 0, handle->algorithm_name, key->data, &key_sexp); if (e...
false
false
false
false
false
0
close_impl(bool close_flag, bool throw_) { if (handle_ != invalid_handle()) { if (close_flag) { bool success = #ifdef BOOST_IOSTREAMS_WINDOWS ::CloseHandle(handle_) == 1; #else BOOST_IOSTREAMS_FD_CLOSE(handle_) != -1; ...
false
false
false
false
false
0
TraversePolyline2D(GF_Node *node, void *rs, Bool is_destroy) { DrawableContext *ctx; Drawable *stack = (Drawable *)gf_node_get_private(node); GF_TraverseState *tr_state = (GF_TraverseState *)rs; if (is_destroy) { drawable_node_del(node); return; } polyline2d_check_changes(node, stack, tr_state); switch (tr...
false
false
false
false
false
0
parseEntityDeclList (tokenInfo *const token) { if (isType (token, TOKEN_PERCENT)) skipToNextStatement (token); else while (isType (token, TOKEN_IDENTIFIER) || (isType (token, TOKEN_KEYWORD) && !isKeyword (token, KEYWORD_function) && !isKeyword (token, KEYWORD_subroutine))) { /* compilers accept key...
false
false
false
false
false
0
find_cap_moves(int str, struct reading_moves *moves) { int alib, blib; int numlibs; int libs[4]; int i, j; int ai, aj; int bi, bj; numlibs = findlib(str, 4, libs); if (numlibs > 4 || numlibs < 2) return; for (i = 0; i < numlibs - 1; i++) { for (j = i + 1; j < numlibs; j++) { alib = lib...
false
false
false
false
false
0
nouveau_gem_pushbuf_validate(struct nouveau_channel *chan, struct drm_file *file_priv, struct drm_nouveau_gem_pushbuf_bo *pbbo, uint64_t user_buffers, int nr_buffers, struct validate_op *op, int *apply_relocs) { struct nouveau_cli *cli = nouveau_cli(file_priv); int ret; INIT_LIST_HEA...
false
false
false
false
false
0
hpi_mixer_close(u32 h_mixer) { struct hpi_message hm; struct hpi_response hr; hpi_init_message_response(&hm, &hr, HPI_OBJ_MIXER, HPI_MIXER_CLOSE); if (hpi_handle_indexes(h_mixer, &hm.adapter_index, NULL)) return HPI_ERROR_INVALID_HANDLE; hpi_send_recv(&hm, &hr); return hr.error; }
false
false
false
false
false
0
state_delcmd(cmdlist_t **list, const char *cmd) { while (*list) { cmdlist_t *item = *list; if (strcasecmp(item->name, cmd) > 0) { /* not found */ break; } if (strcasecmp(item->name, cmd) < 0) { list = &item->next; continue; } /* we found it! */ *list = item->next; free(item->name); ...
false
false
false
false
false
0
ipath_insert_rnr_queue(struct ipath_qp *qp) { struct ipath_ibdev *dev = to_idev(qp->ibqp.device); /* We already did a spin_lock_irqsave(), so just use spin_lock */ spin_lock(&dev->pending_lock); if (list_empty(&dev->rnrwait)) list_add(&qp->timerwait, &dev->rnrwait); else { struct list_head *l = &dev->rnrwait;...
false
false
false
false
false
0
sumo_get_sleep_divider_id_from_clock(struct radeon_device *rdev, u32 sclk, u32 min_sclk_in_sr) { struct sumo_power_info *pi = sumo_get_pi(rdev); u32 i; u32 temp; u32 min = (min_sclk_in_sr > SUMO_MINIMUM_ENGINE_CLOCK) ? min_sclk_in_sr : SUMO_MINIMUM_ENGINE_CLOCK; if (sclk < min) return 0; if (!pi...
false
false
false
false
false
0
initializeCustomLowering(Module &M) { // struct FrameMap { // int32_t NumRoots; // Number of roots in stack frame. // int32_t NumMeta; // Number of metadata descriptors. May be < NumRoots. // void *Meta[]; // May be absent for roots without metadata. // }; std::vector<Type*> EltTys; // 32 bits ...
false
false
false
false
false
0
fprint_array_range_semnode(FILE *fp, Array_range_semnode *range) { int dim = 0; while(range != NULL){ dim++; if(range->lower_tree == NULL){ fprintf(fp, "???"); } else{ fput_semtree(fp, range->lower_tree); } fprintf(fp," : "); if(ra...
false
false
false
false
false
0
lineaddr(Posn l, Address addr, int sign) { int n; int c; File *f = addr.f; Address a; Posn p; a.f = f; if(sign >= 0){ if(l == 0){ if(sign==0 || addr.r.p2==0){ a.r.p1 = a.r.p2 = 0; return a; } a.r.p1 = addr.r.p2; p = addr.r.p2-1; }else{ if(sign==0 || addr.r.p2==0){ p = (Posn)0; ...
false
false
false
false
false
0
tq_eq(Query *self, Query *o) { return (strcmp(TQ(self)->term, TQ(o)->term) == 0) && (strcmp(TQ(self)->field, TQ(o)->field) == 0); }
false
false
false
false
false
0
kernel_inject_neighbor(struct nhrp_address *neighbor, struct nhrp_address *hwaddr, struct nhrp_interface *dev) { struct { struct nlmsghdr n; struct ndmsg ndm; char buf[256]; } req; char neigh[64], nbma[64]; memset(&req.n, 0, sizeof(req.n)); memset(&req.ndm, 0, sizeof(req.ndm)); req.n.n...
false
false
false
false
false
0
fmt_plusminus(char *dest,int i) { if (i) { if (dest) *dest=(i>=0?'+':'-'); return 1; } return 0; }
false
false
false
false
false
0
scheduledxaction_editor_dialog_destroy (GtkObject *object, gpointer data) { GncSxEditorDialog2 *sxed = data; if (sxed == NULL) return; gnc_unregister_gui_component_by_data (DIALOG_SCHEDXACTION2_EDITOR_CM_CLASS, sxed); gnc_embedded_window_close_page (sxed->embed_window, sxed->plugin_page);...
false
false
false
false
false
0
cancelPressed(But *but) { AbutFsel *f = but_packet(but); assert(MAGIC(f)); if (f->callback) { f->callback(f, f->packet, NULL); f->callback = NULL; } butWin_destroy(f->win); return(0); }
false
false
false
false
false
0
set_member_value_help_members(struct call_queue *q, const char *interface, int property, int value) { switch(property) { case MEMBER_PENALTY: return set_member_penalty_help_members(q, interface, value); case MEMBER_RINGINUSE: return set_member_ringinuse_help_members(q, interface, value); default: ast_log(LO...
false
false
false
false
false
0
set_user_agent(GWeb *web, const char *format, va_list args) { g_free(web->user_agent); if (format == NULL) { web->user_agent = NULL; debug(web, "clearing user agent"); } else { web->user_agent = g_strdup_vprintf(format, args); debug(web, "setting user agent %s", web->user_agent); } return TRUE; }
false
false
false
false
false
0
Run(class TKawariVM &vm){ TEntry eid=vm.Dictionary().GetEntry(entry); eid.AssertIfEmpty(entry); if (!eid.IsValid()) return ""; unsigned int size=eid.Size(); TWordID wid=eid.Index(Random(size)); if (!wid) return ""; TKVMCode_base *code=vm.Dictionary().GetWordFromID(wid); string retstr=vm.RunWithNewContext(code...
false
false
false
false
false
0
setexposure(struct gspca_dev *gspca_dev, s32 val, s32 freq) { struct sd *sd = (struct sd *) gspca_dev; int integration = val << 6; u8 expose_h, expose_m, expose_l; /* Do this before the set_feature calls, for proper timing wrt the interrupt driven pkt_scan. Note we may still race but that is not a big issu...
false
false
false
false
false
0
http_open_port_if(int port, int ssl, Octstr *interface) { struct server *p; if (ssl) info(0, "HTTP: Opening SSL server at port %d.", port); else info(0, "HTTP: Opening server at port %d.", port); p = gw_malloc(sizeof(*p)); p->port = port; p->ssl = ssl; p->fd = make_server_...
false
false
false
false
false
0
try_year_cmp_func(Item_result type) { if (type == ROW_RESULT) return FALSE; bool a_is_year= (*a)->field_type() == MYSQL_TYPE_YEAR; bool b_is_year= (*b)->field_type() == MYSQL_TYPE_YEAR; if (!a_is_year && !b_is_year) return FALSE; if (a_is_year && b_is_year) { get_value_a_func= &get_year_value...
false
false
false
false
false
0
vs_scanline_merge_linear_Y (uint8_t * dest, uint8_t * src1, uint8_t * src2, int n, int x) { uint32_t value = x >> 8; if (value == 0) { memcpy (dest, src1, n); } else { video_scale_orc_merge_linear_u8 (dest, src1, src2, value, n); } }
false
false
false
false
false
0
of_get_next_parent(struct device_node *node) { struct device_node *parent; unsigned long flags; if (!node) return NULL; raw_spin_lock_irqsave(&devtree_lock, flags); parent = of_node_get(node->parent); of_node_put(node); raw_spin_unlock_irqrestore(&devtree_lock, flags); return parent; }
false
false
false
false
false
0
qla2x00_write_flash_byte(struct qla_hw_data *ha, uint32_t addr, uint8_t data) { uint16_t bank_select; struct device_reg_2xxx __iomem *reg = &ha->iobase->isp; bank_select = RD_REG_WORD(&reg->ctrl_status); if (IS_QLA2322(ha) || IS_QLA6322(ha)) { /* Specify 64K address range: */ /* clear out Module Select and Fl...
false
false
false
false
false
0
yuv420p_to_rgb (unsigned char *image, unsigned char *image2, int x, int y, int z) { const int numpix = x * y; const int bytes = z; /* (z*8) >> 3; */ int i, j, y00, y01, y10, y11, u, v; unsigned char *pY = image; unsigned char *pU = pY + numpix; unsigned char *pV = pU + numpix / 4; fo...
false
false
false
false
false
0
main(int argc, char *argv[]) { FILE *fp, *fpout; char *infile, *outfile; int i; /* option parsing */ infile = NULL; outfile = NULL; for(i=1;i<argc;i++) { if (argv[i][0] == '-') { switch(argv[i][1]) { case 'h': usage(); return -1; break; case 'o': if (++i >= argc) { usage(); re...
false
false
false
false
true
1
dialog_load_selection (SortFlowState *state, gboolean *col_rb) { GnmRange const *first; GnmSortData const *data; first = selection_first_range (state->sv, NULL, NULL); if (first != NULL) { gtk_toggle_button_set_active ( GTK_TOGGLE_BUTTON (state->cell_sort_col_rb), (*col_rb = (first->end.row - first->start...
false
false
false
false
false
0
lookup_or_add_counter (htab_t hash, const char *id, int val, bool histogram_p) { statistics_counter_t **counter; statistics_counter_t c; c.id = id; c.val = val; counter = (statistics_counter_t **) htab_find_slot (hash, &c, INSERT); if (!*counter) { *counter = XNEW (struct statistics_count...
false
false
false
false
false
0
setBiLinearPriorities(int value, double meshSize) { OsiObject ** newObject = new OsiObject * [numberObjects_]; int numberOdd = 0; int i; for ( i = 0; i < numberObjects_; i++) { OsiBiLinear * obj = dynamic_cast<OsiBiLinear *> (object_[i]); if (obj) { if (obj->xMeshSize() < 1.0...
false
false
false
false
false
0
set_super_info (int access_flags, tree this_class, tree super_class, int interfaces_count) { int total_supers = interfaces_count; tree class_decl = TYPE_NAME (this_class); if (super_class) total_supers++; if (total_supers) TYPE_BINFO (this_class) = make_tree_binfo (total_supers); TYPE_VFIELD (th...
false
false
false
false
false
0
el3_interrupt(int irq, void *dev_id) { struct net_device *dev = (struct net_device *) dev_id; struct el3_private *lp = netdev_priv(dev); unsigned int ioaddr; unsigned status; int work_budget = max_interrupt_work; int handled = 0; if (!netif_device_present(dev)) return IRQ_NONE; ioaddr = dev->base_addr; pr_...
false
false
false
false
false
0
dot_trans (Bnode p) { Bnode curr = p; Bnode prev = NULL; while (!curr->atom) { if (dotp(curr->car)) { if (!curr->cdr->atom && nullp(curr->cdr->cdr) && prev != NULL && !dotp(curr->cdr->car)) { prev->cdr = curr->cdr->car; free_bnode(curr->cdr->cdr); free_bnode(curr->cdr); free_bnode(curr->car...
false
true
false
false
true
1
MemoryContextContains(MemoryContext context, void *pointer) { StandardChunkHeader *header; /* * Try to detect bogus pointers handed to us, poorly though we can. * Presumably, a pointer that isn't MAXALIGNED isn't pointing at an * allocated chunk. */ if (pointer == NULL || pointer != (void *) MAXALIGN(pointe...
false
false
false
false
false
0
binary_tree_malloc_node(struct binary_tree_descriptor *desc, void *data, struct binary_tree_node *left, struct binary_tree_node *right) { struct binary_tree_node *p; if (desc->count < ARRAY_SIZE(desc->buff)) { struct binary_tree_cache *q; for (q = desc->buff; q->flags; q++); p = &q->node; q->flags = 1; }...
false
false
false
false
false
0
_call_continous_cb (RestProxyCall *call, const gchar *buf, gsize len, const GError *error_in, GObject *weak_object, gpointer userdata) { SwItemStream *item_stream = SW_ITEM_STREAM (weak_object);...
false
false
false
false
false
0
sge_sl_delete(sge_sl_list_t *list, sge_sl_destroy_f destroy, sge_sl_direction_t direction) { bool ret = true; DENTER(SL_LAYER, "sge_sl_delete"); if (list != NULL) { sge_sl_elem_t *elem; sge_mutex_lock(SL_MUTEX_NAME, SGE_FUNC, __LINE__, &list->mutex); if (direction == SGE_SL_F...
false
false
false
false
false
0
OutputFlush(int outputSite, bool hardFlush, int propagation, bool blocking, const std::string &channel) { if (propagation && AttachedTransformation()->ChannelFlush(channel, hardFlush, propagation-1, blocking)) { m_continueAt = outputSite; return true; } m_continueAt = 0; return false; }
false
false
false
false
false
0
scatterwalk_copychunks(void *buf, struct scatter_walk *walk, size_t nbytes, int out) { for (;;) { unsigned int len_this_page = scatterwalk_pagelen(walk); u8 *vaddr; if (len_this_page > nbytes) len_this_page = nbytes; vaddr = scatterwalk_map(walk); memcpy_dir(buf, vaddr, len_this_page, out); sca...
false
false
false
false
false
0
print_table_r4_portable(FILE *fp, struct symbol *s) { int i, j, k, l, v; char *s1; int n0=s->args[0].n; int n1=s->args[1].n; int n2=s->args[2].n; int n3=s->args[3].n; fprintf(fp, "\n predicate(%s(_,_,_,_), [\n", s->name); for (i = 0; i < n0; i++) { for (j = 0; j < n1; j++) { for (k = ...
false
false
false
false
false
0
creature_kill_all_players_creatures(player_t *player) { creature_t *creature = &creatures[0]; for (int i = 0; i < MAXCREATURES; i++, creature++) { if (!CREATURE_USED(creature)) continue; if (creature->player != player) continue; creature_kill(creature, NULL); ...
false
false
false
false
false
0
define_default_range(int which) { char *id; class_datum_t *cladatum; if (pass == 1) { while ((id = queue_remove(id_queue))) free(id); return 0; } while ((id = queue_remove(id_queue))) { if (!is_id_in_scope(SYM_CLASSES, id)) { yyerror2("class %s is not within scope", id); return -1; } cladatum ...
false
false
false
false
false
0
do_split (FILE *fp) { int c, ctb, pkttype; unsigned long pktlen = 0; int partial = 0; unsigned char header[20]; int header_idx = 0; ctb = getc (fp); if (ctb == EOF) return 3; /* ready */ header[header_idx++] = ctb; if (!(ctb & 0x80)) { log_error("invalid CTB %02x\n", ctb ); r...
true
true
false
false
true
1
uv__buf_count(uv_buf_t bufs[], int bufcnt) { size_t total = 0; int i; for (i = 0; i < bufcnt; i++) { total += bufs[i].len; } return total; }
false
false
false
false
false
0
progress_warn(progress_t * progress, char *reason, ...) { gchar *s; va_list ap; g_mutex_lock(progress->mutex); if (reason != NULL) { va_start(ap, reason); g_vasprintf(&s, reason, ap); free(progress->s); progress->s = s; va_end(ap); } progress->done = 2; g_cond_signal(progress->cond); g_mutex_unlock(pr...
false
false
false
false
false
0
dump(orbOptions::sequenceString& result) { const char* n = omniORB::getLogFilename(); orbOptions::addKVString(key(), n ? n : "[stderr]", result); } }
false
false
false
false
false
0
get_charset(uint cs_number, myf flags) { CHARSET_INFO *cs; if (cs_number == default_charset_info->number) return default_charset_info; my_pthread_once(&charsets_initialized, init_available_charsets); if (cs_number >= array_elements(all_charsets)) return NULL; cs=get_internal_charset(cs_number, ...
false
false
false
false
false
0
avc_has_perm_flags(u32 ssid, u32 tsid, u16 tclass, u32 requested, struct common_audit_data *auditdata, int flags) { struct av_decision avd; int rc, rc2; rc = avc_has_perm_noaudit(ssid, tsid, tclass, requested, 0, &avd); rc2 = avc_audit(ssid, tsid, tclass, requested, &avd, rc, auditdata, flags...
false
false
false
false
false
0
qla4xxx_initialize_adapter(struct scsi_qla_host *ha, int is_reset) { int status = QLA_ERROR; ha->eeprom_cmd_data = 0; ql4_printk(KERN_INFO, ha, "Configuring PCI space...\n"); ha->isp_ops->pci_config(ha); ha->isp_ops->disable_intrs(ha); /* Initialize the Host adapter request/response queues and firmware */ if...
false
false
false
false
false
0
do_animation(void) { int i; for (i = 1; i < mon_max; i++) { byte attr; monster_type *m_ptr = &mon_list[i]; monster_race *r_ptr = &r_info[m_ptr->r_idx]; if (!m_ptr || !m_ptr->ml) continue; else if (rf_has(r_ptr->flags, RF_ATTR_MULTI)) attr = randint1(BASIC_COLORS - 1); else if (rf_has(r_ptr->flags...
false
false
false
false
false
0
RightPoly () const { return ((DBObjRecord *) (RightPolyVAR > 1 ? RightPolyVAR - 2 : DBFault)); }
false
false
false
false
false
0
HMAC_Destroy(HMACContext *cx, PRBool freeit) { if (cx == NULL) return; PORT_Assert(!freeit == !cx->wasAllocated); if (cx->hash != NULL) { cx->hashobj->destroy(cx->hash, PR_TRUE); PORT_Memset(cx, 0, sizeof *cx); } if (freeit) PORT_Free(cx); }
false
false
false
false
false
0
_format(const DigitList &number, UnicodeString& appendTo, FieldPositionHandler& handler, UErrorCode &status) const { // Special case for NaN, sets the begin and end index to be the // the string length of localized name of NaN. if (numb...
false
false
false
false
false
0
gnutls_certificate_get_ours (gnutls_session_t session) { gnutls_certificate_credentials_t cred; CHECK_AUTH (GNUTLS_CRD_CERTIFICATE, NULL); cred = (gnutls_certificate_credentials_t) _gnutls_get_cred (session->key, GNUTLS_CRD_CERTIFICATE, NULL); if (cred == NULL || cred->cert_list == NULL) { gnutl...
false
false
false
false
false
0
mono_portability_remember_string (MonoProfiler *prof, MonoDomain *domain, MonoString *str) { SavedString *head, *entry; if (!str || !domain || !runtime_initialized) return; entry = (SavedString*)g_malloc0 (sizeof (SavedString)); entry->string = str; entry->domain = domain; entry->stack_entries = mono_stack_ba...
false
false
false
false
false
0
MarkAllocated(unsigned Reg) { for (MCRegAliasIterator AI(Reg, &TRI, true); AI.isValid(); ++AI) UsedRegs[*AI/32] |= 1 << (*AI&31); }
false
false
false
false
false
0
build_parameters_string (GStrv parameters) { GPtrArray *output = g_ptr_array_new (); char *join; GStrv iter; for (iter = parameters; iter != NULL && *iter != NULL; iter++) { static const char *prefix = "type="; const char *param = *iter; InfoParameterData *iter2; if (!g_str_has_pre...
false
false
false
false
false
0
afs_fs_exit(void) { _enter(""); afs_mntpt_kill_timer(); unregister_filesystem(&afs_fs_type); if (atomic_read(&afs_count_active_inodes) != 0) { printk("kAFS: %d active inode objects still present\n", atomic_read(&afs_count_active_inodes)); BUG(); } /* * Make sure all delayed rcu free inodes are f...
false
false
false
false
false
0
search_call(int call_id, struct gn_statemachine *state) { int i; for (i = 0; i < GN_CALL_MAX_PARALLEL; i++) if (calltable[i].state == state && calltable[i].call_id == call_id) return calltable + i; return NULL; }
false
false
false
false
false
0
__ecereProp___ecereNameSpace__ecere__gui__controls__StatusField_Set_width(struct __ecereNameSpace__ecere__com__Instance * this, int value) { struct __ecereNameSpace__ecere__gui__controls__StatusField * __ecerePointer___ecereNameSpace__ecere__gui__controls__StatusField = (struct __ecereNameSpace__ecere__gui__controls__S...
false
false
false
false
false
0
gdip_image_format_for_format_guid (GDIPCONST GUID *formatGUID) { if (memcmp (formatGUID, &gdip_bmp_image_format_guid, sizeof (GUID)) == 0) return BMP; if (memcmp (formatGUID, &gdip_jpg_image_format_guid, sizeof (GUID)) == 0) return JPEG; if (memcmp (formatGUID, &gdip_png_image_format_guid, sizeof (GUID)) == 0) ...
false
false
false
false
false
0
gkd_util_push_environment (const gchar *name, const gchar *value) { gchar *env; init_environment (); env = g_strdup_printf ("%s=%s", name, value); g_array_append_val (published_environ, env); if (watch_environ) (watch_environ) (env, watch_user_data); }
false
false
false
false
false
0
disp_unit_info(int dispY1, InnUnit* hireInfoPtr, int refreshFlag) { Skill* skillPtr = &(hireInfoPtr->skill); //---------------- paint the panel --------------// if( refreshFlag == INFO_REPAINT ) { vga_util.d3_panel_up( INFO_X1, dispY1, INFO_X2, dispY1+54 ); } //------ display population composition of this r...
false
false
false
false
false
0
mop_take_branch(void) { zbyte branch = HIBYTE(PC); PC++; if(branch & b10000000) /* Bit 7 set means 'branch when true' */ take_branch(branch); else skip_branch(branch); }
false
false
false
false
false
0
readEnvPath(const char *env) { QByteArray c_path; #ifndef _WIN32_WCE c_path = qgetenv(env); if (c_path.isEmpty()) return QString(); #else bool ok; QString retval = getWin32RegistryValue(HKEY_LOCAL_MACHINE, "Software\\kde", "KDEDIRS", &ok); if (!ok){ return QString(); } else {...
false
false
false
false
false
0
OnOutputLine(const wxString& line) { if ( !line.empty() ) { m_TextSizer->Add(new CTransparentStaticText(this, wxID_ANY, line)); } else { // empty line, no need to create a control for it if ( !m_hLine ) { m_hLine = GetCharHeight(); } m_TextSizer->Add(5, m_hLine); ...
false
false
false
false
false
0
create_pathname(const char *path, const char *filename) { size_t size; char *pathname; RUNTIME_ASSERT(path); RUNTIME_ASSERT(filename); RUNTIME_ASSERT('\0' != *path); size = 2 + strlen(path) + strlen(filename); if (NULL != (pathname = malloc(size))) { bool has_slash; char *p; p = pathname...
false
false
false
false
true
1
test_any_raw_not_set (void) { GBytes *check; GNode *asn, *node; asn = egg_asn1x_create (test_asn1_tab, "TestAnySeq"); g_assert (asn != NULL); node = egg_asn1x_node (asn, "contents", NULL); g_assert (node != NULL); check = egg_asn1x_get_any_raw (node, NULL); g_assert (check == NULL); egg_asn1x_destroy (asn)...
false
false
false
false
false
0
showEvent(QShowEvent* e) { // Now that we're shown, use our width to calculate a good // bounding box for the text, and resize m_textEdit appropriately. KDialog::showEvent(e); if(!m_textEdit) return; QSize fudge(20, 24); // About what it sounds like :-/ ...
false
false
false
false
false
0
SaveFile( FILE* fp ) const { if ( useMicrosoftBOM ) { const unsigned char TIXML_UTF_LEAD_0 = 0xefU; const unsigned char TIXML_UTF_LEAD_1 = 0xbbU; const unsigned char TIXML_UTF_LEAD_2 = 0xbfU; fputc( TIXML_UTF_LEAD_0, fp ); fputc( TIXML_UTF_LEAD_1, fp ); fputc( TIXML_UTF_LEAD_2, fp ); } Print( fp, 0 ); ...
false
false
false
false
false
0
fdp_nci_send(struct nci_dev *ndev, struct sk_buff *skb) { struct fdp_nci_info *info = nci_get_drvdata(ndev); struct device *dev = &info->phy->i2c_dev->dev; dev_dbg(dev, "%s\n", __func__); if (atomic_dec_and_test(&info->data_pkt_counter)) info->data_pkt_counter_cb(ndev); return info->phy_ops->write(info->phy, ...
false
false
false
false
false
0
hash_keys(hash_table_t *table, unsigned long *count_arg, hash_key_t **keys_arg) { unsigned long count = table->entry_count; hash_key_t *keys; hash_keys_callback_data_t data; if (!table) return HASH_ERROR_BAD_TABLE; if (count == 0) { *count_arg = 0; *keys_arg = NULL; return ...
false
false
false
false
false
0
iconbutton_filename_change( FL_OBJECT * ob, long data FL_UNUSED_ARG ) { if ( ! IsIconButton( edited->objclass ) ) return; strcpy( info->filename, fl_get_input( ob ) ); if ( info->filename[ 0 ] ) { ( edited->objclass == FL_PIXMAPBUTTON ? fl_...
false
true
false
false
false
1
rounddiv(x, y) /* calculate x/y, rounding as appropriate */ long x; int y; { int r, m; int divsgn = 1; if (y == 0) panic("division by zero in rounddiv"); else if (y < 0) { divsgn = -divsgn; y = -y; } if (x < 0) { divsgn = -divsgn; x = -x; } r = x / y; m = x % y; i...
false
false
false
false
false
0