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 |
|---|---|---|---|---|---|---|
softmix_bridge_create(struct ast_bridge *bridge)
{
struct softmix_bridge_data *softmix_data;
if (!(softmix_data = ao2_alloc(sizeof(*softmix_data), softmix_bridge_data_destroy))) {
return -1;
}
if (!(softmix_data->timer = ast_timer_open())) {
ast_log(AST_LOG_WARNING, "Failed to open timer for softmix bridge\n")... | false | false | false | false | false | 0 |
caml_init_gc (uintnat minor_size, uintnat major_size,
uintnat major_incr, uintnat percent_fr,
uintnat percent_m)
{
uintnat major_heap_size = Bsize_wsize (norm_heapincr (major_size));
if (caml_page_table_initialize(Bsize_wsize(minor_size) + major_heap_size)){
caml_fatal_err... | false | false | false | false | false | 0 |
read_dependence (rtx mem, rtx x)
{
return MEM_VOLATILE_P (x) && MEM_VOLATILE_P (mem);
} | false | false | false | false | false | 0 |
sh_veu_s_fmt_vid_out(struct file *file, void *priv,
struct v4l2_format *f)
{
int ret = sh_veu_try_fmt_vid_out(file, priv, f);
if (ret)
return ret;
return sh_veu_s_fmt(priv, f);
} | false | false | false | false | false | 0 |
_sort_by_partition(void *void1, void *void2)
{
int diff;
sinfo_data_t *sinfo1 = (sinfo_data_t *) void1;
sinfo_data_t *sinfo2 = (sinfo_data_t *) void2;
char *val1 = "", *val2 = "";
if (part_order) {
diff = (int)sinfo1->part_inx - (int)sinfo2->part_inx;
} else {
if (sinfo1->part_info && sinfo1->part_info->name... | false | false | false | false | false | 0 |
camel_imapx_command_new (CamelIMAPXServer *is,
const gchar *name,
CamelFolder *select,
const gchar *format,
...)
{
CamelIMAPXRealCommand *real_ic;
static gint tag = 0;
va_list ap;
real_ic = g_slice_new0 (CamelIMAPXR... | false | false | false | false | false | 0 |
gst_rtp_session_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec)
{
GstRtpSession *rtpsession;
GstRtpSessionPrivate *priv;
rtpsession = GST_RTP_SESSION (object);
priv = rtpsession->priv;
switch (prop_id) {
case PROP_NTP_NS_BASE:
GST_OBJECT_LOCK (rtpsession);
... | false | false | false | false | false | 0 |
qdm2_fft_decode_tones (QDM2Context *q, int duration, GetBitContext *gb, int b)
{
int channel, stereo, phase, exp;
int local_int_4, local_int_8, stereo_phase, local_int_10;
int local_int_14, stereo_exp, local_int_20, local_int_28;
int n, offset;
local_int_4 = 0;
local_int_28 = 0;
local_in... | false | false | false | false | false | 0 |
print_services(const char *runlevel, RC_STRINGLIST *svcs)
{
RC_STRINGLIST *l = NULL;
RC_STRING *s;
char *r = NULL;
if (!svcs)
return;
if (!deptree)
deptree = _rc_deptree_load(0, NULL);
if (!deptree) {
TAILQ_FOREACH(s, svcs, entries)
if (!runlevel ||
rc_service_in_runlevel(s->value, runlevel))
... | false | false | false | false | false | 0 |
doquerylrcpfn(int argc, char **argv)
{
globus_result_t r;
globus_list_t *l;
int offset;
offset = 0;
while ((r = globus_rls_client_lrc_get_lfn(h, argv[0], &offset, reslimit,
&l)) == GLOBUS_SUCCESS) {
showresult(l);
if (offset == -1)
break;
}
return r;
} | false | false | false | false | false | 0 |
operator+(const char* c1, const SimpleString& s2)
{
const char* c_in = c1;
int n1 = 0; while (*c_in++ != 0) ++n1;
SimpleString s(n1 + s2.n, (char)0);
c_in = c1; unsigned int i = n1; char* c_out = s.S;
while (i--) *c_out++ = *c_in++;
c_in = s2.S; i = s2.n;
while (i--) *c_out++ = *c_in++;
return s... | false | false | false | false | false | 0 |
allowed_disk_usage(double boinc_total) {
double limit_pct, limit_min_free, limit_abs;
limit_pct = host_info.d_total*global_prefs.disk_max_used_pct/100.0;
limit_min_free = boinc_total + host_info.d_free - global_prefs.disk_min_free_gb*GIGA;
double size = min(limit_pct, limit_min_free);
if (global_p... | false | false | false | false | false | 0 |
run_timers()
{
if (!attempt_lock_timers())
return;
if (_master_paused == 0 && _timer_heap.size() > 0 && !_stopper) {
#if CLICK_LINUXMODULE
_timer_task = current;
#endif
Timestamp now = Timestamp::now();
Timer* t;
while (_timer_heap.size() > 0 && !_stopper
&& (t = _timer_heap.at_u(0), t->_expiry <= ... | false | false | false | false | false | 0 |
ginInsertEntry(BuildAccumulator *accum, ItemPointer heapptr, OffsetNumber attnum, Datum entry)
{
EntryAccumulator key;
EntryAccumulator *ea;
bool isNew;
/*
* For the moment, fill only the fields of key that will be looked at
* by cmpEntryAccumulator or ginCombineData.
*/
key.attnum = attnum;
key.value = e... | false | false | false | false | false | 0 |
i_unregister_root(gs_memory_t * mem, gs_gc_root_t * rp, client_name_t cname)
{
gs_ref_memory_t * const imem = (gs_ref_memory_t *)mem;
gs_gc_root_t **rpp = &imem->roots;
if_debug2m('8', mem, "[8]unregister root(%s) 0x%lx\n",
client_name_string(cname), (ulong) rp);
while (*rpp != rp)
... | false | false | false | false | false | 0 |
contacts_row_group_add (ContactsRowGroup* self, ContactsRow* row) {
Block34Data* _data34_;
ContactsRow* _tmp0_ = NULL;
ContactsRow* _tmp1_ = NULL;
GeeArrayList* _tmp2_ = NULL;
ContactsRow* _tmp3_ = NULL;
ContactsRow* _tmp4_ = NULL;
g_return_if_fail (self != NULL);
g_return_if_fail (row != NULL);
_data34_ = g_s... | false | false | false | false | false | 0 |
read_local_class(bdaddr_t *bdaddr, uint8_t *class)
{
char filename[PATH_MAX + 1], tmp[3], *str;
int i;
create_filename(filename, PATH_MAX, bdaddr, "config");
str = textfile_get(filename, "class");
if (!str)
return -ENOENT;
memset(tmp, 0, sizeof(tmp));
for (i = 0; i < 3; i++) {
memcpy(tmp, str + (i * 2) + ... | false | false | false | false | false | 0 |
at91ether_start(struct net_device *dev)
{
struct macb *lp = netdev_priv(dev);
dma_addr_t addr;
u32 ctl;
int i;
lp->rx_ring = dma_alloc_coherent(&lp->pdev->dev,
(AT91ETHER_MAX_RX_DESCR *
sizeof(struct macb_dma_desc)),
&lp->rx_ring_dma, GFP_KERNEL);
if (!lp->rx_ring)
return -ENOMEM;
lp->rx_b... | false | false | false | false | false | 0 |
jitter_read (cdrom_drive_t *d, void *p, lsn_t begin, long i_sectors,
jitter_baddness_t jitter_badness)
{
static int i_jitter=0;
int jitter_flag;
long i_sectors_orig = i_sectors;
long i_jitter_offset = 0;
char *p_buf=malloc(CDIO_CD_FRAMESIZE_RAW*(i_sectors+1));
if (d->i_test_flags & CDDA_TEST_ALW... | false | false | false | false | false | 0 |
JustDied(Unit* pKiller) override
{
if (pKiller->GetEntry() != NPC_RAJAXX)
{
return;
}
// Yell when killed by Rajaxx
if (m_pInstance)
{
if (Creature* pRajaxx = m_pInstance->GetSingleCreatureFromStorage(NPC_RAJAXX))
{
... | false | false | false | false | false | 0 |
CAN_GetITStatus(CAN_TypeDef* CANx, uint32_t CAN_IT)
{
ITStatus itstatus = RESET;
/* Check the parameters */
assert_param(IS_CAN_ALL_PERIPH(CANx));
assert_param(IS_CAN_IT(CAN_IT));
/* check the interrupt enable bit */
if((CANx->IER & CAN_IT) != RESET)
{
/* in case the Interrupt is enabled, ..... | false | false | false | false | false | 0 |
check_for_zombie_home_server(REQUEST *request)
{
home_server *home;
struct timeval when;
home = request->home_server;
if (home->state != HOME_STATE_ZOMBIE) return;
when = home->zombie_period_start;
when.tv_sec += home->zombie_period;
fr_event_now(el, &now);
if (timercmp(&now, &when, <)) {
return;
}
mar... | false | false | false | false | false | 0 |
ecCheckPubKey3617(const EcCurve *curve, const EcPoint *pub)
{
/* Represent point at infinity by (0, 0), make sure it's not that */
if (bnCmpQ(pub->x, 0) == 0 && bnCmpQ(pub->y, 0) == 0) {
return 0;
}
/* Check that coordinates are within range */
if (bnCmpQ(pub->x, 0) < 0 || bnCmp(pub->x, curv... | false | false | false | false | false | 0 |
xsh_scired_ifu_stare_create(cpl_plugin *plugin){
cpl_recipe *recipe = NULL;
xsh_clipping_param crh_clip_param = {5.0, 5, 0.7, 0,0.3};
/* First param (conv_kernel) should be initialized correctly ! */
xsh_rectify_param rectify = { "tanh",
CPL_KERNEL_DEFAULT, 2,
... | false | false | false | false | false | 0 |
parse_command_line( int argc, char *argv[], CardState *state, DFBColor *dest, DFBColor *source )
{
int i;
/* Parse command line arguments. */
for (i=1; i<argc; i++) {
const char *arg = argv[i];
if (strcmp (arg, "-h") == 0 || strcmp (arg, "--help") == 0) {
print_usage ... | false | false | false | false | false | 0 |
ifile_free_categories(category_rating *cr, ifile_db *idata)
{
int i;
for (i = 0; i < idata->num_folders; i++)
free(cr[i].category);
free(cr);
} | false | false | false | false | false | 0 |
rtsx_pci_shutdown(struct pci_dev *pcidev)
{
struct pcr_handle *handle;
struct rtsx_pcr *pcr;
dev_dbg(&(pcidev->dev), "--> %s\n", __func__);
handle = pci_get_drvdata(pcidev);
pcr = handle->pcr;
rtsx_pci_power_off(pcr, HOST_ENTER_S1);
pci_disable_device(pcidev);
} | false | false | false | false | false | 0 |
drag_data_get(GtkTreeView *tree_view, GdkDragContext *context,
GtkSelectionData *data, guint info,
guint time, GtkTreeModel *model)
{
GtkTreeIter iter;
FolderColumnType type;
GtkTreeModel *source_model;
if (info != TARGET_INFO_SUMCOL)
return;
if (!gtk_tree_selection_get_selected
(gtk_tree_view_... | false | false | false | false | false | 0 |
nvkm_memx_init(struct nvkm_pmu *pmu, struct nvkm_memx **pmemx)
{
struct nvkm_device *device = pmu->subdev.device;
struct nvkm_memx *memx;
u32 reply[2];
int ret;
ret = nvkm_pmu_send(pmu, reply, PROC_MEMX, MEMX_MSG_INFO,
MEMX_INFO_DATA, 0);
if (ret)
return ret;
memx = *pmemx = kzalloc(sizeof(*memx), GFP... | false | false | false | false | false | 0 |
print_time(void)
{
struct timeval tv;
static struct timeval oldtime={0};
int dsec,dusec;
gettimeofday(&tv,NULL);
dsec=tv.tv_sec-oldtime.tv_sec;
dusec=tv.tv_usec-oldtime.tv_usec;
if(dusec<0){
dsec--;
dusec+=1000000;
}
printf("%d.%06d +%d.%06d\n",(int)tv.tv_sec,(int)tv.tv_usec,dsec,dusec);
oldtime=tv;
} | false | false | false | false | false | 0 |
softLogByz(tcPDPtr p) const {
double res = ( sqr(log(1.-x))/2. - sqr(pi)/6. ) * PDFx(p);
if ( z > x ) {
res += (PDFxByz(p) - z*PDFx(p))*log(1.-z)/(z*(1.-z));
res -= PDFxByz(p)*log(z)/(z*(1.-z));
}
return res;
} | false | false | false | false | false | 0 |
init_pup( PopUP * m )
{
m->menu_cb = NULL;
m->enter_cb = m->leave_cb = NULL;
m->w = m->h = m->maxw = 0;
m->nitems = 0;
m->title_width = 0;
m->win = None;
m->gc_active = m->gc_inactive = None;
m->bw = pup_bw;
m->title = NULL;
m->item[ 0 ] ... | false | false | false | false | false | 0 |
gf100_gr_init_fw(struct gf100_gr *gr, u32 fuc_base,
struct gf100_gr_fuc *code, struct gf100_gr_fuc *data)
{
struct nvkm_device *device = gr->base.engine.subdev.device;
int i;
nvkm_wr32(device, fuc_base + 0x01c0, 0x01000000);
for (i = 0; i < data->size / 4; i++)
nvkm_wr32(device, fuc_base + 0x01c4, data->data[... | false | false | false | false | false | 0 |
count_arguments(const char *s)
{
int i = 0;
for (; *s != '\0'; s++)
if (*s == ',')
i++;
return i+1;
} | false | false | false | false | false | 0 |
crypto_aes_set_key(struct crypto_tfm *tfm, const u8 *in_key,
unsigned int key_len)
{
struct crypto_aes_ctx *ctx = crypto_tfm_ctx(tfm);
u32 *flags = &tfm->crt_flags;
int ret;
ret = crypto_aes_expand_key(ctx, in_key, key_len);
if (!ret)
return 0;
*flags |= CRYPTO_TFM_RES_BAD_KEY_LEN;
return -EINVAL;
} | false | false | false | false | false | 0 |
chunk_allocate(int bytes, const EST_ChunkPtr &initial, int initial_start, int initial_len)
{
if (initial_len >= bytes)
{
cerr<<"initialiser too long\n";
abort();
}
EST_Chunk *cp = new(bytes) EST_Chunk;
memcpy(cp->memory, initial.ptr->memory + initial_start, initial_len);
cp->memory[initial_... | false | false | false | false | true | 1 |
unqualified_fn_lookup_error (tree name)
{
if (processing_template_decl)
{
/* In a template, it is invalid to write "f()" or "f(3)" if no
declaration of "f" is available. Historically, G++ and most
other compilers accepted that usage since they deferred all name
lookup until instantiation time rather ... | false | false | false | false | false | 0 |
isNegativeZeroValue() const {
// Floating point values have an explicit -0.0 value.
if (const ConstantFP *CFP = dyn_cast<ConstantFP>(this))
return CFP->isZero() && CFP->isNegative();
// Otherwise, just use +0.0.
return isNullValue();
} | false | false | false | false | false | 0 |
wd719x_interrupt(int irq, void *dev_id)
{
struct wd719x *wd = dev_id;
union wd719x_regs regs;
unsigned long flags;
u32 SCB_out;
spin_lock_irqsave(wd->sh->host_lock, flags);
/* read SCB pointer back from card */
SCB_out = wd719x_readl(wd, WD719X_AMR_SCB_OUT);
/* read all status info at once */
regs.all = cpu_t... | false | false | false | false | false | 0 |
capabilities_ok(struct tdb_context *tdb,
tdb_off_t capabilities)
{
tdb_off_t off, next;
enum TDB_ERROR ecode = TDB_SUCCESS;
const struct tdb_capability *cap;
/* Check capability list. */
for (off = capabilities; off && ecode == TDB_SUCCESS; off = next) {
cap = tdb_access_read(tdb, off, sizeof(*cap), t... | false | false | false | false | false | 0 |
calc_clear_stack(int count)
/* remove the trailing `count' stack elements from the stack.
*/
{
for (--sp; count; --count, --sp) {
switch (stack[sp].type) {
case CO_VARIABLE:
case CO_ERROR:
free(stack[sp].u.s);
stack[sp].u.s = 0;
break;
default:
break;
}
stack[sp].t... | false | false | false | false | false | 0 |
getTarget() const
{
// set _ptr to NULL and _tgt to original target if destroyed
checkDangling();
if ( _ptr ) return _ptr->getTarget();
return _tgt;
} | false | false | false | false | false | 0 |
on_button_delete()
{
Gtk::TreeView* treeview = get_selected_treeview();
if(!treeview)
return;
Glib::RefPtr<type_model> model = get_selected_model();
Glib::RefPtr<Gtk::TreeSelection> refTreeSelection = treeview->get_selection();
if(refTreeSelection)
{
Gtk::TreeModel::iterator iter = refTreeSelectio... | false | false | false | false | false | 0 |
smtp_set_reverse_path (smtp_message_t message, const char *mailbox)
{
SMTPAPI_CHECK_ARGS (message != NULL, 0);
if (message->reverse_path_mailbox != NULL)
free (message->reverse_path_mailbox);
if (mailbox == NULL)
message->reverse_path_mailbox = NULL;
else if ((message->reverse_path_mailbox = strdup (ma... | false | false | false | false | false | 0 |
skl_ddb_get_hw_state(struct drm_i915_private *dev_priv,
struct skl_ddb_allocation *ddb /* out */)
{
enum pipe pipe;
int plane;
u32 val;
memset(ddb, 0, sizeof(*ddb));
for_each_pipe(dev_priv, pipe) {
if (!intel_display_power_is_enabled(dev_priv, POWER_DOMAIN_PIPE(pipe)))
continue;
for_each_plane(dev_p... | false | false | false | false | false | 0 |
flmCountCharacters(
FLMBYTE * pValue,
FLMUINT uiValueLen,
FLMUINT uiMaxToCount,
FLMUINT uiIfdFlags)
{
FLMUINT uiNumChars = 0;
FLMUINT uiObjLength;
for (uiObjLength = 0;
uiNumChars <= uiMaxToCount && uiValueLen;
pValue += uiObjLength, uiValueLen =
(uiValueLen >= uiObjLength) ? uiValueLen -... | false | false | false | false | false | 0 |
bSetValue( int iPnlID, const wxString & rosValue )
{
PnlValue * poPnlValue;
// Get a pointer to the appropriate value panel
poPnlValue = poGetPanel( iPnlID );
if( poPnlValue == NULL ) return( FALSE );
// Set the panel value
if( ! poPnlValue->bSetValue( rosValue ) ) return( FALSE );
// ... | false | false | false | false | false | 0 |
timelib_update_from_sse(timelib_time *tm)
{
timelib_sll sse;
sse = tm->sse;
switch (tm->zone_type) {
case TIMELIB_ZONETYPE_ABBR:
case TIMELIB_ZONETYPE_OFFSET: {
int z = tm->z;
signed int dst = tm->dst;
timelib_unixtime2gmt(tm, tm->sse - (tm->z * 60));
tm->z = z;
tm->dst = dst;
goto clea... | false | false | false | false | false | 0 |
mn_cn_params_influence_fn( model_DS model, tparm_DS tparm, int term_index, int n_att,
float *v_ptr, float *class_mean_ptr, float *class_sigma_ptr,
float *global_mean_ptr, float *global_sigma_ptr,
float **term_att_list_ptr, int ... | false | false | false | false | false | 0 |
bfd_openstreamr (const char *filename, const char *target, void *streamarg)
{
FILE *stream = (FILE *) streamarg;
bfd *nbfd;
const bfd_target *target_vec;
nbfd = _bfd_new_bfd ();
if (nbfd == NULL)
return NULL;
target_vec = bfd_find_target (target, nbfd);
if (target_vec == NULL)
{
_bfd_delet... | false | false | false | false | false | 0 |
AppendSeconds(char *cp, int sec, fsec_t fsec, int precision, bool fillzeros)
{
if (fsec == 0)
{
if (fillzeros)
sprintf(cp, "%02d", abs(sec));
else
sprintf(cp, "%d", abs(sec));
}
else
{
#ifdef HAVE_INT64_TIMESTAMP
if (fillzeros)
sprintf(cp, "%02d.%0*d", abs(sec), precision, (int) Abs(fsec));
else
... | false | true | false | false | false | 1 |
qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
Q_ASSERT(staticMetaObject.cast(_o));
WidgetPlaque *_t = static_cast<WidgetPlaque *>(_o);
switch (_id) {
case 0: _t->change((*reinterpret_cast< int(*)>(_a[1])),(*rein... | false | false | false | false | false | 0 |
atmel_spi_next_xfer_fifo(struct spi_master *master,
struct spi_transfer *xfer)
{
struct atmel_spi *as = spi_master_get_devdata(master);
u32 current_remaining_data, num_data;
u32 offset = xfer->len - as->current_remaining_bytes;
const u16 *words = (const u16 *)((u8 *)xfer->tx_buf + offset);
const u8 *byte... | false | false | false | false | false | 0 |
MergeFrom(const envelope& from) {
GOOGLE_CHECK_NE(&from, this);
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
if (from.has_msg_type()) {
set_msg_type(from.msg_type());
}
if (from.has_msg_size()) {
set_msg_size(from.msg_size());
}
if (from.has_msg_data()) {
set_msg_data(f... | false | false | false | false | false | 0 |
display_output_page(gx_device * dev, int copies, int flush)
{
gx_device_display *ddev = (gx_device_display *) dev;
int code;
if (ddev->callback == NULL)
return 0;
display_set_separations(ddev);
code = (*(ddev->callback->display_page))
(ddev->pHandle, dev, copies, flu... | false | false | false | false | false | 0 |
CoDelQueue(OS_EventID id,U8 opt) {
P_ECB pecb;
P_QCB pqcb;
StatusType err;
#if CFG_PAR_CHECKOUT_EN >0
if(id >= CFG_MAX_EVENT) {
return E_INVALID_ID; /* Invalid id,return error */
}
#endif
pecb = &EventTbl[id];
#if CFG_PAR_CHECKOUT_EN >0
if( pecb->eventType != EVENT_TYPE_QUEUE) {
re... | false | false | false | false | false | 0 |
infix_get_proptable(zword object, zword prop, zword *length)
{
zword propnum, location, nloc, nlen;
location = 0;
while(infix_property_loop(object, &propnum, &location, length, &nloc, &nlen)) {
if(propnum == prop)
return location;
}
return 0;
} | false | false | false | false | false | 0 |
tcp_dd_handle_write_request(struct network_client *client, struct tcp_dd_file_request *req)
{
int fd;
int ret;
mode_t mode;
mode = file_get_mode(req->filename);
switch (mode & S_IFMT)
{
case S_IFREG:
pr_info("remove regular file %s", req->filename);
unlink(req->filename);
break;
case S_IFBLK:
pr_info(... | false | false | false | false | false | 0 |
xmlnode_to_formatted_str( xmlnode *psNode, int *pnLen ) {
char *pnXml, *pnXmlWithDeclaration;
g_return_val_if_fail( psNode != NULL, NULL );
pnXml = xmlnode_to_str_helper( psNode, pnLen, TRUE, 0 );
pnXmlWithDeclaration = g_strdup_printf( "<?xml version='1.0' encoding='UTF-8' ?>\n\n%s", pnXml );
g_free( pnXml );
... | false | false | false | false | false | 0 |
mnode_traverse_stub(mnode* node, MNODE_TRAVERSE_PROC proc, void* data)
{
while (1)
{
if (node->child)
mnode_traverse_stub(node->child, proc, data);
proc(node, data);
if (!(node = node->next))
break;
}
} | false | false | false | false | false | 0 |
EffectCharge(SpellEffectIndex /*eff_idx*/)
{
if (!unitTarget)
return;
// TODO: research more ContactPoint/attack distance.
// 3.666666 instead of ATTACK_DISTANCE(5.0f) in below seem to give more accurate result.
float x, y, z;
unitTarget->GetContactPoint(m_caster, x, y, z, 3.666666f);
... | false | false | false | false | false | 0 |
gnc_ui_account_get_balance_as_of_date (Account *account,
time64 date,
gboolean include_children)
{
gnc_numeric balance;
gnc_commodity *currency;
if (account == NULL)
return gnc_numeric_zero ();
currency = xaccAccount... | false | false | false | false | false | 0 |
f_2503(C_word t1){
C_word tmp;
C_word t2;
C_word t3;
C_word t4;
C_word t5;
C_stack_overflow_check;
loop:
t2=C_i_cdr(t1);
if(C_truep(C_i_pairp(t2))){
t5=t2;
t1=t5;
goto loop;}
else{
t3=t1;
return(t3);}} | false | false | false | false | false | 0 |
previous_diffusion_source (GfsVariable * v,
GfsSourceDiffusion * d)
{
GSList * i;
i = GTS_SLIST_CONTAINER (v->sources)->items;
while (i) {
if (i->data != d && GFS_IS_SOURCE_DIFFUSION (i->data))
return i->data;
i = i->next;
}
return NULL;
} | false | false | false | false | false | 0 |
deserialize(TextInput& t) {
t.readSymbol("(");
x = (float)t.readNumber();
t.readSymbol(",");
y = (float)t.readNumber();
t.readSymbol(",");
z = (float)t.readNumber();
t.readSymbol(")");
} | false | false | false | false | false | 0 |
propagate(Solver& s, PostPropagator* x) const {
for (PostPropagator* p = head, *t; p != x;) {
// just in case t removes itself from the list
// during propagateFixpoint
t = p;
p = p->next;
if (!t->propagateFixpoint(s)) { return false; }
}
return true;
} | false | false | false | false | false | 0 |
fcntl_lock_file(const char *file, short lock_type, int warn_if_read_only)
{
int lockfd;
char *dir;
char *c;
struct flock lock = {
.l_type = lock_type,
.l_whence = 0,
.l_start = 0,
.l_len = 0
};
if (!(dir = dm_strdup(file))) {
log_error("fcntl_lock_file failed in strdup.");
return -1;
}
if ((c = st... | false | false | false | false | true | 1 |
cdc_mbim_rx_add_vid(struct net_device *netdev, __be16 proto, u16 vid)
{
struct usbnet *dev = netdev_priv(netdev);
struct cdc_mbim_state *info = (void *)&dev->data;
/* creation of this VLAN is a request to tag IP session 0 */
if (vid == MBIM_IPS0_VID)
info->flags |= FLAG_IPS0_VLAN;
else
if (vid >= 512) /* we d... | false | false | false | false | false | 0 |
cornerIndex(MSBoolean b_)
{
if (cornerIndex()!=b_)
{
_cornerIndex=b_;
if (cornerIndexXGC()==0) createCornerIndexXGC();
drawLabel(panner()->window());
}
} | false | false | false | false | false | 0 |
connect_to_host(char *hostname, short portno)
{
struct hostent *host_info;
int sockfd, yes=1;
struct sockaddr_in host_addr;
host_info = gethostbyname(hostname);
if (host_info == NULL) {
return -1;
}
sockfd = mysocket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (sockfd < 0) {
... | false | true | false | false | false | 1 |
_dc1394_v130_handshake(dc1394camera_t *camera, dc1394video_mode_t video_mode)
{
uint32_t setting_1, err_flag1, err_flag2, v130handshake;
uint32_t exit_loop;
dc1394error_t err;
if (!dc1394_is_video_mode_scalable(video_mode))
return DC1394_INVALID_VIDEO_MODE;
if (camera->iidc_version >= DC13... | false | false | false | false | true | 1 |
au_di_cp(struct au_dinfo *dst, struct au_dinfo *src)
{
AuRwMustWriteLock(&dst->di_rwsem);
AuRwMustWriteLock(&src->di_rwsem);
dst->di_bstart = src->di_bstart;
dst->di_bend = src->di_bend;
dst->di_bwh = src->di_bwh;
dst->di_bdiropq = src->di_bdiropq;
/* smp_mb(); */
} | false | false | false | false | false | 0 |
InstrStopNode(Instrumentation *instr, double nTuples)
{
instr_time endtime;
/* count the returned tuples */
instr->tuplecount += nTuples;
if (INSTR_TIME_IS_ZERO(instr->starttime))
{
elog(DEBUG2, "InstrStopNode called without start");
return;
}
INSTR_TIME_SET_CURRENT(endtime);
INSTR_TIME_ACCUM_DIFF(instr-... | false | false | false | false | false | 0 |
setSticky(bool sticky) {
setState(WinStateAllWorkspaces, sticky ? WinStateAllWorkspaces : 0);
#ifdef CONFIG_WINLIST
windowList->updateWindowListApp(fWinListItem);
#endif
if (affectsWorkArea())
manager->updateWorkArea();
} | false | false | false | false | false | 0 |
ctg2dec (in)
char *in; /* Character string */
{
double dec; /* Declination in degrees (returned) */
double deg, min, sec, sign;
char *value, *c1;
dec = 0.0;
/* Translate value from ASCII colon-delimited string to binary */
if (!in[0])
return (dec);
else
value = in;
/* Set sign */... | false | false | false | false | false | 0 |
snd_mtpav_portscan(struct mtpav *chip) // put mtp into smart routing mode
{
u8 p;
for (p = 0; p < 8; p++) {
snd_mtpav_send_byte(chip, 0xf5);
snd_mtpav_send_byte(chip, p);
snd_mtpav_send_byte(chip, 0xfe);
}
} | false | false | false | false | false | 0 |
check_stab(struct csa *csa, double tol_bnd)
{ int m = csa->m;
#ifdef GLP_DEBUG
int n = csa->n;
#endif
char *type = csa->type;
double *lb = csa->lb;
double *ub = csa->ub;
double *coef = csa->coef;
int *head = csa->head;
int phase = csa->phase;
double *bbar = csa->bbar;... | false | false | false | false | false | 0 |
Unixy_pid_read(bstring pid_path)
{
pid_t pid = -1;
FILE *pid_file = NULL;
check(pid_path, "PID file has not been set yet.");
pid_file = fopen(bdata(pid_path), "r");
check(pid_file, "Failed to open PID file %s for reading.", bdata(pid_path));
check(fscanf(pid_file, "%d", &pid) != -1, "Failed t... | false | false | false | false | false | 0 |
Build(vtkUnstructuredGrid *mesh, vtkDataArray *scalarField)
{
for(vtkIdType i = 0; i < mesh->GetNumberOfCells(); i++)
{
vtkCell *tet = mesh->GetCell(i);
vtkIdList *tetPointList = tet->GetPointIds();
if(tetPointList->GetNumberOfIds() != 4)
return vtkReebGraph::ERR_NOT_A_SIMPLICIAL_MESH;
Strea... | false | false | false | false | false | 0 |
ResizeControls(unsigned nInputs, const std::string & baseName)
{
std::list<std::string> names;
if (nInputs == 1)
{
names.push_back("In Control");
ResizeControls(nInputs, names);
return;
}
for (unsigned i=0; i<nInputs; i++)
{
std::ostringstream os;
os << baseName << "_" << i;
names.push_b... | false | false | false | false | false | 0 |
store_alert_led(struct device *dev,
struct device_attribute *devattr, const char *buf, size_t count)
{
u8 reg;
struct fschmd_data *data = dev_get_drvdata(dev);
unsigned long v;
int err;
err = kstrtoul(buf, 10, &v);
if (err)
return err;
mutex_lock(&data->update_lock);
reg = i2c_smbus_read_byte_data(to_i2c_... | false | false | false | false | false | 0 |
ChangeWindowName(char *str)
{
XTextProperty name;
if (XStringListToTextProperty(&str,1,&name) == 0) {
fprintf(stderr,"%s: cannot allocate window name.\n",module->name);
return;
}
XSetWMName(dpy,win,&name);
XSetWMIconName(dpy,win,&name);
XFree(name.value);
} | false | false | false | false | false | 0 |
getstryng(char *fname)
{ /* read in a file name from stdin and take off newline if any */
char *end;
fflush(stdout);
fname = fgets(fname, FNMLNGTH, stdin);
if ( fname == NULL )
EOF_error();
if ( (end = strpbrk(fname, "\n\r")) != NULL)
*end = '\0';
} | false | false | false | false | false | 0 |
open( pfs_name *name, int flags, mode_t mode ) {
pfs_file *file = 0;
MYSQL *mysql_cxn = (MYSQL *)pfs_service_connect_cache(name);
debug(D_BXGRID, "open %s", name->rest);
if (mysql_cxn) {
struct bxgrid_virtual_folder *bvf = bxgrid_bvf_find(name->rest);
if (bvf) {
errno = EISDIR;
return 0;
} els... | false | false | false | false | false | 0 |
SetWorldRotation(float qx, float qy, float qz, float qw)
{
Quat rotation(qx, qy, qz, qw);
// Temporary solution for gameobjects that has no rotation data in DB:
if (qz == 0.f && qw == 0.f)
rotation = Quat::fromAxisAngleRotation(G3D::Vector3::unitZ(), GetOrientation());
rotation.unitize();
m... | false | false | false | false | false | 0 |
mtc_domath( char *str )
{
VARIABLE *headsave; /* this should not be here */
jmp_buf jmp, *savejmp; /* save program context */
void (*sigfunc)() = (void (*)())signal( SIGINT, sig_trap );
if ( !str || !*str )
{
str = (char *)doread();
signal( SIGINT, sigfunc );
return ma... | false | true | false | false | true | 1 |
httpCacheNegatively(StoreEntry * entry)
{
storeNegativeCache(entry);
if (EBIT_TEST(entry->flags, ENTRY_CACHABLE))
storeSetPublicKey(entry);
if (entry->expires <= squid_curtime)
storeRelease(entry);
} | false | false | false | false | false | 0 |
build_x_conditional_expr (tree ifexp, tree op1, tree op2)
{
tree orig_ifexp = ifexp;
tree orig_op1 = op1;
tree orig_op2 = op2;
tree expr;
if (processing_template_decl)
{
/* The standard says that the expression is type-dependent if
IFEXP is type-dependent, even though the eventual type of the
e... | false | false | false | false | false | 0 |
tiffcmyk_print_page(gx_device_printer * pdev, FILE * file)
{
gx_device_tiff *const tfdev = (gx_device_tiff *)pdev;
int code;
if (tfdev->Compression==COMPRESSION_NONE &&
pdev->height > ((unsigned long) 0xFFFFFFFF - ftell(file))/(pdev->width)) /* note width is never 0 in print_page */
return_... | false | false | false | false | false | 0 |
dib7000m_set_diversity_in(struct dvb_frontend *demod, int onoff)
{
struct dib7000m_state *state = demod->demodulator_priv;
if (state->div_force_off) {
dprintk( "diversity combination deactivated - forced by COFDM parameters");
onoff = 0;
}
state->div_state = (u8)onoff;
if (onoff) {
dib7000m_write_word(stat... | false | false | false | false | false | 0 |
lj_cconv_tv_bf(CTState *cts, CType *s, TValue *o, uint8_t *sp)
{
CTInfo info = s->info;
CTSize pos, bsz;
uint32_t val;
lua_assert(ctype_isbitfield(info));
/* NYI: packed bitfields may cause misaligned reads. */
switch (ctype_bitcsz(info)) {
case 4: val = *(uint32_t *)sp; break;
case 2: val = *(uint16_t ... | false | false | false | false | false | 0 |
vcal_update_event(const gchar *vevent)
{
VCalEvent *event = vcal_get_event_from_ical(vevent, NULL);
gboolean r = FALSE;
if (event) {
r = vcal_delete_event(event->uid);
vcal_manager_free_event(event);
if (r)
return vcal_add_event(vevent);
}
return NULL;
} | false | false | false | false | false | 0 |
idma64_platform_probe(struct platform_device *pdev)
{
struct idma64_chip *chip;
struct device *dev = &pdev->dev;
struct resource *mem;
int ret;
chip = devm_kzalloc(dev, sizeof(*chip), GFP_KERNEL);
if (!chip)
return -ENOMEM;
chip->irq = platform_get_irq(pdev, 0);
if (chip->irq < 0)
return chip->irq;
mem ... | false | false | false | false | false | 0 |
isTPLDg(void *ctx, size_t n, Parameter *arg)
{
if (arg->storageClass & (STCalias | STCauto | STCstatic))
return 1;
return 0;
} | false | false | false | false | false | 0 |
interface_ip4_address_change_cb (const char *interface)
{
PTRACE(4, "HalManager_dbus\tDetected IPv4 address change on network interface " << interface);
//signal
} | false | false | false | false | false | 0 |
updateinheredimage(struct filter *f)
{
if ((f->flags & SHAREDDATA) && f->childimage) {
if (f->childimage->nimages == 2
&& f->image->currimage != f->childimage->currimage)
f->childimage->flip(f->childimage); /*Hack for interlace filter */
}
} | false | false | false | false | false | 0 |
memusage_alloc(const char *name, size_t width)
{
memusage_t *mu;
g_assert(name != NULL);
g_assert(size_is_non_negative(width));
mu = xpmalloc0(sizeof *mu);
mu->magic = MEMUSAGE_MAGIC;
mu->name = xpstrdup(name);
mu->width = width;
mu->timer_ev = cq_periodic_main_add(MEMUSAGE_PERIOD_MS, memusage_timer, mu);
r... | false | false | false | false | false | 0 |
vim_handle_signal(sig)
int sig;
{
static int got_signal = 0;
static int blocked = TRUE;
switch (sig)
{
case SIGNAL_BLOCK: blocked = TRUE;
break;
case SIGNAL_UNBLOCK: blocked = FALSE;
if (got_signal != 0)
{
kill(getpid(), got_signal);
got_signal = 0;
}... | false | false | false | false | false | 0 |
Continue(InterruptFlag after_what) {
ExecutionAccess access;
thread_local_.interrupt_flags_ &= ~static_cast<int>(after_what);
if (thread_local_.interrupt_flags_ == 0) {
reset_limits(access);
}
} | false | false | false | false | false | 0 |
load(ifstream & fp) {
uint type = loadValue<uint>(fp);
if(type!=ALPHPART_HDR)
return NULL;
SequenceAlphPart * ret = new SequenceAlphPart();
ret->sigma = loadValue<uint>(fp);
ret->origsigma = loadValue<uint>(fp);
ret->maxLen = loadValue<uint>(fp);
ret->... | 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.