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
getGpuShaderText(const GpuShaderDesc & shaderDesc) const { AutoMutex lock(m_resultsCacheMutex); if(m_lastShaderDesc != shaderDesc.getCacheID()) { m_lastShaderDesc = shaderDesc.getCacheID(); m_shader = ""; m_shaderCacheID = ""; m_lut3D....
false
false
false
false
false
0
InsertLine(int line, int edition, bool undoing) { if (collecting && !undoing) { state.InsertSpace(line, 1); int linePosition = line; int fillLength = 1; if (state.FillRange(linePosition, edition, fillLength)) AdvanceEdition(); } }
false
false
false
false
false
0
add_to_process(struct process *process, struct latency_line *line) { GList *item; struct latency_line *line2; item = g_list_first(process->latencies); while (item) { line2 = item->data; item = g_list_next(item); if (strcmp(line->reason, line2->reason)==0) { line2->count += line->count; line2->time += li...
false
false
false
false
false
0
rgb2pixel( unsigned int r, unsigned int g, unsigned int b ) { FL_State *s = fl_state + fl_vmode; /* This one drops bits and looks bad if primary color resolution is less than 6, but server calculates color this way. A better way should be r = ((float) r * ((1L << s->rbits) ...
false
false
false
false
false
0
nfs_can_extend_write(struct file *file, struct page *page, struct inode *inode) { int ret; struct file_lock_context *flctx = inode->i_flctx; struct file_lock *fl; if (file->f_flags & O_DSYNC) return 0; if (!nfs_write_pageuptodate(page, inode)) return 0; if (NFS_PROTO(inode)->have_delegation(inode, FMODE_WRIT...
false
false
false
false
false
0
skip(int direction) { if (direction > 0) mesg(_("...skipping forward\n")); else mesg(_("...skipping backward\n")); }
false
false
false
false
false
0
pdc20621_interrupt(int irq, void *dev_instance) { struct ata_host *host = dev_instance; struct ata_port *ap; u32 mask = 0; unsigned int i, tmp, port_no; unsigned int handled = 0; void __iomem *mmio_base; VPRINTK("ENTER\n"); if (!host || !host->iomap[PDC_MMIO_BAR]) { VPRINTK("QUICK EXIT\n"); return IRQ_NON...
false
false
false
false
false
0
complete_login (struct credentials *pcred) { char *cwd; if (setegid ((gid_t) pcred->gid) < 0) { reply (550, "Can't set gid."); goto bad; } #ifdef HAVE_INITGROUPS initgroups (pcred->name, pcred->gid); #endif /* open wtmp before chroot */ snprintf (ttyline, sizeof (ttyline), "ftp%d", (int...
false
false
false
false
true
1
is_card_of_driver(char *cardname, struct contrprocinfo *p) { if (strcmp(cardname, p->driver) == 0) return 1; if ( strcmp(cardname, "b1pci") == 0 && strcmp(p->driver, "b1pciv4") == 0) return 1; if (strcmp(cardname, p->name) == 0) return 1; return 0; }
false
false
false
false
false
0
script_handler_copy(spif_charptr_t *params) { unsigned char i; char *buffer_id; Atom sel = XA_PRIMARY; if (params) { for (i = 0; (buffer_id = params[i]); i++) { if (*buffer_id) { if (*buffer_id >= '0' && *buffer_id <= '7') { sel = (Atom) ((int) XA...
false
false
false
false
false
0
gigolo_describe_scheme(const gchar *scheme) { if (gigolo_str_equal(scheme, "file")) return _("Unix Device"); else if (gigolo_str_equal(scheme, "smb")) return _("Windows Share"); else if (gigolo_str_equal(scheme, "ftp")) return _("FTP"); else if (gigolo_str_equal(scheme, "http")) return _("HTTP"); else if (...
false
false
false
false
false
0
nilfs_transaction_commit(struct super_block *sb) { struct nilfs_transaction_info *ti = current->journal_info; struct the_nilfs *nilfs = sb->s_fs_info; int err = 0; BUG_ON(ti == NULL || ti->ti_magic != NILFS_TI_MAGIC); ti->ti_flags |= NILFS_TI_COMMIT; if (ti->ti_count > 0) { ti->ti_count--; trace_nilfs2_trans...
false
false
false
false
false
0
go_marker_palette_render_func (cairo_t *cr, GdkRectangle const *area, int index, gpointer data) { GOMarker *marker; GOMarkerSelectorState *state = data; int size = 2 * ((int) (MIN (area->width, area->height) * .30)); if (size < 1) return; marker = go_marker_new (); go_marker_set_...
false
false
false
false
false
0
squash_message(void) { struct rev_info rev; struct commit *commit; struct strbuf out; struct commit_list *j; int fd; printf("Squash commit -- not updating HEAD\n"); fd = open(git_path("SQUASH_MSG"), O_WRONLY | O_CREAT, 0666); if (fd < 0) die("Could not write to %s", git_path("SQUASH_MSG")); init_revisions(...
false
false
false
false
true
1
wbeachvl_get_bg_tile_info(int tile_index) { UINT16 code = wbeachvl_videoram3[2*tile_index]; UINT16 color = wbeachvl_videoram3[2*tile_index+1]; SET_TILE_INFO( 1, code & 0x7fff, color / 4, (code & 0x8000) ? TILE_FLIPX : 0) }
false
false
false
false
false
0
count_active_levels(stonith_topology_t * tp) { int lpc = 0; int count = 0; for (lpc = 0; lpc < ST_LEVEL_MAX; lpc++) { if (tp->levels[lpc] != NULL) { count++; } } return count; }
false
false
false
false
false
0
popitem() { return tuple(detail::borrowed_reference( this->attr("popitem")().ptr() )); }
false
false
false
false
false
0
ixgb_get_ee_pba_number(struct ixgb_hw *hw) { if (ixgb_check_and_get_eeprom_data(hw)) return le16_to_cpu(hw->eeprom[EEPROM_PBA_1_2_REG]) | (le16_to_cpu(hw->eeprom[EEPROM_PBA_3_4_REG])<<16); return 0; }
false
false
false
false
false
0
nsspkcs5_PBKDF1(const SECHashObject *hashObj, SECItem *salt, SECItem *pwd, int iter, PRBool faulty3DES) { SECItem *hash = NULL, *pre_hash = NULL; SECStatus rv = SECFailure; if((salt == NULL) || (pwd == NULL) || (iter < 0)) { return NULL; } hash = (SECItem *)PORT_ZAlloc(sizeof(SECItem)); ...
false
false
false
false
false
0
getDeclGroupRefEndLoc(DeclGroupRef DGR) { Decl *LastD; if (DGR.isSingleDecl()) { LastD = DGR.getSingleDecl(); } else { DeclGroupRef::iterator E = DGR.end(); --E; LastD = (*E); } #if 0 VarDecl *VD = dyn_cast<VarDecl>(LastD); TransAssert(VD && "Bad VD!"); SourceRange VarRange = VD->getSo...
false
false
false
false
false
0
get_default_magic(void) { static const char hmagic[] = "/.magic"; static char default_magic[2 * MAXPATHLEN + 2]; char *home; char hmagicpath[MAXPATHLEN + 1]; if ((home = getenv("HOME")) == NULL) return MAGIC; (void)snprintf(hmagicpath, sizeof(hmagicpath), "%s%s", home, hmagic); if (access(hmagicpath, R_OK) ...
false
false
false
false
false
0
get_area(stl_facet *facet) { double cross[3][3]; float sum[3]; float n[3]; float area; int i; /* cast to double before calculating cross product because large coordinates can result in overflowing product (bad area is responsible for bad volume and bad facets reversal) */ for(i = 0; i < 3; i++) ...
false
false
false
false
false
0
finish_password_change (gboolean passwd_provided) { GtkWidget *user_passwd_dialog; GtkWidget *nocheck_toggle; OobsUser *user; OobsGroup *no_passwd_login_group; gboolean no_passwd_login_changed; gboolean is_self; user_passwd_dialog = gst_dialog_get_widget (tool->main_dialog, "user_passwd_dialog"); nocheck_...
false
false
false
false
false
0
qla82xx_msix_rsp_q(int irq, void *dev_id) { scsi_qla_host_t *vha; struct qla_hw_data *ha; struct rsp_que *rsp; struct device_reg_82xx __iomem *reg; unsigned long flags; uint32_t host_int = 0; rsp = (struct rsp_que *) dev_id; if (!rsp) { printk(KERN_INFO "%s(): NULL response queue pointer.\n", __func__); ...
false
false
false
false
false
0
insert( const CRenderizablePtr &newObject, const std::string &viewportName ) { MRPT_START for (TListViewports::iterator it = m_viewports.begin();it!= m_viewports.end();++it) { if ((*it)->m_name == viewportName ) { (*it)->insert(newObject); return; } } THROW_EXCEPTION_CUSTOM_MSG1("Error: viewport '%s' n...
false
false
false
false
false
0
GOUse_go_gordunni_trap(Player* pPlayer, GameObject* pGo) { switch (urand(0, 1)) { case 0: pPlayer->CastSpell(pGo->GetPositionX(), pGo->GetPositionY(), pGo->GetPositionZ(), 19394, false); break; case 1: pPlayer->CastSpell(pGo->GetPositionX(), pGo->GetPositionY(), pGo->GetPositionZ...
false
false
false
false
false
0
parse_stats(unsigned counters[STATS_END], char *buf) { int i; char *p, *p2; p = buf; for (i=0;i<STATS_END;i++) { counters[i] += strtol(p, &p2, 10); if (!p2 || p2 == p) break; p = p2; } }
false
false
false
false
false
0
Next() // Next discrete random variable { int i = (int)(n*RNG->Next()); if (RNG->Next()<p[i]) i=ialt[i]; return val ? val[i] : (Real)i; }
false
false
false
false
false
0
dy_initbasis (int concnt, int factor, double zero_tol) /* This routine calls the glpk routine inv_create to initialize the basis data structures, then sets values for the zero tolerance (eps_tol), pivot ratio (piv_tol) and number of candidates examined (piv_lim). NOTE: This routine can be (and typically is) c...
false
false
false
false
false
0
initqueue(struct queue *q) { struct requirements noreq = { 0, ALLMASK, 0 }; struct initdata init = { NULL, 0 }; #ifdef DEBUG printf("\n\nInitializing queue\n"); #endif q->palettechg = NULL; if (!q->first->action->requirement(q->first, &noreq)) return 0; if (!q->last->action->initialize(q->last,...
false
false
false
false
false
0
GetNoDataValue( int *pbSuccess) { std::vector<double> &v=m_parent_dataset->vNoData; if (v.size()==0) return GDALPamRasterBand::GetNoDataValue(pbSuccess); if (pbSuccess) *pbSuccess=TRUE; return getBandValue(v,nBand); }
false
false
false
false
false
0
tds_gss_free(TDSSOCKET * tds, struct tds_authentication * tds_auth) { TDSGSSAUTH *auth = (TDSGSSAUTH *) tds_auth; OM_uint32 min_stat; if (auth->tds_auth.packet) { gss_buffer_desc send_tok; send_tok.value = (void *) auth->tds_auth.packet; send_tok.length = auth->tds_auth.packet_len; gss_release_buffer(&min_...
false
false
false
false
false
0
SUBR_chr(void) { int car; SUBR_GET_PARAM(1); VALUE_conv_integer(PARAM); car = PARAM->_integer.value; if (car < 0 || car > 255) THROW(E_ARG); STRING_char_value(PARAM, car); }
false
false
false
false
false
0
main(int argc, const char **argv) { /* read variables and init gpio */ config(); open_gpio(); send_msg(RPiMsgInit); /* set up data files: */ start_time = time(NULL); while (ethernet && (start_time < 600)) { sleep(1); start_time = time(NULL); } logs_open(); signal(SIGINT, &signal_handler); signal(SIGTERM,...
false
false
false
false
true
1
NK6510_GetProfile(gn_data *data, struct gn_statemachine *state) { unsigned char req[150] = {FBUS_FRAME_HEADER, 0x01, 0x01, 0x0C, 0x01}; int i, length = 7; for (i = 0; i < 0x0a; i++) { req[length] = 0x04; req[length + 1] = data->profile->number; req[length + 2] = i; req[length + 3] = 0x01; length += 4; } ...
true
true
false
false
false
1
fc_aton ( const char *wwn_text, struct fc_name *wwn ) { char *ptr = ( ( char * ) wwn_text ); unsigned int i = 0; while ( 1 ) { wwn->bytes[i++] = strtoul ( ptr, &ptr, 16 ); if ( i == sizeof ( wwn->bytes ) ) return ( ( *ptr == '\0' ) ? 0 : -EINVAL ); if ( *ptr != ':' ) return -EINVAL; ptr++; } }
false
true
false
false
false
1
nssCKMDSessionObject_Create ( NSSCKFWToken *fwToken, NSSArena *arena, CK_ATTRIBUTE_PTR attributes, CK_ULONG ulCount, CK_RV *pError ) { NSSCKMDObject *mdObject = (NSSCKMDObject *)NULL; nssCKMDSessionObject *mdso = (nssCKMDSessionObject *)NULL; CK_ULONG i; nssCKFWHash *hash; *pError = CKR_OK; mdso...
false
false
false
false
false
0
DoSummonCritter(CreatureSummonPositions& list, SummonPropertiesEntry const* prop, SpellEffectIndex effIdx, uint32 /*level*/) { MANGOS_ASSERT(!list.empty() && prop); // ATM only first position is supported for summoning uint32 pet_entry = m_spellInfo->EffectMiscValue[effIdx]; CreatureInfo const* cInfo =...
false
false
false
false
false
0
save_image(void) { int i; if (!need_saving) return; for (i = 0; i < maxROWS; i++) { (void) memmove(ea_save[appres.save_lines+i], (ea_buf + (i*COLS)), COLS*sizeof(struct ea)); } need_saving = False; }
false
false
false
false
false
0
evas_render_invalidate(Evas *e) { MAGIC_CHECK(e, Evas, MAGIC_EVAS); return; MAGIC_CHECK_END(); eina_array_clean(&e->active_objects); eina_array_clean(&e->render_objects); eina_array_flush(&e->restack_objects); eina_array_flush(&e->delete_objects); e->invalidate = EINA_TRUE; }
false
false
false
false
false
0
_equalCreateFunctionStmt(CreateFunctionStmt *a, CreateFunctionStmt *b) { COMPARE_SCALAR_FIELD(replace); COMPARE_NODE_FIELD(funcname); COMPARE_NODE_FIELD(parameters); COMPARE_NODE_FIELD(returnType); COMPARE_NODE_FIELD(options); COMPARE_NODE_FIELD(withClause); return true; }
false
false
false
false
false
0
iscsi_sysfs_for_each_session(void *data, int *nr_found, iscsi_sysfs_session_op_fn *fn, int in_parallel) { struct dirent **namelist; int rc = 0, n, i, chldrc = 0; struct session_info *info; pid_t pid = 0; info = calloc(1, sizeof(*info)); if (!info) return ISCSI_ERR_NOMEM; n = scandir(ISCSI_SESSION_D...
false
false
false
false
false
0
bfa_fcs_rport_sm_nsdisc_sent(struct bfa_fcs_rport_s *rport, enum rport_event event) { bfa_trc(rport->fcs, rport->pwwn); bfa_trc(rport->fcs, rport->pid); bfa_trc(rport->fcs, event); switch (event) { case RPSM_EVENT_ACCEPTED: case RPSM_EVENT_ADDRESS_CHANGE: if (rport->pid) { bfa_sm_set_state(rport, bfa_fcs...
false
false
false
false
false
0
rpcsvc_program_unregister_portmap (rpcsvc_program_t *prog) { int ret = 0; if (!prog) goto out; if (!(pmap_unset(prog->prognum, prog->progver))) { gf_log (GF_RPCSVC, GF_LOG_ERROR, "Could not unregister with" " portmap"); go...
false
false
false
false
false
0
dbeta(double x, double a, double b, int give_log) { double lval; #ifdef IEEE_754 /* NaNs propagated correctly */ if (ISNAN(x) || ISNAN(a) || ISNAN(b)) return x + a + b; #endif if (a <= 0 || b <= 0) ML_ERR_return_NAN; if (x < 0 || x > 1) return(R_D__0); if (x == 0) { if(a > 1) return(R_D__0); ...
false
false
false
false
false
0
prune_by_reuse (struct mem_ref_group *groups) { for (; groups; groups = groups->next) prune_group_by_reuse (groups); }
false
false
false
false
false
0
initMaskGenerator(vplUint32* buffer, vplUint spCount, HorizontalSpan* span) { maskBuffer_ = buffer; subPixelCount_ = spCount; span_ = span; // Choose offsets if(subPixelCo...
false
false
false
false
false
0
rb_player_gst_xfade_seekable (RBPlayer *iplayer) { RBPlayerGstXFade *player = RB_PLAYER_GST_XFADE (iplayer); gboolean can_seek = TRUE; RBXFadeStream *stream; /* is this supposed to query the most recently opened stream, * or the current playing stream? I really don't know. */ g_rec_mutex_lock (&player->priv-...
false
false
false
false
false
0
load_inst(UnpicklerObject *self) { PyObject *cls = NULL; PyObject *args = NULL; PyObject *obj = NULL; PyObject *module_name; PyObject *class_name; Py_ssize_t len; Py_ssize_t i; char *s; if ((i = marker(self)) < 0) return -1; if ((len = _Unpickler_Readline(self, &s)) < 0)...
false
false
false
false
false
0
clear(bool deep_clear) { if (deep_clear) m_data.clear(); else { for (map<string,TCallData>::iterator i=m_data.begin();i!=m_data.end();++i) i->second = TCallData(); } }
false
false
false
false
false
0
tail_append_pending_moves(struct pending_dir_move *moves, struct list_head *stack) { if (list_empty(&moves->list)) { list_add_tail(&moves->list, stack); } else { LIST_HEAD(list); list_splice_init(&moves->list, &list); list_add_tail(&moves->list, stack); list_splice_tail(&list, stack); } }
false
false
false
false
false
0
wr_player_spells(void) { int i; wr_u16b(PY_MAX_SPELLS); for (i = 0; i < PY_MAX_SPELLS; i++) wr_byte(p_ptr->spell_flags[i]); for (i = 0; i < PY_MAX_SPELLS; i++) wr_byte(p_ptr->spell_order[i]); }
false
false
false
false
false
0
check_deps_environment_vars (void) { char *spec; spec = getenv ("DEPENDENCIES_OUTPUT"); if (spec) cpp_opts->deps.style = DEPS_USER; else { spec = getenv ("SUNPRO_DEPENDENCIES"); if (spec) { cpp_opts->deps.style = DEPS_SYSTEM; cpp_opts->deps.ignore_main_file = true; } } if (sp...
false
false
false
false
false
0
saved_frames_new (void) { struct saved_frames *saved_frames = NULL; saved_frames = GF_CALLOC (1, sizeof (*saved_frames), gf_common_mt_rpcclnt_savedframe_t); if (!saved_frames) { return NULL; } INIT_LIST_HEAD (&saved_frames->sf.list); INIT_LIST_HEAD (&saved_frames->lk_sf.list)...
false
false
false
false
false
0
HPCC_fftw_mpi(hpcc_fftw_mpi_plan p, int n_fields, fftw_complex *local_data, fftw_complex *work){ int rank, size; s64Int_t n; int i, ln; MPI_Comm_size( p->comm, &size ); MPI_Comm_rank( p->comm, &rank ); n = p->n; if (FFTW_FORWARD == p->dir) HPCC_pzfft1d( n, local_data, work, p->work, rank, size, -1,...
false
false
false
false
false
0
OutputMemberInit(struct MemberInit * init, struct __ecereNameSpace__ecere__com__Instance * f) { if(init->identifiers) { if((*init->identifiers).count > 1) { struct Identifier * id; for(id = (*init->identifiers).first; id; id = id->next) { OutputIdentifier(id, f); if(id->next) ((unsigned int (*)(struct __ecereNameSpace...
false
false
false
false
false
0
intel_setup_irq_remapping(struct intel_iommu *iommu) { struct ir_table *ir_table; struct page *pages; unsigned long *bitmap; if (iommu->ir_table) return 0; ir_table = kzalloc(sizeof(struct ir_table), GFP_KERNEL); if (!ir_table) return -ENOMEM; pages = alloc_pages_node(iommu->node, GFP_KERNEL | __GFP_ZERO,...
false
false
false
false
false
0
Transpose(TransposedMatrix*, MatrixType mt) { REPORT GeneralMatrix* gmx = new RowVector; MatrixErrorNoSpace(gmx); gmx->nrows_val = 1; gmx->ncols_val = gmx->storage = storage; return BorrowStore(gmx,mt); }
false
false
false
false
false
0
addreq(const struct l2t_entry *e, const u32 *addr) { if (e->v6) return (e->addr[0] ^ addr[0]) | (e->addr[1] ^ addr[1]) | (e->addr[2] ^ addr[2]) | (e->addr[3] ^ addr[3]); return e->addr[0] ^ addr[0]; }
false
false
false
false
false
0
removeAttr(const char* attrname, const char* attrval) { if (this->attrs==NULL || attrname==NULL || attrname[0]==0) return 0; int aid=this->names->attrs.getId(attrname); if (aid<0) return 0; int delcount=0; //could be more than one ? for (int i=0;i<this->attrs->Count();i++) { if (aid==this->attrs->Get(i)...
false
false
false
false
false
0
mark_columns_needed_for_delete() { if (triggers) triggers->mark_fields_used(TRG_EVENT_DELETE); if (file->ha_table_flags() & HA_REQUIRES_KEY_COLUMNS_FOR_DELETE) { Field **reg_field; for (reg_field= field ; *reg_field ; reg_field++) { if ((*reg_field)->flags & PART_KEY_FLAG) bitmap_set...
false
false
false
false
false
0
ast_pbx_outgoing_cdr_failed(void) { /* allocate a channel */ struct ast_channel *chan = ast_dummy_channel_alloc(); if (!chan) return -1; /* failure */ ast_channel_cdr_set(chan, ast_cdr_alloc()); if (!ast_channel_cdr(chan)) { /* allocation of the cdr failed */ chan = ast_channel_unref(chan); /* free the ...
false
false
false
false
false
0
tp_account_channel_request_set_request_property ( TpAccountChannelRequest *self, const gchar *name, GVariant *value) { GValue *v; g_return_if_fail (TP_IS_ACCOUNT_CHANNEL_REQUEST (self)); g_return_if_fail (!self->priv->requested); v = g_slice_new0 (GValue); dbus_g_value_parse_g_variant (value, v)...
false
false
false
false
false
0
fimc_cap_reqbufs(struct file *file, void *priv, struct v4l2_requestbuffers *reqbufs) { struct fimc_dev *fimc = video_drvdata(file); int ret; ret = vb2_ioctl_reqbufs(file, priv, reqbufs); if (!ret) fimc->vid_cap.reqbufs_count = reqbufs->count; return ret; }
false
false
false
false
false
0
gwy_hmarker_box_button_release(GtkWidget *widget, GdkEventButton *event) { GwyMarkerBox *mbox; gdouble pos; gboolean ghost; gint x, y; /* React to left button only */ mbox = GWY_MARKER_BOX(widget); if (event->button != 1 || !mbox->button) return FALSE;...
false
false
false
false
false
0
create_dialog1 (void) { GtkWidget *dialog1; GtkWidget *dialog_vbox3; GtkWidget *messageLabel; GtkWidget *dialog_action_area3; GtkWidget *cancelbutton1; GtkWidget *okbutton1; dialog1 = gtk_dialog_new (); gtk_widget_set_name (dialog1, "dialog1"); gtk_widget_set_size_request (dialog1, 210, 140); gtk_w...
false
false
false
false
false
0
sync_user (USER * user, CONNECTION * con) { ASSERT (validate_connection (con)); ASSERT (validate_user (user)); /* we should never tell a peer server about a user that is behind them */ ASSERT (user->con != con); if (user->con == con) { /* this really shouldnt happen! */ ASSERT (0); re...
false
false
false
false
false
0
getPartProperties(ModelPart * modelPart, ItemBase * itemBase, bool wantDebug, QStringList & keys) { QHash<QString, QString> properties; QString family; QString partNumber; if (modelPart != NULL && itemBase != NULL) { properties = itemBase->prepareProps(modelPart, wantDebug, keys); } return properties; }
false
false
false
false
false
0
get_firefox_profile_root( std::string& profile_root ) { bool retval = false; FILE* pf = NULL; MIOFILE pmf; MOZILLA_PROFILES mps; MOZILLA_PROFILE* mp = NULL; std::string cookies_root; std::string tmp; unsigned int i = 0; unsigned int default_index = 0; get_home_dir_path( profile_...
false
false
false
false
false
0
AbsolutePath(char *dirname) { char *path; if ( !dirname ) return NULL; if ( dirname[0] == '/' ) // it's already absolute path return dirname; path = (char *)malloc(MAXPATHLEN); if ( !path ) { LogError("malloc() error in %s line %d: %s\n", __FILE__, __LINE__, strerror(errno) ); return NULL; } memset((vo...
false
false
false
false
false
0
panel_action_protocol_filter (GdkXEvent *gdk_xevent, GdkEvent *event, gpointer data) { GdkWindow *window; GdkScreen *screen; GdkDisplay *display; XEvent *xevent = (XEvent *) gdk_xevent; if (xevent->type != ClientMessage) return GDK_FILTER_CONTINUE; if (xevent->xclient.message_type != a...
false
false
false
false
false
0
csvdata_new (DATASET *dset) { csvdata *c = malloc(sizeof *c); if (c == NULL) { return NULL; } c->flags = 0; c->delim = '\t'; c->markerpd = -1; c->maxlen = 0; c->real_n = 0; c->line = NULL; c->dset = NULL; c->ncols = 0; c->nrows = 0; *c->str = '\0'; *c->skipstr ...
false
false
false
false
false
0
CaptureXMP ( const XMP_Uns8 * xmpPtr, const XMP_Uns32 xmpLen, XMP_Int64 fileOffset ) { if ( xmpLen > sXMPMax ) { if (sXMPPtr != 0) free (sXMPPtr); sXMPPtr = (XMP_Uns8*) malloc (xmpLen); sXMPMax = xmpLen; } memcpy ( sXMPPtr, xmpPtr, xmpLen ); sXMPLen = xmpLen; sXMPPos = fileOffset; }
false
false
false
false
false
0
acdHelpTextResource(const AcdPAcd thys, AjPStr* Pstr) { ajint maxreads = 0; ajStrAssignClear(Pstr); acdAttrToInt(thys, "maxreads", 1, &maxreads); if(maxreads <= 1) ajStrAssignC(Pstr, "data resource"); else ajStrAssignC(Pstr, "data resource(s)"); ajStrFmtTitle(Pstr); ajSt...
false
false
false
false
false
0
getLocations( PD_RDFModelHandle alternateModel ) { PD_RDFLocations ret; addLocations( ret, false, " prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \n" " prefix foaf: <http://xmlns.com/foaf/0.1/> \n" " prefix dc: <http://purl.org/dc/elements/1...
false
false
false
false
false
0
errorlog_cmp(logerror *a, logerror *b, short sorttype) { //Deleted entries always go to the bottom if (a->count == 0) return -1; if (b->count == 0) return 1; switch(sorttype) { case SORT_DATE: break; //Handled below case SORT_DATE_REVERSE: if (a->latest_occurrence->date > b->latest_occurrenc...
false
false
false
false
false
0
tile_set_owner(struct tile *ptile, struct player *pplayer, struct tile *claimer) { if (BORDERS_DISABLED != game.info.borders) { ptile->owner = pplayer; ptile->claimer = claimer; } }
false
false
false
false
false
0
SDcheckempty(int32 sdsid, /* IN: dataset ID */ intn *emptySDS /* TRUE if SDS is empty */) { CONSTR(FUNC, "SDcheckempty"); /* for HGOTO_ERROR */ NC *handle = NULL; /* file record struct */ NC_var *var = NULL; /* variable record struct */ int32 ret_value = SUCCEED; #ifdef SDDEBUG fpr...
false
false
false
false
false
0
cmp_filename(struct file_info *file_info, char * name) { if (!file_info) return 1; return strcmp(file_info->name,name) ? 1 : 0; }
false
false
false
false
false
0
sng_gethostid() { struct hostent *host ; struct in_addr hostid ; char name[100] ; gethostname(name, sizeof(name)) ; if ((host = gethostbyname(name)) != NULL) return *(u_long *)(host->h_addr_list[0]) ; printf("gethostid failure (gethostbyname,gethostname)\n"); exit(0); }
false
false
false
false
false
0
MFLAGS_append(const char *flag, char *arg) { char *str; Var_Append(".MAKEFLAGS", flag, VAR_GLOBAL); if (arg != NULL) { str = MAKEFLAGS_quote(arg); Var_Append(".MAKEFLAGS", str, VAR_GLOBAL); free(str); } Var_Append("MFLAGS", flag, VAR_GLOBAL); if (arg != NULL) { str = MAKEFLAGS_quote(arg); Var_Append("...
false
false
false
false
false
0
iwl_dbgfs_ucode_bt_stats_read(struct file *file, char __user *user_buf, size_t count, loff_t *ppos) { struct iwl_priv *priv = (struct iwl_priv *)file->private_data; int pos = 0; char *buf; int bufsz = (sizeof(struct statistics_bt_activity) * 24) + 200; ssize_t ret; struct statistics_bt_activity *bt, *ac...
false
false
false
false
false
0
rl_echo_signal_char (sig) int sig; { char cstr[3]; int cslen, c; if (_rl_echoctl == 0 || _rl_echo_control_chars == 0) return; switch (sig) { case SIGINT: c = _rl_intr_char; break; #if defined (SIGQUIT) case SIGQUIT: c = _rl_quit_char; break; #endif #if defined (SIGTSTP) case SIGTSTP:...
false
false
false
false
false
0
brcmstb_gpio_irq_setup(struct platform_device *pdev, struct brcmstb_gpio_bank *bank) { struct brcmstb_gpio_priv *priv = bank->parent_priv; struct device *dev = &pdev->dev; struct device_node *np = dev->of_node; bank->irq_chip.name = dev_name(dev); bank->irq_chip.irq_mask = brcmstb_gpio_irq_mask; bank->irq_chip...
false
false
false
false
false
0
Hcr_State_BODY_SIGN__SIGN(HANDLE_FDK_BITSTREAM bs, void *ptr) { H_HCR_INFO pHcr = (H_HCR_INFO)ptr; SCHAR *pRemainingBitsInSegment; USHORT *pLeftStartOfSegment; USHORT *pRightStartOfSegment; UCHAR readDirection; UINT *pSegmentBitfield; UINT *pCodewordBitfield; UINT ...
false
false
false
false
false
0
ci_udc_stop(struct usb_gadget *gadget) { struct ci_hdrc *ci = container_of(gadget, struct ci_hdrc, gadget); unsigned long flags; spin_lock_irqsave(&ci->lock, flags); if (ci->vbus_active) { hw_device_state(ci, 0); if (ci->platdata->notify_event) ci->platdata->notify_event(ci, CI_HDRC_CONTROLLER_STOPPED_E...
false
false
false
false
false
0
SetUrl(Ns_Request *request, char *url, Tcl_Encoding encoding) { Ns_Conn *conn; Ns_DString ds1, ds2; char *p; Ns_DStringInit(&ds1); Ns_DStringInit(&ds2); /* * Look for a query string at the end of the URL. */ p = strchr(url, '?'); if (p != NULL) { *p++ = '\...
false
true
false
false
false
1
bin2chars(CMPIUint64 msecs, CMPIBoolean interval, CMPIStatus * rc, char *str_time) { time_t secs = msecs / 1000000ULL; unsigned long usecs = msecs % 1000000ULL; if (interval) { unsigned long long useconds, seconds, mins, hrs, days; seconds= msecs / 1000000ULL; useconds = msecs % 1000000ULL;...
false
false
false
false
false
0
indigui_create_switch_combobox(struct indi_prop_t *iprop, int num_props) { GtkTreeIter iter; GtkTreeStore *model = gtk_tree_store_new(1, G_TYPE_STRING); GtkWidget *box; indi_list *isl; unsigned long signal; long pos = 0; for (isl = il_iter(iprop->elems); ! il_is_last(isl); isl = il_next(isl), pos++) { struct ...
false
false
false
false
false
0
pro_string(const struct ltab *lt, char ** strp, helpfn_t helpfn) { char *str, *orig = *strp? *strp: ""; struct sctrl wst_str; wst_str.helpcode = lt->helpcode * 10; wst_str.helpfn = wotjprin; wst_str.size = lt->size; wst_str.col = lt->col; wst_str.magic_p = MAG_OK|MAG_R|MAG_CRS|MAG_NL; wst_str.msg = (char *) 0;...
false
false
false
false
false
0
e_google_chooser_dialog_new (EGoogleChooser *chooser, GtkWindow *parent) { g_return_val_if_fail (E_IS_GOOGLE_CHOOSER (chooser), NULL); g_return_val_if_fail (parent == NULL || GTK_IS_WINDOW (parent), NULL); return g_object_new ( E_TYPE_GOOGLE_CHOOSER_DIALOG, "chooser", chooser, "tran...
false
false
false
false
false
0
slotEjectDone(int error, const QString &errorString) { m_ejectInProgress = false; emit ejectDone(static_cast<Solid::ErrorType>(error), errorString, m_device->udi()); }
false
false
false
false
false
0
L13() {register object *base=vs_base; register object *sup=base+VM13; VC13 vs_check; {object V76; object V77; V76=(base[0]); V77=(base[1]); vs_top=sup; goto TTL; TTL:; base[2]= ((object)VV[14]); vs_top=(vs_base=base+2)+1; Lfloat_digits(); vs_top=sup; V78= vs_base[0]; {object V80; V80= ((V77))->v.v_self[(...
false
false
false
false
false
0
test_pkcs7_unpad_normal() { string s = "TEST STRING\x04\x04\x04\x04"; string result; try { result = pkcs7_unpad(s); } catch(...) { cerr << "error: pkcs7_unpad threw exception when it shouldn't." << endl; cerr << "<<<PKCS7 Unpadding Normal Functionality: FAIL>>>" << en...
false
false
false
false
false
0
xdr_guestfs_int_lvm_lv (XDR *xdrs, guestfs_int_lvm_lv *objp) { register int32_t *buf; int i; if (!xdr_string (xdrs, &objp->lv_name, ~0)) return FALSE; if (!xdr_opaque (xdrs, objp->lv_uuid, 32)) return FALSE; if (!xdr_string (xdrs, &objp->lv_attr, ~0)) return FALSE; if (!xdr_int64_t (xdrs, &objp->lv_...
false
false
false
false
false
0
get_filesize_for_file_descriptor(FILE *fp) { off_t result = 0; struct stat stat_info; int file_no = fileno(fp); if((fstat(file_no, &stat_info) == 0)) /* returns 0 on success */ result = (int)stat_info.st_size; return (guint32)result; }
false
false
false
false
false
0
GetServerTypeFromName(const wxString& name) { for (int i = 0; i < SERVERTYPE_MAX; ++i) { enum ServerType type = (enum ServerType)i; if (name == CServer::GetNameFromServerType(type)) return type; } return DEFAULT; }
false
false
false
false
false
0
parse_value_boolean(const gchar *in, const ObtDDParse *const parse, gboolean *error) { if (strcmp(in, "true") == 0) return TRUE; else if (strcmp(in, "false") != 0) parse_error("Invalid boolean value", parse, error); retu...
false
false
false
false
false
0
brcms_c_suspend_mac_and_wait(struct brcms_c_info *wlc) { struct brcms_hardware *wlc_hw = wlc->hw; struct bcma_device *core = wlc_hw->d11core; u32 mc, mi; brcms_dbg_mac80211(core, "wl%d: bandunit %d\n", wlc_hw->unit, wlc_hw->band->bandunit); /* * Track overlapping suspend requests */ wlc_hw->mac_suspen...
false
false
false
false
false
0
totem_action_handle_seek (TotemObject *totem, GdkEventKey *event, gboolean is_forward) { if (is_forward != FALSE) { if (event->state & GDK_SHIFT_MASK) totem_action_seek_relative (totem, SEEK_FORWARD_SHORT_OFFSET * 1000, FALSE); else if (event->state & GDK_CONTROL_MASK) totem_action_seek_relative (totem, SEEK...
false
false
false
false
false
0