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 |
|---|---|---|---|---|---|---|
IoHTTPParser_setRequestURI_givenSize_(void *data, const unsigned char * buffer, size_t bufferSize)
{
IoHTTPParser *self = (IoHTTPParser *)data;
if(bufferSize > MAX_REQUEST_URI_LENGTH)
{
HTTPParser *parser = PARSER(self);
HTTPParser_setParseError_(parser, "requestURI is longer than the allowed length of %d byte... | false | false | false | false | false | 0 |
handle_entry(struct dirent_data *entry, int flags, int maxdepth, cli_ftw_cb callback, struct cli_ftw_cbdata *data, cli_ftw_pathchk pathchk)
{
if (!entry->is_dir) {
return callback(entry->statbuf, entry->filename, entry->filename, visit_file, data);
} else {
return cli_ftw_dir(entry->dirname, flags, maxdepth, ... | false | false | false | false | false | 0 |
adf_init_admin_comms(struct adf_accel_dev *accel_dev)
{
struct adf_admin_comms *admin;
struct adf_hw_device_data *hw_data = accel_dev->hw_device;
struct adf_bar *pmisc =
&GET_BARS(accel_dev)[hw_data->get_misc_bar_id(hw_data)];
void __iomem *csr = pmisc->virt_addr;
void __iomem *mailbox = csr + ADF_DH895XCC_MAILB... | false | false | false | false | false | 0 |
transfer_map_access(const gs_data_source_t *psrc, ulong start, uint length,
byte *buf, const byte **ptr)
{
const gx_transfer_map *map = (const gx_transfer_map *)psrc->data.str.data;
uint i;
if (ptr)
*ptr = buf;
for (i = 0; i < length; ++i)
buf[i] = frac2byte(map->val... | false | false | false | false | false | 0 |
write_index(FILE *index, ARTHANDLE *art, const char *file)
{
fprintf(index, "%s ", file);
write_index_header(index, art, "Subject");
putc(' ', index);
write_index_header(index, art, "Message-ID");
fprintf(index, "\n");
if (ferror(index) || fflush(index) == EOF)
syswarn("cannot write inde... | false | false | false | false | false | 0 |
ahd_update_coalescing_values(struct ahd_softc *ahd, u_int timer, u_int maxcmds,
u_int mincmds)
{
if (timer > AHD_TIMER_MAX_US)
timer = AHD_TIMER_MAX_US;
ahd->int_coalescing_timer = timer;
if (maxcmds > AHD_INT_COALESCING_MAXCMDS_MAX)
maxcmds = AHD_INT_COALESCING_MAXCMDS_MAX;
if (mincmds > AHD_INT_COALE... | false | false | false | false | false | 0 |
create_port(int idx, int type)
{
struct snd_seq_port_info pinfo;
struct snd_seq_port_callback pcb;
struct snd_seq_dummy_port *rec;
if ((rec = kzalloc(sizeof(*rec), GFP_KERNEL)) == NULL)
return NULL;
rec->client = my_client;
rec->duplex = duplex;
rec->connect = 0;
memset(&pinfo, 0, sizeof(pinfo));
pinfo.add... | false | false | false | false | false | 0 |
kvm_dev_ioctl_get_cpuid(struct kvm_cpuid2 *cpuid,
struct kvm_cpuid_entry2 __user *entries,
unsigned int type)
{
struct kvm_cpuid_entry2 *cpuid_entries;
int limit, nent = 0, r = -E2BIG, i;
u32 func;
static const struct kvm_cpuid_param param[] = {
{ .func = 0, .has_leaf_count = true },
{ .func = 0x8... | false | false | false | false | false | 0 |
VerifyCallSite(CallSite CS) {
Instruction *I = CS.getInstruction();
Assert1(CS.getCalledValue()->getType()->isPointerTy(),
"Called function must be a pointer!", I);
const PointerType *FPTy = cast<PointerType>(CS.getCalledValue()->getType());
Assert1(FPTy->getElementType()->isFunctionTy(),
... | false | false | false | false | false | 0 |
slotSlaveGone()
{
IdleSlave *slave = (IdleSlave *) sender();
mSlaveList.removeAll(slave);
if ((mSlaveList.count() == 0) && (mTimer.isActive()))
{
mTimer.stop();
}
} | false | false | false | false | false | 0 |
compat_agpioc_reserve_wrap(struct agp_file_private *priv, void __user *arg)
{
struct agp_region32 ureserve;
struct agp_region kreserve;
struct agp_client *client;
struct agp_file_private *client_priv;
DBG("");
if (copy_from_user(&ureserve, arg, sizeof(ureserve)))
return -EFAULT;
if ((unsigned) ureserve.seg_c... | false | false | false | false | false | 0 |
getWaveletName(Type wavelet)
{
switch (wavelet) {
case Haar: return "Haar";
case Daubechies_2: return "Daubechies 2";
case Daubechies_3: return "Daubechies 3";
case Daubechies_4: return "Daubechies 4";
case Daubechies_5: return "Daubechies 5";
case Daubechies_6: retur... | false | false | false | false | false | 0 |
label_is_jump_target_p (label, jump_insn)
rtx label, jump_insn;
{
rtx tmp = JUMP_LABEL (jump_insn);
if (label == tmp)
return true;
if (tmp != NULL_RTX
&& (tmp = NEXT_INSN (tmp)) != NULL_RTX
&& GET_CODE (tmp) == JUMP_INSN
&& (tmp = PATTERN (tmp),
GET_CODE (tmp) == ADDR_VEC
|| GET... | false | false | false | false | false | 0 |
handle_interrupt (pixma_t * s, int timeout)
{
uint8_t buf[64];
int len;
len = pixma_wait_interrupt (s->io, buf, sizeof (buf), timeout);
if (len == PIXMA_ETIMEDOUT)
return 0;
if (len < 0)
return len;
if (len%16) /* len must be a multiple of 16 bytes */
{
PDBG (pixma_dbg
(1, ... | false | false | false | false | false | 0 |
createSpecialResponse( bool tls ) const {
QStringList result;
if ( tls )
result.push_back( QLatin1String("STARTTLS") );
result += saslMethodsQSL();
if ( have( "PIPELINING" ) )
result.push_back( QLatin1String("PIPELINING") );
if ( have( "8BITMIME" ) )
result.push_back( QLatin1String... | false | false | false | false | false | 0 |
my_strusage (int level)
{
const char *p;
switch (level)
{
case 11: p = "symcryptrun (GnuPG)";
break;
case 13: p = VERSION; break;
case 17: p = PRINTABLE_OS_NAME; break;
case 19: p = _("Please report bugs to <@EMAIL@>.\n"); break;
case 1:
case 40: p = _("Usage: symcryptrun [option... | false | false | false | false | false | 0 |
x86_get_event_constraints(struct cpu_hw_events *cpuc, int idx,
struct perf_event *event)
{
struct event_constraint *c;
if (x86_pmu.event_constraints) {
for_each_event_constraint(c, x86_pmu.event_constraints) {
if ((event->hw.config & c->cmask) == c->code) {
event->hw.flags |= c->flags;
return c;
... | false | false | false | false | false | 0 |
getDefaultValue(const TypePtr& p)
{
BuiltinPtr builtin = BuiltinPtr::dynamicCast(p);
if(builtin)
{
switch(builtin->kind())
{
case Builtin::KindBool:
{
return "false";
}
case Builtin::KindByte:
case Builtin::KindShort... | false | false | false | false | false | 0 |
genwqe_info_show(struct seq_file *s, void *unused)
{
struct genwqe_dev *cd = s->private;
u16 val16, type;
u64 app_id, slu_id, bitstream = -1;
struct pci_dev *pci_dev = cd->pci_dev;
slu_id = __genwqe_readq(cd, IO_SLU_UNITCFG);
app_id = __genwqe_readq(cd, IO_APP_UNITCFG);
if (genwqe_is_privileged(cd))
bitstrea... | false | false | false | false | false | 0 |
storeKeyHashCmp(const void *a, const void *b)
{
const unsigned char *A = a;
const unsigned char *B = b;
int i;
for (i = 0; i < SQUID_MD5_DIGEST_LENGTH; i++) {
if (A[i] < B[i])
return -1;
if (A[i] > B[i])
return 1;
}
return 0;
} | false | false | false | false | false | 0 |
imapx_job_noop_start (CamelIMAPXJob *job,
CamelIMAPXServer *is,
GCancellable *cancellable,
GError **error)
{
CamelIMAPXCommand *ic;
CamelFolder *folder;
folder = camel_imapx_job_ref_folder (job);
ic = camel_imapx_command_new (
is, "NOOP", folder,... | false | false | false | false | false | 0 |
manageBase(GenericBase * base)
{
_basetav = 0;
// scan all buildings looking for creatures
uint count = base->getBuildingCount();
uint nbuil;
ialogN("Try buy");
for( nbuil = 0; nbuil < count ; nbuil++ ) {
GenericInsideBuilding * building=base->getBuilding( nbuil );
InsideAction * action = DataTheme.bases.at( ... | false | false | false | false | false | 0 |
bdget_disk(struct gendisk *disk, int partno)
{
struct hd_struct *part;
struct block_device *bdev = NULL;
part = disk_get_part(disk, partno);
if (part)
bdev = bdget(part_devt(part));
disk_put_part(part);
return bdev;
} | false | false | false | false | false | 0 |
allocate_color_stack(patch_fill_state_t *pfs, gs_memory_t *memory)
{
if (pfs->color_stack != NULL)
return 0;
pfs->color_stack_step = offset_of(patch_color_t, cc.paint.values[pfs->num_components]);
pfs->color_stack_step = (pfs->color_stack_step + sizeof(void *) - 1) / sizeof(void *) * sizeof(void *);... | false | false | false | false | false | 0 |
btl_openib_async_poll_init(struct mca_btl_openib_async_poll *devices_poll)
{
devices_poll->active_poll_size = 1;
devices_poll->poll_size = 4;
devices_poll->async_pollfd = malloc(sizeof(struct pollfd) * devices_poll->poll_size);
if (NULL == devices_poll->async_pollfd) {
BTL_ERROR(("Failed malloc:... | false | false | false | false | false | 0 |
is_special_global_name(const char *m, const char *e, rb_encoding *enc)
{
int mb = 0;
if (m >= e) return 0;
if (is_global_name_punct(*m)) {
++m;
}
else if (*m == '-') {
++m;
if (m < e && is_identchar(m, e, enc)) {
if (!ISASCII(*m)) mb = 1;
m += rb_enc_mbclen(m, e, enc);
}
}
els... | false | false | false | false | false | 0 |
ges_audio_transition_duration_changed (GESTrackElement * track_element,
guint64 duration)
{
GESAudioTransition *self;
GstElement *gnlobj = ges_track_element_get_gnlobject (track_element);
GstTimedValueControlSource *ta, *tb;
self = GES_AUDIO_TRANSITION (track_element);
GST_INFO ("updating controller: gn... | false | false | false | false | false | 0 |
wrt_mono(Term m2)
{
int ret=0,n,d;
List ms,l;
ms=CopyTerm(CompoundArg2(m2));
for(l=CompoundArgN(m2,3);l;l=ListTail(l))
ms=AppendLast(ms,MakeCompound2(OPR_POW,ListFirst(l),NewInteger(1)));
if(is_compound(CompoundArg1(m2)))
{
n=IntegerValue(CompoundArg1(CompoundArg1(m2)));
d=IntegerValue(CompoundArg2(Compound... | false | false | false | false | false | 0 |
gst_base_sink_chain_unlocked (GstBaseSink * basesink, GstPad * pad,
guint8 obj_type, gpointer obj)
{
GstBaseSinkClass *bclass;
GstFlowReturn result;
GstClockTime start = GST_CLOCK_TIME_NONE, end = GST_CLOCK_TIME_NONE;
GstSegment *clip_segment;
GstBuffer *time_buf;
if (G_UNLIKELY (basesink->flushing))
... | false | false | false | false | false | 0 |
xen_hvm_init_time_ops(void)
{
/* vector callback is needed otherwise we cannot receive interrupts
* on cpu > 0 and at this point we don't know how many cpus are
* available */
if (!xen_have_vector_callback)
return;
if (!xen_feature(XENFEAT_hvm_safe_pvclock)) {
printk(KERN_INFO "Xen doesn't support pvclock on... | false | false | false | false | false | 0 |
tr_needs_eval()const
{
switch (_gatemode) {
case moUNKNOWN: unreachable(); break;
case moMIXED: unreachable(); break;
case moDIGITAL:
//assert(!is_q_for_eval());
if (_sim->analysis_is_restore()) {untested();
}else if (_sim->analysis_is_static()) {
}else{
}
return (_sim->analysis_is_sta... | false | false | false | false | false | 0 |
applyDefaults(Input::Format f) {
if (f != Input::SMODELS && satPreDefault) {
SatElite::SatElite* pre = new SatElite::SatElite();
pre->options.maxIters = 20;
pre->options.maxOcc = 25;
pre->options.maxTime = 120;
config->ctx.satPrepro.reset(pre);
}
} | false | false | false | false | false | 0 |
syncop_readlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int op_ret, int op_errno, const char *path,
struct iatt *stbuf, dict_t *xdata)
{
struct syncargs *args = NULL;
args = cookie;
args->op_ret = op_ret;
args->op_errno = op_e... | false | false | false | false | false | 0 |
offsetParent() const
{
if (isBody() || style()->position() == PFIXED)
return 0;
// can't really use containing blocks here (#113280)
bool skipTables = isPositioned() || isRelPositioned();
bool strict = !style()->htmlHacks();
RenderObject* curr = parent();
while (curr && (!curr->element(... | false | false | false | false | false | 0 |
primitive_tuple_boa() {
data_root<tuple_layout> layout(ctx->pop(), this);
tagged<tuple> t(allot<tuple>(tuple_size(layout.untagged())));
t->layout = layout.value();
cell size = untag_fixnum(layout.untagged()->size) * sizeof(cell);
memcpy(t->data(), (cell*)(ctx->datastack - size + sizeof(cell)), size);
ctx->... | false | false | false | false | false | 0 |
au0828_dvb_stop_feed(struct dvb_demux_feed *feed)
{
struct dvb_demux *demux = feed->demux;
struct au0828_dev *dev = (struct au0828_dev *) demux->priv;
struct au0828_dvb *dvb = &dev->dvb;
int ret = 0;
dprintk(1, "%s()\n", __func__);
if (dvb->frontend) {
cancel_work_sync(&dev->restart_streaming);
mutex_lock(... | false | false | false | false | false | 0 |
smf_track_new(void)
{
smf_track_t *track = malloc(sizeof(smf_track_t));
if (track == NULL) {
g_critical("Cannot allocate smf_track_t structure: %s", strerror(errno));
return (NULL);
}
memset(track, 0, sizeof(smf_track_t));
track->next_event_number = 0;
track->events_array = g_ptr_array_new();
assert(track-... | false | false | false | false | false | 0 |
main(int argc, char* argv[])
{
if (argc < 3) {
cerr << "usage: test <n> <file>" << endl;
return 1;
}
for (int i = 0; i < atoi(argv[1]); i++) doTest(argc - 2, argv + 2);
} | false | false | false | false | false | 0 |
new_obj_unconnected(enum obj_type type, struct inst *base)
{
struct obj *obj;
obj = alloc_type(struct obj);
obj->type = type;
obj->name = NULL;
obj->frame = active_frame;
obj->base = inst_get_vec(base);
obj->next = NULL;
obj->lineno = 0;
return obj;
} | false | false | false | false | false | 0 |
totem_pl_parser_line_is_empty (const char *line)
{
guint i;
if (line == NULL)
return TRUE;
for (i = 0; line[i] != '\0'; i++) {
if (line[i] != '\t' && line[i] != ' ')
return FALSE;
}
return TRUE;
} | false | false | false | false | false | 0 |
adjust_arginfo(Namep np)
#endif
/* adjust arginfo to omit the length arg for the
arg that we now know to be a character-valued
function */
{
struct Entrypoint *ep;
chainp args;
Argtypes *at;
for(ep = entries; ep; ep = ep->entnextp)
for(args = ep->arglist; args; args = args->nextp)
if (np == (Na... | false | false | false | false | false | 0 |
has_a_job_in_progress(PROJECT* p) {
for (unsigned int j=0; j<gstate.results.size(); j++) {
RESULT* rp = gstate.results[j];
if (rp->project != p) continue;
if (rp->state() < RESULT_FILES_UPLOADED) {
return true;
}
}
return false;
} | false | false | false | false | false | 0 |
start_element_cb (GMarkupParseContext *ctx,
const char *element_name,
const char **attribute_names,
const char **attribute_values,
gpointer user_data,
GError **err)
{
ParserInfo *info;
info = (ParserInfo *) user_data;
if (strcmp (element_name, "text") == 0)
info->in_text = TRUE;
else if (str... | false | false | false | false | false | 0 |
acl_match_ip(struct acl_test *test, struct acl_pattern *pattern)
{
struct in_addr *s;
if (test->i != AF_INET)
return ACL_PAT_FAIL;
s = (void *)test->ptr;
if (((s->s_addr ^ pattern->val.ipv4.addr.s_addr) & pattern->val.ipv4.mask.s_addr) == 0)
return ACL_PAT_PASS;
return ACL_PAT_FAIL;
} | false | false | false | false | false | 0 |
eventKeyDown(const SDL_KeyboardEvent* key)
{
int mod = SDL_GetModState() & ~(KMOD_NUM | KMOD_CAPS | KMOD_MODE);
if ( (mod & KMOD_CTRL) &&( key->keysym.sym == SDLK_r ))
return insertCursorCoordinates();
return ASC_PG_Dialog::eventKeyDown(key);
} | false | false | false | false | false | 0 |
LockCheckConflicts(LockMethod lockMethodTable,
LOCKMODE lockmode,
LOCK *lock,
PROCLOCK *proclock,
PGPROC *proc)
{
int numLockModes = lockMethodTable->numLockModes;
LOCKMASK myLocks;
LOCKMASK otherLocks;
int i;
/*
* first check for global conflicts: If no locks conflict with my re... | false | false | false | false | false | 0 |
_gtk_marshal_BOOLEAN__OBJECT_OBJECT_OBJECTv (GClosure *closure,
GValue *return_value,
gpointer instance,
va_list args,
... | false | false | false | false | false | 0 |
xrealloc(void *w, size_t n) {
void *v;
v = realloc(w, n);
if (n != 0 && !v) abort();
return v;
} | false | false | false | false | false | 0 |
hash_file_list_start(void)
{
g_assert(!hash_priv.uris);
gtkhash_hash_file_clear_digests(&hash_priv.file_data);
hash_priv.uris = list_get_all_uris();
g_assert(hash_priv.uris);
hash_file_start(hash_priv.uris->data);
} | false | false | false | false | false | 0 |
show_bank1_value(struct device *dev,
struct device_attribute *devattr, char *buf)
{
struct sensor_device_attribute_2 *attr = to_sensor_dev_attr_2(devattr);
struct abituguru_data *data = abituguru_update_device(dev);
if (!data)
return -EIO;
return sprintf(buf, "%d\n", (data->bank1_value[attr->index] *
data->ban... | false | false | false | false | false | 0 |
CLWOMeshFileLoader(scene::ISceneManager* smgr,
io::IFileSystem* fs)
: SceneManager(smgr), FileSystem(fs), File(0), Mesh(0)
{
#ifdef _DEBUG
setDebugName("CLWOMeshFileLoader");
#endif
} | false | false | false | false | false | 0 |
dump_hdt(struct s_hardware *hardware, ZZJSON_CONFIG *config, ZZJSON **item) {
(void) hardware;
CREATE_NEW_OBJECT;
add_s("hdt.product_name",PRODUCT_NAME);
add_s("hdt.version",VERSION);
add_s("hdt.code_name",CODENAME);
add_s("hdt.author", AUTHOR);
add_s("hdt.core_developer", CORE_DEVELOPER);
char *contributors[N... | true | true | false | false | false | 1 |
redraw(void)
{
if (owner()->mapped()==MSTrue)
{
MSWidgetCommon::drawBackground();
if(highlighted()==MSTrue) drawHighlight();
else undrawHighlight();
drawSymbol();
if (pixmap()==0) drawLabel();
else drawPixmap();
}
} | false | false | false | false | false | 0 |
LowerDbgDeclare(Function &F) {
DIBuilder DIB(*F.getParent(), /*AllowUnresolved*/ false);
SmallVector<DbgDeclareInst *, 4> Dbgs;
for (auto &FI : F)
for (Instruction &BI : FI)
if (auto DDI = dyn_cast<DbgDeclareInst>(&BI))
Dbgs.push_back(DDI);
if (Dbgs.empty())
return false;
for (auto &I ... | false | false | false | false | false | 0 |
tuple_evalnode_free(TupleEvalNode *expr)
{
TupleEvalNode *curr = expr, *next;
while (curr) {
next = curr->next;
g_free(curr->text);
if (curr->children)
tuple_evalnode_free(curr->children);
g_free(curr);
curr = next;
}
} | false | false | false | false | false | 0 |
GroupFind(char *id)
#else
GroupFind(id)
char *id;
#endif
{
PARSERGROUP *pg;
for (pg = parserGroups; pg != (PARSERGROUP *)0; pg = pg->next) {
if (strcmp(id, pg->name->string) == 0)
return pg;
}
return pg;
} | false | false | false | false | false | 0 |
play_song(song_iterator_t *it, GTimeVal *wakeup_time, int writeahead_time)
{
unsigned char buf[8];
int result;
if (play_paused) {
GTimeVal ct;
sci_get_current_time(&ct);
*wakeup_time =
add_time_delta(*wakeup_time, delta_time(play_pause_counter, ct));
play_pause_counter = ct;
} else
/* Not paused: */
... | false | false | false | false | false | 0 |
we_var_move_cb(GtkButton *button, gpointer data)
{
GtkTreeView *view;
GtkTreeModel *model;
GtkTreeSelection *selection;
GList *selected;
GtkTreeIter iter;
World *world;
gboolean is_up;
gint new_pos;
view = (GtkTreeView *) data;
world = (Wor... | false | false | false | false | false | 0 |
erase_next (DialogData *data)
{
UDisksBlock *block = NULL;
GVariantBuilder options_builder;
const gchar *erase_type;
g_assert (data->blocks_erase_iter != NULL);
block = UDISKS_BLOCK (data->blocks_erase_iter->data);
data->blocks_erase_iter = data->blocks_erase_iter->next;
erase_type = data->erase_type;... | false | false | false | false | false | 0 |
dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
return (dissector_try_uint(m3ap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
} | false | false | false | false | false | 0 |
asn_build_string(u_char * data,
size_t * datalength,
u_char type, const u_char * str, size_t strlength)
{
/*
* ASN.1 octet string ::= primstring | cmpdstring
* primstring ::= 0x04 asnlength byte {byte}*
* cmpdstring ::= 0x24 asnlength string {string}*
* This cod... | false | false | false | false | false | 0 |
get_defaults_options(int argc, char **argv,
char **defaults,
char **extra_defaults,
char **group_suffix)
{
int org_argc= argc, prev_argc= 0;
*defaults= *extra_defaults= *group_suffix= 0;
while (argc >= 2 && argc != prev_argc)
{
/* S... | false | false | false | false | false | 0 |
DoBinds()
{
struct PortInfo *pptr;
for (pptr = PortList; pptr; pptr = pptr->next)
{
if ((pptr->tries < MaxBinds) && (pptr->socket == NOSOCKET))
{
DoListen(pptr);
if (pptr->tries >= MaxBinds)
{
putlog(LOG2,
"Giving up attempt to bind port [%d]",
pptr->port);
SendUmode(OPE... | false | false | false | false | false | 0 |
Undefined() {
i::Isolate* isolate = i::Isolate::Current();
if (!EnsureInitializedForIsolate(isolate, "v8::Undefined()")) {
return v8::Handle<v8::Primitive>();
}
return v8::Handle<Primitive>(ToApi<Primitive>(
isolate->factory()->undefined_value()));
} | false | false | false | false | false | 0 |
Run(TKawariVM &vm){
string entry_name=entry_id->Run(vm);
if (!entry_name.size()) return("");
TEntry entry=vm.Dictionary().GetEntry(entry_name);
if (entry.AssertIfEmpty(entry_name)) return("");
string num=expr->Run(vm);
int index=atoi(num.c_str());
if (index<0) index+=entry.Size();
if (index<0) return("");
T... | false | false | false | false | false | 0 |
has_input(struct mansession *s)
{
int x;
for (x=1;x<s->inlen;x++)
if ((s->inbuf[x] == '\n') && (s->inbuf[x-1] == '\r'))
return 1;
return 0;
} | false | false | false | false | false | 0 |
track_hdr_cb(const route_head* trk)
{
this_index++;
if (this_index != track_index) {
return;
}
write_header(trk);
} | false | false | false | false | false | 0 |
get_server_verify(SSL *s)
{
unsigned char *p;
int i, n, len;
p=(unsigned char *)s->init_buf->data;
if (s->state == SSL2_ST_GET_SERVER_VERIFY_A)
{
i=ssl2_read(s,(char *)&(p[s->init_num]),1-s->init_num);
if (i < (1-s->init_num))
return(ssl2_part_read(s,SSL_F_GET_SERVER_VERIFY,i));
s->init_num += i;
s... | false | false | false | false | false | 0 |
chv_get_stolen_size(u16 gmch_ctrl)
{
gmch_ctrl >>= SNB_GMCH_GMS_SHIFT;
gmch_ctrl &= SNB_GMCH_GMS_MASK;
/*
* 0x0 to 0x10: 32MB increments starting at 0MB
* 0x11 to 0x16: 4MB increments starting at 8MB
* 0x17 to 0x1d: 4MB increments start at 36MB
*/
if (gmch_ctrl < 0x11)
return gmch_ctrl << 25;
else if (... | false | false | false | false | false | 0 |
pcie_pme_from_pci_bridge(struct pci_bus *bus, u8 devfn)
{
struct pci_dev *dev;
bool found = false;
if (devfn)
return false;
dev = pci_dev_get(bus->self);
if (!dev)
return false;
if (pci_is_pcie(dev) && pci_pcie_type(dev) == PCI_EXP_TYPE_PCI_BRIDGE) {
down_read(&pci_bus_sem);
if (pcie_pme_walk_bus(bus))... | false | false | false | false | false | 0 |
upsdrv_updateinfo(void)
{
char command[] = COM_POLL_STAT;
int i;
static int retry = 0;
/*
* Fill the command portion with random characters from the range
* [A...J].
*/
for (i = 1; i < 12; i++) {
command[i] = (random() % 10) + 'A';
}
/*
* Find which character must be an 'L' and put it there.
*/
co... | false | false | false | false | true | 1 |
_transactionid_disp(struct dm_report *rh, struct dm_pool *mem,
struct dm_report_field *field,
const void *data, void *private)
{
const struct lv_segment *seg = (const struct lv_segment *) data;
/* Suppress thin count if not thin pool */
if (!seg_is_thin_pool(seg)) {
dm_report_field_set_value(field, "", NU... | false | false | false | false | false | 0 |
us_osc_msg_bundle_append( us_osc_msg_bundle_t *self, us_osc_msg_t *msg )
{
us_osc_msg_t *r = 0;
if ( self && msg )
{
if ( !self->m_first_msg )
{
self->m_first_msg = msg;
}
else
{
self->m_last_msg->m_next = msg;
}
self->m_last_ms... | false | false | false | false | false | 0 |
gst_y4m_encode_get_property (GObject * object, guint prop_id, GValue * value,
GParamSpec * pspec)
{
GstY4mEncode G_GNUC_UNUSED *filter;
g_return_if_fail (GST_IS_Y4M_ENCODE (object));
filter = GST_Y4M_ENCODE (object);
switch (prop_id) {
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id,... | false | false | false | false | false | 0 |
pin_config_match(struct hda_codec *codec,
const struct hda_pintbl *pins)
{
int i;
for (i = 0; i < codec->init_pins.used; i++) {
struct hda_pincfg *pin = snd_array_elem(&codec->init_pins, i);
hda_nid_t nid = pin->nid;
u32 cfg = pin->cfg;
const struct hda_pintbl *t_pins;
int found;
t_pins = pins;
... | false | false | false | false | false | 0 |
GetFloat (char *data, float *val){
char *endPtr;
double retVal;
assert (val);
errno = 0;
retVal = strtod (data, &endPtr);
if (retVal == 0 && (errno != 0 || data == endPtr)) return false;
if (errno != 0 && (retVal >= 1000000.0 || retVal <= -1000000.0)) return false;
*val = (float) retVal;
return true... | false | false | false | false | false | 0 |
shrink_list(enum lru_list lru, unsigned long nr_to_scan,
struct lruvec *lruvec, struct scan_control *sc)
{
if (is_active_lru(lru)) {
if (inactive_list_is_low(lruvec, lru))
shrink_active_list(nr_to_scan, lruvec, sc, lru);
return 0;
}
return shrink_inactive_list(nr_to_scan, lruvec, sc, lru);
} | false | false | false | false | false | 0 |
key_unit_unload_all(void)
{
struct unit *pnext_focus = NULL, *plast;
unit_list_iterate(get_units_in_focus(), punit) {
if ((plast = request_unit_unload_all(punit))) {
pnext_focus = plast;
}
} unit_list_iterate_end;
if (pnext_focus) {
unit_list_iterate(get_units_in_focus(), punit) {
/* U... | false | false | false | false | false | 0 |
drm_intel_gem_context_create(drm_intel_bufmgr *bufmgr)
{
drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *)bufmgr;
struct drm_i915_gem_context_create create;
drm_intel_context *context = NULL;
int ret;
context = calloc(1, sizeof(*context));
if (!context)
return NULL;
VG_CLEAR(create);
ret = drmIoct... | false | false | false | false | false | 0 |
e_modapi_shutdown(E_Module *m __UNUSED__)
{
E_Config_Dialog *cfd;
while ((cfd = e_config_dialog_get("E", "windows/window_process"))) e_object_del(E_OBJECT(cfd));
while ((cfd = e_config_dialog_get("E", "windows/window_list_menu"))) e_object_del(E_OBJECT(cfd));
while ((cfd = e_config_dialog_get("E", "windows/... | false | false | false | false | false | 0 |
save_settings(void)
{
GKeyFile *config = g_key_file_new();
gchar *config_dir = g_path_get_dirname(CONFIG_FILE);
gchar *data;
g_key_file_load_from_file(config, CONFIG_FILE, G_KEY_FILE_NONE, NULL);
if (! g_file_test(config_dir, G_FILE_TEST_IS_DIR) && utils_mkdir(config_dir, TRUE) != 0)
{
g_free(config_di... | false | false | false | false | false | 0 |
ltc2952_poweroff_probe(struct platform_device *pdev)
{
int ret;
struct ltc2952_poweroff *data;
if (pm_power_off) {
dev_err(&pdev->dev, "pm_power_off already registered");
return -EBUSY;
}
data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
if (!data)
return -ENOMEM;
data->dev = &pdev->dev;
plat... | false | false | false | false | false | 0 |
EnsureCaretVisible(bool useMargin, bool vert, bool horiz) {
SetXYScroll(XYScrollToMakeVisible(SelectionRange(posDrag.IsValid() ? posDrag : sel.RangeMain().caret),
static_cast<XYScrollOptions>((useMargin?xysUseMargin:0)|(vert?xysVertical:0)|(horiz?xysHorizontal:0))));
} | false | false | false | false | false | 0 |
getvol()
{
int fd;
int status=0;
int x;
fd=open(device,0);
if(fd < 0)
{
fprintf(stderr,"asmixer:unable to grab %s\n", device);
return;
}
for(x=0;x<3;x++)
{
if (ioctl(fd,MIXER_READ(voldev[x]),&vol[x]) < 0)
status = -1;
vol[x]=vol[x] >> 8;
volbu... | false | false | false | false | false | 0 |
start_search (NautilusSearchDirectory *search)
{
NautilusSearchEngineModel *model_provider;
NautilusSearchEngineSimple *simple_provider;
if (!search->details->query) {
return;
}
if (search->details->search_running) {
return;
}
if (!search->details->monitor_list && !search->details->pending_callback_list) ... | false | false | false | false | false | 0 |
redo_cut(undo *u) {
int i;
filestruct *t, *c;
/* If we cut the magicline may was well not crash :/ */
if (!u->cutbuffer)
return;
do_gotolinecolumn(u->lineno, u->begin+1, FALSE, FALSE, FALSE, FALSE);
openfile->mark_set = u->mark_set;
if (cutbuffer)
free(cutbuffer);
cutbuffer = NULL;
... | false | false | false | false | false | 0 |
Message(gchar* message, gchar* title)
{
GtkWidget* dialog = NULL;
if(!message) return;
if(!title) return;
if(strstr(title,"Error"))
dialog = gtk_message_dialog_new_with_markup (NULL,
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
"%s",
message);
else
dialog = gtk... | false | false | false | false | false | 0 |
search_ctnr(CONTAINER rootNode, COMPARE_FUNC compare_func, void* pattern)
{
CONTAINER it;
INDEX counter = 0;
if (rootNode == NIL || compare_func == NIL || pattern == NIL) {
rpterr("search_ctnr: NIL argument");
return -1;
}
for (it = rootNode->next; it != rootNode; it = it->next) {
if (compare_func(pattern... | false | false | false | false | false | 0 |
cmsStageAllocCLut16bitGranular(cmsContext ContextID,
const cmsUInt32Number clutPoints[],
cmsUInt32Number inputChan,
cmsUInt32Number outputChan,
const cm... | false | false | false | false | false | 0 |
_sys_glob(char *pattern, int *num_files)
{
int i = 0;
char **files = NULL;
glob_t result;
glob(pattern, GLOB_MARK, NULL, &result);
files = (char **)calloc(result.gl_pathc + 1, sizeof(char *));
for (i = 0 ; i < result.gl_pathc; i++) {
files[i] = strdup(result.gl_pathv[i]);
}
if (num_files)
*... | false | false | false | false | false | 0 |
create_log_grid (double start, double end,
int num_points)
{
log_grid *grid = malloc (sizeof (log_grid));
grid->code = LOG;
grid->start = start;
grid->end = end;
grid->num_points = num_points;
grid->points = malloc(num_points*sizeof(double));
grid->a = 1.0/(double)(num_points-1)*log(end/start);
grid-... | false | true | false | false | false | 1 |
contains(const Point& pt) const
{
return
pt.x >= x && pt.x < x+w &&
pt.y >= y && pt.y < y+h;
} | false | false | false | false | false | 0 |
gf_odf_parse_command(GF_BitStream *bs, GF_ODCom **com, u32 *com_size)
{
u32 val, size, sizeHeader;
u8 tag;
GF_Err err;
GF_ODCom *newCom;
if (!bs) return GF_BAD_PARAM;
*com_size = 0;
//tag
tag = gf_bs_read_int(bs, 8);
sizeHeader = 1;
//size
size = 0;
do {
val = gf_bs_read_int(bs, 8);
sizeHeader++;
... | false | false | false | false | false | 0 |
run_tests(struct test *tests, int argc, char **argv) {
int result = EXIT_SUCCESS;
list_for_each(t, tests) {
if (! should_run(t->name, argc, argv))
continue;
if (run_one_test(t) < 0)
result = EXIT_FAILURE;
}
return result;
} | false | false | false | false | false | 0 |
set_pkeys(struct ipath_devdata *dd, u16 *pkeys, u8 port)
{
struct ipath_portdata *pd;
int i;
int changed = 0;
/* always a kernel port, no locking needed */
pd = dd->ipath_pd[0];
for (i = 0; i < ARRAY_SIZE(pd->port_pkeys); i++) {
u16 key = pkeys[i];
u16 okey = pd->port_pkeys[i];
if (key == okey)
contin... | false | false | false | false | false | 0 |
ph_disconnect(struct st5481_adapter *adapter)
{
DBG(8, "");
st5481_in_mode(&adapter->d_in, L1_MODE_NULL);
// Turn off the green LED to tell that we left state F7
adapter->leds &= ~GREEN_LED;
st5481_usb_device_ctrl_msg(adapter, GPIO_OUT, adapter->leds, NULL, NULL);
} | false | false | false | false | false | 0 |
initio_state_3(struct initio_host * host)
{
struct scsi_ctrl_blk *scb = host->active;
struct target_control *active_tc = host->active_tc;
int i;
#if DEBUG_STATE
printk("-s3-");
#endif
for (;;) {
switch (host->phase) {
case CMD_OUT: /* Command out phase */
for (i = 0; i < (int) scb->cdblen; i++)
... | false | false | false | false | false | 0 |
__ecereMethod___ecereNameSpace__ecere__gui__controls__PopupMenu_MenuItemSelection(struct __ecereNameSpace__ecere__com__Instance * this, struct __ecereNameSpace__ecere__com__Instance * parentMenu, struct __ecereNameSpace__ecere__gui__controls__ItemPtr * selectionPtr, unsigned int key)
{
struct __ecereNameSpace__ecere__g... | false | false | false | false | false | 0 |
main()
{
f(kwsys_stl::vector<int>());
return 0;
} | false | false | false | false | false | 0 |
ProcessBlock(BasicBlock &BB) {
// Can't sink anything out of a block that has less than two successors.
if (BB.getTerminator()->getNumSuccessors() <= 1) return false;
// Don't bother sinking code out of unreachable blocks. In addition to being
// unprofitable, it can also lead to infinite looping, because in a... | 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.