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 |
|---|---|---|---|---|---|---|
create_pixbuf (const gchar *filename)
{
gchar *pathname = NULL;
GdkPixbuf *pixbuf;
GError *error = NULL;
if (!filename || !filename[0])
return NULL;
pathname = find_pixmap_file (filename);
if (!pathname)
{
g_warning (_("Couldn't find pixmap file: %s"), filenam... | false | false | false | false | false | 0 |
qlcnic_get_bar_length(u32 dev_id, ulong *bar)
{
switch (dev_id) {
case PCI_DEVICE_ID_QLOGIC_QLE824X:
*bar = QLCNIC_82XX_BAR0_LENGTH;
break;
case PCI_DEVICE_ID_QLOGIC_QLE834X:
case PCI_DEVICE_ID_QLOGIC_QLE8830:
case PCI_DEVICE_ID_QLOGIC_QLE844X:
case PCI_DEVICE_ID_QLOGIC_VF_QLE834X:
case PCI_DEVICE_ID_QLOGIC_... | false | false | false | false | false | 0 |
cxd2820r_sleep_t(struct dvb_frontend *fe)
{
struct cxd2820r_priv *priv = fe->demodulator_priv;
int ret, i;
struct reg_val_mask tab[] = {
{ 0x000ff, 0x1f, 0xff },
{ 0x00085, 0x00, 0xff },
{ 0x00088, 0x01, 0xff },
{ 0x00081, 0x00, 0xff },
{ 0x00080, 0x00, 0xff },
};
dev_dbg(&priv->i2c->dev, "%s\n", __func... | false | false | false | false | false | 0 |
gimp_unit_get_number_of_built_in_units (void)
{
g_return_val_if_fail (_gimp_unit_vtable.unit_get_number_of_built_in_units
!= NULL, GIMP_UNIT_END);
return _gimp_unit_vtable.unit_get_number_of_built_in_units ();
} | false | false | false | false | false | 0 |
PyTokenizer_FromString(const char *str, int exec_input)
{
struct tok_state *tok = tok_new();
if (tok == NULL)
return NULL;
str = decode_str(str, exec_input, tok);
if (str == NULL) {
PyTokenizer_Free(tok);
return NULL;
}
/* XXX: constify members. */
tok->buf = tok->cu... | false | false | false | false | false | 0 |
patch_generic_hdmi(struct hda_codec *codec)
{
struct hdmi_spec *spec;
spec = kzalloc(sizeof(*spec), GFP_KERNEL);
if (spec == NULL)
return -ENOMEM;
spec->ops = generic_standard_hdmi_ops;
codec->spec = spec;
hdmi_array_init(spec, 4);
if (is_haswell_plus(codec)) {
intel_haswell_enable_all_pins(codec, true);
... | false | false | false | false | false | 0 |
mousePressEvent( QMouseEvent* event )
{
//get the item that was clicked
QModelIndex index = indexAt( event->pos() );
//first of all, if a left click, check if the delegate wants to do something about this click
if( event->button() == Qt::LeftButton )
{
//we need to translate the position of... | false | false | false | false | false | 0 |
gen_sub3_insn (rtx r0, rtx r1, rtx c)
{
int icode = (int) sub_optab->handlers[(int) GET_MODE (r0)].insn_code;
if (icode == CODE_FOR_nothing
|| ! ((*insn_data[icode].operand[0].predicate)
(r0, insn_data[icode].operand[0].mode))
|| ! ((*insn_data[icode].operand[1].predicate)
(r1, insn_data[icod... | false | false | false | false | false | 0 |
_pysqlite_build_py_params(sqlite3_context *context, int argc, sqlite3_value** argv)
{
PyObject* args;
int i;
sqlite3_value* cur_value;
PyObject* cur_py_value;
const char* val_str;
Py_ssize_t buflen;
args = PyTuple_New(argc);
if (!args) {
return NULL;
}
for (i = 0; i < a... | false | false | false | false | false | 0 |
astnode_get_child_count(const astnode *p)
{
astnode *c;
int count = 0;
if (p != NULL) {
for (c = p->first_child; c != NULL; count++, c = c->next_sibling);
}
return count;
} | false | false | false | false | false | 0 |
unlocked_eval (double x)
{
// I don't see the point of this...
if (_dirty) {
solve ();
}
return _list.unlocked_eval (x);
} | false | false | false | false | false | 0 |
scsi_scan_host_selected(struct Scsi_Host *shost, unsigned int channel,
unsigned int id, u64 lun, int rescan)
{
SCSI_LOG_SCAN_BUS(3, shost_printk (KERN_INFO, shost,
"%s: <%u:%u:%llu>\n",
__func__, channel, id, lun));
if (((channel != SCAN_WILD_CARD) && (channel > shost->max_channel)) ||
((id != SCAN_W... | false | false | false | false | false | 0 |
skipToEnd() {
int startLevel = blockLevel++ ;
std::istream &in = currentContext->getStream() ;
readLine() ;
while (!in.eof()) {
char *s = line ;
while (*s != 0) {
if (*s == '{') {
blockLevel++ ;
} else if (*s == '}') {
if (--blockLe... | false | false | false | false | false | 0 |
SaveBinEntry(BamBinMap& binMap,
const uint32_t& saveBin,
const uint64_t& saveOffset,
const uint64_t& lastOffset)
{
// look up saveBin
BamBinMap::iterator binIter = binMap.find(saveBin);
// create new chunk
Chunk newChunk(saveOffset, lastOffset);
// if entry doesn't exist
... | false | false | false | false | false | 0 |
nfs4_get_rootfh(struct nfs_server *server, struct nfs_fh *mntfh, bool auth_probe)
{
struct nfs_fsinfo fsinfo;
int ret = -ENOMEM;
dprintk("--> nfs4_get_rootfh()\n");
fsinfo.fattr = nfs_alloc_fattr();
if (fsinfo.fattr == NULL)
goto out;
/* Start by getting the root filehandle from the server */
ret = nfs4_pro... | false | false | false | false | false | 0 |
mergeonerun(Tuplesortstate *state)
{
int destTape = state->tp_tapenum[state->tapeRange];
int srcTape;
int tupIndex;
SortTuple *tup;
long priorAvail,
spaceFreed;
/*
* Start the merge by loading one tuple from each active source tape into
* the heap. We can also decrease the input run/dummy run co... | false | false | false | false | false | 0 |
dh_util_create_data_uri_for_filename (const gchar *filename,
const gchar *mime_type)
{
gchar *data;
gsize data_length;
gchar *base64;
gchar *uri;
if (!g_file_get_contents (filename, &data, &data_length, NULL))
return NULL;
... | false | false | false | false | false | 0 |
_dxf_cat_lower( char *s )
{
char * p;
if ( !s )
return 0;
for ( p = s; *p; p++ )
*p = tolower( *p );
return 1;
} | false | false | false | false | false | 0 |
fh_deleteheap(struct fibheap *h)
{
/*
* We could do this even faster by walking each binomial tree, but
* this is simpler to code.
*/
while (h->fh_min != NULL)
fhe_destroy(fh_extractminel(h));
fh_destroyheap(h);
free(h);
} | false | false | false | false | false | 0 |
ssb_fill_sprom_with_fallback(struct ssb_bus *bus, struct ssb_sprom *out)
{
if (!get_fallback_sprom)
return -ENOENT;
return get_fallback_sprom(bus, out);
} | false | false | false | false | false | 0 |
addMessage(callback &callback)
const
{
if (isDestroyed(callback))
return NULL;
add *a=new add(account, callback);
if (!a)
callback.fail(strerror(errno));
return a;
} | false | false | false | false | false | 0 |
jsonListClear(JsonListNode *root)
{
JsonListNode *next;
JsonListNode *deleteCurr = root;
while(deleteCurr)
{
next = deleteCurr->next;
jsonFree(deleteCurr->value,true);
free(deleteCurr);
deleteCurr = next;
}
} | false | false | false | false | false | 0 |
CifSkipSeparator()
{
char Found;
Found = 0;
while ( ! Found )
{
switch ( CifNextChar )
{
case '(' :
case ')' :
case ';' :
case '-' :
case EOF :
Found = 1;
break;
default :
if ( isdigit( (int)CifNextChar ) )... | false | false | false | false | false | 0 |
PKIX_PL_Date_CreateFromPRTime(
PRTime prtime,
PKIX_PL_Date **pDate,
void *plContext)
{
PKIX_ENTER(DATE, "PKIX_PL_Date_CreateFromPRTime");
PKIX_CHECK(
pkix_pl_Date_CreateFromPRTime(prtime, pDate, plContext),
PKIX_DATECREATEFROMPRTIMEFAILED);
cleanup:
PKIX_RETURN(DATE)... | false | false | false | false | false | 0 |
KillCharPrev() {
if (CP.Col == 0) {
if (CP.Row > 0)
if (ExposeRow(VToR(CP.Row) - 1) == 0) return 0;
if (!MoveUp()) return 0;
if (!MoveLineEnd()) return 0;
if (LineJoin()) return 1;
} else {
if (!MovePrev()) return 0;
if (DelText(CP.Row, CP.Col, 1)) ret... | false | false | false | false | false | 0 |
calcBufferSize(unsigned int width, unsigned int height) const {
if ((fFlags & DDSD_HEIGHT) == 0 || (fFlags & DDSD_WIDTH) == 0)
return 0;
if ((fFlags & DDSD_PIXELFORMAT) == 0)
throw hsBadParamException(__FILE__, __LINE__, "Surface has no pixel format descriptor");
size_t stride, blocks;
... | false | false | false | false | false | 0 |
soap_wsrm_pulse(struct soap *soap, int timeout)
{ soap_wsrm_sequence_handle seq;
int ct = soap->connect_timeout;
int st = soap->send_timeout;
int rt = soap->recv_timeout;
int a = 1;
DBGFUN("soap_wsrm_pulse");
soap->connect_timeout = soap->send_timeout = soap->recv_timeout = timeout;
MUTEX_LOCK(soap_wsrm_s... | false | false | false | false | false | 0 |
ps(args)
char **args;
{
FILE *stdout_log=NULL, *stderr_log=NULL;
int stdout_log_fd, stderr_log_fd;
remove_log();
/* See the comment in system.c on closing tty descriptors. */
int old_stdout = dup(1);
int old_stderr = dup(2);
close(1);
close(2);
strcpy(stdout_log_name,stdout_l... | false | false | false | false | false | 0 |
pvresize_size_stub (XDR *xdr_in)
{
int r;
struct guestfs_pvresize_size_args args;
CLEANUP_FREE char *device = NULL;
int64_t size;
/* The caller should have checked before calling this. */
if (! optgroup_lvm2_available ()) {
reply_with_error_errno (ENOTSUP,
"feature '%s' is not available in this\... | false | false | false | false | false | 0 |
gkm_module_remove_token_object (GkmModule *self, GkmTransaction *transaction, GkmObject *object)
{
g_return_if_fail (GKM_IS_MODULE (self));
g_return_if_fail (GKM_IS_OBJECT (object));
g_assert (GKM_MODULE_GET_CLASS (self)->remove_token_object);
if (gkm_object_is_transient (object))
remove_transient_object (self, ... | false | false | false | true | false | 1 |
read_bandwidth_usage(void)
{
or_state_t *state = get_or_state();
{
char *fname = get_datadir_fname("bw_accounting");
unlink(fname);
tor_free(fname);
}
if (!state)
return -1;
log_info(LD_ACCT, "Reading bandwidth accounting data from state file");
n_bytes_read_in_interval = state->Accountin... | true | true | false | false | false | 1 |
BuildSignature(CommandSignature &signature)
{
Validator *prefNameValidator(new Validator());
signature.AddParameter(wxT("PrefName"), wxT(""), prefNameValidator);
Validator *prefValueValidator(new Validator());
signature.AddParameter(wxT("PrefValue"), wxT(""), prefValueValidator);
} | false | false | false | false | false | 0 |
carter_setup (void)
{
/* This routine must be called once before using carter table stuff.
It reads the carter.d file and loads the appropriate arrays.
It sets carter_not_initialized = FALSE upon successful completion
and returns 0. If failure occurs, it returns -1. */
FILE *fp = NULL;
char buffer [BUFSIZ], *n... | true | true | false | false | true | 1 |
dm_table_set_type(struct dm_table *t)
{
unsigned i;
unsigned bio_based = 0, request_based = 0, hybrid = 0;
bool use_blk_mq = false;
struct dm_target *tgt;
struct dm_dev_internal *dd;
struct list_head *devices;
unsigned live_md_type = dm_get_md_type(t->md);
for (i = 0; i < t->num_targets; i++) {
tgt = t->targ... | false | false | false | false | false | 0 |
BuildFieldKey(TABFeature *poFeature, int nFieldNo,
TABFieldType eType, int nIndexNo)
{
GByte *pKey = NULL;
switch(eType)
{
case TABFChar:
pKey = m_poRelINDFileRef->BuildKey(nIndexNo,
poFeature->GetFieldAsString(nFieldNo));
... | false | false | false | false | false | 0 |
parse_positive_number_arg(char *s, char *name)
{
char *end_ptr;
unsigned long result;
errno = 0;
result = strtoul(s, &end_ptr, 10);
if (errno) {
die(name, strerror(errno));
}
if (*s == '\0') {
die(name, "argument value cannot be empty");
}
if (*end_ptr != '\0') {
... | false | false | false | false | false | 0 |
glp_mem_limit(int limit)
{ ENV *env = get_env_ptr();
if (limit < 1)
xerror("glp_mem_limit: limit = %d; invalid parameter\n",
limit);
if ((size_t)limit <= (SIZE_T_MAX >> 20))
env->mem_limit = (size_t)limit << 20;
else
env->mem_limit = SIZE_T_MAX;
return;... | false | false | false | false | false | 0 |
get_innermost_hmdf_table_of_outside(Block *bpt)
{
Block *b;
if (bpt == NULL) {
return NULL;
}
for (b = bpt->outer; b != NULL && b->hmdf == NULL ; b=b->outer);
if (b == NULL) {
return bpt->module->super_hmdf;
}
return b->hmdf;
} | false | false | false | false | false | 0 |
au_dpri_vdir(struct au_vdir *vdir)
{
unsigned long ul;
union au_vdir_deblk_p p;
unsigned char *o;
if (!vdir || IS_ERR(vdir)) {
dpri("err %ld\n", PTR_ERR(vdir));
return;
}
dpri("deblk %u, nblk %lu, deblk %p, last{%lu, %p}, ver %lu\n",
vdir->vd_deblk_sz, vdir->vd_nblk, vdir->vd_deblk,
vdir->vd_las... | false | false | false | false | false | 0 |
c_parser_else_body (c_parser *parser)
{
location_t else_loc = c_parser_peek_token (parser)->location;
tree block = c_begin_compound_stmt (flag_isoc99);
while (c_parser_next_token_is_keyword (parser, RID_CASE)
|| c_parser_next_token_is_keyword (parser, RID_DEFAULT)
|| (c_parser_next_token_is (parser, CPP_NAME)... | false | false | false | false | false | 0 |
ssd_free_dev(struct kref *kref)
{
struct ssd_device *dev;
if (!kref) {
return;
}
dev = container_of(kref, struct ssd_device, kref);
put_disk(dev->gd);
ssd_put_index(dev->slave, dev->idx);
kfree(dev);
} | false | false | false | false | false | 0 |
push(
unsigned short aModule,
unsigned short aCode,
OFStatus aStatus,
const char *aText,
OFCondition subCondition)
{
OFOStringStream os;
/* declare variable outside the block structure of the OFSTRINGSTREAM_xxx macros */
OFConditionString *condString;
char buf[16];
sprintf(buf,"%04x:%04x "... | false | false | false | false | false | 0 |
event_PageSizeChanged (fp_PageSize::Predefined pd)
{
fp_PageSize ps(pd);
if( TRUE != gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (m_radioPagePortrait)))
{
ps.setLandscape();
}
m_PageSize = ps;
// change the units in the dialog, too.
UT_Dimension new_units = ps.getDims();
setPageUnits(new_units);
XAP_com... | false | false | false | false | false | 0 |
sys_readdir(struct tcb *tcp)
{
if (entering(tcp)) {
tprintf("%lu, ", tcp->u_arg[0]);
} else {
if (syserror(tcp) || tcp->u_rval == 0 || !verbose(tcp))
tprintf("%#lx", tcp->u_arg[1]);
else
printdir(tcp, tcp->u_arg[1]);
/* Not much point in printing this out, it is always 1. */
if (tcp->u_arg[2] != 1)
... | false | false | false | false | false | 0 |
UpdateFlags(void)
{
cassette_readable = cassette_motor &&
(CASSETTE_status == CASSETTE_STATUS_READ_WRITE ||
CASSETTE_status == CASSETTE_STATUS_READ_ONLY) &&
!eof_of_tape;
cassette_writable = cassette_motor &&
CASSETTE_status == CASS... | false | false | false | false | false | 0 |
getFont(int i) {
if (i < 0 || i >= (int)m_Fonts.size()) return m_Fonts.get(0);
return m_Fonts.get(i);
} | false | false | false | false | false | 0 |
CheckBreakpoint( int from, int to, int bArrBrkpt[] )
{
int i;
for ( i = from + 1; i < to; i++ )
if ( bArrBrkpt[ i ] )
return 0;
return 1;
} | false | false | false | false | false | 0 |
buffer_list_create_write (GstBuffer ** buf, guint idx, gpointer q)
{
GstQueue2 *queue = q;
GST_TRACE_OBJECT (queue,
"writing buffer %u of size %" G_GSIZE_FORMAT " bytes", idx,
gst_buffer_get_size (*buf));
if (!gst_queue2_create_write (queue, *buf)) {
GST_INFO_OBJECT (queue, "create_write() retur... | false | false | false | false | false | 0 |
print_ctrl_task_inner(Ctrl_task *ctrl_task, int nest,
proc_kind proc, int acc_tp,
int pe_no)
{
List *inner = ctrl_task_get_inner(ctrl_task);
int i, l = list_length(inner);
#ifndef WRITE_ALL_INNER
for (i = 0; i < l; i++) {
Ctrl_task *c = (Ctrl_task *)l... | false | false | false | false | false | 0 |
avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size,
const short *samples)
{
if(buf_size < FF_MIN_BUFFER_SIZE && 0){
av_log(avctx, AV_LOG_ERROR, "buffer smaller than minimum size\n");
return -1;
}
if((avctx->codec->capabilities & CODEC_CAP_DELAY) |... | false | false | false | false | false | 0 |
USGSDEM_LookupNTSByTile( const char *pszTile, char *pszName,
double *pdfULLong, double *pdfULLat )
{
/* -------------------------------------------------------------------- */
/* Access NTS 1:50k sheet CSV file. */
/* ----------------------------------------... | false | false | false | false | false | 0 |
PyString_Size(register PyObject *op)
{
if (!PyString_Check(op))
return string_getsize(op);
return Py_SIZE(op);
} | false | false | false | false | false | 0 |
_read_audio_sectors_nrg (void *p_user_data, void *data, lsn_t lsn,
unsigned int nblocks)
{
_img_private_t *p_env = p_user_data;
CdioListNode_t *node;
if (lsn >= p_env->size)
{
cdio_warn ("trying to read beyond image size (%lu >= %lu)",
(long unsigned int) lsn, (long unsigned int) p_env->size)... | false | false | false | false | false | 0 |
lperror(int level, const char * format, ...)
{
static char logmsg[LOG_MSG_LENGTH];
va_list vptr;
if (!logpriv)
log_reinit();
if (logpriv->level < level)
return;
va_start(vptr, format);
vsnprintf(logmsg, LOG_MSG_LENGTH, format, vptr);
va_end(vptr);
if (logpriv->daemon)
syslog(level, "%s: %s", logmsg, s... | false | false | false | false | false | 0 |
gt_chain2dim_retrace_previousinchain(GtChain2Dim *chain,
const GtChain2Dimmatchtable *matchtable,
unsigned long retracestart)
{
unsigned long matchnum, lengthofchain;
chain->storedinreverseorder = false;
for (lengthofchain = 0, matchnum = retr... | false | false | false | false | false | 0 |
hns_ppe_set_qid(struct ppe_common_cb *ppe_common, u32 qid)
{
u32 qid_mod = dsaf_read_dev(ppe_common, PPE_COM_CFG_QID_MODE_REG);
if (!dsaf_get_field(qid_mod, PPE_CFG_QID_MODE_DEF_QID_M,
PPE_CFG_QID_MODE_DEF_QID_S)) {
dsaf_set_field(qid_mod, PPE_CFG_QID_MODE_DEF_QID_M,
PPE_CFG_QID_MODE_DEF_QID_S, qi... | false | false | false | false | false | 0 |
field_value (PR *pr, FieldIndex field)
{
char *result = NULL;
if (field == InvalidFieldIndex)
{
abort ();
}
if (pr->private != NULL && pr->private->value != NULL)
{
result = pr->private->value[field->number].data.string;
}
if (result == NULL)
{
/* Houston, we have a pr... | false | false | false | false | false | 0 |
copylastchunk(struct connection *p)
{
if (p->pipe_params.chunkit) {
if (p->output.ceiling - p->output.end >= 5) {
memcpy(p->output.end, "0\r\n\r\n", 5);
p->output.end += 5;
p->script_input.state = 3;
}
} else
p->script_input.state = 3;
} | false | false | false | false | false | 0 |
reset_chan_info(struct chanset_t *chan)
{
/* Don't reset the channel if we're already resetting it */
if (channel_inactive(chan)) {
dprintf(DP_MODE, "PART %s\n", chan->name);
return;
}
if (!channel_pending(chan)) {
nfree(chan->channel.key);
chan->channel.key = (char *) channel_malloc(1);
cha... | false | false | false | false | false | 0 |
ath6kl_wmi_tx_pwr_reply_rx(struct wmi *wmi, u8 *datap, int len)
{
struct wmi_tx_pwr_reply *reply;
if (len < sizeof(struct wmi_tx_pwr_reply))
return -EINVAL;
reply = (struct wmi_tx_pwr_reply *) datap;
ath6kl_txpwr_rx_evt(wmi->parent_dev, reply->dbM);
return 0;
} | false | false | false | false | false | 0 |
print_file_energy_units(FILE * fp, enum siesta_energy_measurement_type units)
{
gint allok = 0;
switch (units)
{
case J_ENRG: fprintf(fp, " J\n"); break;
case ERG_ENRG: fprintf(fp, " erg\n"); break;
case EV_ENRG: fprintf(fp, " eV\n"); break;
case... | false | false | false | false | false | 0 |
show_preference()
{
SKELETON::View* view = dynamic_cast< View* >( m_notebook->get_nth_page( m_clicked_page ) );
if( view ) view->show_preference();
} | false | false | false | false | false | 0 |
expand_builtin_atomic_compare_exchange (enum machine_mode mode, tree exp,
rtx target)
{
rtx expect, desired, mem, oldval;
enum memmodel success, failure;
tree weak;
bool is_weak;
success = get_memmodel (CALL_EXPR_ARG (exp, 4));
failure = get_memmodel (CALL_EXPR_ARG (exp, 5));
if (failure == MEMMOD... | false | false | false | false | true | 1 |
find_roll_to_hit(struct monst *mtmp)
{
schar tmp;
int tmp2;
tmp = 1 + Luck + abon() + find_mac(mtmp) + u.uhitinc +
maybe_polyd(youmonst.data->mlevel, u.ulevel);
check_caitiff(mtmp);
/* attacking peaceful creatures is bad for the samurai's giri */
if (Role_if(PM_SAMURAI) && mtmp->mpeac... | false | false | false | false | false | 0 |
V8_Fatal(const char* file, int line, const char* format, ...) {
fflush(stdout);
fflush(stderr);
fatal_error_handler_nesting_depth++;
// First time we try to print an error message
if (fatal_error_handler_nesting_depth < 2) {
i::OS::PrintError("\n\n#\n# Fatal error in %s, line %d\n# ", file, line);
va_... | false | false | false | false | false | 0 |
position_menu(GtkMenu *menu, gint *x, gint *y, gboolean *push_in, MenuPosition *pos)
{
*x = pos->x;
*y = pos->y;
*push_in = false;
delete pos;
} | false | false | false | false | false | 0 |
add_to_chain(struct tdb_context *tdb,
tdb_off_t subhash,
tdb_off_t new_off)
{
tdb_off_t entry;
enum TDB_ERROR ecode;
entry = tdb_find_zero_off(tdb, subhash, 1<<TDB_HASH_GROUP_BITS);
if (TDB_OFF_IS_ERR(entry)) {
return TDB_OFF_TO_ERR(entry);
}
if (entry == 1 << TDB_HASH_GROUP_BITS) {
tdb_off_t next... | false | false | false | false | false | 0 |
sys_get_home_dir(void)
{
#if defined(WIN32) || defined(__WIN32__)
HKEY hKey;
char path[HT_NAME_MAX];
/*
LONG len = HT_NAME_MAX;
if(RegOpenKey(HKEY_CURRENT_USER,
"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders",
&hKey) == ERROR_S... | false | false | false | false | false | 0 |
strip_line(char *line)
{
char *p = line + strlen(line);
while (p > line && (p[-1] == '\n' || p[-1] == '\r'))
*--p = 0;
} | false | false | false | false | false | 0 |
freetuxtv_channels_group_infos_new(gchar *name, FREETUXTV_CHANNELSGROUP_TYPEGROUP type)
{
g_return_val_if_fail(name != NULL, NULL);
FreetuxTVChannelsGroupInfos *pChannelsGroupInfos;
pChannelsGroupInfos = g_object_new (FREETUXTV_TYPE_CHANNELS_GROUP_INFOS, NULL);
freetuxtv_channels_group_infos_set_name (pChannelsGr... | false | false | false | false | false | 0 |
thread_initialize(void)
{
thread_type *thread;
/* set up logging */
#ifdef THREAD_DEBUG
log_initialize();
_logid = log_open("thread.log");
log_set_level(_logid, THREAD_DEBUG);
#endif
#ifdef DEBUG_MUTEXES
/* create all the internal mutexes, and initialize the mutex tree */
_mutextree = av... | false | false | false | false | false | 0 |
Get(vtkInformation* info, int idx)
{
if (idx < 0 || idx >= this->Length(info))
{
return 0;
}
vtkInformationStringVectorValue* v =
static_cast<vtkInformationStringVectorValue *>
(this->GetAsObjectBase(info));
return v->Value[idx].c_str();
} | false | false | false | false | false | 0 |
write_pgm_image_int_normalized(image_int image, char * name)
{
FILE * f;
unsigned int x,y,n;
int v,max,min;
double factor;
/* check min and max values */
max = min = 0;
for(y=0; y<image->ysize; y++)
for(x=0; x<image->xsize; x++)
{
v = image->data[ x + y * image->xsize ];
if( v >... | false | false | false | false | true | 1 |
approx_tuple_count(PlannerInfo *root, JoinPath *path, List *quals)
{
double tuples;
double outer_tuples = path->outerjoinpath->rows;
double inner_tuples = path->innerjoinpath->rows;
SpecialJoinInfo sjinfo;
Selectivity selec = 1.0;
ListCell *l;
/*
* Make up a SpecialJoinInfo for JOIN_INNER semantics.
*/... | false | false | false | false | false | 0 |
gtkmenu_gtk_menu_set_title(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
{
ScmObj menu_scm;
GtkMenu* menu;
ScmObj title_scm;
const gchar * title;
ScmObj SCM_SUBRARGS[2];
int SCM_i;
SCM_ENTER_SUBR("gtk-menu-set-title");
for (SCM_i=0; SCM_i<2; SCM_i++) {
SCM_SUBRARGS[SCM_i] = SCM_ARGREF(SCM_i);
}
m... | false | false | false | false | false | 0 |
display_debug_lines (struct dwarf_section *section, void *file ATTRIBUTE_UNUSED)
{
unsigned char *data = section->start;
unsigned char *end = data + section->size;
int retValRaw = 1;
int retValDecoded = 1;
if (do_debug_lines == 0)
do_debug_lines |= FLAG_DEBUG_LINES_RAW;
if (do_debug_lines & FLAG_DEBUG... | false | false | false | false | false | 0 |
action_define (defname, value)
const char *defname;
int value;
{
char buf[MAXLINE];
char *cpy;
if ((int) strlen (defname) > MAXLINE / 2) {
format_pinpoint_message (_
("name \"%s\" ridiculously long"),
defname);
return;
}
snprintf (buf, sizeof(buf), "#define %s %d\n", defname, value... | false | false | false | false | false | 0 |
list_tags(void)
{
char path[1024], *path_p, token[80];
default_t *def_p;
const char *home_p;
long new_debug = 0;
FILE *rc_file;
/* do we need to have a home variable? */
if (inpath == NULL) {
/* first we try to read the RC file from the current directory */
rc_file = fopen(DEFAULT_CONFI... | false | false | false | false | false | 0 |
begin_dices() const {
DataRefImpl DRI;
if (!DataInCodeLoadCmd)
return dice_iterator(DiceRef(DRI, this));
MachO::linkedit_data_command DicLC = getDataInCodeLoadCommand();
DRI.p = reinterpret_cast<uintptr_t>(getPtr(this, DicLC.dataoff));
return dice_iterator(DiceRef(DRI, this));
} | false | false | false | false | false | 0 |
iConvG16R16ToFloat32(ILuint* dest, ILushort* src, ILuint size)
{
ILuint i;
for (i = 0; i < size; i += 3) {
//float: 1 sign bit, 8 exponent bits, 23 mantissa bits
//half: 1 sign bit, 5 exponent bits, 10 mantissa bits
*dest++ = halfToFloat(*src++);
*dest++ = halfToFloat(*src++);
*((ILfloat*)dest++) = 1.0f;
}... | false | false | false | false | false | 0 |
abi_widget_get_page_count(AbiWidget * w)
{
UT_return_val_if_fail ( w != NULL, FALSE );
UT_return_val_if_fail ( IS_ABI_WIDGET(w), FALSE );
UT_return_val_if_fail ( w->priv->m_pFrame, FALSE );
FV_View * pView = reinterpret_cast<FV_View *>(w->priv->m_pFrame->getCurrentView());
UT_return_val_if_fail(pView, 0);
FL_Do... | false | false | false | false | false | 0 |
_cpu_up(unsigned int cpu, int tasks_frozen)
{
int ret, nr_calls = 0;
void *hcpu = (void *)(long)cpu;
unsigned long mod = tasks_frozen ? CPU_TASKS_FROZEN : 0;
struct task_struct *idle;
cpu_hotplug_begin();
if (cpu_online(cpu) || !cpu_present(cpu)) {
ret = -EINVAL;
goto out;
}
idle = idle_thread_get(cpu);
... | false | false | false | false | false | 0 |
testpointeE(const gchar *t)
{
guint i;
for(i=0;i<strlen(t);i++)
if(testapointeE(t[i]) ) return TRUE;
return FALSE;
} | false | false | false | false | false | 0 |
getAuxVar(const TodoItem& i) {
assert(i.bound > 0);
uint32 k = i.bound-1;
if (aux_[k] == 0) {
todo_.push_back(i);
aux_[k] = prg_.newAtom();
todo_.back().var = aux_[k];
}
return aux_[k];
} | false | false | false | false | false | 0 |
__ecereNameSpace__ecere__gfx__bitmaps__ReadData(GifFileType * gifFile, GifByteType * bytes, int size)
{
struct __ecereNameSpace__ecere__com__Instance * f = (*gifFile).UserData;
return ((int (*)(struct __ecereNameSpace__ecere__com__Instance *, void * buffer, unsigned int size, unsigned int count))__extension__ ({
stru... | false | false | false | false | false | 0 |
viafb_get_fb_size_from_pci(int chip_type)
{
int i;
u8 offset = 0;
u32 FBSize;
u32 VideoMemSize;
/* search for the "FUNCTION3" device in this chipset */
for (i = 0; i < ARRAY_SIZE(via_function3); i++) {
struct pci_dev *pdev;
pdev = pci_get_device(PCI_VENDOR_ID_VIA, via_function3[i],
NULL);
if (!p... | false | false | false | false | false | 0 |
session_crypto_decode(request_rec * r,
session_rec * z)
{
char *encoded = NULL;
apr_status_t res;
const apr_crypto_t *f = NULL;
session_crypto_dir_conf *dconf = ap_get_module_config(r->per_dir_config,
&session_crypto_module);
if ((dconf->passphrases_set) && z->encoded && *z->en... | false | false | false | false | false | 0 |
insert_line()
{
u16 n, mx;
n = param[0];
if (n < 1) n = 1;
mx = scroll_bot - cursor_y + 1;
if (n >= mx) clear_area(0, cursor_y, width - 1, scroll_bot);
else scroll_region(cursor_y, scroll_bot, -n);
} | false | false | false | false | false | 0 |
http_metadata (void *d, size_t size, void *data)
{
http_desc_t *desc = (http_desc_t*)d;
size_t msize;
pthread_mutex_lock (&desc->meta_lock);
if (!desc->metadata) {
pthread_mutex_unlock (&desc->meta_lock);
return 0;
}
msize = strlen(desc->metadata);
if (msize > size)
msize = size;
memcpy(data, desc->me... | false | false | false | false | false | 0 |
choose_hashed_grouping(PlannerInfo *root,
double tuple_fraction, double limit_tuples,
Path *cheapest_path, Path *sorted_path,
Oid *groupOperators, double dNumGroups,
AggClauseCounts *agg_counts)
{
int numGroupCols = list_length(root->parse->groupClause);
double cheapest_path_rows;
... | false | false | false | false | false | 0 |
startMoving(const QPointF& pt)
{
objectMoved = false;
isMoving = true;
basePoint = pt;
for(int i = 0; i < objectList.size(); i++)
{
objectList[i]->setBasePoint(basePoint);
}
} | false | false | false | false | false | 0 |
luaL_newmetatable (lua_State *L, const char *tname) {
if (luaL_getmetatable(L, tname)) /* name already in use? */
return 0; /* leave previous value on top, but return 0 */
lua_pop(L, 1);
lua_newtable(L); /* create metatable */
lua_pushstring(L, tname);
lua_setfield(L, -2, "__name"); /* metatable.__nam... | false | false | false | false | false | 0 |
_item_mouse_down_cb(void *data,
Evas *evas __UNUSED__,
Evas_Object *obj,
void *event_info)
{
Evas_Event_Mouse_Down *ev = event_info;
Elm_Gen_Item *it = data;
Evas_Coord x, y;
if (ev->button != 1) return;
it->down = 1;
it->dragging = 0;
e... | false | false | false | false | false | 0 |
ik_mmap(unsigned long int size){
unsigned long int pages = (size + pagesize - 1) / pagesize;
total_allocated_pages += pages;
unsigned long int mapsize = pages * pagesize;
assert(size == mapsize);
#ifndef __CYGWIN__
char* mem = mmap(
0,
mapsize,
PROT_READ | PROT_WRITE | PROT_EXEC,
MAP_P... | false | false | false | false | false | 0 |
clocks_application_real_activate (GApplication* base) {
ClocksApplication * self;
ClocksWindow* _tmp0_ = NULL;
ClocksWindow* _tmp2_ = NULL;
self = (ClocksApplication*) base;
_tmp0_ = self->priv->window;
if (_tmp0_ == NULL) {
ClocksWindow* _tmp1_ = NULL;
_tmp1_ = clocks_window_new (self);
g_object_ref_sink (... | false | false | false | false | false | 0 |
spi_get_root_window ()
{
if (!default_display)
spi_set_display (NULL);
return DefaultRootWindow (default_display);
} | false | false | false | false | false | 0 |
cut_sequence_matcher_set_context_size (CutSequenceMatcher *matcher,
guint context_size)
{
CutSequenceMatcherPrivate *priv;
priv = CUT_SEQUENCE_MATCHER_GET_PRIVATE(matcher);
if (priv->context_size != context_size) {
priv->context_size = context_si... | false | false | false | false | false | 0 |
ad5064_probe(struct device *dev, enum ad5064_type type,
const char *name, ad5064_write_func write)
{
struct iio_dev *indio_dev;
struct ad5064_state *st;
unsigned int midscale;
unsigned int i;
int ret;
indio_dev = devm_iio_device_alloc(dev, sizeof(*st));
if (indio_dev == NULL)
return -ENOMEM;
st = iio_pr... | false | false | false | false | false | 0 |
close(FILE *out) {
if (!opened) {
if (!the_XML_Document->skip_empty_tags || attribute || !father) {
if (father && !father->Opened()) father->open(out);
if (onExtraLine) {
fputc('\n', out);
to_indent(out, Indent());
}
fputc('<',... | false | false | false | false | false | 0 |
receive_xds (NautilusTreeViewDragDest *dest,
GtkWidget *widget,
guint32 time,
GdkDragContext *context,
int x, int y)
{
GFile *location;
const guchar *selection_data;
gint selection_format;
gint selection_length;
selection_data = gtk_selection_data_get_data (dest->details->drag_data);
sele... | false | false | false | false | false | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.