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
setup_environment(char *var, char *val) { setenv(var, val, 1); INFO("%s='%s'\n", var, val); if (opt_dry_run) printf("%s='%s'\n", var, val); }
false
false
false
false
false
0
handle_return_statement (fncall *call, ExecState *state, DATASET *dset, int lineno) { const char *s = state->line + 6; /* skip "return" */ ufunc *fun = call->fun; int err = 0; #if EXEC_DEBUG fprintf(stderr, "%s: return: s = '%s'\n", fun->name, s); #endif s += strspn(s, " ")...
true
true
true
false
false
1
CreateAnother(void) const { ::itk::LightObject::Pointer smartPtr; Pointer copyPtr = Self::New(); copyPtr->SetYoungsModulus( this->GetYoungsModulus() ); copyPtr->SetCrossSectionalArea( this->GetCrossSectionalArea() ); copyPtr->SetMomentOfInertia( this->GetMomentOfInertia() ); copyPtr->SetPoissonsRatio( this...
false
false
false
false
false
0
loglist_filter(logerror **list, logerror **filtered, logfilter filter, void *data, unsigned short int mode) { logerror *local_list = *list; logerror *local_filtered = NULL; logerror *last_failed = NULL; logerror *next = NULL; logerror *cur = local_list; unsigned int filtered_count = 0; //FILE *f = fopen(...
false
false
false
false
false
0
GC_generic_malloc_inner(lb, k) register word lb; register int k; { register word lw; register ptr_t op; register ptr_t *opp; if( SMALL_OBJ(lb) ) { register struct obj_kind * kind = GC_obj_kinds + k; # ifdef MERGE_SIZES lw = GC_size_map[lb]; # else lw = ALIGNED_WORDS(lb); if (lw == 0) lw = MI...
false
false
false
false
false
0
vgzprintf(gzFile file, const char *format, va_list va, int buflen) { int len; if (!buflen) { char buf[BUFSIZ]; /* no buffer length given -> try static buffer */ len = gt_xvsnprintf(buf, sizeof (buf), format, va); if (len >= BUFSIZ) { return len; /* unsuccessful trial -> return buffer length fo...
true
true
false
false
false
1
addDisplayType (GType type) { GObjectClass *klass; if (!g_type_is_a (type, GGOBI_TYPE_EXTENDED_DISPLAY)) { g_printerr ("%s is not a GType that extends GGobiExtendedDisplay", g_type_name (type)); } klass = g_type_class_ref (type); ExtendedDisplayTypes = g_slist_append (ExtendedDisplayTypes,...
false
false
false
false
false
0
theme_parse_grip_style (GScanner * scanner, GTokenType wanted_token, XfceRcStyle * retval) { guint token; token = g_scanner_get_next_token(scanner); if (token != wanted_token) { return wanted_token; } token = g_scanner_get_next_token(scanner); if(token != G_TOKEN_EQUAL_SIGN) { ...
false
false
false
false
false
0
gth_histogram_finalize (GObject *object) { GthHistogram *self; int i; self = GTH_HISTOGRAM (object); for (i = 0; i < GTH_HISTOGRAM_N_CHANNELS + 1; i++) g_free (self->priv->values[i]); g_free (self->priv->values); g_free (self->priv->values_max); G_OBJECT_CLASS (gth_histogram_parent_class)->finaliz...
false
false
false
false
false
0
_gth_grid_view_select_range (GthGridView *self, GthGridViewItem *item, int pos) { int a, b; GList *scan; if (self->priv->last_selected_pos == -1) { self->priv->last_selected_pos = pos; self->priv->last_selected_item = item; } if (pos < self->priv->last_selected_pos) { a ...
false
false
false
false
false
0
vficon_icon_data(ViewFile *vf, FileData *fd) { IconData *id = NULL; GList *work; if (!fd) return NULL; work = vf->list; while (work && !id) { IconData *chk = work->data; work = work->next; if (chk->fd == fd) id = chk; } return id; }
false
false
false
false
false
0
GetImplibGNUtoMS(std::string const& gnuName, std::string& out, const char* newExt) { if(this->HasImplibGNUtoMS() && gnuName.size() > 6 && gnuName.substr(gnuName.size()-6) == ".dll.a") { out = gnuName.substr(0, gnuName.size()-6); out += newExt? newExt : ".lib"; retu...
false
false
false
false
false
0
smug_download(struct session *session, struct filename *filename) { struct smug_curl_buffer *curl_buf; CURL *curl = NULL; CURLcode res; struct progress *progress; if (!filename) return -EINVAL; dbg("trying to download %s\n", filename->filename); curl_buf = smug_curl_buffer_alloc(); if (!curl_buf) return ...
false
false
false
false
false
0
evas_object_clip_unset(Evas_Object *obj) { MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); return; MAGIC_CHECK_END(); if (!obj->cur.clipper) return; /* unclip */ if (evas_object_intercept_call_clip_unset(obj)) return; if (obj->smart.smart) { if (obj->smart.smart->smart_class->clip_unset) o...
false
false
false
false
false
0
t3_free_qset(struct adapter *adapter, struct sge_qset *q) { int i; struct pci_dev *pdev = adapter->pdev; for (i = 0; i < SGE_RXQ_PER_SET; ++i) if (q->fl[i].desc) { spin_lock_irq(&adapter->sge.reg_lock); t3_sge_disable_fl(adapter, q->fl[i].cntxt_id); spin_unlock_irq(&adapter->sge.reg_lock); free_rx_buf...
false
false
false
false
false
0
brasero_data_session_disc_removed_cb (BraseroMediumMonitor *monitor, BraseroMedium *medium, BraseroDataSession *self) { GSList *iter; GSList *next; BraseroDataSessionPrivate *priv; priv = BRASERO_DATA_SESSION_PRIVATE (self); /* see if that's the current loaded one */ if (priv->loaded && priv...
false
false
false
false
false
0
handle_one_reflog_commit(unsigned char *sha1, void *cb_data) { struct all_refs_cb *cb = cb_data; if (!is_null_sha1(sha1)) { struct object *o = parse_object(sha1); if (o) { o->flags |= cb->all_flags; add_pending_object(cb->all_revs, o, ""); } else if (!cb->warned_bad_reflog) { warning("reflog of '%s' ...
false
false
false
false
false
0
User_timeperweek(userrec *u) { int i; u_long tot_time = 0; /* Add up all weekly activity times */ for(i=0; i<7; i++) tot_time += u->time_seen[i]; /* Update activity time if they're on right now */ if(u->first_activity) tot_time += (time(NULL) - u->first_activity); return tot_time; }
false
false
false
false
false
0
include(const FXSphered& sphere){ register FXdouble dx,dy,dz,dist,delta,newradius; if(0.0<=sphere.radius){ if(0.0<=radius){ dx=sphere.center.x-center.x; dy=sphere.center.y-center.y; dz=sphere.center.z-center.z; dist=sqrt(dx*dx+dy*dy+dz*dz); if(sphere.radius<dist+radius){ if...
false
false
false
false
false
0
fixupUnconditionalBr(ImmBranch &Br) { MachineInstr *MI = Br.MI; MachineBasicBlock *MBB = MI->getParent(); if (!isThumb1) llvm_unreachable("fixupUnconditionalBr is Thumb1 only!"); // Use BL to implement far jump. Br.MaxDisp = (1 << 21) * 2; MI->setDesc(TII->get(ARM::tBfar)); BBInfo[MBB->getNumber()].S...
false
false
false
false
false
0
drm_atomic_plane_get_property(struct drm_plane *plane, const struct drm_plane_state *state, struct drm_property *property, uint64_t *val) { struct drm_device *dev = plane->dev; struct drm_mode_config *config = &dev->mode_config; if (property == config->prop_fb_id) { *val = (state->fb) ? state->fb->base.id : 0...
false
false
false
false
false
0
strip_paren_comments(char *hdr) { /* Hmmm... is this correct? In Roy's latest draft, (comments) can nest! */ /* Nope, it isn't correct. Fails to handle backslash escape as well. */ while (*hdr) { if (*hdr == '"') { hdr = strchr(hdr, '"'); if (hdr == NULL) { ...
false
false
false
false
false
0
mcp251x_hw_tx_frame(struct spi_device *spi, u8 *buf, int len, int tx_buf_idx) { struct mcp251x_priv *priv = spi_get_drvdata(spi); if (mcp251x_is_2510(spi)) { int i; for (i = 1; i < TXBDAT_OFF + len; i++) mcp251x_write_reg(spi, TXBCTRL(tx_buf_idx) + i, buf[i]); } else { memcpy(priv->spi_tx_buf, ...
false
false
false
false
false
0
drag_var_motion(GtkWidget *widget, GdkDragContext *drag_context, gint x, gint y, guint time_, gpointer user_data) { struct var *from = dragging; struct var *to = user_data; int from_n, to_n, i; if (!has_target(widget, drag_context, "var")) return FALSE; if (from == to || from->table != to->table) retu...
false
false
false
false
false
0
sasl_cb(enum grecs_callback_command cmd, grecs_locus_t *locus, void *varptr, grecs_value_t *value, void *cb_data) { if (cmd == grecs_callback_set_value) { if (value->type != GRECS_TYPE_STRING) grecs_error(locus, 0, _("expected boolean value but found list")); else grecs_string_convert(&sasl_enable,...
false
false
false
false
false
0
virtscsi_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) { struct virtio_scsi *vscsi = container_of(nfb, struct virtio_scsi, nb); switch(action) { case CPU_ONLINE: case CPU_ONLINE_FROZEN: case CPU_DEAD: case CPU_DEAD_FROZEN: __virtscsi_set_affinity(vscsi, true); break; default...
false
false
false
false
false
0
sshv2_rmdir (gftp_request * request, const char *directory) { char *tempstr; size_t len; int ret; g_return_val_if_fail (request != NULL, GFTP_EFATAL); g_return_val_if_fail (request->protonum == GFTP_SSHV2_NUM, GFTP_EFATAL); g_return_val_if_fail (directory != NULL, GFTP_EFATAL); len = 0; tempstr = sshv...
false
false
false
false
false
0
ci_update_vce_dpm(struct radeon_device *rdev, struct radeon_ps *radeon_new_state, struct radeon_ps *radeon_current_state) { struct ci_power_info *pi = ci_get_pi(rdev); int ret = 0; u32 tmp; if (radeon_current_state->evclk != radeon_new_state->evclk) { if (radeon_new_state->evclk) { /* turn the...
false
false
false
false
false
0
toIsoString() const { char buf[32]; YearMonthDay ymd(yearMonthDay()); snprintf(buf, sizeof buf, "%4d-%02d-%02d", ymd.year, ymd.month, ymd.day); return buf; }
false
false
false
false
false
0
stringdiff(STRING *s1, STRING *s2) { STRING *s; size_t i; char *c2, *c; i = s1->s_len; if (i == 0) return slink(s1); s = stringcopy(s1); if (i > s2->s_len) i = s2->s_len; c = s->s_str; c2 = s2->s_str; while (i-- > 0) *c++ &= ~*c2++; return s; }
false
false
false
false
false
0
hexval(char c) { unsigned char uc = c | 0x20; unsigned int v; v = uc - '0'; if (v < 10) return v; return uc - 'a' + 10; }
false
false
false
false
false
0
tblw(void) { if (R.init_load_addr) R.PFC = R.ACC.w.l; tms32025_icount -= (1*CLK); GETDATA(0,0); if (R.external_mem_access) tms32025_icount -= (1*CLK); M_WRTROM(R.PFC, R.ALU.w.l); R.PFC++; }
false
false
false
false
false
0
sam_challenge_banner(krb5_int32 sam_type) { char *label; switch (sam_type) { case PA_SAM_TYPE_ENIGMA: /* Enigma Logic */ label = _("Challenge for Enigma Logic mechanism"); break; case PA_SAM_TYPE_DIGI_PATH: /* Digital Pathways */ case PA_SAM_TYPE_DIGI_PATH_HEX: /* Digital Pathw...
false
false
false
false
false
0
server_readlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, const char *buf, struct iatt *stbuf, dict_t *xdata) { gfs3_readlink_rsp rsp = {0,}; server_state_t *state = NULL; rpcsvc_request_t *req = N...
false
false
false
false
false
0
operator()(int i, int j) { using namespace std; bool Warn = false; if( i >= Width ) { i = Width-1; Warn = true; } if( i < 0 ) { i = 0; Warn = true; } if( j >= Height ) { j = Height-1; Warn = true; } if( j < 0 ) { j = 0; Warn = true; } if( Warn && EasyBMPwarnings ) { cout << "EasyBMP Warning: Attempted to ...
false
false
false
false
false
0
collect_free_pdata (QofQueryPredData *pd) { query_coll_t pdata; GList *node; node = NULL; pdata = (query_coll_t) pd; VERIFY_PDATA (query_collect_type); for (node = pdata->guids; node; node = node->next) { guid_free (node->data); } qof_collection_destroy(pdata->coll); g_l...
false
false
false
false
false
0
basename(const GUTF8String &gfname, const char *suffix) { if(!gfname.length()) return gfname; const char *fname=gfname; #if defined(WIN32) || defined(OS2) // Special cases if (fname[1] == colon) { if(!fname[2]) { return gfname; } if (!fname[3] && (fname[2]== slash || fname[2]== back...
false
false
false
false
false
0
http_parse_connection_header(struct http_txn *txn, struct http_msg *msg, int to_del) { struct hdr_ctx ctx; const char *hdr_val = "Connection"; int hdr_len = 10; if (txn->flags & TX_HDR_CONN_PRS) return; if (unlikely(txn->flags & TX_USE_PX_CONN)) { hdr_val = "Proxy-Connection"; hdr_len = 16; } ctx.idx = ...
false
false
false
false
false
0
send_conn_avail(SOCKET *sock) { Q_DSC dsc; int size; q_create(&dsc,q_buffer,MAX_Q_MSG); q_assign(&dsc,QF_msg_type,ATM_MSG_CONN_AVAIL); q_assign(&dsc,QF_call_ref,sock->call_ref); if ((size = q_close(&dsc)) >= 0) to_signaling(sock->sig,q_buffer,size); }
false
false
false
false
false
0
proc_key_users_show(struct seq_file *m, void *v) { struct rb_node *_p = v; struct key_user *user = rb_entry(_p, struct key_user, node); unsigned maxkeys = uid_eq(user->uid, GLOBAL_ROOT_UID) ? key_quota_root_maxkeys : key_quota_maxkeys; unsigned maxbytes = uid_eq(user->uid, GLOBAL_ROOT_UID) ? key_quota_root_maxb...
false
false
false
false
false
0
cb_key_pressed_left_side(GtkWidget *widget, GdkEventKey *event) { GtkWidget *entry_widget; GtkTextBuffer *text_buffer; GtkTextIter iter; if (event->keyval == GDK_Return) { gtk_signal_emit_stop_by_name(GTK_OBJECT(widget), "key_press_event"); if (ad...
false
false
false
false
false
0
gst_dvbsub_overlay_setcaps_video (GstPad * pad, GstCaps * caps) { GstDVBSubOverlay *render = GST_DVBSUB_OVERLAY (gst_pad_get_parent (pad)); gboolean ret = FALSE; render->width = 0; render->height = 0; if (!gst_video_format_parse_caps (caps, &render->format, &render->width, &render->height) || ...
false
false
false
false
false
0
FuncGASMAN_LIMITS( Obj self ) { Obj list; list = NEW_PLIST(T_PLIST_CYC+IMMUTABLE, 3); SET_LEN_PLIST(list,3); SET_ELM_PLIST(list, 1, INTOBJ_INT(SyStorMin)); SET_ELM_PLIST(list, 2, INTOBJ_INT(SyStorMax)); SET_ELM_PLIST(list, 3, INTOBJ_INT(SyStorKill)); return list; }
false
false
false
false
false
0
search_job(const char *jobid) { int i; for (i=0; i < JOB_MAX; i++) { if (job[i].jid != NULL) { if (strcmp(jobid, job[i].jid) == 0) { return i; } } } return -1; }
false
false
false
false
false
0
gc_config(const char *var, const char *value, void *cb) { if (!strcmp(var, "gc.packrefs")) { if (value && !strcmp(value, "notbare")) pack_refs = -1; else pack_refs = git_config_bool(var, value); return 0; } if (!strcmp(var, "gc.aggressivewindow")) { aggressive_window = git_config_int(var, value); ret...
false
false
false
false
false
0
switch_p_libstate_restore(char * dir_name, bool recover) { if (debug_flags & DEBUG_FLAG_SWITCH) info("switch_p_libstate_restore() starting"); /* No state saved or restored for this plugin, just initialize */ _lock(); _alloc_libstate(); _unlock(); return SLURM_SUCCESS; }
false
false
false
false
false
0
gen_inheritance_die (binfo, context_die) tree binfo; dw_die_ref context_die; { dw_die_ref die = new_die (DW_TAG_inheritance, context_die, binfo); add_type_attribute (die, BINFO_TYPE (binfo), 0, 0, context_die); add_data_member_location_attribute (die, binfo); if (TREE_VIA_VIRTUAL (binfo)) add_AT...
false
false
false
false
false
0
CanvasTableMovable() : m_row_line_width(0), m_column_line_width(0) { signal_motion_notify_event().connect(sigc::mem_fun(*this, &CanvasItemMovable::on_motion_notify_event)); signal_button_press_event().connect(sigc::mem_fun(*this, &CanvasItemMovable::on_button_press_event)); signal_button_release_event().conn...
false
false
false
false
false
0
mntns_install(struct nsproxy *nsproxy, struct ns_common *ns) { struct fs_struct *fs = current->fs; struct mnt_namespace *mnt_ns = to_mnt_ns(ns); struct path root; if (!ns_capable(mnt_ns->user_ns, CAP_SYS_ADMIN) || !ns_capable(current_user_ns(), CAP_SYS_CHROOT) || !ns_capable(current_user_ns(), CAP_SYS_AD...
false
false
false
false
false
0
test_config_write__add_value_at_file_with_no_clrf_at_the_end(void) { git_config *cfg; int i; cl_git_pass(git_config_open_ondisk(&cfg, "config17")); cl_git_pass(git_config_set_int32(cfg, "core.newline", 7)); git_config_free(cfg); cl_git_pass(git_config_open_ondisk(&cfg, "config17")); cl_git_pass(git_config_get_...
false
false
false
false
false
0
find_prev (GSList *list, gconstpointer data) { GSList *prev = NULL; while (list) { if (list->data == data) break; prev = list; list = list->next; } return prev; }
false
false
false
false
false
0
abraca_collections_view_on_drag_leave (AbracaCollectionsView* self, GtkWidget* widget, GdkDragContext* ctx, guint time) { GtkTreeModel* _tmp0_; GtkTreeModel* _tmp1_; AbracaCollectionsModel* _tmp2_; AbracaCollectionsModel* store; GtkTreeViewDropPosition pos = 0; GtkTreePath* _tmp3_ = NULL; GtkTreeViewDropPosition...
false
false
false
false
false
0
Oct6100ApiGetPhasingTsstSwSizes( IN tPOCT6100_CHIP_OPEN f_pOpenChip, OUT tPOCT6100_API_INSTANCE_SIZES f_pInstSizes ) { UINT32 ulTempVar; UINT32 ulResult; /* Determine the amount of memory required for the API phasing TSST list. */ f_pInstSizes->ulPhasingTsstList = f_pOpenChip->ulMaxPhasingTssts * siz...
false
false
false
false
false
0
caml_extunix_read_common(value v_fd, value v_buf, value v_ofs, value v_len, int mode) { CAMLparam4(v_fd, v_buf, v_ofs, v_len); ssize_t ret; size_t fd = Int_val(v_fd); size_t ofs = Long_val(v_ofs); size_t len = Long_val(v_len); size_t processed = 0; char iobuf[UNIX_BUFFER_SIZE]; while(le...
false
false
false
false
false
0
callback_free_lcdset_content(void *arg) { CD_Set *d; int j; d = arg; for(j=0;j<d->state_num;j++) { if (d->stateset[j].s != NULL) free(d->stateset[j].s); } free(d->stateset); free(d->name); free(d); }
false
false
false
false
false
0
atk_debugfs_ggrp_open(struct inode *inode, struct file *file) { struct atk_data *data = inode->i_private; char *buf = NULL; union acpi_object *ret; u8 cls; int i; if (!data->enumerate_handle) return -ENODEV; if (!data->debugfs.id) return -EINVAL; cls = (data->debugfs.id & 0xff000000) >> 24; ret = atk_ggr...
false
false
false
false
false
0
isJobTypeInQueue(const AB_JOB_TYPE type, const AB_ACCOUNT *acc) const { for(int i=0; i<this->jobqueue->size(); i++) { //jiiq = JobInfoInQueue const abt_jobInfo *jiiq = this->jobqueue->at(i); if ((jiiq->getAbJobType() == type) && (jiiq->getAbAccount() == acc)) { //jobtype exists and is for the s...
false
false
false
false
false
0
gegl_node_create_child (GeglNode *self, const gchar *operation) { GeglNode *ret; g_return_val_if_fail (operation != NULL, NULL); ret = gegl_node_new_child (self, "operation", operation, NULL); if (ret && self) { ret->dont_cache = self->dont_cache; } return ret; }
false
false
false
false
false
0
AddWatch(cb::shared_ptr<cbWatch> watch) { WatchesProperty *last_prop = static_cast<WatchesProperty*>(m_grid->GetLastItem(wxPG_ITERATE_DEFAULT)); WatchItem item; wxString symbol, value; watch->GetSymbol(symbol); if (last_prop && last_prop->GetLabel() == wxEmptyString) { item.property = ...
false
false
false
false
false
0
vxge_hw_ring_rxd_post_post(struct __vxge_hw_ring *ring, void *rxdh) { struct vxge_hw_ring_rxd_1 *rxdp = (struct vxge_hw_ring_rxd_1 *)rxdh; struct __vxge_hw_channel *channel; channel = &ring->channel; rxdp->control_0 = VXGE_HW_RING_RXD_LIST_OWN_ADAPTER; if (ring->stats->common_stats.usage_cnt > 0) ring->stats-...
false
false
false
false
false
0
drawBL(UINT8* p) { draw_ball_helper(p, horzBL, (VDELBL & 1) ? prevENABL : ENABL); }
false
false
false
false
false
0
write_file_tx99(struct file *file, const char __user *user_buf, size_t count, loff_t *ppos) { struct ath_softc *sc = file->private_data; struct ath_common *common = ath9k_hw_common(sc->sc_ah); char buf[32]; bool start; ssize_t len; int r; if (count < 1) return -EINVAL; if (sc->cur_chan->nvifs > 1)...
true
true
false
false
false
1
exprList() { returnAST = nullAST; ASTPair currentAST; RefAST exprList_AST = nullAST; try { // for error handling expr(); astFactory.addASTChild(currentAST, returnAST); { do { if ((LA(1)==OP_COMMA)) { RefAST tmp19_AST = nullAST; tmp19_AST = astFactory.create(LT(1)); match(OP_COMMA); ...
false
false
false
false
false
0
aclParseDenyInfoLine(acl_deny_info_list ** head) { char *t = NULL; acl_deny_info_list *A = NULL; acl_deny_info_list *B = NULL; acl_deny_info_list **T = NULL; acl_name_list *L = NULL; acl_name_list **Tail = NULL; /* first expect a page name */ if ((t = strtok(NULL, w_space)) == NULL) { ...
false
false
false
false
false
0
T(const R3Point& point) const { // Return parametric value of closest point on span if (length == 0.0) return 0.0; R3Vector topoint = point - Start(); return Vector().Dot(topoint); }
false
false
false
false
false
0
do_append(ch, rep, pos) LWCHAR ch; char *rep; POSITION pos; { register int a; LWCHAR prev_ch; a = AT_NORMAL; if (ch == '\b') { if (bs_mode == BS_CONTROL) goto do_control_char; /* * A better test is needed here so we don't * backspace over part of the printed * representation of a binary chara...
false
false
false
false
false
0
DLLErrorInternal(PRIntn oserr) /* ** This whole function, and most of the code in this file, are run ** with a big hairy lock wrapped around it. Not the best of situations, ** but will eventually come up with the right answer. */ { const char *error = NULL; #ifdef USE_DLFCN error = dlerror(); /* $$$ That'll be...
false
false
false
false
false
0
mca_btl_sctp_endpoint_shutdown(mca_btl_base_endpoint_t* btl_endpoint) { OPAL_THREAD_LOCK(&btl_endpoint->endpoint_recv_lock); OPAL_THREAD_LOCK(&btl_endpoint->endpoint_send_lock); mca_btl_sctp_endpoint_close(btl_endpoint); btl_endpoint->endpoint_state = MCA_BTL_SCTP_SHUTDOWN; OPAL_THREAD_UNLOCK(&btl_e...
false
false
false
false
false
0
isicom_write_room(struct tty_struct *tty) { struct isi_port *port = tty->driver_data; int free; if (isicom_paranoia_check(port, tty->name, "isicom_write_room")) return 0; free = SERIAL_XMIT_SIZE - port->xmit_cnt - 1; if (free < 0) free = 0; return free; }
false
false
false
false
false
0
enumerator_create_directory(const char *path) { int len; dir_enum_t *this = malloc_thing(dir_enum_t); this->public.enumerate = (void*)enumerate_dir_enum; this->public.destroy = (void*)destroy_dir_enum; if (*path == '\0') { path = "./"; } len = snprintf(this->full, sizeof(this->full)-1, "%s", path); if (len ...
true
true
false
false
false
1
gst_camera_bin_skip_next_preview (GstCameraBin2 * camerabin) { gchar *location; g_mutex_lock (camerabin->preview_list_mutex); if (camerabin->preview_location_list) { location = camerabin->preview_location_list->data; GST_DEBUG_OBJECT (camerabin, "Skipping preview for %s", location); g_free (location)...
false
false
false
false
false
0
set_spec (const char *name, const char *spec) { struct spec_list *sl; const char *old_spec; int name_len = strlen (name); int i; /* If this is the first call, initialize the statically allocated specs. */ if (!specs) { struct spec_list *next = (struct spec_list *) 0; for (i = ARRAY_SIZE (s...
false
false
false
false
false
0
IOWarrior_chr(Driver *drvthis, int x, int y, char c) { PrivateData *p = drvthis->private_data; y--; x--; if ((x >= 0) && (y >= 0) && (x < p->width) && (y < p->height)) p->framebuf[(y * p->width) + x] = c; debug(RPT_DEBUG, "%s: writing char 0x%02X at (%d,%d)", drvthis->name, (unsigned) c, x, y); }
false
false
false
false
false
0
queueDone(queue* q) { chunk* done = createChunk(); done->action = DONE; if(enque(done, q)) { return true; } pdebug("!!!!!queueDone Failed!!!!!"); return false; }
false
false
false
false
false
0
imCompressDataUnZ(const void* src_data, int src_size, void* dst_data, int dst_size) { uLongf ret_size = (uLongf)dst_size; if (uncompress((Bytef*)dst_data, &ret_size, (const Bytef*)src_data, src_size) != Z_OK) return 0; return (int)ret_size; }
false
false
false
false
false
0
BigPop(p) register Prob *p; { static WORD tmp; register int i; BigDiv(0, &tmp); i = 0; while ((tmp < p->p_offset) || (tmp >= p->p_range + p->p_offset)) { p++; i++; } BigMul(p->p_range); BigAdd(tmp - p->p_offset); return i; }
false
false
false
false
false
0
hmac_sha_data(const unsigned char data[], unsigned long data_len, hmac_ctx cx[1]) { unsigned int i; if(cx->klen != HMAC_IN_DATA) /* if not yet in data phase */ { if(cx->klen > HASH_INPUT_SIZE) /* if key is being hashed */ { ...
false
false
false
false
false
0
stream_flush_cb(struct bt_ctf_stream *stream, struct bt_ctf_writer *writer) { struct bt_ctf_field *stream_id; /* Start a new packet in the stream */ if (stream->flushed_packet_count) { /* ctf_init_pos has already initialized the first packet */ ctf_packet_seek(&stream->pos.parent, 0, SEEK_CUR); } stream_id =...
false
false
false
false
false
0
signal_reference(struct task_context *tc, ulong flags, struct reference *ref) { if (flags & FOREACH_SIG) error(FATAL, "sig: -R not supported yet\n"); else error(FATAL, "-R not supported yet\n"); }
false
false
false
false
false
0
command_table_get_label_array (InputPadTableCmd *cmds) { int i = 0, len; char **retval = NULL; if (cmds == NULL) { return NULL; } while (cmds[i].execl) { i++; } len = i; retval = g_new0 (char *, len + 1); for (i = 0; cmds[i].execl; i++) { if (cmds[i].label) {...
false
false
false
false
false
0
goc_polyline_distance (GocItem *item, double x, double y, GocItem **near_item) { GocPolyline *polyline = GOC_POLYLINE (item); GOStyle *style = go_style_dup (go_styled_object_get_style (GO_STYLED_OBJECT (item))); double tmp_width = 0; double res = 20; double ppu = goc_canvas_get_pixels_per_unit (item->canvas); cai...
false
false
false
false
false
0
match_body(const Classifier_Program &c, StringAccum &source) { source << " int l = p->network_length();\n\ if (l > (int) p->network_header_length())\n\ l += " << IPCLASSIFIER_OFFSET_TRANSP << " - p->network_header_length();\n\ else\n\ l += " << IPCLASSIFIER_OFFSET_NET << ";\n\ if (l < " << c.safe_len...
false
false
false
false
false
0
returnjump_p (insn) rtx insn; { if (GET_CODE (insn) != JUMP_INSN) return 0; return for_each_rtx (&PATTERN (insn), returnjump_p_1, NULL); }
false
false
false
false
false
0
FcParseAlias (FcConfigParse *parse) { FcExpr *family = 0, *accept = 0, *prefer = 0, *def = 0, *new = 0; FcEdit *edit = 0, *next; FcVStack *vstack; FcTest *test; FcValueBinding binding; if (!FcConfigLexBinding (parse, FcConfigGetAttribute (parse, "binding"), &binding)) return; while ((vsta...
false
false
false
false
false
0
gngb_file_close(GNGB_FILE *f) { switch(f->type) { case NORMAL_FILE_TYPE: case GB_ROM_FILE_TYPE:return fclose((FILE *)f->stream); case GZIP_FILE_TYPE: #ifdef HAVE_LIBZ return gzclose((gzFile)f->stream); #else fprintf(stderr,"Gzip file unsupported\n"); return -1; #endif case ZIP_ARCH_FILE_TYPE: ...
false
false
false
false
false
0
GetCML () { if (m_CML.length () == 0) { GsfOutput *output = gsf_output_memory_new (); GetDocument ()->GetApp ()->Save (output, "chemical/x-cml", this, m_Content); size_t l = gsf_output_size (output); if (l > 0) m_CML.assign (reinterpret_cast <char const *> (gsf_output_memory_get_bytes (GSF_OUTPUT_MEMORY (ou...
false
false
false
false
false
0
getCoeffABC(Term *t1, double *a, double *b, double *c, int i, int j){ while(t1){ int ind; int expo = t1->getExpo(); double coeff = t1->getCoeff(); if (t1->indVar(i, m) && (expo == 1)){ ind = t1->getOtherInd(i, m); if (ind == -1) *a += coeff; else if (ind == -2){ perror("getCoeffABC...
false
false
false
false
false
0
yyprint (FILE *file, int type, YYSTYPE value) { switch (type) { case tBACK_REF: fprintf (file, " \\%d", value.integer); break; case tFFLAGS: putc (' ', file); fflag_self_print (value.fflags, file); break; case tFACE: fprintf (file, " %s", face_to_string (value.face)); break; cas...
false
false
false
false
false
0
main (int argc, char* argv[]) { float size_in_giga = 0; size_t size, i,j; int index; if (argc >= 2) { size_in_giga = atof(argv[1]); } else { size_in_giga = 4.8; } if (size_in_giga <= 0) { fprintf(stderr, "ERROR: The input size argument should be " "po...
false
false
false
false
false
0
elm_slideshow_timeout_set(Evas_Object *obj, double timeout) { ELM_SLIDESHOW_CHECK(obj); ELM_SLIDESHOW_DATA_GET(obj, sd); sd->timeout = timeout; if (sd->timer) ecore_timer_del(sd->timer); sd->timer = NULL; if (timeout > 0.0) sd->timer = ecore_timer_add(timeout, _timer_...
false
false
false
false
false
0
ares_malloc_data(ares_datatype type) { struct ares_data *ptr; ptr = malloc(sizeof(struct ares_data)); if (!ptr) return NULL; switch (type) { case ARES_DATATYPE_SRV_REPLY: ptr->data.srv_reply.next = NULL; ptr->data.srv_reply.host = NULL; ptr->data.srv_reply.priority = 0; ...
false
false
false
false
false
0
probe_sysfs_tp(blkid_probe pr, const struct blkid_idmag *mag __attribute__((__unused__))) { dev_t dev, disk = 0; int rc; struct sysfs_cxt sysfs, parent; size_t i, count = 0; dev = blkid_probe_get_devno(pr); if (!dev || sysfs_init(&sysfs, dev, NULL) != 0) return 1; rc = 1; /* nothing (default) */ for (i ...
false
false
false
false
false
0
ps8622_backlight_update(struct backlight_device *bl) { struct ps8622_bridge *ps8622 = dev_get_drvdata(&bl->dev); int ret, brightness = bl->props.brightness; if (bl->props.power != FB_BLANK_UNBLANK || bl->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK)) brightness = 0; if (!ps8622->enabled) return -EI...
false
false
false
false
false
0
dp_is_selected(DirPane *dp, const DirRow2 *row) { if(dp == NULL || row == NULL) return FALSE; return gtk_tree_selection_iter_is_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(dp->view)), (GtkTreeIter *) row); }
false
false
false
false
false
0
Evaluate() { ResultList *result = 0; Query *left = (Query *)operands[0]; Query *right = (Query *)operands[1]; if(left && right) { ResultList *l = left->GetResults(); if(l) { ResultList *r = right->GetResults(); if(r) { if(l->IsIgnore()) { result = new ResultList(*r); } else if(...
false
false
false
false
false
0
vas_find_end_v1(void) { struct map_hdr_v1 *hdr; u_long end; end = vas_map_base_v1->end_va; for(hdr = vas_map_base_v1; hdr; hdr = hdr->next) if(hdr->end_va > end) end = hdr->end_va; return end; }
false
false
false
false
false
0
bin_save_open(FILE * f, open_op_t * op_it) { int rv; int32_t i32; int32_t len; char c = OP_OPEN; write_char(c); len = strlen(op_it->name); write_int32(len); write_string(op_it->name, len); write_int32(op_it->flags); write_int32(op_it->mode); write_int32(op_it->retval); if ( (rv = bin_write_info(f, &op_it-...
false
false
false
false
false
0
save_montage() { if(!files_open) return; if(!signalcomps) return; UI_SaveMontagewindow save_mtg(this); }
false
false
false
false
false
0
Java_estraier_Database_uri_1to_1id(JNIEnv *env, jobject obj, jstring uri){ jclass cls; jfieldID fid; jlong coreptr; jboolean icuri; const char *turi; int id; cls = (*env)->GetObjectClass(env, obj); fid = (*env)->GetFieldID(env, cls, "coreptr", "J"); coreptr = (*env)->GetLongField(env, obj, fid); if(...
false
false
false
false
false
0
assign_out_path_ctls(struct hda_codec *codec, struct nid_path *path) { struct hda_gen_spec *spec = codec->spec; hda_nid_t nid; unsigned int val; int badness = 0; if (!path) return BAD_SHARED_VOL * 2; if (path->ctls[NID_PATH_VOL_CTL] || path->ctls[NID_PATH_MUTE_CTL]) return 0; /* already evaluated */ ...
false
false
false
false
false
0