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 |
|---|---|---|---|---|---|---|
make_filename(PyObject *prefix, PyObject *name)
{
PyObject *pathobj;
Py_UCS4 *p, *buf;
Py_ssize_t len;
len = PyUnicode_GET_LENGTH(prefix) + PyUnicode_GET_LENGTH(name) + 1;
p = buf = PyMem_Malloc(sizeof(Py_UCS4) * len);
if (buf == NULL) {
PyErr_NoMemory();
return NULL;
}
... | false | false | false | false | false | 0 |
string_hash( const char *str )
{
unsigned long h = 0;
unsigned long g;
/*
* From the "Dragon" book by Aho, Sethi and Ullman.
*/
while ( *str )
{
h = ( h << 4 ) + *str++;
if ( ( g = ( h & 0xf0000000 ) ) != 0 )
{
h ^= ( g >> 24 );
h ^= g;
}
}
return h;
} | false | false | false | false | false | 0 |
mask_op(i_ctx_t *i_ctx_p,
int (*mask_proc)(gs_state *, gs_transparency_channel_selector_t))
{
int csel;
int code = int_param(osp, 1, &csel);
if (code < 0)
return code;
code = mask_proc(igs, csel);
if (code >= 0)
pop(1);
return code;
} | false | false | false | false | false | 0 |
rq_ioc(struct bio *bio)
{
#ifdef CONFIG_BLK_CGROUP
if (bio && bio->bi_ioc)
return bio->bi_ioc;
#endif
return current->io_context;
} | false | false | false | false | false | 0 |
CountUserBackends(Oid roleid)
{
ProcArrayStruct *arrayP = procArray;
int count = 0;
int index;
LWLockAcquire(ProcArrayLock, LW_SHARED);
for (index = 0; index < arrayP->numProcs; index++)
{
int pgprocno = arrayP->pgprocnos[index];
volatile PGPROC *proc = &allProcs[pgprocno];
if (proc->pid == 0)
c... | false | false | false | false | false | 0 |
inittable(void)
{
/* Define a lookup table. Precompute values and store in a table */
long i;
for (i = 0; i < categs; i++) {
tbl[i].rat = rate[i];
tbl[i].ratxv = rate[i] * xv;
}
} | false | false | false | false | false | 0 |
_iodbcdm_admin_dialbox (HWND hwnd)
{
RETCODE retcode = SQL_ERROR;
/* Check input parameters */
if (!hwnd)
goto quit;
create_administrator (hwnd);
retcode = SQL_SUCCESS;
quit:
return retcode;
} | false | false | false | false | false | 0 |
_setAbiSuiteLibDir()
{
// FIXME: this code sucks hard
char * buf = NULL;
// see if ABIWORD_DATADIR was set in the environment
const char * sz = getenv("ABIWORD_DATADIR");
if (sz && *sz)
{
int len = strlen(sz);
buf = (gchar *)g_malloc(len+1);
strcpy(buf,sz);
char * p = buf;
if ( (p[0]=='"') && (p[len-... | false | false | false | false | false | 0 |
encdesc_write_header(GtEncdesc *encdesc, FILE *fp)
{
unsigned long cur_field_num;
DescField *cur_field;
encdesc_header_io_basics(encdesc, fp, encdesc_gt_xfwrite);
for (cur_field_num = 0;
cur_field_num < encdesc->num_of_fields;
cur_field_num++) {
cur_field = &encdesc->fields[cur_field_num];
... | false | false | false | false | false | 0 |
dmaend_callback(int data)
{
if (cur_control2 & 0x0040)
{
// foul-proof (CPU0 could be deactivated while we wait)
if (suspension_active) { suspension_active = 0; cpu_trigger(resume_trigger); }
// IRQ 5 is the "object DMA end interrupt" and shouldn't be triggered
// if object data isn't ready for DMA w... | false | false | false | false | false | 0 |
lookupResultElementType(const StringC &name)
{
Dtd *dtd = defComplexLpd().resultDtd().pointer();
if (!dtd)
return 0;
ElementType *e = dtd->lookupElementType(name);
if (!e)
message(ParserMessages::noSuchResultElement, StringMessageArg(name));
return e;
} | false | false | false | false | false | 0 |
HPDF_Stream_Read (HPDF_Stream stream,
HPDF_BYTE *ptr,
HPDF_UINT *size)
{
if (!(stream->read_fn))
return HPDF_SetError (stream->error, HPDF_INVALID_OPERATION, 0);
/*
if (HPDF_Error_GetCode(stream->error) != HPDF_NOERROR)
return HPDF_THIS_FUNC_WAS... | false | false | false | false | false | 0 |
create_variant_part_from (tree old_variant_part,
vec<variant_desc> variant_list,
tree record_type, tree pos_list,
vec<subst_pair> subst_list)
{
tree offset = DECL_FIELD_OFFSET (old_variant_part);
tree old_union_type = TREE_TYPE (old_variant_part);
tree new_union_type, new_variant_part;
tree union... | false | false | false | false | false | 0 |
tocase(
bool (*xiswcase)(const unsigned long wc),
unsigned long (*xtowcase)(const unsigned long wc)) const
{
GP<GStringRep> retval;
char const * const eptr=data+size;
char const *ptr=data;
while(ptr<eptr)
{
char const * const xptr=isCharType(xiswcase,ptr,false);
if(ptr == xptr)
break;
pt... | false | false | false | false | false | 0 |
normalize_action_name(lrmd_rsc_t * rsc, const char *action)
{
if (safe_str_eq(action, "monitor") &&
(safe_str_eq(rsc->class, "lsb") ||
safe_str_eq(rsc->class, "service") || safe_str_eq(rsc->class, "systemd"))) {
return "status";
}
return action;
} | false | false | false | false | false | 0 |
gst_audio_karaoke_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
GstAudioKaraoke *filter;
filter = GST_AUDIO_KARAOKE (object);
switch (prop_id) {
case PROP_LEVEL:
filter->level = g_value_get_float (value);
break;
case PROP_MONO_LEVEL:
fil... | false | false | false | false | false | 0 |
deleteTuple(s)
space1_t *s;
{
apptq_t *qtr;
for (qtr = tsh.space ; qtr != NULL ; qtr = qtr->next)
if (!strcmp(qtr->appid, s->appid)) break;
if (qtr == NULL) return;
if (s == qtr->Tqueue) /* remove tuple from space */
qtr->Tqueue = s->next ;
else
s->prev... | false | false | false | false | false | 0 |
static_vertex_find (double *n1, double *n2, double *n3, double *v)
{
double m[9];
double a, b, c, d;
double d1, d2, d3;
/*****************************************
* determine the apex of the triangular *
* piramid defined by neighbours 1,2,3 *
* *
* 1) calculate determinant... | false | false | false | false | false | 0 |
live_messages_notify (DBusCounter *counter,
void *user_data)
{
DBusTransport *transport = user_data;
_dbus_transport_ref (transport);
#if 0
_dbus_verbose ("Size counter value is now %d\n",
(int) _dbus_counter_get_size_value (counter));
_dbus_verbose ("Unix FD... | false | false | false | false | false | 0 |
udl_get_modes(struct drm_connector *connector)
{
struct udl_device *udl = connector->dev->dev_private;
struct edid *edid;
int ret;
edid = (struct edid *)udl_get_edid(udl);
if (!edid) {
drm_mode_connector_update_edid_property(connector, NULL);
return 0;
}
/*
* We only read the main block, but if the monit... | false | false | false | false | false | 0 |
undo_partition (ltrans_partition partition, unsigned int n_cgraph_nodes,
unsigned int n_varpool_nodes)
{
while (VEC_length (cgraph_node_ptr, partition->cgraph_set->nodes) >
n_cgraph_nodes)
{
struct cgraph_node *node = VEC_index (cgraph_node_ptr,
partition->cgraph_set->nodes,
n_cgraph_n... | false | false | false | false | false | 0 |
lev_sel(int cmd, dico_key_t key, const char *dict_word)
{
if (cmd == DICO_SELECT_RUN) {
int dist = dico_levenshtein_distance(key->word, dict_word,
(int)key->strat->closure);
if (dist < 0)
return 0;
return dist <= levenshtein_distance;
}
return 0;
} | false | false | false | false | false | 0 |
Unpack(const Buffer *b)
{
unpack_status_t res=PacketSTRING::Unpack(b);
if(res!=UNPACK_SUCCESS)
return res;
int *offset=&unpacked;
int limit=length+4;
if(*offset<limit)
UNPACK8(eof);
return UNPACK_SUCCESS;
} | false | false | false | false | false | 0 |
exif_mnote_data_fuji_save (ExifMnoteData *ne, unsigned char **buf,
unsigned int *buf_size)
{
ExifMnoteDataFuji *n = (ExifMnoteDataFuji *) ne;
size_t i, o, s, doff;
unsigned char *t;
size_t ts;
if (!n || !buf || !buf_size) return;
/*
* Allocate enough memory for all entries and the number
* of entries.... | false | false | false | false | false | 0 |
_urlpath(path, hostp, typep)
CONST char *path;
char **hostp;
int *typep;
{
int n;
if (!urldrive) return(0);
n = urlparse(path, NULL, hostp, typep, 0);
return((n > 0) ? n : 0);
} | false | false | false | false | false | 0 |
update_window_title(win_struct *win)
{
char *title = NULL;
Window child=None;
if (debug) printf ("update window title\n");
if (win->xmms) {
child=win->xmms_main_window_xlib;
} else {
child=win->child_xlib;
}
if (!assert_window(child)) {
return;
}
title= wnck_get_name (child);
if (t... | false | false | false | false | false | 0 |
CheckIdent (ident)
char *ident;
{
char *cpt;
int i;
cpt = ident;
while ( isspace (*cpt) != 0 )
cpt ++;
if (isalpha(*cpt++) == 0)
Erreur ("IDENT error not an identifier");
for (i = strlen(cpt); i >0; i--)
{
if (isalnum(*cpt) == 0)
if ((*cpt != '_') && (*cpt != '.'))
... | false | false | false | false | false | 0 |
_e_border_show(E_Border *bd)
{
Eina_List *l;
E_Border *tmp;
ecore_evas_show(bd->bg_ecore_evas);
if (bd->post_job)
{
bd->post_show = 1;
return;
}
if (!((bd->comp_hidden) || (bd->tmp_input_hidden > 0)))
{
_e_border_shape_input_rectangle_set(bd);
// not anym... | false | false | false | false | false | 0 |
init( void )
#else
init( )
#endif
{
SignalEntry *q;
Tname = newHashTable();
Rname = newHashTable();
Fcache = newHashTable();
Tcache = newHashTable();
Sname = newHashTable();
Pname = newHashTable(); /* MR11 */
/* Add default signal names */
q = (SignalEntry *)hash_add(Sname,
"NoViableAlt",
... | false | false | false | false | false | 0 |
ioctl_fibmap(struct file *filp, int __user *p)
{
struct address_space *mapping = filp->f_mapping;
int res, block;
/* do we support this mess? */
if (!mapping->a_ops->bmap)
return -EINVAL;
if (!capable(CAP_SYS_RAWIO))
return -EPERM;
res = get_user(block, p);
if (res)
return res;
res = mapping->a_ops->bmap... | false | false | false | false | false | 0 |
sh_first_smallest_max_neighbours()
{
Partition::Cell* best_cell = 0;
int best_value = -1;
unsigned int best_size = UINT_MAX;
KStack<Partition::Cell*> neighbour_cells_visited;
neighbour_cells_visited.init(get_nof_vertices());
for(Partition::Cell* cell = p.first_nonsingleton_cell;
cell;
cell = cel... | false | false | false | false | false | 0 |
pochhammer (gnm_float x, gnm_float n, gboolean give_log)
{
gnm_float rn, rx, lr;
GnmQuad m1, m2;
int e1, e2;
if (gnm_isnan (x) || gnm_isnan (n))
return gnm_nan;
/* This isn't a fundamental restriction, but one we impose. */
if (x <= 0 || x + n <= 0)
return gnm_nan;
if (n == 0)
return give_log ? 0 : 1;
... | false | false | false | false | false | 0 |
is_operator (char c)
{
return c == ':' || c == ',' || c == '{' || c == '}';
} | false | false | false | false | false | 0 |
initPlayers()
{
// Create yellow
KWin4Player* yellow = (KWin4Player*)createPlayer(1, mPlayedBy[Yellow], false);
yellow->setUserId(Yellow);
yellow->setName(Prefs::name1());
addPlayer(yellow);
setPlayedBy(Yellow,mPlayedBy[Yellow]);
// Create Red
KWin4Player* red = (KWin4Player*)createPlayer(1, mPlayedBy... | false | false | false | false | false | 0 |
debug(double me2) const {
if( !generator()->logfile().is_open() ) return;
if( (mePartonData()[0]->id() != 1 && mePartonData()[0]->id() != 2) ||
(mePartonData()[1]->id() != -1 && mePartonData()[1]->id() != -2) ||
mePartonData()[2]->id() != 5100021 ||
mePartonData()[3]->id() != 5100021 ) return;
... | false | false | false | false | false | 0 |
bcmdec_negotiate_format(GstBcmDec *bcmdec)
{
GstCaps *caps;
gboolean result;
guint num = (guint)(bcmdec->output_params.framerate * 1000);
guint den = 1000;
GstStructure *s1;
const GValue *framerate_value;
GstVideoFormat vidFmt;
GstVideoInfo info;
#ifdef YV12__
vidFmt = GST_VIDEO_FORMAT_YV12;
#else
vidFmt = G... | false | false | false | false | false | 0 |
Scm_ForkptyAndExec(ScmString *file, ScmObj args, ScmObj iomap,
ScmObj slaveterm, ScmSysSigset *mask)
{
int argc = Scm_Length(args);
char **argv;
const char *program;
int *fds;
int master;
pid_t pid;
struct termios *term = NULL;
if (argc < 1) {
Scm_Error... | false | false | false | false | false | 0 |
InternalFieldCount() {
if (IsDeadCheck("v8::ObjectTemplate::InternalFieldCount()")) {
return 0;
}
return i::Smi::cast(Utils::OpenHandle(this)->internal_field_count())->value();
} | false | false | false | false | false | 0 |
record_voperand_set (bitmap global, bitmap *local, unsigned int uid)
{
/* Lazily allocate the bitmap. Note that we do not get a notification
when the block local data structures die, so we allocate the local
bitmap backed by the GC system. */
if (*local == NULL)
*local = BITMAP_GGC_ALLOC ();
/* S... | false | false | false | false | false | 0 |
MG_dest_field_changed_cb(AW_root *aw_root) {
if (allow_callbacks) {
// if this is changed -> a new definition will be generated
char *dest_field = aw_root->awar(AWAR_MERGE_GENE_SPECIES_DEST)->read_string();
check_and_correct_current_field(dest_field);
const char *search ... | false | false | false | false | false | 0 |
fat_fh_to_parent_nostale(struct super_block *sb,
struct fid *fh, int fh_len,
int fh_type)
{
struct inode *inode = NULL;
struct fat_fid *fid = (struct fat_fid *)fh;
loff_t i_pos;
if (fh_len < FAT_FID_SIZE_WITH_PARENT)
return NULL;
switch (fh_type) {
case FILEID_FAT_WITH_PARENT:
i_pos ... | false | false | false | false | false | 0 |
make_car_info_local_array(const Stasche_localize_table *localize_table,
const Stasche_localize_tlg_info *tlg_info,
const Stasche_localize_car_info *car_info)
{
int array_num;
int pg_no;
int base;
int i;
if (car_info == NULL) return;
array_num... | false | false | false | false | false | 0 |
attach_one_config(SANEI_Config __sane_unused__ *config, const char *line)
{
int vendor, product, timeout;
int len = strlen(line);
DBG(7, "%s: len = %d, line = %s\n", __func__, len, line);
if (sscanf(line, "usb %i %i", &vendor, &product) == 2) {
/* add the vendor and product IDs to the list of
* known de... | true | true | false | false | true | 1 |
eel_push_context(void)
{
eel_context_t *c = malloc(sizeof(eel_context_t));
if(!c)
{
eel_error("INTERNAL ERROR: Failed to push context!");
return;
}
memcpy(c, &eel_current, sizeof(eel_context_t));
c->previous = context_stack;
context_stack = c;
} | false | false | false | false | false | 0 |
archive_strncat(struct archive_string *as, const void *_p, size_t n)
{
size_t s;
const char *p, *pp;
p = (const char *)_p;
/* Like strlen(p), except won't examine positions beyond p[n]. */
s = 0;
pp = p;
while (s < n && *pp) {
pp++;
s++;
}
if ((as = archive_string_append(as, p, s)) == NULL)
__archive_e... | false | false | false | false | false | 0 |
gsfsln (struct gscmn *pcmn) {
struct gsvar *pvar;
char *res;
gaint ret, len;
pcmn->rres = NULL;
pvar = pcmn->farg;
if (pvar==NULL) {
printf ("Error in strlen: Argument missing\n");
ret = 1;
goto retrn;
}
len = 0;
while (*(pvar->strng+len)) {
len++;
if (len==9999999) break;
}
/*... | false | false | false | false | false | 0 |
insert_section_boundary_note (void)
{
basic_block bb;
rtx new_note;
int first_partition = 0;
if (flag_reorder_blocks_and_partition)
FOR_EACH_BB (bb)
{
if (!first_partition)
first_partition = BB_PARTITION (bb);
if (BB_PARTITION (bb) != first_partition)
{
new_note = emit_note_before (NOT... | false | false | false | false | false | 0 |
Ns_ConfigGetInt(char *section, char *key, int *valuePtr)
{
char *s;
s = Ns_ConfigGetValue(section, key);
if (s == NULL || sscanf(s, "%d", valuePtr) != 1) {
return NS_FALSE;
}
return NS_TRUE;
} | false | false | false | false | false | 0 |
gdef_get_string_var(GDEFVariable *var)
{
if (var->type == VAR_CHAR)
return g_strndup(var->data, var->size);
g_return_val_if_reached(NULL);
} | false | false | false | false | false | 0 |
wrk_do_cnt_sess(struct worker *w, void *priv)
{
struct sess *sess;
CAST_OBJ_NOTNULL(sess, priv, SESS_MAGIC);
AZ(sess->wrk);
THR_SetSession(sess);
sess->wrk = w;
CHECK_OBJ_ORNULL(w->nobjhead, OBJHEAD_MAGIC);
CNT_Session(sess);
CHECK_OBJ_ORNULL(w->nobjhead, OBJHEAD_MAGIC);
THR_SetSession(NULL);
} | false | false | false | false | false | 0 |
sleep_exec ( int argc, char **argv ) {
struct sleep_options opts;
unsigned int seconds;
unsigned long start;
unsigned long delay;
int rc;
/* Parse options */
if ( ( rc = parse_options ( argc, argv, &sleep_cmd, &opts ) ) != 0 )
return rc;
/* Parse number of seconds */
if ( ( rc = parse_integer ( argv[optind... | false | true | false | false | true | 1 |
GotoTokenPosition(int line, const wxString& tokenName)
{
cbStyledTextCtrl* control = GetControl();
if (line > control->GetLineCount())
return false;
GotoLine(line, true); // center function on screen
SetFocus(); // ...and set focus to this editor
// Now highlight the token
co... | false | false | false | false | false | 0 |
Save_PAL(T_IO_Context * context)
{
FILE *file;
char filename[MAX_PATH_CHARACTERS]; ///< full filename
Get_full_filename(filename, context->File_name, context->File_directory);
File_error=0;
// Open output file
if ((file=fopen(filename,"w")))
{
int i;
if (fputs("JASC-PAL\n0100\n256\n", file)==EO... | true | true | false | false | true | 1 |
zstream_append_input(struct zstream *z, const Bytef *src, long len)
{
if (len <= 0) return;
if (NIL_P(z->input)) {
z->input = rb_str_buf_new(len);
rb_str_buf_cat(z->input, (const char*)src, len);
RBASIC(z->input)->klass = 0;
}
else {
rb_str_buf_cat(z->input, (const char*)src, len);
}
} | false | false | false | false | false | 0 |
cb(int ok, X509_STORE_CTX *ctx)
{
int cert_error = X509_STORE_CTX_get_error(ctx);
X509 *current_cert = X509_STORE_CTX_get_current_cert(ctx);
if (!ok)
{
if (current_cert)
{
X509_NAME_print_ex_fp(stdout,
X509_get_subject_name(current_cert),
0, XN_FLAG_ONELINE);
printf("\n");
}
printf("%serr... | false | false | false | false | false | 0 |
query_isduplicate(ns_client_t *client, dns_name_t *name,
dns_rdatatype_t type, dns_name_t **mnamep)
{
dns_section_t section;
dns_name_t *mname = NULL;
isc_result_t result;
CTRACE("query_isduplicate");
for (section = DNS_SECTION_ANSWER;
section <= DNS_SECTION_ADDITIONAL;
section++) {
result = dn... | false | false | false | false | false | 0 |
regcache_rbtree_drop(struct regmap *map, unsigned int min,
unsigned int max)
{
struct regcache_rbtree_ctx *rbtree_ctx;
struct regcache_rbtree_node *rbnode;
struct rb_node *node;
unsigned int base_reg, top_reg;
unsigned int start, end;
rbtree_ctx = map->cache;
for (node = rb_first(&rbtree_ctx->root); node; n... | false | false | false | false | false | 0 |
unity_internal_aggregator_scope_impl_real_search_data_free (gpointer _data) {
UnityInternalAggregatorScopeImplSearchData* _data_;
_data_ = _data;
_g_free0 (_data_->search_string);
_g_hash_table_unref0 (_data_->hints);
_g_object_unref0 (_data_->cancellable);
_g_hash_table_unref0 (_data_->result);
_g_object_unref0... | false | false | false | false | false | 0 |
gl_print_op_finalize (GObject *object)
{
glPrintOp *op = GL_PRINT_OP (object);
gl_debug (DEBUG_PRINT, "");
g_return_if_fail (object != NULL);
g_return_if_fail (GL_IS_PRINT_OP (op));
g_return_if_fail (op->priv != NULL);
g_object_unref (G_OBJECT(op->priv->label));
g_free (op->priv->filenam... | false | false | false | false | false | 0 |
commodity_table_book_begin (QofBook *book)
{
gnc_commodity_table *ct;
ENTER ("book=%p", book);
if (gnc_commodity_table_get_table(book))
return;
ct = gnc_commodity_table_new ();
qof_book_set_data (book, GNC_COMMODITY_TABLE, ct);
if (!gnc_commodity_table_add_default_data(ct, book))
... | false | false | false | false | false | 0 |
perror(void) const
{
fflush(0);
DjVuPrintErrorUTF8("*** ");
DjVuMessageLite::perror(get_cause());
if (file && line>0)
DjVuPrintErrorUTF8("*** (%s:%d)\n", file, line);
else if (file)
DjVuPrintErrorUTF8("*** (%s)\n", file);
if (func)
DjVuPrintErrorUTF8("*** '%s'\n", func);
DjVuPrintError... | false | false | false | false | false | 0 |
my_stftime_tz(RESULT * result, RESULT * arg1, RESULT * arg2, RESULT * arg3)
{
char value[256] = "";
time_t t = R2N(arg2);
char *tz = R2S(arg3);
char *old_tz;
old_tz = getenv("TZ");
/*
* because the next setenv() call may overwrite that string, we
* duplicate it here
*/
if (o... | false | false | false | false | false | 0 |
locate_read_oeminstall(xfile **pxf, int verb) {
int j;
char tname[1000], *pf, *ap;
xfile *xf = NULL; /* return value */
aglob ag;
if (verb) { printf("Looking for OEM install files .. \n"); fflush(stdout); }
tname[0] = '\000';
#ifdef NT
/* Where the normal instalation goes */
if ((pf = getenv("PROGRAMFILES")... | false | false | false | false | false | 0 |
add_server_conf(struct server_conf *server_p)
{
if(EmptyString(server_p->class_name))
{
server_p->class_name = rb_strdup("default");
server_p->class = default_class;
return;
}
server_p->class = find_class(server_p->class_name);
if(server_p->class == default_class)
{
conf_report_error("Warning connect::c... | false | false | false | false | false | 0 |
od_multibutton_init(ODMultiButton *mb)
{
guint i;
#if GTK_CHECK_VERSION(2, 2, 0)
gtk_widget_set_can_focus(GTK_WIDGET(mb), FALSE);
gtk_widget_set_can_default(GTK_WIDGET(mb), FALSE);
gtk_widget_set_receives_default(GTK_WIDGET(mb), FALSE);
#else
GTK_WIDGET_UNSET_FLAGS(mb, GTK_CAN_FOCUS | GTK_CAN_DEFAULT | GTK_RECEIV... | false | false | false | false | false | 0 |
module_set_fixed_variables( struct module_t * m, int n_variables )
{
/* Reallocate */
struct hash * variable_indices;
LIST * * fixed_variables = BJAM_MALLOC( n_variables * sizeof( LIST * ) );
if ( m->fixed_variables )
{
memcpy( fixed_variables, m->fixed_variables, n_variables * sizeof( LIST ... | false | true | false | false | false | 1 |
camel_write (gint fd,
const gchar *buf,
gsize n,
GCancellable *cancellable,
GError **error)
{
gssize w, written = 0;
gint cancel_fd;
if (g_cancellable_set_error_if_cancelled (cancellable, error)) {
errno = EINTR;
return -1;
}
cancel_fd = g_cancellable_get_f... | false | false | false | false | false | 0 |
unique_qvars(Formula f, Ilist vars)
{
if (f->type == ATOM_FORM)
return vars;
else if (quant_form(f)) {
Term var = get_rigid_term(f->qvar, 0);
if (ilist_member(vars, SYMNUM(var))) {
/* Rename this variable. */
int sn = gen_new_symbol("x", 0, vars);
Term newvar = get_rigid_term(sn_to_str... | false | false | false | false | false | 0 |
kvp_match_predicate (gpointer object, QofParam *getter,
QofQueryPredData *pd)
{
int compare;
KvpFrame *kvp;
KvpValue *value;
query_kvp_t pdata = (query_kvp_t)pd;
VERIFY_PREDICATE (query_kvp_type);
kvp = ((query_kvp_getter)getter->param_getfcn) (object, getter);
if (!kv... | false | false | false | false | false | 0 |
validate_exec(const char *path)
{
struct stat buf;
#ifndef WIN32
uid_t euid;
struct group *gp;
struct passwd *pwp;
int i;
int in_grp = 0;
#else
char path_exe[MAXPGPATH + sizeof(".exe") - 1];
#endif
int is_r;
int is_x;
#ifdef WIN32
/* Win32 requires a .exe suffix for stat() */
if (strlen(path) >= ... | true | true | false | false | false | 1 |
set_Foreground(MudProfile *profile, const gchar *candidate)
{
GdkColor color;
if (candidate && gdk_color_parse(candidate, &color))
{
if (!gdk_color_equal(&color, &profile->priv->preferences.Foreground))
{
profile->priv->preferences.Foreground.red = color.red;
profile... | false | false | false | false | false | 0 |
load_servicefp_file(char *sigfile, signature **db, int len)
{
FILE *fp;
bstring filename;
bstring filedata;
struct bstrList *lines;
int i;
(void)(len); // doesn't matter
/*
* Check for a PADS_SIGNATURE_LIST file within the current directory.
*/
if ((fp = fopen(TCP_SIGNATURE... | false | false | false | false | true | 1 |
emp_randomize_chars(char *str)
{
int idx;
int char_index;
// shuffle chars around
for(idx=0; idx<(int)(strlen(str)-1); idx++){
if(frand_range(0.0f, 1.0f) < Emp_intensity){
char_index = (int)frand_range(0.0f, (float)(NUM_RANDOM_CHARS - 1));
str[idx] = Emp_random_char[char_index];
}
}
} | false | false | false | false | false | 0 |
ipmi_print_get_instan_power_Amps_data(IPMI_INST_POWER_CONSUMPTION_DATA instpowerconsumptiondata)
{
uint16_t intampsval=0;
uint16_t decimalampsval=0;
if (instpowerconsumptiondata.instanApms > 0) {
decimalampsval = (instpowerconsumptiondata.instanApms % 10);
intampsval = instpowerconsumptiondata.instanApms / 10;
... | false | false | false | false | false | 0 |
init_pipe_struct_pair(struct pipe_struct *read_pipe, struct pipe_struct *write_pipe)
{
int retval;
int pipefds[2];
retval = pipe(pipefds);
if (retval < 0) {
perror("Unable to create a new pipe!");
goto out;
}
read_pipe->pipe_fd = pipefds[0];
read_pipe->pipe_mate_fd = pipefd... | false | false | false | false | false | 0 |
pushblock(u)
struct undostack *u;
{
if (u->blockp == 0)
if ((uwrite = OPEN_NEW(undobuf)) < 0)
return FALSE;
if (BUFSZ == WRITE_TEXT(uwrite, u->coreblock, BUFSZ)) {
u->blockp++;
u->ptr = 0;
return TRUE;
}
return FALSE;
} | false | false | false | false | false | 0 |
save( QTextStream * ts, int indent )
{
indentation( ts, indent );
if( _type == ArtefactElementaryAction::AT_CHARAC ) {
*ts << "<elementary type=\"CHARAC\" ";
} else {
*ts << "<elementary type=\"SKILL\" ";
}
if( _modif == ArtefactElementaryAction::MT_VALUE ) {
*ts << "modif=\"VALUE\" ";
} else {
*ts << "m... | false | false | false | false | false | 0 |
r8712_createbss_cmd(struct _adapter *padapter)
{
struct cmd_obj *pcmd;
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
struct wlan_bssid_ex *pdev_network =
&padapter->registrypriv.dev_network;
padapter->ledpriv.LedControlHandler(padapter, LED_CTL_START_TO_LINK);
pcmd = kmalloc(sizeof(*pcmd), GFP_ATOMIC);
if... | false | false | false | false | false | 0 |
i915_gem_obj_offset(struct drm_i915_gem_object *o,
struct i915_address_space *vm)
{
struct drm_i915_private *dev_priv = o->base.dev->dev_private;
struct i915_vma *vma;
WARN_ON(vm == &dev_priv->mm.aliasing_ppgtt->base);
list_for_each_entry(vma, &o->vma_list, obj_link) {
if (vma->is_ggtt &&
vma->ggtt_vie... | false | false | false | false | false | 0 |
check_vgs(int32 id,
uintn start_vg,
uintn n_vgs,
char *ident_text, /* just for debugging, remove when done */
uintn resultcount, /* expected number of vgroups */
uint16 *resultarray) /* array containing expected values */
{
uint16 *refarray=NULL;
uintn count=0, ii;
char message[30];
... | false | false | false | false | false | 0 |
evry_state_push(Evry_Selector *sel, Eina_List *plugins)
{
Evry_State *s, *new_state;
Eina_List *l;
Evry_Plugin *p;
Evry_View *view = NULL;
Evry_Window *win = sel->win;
s = sel->state;
if (!(new_state = _evry_state_new(sel, plugins)))
{
DBG("no new state");
return 0;
}
... | false | false | false | false | false | 0 |
add_SubSigs(
/* add SubSig1 and SubSig2 to form SubSig3 */
struct SubSig *SubSig1,
struct SubSig *SubSig2,
struct SubSig *SubSig3, int nbands)
{
int b1, b2;
double wt1, wt2;
double tmp;
wt1 = SubSig1->N / (SubSig1->N + SubSig2->N);
wt2 = 1 - wt1;
/* compute means */
... | false | false | false | false | false | 0 |
getvarval(Var *var)
{
return (var && (var->flags & VARSET)) ? &var->val : NULL;
} | false | false | false | false | false | 0 |
lua_pushnil (lua_State *L) {
ttype(L->top) = LUA_TNIL;
api_incr_top(L);
} | false | false | false | false | false | 0 |
apei_osc_setup(void)
{
static u8 whea_uuid_str[] = "ed855e0c-6c90-47bf-a62a-26de0fc5ad5c";
acpi_handle handle;
u32 capbuf[3];
struct acpi_osc_context context = {
.uuid_str = whea_uuid_str,
.rev = 1,
.cap.length = sizeof(capbuf),
.cap.pointer = capbuf,
};
capbuf[OSC_QUERY_DWORD] = OSC_QUERY_ENABLE;
capb... | false | false | false | false | false | 0 |
gda_meta_table_foreign_key_free (GdaMetaTableForeignKey *tfk)
{
gint i;
for (i = 0; i < tfk->cols_nb; i++) {
g_free (tfk->fk_names_array[i]);
g_free (tfk->ref_pk_names_array[i]);
}
g_free (tfk->fk_cols_array);
g_free (tfk->fk_names_array);
g_free (tfk->ref_pk_cols_array);
g_free (tfk->ref_pk_names_array);
g... | false | false | false | false | false | 0 |
unpack_UYVP (const GstVideoFormatInfo * info, GstVideoPackFlags flags,
gpointer dest, const gpointer data[GST_VIDEO_MAX_PLANES],
const gint stride[GST_VIDEO_MAX_PLANES], gint x, gint y, gint width)
{
int i;
const guint8 *s = GET_LINE (y);
guint16 *d = dest;
for (i = 0; i < width; i += 2) {
guint16 ... | false | false | false | false | false | 0 |
_HZClose(UConverter *cnv){
if(cnv->extraInfo != NULL) {
ucnv_close (((UConverterDataHZ *) (cnv->extraInfo))->gbConverter);
if(!cnv->isExtraLocal) {
uprv_free(cnv->extraInfo);
}
cnv->extraInfo = NULL;
}
} | false | false | false | false | false | 0 |
read_test_msas_text(char *alnfile, char *stkfile)
{
char msg[] = "CLUSTAL msa text-mode read unit test failed";
ESLX_MSAFILE *afp1 = NULL;
ESLX_MSAFILE *afp2 = NULL;
ESL_MSA *msa1, *msa2, *msa3, *msa4;
FILE *alnfp, *stkfp;
char alnfile2[32] = "esltmpaln2XXXXXX";
char ... | true | true | false | false | false | 1 |
sl_if_print(const struct pcap_pkthdr *h, const u_char *p)
{
register u_int caplen = h->caplen;
register u_int length = h->len;
register const struct ip *ip;
if (caplen < SLIP_HDRLEN) {
printf("[|slip]");
return (caplen);
}
length -= SLIP_HDRLEN;
ip = (struct ip *)(p + SLIP_HDRLEN);
if (eflag)
sliplink... | false | false | false | false | false | 0 |
moveDirBrute(Dir::eDir dir)
{
//NOTE: make place after oneself, e.g. object in U
m_mask->unmask();
Cube::t_models resist = m_mask->getResist(dir);
Cube::t_models::iterator end = resist.end();
for (Cube::t_models::iterator i = resist.begin(); i != end; ++i) {
if (!(*i)->isBorder()) {
... | false | false | false | false | false | 0 |
DecodeRUSSrcDstBitpInstruction(MCInst &Inst, unsigned Insn, uint64_t Address,
const void *Decoder) {
unsigned Op1, Op2;
DecodeStatus S = Decode2OpInstruction(Insn, Op1, Op2);
if (S != MCDisassembler::Success)
return Decode2OpInstructionFail(Inst, Insn, Address, Decoder);
Deco... | false | false | false | false | false | 0 |
T1_CopyGlyph( GLYPH *glyph)
{
GLYPH *dest;
long size;
if (glyph==NULL){
T1_errno=T1ERR_INVALID_PARAMETER;
return(NULL);
}
/* Assign padding value */
T1_pad=pFontBase->bitmap_pad;
/* Allocate memory for struct: */
if ((dest=(GLYPH *)malloc(sizeof(GLYPH)))==NULL){
T1_errno=T1ERR_ALLOC_M... | false | true | false | false | false | 1 |
socket_connect_tcp (char *server, unsigned int port, unsigned int timeout)
{
struct sockaddr_in localAddr, servAddr;
struct hostent *h;
struct timeval timeval_v;
int rc;
int sock;
h = gethostbyname(server);
if (h == NULL)
return -1;
memset((char *)&servAddr, 0x0, sizeof(servAddr));
servAddr.sin_family = ... | false | false | false | false | false | 0 |
getExprForDwarfReference(const MCSymbol *Sym, unsigned Encoding,
MCStreamer &Streamer) const {
const MCExpr *Res = MCSymbolRefExpr::Create(Sym, getContext());
switch (Encoding & 0x70) {
default:
report_fatal_error("We do not support this DWARF encoding yet!");
case dwarf::DW_EH_PE_... | false | false | false | false | false | 0 |
on_glade_drop (IAnjutaEditor* editor,
IAnjutaIterable* iterator,
const gchar* signal_data,
PythonPlugin* lang_plugin)
{
GSignalQuery query;
GType type;
guint id;
const gchar* widget;
const gchar* signal;
const gchar* handler;
GList* names = NULL;
GString* str = g_st... | false | false | false | false | false | 0 |
ExpandFPLibCall(SDNode* Node,
RTLIB::Libcall Call_F32,
RTLIB::Libcall Call_F64,
RTLIB::Libcall Call_F80,
RTLIB::Libcall Call_F128,
... | false | false | false | false | false | 0 |
cisco_eeprom_get_region(struct cisco_eeprom *eeprom,size_t offset,
m_uint8_t *data,size_t data_len)
{
size_t i;
for(i=0;i<data_len;i++) {
if (cisco_eeprom_get_byte(eeprom,offset+i,&data[i]) == -1)
return(-1);
}
return(0);
} | false | false | false | false | false | 0 |
arcfb_probe(struct platform_device *dev)
{
struct fb_info *info;
int retval = -ENOMEM;
int videomemorysize;
unsigned char *videomemory;
struct arcfb_par *par;
int i;
videomemorysize = (((64*64)*num_cols)*num_rows)/8;
/* We need a flat backing store for the Arc's
less-flat actual paged framebuffer */
vide... | false | false | false | false | false | 0 |
newConnection(GDBusServer *server, GDBusConnection *newConn, void *data) throw()
{
DBusServerCXX *me = static_cast<DBusServerCXX *>(data);
if (me->m_newConnection) {
GCredentials *credentials;
std::string credString;
credentials = g_dbus_connection_get_peer_credentials(newConn);
... | 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.