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 |
|---|---|---|---|---|---|---|
cmor_get_variable_time_length(int *var_id, int *length) {
cmor_var_t avar;
int i;
*length=0;
avar = cmor_vars[*var_id];
for (i=0;i<avar.ndims;i++) {
if (cmor_axes[avar.original_order[i]].axis=='T') *length=cmor_axes[avar.original_order[i]].length;
}
/* if (*length == -1) { */
/* snprintf(msg,CMO... | false | false | false | false | false | 0 |
H5E_get_auto(const H5E_t *estack, H5E_auto_op_t *op, void **client_data)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
HDassert(estack);
/* Retrieve the requested information */
if(op)
*op = estack->auto_op;
if(client_data)
*client_data = estack->auto_data;
FUNC_LEAVE_NOAPI(SUCCEED)
} | false | false | false | false | false | 0 |
chkNoInstantClass( void )
{
CLASS *class = ClassList;
while( class != NULL ){
if( !class->branch ) return( class->name );
class = class->next;
}
return( NULL );
} | false | false | false | false | false | 0 |
voice_dial(struct audio_device *device, const char *buf)
{
gboolean enable;
if (strlen(buf) < 9)
return -EINVAL;
if (buf[8] == '0')
enable = FALSE;
else
enable = TRUE;
telephony_voice_dial_req(device, enable);
return 0;
} | false | false | false | false | false | 0 |
print_express(node,c)
struct expnode *node; /* expression tree */
int c; /* character for parameters */
{
if ( !strstart ) /* for first time thru */
{ strsize = 200;
strstart = my_list_calloc(1,strsize,ETERNAL_BLOCK);
}
else strstart[0] = '\0';
linestart = pos = strstart;
vch = (char)c;
... | false | false | false | false | false | 0 |
delim_from_arg (const char *s)
{
int i;
for (i=0; csv_delim_args[i] != NULL; i++) {
if (!strcmp(s, csv_delim_args[i])) {
return csv_delims[i];
}
}
return 0;
} | false | false | false | false | false | 0 |
scc_maybe_rx_int(int port, double dcycs)
{
Scc *scc_ptr;
int depth;
int rx_int_mode;
scc_ptr = &(scc_stat[port]);
depth = scc_ptr->rx_queue_depth;
if(depth <= 0) {
/* no more chars, just get out */
scc_clr_rx_int(port);
return;
}
rx_int_mode = (scc_ptr->reg[1] >> 3) & 0x3;
if(rx_int_mode == 1 || rx_int... | false | false | false | false | false | 0 |
dowrite(unsigned offset, unsigned size)
{
ssize_t ret;
off_t newsize;
offset -= offset % writebdy;
if (o_direct)
size -= size % writebdy;
if (size == 0) {
if (!quiet && testcalls > simulatedopcount && !o_direct)
prt("skipping zero size write\n");
log4(OP_SKIPPED, OP_WRITE, offset, size);
return;
}
l... | false | false | false | false | false | 0 |
nand_bch_free(struct nand_bch_control *nbc)
{
if (nbc) {
free_bch(nbc->bch);
kfree(nbc->errloc);
kfree(nbc->eccmask);
kfree(nbc);
}
} | false | false | false | false | false | 0 |
unpark_waiters_on(Capability *cap, StgTVar *s) {
StgTVarWatchQueue *q;
StgTVarWatchQueue *trail;
TRACE("unpark_waiters_on tvar=%p", s);
// unblock TSOs in reverse order, to be a bit fairer (#2319)
for (q = s -> first_watch_queue_entry, trail = q;
q != END_STM_WATCH_QUEUE;
q = q -> next_queue_ent... | false | false | false | false | false | 0 |
find_std_name(const struct std_name *arrPtr,
unsigned int arrSize,
const char *bufPtr,
unsigned int bufSize)
{
unsigned int idx;
const struct std_name *p;
for (idx = 0; idx < arrSize; idx++) {
p = arrPtr + idx;
if (strlen(p->name) != bufSize) continue;
if (!memcmp(bufPtr,p->name,bufS... | false | false | false | false | false | 0 |
Gen_to_Dmatrix(Gen_node g){
Dmatrix Res;
Gmatrix M;
int i,j;
M=Gen_Mtx(g);
Res=Dmatrix_new(GMrows(M),GMcols(M));
for(i=1;i<=GMrows(M);i++)
for(j=1;j<=GMcols(M);j++)
DMref(Res,i,j)=Gen_To_Dbl(*GMref(M,i,j));
return Res;
} | false | false | false | false | false | 0 |
insert FUNCTION((s, x, start, length), char *s AND int x AND int start AND int length)
{
unsigned char cl;
unsigned char cc;
unsigned char cr;
UINT4 y;
int shift;
shift = ((8 - ((start + length) % 8)) % 8);
y = (long) x << shift;
cl = (y >> 16) & 0xff;
cc = (y >> 8) & 0xff;
cr = y & 0xff;
if (shi... | false | false | false | false | false | 0 |
new_frame(Fm_mem_src *src, char *name, unsigned int flags)
{
Frame *f;
f = (Frame *) MALLOC(sizeof(Frame));
if (f == NULL) {
frame_errmsg = "malloc failed";
return(NULL);
}
if (name == NULL || *name == '\0')
f->name = NULL;
else
f->name = xstrdup(name);
if (src == NULL) {
static Fm_mem_src defa... | false | false | false | false | false | 0 |
wi_mutable_string_expand_tilde_in_path(wi_mutable_string_t *path) {
wi_array_t *array;
wi_string_t *component, *string;
struct passwd *user;
wi_uinteger_t length;
WI_RUNTIME_ASSERT_MUTABLE(path);
if(!wi_string_has_prefix(path, WI_STR("~")))
return;
array = wi_string_path_components(path);
component = ... | false | false | false | false | false | 0 |
widget_text_update(void *Self)
{
WIDGET *W = (WIDGET *) Self;
WIDGET_TEXT *T = W->data;
char *string;
int update = 0;
/* evaluate properties */
update += property_eval(&T->prefix);
update += property_eval(&T->postfix);
update += property_eval(&T->style);
/* evaluate value */
pr... | false | false | false | false | true | 1 |
get_record_instance(const glsl_struct_field *fields,
unsigned num_fields,
const char *name)
{
const glsl_type key(fields, num_fields, name);
if (record_types == NULL) {
record_types = hash_table_ctor(64, record_key_hash, record_key_compare);
}
const glsl_type *t = (glsl_type *) h... | false | false | false | false | false | 0 |
i2c_dw_isr(int this_irq, void *dev_id)
{
struct dw_i2c_dev *dev = dev_id;
u32 stat, enabled;
enabled = dw_readl(dev, DW_IC_ENABLE);
stat = dw_readl(dev, DW_IC_RAW_INTR_STAT);
dev_dbg(dev->dev, "%s: enabled=%#x stat=%#x\n", __func__, enabled, stat);
if (!enabled || !(stat & ~DW_IC_INTR_ACTIVITY))
return IRQ_NON... | false | false | false | false | false | 0 |
reallocate() {
Canvas* c = canvas_;
if (c != nil) {
/* remove these two lines when doc otherwise works */
Requisition s;
request(s);
c->push_transform();
c->transformer(transformer_);
extension_.clear();
allocate(c, allocation_, extension_);
c->pop_transform();
}
} | false | false | false | false | false | 0 |
ManagerCallback()
{
m_Mutex.Lock();
if ( CConfig::Instance() )
{
if ( m_pListen )
{
if ( CConfig::Instance()->GetMode(true) == ecmACTIVE )
{
if ( m_pListen->IsConnect() == -1 )
{
StartListen();
}
if ( m_bCrypto )
{
if ( CConfig::Instance()->GetCryptoListenPort() != m_nLi... | false | false | false | false | false | 0 |
pkix_pl_LdapDefaultClient_RecvNonInitial(
PKIX_PL_LdapDefaultClient *client,
PKIX_Boolean *pKeepGoing,
void *plContext)
{
PKIX_UInt32 bytesProcessed = 0;
PKIX_ENTER
(LDAPDEFAULTCLIENT, "pkix_pl_LdapDefaultClient_RecvNonInitial");
PKIX_NULLCHECK_TWO(clien... | false | false | false | false | false | 0 |
fbcon_softback_note(struct vc_data *vc, int t,
int count)
{
unsigned short *p;
if (vc->vc_num != fg_console)
return;
p = (unsigned short *) (vc->vc_origin + t * vc->vc_size_row);
while (count) {
scr_memcpyw((u16 *) softback_in, p, vc->vc_size_row);
count--;
p = advance_row(p, 1);
softback_in ... | false | false | false | false | false | 0 |
lua_setuservalue (lua_State *L, int idx) {
StkId o;
lua_lock(L);
api_checknelems(L, 1);
o = index2addr(L, idx);
api_check(ttisfulluserdata(o), "full userdata expected");
setuservalue(L, uvalue(o), L->top - 1);
luaC_barrier(L, gcvalue(o), L->top - 1);
L->top--;
lua_unlock(L);
} | false | false | false | false | false | 0 |
setProfile(xmlNode *profile)
{
this->unsetProfile();
if(profile != NULL)
{
/*
xmlNodePtr node;
node = xmlNewNode(NULL, (xmlChar*)"profile");
node = xmlDocCopyNode(node, doc, 1);
xmlAddChild(doc->children, node);
xmlNodeSetContent(node, (xmlChar*)get_content(profile));
cout << "profile "
... | false | false | false | false | false | 0 |
dsvec_init_size(Dsvec *odsv, size_t size, int n)
{
Dsvec *dsv;
dsvec_errmsg = NULL;
if (odsv == NULL) {
if ((dsv = new_dsvec(size)) == NULL)
return(NULL);
}
else {
dsv = odsv;
dsv->alloc_flag = 0;
set_default_dsvec(dsv, size);
}
if ((dsv->ptr = (void **) dsv->malloc(n * size)) == NULL) {
dsvec_e... | false | false | false | false | false | 0 |
load_dict(const char* path, struct stat* oldstat,
dict* dictp, void (*free_fn)(void*),
int (*load_fn)(void))
{
struct stat s;
switch (stat_changed(path, oldstat, &s)) {
case -1:
if (errno != ENOENT)
return 0;
oldstat->st_mtime = 0;
oldstat->st_ino = 0;
oldstat->st_size = 0;
... | false | false | false | false | false | 0 |
_extract_parameter(char *param, char *buffer, int buffer_size)
{
/*
* if we start with a quote then we must end with a quote
* otherwise we end with a space
*/
if (*param == '\"') {
int cnt = 0;
param += 1;
for (cnt = 0; *param && *param != '\"' && cnt < buffer_size - 1;
cnt++, param++) {
buffer[c... | false | false | false | false | false | 0 |
egg_list_box_update_active (EggListBox *list_box, EggListBoxChildInfo *child)
{
EggListBoxPrivate *priv = list_box->priv;
gboolean val;
val = priv->active_child == child;
if (priv->active_child != NULL &&
val != priv->active_child_active)
{
priv->active_child_active = val;
gtk_widget_queu... | false | false | false | false | false | 0 |
set_ftp_options_unlocked (GstCurlBaseSink * basesink)
{
GstCurlFtpSink *sink = GST_CURL_FTP_SINK (basesink);
curl_easy_setopt (basesink->curl, CURLOPT_UPLOAD, 1L);
if (sink->ftp_port_arg != NULL && (strlen (sink->ftp_port_arg) > 0)) {
/* Connect data stream actively. */
CURLcode res = curl_easy_setopt (... | false | false | false | false | false | 0 |
botaddr_tcl_set(Tcl_Interp * irp, struct userrec *u,
struct user_entry *e, int argc, char **argv)
{
register struct bot_addr *bi = (struct bot_addr *) e->u.extra;
BADARGS(4, 6, " handle type address ?telnetport ?relayport??");
if (u->flags & USER_BOT) {
/* Silently ignore for user... | false | false | false | false | false | 0 |
G_get_default_window(struct Cell_head *window)
{
char *err;
if ((err = G__get_window(window, "", "DEFAULT_WIND", "PERMANENT"))) {
G_fatal_error(_("default region %s"), err);
G_free(err);
}
return 1;
} | true | true | false | false | false | 1 |
_backup_adder_orc_volume_s32 (OrcExecutor * ORC_RESTRICT ex)
{
int i;
int n = ex->n;
orc_union32 * ORC_RESTRICT ptr0;
orc_union32 var33;
orc_union32 var34;
orc_union32 var35;
orc_union64 var36;
orc_union64 var37;
ptr0 = (orc_union32 *)ex->arrays[0];
/* 1: loadpl */
var34.i = ex->params[24];
... | false | false | false | false | false | 0 |
json_parse_string_with_comments(const char *string) {
JSON_Value *result = NULL;
char *string_mutable_copy = NULL, *string_mutable_copy_ptr = NULL;
string_mutable_copy = parson_strdup(string);
if (!string_mutable_copy)
return NULL;
remove_comments(string_mutable_copy, "/*", "*/");
remove... | false | false | false | false | false | 0 |
ecpg_dynamic_type(Oid type)
{
switch (type)
{
case BOOLOID:
return SQL3_BOOLEAN; /* bool */
case INT2OID:
return SQL3_SMALLINT; /* int2 */
case INT4OID:
return SQL3_INTEGER; /* int4 */
case TEXTOID:
return SQL3_CHARACTER; /* text */
case FLOAT4OID:
return SQL3_REAL; /* float4 */
case FLOA... | false | false | false | false | false | 0 |
create_new_item(item *env, sint32 tag) {
item *op;
if (!free_items) {
free_items = alloc_items(NROF_ITEMS);
}
op = free_items;
free_items = free_items->next;
if (free_items) {
free_items->prev = NULL;
}
op->tag = tag;
op->locked = 0;
if (env) {
add_item... | false | false | false | false | false | 0 |
delay_ok(int i, unsigned char alarm_result, char mors) {
int bit_position = 128;
int j = 7;
int ret = 0;
sprintf(temp_message_space, "delay_ok(): i: %d\talarm_result: %.2x\tmors: %c", i, alarm_result, mors);
log_message(4, temp_message_space);
if ((int)mors == 'm') {
while ( bit_position >= 1 ) {
if... | false | false | false | false | false | 0 |
itracku_device_dump_waypts(void* fd, void (*waypt_add)(waypoint* wpt))
{
itracku_data_record d;
dbg(1, "reading memory");
gbser_write(fd, read_update_data_command, sizeof(read_update_data_command));
itracku_device_update_data_init();
while (itracku_device_update_data_read(&d, sizeof(d))) {
if (itracku_... | false | false | false | false | false | 0 |
run()
{
#ifdef SIGPIPE
/* Don't die with SIGPIPE on remote read shutdown. That's dumb. */
signal( SIGPIPE, SIG_IGN );
#endif
int ret = 0;
int listenFD = -1;
ret = SP_IOUtils::tcpListen( mBindIP, mPort, &listenFD, 0 );
if( 0 == ret ) {
// Clean close on SIGINT or SIGTERM.
mEvSigInt = (struct event*)malloc( ... | false | false | false | false | false | 0 |
mono_test_marshal_ansi_char_array (char *s)
{
const char m[] = "abcdef";
if (strncmp ("qwer", s, 4))
return 1;
memcpy (s, m, sizeof (m));
return 0;
} | false | false | false | false | false | 0 |
get_cairo_pattern(const FillStyle& style, const SWFCxForm& cx)
{
StyleHandler st(cx);
cairo_pattern_t* pattern = boost::apply_visitor(st, style.fill);
return pattern;
} | false | false | false | false | false | 0 |
RomByte(b)
{ rom[Dot.value] = b;
if (Dot.value > MaxDotValue)
MaxDotValue = Dot.value;
if ((Dot.value += 1) >= romsize)
{
RomGrow();
}
} | false | false | false | false | false | 0 |
Open(LoaderBase* fileLdr, const wxString& filename, int pos,ProjectFile* data)
{
bool can_updateui = !GetActiveEditor() || !Manager::Get()->GetProjectManager()->IsLoading();
wxFileName fn(realpath(filename));
NormalizePath(fn, wxEmptyString);
wxString fname = UnixFilename(fn.GetFullPath());
// Mana... | false | false | false | false | false | 0 |
spl_ptr_llist_push(spl_ptr_llist *llist, void *data TSRMLS_DC) /* {{{ */
{
spl_ptr_llist_element *elem = emalloc(sizeof(spl_ptr_llist_element));
elem->data = data;
elem->rc = 1;
elem->prev = llist->tail;
elem->next = NULL;
if (llist->tail) {
llist->tail->next = elem;
} else {
llist->head = elem;
}
lli... | false | false | false | false | false | 0 |
multiplexer_repr (Multiplexer* self) {
gchar* result = NULL;
gchar _tmp0_ = '\0';
struct gsm0710_context* _tmp1_ = NULL;
gint _tmp2_ = 0;
gchar _tmp3_ = '\0';
struct gsm0710_context* _tmp4_ = NULL;
gint _tmp5_ = 0;
const gchar* _tmp6_ = NULL;
struct gsm0710_context* _tmp7_ = NULL;
gint _tmp8_ = 0;
gchar* _tm... | false | false | false | false | false | 0 |
stk1160_reg_reset(struct stk1160 *dev)
{
int i;
static const struct regval ctl[] = {
{STK1160_GCTRL+2, 0x0078},
{STK1160_RMCTL+1, 0x0000},
{STK1160_RMCTL+3, 0x0002},
{STK1160_PLLSO, 0x0010},
{STK1160_PLLSO+1, 0x0000},
{STK1160_PLLSO+2, 0x0014},
{STK1160_PLLSO+3, 0x000E},
{STK1160_PLLFD, 0x0046... | false | false | false | false | false | 0 |
reduce_tertiaries (NODE_T * p)
{
NODE_T *q;
BOOL_T siga;
for (q = p; q != NO_NODE; FORWARD (q)) {
reduce (q, NO_NOTE, NO_TICK, TERTIARY, NIHIL, STOP);
reduce (q, NO_NOTE, NO_TICK, FORMULA, MONADIC_FORMULA, STOP);
reduce (q, NO_NOTE, NO_TICK, TERTIARY, FORMULA, STOP);
reduce (q, NO_NOTE, NO_TICK, T... | false | false | false | false | false | 0 |
is_shadow(struct dm_transaction_manager *tm, dm_block_t b)
{
int r = 0;
unsigned bucket = dm_hash_block(b, DM_HASH_MASK);
struct shadow_info *si;
spin_lock(&tm->lock);
hlist_for_each_entry(si, tm->buckets + bucket, hlist)
if (si->where == b) {
r = 1;
break;
}
spin_unlock(&tm->lock);
return r;
} | false | false | false | false | false | 0 |
output (int unit, unsigned char *p, int len)
{
if (debug)
{
log_packet(p, len, "sent ", LOG_DEBUG);
}
if (write(ppp_fd, p, len) < 0)
{
if (errno == EWOULDBLOCK || errno == ENOBUFS
|| errno == ENXIO || errno == EIO || errno == EINTR)
{
syslog(LOG_WARNING, "write: wa... | false | false | false | false | false | 0 |
leavesAreNumConst(const Expr& e)
{
DebugAssert(e.isTerm() ||
(e.isPropAtom() && theoryOf(e) == this),
"Expected term or arith prop atom");
if (e.validTerminalsConstFlag()) {
return e.getTerminalsConstFlag();
}
if (e.isRational()) {
e.setTerminalsConstFlag(true);
return ... | false | false | false | false | false | 0 |
radeon_irq_kms_pflip_irq_put(struct radeon_device *rdev, int crtc)
{
unsigned long irqflags;
if (crtc < 0 || crtc >= rdev->num_crtc)
return;
if (!rdev->ddev->irq_enabled)
return;
if (atomic_dec_and_test(&rdev->irq.pflip[crtc])) {
spin_lock_irqsave(&rdev->irq.lock, irqflags);
radeon_irq_set(rdev);
spin_... | false | false | false | false | false | 0 |
open_route_table (void)
{
char *path;
close_route_table();
path = path_to_procfs("/net/route");
route_fd = fopen (path, "r");
if (route_fd == NULL) {
error("can't open routing table %s: %m", path);
return 0;
}
route_dev_col = 0; /* default to usual columns */
route_dest_col = 1;
... | false | false | false | false | true | 1 |
sheet_find_boundary_horizontal (Sheet *sheet, int start_col, int move_row,
int base_row, int count,
gboolean jump_to_boundaries)
{
gboolean find_nonblank = sheet_is_cell_empty (sheet, start_col, move_row);
gboolean keep_looking = FALSE;
int new_col, prev_col, lagged_start_col, max_col = gnm_sheet_get_last_co... | false | false | false | false | false | 0 |
metadata_value_free(gpointer data)
{
struct metadata_value *value = data;
switch (value->type) {
case DBUS_TYPE_STRING:
g_free(value->value.str);
break;
}
g_free(value);
} | false | false | false | false | false | 0 |
of_pwm_xlate_with_flags(struct pwm_chip *pc, const struct of_phandle_args *args)
{
struct pwm_device *pwm;
if (pc->of_pwm_n_cells < 3)
return ERR_PTR(-EINVAL);
if (args->args[0] >= pc->npwm)
return ERR_PTR(-EINVAL);
pwm = pwm_request_from_chip(pc, args->args[0], NULL);
if (IS_ERR(pwm))
return pwm;
pwm_s... | false | false | false | false | false | 0 |
eel_accessibility_set_atk_object_return (gpointer object,
AtkObject *atk_object)
{
atk_object_initialize (atk_object, object);
if (!ATK_IS_GOBJECT_ACCESSIBLE (atk_object)) {
g_object_set_qdata_full
(object, get_quark_accessible (), atk_object,
(GDestroyNotify)eel_accessibility_destroy);
g_object_s... | false | false | false | false | false | 0 |
journal_init_revoke(journal_t *journal, int hash_size)
{
int shift, tmp;
J_ASSERT (journal->j_revoke == NULL);
journal->j_revoke = kmem_cache_alloc(revoke_table_cache, GFP_KERNEL);
if (!journal->j_revoke)
return -ENOMEM;
/* Check that the hash_size is a power of two */
J_ASSERT ((hash_size & (hash_size-1)) =... | false | true | false | false | false | 1 |
utilization_print(const lListElem *cr, const char *object_name)
{
lListElem *rde;
DENTER(TOP_LAYER, "utilization_print");
DPRINTF(("resource utilization: %s \"%s\" %f utilized now\n",
object_name?object_name:"<unknown_object>", lGetString(cr, RUE_name),
lGetDouble(cr, RUE_utilized_now)... | false | false | false | false | false | 0 |
sci_controller_isr(struct isci_host *ihost)
{
if (sci_controller_completion_queue_has_entries(ihost))
return true;
/* we have a spurious interrupt it could be that we have already
* emptied the completion queue from a previous interrupt
* FIXME: really!?
*/
writel(SMU_ISR_COMPLETION, &ihost->smu_registers->... | false | false | false | false | false | 0 |
pcifront_bus_read(struct pci_bus *bus, unsigned int devfn,
int where, int size, u32 *val)
{
int err = 0;
struct xen_pci_op op = {
.cmd = XEN_PCI_OP_conf_read,
.domain = pci_domain_nr(bus),
.bus = bus->number,
.devfn = devfn,
.offset = where,
.size = size,
};
struct pcifront_sd *sd = bus... | false | false | false | false | false | 0 |
pack_restart(int i, double *buf)
{
int m = 1;
buf[m++] = x[i][0];
buf[m++] = x[i][1];
buf[m++] = x[i][2];
buf[m++] = tag[i];
buf[m++] = type[i];
buf[m++] = mask[i];
buf[m] = 0.0; // for valgrind
*((tagint *) &buf[m++]) = image[i];
buf[m++] = v[i][0];
buf[m++] = v[i][1];
buf[m++] = v[i][2];
... | false | false | false | false | false | 0 |
paramGetPropertySet(OfxParamHandle param,
OfxPropertySetHandle *propHandle)
{
# ifdef OFX_DEBUG_PARAMETERS
std::cout << "OFX: paramGetPropertySet - " << param << ' ' << propHandle << " ...";
# endif
Param::Instance *paramInstance = reinterpret... | false | false | false | false | false | 0 |
PyFF_LayerArray_dealloc(PyFF_LayerArray *self) {
if ( self->sc!=NULL )
self->sc = NULL;
((PyObject *)self)->ob_type->tp_free((PyObject *) self);
} | false | false | false | false | false | 0 |
pi__dlg_preferences_construct_cb (GtkWidget *dialog,
GthBrowser *browser,
GtkBuilder *dialog_builder)
{
PreferencesData *data;
GtkWidget *general_vbox;
GtkWidget *importer_options;
GtkWidget *widget;
data = g_new0 (PreferencesData, 1);
data->builder = _gtk_builder_new_from_file("ph... | false | false | false | false | false | 0 |
atk_object_real_set_parent (AtkObject *object,
AtkObject *parent)
{
if (object->accessible_parent)
g_object_unref (object->accessible_parent);
object->accessible_parent = parent;
if (object->accessible_parent)
g_object_ref (object->accessible_parent);
} | false | false | false | false | false | 0 |
gregoriotex_fix_style(gregorio_character *first_character)
{
unsigned char possible_fixed_style= 0;
unsigned char state = 0;
/* states are:
- 0: we didn't meet any style yet, which means that if we encounter:
* a character -> we can return, nothing to do
* a style -> we go in state 1
... | false | false | false | false | false | 0 |
l2tp_packet_add_int64(struct l2tp_packet_t *pack, int id, int64_t val, int M)
{
struct l2tp_attr_t *attr = attr_alloc(id, M, pack->hide_avps);
if (!attr)
return -1;
if (attr->H) {
if (pack->last_RV == NULL)
if (l2tp_packet_add_random_vector(pack) < 0)
goto err;
val = htobe64(val);
if (encode_attr(pa... | false | false | false | false | false | 0 |
host_ip(char *str, unsigned char ip[4])
{
unsigned int in[4];
int i;
if (sscanf(str,"%u.%u.%u.%u",&(in[0]),&(in[1]),&(in[2]),&(in[3])) == 4)
{
for (i=0; i<4; i++)
if (in[i] > 255)
{
BIO_printf(bio_err,"invalid IP address\n");
goto err;
}
ip[0]=in[0];
ip[1]=in[1];
ip[2]=in[2];
ip[3]=... | true | true | false | false | false | 1 |
rd_ghost(u32b version)
{
char buf[64];
/* Only if the player's alive */
if (p_ptr->is_dead)
return 0;
/* XXX */
/* Strip name */
rd_string(buf, 64);
/* Strip old data */
strip_bytes(60);
return 0;
} | true | true | false | false | false | 1 |
qmonQCUReadPreferences(void)
{
static bool preferences_set = false;
DENTER(GUI_LAYER, "qmonQCUReadPreferences");
if (!preferences_set) {
const char *qfs;
queue_filter_resources = lCopyList("", lGetList(qmonGetPreferences(),
PREF_queue_filter_resources));... | false | true | false | false | false | 1 |
gda_tree_mgr_select_new (GdaConnection *cnc, GdaStatement *stmt, GdaSet *params)
{
g_return_val_if_fail (GDA_IS_CONNECTION (cnc), NULL);
g_return_val_if_fail (GDA_IS_STATEMENT (stmt), NULL);
g_return_val_if_fail (gda_statement_get_statement_type (stmt) == GDA_SQL_STATEMENT_SELECT, NULL);
g_return_val_if_fail (!para... | false | false | false | false | false | 0 |
print(std::ostream &os) const {
IOInterface::print(os);
std::list<num_addr_pair_t>::const_iterator gmember_iter;
os << "* Group members:" << std::endl;
for(gmember_iter = groupmember_list.begin(); gmember_iter != groupmember_list.end(); ++gmember_iter) {
os << "\t" << inet_ntoa(gmember_iter->first) << " " << gme... | false | false | false | false | false | 0 |
gen_atmtype_abbrev(type)
int type;
{
struct block *b0, *b1;
switch (type) {
case A_METAC:
/* Get all packets in Meta signalling Circuit */
if (!is_atm)
bpf_error("'metac' supported only on raw ATM");
b0 = gen_atmfield_code(A_VPI, 0, BPF_JEQ, 0);
b1 = gen_atmfield_code(A_VCI, 1, BPF_JEQ, 0);
gen_and(b... | false | false | false | false | false | 0 |
_getOKButtonText() const
{
const XAP_StringSet * pSS = m_pApp->getStringSet();
UT_return_val_if_fail(pSS, NULL);
switch(getDialogId())
{
case XAP_DIALOG_ID_LISTDOCUMENTS:
return pSS->getValue(XAP_STRING_ID_DLG_Select);
case XAP_DIALOG_ID_COMPAREDOCUMENTS:
return pSS->getValue(XAP_STRING_ID_DLG_Co... | false | false | false | false | false | 0 |
__vxge_hw_device_vpath_reset_in_prog_check(u64 __iomem *vpath_rst_in_prog)
{
enum vxge_hw_status status;
vxge_trace();
status = __vxge_hw_device_register_poll(vpath_rst_in_prog,
VXGE_HW_VPATH_RST_IN_PROG_VPATH_RST_IN_PROG(0x1ffff),
VXGE_HW_DEF_DEVICE_POLL_MILLIS);
return status;
} | false | false | false | false | false | 0 |
squat_scan(SquatSearchIndex* index, char first_char,
SquatScanCallback handler, void* closure)
{
char buf[SQUAT_WORD_SIZE+1];
const char *s;
int r = squat_find_branch(&s, NULL,
index->word_list, index->data_end, first_char);
if (r != SQUAT_OK)
return(r);
if (!s)... | true | true | false | false | false | 1 |
CopyDesiredColours() {
if (!data || !codes || !colours || !lines) {
return;
}
for (int i=0; i<nColours; i++) {
colours[i].Copy();
}
} | false | false | false | false | false | 0 |
FromTree(const TreeValue* v)
{
const TreeCompound* src = TreeValueCast<TreeCompound> (v);
if (src)
{
// copy all items named in our current map
for (std::vector<MapCompoundElement*>::iterator i( refmap.begin() ); i != refmap.end(); i++)
{
const TreeValue* srcvalue = src->Get((*i)->Name());
... | false | false | false | false | false | 0 |
isNonConstantNegative(const SCEV *F) {
const SCEVMulExpr *Mul = dyn_cast<SCEVMulExpr>(F);
if (!Mul) return false;
// If there is a constant factor, it will be first.
const SCEVConstant *SC = dyn_cast<SCEVConstant>(Mul->getOperand(0));
if (!SC) return false;
// Return true if the value is negative, this ma... | false | false | false | false | false | 0 |
efx_rx_config_page_split(struct efx_nic *efx)
{
efx->rx_page_buf_step = ALIGN(efx->rx_dma_len + efx->rx_ip_align,
EFX_RX_BUF_ALIGNMENT);
efx->rx_bufs_per_page = efx->rx_buffer_order ? 1 :
((PAGE_SIZE - sizeof(struct efx_rx_page_state)) /
efx->rx_page_buf_step);
efx->rx_buffer_truesize = (PAGE_SIZE << ... | false | false | false | false | false | 0 |
square_expose(XEvent *event)
/* handle an expose event in a square */
{
int rv = 0;
struct jester_data *jd = NULL;
XFindContext(display, event->xexpose.window, jester_context,
(XPointer *)&jd);
if(pieces[jd->coords.x][jd->coords.y] == EMPTY)
goto DONE;
draw_piece(pieces[jd->coords.x][jd->c... | false | false | false | false | false | 0 |
cwd(std::string& name) {
std::string new_dir;
if(name[0] != '/') { new_dir=cur_dir+'/'+name; }
else { new_dir=name; };
error=FileNode::no_error;
if(Arc::CanonicalDir(new_dir,false)) {
if(new_dir.length() == 0) { /* always can go to root ? */
cur_dir=new_dir;
name=cur_dir;
return 0;
}... | false | false | false | false | false | 0 |
compute_virtual_size_for_configuration (GnomeRRConfig *config, int *ret_width, int *ret_height)
{
int i;
int width, height;
int output_x, output_y, output_width, output_height;
GnomeRROutputInfo **outputs;
width = height = 0;
outputs = gnome_rr_config_get_outputs (config);
for (i = 0; outputs[i] != NULL... | false | false | false | false | false | 0 |
updateConstants()
{
int i,ni;
/* Links */
for(i=0,ni=m_links.size();i<ni;++i)
{
Link& l=m_links[i];
Material& m=*l.m_material;
l.m_rl = (l.m_n[0]->m_x-l.m_n[1]->m_x).length();
l.m_c0 = (l.m_n[0]->m_im+l.m_n[1]->m_im)/m.m_kLST;
l.m_c1 = l.m_rl*l.m_rl;
}
/* Faces */
for(i=0,ni=m_faces.size();i<ni;+... | false | false | false | false | false | 0 |
lto_fixup_types (tree t)
{
switch (TREE_CODE (t))
{
case IDENTIFIER_NODE:
break;
case TREE_LIST:
LTO_FIXUP_TREE (TREE_VALUE (t));
LTO_FIXUP_TREE (TREE_PURPOSE (t));
LTO_FIXUP_TREE (TREE_CHAIN (t));
break;
case FIELD_DECL:
lto_ft_field_decl (t);
break;
c... | false | false | false | false | false | 0 |
scc_maybe_rx_event(int port, double dcycs)
{
Scc *scc_ptr;
double rx_dcycs;
int in_rdptr, in_wrptr;
int depth;
scc_ptr = &(scc_stat[port]);
if(scc_ptr->rx_event_pending) {
/* one pending already, wait for the event to arrive */
return;
}
in_rdptr = scc_ptr->in_rdptr;
in_wrptr = scc_ptr->in_wrptr;
depth... | false | false | false | false | false | 0 |
FuncADD_ROW_VECTOR_5( Obj self,
Obj list1,
Obj list2,
Obj mult,
Obj from,
Obj to )
{
UInt i;
Obj el1,el2;
while (!IS_INTOBJ(to) ||
INT_INTOBJ(to) > LEN_LIST(list1) ||
... | false | false | false | false | false | 0 |
make_radio(GtkWidget *label, gchar **items)
{
GtkWidget *box, *button;
//GSList *group;
guint i;
box = gtk_vbox_new (FALSE, 0);
button = gtk_radio_button_new_with_label (NULL, _(items[0]));
gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 0);
for (i = 1; items[i] != NULL; i++)
{
button = gtk_radi... | false | false | false | false | false | 0 |
db_object_bytes(Objid oid)
{
Object *o = objects[oid];
int i, len, count;
Verbdef *v;
count = sizeof(Object) + sizeof(Object *);
count += memo_strlen(o->name) + 1;
for (v = o->verbdefs; v; v = v->next) {
count += sizeof(Verbdef);
count += memo_strlen(v->name) + 1;
if (v->program)
count... | false | false | false | false | false | 0 |
check_duplicate_property_names(struct check *c, struct node *dt,
struct node *node)
{
struct property *prop, *prop2;
for_each_property(node, prop) {
for (prop2 = prop->next; prop2; prop2 = prop2->next) {
if (prop2->deleted)
continue;
if (streq(prop->name, prop2->name))
FAIL(c, "Duplicate prop... | false | false | false | false | false | 0 |
replybody(struct rfc2045_mkreplyinfo *ri, struct rfc2045 *rfc)
{
rfc=rfc2045_searchcontenttype(rfc, "text/plain");
if (!rfc)
return;
reformat(ri, rfc, 1);
} | false | false | false | false | false | 0 |
_nc_Calculate_Item_Length_and_Width(MENU * menu)
{
int l;
assert(menu);
menu->height = 1 + menu->spc_rows * (menu->arows - 1);
l = calculate_actual_width(menu, TRUE);
l += menu->marklen;
if ((menu->opt & O_SHOWDESC) && (menu->desclen > 0))
{
l += calculate_actual_width(menu, FALSE);
l +=... | false | false | false | false | false | 0 |
parseFile() {
//
// at the top level, the scene can have a camera,
// background color and a group of objects
// (we add lights and other things in future assignments)
//
char token[MAX_PARSER_TOKEN_LENGTH];
while (getToken(token)) {
if (!strcmp(token, "PerspectiveCamera"))... | false | false | false | false | true | 1 |
merge_frames(char *shapefile, char** framefiles, int numframefiles)
{
FILE *shpfile, *framefile;
int i;
bool tiles = false;
int file_size, shape_size, hdr_size, frame_size;
int total_size;
uint8 *data;
shpfile = fopen(shapefile, "wb");
total_size = 4 + 4*numframefiles;
for (i=0; i<numframefiles; i++) {
fr... | false | false | false | false | true | 1 |
functable_evaluate (Functable * t, double x)
{
int i;
double f0, f1, w0, w1;
double x2, x3;
double w;
if (x < t->offset || x > (t->offset + t->length * t->multiplier)) {
RESAMPLE_DEBUG ("x out of range %g", x);
}
x -= t->offset;
x *= t->inv_multiplier;
i = floor (x);
x -= i;
x2 = x * x;
x... | false | false | false | false | false | 0 |
command_find(mowgli_patricia_t *commandtree, const char *command)
{
return_val_if_fail(commandtree != NULL, NULL);
return_val_if_fail(command != NULL, NULL);
return mowgli_patricia_retrieve(commandtree, command);
} | false | false | false | false | false | 0 |
clausify_formula(Formula f)
{
Formula g;
Plist clauses, p;
g = clausify_prepare(formula_copy(f));
clauses = formula_to_clauses(g);
for (p = clauses; p; p = p->next) {
Topform c = p->v;
renumber_variables(c, MAX_VARS);
}
zap_formula(g);
return clauses;
} | false | false | false | false | false | 0 |
check_connect_status (int f)
{
socklen_t len;
int err;
len = sizeof (err);
if (getsockopt (f, SOL_SOCKET, SO_ERROR, SOCKOPTCAST & err, &len) != 0)
{
nlogerr ("check_connect_status", "getsockopt");
return -1;
}
if (err != 0)
{
_logerr ("check_connect_status", "connect", err);
re... | false | false | false | false | false | 0 |
expand_path_option(curdir, gap)
char_u *curdir;
garray_T *gap;
{
char_u *path_option = *curbuf->b_p_path == NUL
? p_path : curbuf->b_p_path;
char_u *buf;
char_u *p;
int len;
if ((buf = alloc((int)MAXPATHL)) == NULL)
return;
while (*path_option != NUL)
{
copy_option_part(... | false | false | false | false | false | 0 |
dsvec_strneq(Dsvec *dsv1, Dsvec *dsv2, size_t len)
{
unsigned int i;
if (dsvec_len(dsv1) < len || dsvec_len(dsv2) < len)
return(0);
for (i = 0; i < len; i++) {
char *p, *q;
p = (char *) dsvec_ptr_index(dsv1, i);
q = (char *) dsvec_ptr_index(dsv2, i);
if (!streq(p, q))
return(0);
}
return(1);
} | false | false | false | false | false | 0 |
file_cache_deinit(struct file_cache *cache)
{
if (cache == NULL)
{
return;
}
file_cache_fflush(cache);
mem_cache_deinit(&cache->read_cache);
mem_cache_deinit(&cache->write_cache);
close(cache->fd);
} | 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.