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
find_dirtiest_idx_leb(struct ubifs_info *c) { const struct ubifs_lprops *lp; int lnum; while (1) { if (!c->dirty_idx.cnt) return -ENOSPC; /* The lprops pointers were replaced by LEB numbers */ lnum = (size_t)c->dirty_idx.arr[--c->dirty_idx.cnt]; lp = ubifs_lpt_lookup(c, lnum); if (IS_ERR(lp)) return...
false
false
false
false
false
0
be_cmd_get_func_config(struct be_adapter *adapter, struct be_resources *res) { struct be_mcc_wrb *wrb; struct be_cmd_req_get_func_config *req; int status; struct be_dma_mem cmd; if (mutex_lock_interruptible(&adapter->mbox_lock)) return -1; memset(&cmd, 0, sizeof(struct be_dma_mem)); cmd.size = sizeof(struct ...
false
false
false
false
false
0
authorize(void *authData) { GooString *ownerPassword, *userPassword; if (!ok) { return gFalse; } if (authData) { ownerPassword = ((StandardAuthData *)authData)->ownerPassword; userPassword = ((StandardAuthData *)authData)->userPassword; } else { ownerPassword = NULL; userPassword = NULL; ...
false
false
false
false
false
0
getTonePosition(VowelSeq vs, bool terminated) { VowelSeqInfo & info = VSeqList[vs]; if (info.len == 1) return 0; if (info.roofPos != -1) return info.roofPos; if (info.hookPos != -1) { if (vs == vs_uhoh || vs == vs_uhohi || vs == vs_uhohu) //u+o+, u+o+u, u+o+i return ...
false
false
false
false
false
0
JAR_verify_digest(JAR *jar, const char *name, JAR_Digest *dig) { JAR_Item *it; JAR_Digest *shindig; ZZLink *link; ZZList *list = jar->hashes; int result1 = 0; int result2 = 0; if (jar->valid < 0) { /* signature not valid */ return JAR_ERR_SIG; } if (ZZ_ListEmpty (list)) { /* emp...
false
false
false
false
false
0
plugin_dependency_get_plugin (PluginDependency *dep) { g_return_val_if_fail (dep != NULL, NULL); if (dep->plugin == NULL) dep->plugin = go_plugins_get_plugin_by_id (dep->plugin_id); return dep->plugin; }
false
false
false
false
false
0
sshv2_initialize_buffer_with_i18n_string (gftp_request * request, const char *str, size_t *msglen) { const char *addstr; char *utf8, *ret; size_t pathlen; utf8 = gftp_filename_from_utf8 (request, str, &pathlen); if (utf8 != NULL) addstr = utf8; else { ...
false
false
false
false
false
0
regoptail(p, val) char_u *p; char_u *val; { /* When op is neither BRANCH nor BRACE_COMPLEX0-9, it is "operandless" */ if (p == NULL || p == JUST_CALC_SIZE || (OP(p) != BRANCH && (OP(p) < BRACE_COMPLEX || OP(p) > BRACE_COMPLEX + 9))) return; regtail(OPERAND(p), val); }
false
false
false
false
false
0
calc_complex(struct result * r) { if (r) return (calc_complex(r->l) * 10) + 1 + (calc_complex(r->r) * 10); else return 0; }
false
false
false
false
false
0
aux_SHARP_45 (ats_ptr_type arg0, ats_ref_type arg1, ats_ref_type arg2) { /* local vardec */ // ATSlocal_void (tmp148) ; ATSlocal (ats_bool_type, tmp149) ; ATSlocal (ats_ptr_type, tmp150) ; ATSlocal (ats_bool_type, tmp151) ; ATSlocal (ats_int_type, tmp152) ; // ATSlocal_void (tmp157) ; ATSlocal (ats_int_type, tmp158) ; ...
false
false
false
false
false
0
ssh_poll_ctx_remove(ssh_poll_ctx ctx, ssh_poll_handle p) { size_t i; i = p->x.idx; p->x.fd = ctx->pollfds[i].fd; p->ctx = NULL; ctx->polls_used--; /* fill the empty poll slot with the last one */ if (ctx->polls_used > 0 && ctx->polls_used != i) { ctx->pollfds[i] = ctx->pollfds[ctx->polls_used]; ...
false
false
false
false
false
0
mlx5_query_port_mtu(struct mlx5_core_dev *dev, u16 *admin_mtu, u16 *max_mtu, u16 *oper_mtu, u8 port) { u32 in[MLX5_ST_SZ_DW(pmtu_reg)]; u32 out[MLX5_ST_SZ_DW(pmtu_reg)]; memset(in, 0, sizeof(in)); MLX5_SET(pmtu_reg, in, local_port, port); mlx5_core_access_reg(dev, in, sizeof(in), out, sizeof(out), M...
false
false
false
false
true
1
sbft_appendBlock(UtilStringBuffer * sb, void *data, unsigned int size) { int sl; char *ns; if (data == NULL) return; if ((sl = size) + sb->len + 1 >= sb->max) { if (sb->max == 0) sb->max = 8; while (sl + sb->len + 1 >= sb->max) sb->max *= 2; ns = (char *) realloc(sb->hdl, sb->max + 2); ...
false
true
false
false
false
1
ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const { typedef BlockGetAndPut<word32, BigEndian> Block; word32 left, right; Block::Get(inBlock)(left)(right); const word32 *const s=sbox; const word32 *p=pbox; left ^= p[0]; for (unsigned i=0; i<ROUNDS/2; i++) { right ^= (((s[G...
false
false
false
false
false
0
hexdump(FILE *fo, FILE *fi) { int c, n; n = 0; c = fgetc(fi); while (c != -1) { n += fprintf(fo, "%d,", c); if (n > 72) { fprintf(fo, "\n"); n = 0; } c = fgetc(fi); } return n; }
false
true
false
false
true
1
_e_wid_activate_hook(Evas_Object *obj) { E_Widget_Data *wd; wd = e_widget_data_get(obj); if (wd->func) wd->func(wd->data, wd->data2); }
false
false
false
false
false
0
load_timer2 ( unsigned int ticks ) { /* * Now let's take care of PPC channel 2 * * Set the Gate high, program PPC channel 2 for mode 0, * (interrupt on terminal count mode), binary count, * load 5 * LATCH count, (LSB and MSB) to begin countdown. * * Note some implementations have a bug where the high bit...
false
false
false
false
false
0
hostlist_pop(hostlist_t hl) { char *host = NULL; LOCK_HOSTLIST(hl); if (hl->nhosts > 0) { hostrange_t hr = hl->hr[hl->nranges - 1]; host = hostrange_pop(hr); hl->nhosts--; if (hostrange_empty(hr)) { hostrange_destroy(hl->hr[--hl->nranges]); hl->hr[hl-...
false
false
false
false
false
0
send_charset_update(struct unistimsession *pte, int charset) { const unsigned char* packet_send_charset; int packet_size; BUFFSEND; if (unistimdebug) { ast_verb(0, "Sending set default charset\n"); } if (charset == LANG_DEFAULT) { charset = options_languages[find_language(pte->device->language)].encoding; } ...
false
true
false
false
false
1
_remove_stream (gpointer user_data, GObject *where_the_object_was) { FsMsnSession *self = FS_MSN_SESSION (user_data); FsMsnConference *conference = fs_msn_session_get_conference (self, NULL); if (!conference) return; GST_OBJECT_LOCK (conference); if (self->priv->stream == (FsMsnStream *)...
false
false
false
false
false
0
xmlGzfileOpenW (const char *filename, int compression) { const char *path = NULL; char mode[15]; gzFile fd; snprintf(mode, sizeof(mode), "wb%d", compression); if (!strcmp(filename, "-")) { fd = gzdopen(dup(1), mode); return((void *) fd); } if (!xmlStrncasecmp(BAD_CAST filen...
false
false
false
false
false
0
update_from_index_block (GkmGnome2File *self, EggBuffer *buffer) { gchar *identifier; gsize offset; guint section; guint count, i; guint value; g_assert (GKM_IS_GNOME2_FILE (self)); g_assert (buffer); offset = 0; /* The number of entries */ if (!egg_buffer_get_uint32 (buffer, offset, &offset, &count)) re...
false
false
false
false
false
0
player_tick_hit(Model *m, Model_object *o) { Object_type *t; Vector *pos, *size; /* If player isn't hit, nothing has to be done. */ if (!o->hit) return; /* Player drops two food objects from foodstack (if any)! */ /* Get first food object out of stack (if possible). */ if (list_length(o->foodsta...
false
false
false
false
false
0
adjust_array_slot_dim_next(Block *block_head, int entry, Operand *slot_no, SemTree **offsets) { Block *bpt; bpt = block_head; while (bpt != NULL) { adjust_array_slot_dim(bpt, entry, slot_no, off...
false
false
false
false
false
0
ao_play(ao_device *device, char* output_samples, uint_32 num_bytes) { char *playback_buffer; if (device == NULL) return 0; if (device->swap_buffer != NULL) { int out_bytes = num_bytes*device->output_channels/device->input_channels; if (_realloc_swap_buffer(device, out_bytes)) { i...
false
false
false
false
false
0
json_object_key_to_iter(const char *key) { if(!key) return NULL; return hashtable_key_to_iter(key); }
false
false
false
false
false
0
istgt_lu_get_devsize(const char *file) { uint64_t val; struct stat st; int fd; int rc; val = 0ULL; rc = stat(file, &st); if (rc != 0) return val; if (!S_ISCHR(st.st_mode) && !S_ISBLK(st.st_mode)) return val; fd = open(file, O_RDONLY, 0); if (fd >= 0) { #ifdef DIOCGMEDIASIZE if (val == 0) { off_t of...
false
false
false
false
true
1
set_error(int err) { trace(("regular_expression::set_error()\n")); char buffer[100]; regerror(err, &preg, buffer, sizeof(buffer)); errstr = nstring(buffer); }
false
false
false
false
false
0
verify_unprotected(void) { int i; int j; int protected_count = 0; int32_t max_index; test_entry_t * base_addr; if ( pass ) { for ( i = 0; i < NUMBER_OF_ENTRY_TYPES; i++ ) { max_index = max_indices[i]; base_addr = entries[i]; HDassert( base_...
false
false
false
false
false
0
sendto_anywhere(struct Client *target_p, struct Client *source_p, const char *command, const char *pattern, ...) { va_list args; buf_head_t linebuf; rb_linebuf_newbuf(&linebuf); va_start(args, pattern); if(MyClient(target_p)) { if(IsServer(source_p)) rb_linebuf_putmsg(&linebuf, pattern, &args, ":%s %s %...
false
false
false
false
false
0
hex2num(char c) { if (isdigit(c)) return c - '0'; else { char d = tolower(c); if (d >= 'a' && d <= 'f') return d - 'a' + 10; return 0; } }
false
false
false
false
false
0
fcoe_ctlr_link_down(struct fcoe_ctlr *fip) { int link_dropped; LIBFCOE_FIP_DBG(fip, "link down.\n"); mutex_lock(&fip->ctlr_mutex); fcoe_ctlr_reset(fip); link_dropped = fip->state != FIP_ST_LINK_WAIT; fcoe_ctlr_set_state(fip, FIP_ST_LINK_WAIT); mutex_unlock(&fip->ctlr_mutex); if (link_dropped) fc_linkdown(fi...
false
false
false
false
false
0
CwLnx_flush(Driver *drvthis) { PrivateData *p = drvthis->private_data; int i, j; int iUpdate = 0, jUpdate = 0; unsigned char *firstUpdate = NULL, *lastUpdate = NULL; unsigned char *q = p->framebuf; unsigned char *r = p->backingstore; for (i = 0; i < p->height; i++) { for (j = 0; j < p->w...
false
true
false
false
false
1
brasero_genisoimage_read_isosize (BraseroProcess *process, const gchar *line) { gint64 sectors; sectors = strtoll (line, NULL, 10); if (!sectors) return BRASERO_BURN_OK; /* genisoimage reports blocks of 2048 bytes */ brasero_job_set_output_size_for_current_track (BRASERO_JOB (process), sectors, ...
false
false
false
false
false
0
bnxt_free_mem(struct bnxt *bp, bool irq_re_init) { bnxt_free_vnic_attributes(bp); bnxt_free_tx_rings(bp); bnxt_free_rx_rings(bp); bnxt_free_cp_rings(bp); bnxt_free_ntp_fltrs(bp, irq_re_init); if (irq_re_init) { bnxt_free_stats(bp); bnxt_free_ring_grps(bp); bnxt_free_vnics(bp); kfree(bp->bnapi); bp->bnap...
false
false
false
false
false
0
__ocfs2_flush_truncate_log(struct ocfs2_super *osb) { int status; unsigned int num_to_flush; handle_t *handle; struct inode *tl_inode = osb->osb_tl_inode; struct inode *data_alloc_inode = NULL; struct buffer_head *tl_bh = osb->osb_tl_bh; struct buffer_head *data_alloc_bh = NULL; struct ocfs2_dinode *di; struct...
false
false
false
false
false
0
compile(const bool checkErrors) { if (mCompiled == 1) { return true; } // only create a shader object if glsl is supported if (isSupported()) { // create shader object GLenum shaderType = 0x0000; switch (mType) ...
false
false
false
false
false
0
window_create(grs_canvas *src, int x, int y, int w, int h, int (*event_callback)(window *wind, d_event *event, void *data), void *data) { window *wind; window *prev = window_get_front(); d_event event; MALLOC(wind, window, 1); if (wind == NULL) return NULL; Assert(src != NULL); Assert(event_callback != NULL...
false
false
false
false
false
0
nm_system_iface_compat_set_vlan_name_type (int name_type) { int fd; struct vlan_ioctl_args if_request; if ((fd = socket (AF_INET, SOCK_STREAM, 0)) < 0) { nm_log_err (LOGD_DEVICE, "couldn't open control socket."); return -1; } memset (&if_request, 0, sizeof (struct vlan_ioctl_args)); if_request.cmd = SET_VLA...
false
false
false
false
false
0
Reset(InstanceResetMethod method) { // note: since the map may not be loaded when the instance needs to be reset // the instance must be deleted from the DB by InstanceSaveManager if (HavePlayers()) { if (method == INSTANCE_RESET_ALL) { // notify the players to leave the ins...
false
false
false
false
false
0
wnck_selector_get_width (GtkWidget *widget, const char *text) { GtkStyleContext *style_context; GtkStateFlags state; PangoContext *context; PangoFontMetrics *metrics; PangoFontDescription *description; gint char_width; PangoLayout *layout; PangoRectangle natural; gint max_width; gint screen_width; ...
false
false
false
false
false
0
extract_use_nam(char *libnam, char *celnam, int32 *has_config, char *use_spec) { register char *chp; char s1[IDLEN], s2[IDLEN]; strcpy(libnam, ""); strcpy(celnam, ""); *has_config = FALSE; /* case 1: library omitted and escaped cell name */ if (*use_spec == '\\') { strcpy(s2, use_spec); do_cell_tail: ...
true
true
false
false
false
1
rfbConnectToTcpAddr(char *host, int port) { struct hostent *hp; int sock; struct sockaddr_in addr; memset(&addr, 0, sizeof(addr)); addr.sin_family = AF_INET; addr.sin_port = htons(port); if ((addr.sin_addr.s_addr = inet_addr(host)) == htonl(INADDR_NONE)) { if (!(hp...
false
false
false
false
false
0
initAttributesMap() { if (AttrMap.empty()) { AttrMap.insert(std::make_pair("alt", Attr_ALT)); AttrMap.insert(std::make_pair("href", Attr_HREF)); AttrMap.insert(std::make_pair("id", Attr_ID)); AttrMap.insert(std::make_pair("name", Attr_NAME)); AttrMap.insert(std::make_pair("content", Attr_CONTENT)); AttrMap.in...
false
false
false
false
false
0
fat32_fs_object_delete(struct fat32_fs_object_t *fs_object) { struct fat32_fat_t *fat = fs_object->fs->fat; enum fat32_error_t ret; uint32_t cluster = fat32_fs_object_first_cluster(fs_object); ret = fat32_fs_object_mark_free(fs_object); if (ret != FE_OK) { return ret; } if (!(fat32_fs_object_is_fil...
false
false
false
false
false
0
zoom_out_changed_cb (G_GNUC_UNUSED GtkWidget *widget, gpointer data) { g_return_if_fail (data != NULL); Ekiga::DisplayInfo display_info; ekiga_call_window_set_video_size (EKIGA_CALL_WINDOW (data), GM_CIF_WIDTH, GM_CIF_HEIGHT); display_info.zoom = gm_conf_get_int (VIDEO_DISPLAY_KEY "zoom"); if (displ...
false
false
false
false
false
0
init_transition_pgtable(struct kimage *image, pgd_t *pgd) { pud_t *pud; pmd_t *pmd; pte_t *pte; unsigned long vaddr, paddr; int result = -ENOMEM; vaddr = (unsigned long)relocate_kernel; paddr = __pa(page_address(image->control_code_page)+PAGE_SIZE); pgd += pgd_index(vaddr); if (!pgd_present(*pgd)) { pud = (...
false
false
false
false
false
0
document_structure_env_data_copy (const DocumentStructureEnvData* self, DocumentStructureEnvData* dest) { GtkTreePath* _tmp0_ = NULL; GtkTreePath* _tmp1_ = NULL; StructType _tmp2_ = 0; const gchar* _tmp3_ = NULL; gchar* _tmp4_ = NULL; _tmp0_ = (*self).path; _tmp1_ = _gtk_tree_path_copy0 (_tmp0_); _gtk_tree_path...
false
false
false
false
false
0
remove(void* key){ register FXuint q,x; register void* val; if(key){ q=HASH1(key,total); x=HASH2(key,total); while(table[q].key!=key){ if(table[q].key==NULL) goto x; q=(q+x)&(total-1); } val=table[q].value; table[q].key=(void*)-1L; // Empty but not free ...
false
false
false
false
false
0
p_read_char(li_object *args) { int c; FILE *f; f = stdin; if (args) { assert_nargs(1, args); assert_port(li_car(args)); f = li_to_port(li_car(args)).file; } if ((c = getc(f)) == '\n') c = getc(f); if (c == EOF) return li_eof; return li_character(c...
false
false
false
false
false
0
_legacy_decode (ipmi_locate_ctx_t ctx, fipmiu8 *buf, const char *devmem, ipmi_interface_type_t type, struct ipmi_locate_info *locate_info) { assert (ctx); assert (ctx->magic == IPMI_LOCATE_CTX_MAGIC); assert (devmem); assert (IPMI_INTERFACE_TYPE_VA...
false
false
false
false
false
0
getGradients(FXGradient*& segments,FXint& nsegments) const { nsegments=0; if(FXMALLOC(&segments,FXGradient,nsegs)){ memcpy(segments,seg,sizeof(FXGradient)*nsegs); nsegments=nsegs; } }
false
false
false
false
false
0
ScaCleanupCache( FLMUINT uiMaxLockTime) { SCACHE * pTmpSCache; SCACHE * pPrevSCache; FLMUINT uiBlocksExamined = 0; FLMUINT uiLastTimePaused = FLM_GET_TIMER(); FLMUINT uiCurrTime; f_mutexLock( gv_FlmSysData.hShareMutex); pTmpSCache = gv_FlmSysData.SCacheMgr.pLRUReplace; for (;;) { // Stop when ...
false
false
false
false
false
0
file_hardlink(const char *from, const char *to) { int ret; remove(from); ret = mkdir_hierarchy(text_dirname(from), 0777); if (ret < 0) { return ret; } return link(to, from); }
false
false
false
false
false
0
handle_remove (GVfsMetadata *object, GDBusMethodInvocation *invocation, const gchar *arg_treefile, const gchar *arg_path, GVfsMetadata *daemon) { TreeInfo *info; info = tree_info_lookup (arg_treefile); if (info == NULL) { g_dbus_method_invocat...
false
false
false
false
false
0
lwo_cb_PNTS(G3DIffGlobal *global, G3DIffLocal *local) { LwoObject *obj; G3DObject *object; gint32 i, off; obj = (LwoObject *)global->user_data; g_return_val_if_fail(obj != NULL, FALSE); if(global->flags & LWO_FLAG_LWO2) { object = lwo_create_object(global->stream, global->model, global->flags); obj->obje...
false
false
false
false
false
0
CERT_ConvertAndDecodeCertificate(char *certstr) { CERTCertificate *cert; SECStatus rv; SECItem der; rv = ATOB_ConvertAsciiToItem(&der, certstr); if (rv != SECSuccess) return NULL; cert = CERT_NewTempCertificate(CERT_GetDefaultCertDB(), &der, NULL, PR_FALSE,...
false
false
false
false
false
0
add_server (ServerName *rlist, const char *name) { ServerName x; if (rlist && (x=get_server (*rlist, name)) ) return x; /* already in list */ x = g_malloc (sizeof *x + strlen (name) ); strcpy (x->name, name); x->selected = 0; x->next = *rlist; *rlist = x; return x; }
false
true
false
false
true
1
set_fl(int fd, int flags) { int val; if ((val = fcntl(fd, F_GETFL, 0)) < 0) perror("fcntl F_GETFL error"); val |= flags; // turn on flag if (fcntl(fd, F_SETFL, val) < 0) perror("fcntl F_SETFL error"); }
false
false
false
false
false
0
gt_lua_push_strarray_as_table(lua_State *L, GtStrArray *sa) { unsigned long i; gt_assert(L && sa); lua_newtable(L); for (i = 0; i < gt_str_array_size(sa); i++) { lua_pushinteger(L, i+1); /* in Lua we index from 1 on */ lua_pushstring(L, gt_str_array_get(sa, i)); lua_rawset(L, -3); } }
false
false
false
false
false
0
ParseIdentifierOrReservedWord(bool* is_reserved, bool* ok) { *is_reserved = false; if (temp_scope_->StrictMode()) { Expect(Token::IDENTIFIER, ok); } else { if (!Check(Token::IDENTIFIER)) { Expect(Token::FUTURE_RESERVED_WORD, ok); *is_reserve...
false
false
false
false
false
0
copyperm(int ifd, int ofd) { int err; mode_t fmode; struct stat stbuf; err = fstat(ifd, &stbuf); if (err) return err; fmode = stbuf.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX); err = fchown(ofd, stbuf.st_uid, stbuf.st_gid); if (err) fmode &= ~(S_ISUID | S_ISGID); err += fchmod(of...
false
false
false
false
false
0
cb_template_submit(Fl_Return_Button*, void*) { Fl_Shared_Image *img = (Fl_Shared_Image *)template_preview->image(); if (img) img->release(); template_preview->image(0); template_panel->hide(); }
false
false
false
false
false
0
omapi_protocol_get_value (omapi_object_t *h, omapi_object_t *id, omapi_data_string_t *name, omapi_value_t **value) { omapi_protocol_object_t *p; if (h -> type != omapi_type_protocol) return DHCP_R_INVALIDARG; p = (omapi_protocol_object_t *)h; if (omapi_ds_strcmp (name, "default-...
false
false
false
false
false
0
add_dataset(int t) { vtkInternalStructureCache *child = new vtkInternalStructureCache(); child->type = t; child->parent = this; children.push_back(child); return child; }
false
false
false
false
false
0
HandleExploreCheatCommand(char* args) { if (!*args) return false; int flag = atoi(args); Player* chr = getSelectedPlayer(); if (chr == NULL) { SendSysMessage(LANG_NO_CHAR_SELECTED); SetSentErrorMessage(true); return false; } if (flag != 0) { PSe...
false
false
false
false
false
0
unresolve_callback(struct parse_opt_ctx_t *ctx, const struct option *opt, int flags) { int *has_errors = opt->value; const char *prefix = startup_info->prefix; /* consume remaining arguments. */ *has_errors = do_unresolve(ctx->argc, ctx->argv, prefix, prefix ? strlen(prefix) : 0); if (*has_errors) activ...
false
false
false
false
false
0
append(void *dbuf, size_t dlen) { DB_MULTIPLE_WRITE_NEXT(p_, dbt_.get_DBT(), dbuf, dlen); return (p_ != 0); }
false
false
false
false
false
0
_deleteSpan(void) { pf_Frag * pfOld = NULL; pf_Frag * pf = m_fragObject.getNext(); while (pf&&pf->getType()==pf_Frag::PFT_Text&& pf->getField()==this) { pfOld = pf; pf = pfOld->getNext(); m_pPieceTable->deleteFieldFrag(pfOld); } return true; }
false
false
false
false
false
0
unit_color_type(const struct unit_type *punittype) { struct unit_class *pclass = utype_class(punittype); if (pclass->hp_loss_pct > 0) { return UNIT_BG_HP_LOSS; } if (pclass->move_type == UMT_LAND) { return UNIT_BG_LAND; } if (pclass->move_type == UMT_SEA) { return UNIT_BG_SEA; } fc_assert...
false
false
false
false
false
0
krb5_k_verify_checksum_iov(krb5_context context, krb5_cksumtype checksum_type, krb5_key key, krb5_keyusage usage, const krb5_crypto_iov *data, size_t num_data, ...
false
false
false
false
false
0
pl3_file_browser_selected(GtkWidget * container) { if (pl3_fb_tree == NULL) { GtkTreeIter iter,child; pl3_file_browser_init(); gtk_tree_store_append(pl3_fb_dir_store, &iter, NULL); gtk_tree_store_set(pl3_fb_dir_store, &iter, PL3_FB_ICON, "gtk-open", PL3_FB_NAME, "/", PL3_FB_PATH, "/", PL3_FB_OPEN, FALSE, ...
false
false
false
false
false
0
CollectDistNames( CERTCertificate *cert, SECItem *k, void *data) { CERTDistNames *names; PRBool saveit = PR_FALSE; CERTCertTrust trust; dnameNode *node; int len; names = (CERTDistNames *)data; if ( CERT_GetCertTrust(cert, &trust) == SECSuccess ) { /* only collect names of CAs trus...
false
false
false
false
false
0
overrideShortcut(const QKeyEvent* e) { KShortcut scKey; const int key = e->key() | e->modifiers(); const KLineEdit::KeyBindingMap keys = q->getKeyBindings(); if (keys[KLineEdit::TextCompletion].isEmpty()) scKey = KStandardShortcut::shortcut(KStandardShortcut::TextCompletion); else ...
false
false
false
false
false
0
fdevent_connect(fdevent *fde) { if(fde->fd >= select_n) { select_n = fde->fd + 1; } }
false
false
false
false
false
0
ccwrotatepf(pointf p, int ccwrot) { double x = p.x, y = p.y; switch (ccwrot) { case 0: break; case 90: p.x = -y; p.y = x; break; case 180: p.x = x; p.y = -y; break; case 270: p.x = y; p.y = x; break; default: if (ccwrot < 0) return cwrotatepf(p, -ccwrot); if (ccwrot >...
false
false
false
false
false
0
ipw_rfkill_state_work (gpointer user_data) { NMDeviceWifi *self = NM_DEVICE_WIFI (user_data); NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); RfKillState old_state; old_state = priv->ipw_rfkill_state; priv->ipw_rfkill_state = nm_device_wifi_get_ipw_rfkill_state (self); if (priv->ipw_rfkill_state !...
false
false
false
false
false
0
make_bf_salt_para(int rounds, char *saltpara) { static char salt[31]; char tbuf[3]; if(saltpara && (strlen(saltpara) <= 22)) { /* sprintf used because of portability requirements, the length ** is checked above, so it should not be too much of a concern */ sprintf(tbuf, "%02d", rounds); sprintf(salt, "$...
false
false
false
false
false
0
test_diff_rename__can_override_thresholds_when_obeying_config(void) { const char *sha1 = "2bc7f351d20b53f1c72c16c4b036e491c478c49a"; const char *sha2 = "1c068dee5790ef1580cfc4cd670915b48d790084"; git_tree *tree1, *tree2; git_config *cfg; git_diff *diff; git_diff_options diffopts = GIT_DIFF_OPTIONS_INIT; git_dif...
false
false
false
false
false
0
archive_compressor_none_write(struct archive_write *a, const void *vbuff, size_t length) { const char *buff; ssize_t remaining, to_copy; ssize_t bytes_written; struct archive_none *state; state = (struct archive_none *)a->compressor.data; buff = (const char *)vbuff; if (a->client_writer...
false
true
false
false
false
1
wlc_phy_ant_rxdiv_set(struct brcms_phy_pub *ppi, u8 val) { struct brcms_phy *pi = container_of(ppi, struct brcms_phy, pubpi_ro); bool suspend; pi->sh->rx_antdiv = val; if (!(ISNPHY(pi) && D11REV_IS(pi->sh->corerev, 16))) { if (val > ANT_RX_DIV_FORCE_1) wlapi_bmac_mhf(pi->sh->physhim, MHF1, MHF1_ANTDIV, ...
false
false
false
false
false
0
pccard_extract_cis(struct pcmcia_socket *s, char *buf, loff_t off, size_t count) { tuple_t tuple; int status, i; loff_t pointer = 0; ssize_t ret = 0; u_char *tuplebuffer; u_char *tempbuffer; tuplebuffer = kmalloc(sizeof(u_char) * 256, GFP_KERNEL); if (!tuplebuffer) return -ENOMEM; tempbuffer = kmallo...
false
false
false
false
false
0
quote_splitmode(struct Client *source_p, char *charval) { if(charval) { int newval; for(newval = 0; splitmode_values[newval]; newval++) { if(!irccmp(splitmode_values[newval], charval)) break; } /* OFF */ if(newval == 0) { sendto_realops_flags(UMODE_ALL, L_ALL, "%s is disabling spli...
false
false
false
false
false
0
songit_new(unsigned char *data, unsigned int size, int type, songit_id_t id) { base_song_iterator_t *it; int i; if (!data || size < 22) { fprintf(stderr, SIPFX "Attempt to instantiate song iterator for null" " song data\n"); return NULL; } switch (type) { case SCI_SONG_ITERATOR_TYPE_SCI0: /...
false
false
false
false
true
1
udta_del(GF_Box *s) { u32 i; GF_UserDataMap *map; GF_UserDataBox *ptr = (GF_UserDataBox *)s; if (ptr == NULL) return; i=0; while ((map = (GF_UserDataMap *)gf_list_enum(ptr->recordList, &i))) { gf_isom_box_array_del(map->other_boxes); gf_free(map); } gf_list_del(ptr->recordList); gf_free(ptr); }
false
false
false
false
false
0
connection_removed (NMRemoteConnection *connection, gpointer user_data) { CEPageMaster *self = CE_PAGE_MASTER (user_data); CEPageMasterPrivate *priv = CE_PAGE_MASTER_GET_PRIVATE (self); GtkTreeIter iter; if (!find_connection (self, connection, &iter)) return; gtk_list_store_remove (GTK_LIST_STORE (priv->connec...
false
false
false
false
false
0
on_new_line_added(GeanyEditor *editor) { ScintillaObject *sci = editor->sci; gint line = sci_get_current_line(sci); /* simple indentation */ if (editor->auto_indent) { insert_indent_after_line(editor, line - 1); } if (editor_prefs.auto_continue_multiline) { /* " * " auto completion in multiline C/C++/D/Java...
false
false
false
false
false
0
pci_iommu_init(void) { struct iommu_table_entry *p; dma_debug_init(PREALLOC_DMA_DEBUG_ENTRIES); #ifdef CONFIG_PCI dma_debug_add_bus(&pci_bus_type); #endif x86_init.iommu.iommu_init(); for (p = __iommu_table; p < __iommu_table_end; p++) { if (p && (p->flags & IOMMU_DETECTED) && p->late_init) p->late_init(); ...
false
false
false
false
false
0
callbacks_update_statusbar(void) { if ((screen.statusbar.coordstr != NULL)&&(GTK_IS_LABEL(screen.win.statusMessageLeft))) { gtk_label_set_text(GTK_LABEL(screen.win.statusMessageLeft), screen.statusbar.coordstr); } if ((screen.statusbar.diststr != NULL)&&(GTK_IS_LABEL(screen.win.statusMessageRight))) { gtk_label_...
false
false
false
false
false
0
device_list_alloc_to_bufs(const struct device_list * device_list) { int count = 0; int size = 0; const char * device; const struct device_list * device_first; char ** ret; char * last_ptr; int i, j, k; device_first = device_list; while ( device_first ) { int local = 0; if ( ! device_to_string(device_f...
true
true
false
false
true
1
startDrop() { stopHint(); stopDemo(); if ( isCardAnimationRunning() ) { m_dropQueued = true; return; } m_dropInProgress = true; m_interruptAutoDrop = false; m_dropSpeedFactor = 1; emit dropActive( true ); drop(); }
false
false
false
false
false
0
bfa_fcs_lport_sm_online( struct bfa_fcs_lport_s *port, enum bfa_fcs_lport_event event) { struct bfa_fcs_rport_s *rport; struct list_head *qe, *qen; bfa_trc(port->fcs, port->port_cfg.pwwn); bfa_trc(port->fcs, event); switch (event) { case BFA_FCS_PORT_SM_OFFLINE: bfa_sm_set_state(port, bfa_fcs_lport_sm_offl...
false
false
false
false
false
0
GenerateDeoptimizationEntries(MacroAssembler* masm, int count, BailoutType type) { TableEntryGenerator generator(masm, type, count); generator.Generate(); }
false
false
false
false
false
0
check_use (const char *data, nscd_ssize_t first_free, uint8_t *usemap, enum usekey use, ref_t start, size_t len) { assert (len >= 2); if (start > first_free || start + len > first_free || (start & BLOCK_ALIGN_M1)) return 0; if (usemap[start] == use_not) { /* Add the start marker. */ ...
false
false
false
false
false
0
IMG_SetupObject(IMGLoader *read) { if (!read->ch) { GF_ObjectDescriptor *od = (GF_ObjectDescriptor *) gf_odf_desc_new(GF_ODF_OD_TAG); GF_ESD *esd = IMG_GetESD(read); od->objectDescriptorID = 1; gf_list_add(od->ESDescriptors, esd); gf_term_add_media(read->service, (GF_Descriptor *)od, 0); } }
false
true
false
false
true
1
nvkm_mm_head(struct nvkm_mm *mm, u8 heap, u8 type, u32 size_max, u32 size_min, u32 align, struct nvkm_mm_node **pnode) { struct nvkm_mm_node *prev, *this, *next; u32 mask = align - 1; u32 splitoff; u32 s, e; BUG_ON(type == NVKM_MM_TYPE_NONE || type == NVKM_MM_TYPE_HOLE); list_for_each_entry(this, &mm->fre...
false
false
false
false
false
0
_print_priority(sinfo_data_t * sinfo_data, int width, bool right_justify, char *suffix) { char id[FORMAT_STRING_SIZE]; if (sinfo_data) { _build_min_max_16_string(id, FORMAT_STRING_SIZE, sinfo_data->part_info->priority, sinfo_data->part_info->priority, true); _print_str(id, width, right_jus...
false
false
false
false
false
0
GC_push_all(ptr_t bottom, ptr_t top) { register word length; bottom = (ptr_t)(((word) bottom + ALIGNMENT-1) & ~(ALIGNMENT-1)); top = (ptr_t)(((word) top) & ~(ALIGNMENT-1)); if (bottom >= top) return; GC_mark_stack_top++; if (GC_mark_stack_top >= GC_mark_stack_limit) { ABORT("Unexpected...
false
false
false
false
false
0
read_test_data_async (TestConnection *test) { GDataInputStream *stream; stream = g_data_input_stream_new (g_io_stream_get_input_stream (test->client_connection)); g_assert (stream); g_data_input_stream_read_line_async (stream, G_PRIORITY_DEFAULT, NULL, on_input_read_fini...
false
false
false
false
false
0
mspac_attr2type(const krb5_data *attr, krb5_ui_4 *type) { unsigned int i; for (i = 0; i < MSPAC_ATTRIBUTE_COUNT; i++) { if (attr->length == mspac_attribute_types[i].attribute.length && strncasecmp(attr->data, mspac_attribute_types[i].attribute.data, attr->length) == 0) { *type =...
false
false
false
false
false
0