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 |
|---|---|---|---|---|---|---|
parsenumber(struct compiling *c, const char *s)
{
const char *end;
long x;
double dx;
Py_complex compl;
int imflag;
assert(s != NULL);
errno = 0;
end = s + strlen(s) - 1;
imflag = *end == 'j' || *end == 'J';
if (s[0] == '0') {
x = (long) PyOS_strtoul((char *)s, (char **)... | false | false | false | false | false | 0 |
SkipNextWord()
{
while (isspace(*ptr)) ++ptr;
while (!isspace(*ptr)) ++ptr;
while (isspace(*ptr)) ++ptr;
return true;
} | false | false | false | false | false | 0 |
gwy_debug_objects_creation_detailed(GObject *object,
const gchar *details)
{
DebugObjectInfo *info;
if (!G_UNLIKELY(debug_objects_enabled))
return;
if (!id) {
g_assert(!debug_objects_timer && !debug_objects);
debug_objects_timer = g_timer_new();
... | false | false | false | false | false | 0 |
not(uint32_t args) {
ONE_ARG(arg);
if (arg == C_FALSE) return C_TRUE;
else return C_FALSE;
} | false | false | false | false | false | 0 |
setWindowSize(size_t newSize)
{
delete[] m_prevMag;
m_windowSize = newSize;
m_prevMag = new float[m_windowSize/2 + 1];
reset();
} | false | false | false | false | false | 0 |
get_result (char *buf, RcvMsg * rmsg)
{
enum ck_msg_type type;
CheckMsg msg;
int n;
n = upack (buf, &msg, &type);
if (n == -1)
eprintf ("Error in call to upack", __FILE__, __LINE__ - 2);
if (type == CK_MSG_CTX) {
CtxMsg *cmsg = (CtxMsg *) & msg;
rcvmsg_update_ctx (rmsg, cmsg->ctx);
} else if... | false | true | false | false | false | 1 |
SITEsetlist(patlist, subbed, poison, poisonEntry)
char **patlist;
char *subbed;
char *poison;
BOOL *poisonEntry;
{
register char *pat;
register char *p;
register char *u;
register char subvalue;
register char poisonvalue;
register NEWSGROUP *ngp;
register int i;
whil... | false | false | false | false | false | 0 |
recv(int sock, struct packet_header *p, struct inet_address *from)
{
int s;
int r;
UDPpacket u;
s = sock - 1;
if (s < 0 || s >= MAX_UDP_SOCKETS || !udp_socket_list[s])
return 0;
u.channel = -1;
u.data = (Uint8 *)p;
u.maxlen = p->size;
r = SDLNet_UDP_Recv(udp_socket_list[s], &u);
if (r == -1)
{
MSG("C... | false | false | false | false | false | 0 |
historyRecall(history_ *r, double *data, int length)
{
ReturnErrIf(r == NULL);
ReturnErrIf(data == NULL);
ReturnErrIf(length != r->length);
memcpy(data, r->data, length*sizeof(double));
return 0;
} | false | false | false | false | false | 0 |
warn_if_date_trouble (WorkbookControl *wbc, GnmCellRegion *cr)
{
Workbook *wb = wb_control_get_workbook (wbc);
const GODateConventions *wb_date_conv = workbook_date_conv (wb);
if (cr->date_conv == NULL)
return;
if (go_date_conv_equal (cr->date_conv, wb_date_conv))
return;
/* We would like to show a warning, ... | false | false | false | false | false | 0 |
copy(int32_t start, int32_t limit, int32_t dest) {
if (limit <= start) {
return; // Nothing to do; avoid bogus malloc call
}
UChar* text = (UChar*) uprv_malloc( sizeof(UChar) * (limit - start) );
// Check to make sure text is not null.
if (text != NULL) {
extractBetween(start, limit, te... | false | false | false | false | false | 0 |
gsql_variable_class_init (GSQLVariableClass *klass)
{
GSQL_TRACE_FUNC;
GObjectClass *obj_class;
g_return_if_fail (klass != NULL);
obj_class = (GObjectClass *) klass;
parent_class = g_type_class_peek_parent (klass);
variable_signals [SIG_ON_FREE] =
g_signal_new ("on_free",
G_TYPE_FROM_CLASS (obj_... | false | false | false | false | false | 0 |
isABalanced(scapegoat *goat, btree* run, btree* parent, size_t *size){
size_t a = 0, b = 0;
a = *size;
//btree_info(run, NULL, NULL, NULL, NULL, &a, NULL, NULL);
//determine which child run->data is (avoid re-evaluating the lhs)
btree_info(btree_sibling(parent, run), NULL, NULL, NULL, NULL, &b, NULL, NULL);
//wpa... | false | false | false | false | false | 0 |
BraceSmartIndentEnabled()const
{
return Manager::Get()->GetConfigManager(_T("editor"))->ReadBool(_T("/brace_smart_indent"), true);
} | false | false | false | false | false | 0 |
add_job_report(u_long32 jobid, u_long32 jataskid, const char *petaskid, lListElem *jep)
{
lListElem *jr, *jatep = NULL;
DENTER(TOP_LAYER, "add_job_report");
if (jr_list == NULL)
jr_list = lCreateList("job report list", JR_Type);
if (jr_list == NULL || (jr=lCreateElem(JR_Type)) == NULL) {
... | false | false | false | false | false | 0 |
dfb_layer_context_set_src_colorkey( CoreLayerContext *context,
u8 r, u8 g, u8 b, int index )
{
DFBResult ret;
CoreLayerRegionConfig config;
D_ASSERT( context != NULL );
D_DEBUG_AT( Core_Layers, "%s (%02x %02x %02x - %d)\n", __FUNCTION__, r, g, b, ind... | false | false | false | false | false | 0 |
makeconstdata(nc_type nctype)
{
Constant con = nullconstant;
consttype = nctype;
con.nctype = nctype;
con.lineno = lineno;
switch (nctype) {
case NC_CHAR: con.value.charv = char_val; break;
case NC_BYTE: con.value.int8v = byte_val; break;
case NC_SHORT: con.value.int16v = int16_val;... | false | true | false | false | false | 1 |
bfa_ioc_is_disabled(struct bfa_ioc_s *ioc)
{
return bfa_fsm_cmp_state(ioc, bfa_ioc_sm_disabling) ||
bfa_fsm_cmp_state(ioc, bfa_ioc_sm_disabled);
} | false | false | false | false | false | 0 |
fs_rtp_bin_error_downgrade_register (void)
{
static gsize initialization_value = 0;
if (g_once_init_enter (&initialization_value))
{
gsize setup_value = gst_element_register (NULL, "fsrtpbinerrordowngrade",
GST_RANK_MARGINAL, FS_TYPE_RTP_BIN_ERROR_DOWNGRADE);
g_once_init_leave (&initialization_v... | false | false | false | false | false | 0 |
stacktrace_memory_used(void)
{
size_t res;
res = NULL == symbols ? 0 : symbols_memory_size(symbols);
if (stack_atoms != NULL) {
res += hash_table_arena_memory(stack_atoms);
}
return res;
} | false | false | false | false | false | 0 |
binlog_close_connection(handlerton *hton, THD *thd)
{
binlog_cache_mngr *const cache_mngr=
(binlog_cache_mngr*) thd_get_ha_data(thd, binlog_hton);
DBUG_ASSERT(cache_mngr->trx_cache.empty() && cache_mngr->stmt_cache.empty());
thd_set_ha_data(thd, binlog_hton, NULL);
cache_mngr->~binlog_cache_mngr();
my_fre... | false | false | false | false | false | 0 |
buildAll_LocalAnimatedMatrices()
{
for (u32 i=0; i<AllJoints.size(); ++i)
{
SJoint *joint = AllJoints[i];
//Could be faster:
if (joint->UseAnimationFrom &&
(joint->UseAnimationFrom->PositionKeys.size() ||
joint->UseAnimationFrom->ScaleKeys.size() ||
joint->UseAnimationFrom->RotationKeys.... | false | false | false | false | false | 0 |
read_data_mode(VMG_ vm_val_t *retval)
{
char buf[32];
CVmObjString *str_obj;
vm_obj_id_t str_id;
osfildef *fp = get_ext()->fp;
/* read the type flag */
if (osfrb(fp, buf, 1))
{
/* end of file - return nil */
retval->set_nil();
return;
}
/* see... | false | false | false | false | false | 0 |
scm_s_define_internal(enum ScmObjType permitted,
ScmObj var, ScmObj exp, ScmObj env)
{
ScmObj val;
DECLARE_INTERNAL_FUNCTION("define");
#if SCM_USE_HYGIENIC_MACRO
SCM_ASSERT(SYMBOLP(var) || SYMBOLP(SCM_FARSYMBOL_SYM(var)));
#else
SCM_ASSERT(SYMBOLP(var));
#endif
var = SCM_UNWR... | false | false | false | false | false | 0 |
test_truncate ()
{
GString *s = g_string_new ("0123456789");
g_string_truncate (s, 3);
if (strlen (s->str) != 3)
return FAILED ("size of string should have been 3, instead it is [%s]\n", s->str);
g_string_free (s, TRUE);
s = g_string_new ("a");
s = g_string_truncate (s, 10);
if (strlen (s->str) != 1)
retu... | false | false | false | false | false | 0 |
snd_usb_add_audio_stream(struct snd_usb_audio *chip,
int stream,
struct audioformat *fp)
{
struct snd_usb_stream *as;
struct snd_usb_substream *subs;
struct snd_pcm *pcm;
int err;
list_for_each_entry(as, &chip->pcm_list, list) {
if (as->fmt_type != fp->fmt_type)
continue;
subs = &as->substr... | false | true | false | false | false | 1 |
print_cb(Fl_Widget *w, void *data)
{
Fl_Printer printer;
Fl_Window *win = Fl::first_window();
if(!win) return;
if( printer.start_job(1) ) return;
if( printer.start_page() ) return;
printer.scale(0.5,0.5);
printer.print_widget( win );
printer.end_page();
printer.end_job();
} | false | false | false | false | false | 0 |
gtk_source_view_get_show_right_margin (GtkSourceView *view)
{
g_return_val_if_fail (GTK_SOURCE_IS_VIEW (view), FALSE);
return (view->priv->show_right_margin != FALSE);
} | false | false | false | false | false | 0 |
set_frame(unsigned int frame)
{
if(frame < 0)
impl->current_frame = 0;
else if(frame >= impl->frames.size())
impl->current_frame = impl->frames.size() - 1;
else
impl->current_frame = frame;
} | false | false | false | false | false | 0 |
slotOnItem( Q3ListBoxItem *item )
{
if ( item && m_bChangeCursorOverItem && m_bUseSingle )
viewport()->setCursor(Qt::PointingHandCursor);
if ( item && (m_autoSelectDelay > -1) && m_bUseSingle ) {
m_pAutoSelect->setSingleShot( true );
m_pAutoSelect->start( m_autoSelectDelay );
m_pCurre... | false | false | false | false | false | 0 |
check_vendor_extension(u64 paddr,
struct set_error_type_with_address *v5param)
{
int offset = v5param->vendor_extension;
struct vendor_error_type_extension *v;
u32 sbdf;
if (!offset)
return;
v = acpi_os_map_iomem(paddr + offset, sizeof(*v));
if (!v)
return;
sbdf = v->pcie_sbdf;
sprintf(vendor_dev, "... | false | true | false | false | false | 1 |
get_opname(Oid opno)
{
HeapTuple tp;
tp = SearchSysCache(OPEROID,
ObjectIdGetDatum(opno),
0, 0, 0);
if (HeapTupleIsValid(tp))
{
Form_pg_operator optup = (Form_pg_operator) GETSTRUCT(tp);
char *result;
result = pstrdup(NameStr(optup->oprname));
ReleaseSysCache(tp);
return result;
}
else
... | false | false | false | false | false | 0 |
clearAllSelections_impl(void)
{
// flag used so we can track if we did anything.
bool modified = false;
for (uint i = 0; i < getRowCount(); ++i)
{
for (uint j = 0; j < getColumnCount(); ++j)
{
ListboxItem* item = d_grid[i][j];
// if slot has an item, and item is selected
if ((item != 0) && item->isSe... | false | false | false | false | false | 0 |
up_input_finalize (GObject *object)
{
UpInput *input;
g_return_if_fail (object != NULL);
g_return_if_fail (UP_IS_INPUT (object));
input = UP_INPUT (object);
g_return_if_fail (input->priv != NULL);
if (input->priv->daemon != NULL)
g_object_unref (input->priv->daemon);
if (input->priv->eventfp >= 0)
close (... | false | false | false | false | false | 0 |
lv_add_mirrors(struct cmd_context *cmd, struct logical_volume *lv,
uint32_t mirrors, uint32_t stripes, uint32_t stripe_size,
uint32_t region_size, uint32_t log_count,
struct dm_list *pvs, alloc_policy_t alloc, uint32_t flags)
{
if (!mirrors && !log_count) {
log_error("No conversion is requested");
r... | false | false | false | false | false | 0 |
load_proto(struct iptables_command_state *cs)
{
if (!should_load_proto(cs))
return NULL;
return find_proto(cs->protocol, XTF_TRY_LOAD,
cs->options & OPT_NUMERIC, &cs->matches);
} | false | false | false | false | false | 0 |
isns_scn_deregister(char *name)
{
int err;
uint16_t flags, length = 0;
char buf[2048];
struct isns_hdr *hdr = (struct isns_hdr *) buf;
struct isns_tlv *tlv;
if (!isns_fd)
if (isns_connect() < 0)
return 0;
memset(buf, 0, sizeof(buf));
tlv = (struct isns_tlv *) hdr->pdu;
length += isns_tlv_set(&tlv, ISNS... | false | false | false | false | false | 0 |
bnx2x_update_sge_prod(struct bnx2x_fastpath *fp,
u16 sge_len,
struct eth_end_agg_rx_cqe *cqe)
{
struct bnx2x *bp = fp->bp;
u16 last_max, last_elem, first_elem;
u16 delta = 0;
u16 i;
if (!sge_len)
return;
/* First mark all used pages */
for (i = 0; i < sge_len; i++)
BIT_VEC64_CLEAR_BIT(fp->sge_m... | false | false | false | false | true | 1 |
agx_compute_index(void)
/* This computes the blocksize and offset values for all blocks */
{
int i;
for(i=0;i<AGX_NUMBLOCK;i++)
gindex[i].blocksize=gindex[i].recsize*gindex[i].numrec;
gindex[0].file_offset=16;
gindex[11].file_offset=gindex[0].file_offset+gindex[0].blocksize;
gindex[12].file_offse... | false | false | false | false | false | 0 |
ensQcalignmentCalculateQueryCoverageQueryQuery(
const EnsPQcalignment qca1,
const EnsPQcalignment qca2,
ajuint *Pscore)
{
ajint end1 = 0;
ajint end2 = 0;
ajint start1 = 0;
ajint start2 = 0;
if (!qca1)
return ajFalse;
if (!Pscore)
return ajFalse;
*Pscore = 0... | false | false | false | false | false | 0 |
setStopConflict() {
if (!hasConflict()) {
// we use the nogood {FALSE} to represent the unrecoverable conflict -
// note that {FALSE} can otherwise never be a violated nogood because
// TRUE is always true in every solver
conflict_.push_back(negLit(0));
// remember the current root-level
conflict_.push_bac... | false | false | false | false | false | 0 |
_check_polkit_for_action_internal (CphMechanism *mechanism,
GDBusMethodInvocation *context,
const char *action_method,
gboolean allow_user_interaction,
... | false | false | false | false | false | 0 |
playback_exec(struct ast_channel *chan, const char *data)
{
int res = 0;
int mres = 0;
char *tmp;
int option_skip=0;
int option_say=0;
int option_noanswer = 0;
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(filenames);
AST_APP_ARG(options);
);
if (ast_strlen_zero(data)) {
ast_log(LOG_WARNING, "Playback requir... | false | false | false | false | false | 0 |
pcm_open(struct snd_pcm_substream *substream)
{
struct snd_efw *efw = substream->private_data;
unsigned int sampling_rate;
enum snd_efw_clock_source clock_source;
int err;
err = snd_efw_stream_lock_try(efw);
if (err < 0)
goto end;
err = pcm_init_hw_params(efw, substream);
if (err < 0)
goto err_locked;
e... | false | false | false | false | false | 0 |
piix4_get_smb(void)
{
unsigned long x;
int result;
result = pci_conf_read(0, smbdev, smbfun, 0x08, 1, &x);
if(x < 0x40){
// SB600/700
result = pci_conf_read(0, smbdev, smbfun, 0x90, 2, &x);
if (result == 0) smbusbase = (unsigned short) x & 0xFFFE;
} else {
// ... | false | false | false | false | false | 0 |
apply_constraint(struct dev_pm_qos_request *req,
enum pm_qos_req_action action, s32 value)
{
struct dev_pm_qos *qos = req->dev->power.qos;
int ret;
switch(req->type) {
case DEV_PM_QOS_RESUME_LATENCY:
ret = pm_qos_update_target(&qos->resume_latency,
&req->data.pnode, action, value);
if (ret) {
... | false | false | false | false | false | 0 |
encode_1d_row(t4_state_t *s)
{
int i;
/* Do our work in the reference row buffer, and it is already in place if
we need a reference row for a following 2D encoded row. */
s->ref_steps = row_to_run_lengths(s->ref_runs, s->row_buf, s->image_width);
put_1d_span(s, s->ref_runs[0], t4_white_codes);
... | false | false | false | false | false | 0 |
read_string (LexState *LS, int del, SemInfo *seminfo) {
size_t l = 0;
checkbuffer(LS, l);
save_and_next(LS, l);
while (LS->current != del) {
checkbuffer(LS, l);
switch (LS->current) {
case EOZ:
save(LS, '\0', l);
luaX_lexerror(LS, "unfinished string", TK_EOS);
break; /* to... | false | false | false | false | false | 0 |
read_sane_extended(FILE *f, FLAC__uint32 *val, const char *fn)
/* Read an IEEE 754 80-bit (aka SANE) extended floating point value from 'f',
* convert it into an integral value and store in 'val'. Return false if only
* between 1 and 9 bytes remain in 'f', if 0 bytes remain in 'f', or if the
* value is negative... | false | false | false | false | false | 0 |
fwd_uses_fwd_cmap_procs(gx_device * dev)
{
const gx_cm_color_map_procs *pprocs;
pprocs = dev_proc(dev, get_color_mapping_procs)(dev);
if (pprocs == &FwdDevice_cm_map_procs) {
return true;
}
return false;
} | false | false | false | false | false | 0 |
IncrementalCopy(const char* src, char* op, int len) {
DCHECK_GT(len, 0);
do {
*op++ = *src++;
} while (--len > 0);
} | false | false | false | false | false | 0 |
parse_prefix6(struct parse *cfile, struct group *group) {
struct iaddr lo, hi;
int bits;
enum dhcp_token token;
const char *val;
struct iaddrcidrnetlist *nets;
struct iaddrcidrnetlist *p;
if (local_family != AF_INET6) {
parse_warn(cfile, "prefix6 statement is only supported "
"in DHCPv6 mode.");
skip_... | false | false | false | false | true | 1 |
ComputeWorldPosition( vtkRenderer *ren,
double displayPos[2],
double worldPos[3],
double vtkNotUsed(worldOrient)[9] )
{
vtkDebugMacro( << "Request for computing world position at " <<
"display positio... | false | false | false | false | false | 0 |
initialize()
{
setSceneAlignment( AlignHCenter | AlignVCenter );
setDeckContents();
// Create the talon to the left.
talon = new PatPile( this, 0, "talon" );
talon->setPileRole(PatPile::Stock);
talon->setLayoutPos(0, 0);
talon->setSpread(0, 0);
talon->setKeyboardSelectHint( KCardPile::... | false | false | false | false | false | 0 |
gnm_expr_top_relocate_sheet (GnmExprTop const *texpr,
Sheet const *src,
Sheet const *dst)
{
GnmExprRelocateInfo rinfo;
GnmExprTop const *res;
g_return_val_if_fail (IS_GNM_EXPR_TOP (texpr), NULL);
g_return_val_if_fail (IS_SHEET (src), NULL);
g_return_val_if_fail (IS_SHEET (dst), NULL);
rinfo.relo... | false | false | false | false | false | 0 |
Iidlerun (int argc, lvar_t *argv) {
Tobj mo;
char *ms;
int mode;
if (Tgettype ((mo = argv[0].o)) != T_STRING)
return L_SUCCESS;
ms = Tgetstring (mo);
if (strcmp (ms, "on") == 0)
mode = 1;
else if (strcmp (ms, "off") == 0)
mode = 0;
else
return L_FAILURE;
... | false | false | true | false | true | 1 |
GetScalarResult()
{
if (!(this->IsScalarResult()))
{
vtkErrorMacro("GetScalarResult: no valid scalar result");
return VTK_PARSER_ERROR_RESULT;
}
return this->Stack[0];
} | false | false | false | false | false | 0 |
setAxis(const SbLine& a)
{
#if COIN_DEBUG
if (!(a.getDirection().length() > 0.0f))
SoDebugError::postWarning("SbCylinder::setAxis",
"Axis has zero length => undefined");
#endif // COIN_DEBUG
this->axis = a;
} | false | false | false | false | false | 0 |
drm_poll(struct file *filp, struct poll_table_struct *wait)
{
struct drm_file *file_priv = filp->private_data;
unsigned int mask = 0;
poll_wait(filp, &file_priv->event_wait, wait);
if (!list_empty(&file_priv->event_list))
mask |= POLLIN | POLLRDNORM;
return mask;
} | false | false | false | false | false | 0 |
walgc(Wal *w)
{
File *f;
while (w->head && !w->head->refs) {
f = w->head;
w->head = f->next;
if (w->tail == f) {
w->tail = f->next; // also, f->next == NULL
}
w->nfile--;
unlink(f->path);
free(f->path);
free(f);
}
} | false | false | false | false | false | 0 |
brasero_burn_powermanagement (BraseroBurn *self,
gboolean wake)
{
BraseroBurnPrivate *priv = BRASERO_BURN_PRIVATE (self);
if (wake)
priv->appcookie = brasero_inhibit_suspend (_("Burning CD/DVD"));
else
brasero_uninhibit_suspend (priv->appcookie);
} | false | false | false | false | false | 0 |
l2tp_tunnel_start(struct l2tp_conn_t *conn,
triton_event_func start_func,
void *start_param)
{
if (triton_context_register(&conn->ctx, NULL) < 0) {
log_error("l2tp: impossible to start new tunnel:"
" context registration failed\n");
goto err;
}
triton_md_register_handler(&conn->ctx, &conn->h... | false | true | false | false | true | 1 |
sbitmap_resize (sbitmap bmap, unsigned int n_elms, int def)
{
unsigned int bytes, size, amt;
unsigned int last_bit;
size = SBITMAP_SET_SIZE (n_elms);
bytes = size * sizeof (SBITMAP_ELT_TYPE);
if (bytes > bmap->bytes)
{
amt = (sizeof (struct simple_bitmap_def)
+ bytes - sizeof (SBITMAP_ELT_TYPE... | false | false | false | false | false | 0 |
changeoutgroup()
{
long i, maxinput;
boolean ok;
maxinput = 1;
do {
printf("Which node should be the new outgroup? ");
inpnum(&i, &ok);
ok = (ok && i >= 1 && i <= nonodes && i != root->index);
if (ok)
ok = (ok && !nodep[i - 1]->deleted);
if (ok)
ok = !nodep[nodep[i - 1]->back->i... | false | false | false | false | false | 0 |
flip_faces(Mesh &mesh)
{
Buffer<vertex_t> &p_meshv = mesh.vertices();
Buffer<index_t> &p_meshi = mesh.indices();
// Invert the faces.
for (unsigned int i = 0; i < p_meshi.count(); i+=3) {
int temp = p_meshi[i];
p_meshi[i] = p_meshi[i+2];
p_meshi[i+2] = temp;
}
// Correct the normals.
for ... | false | false | false | false | false | 0 |
_wi_data_hash(wi_runtime_instance_t *instance) {
wi_data_t *data = instance;
return wi_hash_data(data->bytes, WI_MIN(data->length, 16));
} | false | false | false | false | false | 0 |
pcap_ts_event_touch(int pirq, void *data)
{
struct pcap_ts *pcap_ts = data;
if (pcap_ts->read_state == PCAP_ADC_TS_M_STANDBY) {
pcap_ts->read_state = PCAP_ADC_TS_M_PRESSURE;
schedule_delayed_work(&pcap_ts->work, 0);
}
return IRQ_HANDLED;
} | false | false | false | false | false | 0 |
get_property (GObject *object, guint prop_id,
GValue *value, GParamSpec *pspec)
{
NMSettingBondPrivate *priv = NM_SETTING_BOND_GET_PRIVATE (object);
NMSettingBond *setting = NM_SETTING_BOND (object);
switch (prop_id) {
case PROP_INTERFACE_NAME:
g_value_set_string (value, nm_setting_bond_get_interfa... | false | false | false | false | false | 0 |
move_repair(piece_info_t *obj)
{
path_map_t path_map[MAP_SIZE];
loc_t loc;
ASSERT (obj->type > FIGHTER);
if (obj->hits == piece_attr[obj->type].max_hits) {
obj->func = NOFUNC;
return;
}
if (user_map[obj->loc].contents == 'O') { /* it is in port? */
obj->moved += 1;
return;
}
lo... | false | false | false | false | false | 0 |
coord2bin(double *x)
{
int ix,iy,iz;
if (x[0] >= bboxhi[0])
ix = static_cast<int> ((x[0]-bboxhi[0])*bininvx) + nbinx;
else if (x[0] >= bboxlo[0]) {
ix = static_cast<int> ((x[0]-bboxlo[0])*bininvx);
ix = MIN(ix,nbinx-1);
} else
ix = static_cast<int> ((x[0]-bboxlo[0])*bininvx) - 1;
if (x[1] >=... | false | false | false | false | false | 0 |
vgacon_save_screen(struct vc_data *c)
{
static int vga_bootup_console = 0;
if (!vga_bootup_console) {
/* This is a gross hack, but here is the only place we can
* set bootup console parameters without messing up generic
* console initialization routines.
*/
vga_bootup_console = 1;
c->vc_x = screen_inf... | false | false | false | false | false | 0 |
vt_ioexit(uint32_t tid, uint64_t* time, uint64_t* etime, uint32_t fid,
uint64_t hid, uint32_t op, uint64_t bytes)
{
GET_THREAD_ID(tid);
if (VTTHRD_TRACE_STATUS(VTThrdv[tid]) != VT_TRACE_ON) return;
VTGen_write_FILE_OPERATION(VTTHRD_GEN(VTThrdv[tid]),
time,
... | false | false | false | false | false | 0 |
acfg_free (MonoAotCompile *acfg)
{
int i;
img_writer_destroy (acfg->w);
for (i = 0; i < acfg->nmethods; ++i)
if (acfg->cfgs [i])
g_free (acfg->cfgs [i]);
g_free (acfg->cfgs);
g_free (acfg->static_linking_symbol);
g_free (acfg->got_symbol);
g_free (acfg->plt_symbol);
g_ptr_array_free (acfg->methods, TRUE);... | false | false | false | false | false | 0 |
connect_to_socks5_proxy (CamelTcpStreamRaw *raw,
const gchar *proxy_host,
gint proxy_port,
const gchar *host,
const gchar *service,
gint fallback_port,
GCancellable *canc... | false | false | false | false | false | 0 |
ensGvpopulationadaptorFetchAllbyGvindividuals(
EnsPGvpopulationadaptor gvpa,
AjPList gvis,
AjPList gvps)
{
/*
** NOTE: This function does not use the Ensembl Base Adaptor
** functionality, because an additional 'individual_population' table is
** required.
*/
const char *template =
... | false | false | false | false | false | 0 |
dot(const double* v1, unsigned s, const double* v2, unsigned n)
{
double sum=0.0;
for (unsigned i=0;i<n;++i,v1+=s) sum+= (*v1)*v2[i];
return sum;
} | false | false | false | false | false | 0 |
oggpack_read(oggpack_buffer *b, int bits) {
unsigned long ret;
unsigned long m=mask[bits];
bits+=b->endbit;
if (b->endbyte+4>=b->storage) {
ret=(unsigned long)-1;
if (b->endbyte+(bits-1)/8>=b->storage) goto overflow;
}
ret=b->ptr[0]>>b->endbit;
if (bits>8) {
ret|=b->ptr[1]<<(8-b->endbit);
... | false | false | false | false | false | 0 |
ib_uverbs_close(struct inode *inode, struct file *filp)
{
struct ib_uverbs_file *file = filp->private_data;
struct ib_uverbs_device *dev = file->device;
mutex_lock(&file->cleanup_mutex);
if (file->ucontext) {
ib_uverbs_cleanup_ucontext(file, file->ucontext);
file->ucontext = NULL;
}
mutex_unlock(&file->clean... | false | false | false | false | false | 0 |
gettagsandvalues(uint8_t *buffer, int length, std::map<std::string,
struct tagvalue> &tagvalues, int messageextentoffset)
{
int counter = 0;
uint8_t *p = buffer;
uint8_t marker1 = YAHOO_OLD_MARKER1;
uint8_t marker2 = YAHOO_OLD_MARKER2;
if (yahooversion == YAHOO_VERSION_FLASH)
{
marker1 = YAHOO_FLASH_MARKER1;
... | false | false | false | false | false | 0 |
clone(const String& newName) const
{
Animation* newAnim = OGRE_NEW Animation(newName, mLength);
newAnim->mInterpolationMode = mInterpolationMode;
newAnim->mRotationInterpolationMode = mRotationInterpolationMode;
// Clone all tracks
for (NodeTrackList::const_iterator ... | false | false | false | false | false | 0 |
bfusb_load_firmware(struct bfusb_data *data,
const unsigned char *firmware, int count)
{
unsigned char *buf;
int err, pipe, len, size, sent = 0;
BT_DBG("bfusb %p udev %p", data, data->udev);
BT_INFO("BlueFRITZ! USB loading firmware");
buf = kmalloc(BFUSB_MAX_BLOCK_SIZE + 3, GFP_KERNEL);
if (!buf) {
... | false | true | false | false | false | 1 |
dw_mci_translate_sglist(struct dw_mci *host, struct mmc_data *data,
unsigned int sg_len)
{
unsigned int desc_len;
int i;
if (host->dma_64bit_address == 1) {
struct idmac_desc_64addr *desc_first, *desc_last, *desc;
desc_first = desc_last = desc = host->sg_cpu;
for (i = 0; i < sg_len; i++) {
unsign... | false | false | false | false | false | 0 |
reparent_children (struct file_link *dlink, struct file_link *slink)
{
void **slot = idh.idh_file_link_table.ht_vec;
void **end = &idh.idh_file_link_table.ht_vec[idh.idh_file_link_table.ht_size];
for ( ; slot < end; slot++)
{
if (!HASH_VACANT (*slot))
{
struct file_link *child = (struct file_link *... | false | false | false | false | false | 0 |
set_psm_initial(PatchSetMember * psm)
{
psm->pre_rev = NULL;
if (psm->post_rev->dead)
{
/*
* we expect a 'file xyz initially added on branch abc' here
* but there can only be one such member in a given patchset
*/
if (psm->ps->branch_add)
debug(DEBUG_APPMSG1, "WARNING: branch_add already set!"... | false | false | false | false | false | 0 |
remove_vertex(int i)
/* removes vertex i from the graph and returns an edge with the
new face on the left. Note that afterwards the vertices are
in general no more numbered 0...nv-1, but maybe e.g. 0...nv
with some number in the middle missing.
*/
{
EDGE *run, *end, *buffer;
nv--;
ne -= 2*degre... | false | false | false | false | false | 0 |
test_refs_races__create_matching(void)
{
git_reference *ref, *ref2, *ref3;
git_oid id, other_id;
git_oid_fromstr(&id, commit_id);
git_oid_fromstr(&other_id, other_commit_id);
cl_git_fail_with(GIT_EMODIFIED, git_reference_create_matching(&ref, g_repo, refname, &other_id, 1, &other_id, NULL, NULL));
cl_git_pass(... | false | false | false | false | false | 0 |
thread_function_2(void *anArg)
{
DENTER(TOP_LAYER, "thread_function_2");
sleep(6);
SGE_LOCK(LOCK_GLOBAL, LOCK_WRITE);
sleep(2);
SGE_UNLOCK(LOCK_GLOBAL, LOCK_WRITE);
DEXIT;
return (void *)NULL;
} | false | false | false | false | false | 0 |
load_config(gchar *path)
{
FILE *f;
PluginConfigRec *cfg;
gchar buf[128+32+2], config[32], arg[128];
gchar *s, *plugin_config_block = NULL;
//g_print("Trying to load config from file '%s'\n", path);
f = g_fopen(path, "r");
if (!f)
return;
while (fgets(buf, sizeof(buf), f))
{
if (!buf[0] || buf[0]... | false | false | false | false | false | 0 |
clipToRect(SplashCoord x0, SplashCoord y0,
SplashCoord x1, SplashCoord y1) {
if (x0 < x1) {
if (x0 > xMin) {
xMin = x0;
xMinI = splashFloor(xMin);
}
if (x1 < xMax) {
xMax = x1;
xMaxI = splashFloor(xMax);
}
} else {
if (x1 > xMin) {
xMin = x1;
xMinI = sp... | false | false | false | false | false | 0 |
read ( void * buf,
unsigned int len ) throw ( Exception )
{
int ret;
if ( !isOpen() ) {
return 0;
}
ret = recv( sockfd, buf, len, 0);
if ( ret == -1 ) {
switch (errno) {
case ECONNRESET:
// re-open t... | false | false | false | false | false | 0 |
H5I_dec_ref(hid_t id)
{
H5I_id_info_t *id_ptr; /*ptr to the new ID */
int ret_value; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
HDassert(id >= 0);
/* General lookup of the ID */
if(NULL == (id_ptr = H5I__find_id(id)))
HGOTO_ERROR(H5E_ATOM, H5... | false | false | false | false | false | 0 |
gf_odf_write_esd_remove(GF_BitStream *bs, GF_ESDRemove *esdRem)
{
GF_Err e;
u32 size, i;
if (! esdRem) return GF_BAD_PARAM;
e = gf_odf_size_esd_remove(esdRem, &size);
if (e) return e;
e = gf_odf_write_base_descriptor(bs, esdRem->tag, size);
if (e) return e;
gf_bs_write_int(bs, esdRem->ODID, 10);
gf_bs_write_... | false | false | false | false | false | 0 |
mono_tramp_info_register (MonoTrampInfo *info)
{
MonoTrampInfo *copy;
if (!info)
return;
copy = g_new0 (MonoTrampInfo, 1);
copy->code = info->code;
copy->code_size = info->code_size;
copy->name = g_strdup (info->name);
mono_jit_lock ();
tramp_infos = g_slist_prepend (tramp_infos, copy);
mono_jit_unlock ()... | false | false | false | false | false | 0 |
Connect(const Request ¬ification)
{
QSharedPointer<Edge> edge = notification.GetFrom().dynamicCast<Edge>();
if(!edge) {
qWarning() << "Connection attempt not from an Edge: " <<
notification.GetFrom()->ToString();
return;
}
QByteArray brem_id = notification.GetData().toByteA... | false | false | false | false | false | 0 |
focus_in_event_ModelessOther(GtkWidget *widget,GdkEvent */*event*/,
std::pointer_to_unary_function<int, gboolean> *other_function)
{
XAP_App *pApp=static_cast<XAP_App *>(g_object_get_data(G_OBJECT(widget), "pApp"));
XAP_Frame *pFrame= pApp->getLastFocussedFrame();
if(pFrame == static_cast<XAP_Frame *... | false | false | false | false | false | 0 |
upsdrv_initinfo(void)
{
char *v;
/* setup the basics */
dstate_setinfo("ups.mfr", "%s", ((v = getval("mfr")) != NULL) ? v : upstab[upstype].mfr);
dstate_setinfo("ups.model", "%s", ((v = getval("model")) != NULL) ? v : upstab[upstype].model);
if ((v = getval("serial")) != NULL) {
dstate_setinfo("ups.serial", "... | false | false | false | false | false | 0 |
isFlagged() const {
DebugAssert(!isNull(), "CVC3::Theorem::isFlagged: we are Null");
if (isRefl()) return exprValue()->d_em->getTM()->isFlagged((long)d_expr);
else return thm()->isFlagged();
} | false | false | false | false | false | 0 |
tryPropagateBranch(BasicBlock *bb)
{
for (Instruction *i = bb->getExit(); i && i->op == OP_BRA; i = i->prev) {
BasicBlock *bf = i->asFlow()->target.bb;
if (bf->getInsnCount() != 1)
continue;
FlowInstruction *bra = i->asFlow();
FlowInstruction *rep = bf->getExit()->asFlow();
... | false | false | false | false | false | 0 |
build_user_pbes(struct ocrdma_dev *dev, struct ocrdma_mr *mr,
u32 num_pbes)
{
struct ocrdma_pbe *pbe;
struct scatterlist *sg;
struct ocrdma_pbl *pbl_tbl = mr->hwmr.pbl_table;
struct ib_umem *umem = mr->umem;
int shift, pg_cnt, pages, pbe_cnt, entry, total_num_pbes = 0;
if (!mr->hwmr.num_pbes)
return;
... | false | false | false | false | false | 0 |
isnotblank(char *line,int flag)
{
int c;
if (!strcmp(line,EMPTY_LINE))
return 0;
if (flag)
return 1;
if (!*line)
return 0;
while (*line)
if (*line=='~')
if (!getcolor(&line,&c,1))
return 1;
else
line++;
... | 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.