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 |
|---|---|---|---|---|---|---|
Configure(void **ctxp, int argc, char *argv[])
{
ContextInfo *ci;
int c;
*ctxp = av_mallocz(sizeof(ContextInfo));
ci = (ContextInfo *) *ctxp;
optind = 1;
ci->dir = av_strdup("/tmp");
ci->threshold = 100;
ci->file_limit = 100;
ci->min_interval = 1000000;
ci->inset = 10; /* ... | false | true | false | false | true | 1 |
updateForeground(unsigned long oldFg_)
{
MSEntryFieldPlus::updateForeground(oldFg_);
if (monthView() != 0) monthView()->foreground(foreground());
} | false | false | false | false | false | 0 |
stage3list_gc (List_T *old) {
List_T p;
Stage3end_T hit;
for (p = *old; p != NULL; p = p->rest) {
hit = (Stage3end_T) p->first;
Stage3end_free(&hit);
}
List_free(&(*old));
return;
} | false | false | false | false | false | 0 |
init_style()
{
if (!atom->q_flag || !atom->mu_flag || !atom->torque_flag)
error->all(FLERR,"Pair dipole/sf requires atom attributes q, mu, torque");
neighbor->request(this);
} | false | false | false | false | false | 0 |
ar9003_hw_get_duration(struct ath_hw *ah, const void *ds, int index)
{
const struct ar9003_txc *adc = ds;
switch (index) {
case 0:
return MS(ACCESS_ONCE(adc->ctl15), AR_PacketDur0);
case 1:
return MS(ACCESS_ONCE(adc->ctl15), AR_PacketDur1);
case 2:
return MS(ACCESS_ONCE(adc->ctl16), AR_PacketDur2);
case 3:... | false | false | false | false | false | 0 |
PQG_GetLength(const SECItem *obj)
{
unsigned int len = obj->len;
if (obj->data == NULL) {
return 0;
}
if (len > 1 && obj->data[0] == 0) {
len--;
}
return len;
} | false | false | false | false | false | 0 |
sendLength610p (int *cmd)
{
int ret, i, wait;
/* 55,AA,x,y,z,t */
byteMode ();
wait = putByte610p (0x55);
if ((wait != 0xC8) && (wait != 0xC0))
{
DBG (0,
"sendLength610p failed, expected 0xC8 or 0xC0 got 0x%02X ! (%s:%d)\n",
wait, __FILE__, __LINE__);
return 0;
}
wait = putByte610... | false | false | false | false | false | 0 |
_print_job_core_spec(job_info_t * job, int width, bool right, char* suffix)
{
if (job == NULL) /* Print the Header instead */
_print_str("CORE_SPEC", width, right, true);
else
_print_int(job->core_spec, width, right, true);
return SLURM_SUCCESS;
} | false | false | false | false | false | 0 |
multi_sg_draw_radio_buttons()
{
// draw the appropriate radio button
switch(Multi_sg_netgame->mode){
case NG_MODE_OPEN:
Multi_sg_buttons[gr_screen.res][MSG_OPEN_GAME].button.draw_forced(2);
break;
/*
case NG_MODE_CLOSED:
Multi_sg_buttons[gr_screen.res][MSG_CLOSED_GAME].button.draw_forced(2);
break;
*/
cas... | false | false | false | false | false | 0 |
plain_probe(CHAR16 *kname)
{
Elf32_Ehdr ehdr;
EFI_STATUS status;
INTN ret = -1;
fops_fd_t fd;
UINTN size = sizeof(ehdr);
status = fops_open(kname, &fd);
if (EFI_ERROR(status))
return -1;
status = fops_read(fd, &ehdr, &size);
if (EFI_ERROR(status) || size != sizeof(ehdr))
goto error;
ret = is_valid_he... | false | false | false | false | false | 0 |
cl_process (GeglOperation *operation,
GeglBuffer *input,
GeglBuffer *output,
const GeglRectangle *result)
{
const Babl *in_format = gegl_operation_get_format (operation, "input");
const Babl *out_format = gegl_operation_get_format (operation, "output");
... | false | false | false | false | false | 0 |
radeon_mn_release(struct mmu_notifier *mn,
struct mm_struct *mm)
{
struct radeon_mn *rmn = container_of(mn, struct radeon_mn, mn);
INIT_WORK(&rmn->work, radeon_mn_destroy);
schedule_work(&rmn->work);
} | false | false | false | false | false | 0 |
initFakeComponent()
{
QString name = QCoreApplication::applicationName();
if(name.isEmpty() && QCoreApplication::instance())
name = qAppName();
if(name.isEmpty())
name = QString::fromLatin1("kde");
return KComponentData(name.toLatin... | false | false | false | false | false | 0 |
ssl_configure(GLOBAL_OPTIONS *global) { /* configure global SSL settings */
#ifdef USE_FIPS
if(FIPS_mode()!=global->option.fips) {
RAND_set_rand_method(NULL); /* reset RAND methods */
if(!FIPS_mode_set(global->option.fips)) {
ERR_load_crypto_strings();
sslerror("FIPS_mode_set... | false | false | false | false | false | 0 |
b43_phy_ht_tx_power_fix(struct b43_wldev *dev)
{
int i;
for (i = 0; i < 3; i++) {
u16 mask;
u32 tmp = b43_httab_read(dev, B43_HTTAB32(26, 0xE8));
if (0) /* FIXME */
mask = 0x2 << (i * 4);
else
mask = 0;
b43_phy_mask(dev, B43_PHY_EXTG(0x108), mask);
b43_httab_write(dev, B43_HTTAB16(7, 0x110 + i), ... | false | false | false | false | false | 0 |
hash_dump (struct hash_table_s *ht, void **vector_0, qsort_cmp_t compare)
{
void **vector;
void **slot;
void **end = &ht->ht_vec[ht->ht_size];
if (vector_0 == 0)
vector_0 = XMALLOC (void *, ht->ht_fill + 1);
vector = vector_0;
for (slot = ht->ht_vec; slot < end; slot++)
if (!HASH_VACANT (*slot))
... | false | false | false | false | false | 0 |
route_csum(unsigned char *buf, int start, int end)
{
unsigned int sum = 1; /* Starting value for Phase IV */
int i;
for (i=start; i<end; i++, i++)
{
sum += buf[i] + (buf[i+1]<<8);
}
sum = (sum>>16) + (sum&0xFFFF);
sum = (sum>>16) + (sum&0xFFFF);
return (unsigned short)sum;
} | false | false | false | false | false | 0 |
snd_hdac_i915_exit(struct hdac_bus *bus)
{
struct device *dev = bus->dev;
struct i915_audio_component *acomp = bus->audio_component;
if (!acomp)
return 0;
WARN_ON(bus->i915_power_refcount);
if (bus->i915_power_refcount > 0 && acomp->ops)
acomp->ops->put_power(acomp->dev);
component_master_del(dev, &hdac_co... | false | false | false | false | false | 0 |
send_members(struct Client *client_p, struct Channel *chptr,
char *lmodebuf, char *lparabuf)
{
struct Membership *ms;
dlink_node *ptr;
int tlen; /* length of text to append */
char *t, *start; /* temp char pointer */
start = t = buf + ircsprintf(buf, ":%s SJOIN %lu %s %s %s:",... | false | true | false | false | false | 1 |
store1Kin( double x1in, double x2in, double sHin) {
// Default value only sensible for these processes.
swapTU = false;
// Incoming parton momentum fractions and sHat.
x1Save = x1in;
x2Save = x2in;
sH = sHin;
mH = sqrt(sH);
sH2 = sH * sH;
// Different options for renormalization scale, b... | false | false | false | false | false | 0 |
unify(Interval &that)
{
assert(this != &that);
for (Range *next, *r = that.head; r; r = next) {
next = r->next;
this->extend(r->bgn, r->end);
delete r;
}
that.head = NULL;
} | false | false | false | false | false | 0 |
rdataset_clearprefetch(dns_rdataset_t *rdataset) {
dns_rbtdb_t *rbtdb = rdataset->private1;
dns_rbtnode_t *rbtnode = rdataset->private2;
rdatasetheader_t *header = rdataset->private3;
header--;
NODE_LOCK(&rbtdb->node_locks[rbtnode->locknum].lock,
isc_rwlocktype_write);
header->attributes &= ~RDATASET_ATTR_PR... | false | false | false | false | false | 0 |
shortcut_str(char *str)
{
while (*str) {
if (*str=='~') {
memmove(str, str+1, strlen(str));
return str;
}
str++;
}
return NULL;
} | false | false | false | false | false | 0 |
ms_objv8_write_listbox (BiffPut *bp, gboolean filtered)
{
static guint8 const data[] = {
0x13, 0,
0xee, 0x1f, /* totally contradicts docs, see above */
0, 0, 0, 0, 1, 0, 1, 3, 0, 0, 2, 0,
8, 0, 0x57, 0, 0, 0, 0, 0
};
guint8 buf[sizeof data];
memcpy (buf, data, sizeof data);
if (filtered)
GSF_LE_SET_GUINT... | false | true | false | false | false | 1 |
readFile(istream& is, bool warn, int subrun) {
// Check that constructor worked.
if (!isConstructed) return false;
// Read in one line at a time.
string line;
bool accepted = true;
int subrunNow = SUBRUNDEFAULT;
while ( getline(is, line) ) {
// Check whether entered new subrun.
int subrunLine =... | false | false | false | false | false | 0 |
rtl8821ae_allow_all_destaddr(struct ieee80211_hw *hw,
bool allow_all_da, bool write_into_reg)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
if (allow_all_da) /* Set BIT0 */
rtlpci->receive_config |= RCR_AAP;
else /* Clear BIT0 */
rtlpci->receive_config &= ~RC... | false | false | false | false | false | 0 |
set_first_derives()
{
register unsigned *rrow;
register unsigned *vrow;
register int j;
register unsigned k;
register unsigned cword;
register short *rp;
int rule;
int i;
int rulesetsize;
int varsetsize;
rulesetsize = WORDSIZE(nrules);
varsetsize = WORDSIZE(nvars);
... | false | false | false | false | false | 0 |
mpi_get_digit( t_uint *d, int radix, char c )
{
*d = 255;
if( c >= 0x30 && c <= 0x39 ) *d = c - 0x30;
if( c >= 0x41 && c <= 0x46 ) *d = c - 0x37;
if( c >= 0x61 && c <= 0x66 ) *d = c - 0x57;
if( *d >= (t_uint) radix )
return( POLARSSL_ERR_MPI_INVALID_CHARACTER );
return( 0 );
} | false | false | false | false | false | 0 |
PyCPointerType_from_param(PyObject *type, PyObject *value)
{
StgDictObject *typedict;
if (value == Py_None) {
/* ConvParam will convert to a NULL pointer later */
Py_INCREF(value);
return value;
}
typedict = PyType_stgdict(type);
assert(typedict); /* Cannot be NULL for poin... | false | false | false | false | false | 0 |
acpi_run_hpp(acpi_handle handle, struct hotplug_params *hpp)
{
acpi_status status;
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
union acpi_object *package, *fields;
int i;
memset(hpp, 0, sizeof(struct hotplug_params));
status = acpi_evaluate_object(handle, "_HPP", NULL, &buffer);
if (ACPI_FAILUR... | false | false | false | false | false | 0 |
stb0899_read_signal_strength(struct dvb_frontend *fe, u16 *strength)
{
struct stb0899_state *state = fe->demodulator_priv;
struct stb0899_internal *internal = &state->internal;
int val;
u32 reg;
*strength = 0;
switch (state->delsys) {
case SYS_DVBS:
case SYS_DSS:
if (internal->lock) {
reg = stb0899_read... | false | false | false | false | false | 0 |
LowerJumpTable(SDValue Op, SelectionDAG &DAG, const SPUSubtarget *ST) {
EVT PtrVT = Op.getValueType();
JumpTableSDNode *JT = cast<JumpTableSDNode>(Op);
SDValue JTI = DAG.getTargetJumpTable(JT->getIndex(), PtrVT);
SDValue Zero = DAG.getConstant(0, PtrVT);
const TargetMachine &TM = DAG.getTarget();
// FIXME t... | false | false | false | false | false | 0 |
skin(char *name)
{
int c;
char *cp, *cp2;
char *bufend;
int gotlt, lastsp;
char *nbuf;
if (name == NULL)
return(NULL);
if (strchr(name, '(') == NULL && strchr(name, '<') == NULL
&& strchr(name, ' ') == NULL)
return(name);
gotlt = 0;
lastsp = 0;
nbuf = ac_alloc(strlen(name) + 1);
bufend = nbuf;
for... | false | false | false | false | false | 0 |
radeon_set_fbinfo(struct radeonfb_info *rinfo)
{
struct fb_info *info = rinfo->info;
info->par = rinfo;
info->pseudo_palette = rinfo->pseudo_palette;
info->flags = FBINFO_DEFAULT
| FBINFO_HWACCEL_COPYAREA
| FBINFO_HWACCEL_FILLRECT
| FBINFO_HWACCEL_XPAN
| FBINFO_HWACCEL_YPAN;
info->fbops = ... | false | false | false | false | false | 0 |
setup_ibs_ctl(int ibs_eilvt_off)
{
struct pci_dev *cpu_cfg;
int nodes;
u32 value = 0;
nodes = 0;
cpu_cfg = NULL;
do {
cpu_cfg = pci_get_device(PCI_VENDOR_ID_AMD,
PCI_DEVICE_ID_AMD_10H_NB_MISC,
cpu_cfg);
if (!cpu_cfg)
break;
++nodes;
pci_write_config_dword(cpu_cfg, IBSCTL, ibs_eilvt_off
... | false | false | false | false | false | 0 |
gnac_profiles_xml_engine_add_values(XMLDoc *doc, ...)
{
const gchar *expr = "/audio-profile/format-specific";
xmlXPathObjectPtr xpath_obj = gnac_profiles_xml_engine_evaluate_query(
expr, doc->xpath_context);
if (!xpath_obj) return;
xmlNodeSetPtr nodes = xpath_obj->nodesetval;
if (xmlXPathNodeSetIsEmp... | false | false | false | false | false | 0 |
iTCO_wdt_set_NO_REBOOT_bit(void)
{
u32 val32;
/* Set the NO_REBOOT bit: this disables reboots */
if (iTCO_wdt_private.iTCO_version >= 2) {
val32 = readl(iTCO_wdt_private.gcs_pmc);
val32 |= no_reboot_bit();
writel(val32, iTCO_wdt_private.gcs_pmc);
} else if (iTCO_wdt_private.iTCO_version == 1) {
pci_read_co... | false | false | false | false | false | 0 |
NP_aliasExpand(TypeCode_pairlist* tcpl)
{
TypeCode_struct* tc = new TypeCode_struct;
TypeCode_pairlist pl(tcpl, tc, this);
tc->pd_repoId = pd_repoId;
tc->pd_name = pd_name;
tc->pd_nmembers = pd_nmembers;
TypeCode_struct::Member* members = new TypeCode_struct::Member[pd_nmembers];
tc->pd_members = member... | false | false | false | false | false | 0 |
feat(size_t index) const {
if(index < m_dense.size())
return index;
else
return m_sparseFeats[index-m_dense.size()];
} | false | false | false | false | false | 0 |
parse_message(private_task_manager_t *this, message_t *msg)
{
status_t status;
u_int8_t type = 0;
status = msg->parse_body(msg, this->ike_sa->get_keymat(this->ike_sa));
if (status == SUCCESS)
{ /* check for unsupported critical payloads */
enumerator_t *enumerator;
unknown_payload_t *unknown;
payload_t *pa... | false | false | false | false | false | 0 |
zforce_parse_dt(struct device *dev)
{
struct zforce_ts_platdata *pdata;
struct device_node *np = dev->of_node;
if (!np)
return ERR_PTR(-ENOENT);
pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
if (!pdata) {
dev_err(dev, "failed to allocate platform data\n");
return ERR_PTR(-ENOMEM);
}
if (of_prop... | false | false | false | false | false | 0 |
ti_write(struct tty_struct *tty, struct usb_serial_port *port,
const unsigned char *data, int count)
{
struct ti_port *tport = usb_get_serial_port_data(port);
if (count == 0) {
dev_dbg(&port->dev, "%s - write request of 0 bytes\n", __func__);
return 0;
}
if (tport == NULL || !tport->tp_is_open)
return -E... | false | false | false | false | false | 0 |
neural_train_sanitize_args(NeuralTrainArgs *args)
{
args->trainsteps = MIN(args->trainsteps, 10000);
args->masking = MIN(args->masking, GWY_MASK_INCLUDE);
} | false | false | false | false | false | 0 |
assemblyref_public_tok (MonoImage *image, guint32 key_index, guint32 flags)
{
const gchar *public_tok;
int len;
public_tok = mono_metadata_blob_heap (image, key_index);
len = mono_metadata_decode_blob_size (public_tok, &public_tok);
if (flags & ASSEMBLYREF_FULL_PUBLIC_KEY_FLAG) {
guchar token [8];
mono_diges... | false | false | false | false | false | 0 |
finished(int id, bool error)
{
if (id != m_connectionId) {
return;
}
if (error) {
if (m_statusCode != 200) {
DebugDialog::debug(QString("http check new version error %1").arg(m_http.errorString()));
emit httpError(m_http.error());
return;
}
}
DebugDialog::debug("http check new version no error");... | false | false | false | false | false | 0 |
dump_fundamental_type (GType type, const char *symbol, GOutputStream *out)
{
guint n_interfaces;
guint i;
GType *interfaces;
GString *parent_str;
GType parent;
gboolean first = TRUE;
escaped_printf (out, " <fundamental name=\"%s\" get-type=\"%s\"",
g_type_name (type), symbol);
if (G_TYPE_IS_ABST... | false | false | false | false | false | 0 |
pos_clause(struct clause *c)
{
struct literal *lit;
lit = c->first_lit;
while (lit)
if (!lit->sign && !answer_lit(lit))
return(0); /* fail because found negative non-anser literal */
else
lit = lit->next_lit;
return(1);
} | false | false | false | false | false | 0 |
unpack(PyObject *self, PyObject *args)
{
PyObject *s_object, *fmt, *inputstr, *result;
if (!PyArg_UnpackTuple(args, "unpack", 2, 2, &fmt, &inputstr))
return NULL;
s_object = cache_struct(fmt);
if (s_object == NULL)
return NULL;
result = s_unpack(s_object, inputstr);
Py_DECREF(s... | false | false | false | false | false | 0 |
flush()
{
if (flushed_)
return;
// Flush
write(QByteArray(),true);
int result = inflateEnd(zlib_stream_);
if (result != Z_OK)
qWarning("compressor.c: inflateEnd failed (%s)", result);
flushed_ = true;
} | false | false | false | false | false | 0 |
updateARListCB(Widget w, XtPointer cld, XtPointer cad)
{
lList *alp = NULL;
/* set busy cursor */
XmtDisplayBusyCursor(w);
qmonMirrorMultiAnswer(AR_T, &alp);
if (alp) {
qmonMessageBox(w, alp, 0);
lFreeList(&alp);
/* set default cursor */
XmtDisplayDefaultCursor(w);
return;... | false | false | false | false | false | 0 |
SpaceOfAlreadySerializedObject(HeapObject* object) {
for (int i = FIRST_SPACE; i <= LAST_SPACE; i++) {
AllocationSpace s = static_cast<AllocationSpace>(i);
if (HEAP->InSpace(object, s)) {
return i;
}
}
UNREACHABLE();
return 0;
} | false | false | false | false | false | 0 |
acpi_ec_init(void)
{
int result;
/* register workqueue for _Qxx evaluations */
result = acpi_ec_query_init();
if (result)
goto err_exit;
/* Now register the driver for the EC */
result = acpi_bus_register_driver(&acpi_ec_driver);
if (result)
goto err_exit;
err_exit:
if (result)
acpi_ec_query_exit();
re... | false | false | false | false | false | 0 |
sys_retrieve_identity (xmlNodePtr node, int *err)
{
identity *ident;
xmlNodePtr cur;
int n_atoms, depvar;
int i, got = 0;
got += gretl_xml_get_prop_as_int(node, "n_atoms", &n_atoms);
got += gretl_xml_get_prop_as_int(node, "depvar", &depvar);
if (got < 2) {
*err = E_DATA;
return NULL;
... | false | false | false | false | false | 0 |
temp_image(GB_IMG *img)
{
gPicture *image;
if (!img->data)
image = new gPicture();
else
image = gPicture::fromData((const char *)img->data, img->width, img->height);
image->setTag(new gGambasTag((void *)img));
return image;
} | false | false | false | false | false | 0 |
pp_cxx_qualified_id (cxx_pretty_printer *pp, tree t)
{
switch (TREE_CODE (t))
{
case PTRMEM_CST:
pp_cxx_nested_name_specifier (pp, PTRMEM_CST_CLASS (t));
pp_cxx_unqualified_id (pp, PTRMEM_CST_MEMBER (t));
break;
case OVERLOAD:
t = OVL_CURRENT (t);
case FUNCTION_DECL:
if ... | false | false | false | false | true | 1 |
RimuoviLista(object_t *o)
{
if(totale_lista>0)
{
register int i=0;
while(object_list[i]!=o&&i<DIMENSIONI_LISTA_OGGETTI)
i++;
if(i<DIMENSIONI_LISTA_OGGETTI)
{
totale_lista--;
object_list[i]=object_list[totale_lista];
object_list[to... | false | false | false | false | false | 0 |
isBoolArray(AST::Node* b, int& singleInt) {
AST::Array* a = b->getArray();
singleInt = -1;
if (a->a.size() == 0)
return true;
for (int i=a->a.size(); i--;) {
if (a->a[i]->isBoolVar() || a->a[i]->isBool()) {
} else if (a->a[i]->isIntVar()) {
if (aliasBool2Int(a->a[i]->getIntVar(... | false | false | false | false | false | 0 |
IntersectBlock3(b_type B1, b_type B2)
/* modifies B1 to equal B1 intersect B2 */
{
long j;
if(B1->N != B2->N) blockerror("N1!=N2 for Intersection operation");
for(j=0;j<B1->nint;j++) B1->i[j] = B1->i[j] & B2->i[j];
} | false | false | false | false | false | 0 |
set_final_mode(struct Mode *mode, struct Mode *oldmode)
{
char *pbuf = parabuf;
int len;
int i;
*mbuf++ = '-';
for (i = 0; flags[i].letter; i++)
{
if ((flags[i].mode & oldmode->mode) &&
!(flags[i].mode & mode->mode))
*mbuf++ = flags[i].letter;
}
if (oldmode->limit != 0 && mode->limi... | false | false | false | false | false | 0 |
get_interface_mac_address(int index, uint8_t *mac_address)
{
struct ifreq ifr;
int sk, err;
sk = socket(PF_INET, SOCK_DGRAM | SOCK_CLOEXEC, 0);
if (sk < 0) {
perror("Open socket error");
return;
}
memset(&ifr, 0, sizeof(ifr));
ifr.ifr_ifindex = index;
err = ioctl(sk, SIOCGIFNAME, &ifr);
if (err < 0) {
... | false | true | false | false | false | 1 |
shrink_lruvec(struct lruvec *lruvec, int swappiness,
struct scan_control *sc, unsigned long *lru_pages)
{
unsigned long nr[NR_LRU_LISTS];
unsigned long targets[NR_LRU_LISTS];
unsigned long nr_to_scan;
enum lru_list lru;
unsigned long nr_reclaimed = 0;
unsigned long nr_to_reclaim = sc->nr_to_reclaim;
struct ... | false | true | false | false | false | 1 |
image_loaded_cb (Screen *screen, Window window, Drawable p,
const char *name, XRectangle *geometry,
void *closure)
{
Display *dpy = DisplayOfScreen (screen);
apple2_sim_t *sim = (apple2_sim_t *) closure;
slideshow_data *mine = (slideshow_data *) sim->controller_data;
XWindowAtt... | false | false | false | false | false | 0 |
static_polyhedron_remove (gamgi_polyhedron *polyhedron)
{
gamgi_face *face;
gamgi_vertex *vertex;
gamgi_slist *slist;
/*******************************
* remove face nodes AND faces *
*******************************/
slist = polyhedron->face;
while (slist != NULL)
{
face = (gamgi_face *) slist->data;
static_fa... | false | false | false | false | false | 0 |
NC_check_file_type(const char *path, int use_parallel, void *mpi_info,
int *cdf, int *hdf)
{
char magic[MAGIC_NUMBER_LEN];
*hdf = 0; *cdf = 0;
/* Get the 4-byte magic from the beginning of the file. Don't use posix
* for parallel, use the MPI functions instead. */
#ifdef USE_PARALLEL_MPIO
if ... | true | true | false | false | true | 1 |
vb2_plane_vaddr(struct vb2_buffer *vb, unsigned int plane_no)
{
if (plane_no >= vb->num_planes || !vb->planes[plane_no].mem_priv)
return NULL;
return call_ptr_memop(vb, vaddr, vb->planes[plane_no].mem_priv);
} | false | false | false | false | false | 0 |
brasero_burn_unset_checksums (BraseroBurn *self)
{
GSList *tracks;
BraseroTrackType *type;
BraseroBurnPrivate *priv;
priv = BRASERO_BURN_PRIVATE (self);
tracks = brasero_burn_session_get_tracks (priv->session);
type = brasero_track_type_new ();
for (; tracks; tracks = tracks->next) {
BraseroTrack *track;
... | false | false | false | false | false | 0 |
ExtensionFileName() {
if (overrideExtension.length())
return overrideExtension;
else if (fileName[0]) {
// Force extension to lower case
char fileNameWithLowerCaseExtension[MAX_PATH];
strcpy(fileNameWithLowerCaseExtension, fileName);
char *extension = strrchr(fileNameWithLowerCaseExtension, '.');
if (exte... | false | false | false | false | false | 0 |
be_shrunk(int i, double Gmax1, double Gmax2)
{
if(is_upper_bound(i))
{
if(y[i]==+1)
return(-G[i] > Gmax1);
else
return(-G[i] > Gmax2);
}
else if(is_lower_bound(i))
{
if(y[i]==+1)
return(G[i] > Gmax2);
else
return(G[i] > Gmax1);
}
else
return(false);
} | false | false | false | false | false | 0 |
geneve6_build_skb(struct dst_entry *dst, struct sk_buff *skb,
__be16 tun_flags, u8 vni[3], u8 opt_len, u8 *opt,
u32 flags, bool xnet)
{
struct genevehdr *gnvh;
int min_headroom;
int err;
bool udp_sum = !(flags & GENEVE_F_UDP_ZERO_CSUM6_TX);
skb_scrub_packet(skb, xnet);
min_headroom = LL_RESERVED... | false | false | false | false | false | 0 |
mousePressEvent (QGraphicsSceneMouseEvent* event)
{
if (event->buttons()==Qt::LeftButton) {
m_widget->mouseBorderClick(position());
}
} | false | false | false | false | false | 0 |
current_scope (void)
{
if (current_function_decl == NULL_TREE)
return current_class_type;
if (current_class_type == NULL_TREE)
return current_function_decl;
if ((DECL_FUNCTION_MEMBER_P (current_function_decl)
&& same_type_p (DECL_CONTEXT (current_function_decl),
current_class_type))
... | false | false | false | false | false | 0 |
GetVFormatted(const char* format, va_list args) {
Vector<char> str = Vector<char>::New(1024);
int len = OS::VSNPrintF(str, format, args);
if (len == -1) {
DeleteArray(str.start());
return format;
}
uint32_t hash = HashSequentialString(
str.start(), len, HEAP->HashSeed());
return AddOrDisposeSt... | false | false | false | false | false | 0 |
eina_benchmark_free(Eina_Benchmark *bench)
{
Eina_Array *names;
if (!bench)
return;
while (bench->runs)
{
Eina_Run *run = (Eina_Run *)bench->runs;
bench->runs = eina_inlist_remove(bench->runs, bench->runs);
free(run);
}
EINA_LIST_FREE(bench->names, names)
{
... | false | false | false | false | false | 0 |
get_cert_times (CERTCertificate *cert,
gchar **issued_on,
gchar **expires_on)
{
PRTime time_issued_on;
PRTime time_expires_on;
PRExplodedTime explodedTime;
struct tm exploded_tm;
gchar buf[128];
g_return_if_fail (cert != NULL);
g_return_if_fail (issued_on != NULL);
g_return_if_f... | false | false | false | false | false | 0 |
gx_wave_view_size_request (GtkWidget *widget, GtkRequisition *requisition)
{
g_assert(GX_IS_WAVE_VIEW(widget));
requisition->width = liveview_x;
requisition->height = liveview_y;
} | false | false | false | false | false | 0 |
test_blame_simple__can_restrict_to_newish_commits(void)
{
git_blame_options opts = GIT_BLAME_OPTIONS_INIT;
cl_git_pass(git_repository_open(&g_repo, cl_fixture("testrepo.git")));
{
git_object *obj;
cl_git_pass(git_revparse_single(&obj, g_repo, "be3563a"));
git_oid_cpy(&opts.oldest_commit, git_object_id(obj));... | false | false | false | false | false | 0 |
gstbt_tone_conversion_set_property(GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec)
{
GstBtToneConversion *self = GSTBT_TONE_CONVERSION(object);
if(self->dispose_has_run) return;
s... | false | false | false | false | false | 0 |
gopro_camera_receive(char *data, size_t size, size_t n, void *context) {
vbuffer *buffer = (vbuffer *)context;
int err = vbuffer_append(buffer, data, size * n);
return (err == 0) ? size * n : 0;
} | false | false | false | false | false | 0 |
init()
{
if (fd != 0)
return;
fd = service_connect(ihost, iport);
if (fd < 0) {
err++;
} else if ((ipass != NULL) && (*ipass != '\0')) { /* Passwort senden */
char buf[40];
qprintf(buf, sizeof(buf), "pass %s", ipass);
send_command(fd, buf);
get_answer(fd);
}
} | false | false | false | false | false | 0 |
write_virtual_byte_32(unsigned s, Bit32u offset, Bit8u data)
{
Bit32u laddr;
bx_segment_reg_t *seg = &BX_CPU_THIS_PTR sregs[s];
BX_INSTR_MEM_DATA_ACCESS(BX_CPU_ID, s, offset, 1, BX_WRITE);
BX_ASSERT(BX_CPU_THIS_PTR cpu_mode != BX_MODE_LONG_64);
if (seg->cache.valid & SegAccessWOK) {
if (offset <= seg->c... | false | false | false | false | false | 0 |
lbtf_op_start(struct ieee80211_hw *hw)
{
struct lbtf_private *priv = hw->priv;
void *card = priv->card;
int ret = -1;
lbtf_deb_enter(LBTF_DEB_MACOPS);
if (!priv->fw_ready)
/* Upload firmware */
if (priv->hw_prog_firmware(card))
goto err_prog_firmware;
/* poke the firmware */
priv->capability = WLAN_CAP... | false | false | false | false | false | 0 |
_g_line_matches_pattern (const char *line,
const char *pattern)
{
const char *l = line, *p = pattern;
for (/* void */; (*p != 0) && (*l != 0); p++, l++) {
if (*p != '%') {
if (*p != *l)
return FALSE;
}
else {
p++;
switch (*p) {
case 'a':
break;
case 'n':
if (!isdigit (*l))
r... | false | false | false | false | false | 0 |
glade_gtk_widget_write_atk_relation (GladeProperty *property,
GladeXmlContext *context,
GladeXmlNode *node)
{
GladeProjectFormat fmt;
GladeXmlNode *prop_node;
gchar *value, **split;
gint i;
fmt = glade_project_get_format (property->widget->project);
if ((value = ... | false | false | false | false | false | 0 |
memory_dealloc(PyMemoryViewObject *self)
{
_PyObject_GC_UNTRACK(self);
if (self->view.obj != NULL) {
if (self->base && PyTuple_Check(self->base)) {
/* Special case when first element is generic object
with buffer interface and the second element is a
contiguous ... | false | false | false | false | true | 1 |
max3100_enable_ms(struct uart_port *port)
{
struct max3100_port *s = container_of(port,
struct max3100_port,
port);
if (s->poll_time > 0)
mod_timer(&s->timer, jiffies);
dev_dbg(&s->spi->dev, "%s\n", __func__);
} | false | false | false | false | false | 0 |
marker_truncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno, struct iatt *prebuf,
struct iatt *postbuf)
{
marker_local_t *local = NULL;
marker_conf_t *priv = NULL;
if (op_ret == -1) {
... | false | false | false | false | false | 0 |
test_refs_transactions__single_ref_delete(void)
{
git_reference *ref;
cl_git_pass(git_transaction_lock_ref(g_tx, "refs/heads/master"));
cl_git_pass(git_transaction_remove(g_tx, "refs/heads/master"));
cl_git_pass(git_transaction_commit(g_tx));
cl_git_fail_with(GIT_ENOTFOUND, git_reference_lookup(&ref, g_repo, "re... | false | false | false | false | false | 0 |
_gtk_error_dialog_from_gerror_run (GtkWindow *parent,
const char *title,
GError **gerror)
{
GtkWidget *d;
g_return_if_fail (*gerror != NULL);
d = _gtk_message_dialog_new (parent,
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_DIALOG_ERROR,
title,
(*gerror)->messa... | false | false | false | false | false | 0 |
get_blob_type_from_length(ulong length)
{
enum_field_types type;
if (length < 256)
type= MYSQL_TYPE_TINY_BLOB;
else if (length < 65536)
type= MYSQL_TYPE_BLOB;
else if (length < 256L*256L*256L)
type= MYSQL_TYPE_MEDIUM_BLOB;
else
type= MYSQL_TYPE_LONG_BLOB;
return type;
} | false | false | false | false | false | 0 |
zpackedarray(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
int code;
ref parr;
check_type(*op, t_integer);
if (op->value.intval < 0)
return_error(e_rangecheck);
if (op->value.intval > op - osbot &&
op->value.intval >= ref_stack_count(&o_stack)
)
return_error(e_stackunderf... | false | false | false | false | false | 0 |
cray_vect_GetColorAtV(int sel, Geom *geom, va_list *args) {
Vect *v = (Vect *)geom;
ColorA *color;
int index;
int i, j, k;
color = va_arg(*args, ColorA *);
index = va_arg(*args, int);
if (index == -1 || !v->ncolor) return NULL;
for (i = j = k = 0; i < v->nvec;
i++, j+= abs(v->vnvert[i]), k += v-... | false | false | false | false | false | 0 |
ap_dbd_open(apr_pool_t *pool, server_rec *s)
{
svr_cfg *svr = ap_get_module_config(s->module_config, &dbd_module);
dbd_group_t *group = svr->group;
dbd_cfg_t *cfg = svr->cfg;
ap_dbd_t *rec = NULL;
#if APR_HAS_THREADS
apr_status_t rv;
#endif
/* If nothing is configured, we shouldn't be here */
... | false | false | false | false | false | 0 |
read_option(char *opt, size_t optlen, char *value, size_t valuelen, void *data)
{
struct config_state *config = data;
enum option_code status = OPT_ERR_NO_OPTION_VALUE;
config->lineno++;
/* Check for comment markers, since read_properties() will
* only ensure opt and value are split at first " \t". */
optlen =... | false | false | false | false | false | 0 |
AddWizard(TemplateOutputType otype,
const wxString& title,
const wxString& cat,
const wxString& script,
const wxString& templatePNG,
const wxString& wizardPNG,
const wxString& xrc)
{
// check that... | false | false | false | false | false | 0 |
claws_mailmbox_timestamp(struct claws_mailmbox_folder * folder)
{
int r;
struct stat buf;
r = stat(folder->mb_filename, &buf);
if (r < 0)
folder->mb_mtime = (time_t) -1;
else
folder->mb_mtime = buf.st_mtime;
} | false | false | false | false | false | 0 |
crm_connect_corosync(crm_cluster_t * cluster)
{
gboolean rc = FALSE;
if (is_openais_cluster()) {
crm_set_status_callback(&peer_update_callback);
cluster->cpg.cpg_deliver_fn = crmd_cs_dispatch;
cluster->cpg.cpg_confchg_fn = pcmk_cpg_membership;
cluster->destroy = crmd_cs_destroy;... | false | false | false | false | false | 0 |
write(ostream & os) const
{
os << to_utf8(layoutName()) << "\n";
InsetCollapsable::write(os);
} | false | false | false | false | false | 0 |
cm_tdbusm_get_as(DBusMessage *msg, void *parent, char ***as)
{
DBusError err;
char **tmp;
int i;
*as = NULL;
dbus_error_init(&err);
if (dbus_message_get_args(msg, &err,
DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &tmp, &i,
DBUS_TYPE_INVALID)) {
*as = cm_tdbusm_take_dbus_string_array(parent, tmp, i);
return... | false | false | false | false | false | 0 |
timer_add_widget(void (*callback) (void *data), void *data, const int interval, const int one_shot)
/* Add widget to timer group of the specified update interval
(also creates a new timer group if necessary).
callback (void pointer): function of type void func(void *data)
which will be called whenever the ti... | false | false | false | false | false | 0 |
ssh_set_config(StonithPlugin* s, StonithNVpair* list)
{
struct pluginDevice* sd = (struct pluginDevice *)s;
const char * hlist;
ERRIFWRONGDEV(s,S_OOPS);
if ((hlist = OurImports->GetValue(list, ST_HOSTLIST)) == NULL) {
return S_OOPS;
}
sd->hostlist = OurImports->StringToHostList(hlist);
if (sd->hostlist == NU... | 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.