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 |
|---|---|---|---|---|---|---|
mei_clear_lists(struct mei_device *dev, struct file *file)
{
bool removed = false;
/* remove callbacks associated with a file */
mei_clear_list(dev, file, &dev->amthif_cmd_list.list);
if (mei_clear_list(dev, file, &dev->amthif_rd_complete_list.list))
removed = true;
mei_clear_list(dev, file, &dev->ctrl_rd_list... | false | false | false | false | false | 0 |
getTemplateIdentification(OFString &templateIdentifier,
OFString &mappingResource) const
{
OFCondition result = SR_EC_InvalidValue;
/* check for valid value pair */
if ((TemplateIdentifier.empty() && MappingResource.empty()) ||
(!TemplateIde... | false | false | false | false | false | 0 |
camel_trie_search (CamelTrie *trie,
const gchar *buffer,
gsize buflen,
gint *matched_id)
{
const guchar *inptr, *inend, *prev, *pat;
register gsize inlen = buflen;
struct _trie_state *q;
struct _trie_match *m = NULL; /* init to please gcc */
gunichar c;
in... | false | false | false | false | false | 0 |
PrintSelf(ostream& os, vtkIndent indent)
{
//Superclass typedef defined in vtkTypeMacro() found in vtkSetGet.h
this->Superclass::PrintSelf(os,indent);
os << indent << "Label Text: " << (this->LabelMapper->GetInput() ?
this->LabelMapper->GetInput() :
... | false | false | false | false | false | 0 |
spyhunt_get_bg_tile_info(int tile_index)
{
int data = videoram[tile_index];
int code = (data & 0x3f) | ((data >> 1) & 0x40);
SET_TILE_INFO(0, code, 0, (data & 0x40) ? TILE_FLIPY : 0);
} | false | false | false | false | false | 0 |
sg_fs_stats_item_compare(const sg_fs_stats *a, const sg_fs_stats *b) {
int rc;
rc = strcmp(a->device_name, b->device_name);
if( 0 != rc )
return rc;
rc = strcmp(a->device_canonical, b->device_canonical);
if( 0 != rc )
return rc;
rc = strcmp(a->mnt_point, b->mnt_point);
if( 0 != rc )
return rc;
rc = s... | false | false | false | false | false | 0 |
encfs_unlink(const char *path)
{
EncFS_Context *ctx = context();
int res = -EIO;
shared_ptr<DirNode> FSRoot = ctx->getRoot(&res);
if(!FSRoot)
return res;
try
{
// let DirNode handle it atomically so that it can handle race
// conditions
res = FSRoot->unlink( path );
} catch( rlog::Erro... | false | false | false | false | false | 0 |
krb5_find_princ_in_cred_list (context, creds_list, princ)
krb5_context context;
krb5_creds **creds_list;
krb5_principal princ;
{
int i = 0;
krb5_boolean temp_stored = FALSE;
if (creds_list){
while(creds_list[i]){
if (krb5_principal_compare(context,
... | false | false | false | false | false | 0 |
intervalNum
(
int number
) const
{
int highlighted = 0;
const QTreeWidgetItem *allIntervals = mainWindow->allIntervalItems();
for ( int ii = 0; ii < allIntervals->childCount(); ii++)
{
IntervalItem *current = (IntervalItem *) allIntervals->child( ii );
if ( curr... | false | false | false | false | false | 0 |
nilfs_segbuf_submit_bh(struct nilfs_segment_buffer *segbuf,
struct nilfs_write_info *wi,
struct buffer_head *bh, int mode)
{
int len, err;
BUG_ON(wi->nr_vecs <= 0);
repeat:
if (!wi->bio) {
wi->bio = nilfs_alloc_seg_bio(wi->nilfs, wi->blocknr + wi->end,
wi->nr_vecs);
if (unlikely(!wi->bio... | false | false | false | false | false | 0 |
ath9k_htc_tx_drainq(struct ath9k_htc_priv *priv,
struct sk_buff_head *queue)
{
struct sk_buff *skb;
while ((skb = skb_dequeue(queue)) != NULL) {
ath9k_htc_tx_process(priv, skb, NULL);
}
} | false | false | false | false | false | 0 |
imGaussianStdDev2KernelSize(float stddev)
{
if (stddev < 0)
return (int)-stddev;
else
{
int width = (int)(3.35*stddev + 0.3333);
return 2*width + 1;
}
} | false | false | false | false | false | 0 |
view_selection(MainInfo *min, DirPane *dp, gint (*viewer)(MainInfo *min, GFile *file, const gchar *encoding, GError **err), const gchar *encoding)
{
gboolean ok = TRUE;
GSList *slist, *iter;
GError *err = NULL;
if((slist = dp_get_selection(dp)) == NULL)
return 1;
for(iter = slist; ok && iter != NULL; iter = g... | false | false | false | false | false | 0 |
mpd_callocfunc_em(size_t nmemb, size_t size)
{
void *ptr;
size_t req;
mpd_size_t overflow;
#if MPD_SIZE_MAX < SIZE_MAX
/* full_coverage test only */
if (nmemb > MPD_SIZE_MAX || size > MPD_SIZE_MAX) {
return NULL;
}
#endif
req = mul_size_t_overflow((mpd_size_t)nmemb, (mpd_size_t)siz... | false | false | false | false | false | 0 |
gbemol_library_resolve_tags (GbemolLibrary *lib)
{
gint key[3], i;
gchar *str[3];
gboolean all[3];
GtkTreeIter iter;
GList *l, *songs;
/* Get the values from each constraint */
for (i = 0; i < 3; i++)
{
/* The tag key */
if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (lib->priv->cmb_constraint[i]), &iter... | false | false | false | false | false | 0 |
iconv_header(request_rec *r, iconv_t cd) {
char *buff;
char *keys[] = { "Destination", NULL };
int i;
char *unparsed_uri;
char *query_string;
/* Normalize encoding in HTTP request line */
query_string = apr_pstrdup(r->pool, r->unparsed_uri);
unparsed_uri = ap_getword(r->pool, &query_string, '?');
... | false | false | false | false | false | 0 |
fstGetVarint64(unsigned char *mem, int *skiplen)
{
unsigned char *mem_orig = mem;
uint64_t rc = 0;
while(*mem & 0x80)
{
mem++;
}
*skiplen = mem - mem_orig + 1;
for(;;)
{
rc <<= 7;
rc |= (uint64_t)(*mem & 0x7f);
if(mem == mem_orig)
{
... | false | false | false | false | false | 0 |
keyspan_usa19hs_calc_baud(struct usb_serial_port *port,
u32 baud_rate, u32 baudclk, u8 *rate_hi,
u8 *rate_low, u8 *prescaler, int portnum)
{
u32 b16, /* baud rate times 16 (actual rate used internally) */
div; /* divisor */
dev_dbg(&port->dev, "%s - %d.\n", __func__, baud_rate);
/* prevent di... | false | false | false | false | false | 0 |
setTrustedCertificates(const CertificateCollection &trusted)
{
d->trusted = trusted;
if(d->state != TLS::Private::Inactive)
d->c->setTrustedCertificates(trusted);
} | false | false | false | false | false | 0 |
WriteOffFile(const char *filename)
{
// Open file
FILE *fp;
if (!(fp = fopen(filename, "w"))) {
RNFail("Unable to open file %s", filename);
return 0;
}
// Write header
fprintf(fp, "OFF\n");
fprintf(fp, "%d %d %d\n", NVertices(), NFaces(), NEdges());
// Write vertices
for (int i = 0; i < NVer... | false | false | false | false | false | 0 |
ifstate_set(struct lio *lio, int state_flag)
{
atomic_set(&lio->ifstate, (atomic_read(&lio->ifstate) | state_flag));
} | false | false | false | false | false | 0 |
Execute(vtkObject *caller, unsigned long eventId, void *callData)
{
if (vtkCommand::TimerEvent == eventId)
{
int tid = * static_cast<int *>(callData);
if (tid == this->FastTimerId)
{
cout << "New collision\n";
vtkPolyData * mesh = vtkPolyData::SafeDownCast(this->DeformationM... | false | false | false | false | false | 0 |
linein_caps(unsigned long pin_caps, unsigned long wid_caps)
{
int vref = (pin_caps & AC_PINCAP_VREF) >> AC_PINCAP_VREF_SHIFT;
return (pin_caps & AC_PINCAP_IN) && (vref & AC_PINCAP_VREF_HIZ);
} | false | false | false | false | false | 0 |
window_unfullscreen (DhWindow *window)
{
if (! window_is_fullscreen (window))
return;
gtk_window_unfullscreen (GTK_WINDOW (window));
gtk_widget_show (gtk_ui_manager_get_widget (window->priv->manager, "/MenuBar"));
gtk_widget_show (gtk_ui_manager_get_widget (window->priv-... | false | false | false | false | false | 0 |
onVpnTaskErrorMsg(int iErrorCode)
{
// qDebug() << "ConnectionManager::onVpnTaskErrorMsg(int" << iErrorCode << ")";
char acBuf[1024];
const qint64 iLineLength = m_pVPNControlTask->readErrorLine(acBuf, sizeof(acBuf));
if (iLineLength > 0)
{
m_pConnectionInformation->appendLogColorText(QColor(255, 0... | false | false | false | false | false | 0 |
compositor_3d_get_camera(GF_Compositor *compositor)
{
#ifndef GPAC_DISABLE_VRML
if (compositor->active_layer) {
return compositor_layer3d_get_camera(compositor->active_layer);
}
#endif
if (compositor->visual->type_3d)
return &compositor->visual->camera;
return NULL;
} | false | false | false | false | false | 0 |
create_tidscan_plan(PlannerInfo *root, TidPath *best_path,
List *tlist, List *scan_clauses)
{
TidScan *scan_plan;
Index scan_relid = best_path->path.parent->relid;
List *tidquals = best_path->tidquals;
List *ortidquals;
/* it should be a base rel... */
Assert(scan_relid > 0);
Assert(best_path->pa... | false | false | false | false | false | 0 |
adv7842_dv_timings_cap(struct v4l2_subdev *sd,
struct v4l2_dv_timings_cap *cap)
{
if (cap->pad != 0)
return -EINVAL;
*cap = *adv7842_get_dv_timings_cap(sd);
return 0;
} | false | false | false | false | false | 0 |
binder_node_release(struct binder_node *node, int refs)
{
struct binder_ref *ref;
int death = 0;
list_del_init(&node->work.entry);
binder_release_work(&node->async_todo);
if (hlist_empty(&node->refs)) {
kfree(node);
binder_stats_deleted(BINDER_STAT_NODE);
return refs;
}
node->proc = NULL;
node->local_... | false | false | false | false | false | 0 |
tty_clear_nhwindow(window)
winid window;
{
register struct WinDesc *cw = 0;
if(window == WIN_ERR || (cw = wins[window]) == (struct WinDesc *) 0)
panic(winpanicstr, window);
ttyDisplay->lastwin = window;
switch(cw->type) {
case NHW_MESSAGE:
if(ttyDisplay->toplin) {
home();
cl_end()... | false | false | false | false | false | 0 |
panel_layout_get_default_layout_file (void)
{
char *user_file;
user_file = panel_util_get_from_personal_path (PANEL_LAYOUT_DEFAULT_LAYOUT_FILE);
if (g_file_test (user_file, G_FILE_TEST_IS_REGULAR))
return user_file;
g_free (user_file);
return g_build_filename ... | false | false | false | false | false | 0 |
iforce_serio_connect(struct serio *serio, struct serio_driver *drv)
{
struct iforce *iforce;
int err;
iforce = kzalloc(sizeof(struct iforce), GFP_KERNEL);
if (!iforce)
return -ENOMEM;
iforce->bus = IFORCE_232;
iforce->serio = serio;
serio_set_drvdata(serio, iforce);
err = serio_open(serio, drv);
if (err)... | false | false | false | false | false | 0 |
fix_cdpn_symlinks(struct gfs2_sbd *sbp, osi_list_t *cdpn_to_fix)
{
osi_list_t *tmp, *x;
int error = 0;
cdpns_fixed = 0;
osi_list_foreach_safe(tmp, cdpn_to_fix, x) {
struct gfs2_inum fix, dir;
struct inode_dir_block *l_fix;
struct gfs2_buffer_head *bh;
struct gfs2_inode *fix_inode;
uint64_t eablk;
l_fi... | false | false | false | false | false | 0 |
remove_importlib_frames(void)
{
const char *importlib_filename = "<frozen importlib._bootstrap>";
const char *remove_frames = "_call_with_frames_removed";
int always_trim = 0;
int in_importlib = 0;
PyObject *exception, *value, *base_tb, *tb;
PyObject **prev_link, **outer_link = NULL;
/* Syn... | false | false | false | false | false | 0 |
Server_isfromme()
{
if(isequal(Server->from_n,Server->currentnick))
return 1;
else
return 0;
} | false | false | false | false | false | 0 |
fiji_check_fw_load_finish(struct pp_smumgr *smumgr,
uint32_t fw_type)
{
struct fiji_smumgr *priv = (struct fiji_smumgr *)(smumgr->backend);
uint32_t mask = fiji_get_mask_for_firmware_type(fw_type);
/* Check SOFT_REGISTERS_TABLE_28.UcodeLoadStatus */
if (smum_wait_on_indirect_register(smumgr, mmSMC_IND_INDEX,
... | false | false | false | false | false | 0 |
i40e_enable_misc_int_causes(struct i40e_pf *pf)
{
struct i40e_hw *hw = &pf->hw;
u32 val;
/* clear things first */
wr32(hw, I40E_PFINT_ICR0_ENA, 0); /* disable all */
rd32(hw, I40E_PFINT_ICR0); /* read to clear */
val = I40E_PFINT_ICR0_ENA_ECC_ERR_MASK |
I40E_PFINT_ICR0_ENA_MAL_DETECT_MASK ... | false | false | false | false | false | 0 |
data() const
{
std::list<P> tmp;
std::list<edge3d>::const_iterator ep(m_data.begin());
// first point is duplicated by constructor
while (ep != m_data.end())
{
tmp.push_back((*ep).head());
++ep;
}
std::vector<P> value;
value.assign(tmp.begin(), tmp.end());
return value;
... | false | false | false | false | false | 0 |
profiler_dealloc(ProfilerObject *op)
{
if (op->flags & POF_ENABLED)
PyEval_SetProfile(NULL, NULL);
flush_unmatched(op);
clearEntries(op);
Py_XDECREF(op->externalTimer);
Py_TYPE(op)->tp_free(op);
} | false | false | false | false | false | 0 |
gst_jpeg_dec_free_buffers (GstJpegDec * dec)
{
gint i;
for (i = 0; i < 16; i++) {
g_free (dec->idr_y[i]);
g_free (dec->idr_u[i]);
g_free (dec->idr_v[i]);
dec->idr_y[i] = NULL;
dec->idr_u[i] = NULL;
dec->idr_v[i] = NULL;
}
dec->idr_width_allocated = 0;
} | false | false | false | false | false | 0 |
GetFilename(const std::wstring& fileName) {
size_t index = MAX(int(fileName.find_last_of(L"\\")),int(fileName.find_last_of(L"/")))+1;
wstring name = fileName.substr(index,fileName.length()-index);
return name;
} | false | false | false | false | false | 0 |
lp872x_config(struct lp872x *lp)
{
struct lp872x_platform_data *pdata = lp->pdata;
int ret;
if (!pdata || !pdata->update_config)
goto init_dvs;
ret = lp872x_write_byte(lp, LP872X_GENERAL_CFG, pdata->general_config);
if (ret)
return ret;
init_dvs:
return lp872x_init_dvs(lp);
} | false | false | false | false | false | 0 |
tps51632_init_dcdc(struct tps51632_chip *tps,
struct tps51632_regulator_platform_data *pdata)
{
int ret;
uint8_t control = 0;
int vsel;
if (!pdata->enable_pwm_dvfs)
goto skip_pwm_config;
control |= TPS51632_DVFS_PWMEN;
vsel = TPS51632_VOLT_VSEL(pdata->base_voltage_uV);
ret = regmap_write(tps->regmap, TPS51... | false | false | false | false | false | 0 |
endOfLine(void) { if (isProtected()==MSFalse) moveCursorX(lineLength(cursorY())-1); } | false | false | false | false | false | 0 |
success(std::string message)
{
try {
if (mboxAccount.isDestroyed())
{
fail("Operation aborted.");
return;
}
mboxAccount->genericReadMessageContent(&*mboxAccount,
&*mboxAccount,
messages,
peek,
readType,
callback);
delete this;
} catch (... | false | false | false | false | false | 0 |
__repmgr_write_iovecs(env, conn, iovecs, writtenp)
ENV *env;
REPMGR_CONNECTION *conn;
REPMGR_IOVECS *iovecs;
size_t *writtenp;
{
REPMGR_IOVECS iovec_buf, *v;
size_t nw, sz, total_written;
int ret;
/*
* Send as much data to the site as we can, without blocking. Keep
* writing as long as we're making some p... | false | false | false | false | false | 0 |
is_disk(char *dev)
{
char syspath[PATH_MAX];
char *slash;
static DEV_LIST_PTR dev_head = NULL;
DEV_LIST_PTR dev_cur, dev_last;
dev_cur = dev_head;
while (dev_cur) {
if (strcmp(dev_cur->dev_name, dev) == 0)
return dev_cur->memoized;
dev_last = dev_cur;
dev_cur = dev_cur->next;
}
dev_cur = (DEV_LIST_... | true | true | false | false | true | 1 |
copy_address_ai_to_contact_ai(const struct AddressAppInfo *aai, struct ContactAppInfo *cai)
{
int i, a_entry, c_entry;
memcpy(&cai->category, &aai->category, sizeof(struct CategoryAppInfo));
memset(&cai->internal, '\0', 26);
for (i=0; i<NUM_CONTACT_ENTRIES; i++) {
c_entry = cont_addr_map[i*2];
... | false | true | false | false | false | 1 |
mime_var_destroy (mime_var_t * obj)
{
int status;
struct sigaction new_action;
if (obj->name)
{
free (obj->name);
obj->name = NULL;
}
if (obj->filename)
{
free (obj->filename);
obj->filename = NULL;
}
if (obj->type)
{
free (obj->type);
obj->type = NULL;... | false | false | false | false | false | 0 |
edac_pci_dev_show(struct kobject *kobj, struct attribute *attr,
char *buffer)
{
struct edac_pci_dev_attribute *edac_pci_dev;
edac_pci_dev = (struct edac_pci_dev_attribute *)attr;
if (edac_pci_dev->show)
return edac_pci_dev->show(edac_pci_dev->value, buffer);
return -EIO;
} | false | false | false | false | false | 0 |
fstWriterSetTimescale(void *ctx, int ts)
{
struct fstWriterContext *xc = (struct fstWriterContext *)ctx;
if(xc)
{
off_t fpos = ftello(xc->handle);
fstWriterFseeko(xc, xc->handle, FST_HDR_OFFS_TIMESCALE, SEEK_SET);
fputc(ts & 255, xc->handle);
fflush(xc->handle);
fstWriterFseeko(xc, xc->handle, fpos, SEEK_S... | false | false | false | false | false | 0 |
Start(void) throw(Err)
{
std::vector<MIDIDevice*>::iterator it;
it = mDevices.begin();
/** Remove created but unused devices
*/
while (it!=mDevices.end())
{
MIDIDevice* d = *it;
if (d->mInputs.size()==0 &&
d->mOutputs.size()==0)
{
it = mDevices.erase(it);
delete d;
}else{
it++;
}
} ... | false | false | false | false | false | 0 |
runtimeCode() {
String *s = NewString("");
String *serrors = Swig_include_sys("tclerrors.swg");
if (!serrors) {
Printf(stderr, "*** Unable to open 'tclerrors.swg'\n");
} else {
Append(s, serrors);
Delete(serrors);
}
String *sapi = Swig_include_sys("tclapi.swg");
if (!sapi) ... | false | false | false | false | false | 0 |
removeAnnotation(fl_AnnotationLayout * pFL)
{
UT_sint32 i = m_vecAnnotations.findItem(pFL);
if(i< 0)
{
return;
}
m_vecAnnotations.deleteNthItem(i);
if(isLayoutDeleting())
return;
m_vecAnnotations.qsort(compareLayouts);
for(i=0; i<static_cast<UT_sint32>(countAnnotations());i++)
{
fl_AnnotationLayout *... | false | false | false | false | false | 0 |
SetBinaryAddress(const char *str, char portDelineator)
{
if ( NonNumericHostString( str ) )
{
#if defined(_WIN32)
if (_strnicmp(str,"localhost", 9)==0)
#else
if (strncasecmp(str,"localhost", 9)==0)
#endif
{
address.addr4.sin_addr.s_addr=inet_addr__("127.0.0.1");
if (str[9])
{
... | false | false | false | false | false | 0 |
_add_toggleable_item (FrogrSettingsDialog *self, GtkBox *box,
GtkRadioButton *radio_member, gboolean force_radio,
const gchar *mnemonic, GtkWidget **out_ref)
{
GtkWidget *item = NULL;
/* If it has a group associated, it's a radio button */
if (radio_member || force_rad... | false | false | false | false | false | 0 |
ewx_i2c_getdata(struct snd_i2c_bus *bus, int ack)
{
struct snd_ice1712 *ice = bus->private_data;
int bit;
/* set RW pin to low */
snd_ice1712_write(ice, ICE1712_IREG_GPIO_WRITE_MASK, ~ICE1712_EWX2496_RW);
snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, 0);
if (ack)
udelay(5);
bit = snd_ice1712_read(ice, ICE1712... | false | false | false | false | false | 0 |
run_daemon( /* RETURN: nothing */
H_PTR h) /* IN: app instance */
{
int random_fd = -1;
struct rand_pool_info *output;
if (0 != params->run_level) {
anchor_info(h);
return;
}
if (params->foreground==0)
daemonize();
else printf ("%s sta... | false | false | false | false | false | 0 |
text(double x,double y,const char* name, const char* link)
{
char buf[512];
if (link != 0 && link[0]!=0) {
// open the optional link tag
fprintf(fic_repr,"<a xlink:href=\"%s\">\n", xmlcode(link, buf));
}
char name2[256];
fprintf(fic_repr,"<text x=\"%f\" y=\"%f\" font-family=\"Arial\" fo... | false | false | false | false | false | 0 |
cb_ident (cpp_reader * ARG_UNUSED (pfile),
unsigned int ARG_UNUSED (line),
const cpp_string * ARG_UNUSED (str))
{
if (!flag_no_ident)
{
/* Convert escapes in the string. */
cpp_string cstr = { 0, 0 };
if (cpp_interpret_string (pfile, str, 1, &cstr, CPP_STRING))
{
targetm.asm_out.outpu... | false | false | false | false | false | 0 |
P_CheckMeleeRange (mobj_t* actor)
{
mobj_t* pl;
fixed_t dist;
if (!actor->target)
return false;
pl = actor->target;
dist = P_AproxDistance (pl->x-actor->x, pl->y-actor->y);
if (dist >= MELEERANGE-20*FRACUNIT+pl->info->radius)
return false;
if (! P_CheckSight (actor, actor->target) ... | false | false | false | false | false | 0 |
intel_pin_dbg_show(struct pinctrl_dev *pctldev, struct seq_file *s,
unsigned pin)
{
struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev);
u32 cfg0, cfg1, mode;
bool locked, acpi;
if (!intel_pad_owned_by_host(pctrl, pin)) {
seq_puts(s, "not available");
return;
}
cfg0 = readl(intel_get_pa... | false | false | false | false | false | 0 |
apply_dual_change (G, n, delta)
graph *G;
node *n;
int delta;
#endif
{
int ei;
edge *e;
node *c=n;
node *stop = G->nodelist - 1;
if (delta == INTEGER_MAX) {
fprintf (stderr, "\ndelta=Infinity, node=%i\n", (int) (n-G->nodelist));
fprintf (stderr, "There seems to be no perfect matching\n");
}
... | false | false | false | false | false | 0 |
Connect(string in_host, int in_reconnect) {
char proto[11];
char temphost[129];
short int temport;
if (sscanf(in_host.c_str(), "%10[^:]://%128[^:]:%hu",
proto, temphost, &temport) != 3) {
_MSG("Kismet network client could not parse host, expected the form "
"proto://host:port, got '" + in_host + "'", ... | false | false | false | false | false | 0 |
mask_pack(object *pack, unsigned short mask)
{
while (pack->next_object) {
pack = pack->next_object;
if (pack->what_is & mask) {
return 1;
}
}
return 0;
} | false | false | false | false | false | 0 |
decimal2longlong(decimal_t *from, longlong *to)
{
dec1 *buf=from->buf;
longlong x=0;
int intg, frac;
for (intg=from->intg; intg > 0; intg-=DIG_PER_DEC1)
{
longlong y=x;
/*
Attention: trick!
we're calculating -|from| instead of |from| here
because |LONGLONG_MIN| > LONGLONG_MAX
... | false | false | false | false | false | 0 |
check_tmrec(tmrec_p _trp, ac_tm_p _atp, tr_res_p _tsw)
{
if(!_trp || !_atp)
return REC_ERR;
/* it is before start date */
if(_atp->time < _trp->dtstart)
return REC_NOMATCH;
/* no duration or end -> for ever */
if (!_IS_SET(_trp->duration) && !_IS_SET(_trp->dtend))
return REC_MATCH;
/* compute the duratio... | false | false | false | false | false | 0 |
write_codec_blueprint_string (int fd, const gchar *str) {
gint size;
size = strlen (str);
WRITE_CHECK (write_codec_blueprint_int (fd, size));
return write (fd, str, size) == size;
} | false | false | false | false | false | 0 |
technisat_usb2_calc_lrc(const u8 *b, u16 length)
{
u8 lrc = 0;
while (--length)
lrc ^= *b++;
return lrc;
} | false | false | false | false | false | 0 |
mailimap_annotatemore_entry_list_free(struct
mailimap_annotatemore_entry_list * en_list)
{
switch(en_list->en_list_type) {
case MAILIMAP_ANNOTATEMORE_ENTRY_LIST_TYPE_ENTRY_ATT_LIST:
clist_foreach(en_list->en_list_data,
(clist_func) mailimap_annotatemore_entry_att_free, NULL);
break;
case MAI... | false | false | false | false | false | 0 |
output_set_cookie_value(
HashStringValue::key_type aname,
HashStringValue::value_type ameaning,
bool adelete){
String* result=new String();
// attribute=
*result << String(aname, String::L_HTTP_COOKIE) << "=";
Value* lmeaning;
// figure out 'meaning'
// Set-Cookie: (attribute)=(value); path=/
Has... | false | false | false | false | false | 0 |
log_update(LOG_REC *log)
{
g_return_if_fail(log != NULL);
if (log_find(log->fname) == NULL) {
logs = g_slist_append(logs, log);
log->handle = -1;
}
log_update_config(log);
signal_emit("log new", 1, log);
} | false | false | false | false | false | 0 |
insert_aspect_includes (VerboseMgr &vm, set<Unit*> &cc_units,
set<Unit*> &h_units, const string &aspect_includes) {
vm++;
for (set<Unit*>::iterator iter = cc_units.begin ();
iter != cc_units.end (); ++iter) {
vm << "Manipulating translation unit file " << (*iter)->name () << endvm;
insert_aspect_in... | false | false | false | false | false | 0 |
cm_result_specialists(const struct cm_result *result)
{
int count = 0;
specialist_type_iterate(spec) {
count += result->specialists[spec];
} specialist_type_iterate_end;
return count;
} | false | false | false | false | false | 0 |
CleanId(const char* c)
{
size_t len = 0;
for (; len < MAX_ID_LENGTH; len++) { if (c[len] == 0) break; }
fm::string out(len, *c);
char* id = out.begin();
if (*c != 0)
{
// First character: alphabetic or '_'.
if ((*c >= 'a' && *c <= 'z') || (*c >= 'A' && *c <= 'Z') || *c == '_') *id = *c;
else *id =... | false | false | false | false | false | 0 |
handleSigChild() {
pid_t epid;
unsigned int i;
int s;
while ( ( epid = waitpid(-1,&s,WNOHANG) ) > 0 ) {
for(i=0;i<pids.size();i++)
if (pids[i] == epid) {
if (handlers[i] != 0) handlers[i]->ZombieNotification(epid);
pids.erase(pids.begin() + i);
handlers.erase(handlers.begin() + i);
break;
... | false | false | false | false | false | 0 |
submitTo(Server *server)
{
Q_ASSERT(server);
if (!server)
return;
server->setUrlStyle(urlType(ui->serverType));
if (urlType(ui->serverType) == Server::NoStyle) {
QString path = ui->serverUrl->text();
if (!path.startsWith("file://")) {
if (path.startsWith("/"))
... | false | false | false | false | false | 0 |
archive_read_support_filter_all(struct archive *a)
{
archive_check_magic(a, ARCHIVE_READ_MAGIC,
ARCHIVE_STATE_NEW, "archive_read_support_filter_all");
/* Bzip falls back to "bunzip2" command-line */
archive_read_support_filter_bzip2(a);
/* The decompress code doesn't use an outside library. */
archive_read_s... | false | false | false | false | false | 0 |
select_p_select_nodeinfo_get(select_nodeinfo_t *nodeinfo,
enum select_nodedata_type dinfo,
enum node_states state,
void *data)
{
int rc = SLURM_SUCCESS;
uint16_t *uint16 = (uint16_t *) data;
char **tmp_char = (char **) data;
select_nodeinfo_t **select_nodeinfo = (select_nodeinfo_t **) data;
if (nod... | false | false | false | false | false | 0 |
sb_dsp_get_byte(sb_devc * devc)
{
int i;
for (i = 1000; i; i--)
{
if (inb(DSP_DATA_AVAIL) & 0x80)
return inb(DSP_READ);
}
return 0xffff;
} | false | false | false | false | false | 0 |
dump_packet(const char *tag, unsigned char *p, int len)
{
int proto;
if (!debug)
return;
/*
* don't print LCP echo request/reply packets if debug <= 1
* and the link is up.
*/
proto = (p[2] << 8) + p[3];
if (debug <= 1 && unsuccess == 0 && proto == PPP_LCP
&& len >= PPP_HDRLEN + H... | false | false | false | false | false | 0 |
findVariables() const
{
QSet<QString> back = CodeLineEdit::findVariables();
if(!isCode() && !text().isEmpty())
back.insert(text());
return back;
} | false | false | false | false | false | 0 |
atoms_recov_write_ftyp_info (FILE * f, AtomFTYP * ftyp, GstBuffer * prefix)
{
guint8 *data = NULL;
guint64 offset = 0;
guint64 size = 0;
if (prefix) {
if (fwrite (GST_BUFFER_DATA (prefix), 1, GST_BUFFER_SIZE (prefix), f) !=
GST_BUFFER_SIZE (prefix)) {
return FALSE;
}
}
if (!atom_ftyp_... | false | false | false | false | false | 0 |
ck_manager_get_current_session (CkManager *manager,
DBusGMethodInvocation *context)
{
gboolean res;
char *sender;
uid_t calling_uid;
pid_t calling_pid;
sender = dbus_g_method_get_sender (context);
g_debug ... | false | false | false | false | false | 0 |
main(void)
{
unsigned nerrors = 0; /* track errors */
/* Test Setup */
puts("Testing the external file cache");
/* Create property lists */
fcpl_id = H5Pcreate(H5P_FILE_CREATE);
fapl_id = h5_fileaccess();
dxpl_id = H5Pcreate(H5P_DATASET_XFER);
/* Patch filenames */
h5_fixna... | false | false | false | false | false | 0 |
coll_parse_unaryfilter (xmmsv_coll_token_t *tokens, xmmsv_coll_t **ret)
{
xmmsv_coll_t *coll;
char *prop;
xmmsv_coll_token_t *tk = tokens;
TOKEN_ASSERT (tk, XMMS_COLLECTION_TOKEN_OPFIL_HAS);
tk = coll_next_token (tk);
prop = coll_parse_prop (tk);
if (!prop) {
*ret = NULL;
return tokens;
}
coll = xmmsv_c... | false | false | false | false | false | 0 |
EnqueueEvent(jack_nframes_t time, size_t size,
jack_midi_data_t *buffer)
{
JackMidiAsyncQueue *queue = (size == 1) && (*buffer >= 0xf8) ? rt_queue :
non_rt_queue;
return queue->EnqueueEvent(time, size, buffer);
} | false | false | false | false | false | 0 |
fread_wrapper(state_t *s, char *dest, int bytes, int handle)
{
SCIkdebug(SCIkFILE, "fread()'ing %d bytes from handle %d\n", bytes, handle);
if (handle == 0) {
SCIkwarn(SCIkERROR, "Attempt to read from file handle 0\n");
return;
}
if ((handle >= s->file_handles_nr) || (s->file_handles[handle] == NULL))... | false | false | false | false | false | 0 |
zcatch(void)
{
ZASSERT(zversion == 6 || NFRAMES > 1, "@catch called outside of a function");
/* Must account for the dummy frame in non-V6 stories. */
store(zversion == 6 ? NFRAMES : NFRAMES - 1);
} | false | false | false | false | false | 0 |
vline_length( int visLineNum ) {
int nextLineStart, lineStartPos;
if (visLineNum < 0 || visLineNum >= mNVisibleLines)
return (0);
lineStartPos = mLineStarts[ visLineNum ];
if ( lineStartPos == -1 )
return 0;
if ( visLineNum + 1 >= mNVisibleLines )
return mLastChar - lineStartPos;
nextLineStar... | false | false | false | false | false | 0 |
txt_to_email(_domain target, const char *src, _cdomain origin) {
unsigned char dom[DOM_LEN];
char *cptr;
if ((cptr = (char *)strchr(src, '@')) != NULL && !(cptr[0] == '@' && cptr[1] == 0)) {
/* contains a '@', so assume it's an email address */
if (src[0] == '@') throw PException("Incorrect email adress/... | false | false | false | false | false | 0 |
amdtp_am824_set_parameters(struct amdtp_stream *s, unsigned int rate,
unsigned int pcm_channels,
unsigned int midi_ports,
bool double_pcm_frames)
{
struct amdtp_am824 *p = s->protocol;
unsigned int midi_channels;
unsigned int i;
int err;
if (amdtp_stream_running(s))
return -EINVAL;... | false | false | false | false | false | 0 |
sv_ignoreeof (name)
char *name;
{
SHELL_VAR *tmp_var;
char *temp;
eof_encountered = 0;
tmp_var = find_variable (name);
ignoreeof = tmp_var != 0;
temp = tmp_var ? value_cell (tmp_var) : (char *)NULL;
if (temp)
eof_encountered_limit = (*temp && all_digits (temp)) ? atoi (temp) : 10;
set_shellop... | false | false | false | false | false | 0 |
asn1PE_H225TunnelledProtocol (OOCTXT* pctxt, H225TunnelledProtocol* pvalue)
{
static Asn1SizeCnst subIdentifier_lsize1 = { 0, 1, 64, 0 };
int stat = ASN_OK;
ASN1BOOL extbit;
/* extension bit */
extbit = 0;
encodeBit (pctxt, extbit);
encodeBit (pctxt, (ASN1BOOL)pvalue->m.subIdentifierPresent);
... | false | false | false | false | false | 0 |
tracker_sparql_backend_real_update (TrackerSparqlConnection* base, const gchar* sparql, gint priority, GCancellable* cancellable, GError** error) {
TrackerSparqlBackend * self;
gint _tmp0_ = 0;
const gchar* _tmp1_ = NULL;
TrackerSparqlConnection* _tmp2_ = NULL;
TrackerSparqlConnection* _tmp4_ = NULL;
const gchar*... | false | false | false | false | false | 0 |
tegra_hdmi_set_format(struct hda_codec *codec, unsigned int format)
{
unsigned int value;
/* bits [31:30] contain the trigger and valid bits */
value = snd_hda_codec_read(codec, NVIDIA_AFG_NID, 0,
NVIDIA_GET_SCRATCH0, 0);
value = (value >> 24) & 0xff;
/* bits [15:0] are used to store the HDA format */
sn... | false | false | false | false | false | 0 |
gwy_data_field_grains_remove_by_height(GwyDataField *data_field,
GwyDataField *grain_field,
gdouble threshval,
gboolean below)
{
gint i, xres, yres, ngrains;
gdouble *data;
gboolean *grain_ki... | false | false | false | false | false | 0 |
NCsetup(i)
register int i;
{
register WIP *wp;
register NCDISPATCH *dp;
char *p;
char buff[SMBUF];
/* Set the greeting message. */
if ((p = GetConfigValue(_CONF_PATHHOST)) == NULL)
/* Worked in main, now it fails? Curious. */
p = Path.Data;
(void)sprintf(buff, "%d %s InterNetNews s... | false | false | false | false | false | 0 |
pcre_get_compiled_regex_ex(char *regex, pcre_extra **extra, int *preg_options, int *compile_options TSRMLS_DC)
{
pcre_cache_entry * pce = pcre_get_compiled_regex_cache(regex, strlen(regex) TSRMLS_CC);
if (extra) {
*extra = pce ? pce->extra : NULL;
}
if (preg_options) {
*preg_options = pce ? pce->preg_options ... | false | false | false | false | false | 0 |
pygwy_console_open_file(GtkToolButton *btn, gpointer user_data)
{
GtkWidget *file_chooser;
GtkFileFilter *filter = gtk_file_filter_new();
GtkTextBuffer *console_file_buf;
GtkTextView *textview;
gtk_file_filter_add_mime_type(filter, "text/x-python");
gtk_file_filter_add_pattern(filter, "*.py");
... | 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.