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 |
|---|---|---|---|---|---|---|
canvas_msg(t_glist *gl, t_symbol *s, int argc, t_atom *argv)
{
t_message *x = (t_message *)pd_new(message_class);
x->m_messresponder.mr_pd = messresponder_class;
x->m_messresponder.mr_outlet = outlet_new(&x->m_text, &s_float);
x->m_text.te_width = 0; /* don't know it yet. */
... | true | true | false | false | false | 1 |
__db_truncate_pp(dbp, txn, countp, flags)
DB *dbp;
DB_TXN *txn;
u_int32_t *countp, flags;
{
DB_THREAD_INFO *ip;
ENV *env;
int handle_check, ret, t_ret, txn_local;
env = dbp->env;
handle_check = txn_local = 0;
STRIP_AUTO_COMMIT(flags);
/* Check for invalid flags. */
if (F_ISSET(dbp, DB_AM_SECONDARY)) {
_... | false | false | false | true | false | 1 |
keys()
const
{
trace(("rpt_value_cstate::keys(this = %08lX)\n{\n", (long)this));
rpt_value_list *p = new rpt_value_list();
rpt_value::pointer result(p);
for (size_t j = 0; j < length; ++j)
{
rpt_value::pointer elem =
rpt_value_integer::create(magic_zero_decode(list[j]));
p->append(... | false | false | false | false | false | 0 |
H5A_dense_write(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo, H5A_t *attr)
{
H5A_bt2_ud_common_t udata; /* User data for v2 B-tree modify */
H5A_bt2_od_wrt_t op_data; /* "Op data" for v2 B-tree modify */
H5HF_t *fheap = NULL; /* Fractal heap handle */
H5HF_t *shared... | false | false | false | false | false | 0 |
ck_session_get_creation_time (CkSession *session,
char **iso8601_datetime,
GError **error)
{
g_return_val_if_fail (CK_IS_SESSION (session), FALSE);
if (iso8601_datetime != NULL) {
*iso8601_datetime = _g_tim... | false | false | false | false | false | 0 |
getGravity ( const c8 * surface )
{
if ( 0 == strcmp ( surface, "earth" ) ) return vector3df ( 0.f, -90.f, 0.f );
if ( 0 == strcmp ( surface, "moon" ) ) return vector3df ( 0.f, -6.f / 100.f, 0.f );
if ( 0 == strcmp ( surface, "water" ) ) return vector3df ( 0.1f / 100.f, -2.f / 100.f, 0.f );
if ( 0 == strcmp ( ... | false | false | false | false | false | 0 |
afr_lk_transfer_datalock (call_frame_t *dst, call_frame_t *src,
unsigned int child_count)
{
afr_local_t *dst_local = NULL;
afr_local_t *src_local = NULL;
afr_internal_lock_t *dst_lock = NULL;
afr_internal_lock_t *src_lock = NULL;
dst_local = dst->local;... | false | false | false | false | false | 0 |
set_width(unsigned w, bool)
{
if (w != vector_width())
return false;
return true;
} | false | false | false | false | false | 0 |
default_browse_url(void){
if( !strncmp(g.zPath,"dir",3) ) {
/* If the _current_ path is already a browse path, go with it */
return g.zPath;
}else{
/* If cookie is set, it overrides default setting */
char *zBrowseUrlCookieName = mprintf("%t_browse_url",g.zName);
const char *zCookieValue = P(zBr... | false | false | false | false | false | 0 |
gradspline2d_sandwell (double r, double par[], double *G)
{
if (r == 0.0) return (0.0);
return (r * (2.0 * log (r) - 1.0)); /* Just regular spline; par not used */
} | false | false | false | false | false | 0 |
port100_send_cmd_sync(struct port100 *dev, u8 cmd_code,
struct sk_buff *req)
{
int rc;
struct port100_sync_cmd_response arg;
init_completion(&arg.done);
rc = port100_send_cmd_async(dev, cmd_code, req,
port100_send_sync_complete, &arg);
if (rc) {
dev_kfree_skb(req);
return ERR_PTR(rc);
}
... | false | false | false | false | false | 0 |
opdb_enum(opdb_enum_func_t func, void *user_data)
{
int i;
for (i = 0; i < ARRAY_LEN(keys); i++) {
const struct opdb_key *key = &keys[i];
const union opdb_value *value = &values[i];
if (func(user_data, key, value) < 0)
return -1;
}
return 0;
} | false | false | false | false | false | 0 |
main(int argc, char **argv)
{
char *this_program = str_dup(argv[0]);
const char *log_file = 0;
int emergency = 0;
Var desc;
slistener *l;
init_cmdline(argc, argv);
argc--;
argv++;
while (argc > 0 && argv[0][0] == '-') {
/* Deal with any command-line options */
switch (argv[0][1])... | false | false | false | false | true | 1 |
getRaw(const std::string& key, std::string& value) const
{
StringMap::const_iterator it = _map.find(key);
if (it != _map.end())
{
value = it->second;
return true;
}
else return false;
} | false | false | false | false | false | 0 |
Translate_initialise_nucleotide_data(Translate *t){
register gint i;
for(i = 0; i < Translate_NT_SET_SIZE; i++)
t->nt2d[t->nt[i]] = t->nt2d[tolower(t->nt[i])] = i;
t->nt2d['X'] = t->nt2d['x'] = t->nt2d['N'];
t->nt2d['U'] = t->nt2d['u'] = t->nt2d['T'];
return;
} | false | false | false | false | false | 0 |
__sprofil (struct prof *profp, int profcnt, struct timeval *tvp,
unsigned int flags)
{
struct prof *p[profcnt];
struct itimerval timer;
struct sigaction act;
int i;
if (tvp != NULL)
{
/* Return profiling period. */
unsigned long int t = 1000000 / __profile_frequency ();
tvp->tv_sec... | false | false | false | false | false | 0 |
rw_rewrite_print(struct rw_info *info)
{
char *p=rfc822_gettok(info->ptr);
if (!p) clog_msg_errno();
( (struct rw_info_rewrite *)info->udata)->buf=p;
} | false | false | false | false | false | 0 |
fz_open_fd(fz_context *ctx, int fd)
{
fz_stream *stm;
int *state;
state = fz_malloc_struct(ctx, int);
*state = fd;
fz_try(ctx)
{
stm = fz_new_stream(ctx, state, read_file, close_file);
}
fz_catch(ctx)
{
fz_free(ctx, state);
fz_rethrow(ctx);
}
stm->seek = seek_file;
return stm;
} | false | false | false | false | true | 1 |
fls(int mask)
{
int bit;
if (mask == 0)
return (0);
for (bit = 1; mask != 1; bit++)
mask = (unsigned int) mask >> 1;
return (bit);
} | false | false | false | false | false | 0 |
idebugger_connect (IAnjutaDebugger *plugin, const gchar *server, const gchar *argument, gboolean terminal, gboolean stop, GError **err)
{
DEBUG_PRINT ("%s", "connect: Not Implemented");
JSDbg *self = ANJUTA_PLUGIN_JSDBG (plugin);
gint port = DEBUGGER_PORT;
if (server)
{
gint len = strlen (server), k;
for (k ... | false | false | false | false | false | 0 |
kmo_priv_moffat1d_fncd(const double x[], const double a[], double result[])
{
// y(x) = a[0] + a[1]*(1 + ((x-a[2])/a[3])^2)^(-a[4])
if (a == NULL)
result = NULL;
double bb = (1 + pow(((x[0]-a[2])/a[3]),2));
double aa = pow(bb, -a[4]);
/* derivative in a[0] */
result[0] = 1;
/* der... | false | false | false | true | false | 1 |
xpmGetString(mdata, sptr, l)
xpmData *mdata;
char **sptr;
unsigned int *l;
{
unsigned int i, n = 0;
int c;
char *p, *q, buf[BUFSIZ];
if (!mdata->type) {
if (mdata->cptr) {
char *start;
while (isspace(c = *mdata->cptr) && c != mdata->Eos)
mdata->cptr++;
start = mdata->cptr;... | false | false | false | false | true | 1 |
show_dh_state(struct device *dev, struct device_attribute *attr, char *buf)
{
struct scsi_device *sdev = to_scsi_device(dev);
if (!sdev->handler)
return snprintf(buf, 20, "detached\n");
return snprintf(buf, 20, "%s\n", sdev->handler->name);
} | false | false | false | false | false | 0 |
RenameRelationInternal(Oid myrelid, const char *newrelname, Oid namespaceId)
{
Relation targetrelation;
Relation relrelation; /* for RELATION relation */
HeapTuple reltup;
Form_pg_class relform;
/*
* Grab an exclusive lock on the target table, index, sequence or view,
* which we will NOT release until ... | false | false | false | true | false | 1 |
makecmd(unsigned char *buf, unsigned char src, unsigned char dst, unsigned char pkt,
unsigned char len, unsigned char *param)
{
if (len > 16)
return 0;
if (src > 15 || dst > 15)
return 0;
if (len && !param)
return 0;
unsigned char *b = buf, l = len;
*b++ = 0xaa;
if (tst... | false | false | false | false | false | 0 |
nemo_window_slot_set_content_view (NemoWindowSlot *slot,
const char *id)
{
NemoFile *file;
char *uri;
g_assert (slot != NULL);
g_assert (slot->location != NULL);
g_assert (id != NULL);
uri = nemo_window_slot_get_location_uri (slot);
DEBUG ("Change view of window %s to %s", uri, id);
g_free (uri);
... | false | false | false | false | false | 0 |
g2_get_free_device()
{
int i, dix;
if(g2_dev==NULL) { /* if NULL initialize */
g2_dev_size=1;
g2_dev=g2_malloc(sizeof(g2_device));
g2_dev[0].t=g2_NDEV; /* set to free */
g2_dev[0].d.pd=NULL; /* no device yet */
}
dix=-1;
for(i=0;i<g2_dev_size;i++) /* find empty place */
... | false | false | false | false | false | 0 |
mctrl_gpio_irq_handle(int irq, void *context)
{
struct mctrl_gpios *gpios = context;
struct uart_port *port = gpios->port;
u32 mctrl = gpios->mctrl_prev;
u32 mctrl_diff;
mctrl_gpio_get(gpios, &mctrl);
mctrl_diff = mctrl ^ gpios->mctrl_prev;
gpios->mctrl_prev = mctrl;
if (mctrl_diff & MCTRL_ANY_DELTA && port-... | false | false | false | false | false | 0 |
gm_cell_renderer_bitext_get_property (GObject *obj,
guint prop_id,
GValue *value,
GParamSpec *spec)
{
GmCellRendererBitext *renderer = NULL;
renderer = (GmCellRendererBitext *)obj;
switch (prop_id) {
case GM_CELL_RENDERER_BITEXT_PROP_PRIMARY_TEXT:
g_value_set_string (value, ... | false | false | false | false | false | 0 |
any_header_changes(void)
{
struct headerentry *he;
for(he = Pmaster->headents; he->name != NULL; he++)
if(he->dirty)
break;
return(he->name && he->dirty);
} | false | false | false | false | false | 0 |
val_bind (dataflow_set *set, rtx val, rtx loc, bool modified)
{
if (REG_P (loc))
{
if (modified)
var_regno_delete (set, REGNO (loc));
var_reg_decl_set (set, loc, VAR_INIT_STATUS_INITIALIZED,
dv_from_value (val), 0, NULL_RTX, INSERT);
}
else if (MEM_P (loc))
{
struct elt_loc_list *l... | false | false | false | false | false | 0 |
tour2d_projdata(splotd *sp, greal **world_data, GGobiData *d, ggobid *gg) {
gint i, j, m;
displayd *dsp = (displayd *) sp->displayptr;
greal precis = (greal) PRECISION1;
greal tmpf, maxx, maxy;
if (sp->tour2d.initmax) {
sp->tour2d.maxscreen = precis;
sp->tour2d.initmax = false;
}
tmpf = precis/s... | false | false | false | false | false | 0 |
update_stmt_fields(MYSQL_STMT *stmt)
{
MYSQL_FIELD *field= stmt->mysql->fields;
MYSQL_FIELD *field_end= field + stmt->field_count;
MYSQL_FIELD *stmt_field= stmt->fields;
MYSQL_BIND *my_bind= stmt->bind_result_done ? stmt->bind : 0;
if (stmt->field_count != stmt->mysql->field_count)
{
/*
The table... | false | false | false | false | false | 0 |
do_get_native_max_sectors (int fd)
{
int err = 0;
__u64 max = 0;
struct hdio_taskfile r;
get_identify_data(fd);
if (!id)
exit(EIO);
memset(&r, 0, sizeof(r));
r.cmd_req = TASKFILE_CMD_REQ_NODATA;
r.dphase = TASKFILE_DPHASE_NONE;
r.oflags.lob.dev = 1;
r.oflags.lob.command = 1;
r.iflags.lob.command =... | false | false | false | false | false | 0 |
isLoopGuardedBy(const Loop *L,
Predicate Pred,
const SCEV *A,
const SCEV *B) const {
if (SE->isLoopEntryGuardedByCond(L, Pred, A, B))
return AlwaysTrue;
Pred =... | false | false | false | false | false | 0 |
parse_text_line(char *pos)
{
int i, nr;
char *row= pos;
size_t len;
DBUG_ENTER("parse_text_line");
len= strlen (pos);
while (*pos)
{
if (*pos == '\\')
{
switch (*++pos) {
case '\\':
case '"':
(void) memmove (pos - 1, pos, len - (row - pos));
break;
case 'n':
pos[-1]= '\... | false | false | false | false | false | 0 |
chunked_data_send(int dst, int src) {
char *buf;
int bsize;
int i, w, csize;
char *err = NULL;
bsize = BUFSIZE;
buf = new(bsize);
/* Take care of all chunks */
do {
i = so_recvln(src, &buf, &bsize);
if (i <= 0) {
if (debug)
printf("chunked_data_send: aborting, read error\n");
free(buf);
retu... | false | false | false | false | false | 0 |
df_def_dominates_uses_p (df, def, blocks)
struct df *df ATTRIBUTE_UNUSED;
struct ref *def;
bitmap blocks;
{
struct df_link *du_link;
/* Follow def-use chain to find all the uses of this def. */
for (du_link = DF_REF_CHAIN (def); du_link; du_link = du_link->next)
{
struct ref *use = du_l... | false | false | false | false | false | 0 |
remove_blank_lines(const char *zOrig){
int i, j, n;
char *z;
for(i=j=0; fossil_isspace(zOrig[i]); i++){ if( zOrig[i]=='\n' ) j = i+1; }
n = strlen(&zOrig[j]);
while( n>0 && fossil_isspace(zOrig[j+n-1]) ){ n--; }
z = mprintf("%.*s", n, &zOrig[j]);
for(i=j=0; z[i]; i++){
if( z[i+1]=='\n' && z[i]!='\n' &... | false | false | false | false | true | 1 |
scm_i_thread_put_to_sleep ()
{
if (threads_initialized_p)
{
scm_i_thread *t;
scm_leave_guile ();
scm_i_pthread_mutex_lock (&thread_admin_mutex);
/* Signal all threads to go to sleep
*/
scm_i_thread_go_to_sleep = 1;
for (t = all_threads; t; t = t->next_thread)
scm_i_p... | false | false | false | false | false | 0 |
item_cursor_setup_auto_fill (GnmItemCursor *ic, GnmItemCursor const *parent, int x, int y)
{
Sheet const *sheet = scg_sheet (parent->scg);
GSList *merges;
ic->base_x = x;
ic->base_y = y;
ic->autofill_src = parent->pos;
/* If there are arrays or merges in the region ensure that we
* need to ensure that an int... | false | false | false | false | false | 0 |
go_gchemutils_component_finalize (GObject *obj)
{
GOGChemUtilsComponent *gogcu = GO_GCHEMUTILS_COMPONENT (obj);
if (gogcu->window)
gogcu->window->Destroy ();
g_free (gogcu->data);
G_OBJECT_CLASS (gogcu_parent_klass)->finalize (obj);
} | false | false | false | false | false | 0 |
eingabe(long* dd, unsigned char k)
{ unsigned char hk;
long hn,hw;
hw = (int) e_inbyte();
if (hw > 127) hw -= 256;
for (hn = 2; hn <= (long) k; hn++)
{ hk = e_inbyte();
hw = hw*256+hk;
};
*dd = hw;
} | false | false | false | false | false | 0 |
attachOrthoEdges (Agraph_t* g, maze* mp, int n_edges, route* route_list, splineInfo *sinfo, epair_t es[], int doLbls)
{
int irte = 0;
int i, ipt, npts;
pointf* ispline = 0;
int splsz = 0;
pointf p, p1, q1;
route rte;
segment* seg;
Agedge_t* e;
textlabel_t* lbl;
for (; irte < n_e... | false | false | false | false | false | 0 |
clear_glock(struct gfs2_glock *gl)
{
gfs2_glock_remove_from_lru(gl);
spin_lock(&gl->gl_lockref.lock);
if (gl->gl_state != LM_ST_UNLOCKED)
handle_callback(gl, LM_ST_UNLOCKED, 0, false);
spin_unlock(&gl->gl_lockref.lock);
if (queue_delayed_work(glock_workqueue, &gl->gl_work, 0) == 0)
gfs2_glock_put(gl);
} | false | false | false | false | false | 0 |
reinstall_routes(private_kernel_netlink_net_t *this)
{
enumerator_t *enumerator;
route_entry_t *route;
this->net_changes_lock->lock(this->net_changes_lock);
this->routes_lock->lock(this->routes_lock);
enumerator = this->routes->create_enumerator(this->routes);
while (enumerator->enumerate(enumerator, NULL, (voi... | false | false | false | false | false | 0 |
bfa_nw_ioc_fwver_get(struct bfa_ioc *ioc, struct bfi_ioc_image_hdr *fwhdr)
{
u32 pgnum;
u32 loff = 0;
int i;
u32 *fwsig = (u32 *) fwhdr;
pgnum = bfa_ioc_smem_pgnum(ioc, loff);
writel(pgnum, ioc->ioc_regs.host_page_num_fn);
for (i = 0; i < (sizeof(struct bfi_ioc_image_hdr) / sizeof(u32));
i++) {
fwsig[... | false | false | false | false | false | 0 |
gf_odf_get_bifs_config(GF_DefaultDescriptor *dsi, u8 oti)
{
Bool hasSize, cmd_stream;
GF_BitStream *bs;
GF_BIFSConfig *cfg;
if (oti>=GPAC_OTI_SCENE_BIFS_EXTENDED) return NULL;
if (!dsi || !dsi->data || !dsi->dataLength ) {
/* Hack for T-DMB non compliant streams (OnTimeTek ?) */
cfg = (GF_BIFSConfig *) gf_od... | false | false | false | false | false | 0 |
set_parameter(int param, parameter_t value) {
switch (param) {
case 1:
crate = std::pow(2.0, value / 6.0);
break;
case 2:
threshold = value / 100.0;
break;
default:
DBC_NEVER_REACHED();
}
} | false | false | false | false | false | 0 |
new_inode_lock (struct gf_flock *flock, void *transport, pid_t client_pid,
gf_lkowner_t *owner, const char *volume)
{
pl_inode_lock_t *lock = NULL;
lock = GF_CALLOC (1, sizeof (*lock),
gf_locks_mt_pl_inode_lock_t);
if (!lock) {
return N... | false | false | false | false | false | 0 |
gda_data_access_wrapper_describe_column (GdaDataModel *model, gint col)
{
GdaDataAccessWrapper *imodel;
g_return_val_if_fail (GDA_IS_DATA_ACCESS_WRAPPER (model), NULL);
imodel = (GdaDataAccessWrapper*) model;
g_return_val_if_fail (imodel->priv, NULL);
if (imodel->priv->model) {
if (imodel->priv->columns)
ret... | false | false | false | false | false | 0 |
lt_string_truncate(lt_string_t *string,
ssize_t len)
{
lt_return_val_if_fail (string != NULL, NULL);
if (len < 0)
len = string->len + len;
len = LT_MAX (len, 0);
string->len = LT_MIN (len, string->len);
string->string[string->len] = 0;
return string;
} | false | false | false | false | false | 0 |
netsnmp_table_build_result(netsnmp_handler_registration *reginfo,
netsnmp_request_info *reqinfo,
netsnmp_table_request_info *table_info,
u_char type, u_char * result, size_t result_len)
{
netsnmp_variable_list *var;
if (!reqinfo ... | false | false | false | false | false | 0 |
ppc32_exec_single_insn_ext(cpu_ppc_t *cpu,ppc_insn_t insn)
{
int res;
res = ppc32_exec_single_instruction(cpu,insn);
if (likely(!res)) cpu->ia += sizeof(ppc_insn_t);
return(res);
} | false | false | false | false | false | 0 |
add(const map<string,float>& domainCount,float count,
const MaybeLog& maybeLog,
std::vector<float>& denseValues,
std::map<std::string,float>& sparseValues) const
{
typedef vector< string >::const_iterator I;
for (I i = m_domain.list.begin(); i != m_domain.list.end(); i++ ) {
map<stri... | false | false | false | false | false | 0 |
Channel_WaitRAP(GF_Channel *ch)
{
ch->pck_sn = 0;
/*if using RAP signal and codec not resilient, wait for rap. If RAP isn't signaled DON'T wait for it :)*/
if (!ch->codec_resilient)
ch->stream_state = 2;
if (ch->buffer) gf_free(ch->buffer);
ch->buffer = NULL;
ch->AULength = 0;
ch->au_sn = 0;
} | false | false | false | false | false | 0 |
variationCount(MoveId moveId) const
{
MoveId node = nodeValid(moveId);
if(node != NO_MOVE)
{
return m_moveNodes[node].variations.size();
}
return 0;
} | false | false | false | false | false | 0 |
atk_state_type_register (const gchar *name)
{
g_return_val_if_fail (name, ATK_STATE_INVALID);
if (last_type < NUM_POSSIBLE_STATES -1)
{
state_names[++last_type] = g_strdup (name);
return (last_type);
}
return ATK_STATE_INVALID; /* caller needs to check */
} | false | false | false | false | false | 0 |
qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
Q_ASSERT(staticMetaObject.cast(_o));
IJSInterpreter *_t = static_cast<IJSInterpreter *>(_o);
switch (_id) {
case 0: _t->JavaScriptConsoleMessage((*reinterpret_cast< ... | false | false | false | false | false | 0 |
stack_regs_mentioned (const_rtx insn)
{
unsigned int uid, max;
int test;
if (! INSN_P (insn) || !stack_regs_mentioned_data.exists ())
return 0;
uid = INSN_UID (insn);
max = stack_regs_mentioned_data.length ();
if (uid >= max)
{
/* Allocate some extra size to avoid too many reallocs, but
do... | false | false | false | false | false | 0 |
gc_collect(pobject env)
{
int collected = 0;
/*
int old_count = gc_objects;
*/
pobject prev, cur, object;
/* set gc flag of all gc_list objects to 0 */
cur = gc_list;
while (cur) {
gc_flag_set(cons_car(cur), 0);
cur = cons_cdr(cur);
}
/* traverse environment and... | false | false | false | false | false | 0 |
check_tcl_chjn(const char *bot, const char *nick, int chan,
const char type, int sock, const char *host)
{
struct flag_record fr = { FR_GLOBAL, 0, 0, 0, 0, 0 };
char s[11], t[2], u[11];
t[0] = type;
t[1] = 0;
switch (type) {
case '*':
fr.global = USER_OWNER;
break;
case '+':
... | true | true | false | false | false | 1 |
isns_create_default_domain(void)
{
isns_object_t *obj;
obj = isns_create_object(&isns_dd_template, NULL, NULL);
if (!obj)
return NULL;
isns_object_set_uint32(obj, ISNS_TAG_DD_ID, 0);
obj->ie_rebuild = __isns_default_dd_rebuild;
return obj;
} | false | false | false | false | false | 0 |
isl_val_trunc(__isl_take isl_val *v)
{
if (!v)
return NULL;
if (isl_val_is_int(v))
return v;
if (!isl_val_is_rat(v))
return v;
v = isl_val_cow(v);
if (!v)
return NULL;
isl_int_tdiv_q(v->n, v->n, v->d);
isl_int_set_si(v->d, 1);
return v;
} | false | false | false | false | false | 0 |
iommu_set_fault_handler(struct iommu_domain *domain,
iommu_fault_handler_t handler,
void *token)
{
BUG_ON(!domain);
domain->handler = handler;
domain->handler_token = token;
} | false | false | false | false | false | 0 |
strCat(char **strp, const char *fmt, ...)
{
char *str, *tstr;
va_list args;
int el;
va_start(args, fmt);
el = VASPrintf(&str, fmt, args);
va_end(args);
if (*strp) {
int ol = strlen(*strp);
tstr = mmalloc(el + ol + 1);
memcpy(tstr, *strp, ol);
memcpy(tstr + ol... | false | false | false | false | false | 0 |
ip6_address_as_string (const struct in6_addr *ip)
{
char buf[INET6_ADDRSTRLEN];
memset (&buf, '\0', sizeof (buf));
if (inet_ntop (AF_INET6, ip, buf, INET6_ADDRSTRLEN)) {
return g_strdup (buf);
} else {
int j;
GString *ip6_str = g_string_new (NULL);
g_string_append_printf (ip6_str, "%02X", ip->s6_addr[0]);... | false | false | false | false | false | 0 |
offset_recurse(int* data, int len, int nv)
{
if (len == 0)
return 0;
// calculate length of initial constant indices
int prefix = 1;
while (prefix < len && data[0] == data[prefix])
prefix++;
int m = data[0];
int s1 = ptriang.noverk(nv+len-1, len) - ptriang.noverk(nv-m+len-1,len);
// cancel m from the rest ... | false | false | false | false | false | 0 |
spmi_regulator_common_set_load(struct regulator_dev *rdev, int load_uA)
{
struct spmi_regulator *vreg = rdev_get_drvdata(rdev);
unsigned int mode;
if (load_uA >= vreg->hpm_min_load)
mode = REGULATOR_MODE_NORMAL;
else
mode = REGULATOR_MODE_IDLE;
return spmi_regulator_common_set_mode(rdev, mode);
} | false | false | false | false | false | 0 |
delConnection(edge* e)
{
int my_idx, other_idx;
vertex* v;
// Find the side we are connected at and edge index
if (e->v1 == this) {
my_idx = e->idx1;
other_idx = e->idx2;
v = (vertex*)(e->v2);
}
else if (e->v2 == this) {
my_idx = e->idx2;
other_idx = e->idx1;
v = (vertex*)(e->v1);
... | false | false | false | false | false | 0 |
pdf_run_page_contents_with_usage(pdf_document *xref, pdf_page *page, fz_device *dev, fz_matrix ctm, char *event, fz_cookie *cookie)
{
fz_context *ctx = dev->ctx;
pdf_csi *csi;
ctm = fz_concat(page->ctm, ctm);
if (page->transparency)
fz_begin_group(dev, fz_transform_rect(ctm, page->mediabox), 1, 0, 0, 1);
csi ... | false | false | false | false | false | 0 |
cell_defer(struct cache *cache, struct dm_bio_prison_cell *cell, bool holder)
{
unsigned long flags;
if (!holder && dm_cell_promote_or_release(cache->prison, cell)) {
/*
* There was no prisoner to promote to holder, the
* cell has been released.
*/
free_prison_cell(cache, cell);
return;
}
spin_lock... | false | false | false | false | false | 0 |
gt_dlist_remove(GtDlist *dlist, GtDlistelem *dlistelem)
{
gt_assert(dlist && dlistelem);
gt_assert(!dlistelem->previous || dlistelem->previous->next == dlistelem);
gt_assert(!dlistelem->next || dlistelem->next->previous == dlistelem);
if (dlistelem->previous)
dlistelem->previous->next = dlistelem->next;
i... | false | false | false | false | false | 0 |
_redisCmd_dup(RedisCmd *cmd)
{
RedisCmd *ret;
int i;
ret = redisCmd_new(cmd->protocolType, NULL);
if (ret == NULL) return NULL;
for (i = 0; i<cmd->argsCount; i++)
{
int rc;
rc = redisCmd_addArg(ret, (char *)cmd->args[i], bstr_len(cmd->args[i]));
if (rc != REDIS_NOERROR)
{
redisCmd_free... | false | false | false | false | false | 0 |
hwpoison_unpoison(void *data, u64 val)
{
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
return unpoison_memory(val);
} | false | false | false | false | false | 0 |
__set_gcr3(struct protection_domain *domain, int pasid,
unsigned long cr3)
{
u64 *pte;
if (domain->mode != PAGE_MODE_NONE)
return -EINVAL;
pte = __get_gcr3_pte(domain->gcr3_tbl, domain->glx, pasid, true);
if (pte == NULL)
return -ENOMEM;
*pte = (cr3 & PAGE_MASK) | GCR3_VALID;
return __amd_iommu_fl... | false | false | false | false | false | 0 |
NSS_CMSDigestContext_FinishMultiple(NSSCMSDigestContext *cmsdigcx,
PLArenaPool *poolp,
SECItem ***digestsp)
{
SECItem ** digests = NULL;
digestPair *pair;
void * mark;
int i;
SECStatus rv;
/* no contents? do not finish digests ... | false | false | false | true | false | 1 |
AddEntry2SubIn(Block *pBlk,
symbol_kind kind,
int entry)
{
switch(kind){
case KIND_VAR:
add1_IntSet(pBlk->df_info->scalar_live_in, entry);
break;
case KIND_ARRAY:
add1_IntSet(pBlk->df_info->array_live_in, entry);
break;
default:
fatal("(mp_dataflow.c) :... | false | false | false | false | false | 0 |
nhmex_rbox_msr_enable_event(struct intel_uncore_box *box, struct perf_event *event)
{
struct hw_perf_event *hwc = &event->hw;
struct hw_perf_event_extra *reg1 = &hwc->extra_reg;
struct hw_perf_event_extra *reg2 = &hwc->branch_reg;
int idx, port;
idx = reg1->idx;
port = idx / 6 + box->pmu->pmu_idx * 4;
switch (... | false | false | false | false | false | 0 |
gth_catalog_update_standard_attributes (GFile *file,
GFileInfo *info)
{
char *display_name = NULL;
char *edit_name = NULL;
char *basename;
basename = g_file_get_basename (file);
if ((basename != NULL) && (strcmp (basename, "/") != 0)) {
char *name;
GthDateTime *date_time;
name = NULL... | true | true | true | false | false | 1 |
isdn_ppp_init(void)
{
int i,
j;
#ifdef CONFIG_ISDN_MPP
if (isdn_ppp_mp_bundle_array_init() < 0)
return -ENOMEM;
#endif /* CONFIG_ISDN_MPP */
for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
if (!(ippp_table[i] = kzalloc(sizeof(struct ippp_struct), GFP_KERNEL))) {
printk(KERN_WARNING "isdn_ppp_init: Could not all... | false | false | false | false | false | 0 |
cache_init(git_pack_cache *cache)
{
memset(cache, 0, sizeof(git_pack_cache));
cache->entries = git_offmap_alloc();
GITERR_CHECK_ALLOC(cache->entries);
cache->memory_limit = GIT_PACK_CACHE_MEMORY_LIMIT;
git_mutex_init(&cache->lock);
return 0;
} | false | false | false | false | false | 0 |
decode_irq_flags(struct pnp_dev *dev, int flags, u8 *triggering,
u8 *polarity, u8 *shareable)
{
switch (flags & (IORESOURCE_IRQ_LOWLEVEL | IORESOURCE_IRQ_HIGHLEVEL |
IORESOURCE_IRQ_LOWEDGE | IORESOURCE_IRQ_HIGHEDGE)) {
case IORESOURCE_IRQ_LOWLEVEL:
*triggering = ACPI_LEVEL_SENSITIVE;
*polarity = ACPI... | false | false | false | false | false | 0 |
turn_tcp_connect(int verbose, app_ur_conn_info *clnet_info, ioa_addr *peer_addr) {
{
int cp_sent = 0;
stun_buffer message;
stun_init_request(STUN_METHOD_CONNECT, &message);
stun_attr_add_addr(&message, STUN_ATTRIBUTE_XOR_PEER_ADDRESS, peer_addr);
if(add_integrity(clnet_info, &message)<0) return -1;
st... | false | false | false | false | false | 0 |
id_to_url(const GUTF8String & id) const
{
check();
DEBUG_MSG("DjVuDocument::id_to_url(): translating ID='" << id << "' to URL\n");
DEBUG_MAKE_INDENT(3);
if (flags & DOC_TYPE_KNOWN)
switch(doc_type)
{
case BUNDLED:
if (flags & DOC_DIR_KNOWN)
{
GP<DjVmDir::File> file=djvm_dir->... | false | false | false | false | false | 0 |
memory_module_register(char *name,
void (*setup)(struct _memory_segment *s))
{
if(memory_module_count == memory_module_count_max) {
memory_module_count_max += 4;
memory_module = realloc(memory_module,
sizeof(struct _memory_module) *
memory_module_count_max);
}
memory_module[memory_module_count].na... | false | false | false | false | false | 0 |
evaluate(AttributeValue* arg0, AttributeValue* arg1, bool check_id){
//TODO
return new BooleanAttribute(arg0->equal(arg1, check_id));
} | false | false | false | false | false | 0 |
dvb_fe_get_event(struct dvb_v5_fe_parms *parms)
{
struct dvb_frontend_event event;
fe_status_t status;
int i;
if (!parms->legacy_fe) {
dvb_fe_get_parms(parms);
return dvb_fe_get_stats(parms);
}
if (ioctl(parms->fd, FE_GET_EVENT, &event) == -1) {
dvb_perror("FE_GET_EVENT");
return -1;
}
status = event.... | false | false | false | false | false | 0 |
DecodeSpecial3LlSc(MCInst &Inst,
unsigned Insn,
uint64_t Address,
const void *Decoder) {
int64_t Offset = SignExtend64<9>((Insn >> 7) & 0x1ff);
unsigned Rt = fieldFromInstruction(Insn, 16, 5);
unsi... | false | false | false | false | false | 0 |
png_read_update_info(png_structrp png_ptr, png_inforp info_ptr)
{
png_debug(1, "in png_read_update_info");
if (png_ptr != NULL)
{
if ((png_ptr->flags & PNG_FLAG_ROW_INIT) == 0)
{
png_read_start_row(png_ptr);
# ifdef PNG_READ_TRANSFORMS_SUPPORTED
png_read_transform_info... | false | false | false | false | false | 0 |
xhci_mvebu_mbus_config(void __iomem *base,
const struct mbus_dram_target_info *dram)
{
int win;
/* Clear all existing windows */
for (win = 0; win < USB3_MAX_WINDOWS; win++) {
writel(0, base + USB3_WIN_CTRL(win));
writel(0, base + USB3_WIN_BASE(win));
}
/* Program each DRAM CS in a seperate window */
for... | false | false | false | false | false | 0 |
find_charset_encoding(Octstr *document)
{
long gt = 0, enc = 0;
Octstr *encoding = NULL, *temp = NULL;
enc = octstr_search(document, octstr_imm(" encoding="), 0);
gt = octstr_search(document, octstr_imm("?>"), 0);
/* in case there is no encoding argument, assume always UTF-8 */
if (enc < 0 || ... | false | false | false | false | false | 0 |
set_spell_language_cb (GeditSpellChecker *spell,
const GeditSpellCheckerLanguage *lang,
GeditDocument *doc)
{
const gchar *key;
g_return_if_fail (GEDIT_IS_DOCUMENT (doc));
g_return_if_fail (lang != NULL);
key = gedit_spell_checker_language_to_key (lang);
g_return_if_fail (key != NULL);
... | false | false | false | false | false | 0 |
_delete_node (struct Node* node, int raw) {
struct Node* start = node->firstchild;
struct Node* curr = (struct Node *) NULL;
/* if deletion is raw then don't bother maintaining
the prev/next sibling relationships as these nodes
will anyway be deleted later. (i.e. part of a
larger rec... | false | false | false | false | false | 0 |
row_sel_fetch_columns(
/*==================*/
dict_index_t* index, /*!< in: record index */
const rec_t* rec, /*!< in: record in a clustered or non-clustered
index; must be protected by a page latch */
const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */
sym_node_t* column) /*!< in: first column in a co... | false | false | false | false | false | 0 |
set_block_cb (GDBusProxy *proxy,
GAsyncResult *res,
gpointer user_data)
{
GVariant *retval;
gboolean status;
GError *error = NULL;
retval = g_dbus_proxy_call_finish (proxy, res, &error);
if (retval)
g_variant_get (retval, "(b)", &status);
if (error) {
g_warning ("Failed to ... | false | false | false | false | false | 0 |
menuitem_currentsong (void) {
song * s;
GtkWidget * dialog;
gchar * msg;
if (gjay->player_get_current_song==NULL)
{
if (gjay->prefs->music_player == PLAYER_NONE)
gjay_error_dialog(_("Cannot get current song with no player selected."));
else {
msg = g_strdup_printf(_("Don't know how to ge... | false | false | false | false | false | 0 |
compare(const Jid &a, bool compareRes) const
{
if(null && a.null)
return true;
// only compare valid jids
if(!valid || !a.valid)
return false;
if(compareRes ? (f != a.f) : (b != a.b))
return false;
return true;
} | false | false | false | false | false | 0 |
gen_scheduled_generic_parms_dies (void)
{
unsigned i;
tree t;
if (generic_type_instances == NULL)
return;
FOR_EACH_VEC_ELT (tree, generic_type_instances, i, t)
gen_generic_params_dies (t);
} | false | false | false | false | false | 0 |
EvalStatus(char *szOutput)
{
int i;
*szOutput = 0;
for (i = N_CLASSES - 1; i >= 0; i--)
if (acsf[i])
acsf[i] (strchr(szOutput, 0));
} | 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.