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 |
|---|---|---|---|---|---|---|
dc1394_usb_camera_new (platform_t * p, platform_device_t * device,
uint32_t unit_directory_offset)
{
libusb_device_handle * handle;
platform_camera_t * camera;
if (libusb_open (device->dev, &handle) < 0) {
dc1394_log_error ("usb: Failed to open device");
return NULL;
}
if (... | false | false | false | false | false | 0 |
SetStyleTable(OGRStyleTable *poStyleTable)
{
if ( m_poStyleTable )
delete m_poStyleTable;
if ( poStyleTable )
m_poStyleTable = poStyleTable->Clone();
} | false | false | false | false | false | 0 |
parseIndex(std::string::const_iterator& itFmt, const std::string::const_iterator& endFmt)
{
int index = 0;
while (itFmt != endFmt && Ascii::isDigit(*itFmt))
{
index = 10*index + *itFmt - '0';
++itFmt;
}
if (itFmt != endFmt && *itFmt == ']') ++itFmt;
return index;
} | false | false | false | false | false | 0 |
xmlSchemaPIllegalAttrErr(xmlSchemaParserCtxtPtr ctxt,
xmlParserErrors error,
xmlSchemaBasicItemPtr ownerComp ATTRIBUTE_UNUSED,
xmlAttrPtr attr)
{
xmlChar *strA = NULL, *strB = NULL;
xmlSchemaFormatNodeForError(&strA, ACTXT_CAST ctxt, at... | false | false | false | false | false | 0 |
operator<< (ostream& o, PointCut& p)
{
for (const ListElement* e = p.first(); e; e = p.next(e)) {
JoinPoint& jp = ((JoinPoint&)*e);
o << jp;
}
return o;
} | false | false | false | false | false | 0 |
xhci_change_max_exit_latency(struct xhci_hcd *xhci,
struct usb_device *udev, u16 max_exit_latency)
{
struct xhci_virt_device *virt_dev;
struct xhci_command *command;
struct xhci_input_control_ctx *ctrl_ctx;
struct xhci_slot_ctx *slot_ctx;
unsigned long flags;
int ret;
spin_lock_irqsave(&xhci->lock, flags);
... | false | false | false | false | false | 0 |
fmc_match(struct device *dev, struct device_driver *drv)
{
struct fmc_driver *fdrv = to_fmc_driver(drv);
struct fmc_device *fdev = to_fmc_device(dev);
struct fmc_fru_id *fid;
int i, matched = 0;
/* This currently only matches the EEPROM (FRU id) */
fid = fdrv->id_table.fru_id;
if (!fid) {
dev_warn(&fdev->dev,... | false | false | false | false | false | 0 |
ct_encode_char(char *dst, size_t len, Char c, mbstate_t *state)
{
ssize_t l = 0;
if (len < ct_enc_width(c))
return -1;
l = wcrtomb(dst, c, state);
if (l < 0) {
memset (state, 0, sizeof (mbstate_t));
l = 0;
}
return l;
} | false | false | false | false | false | 0 |
sg_NumHumans()
{
int humans = 0;
for (int i = se_PlayerNetIDs.Len()-1; i>=0; i--)
{
ePlayerNetID* p = se_PlayerNetIDs(i);
if (p->IsHuman() && p->IsActive() && ( bool(p->CurrentTeam()) || bool(p->NextTeam()) ) )
humans++;
}
return humans;
} | false | false | false | false | false | 0 |
rt73usb_load_firmware(struct rt2x00_dev *rt2x00dev,
const u8 *data, const size_t len)
{
unsigned int i;
int status;
u32 reg;
/*
* Wait for stable hardware.
*/
for (i = 0; i < 100; i++) {
rt2x00usb_register_read(rt2x00dev, MAC_CSR0, ®);
if (reg)
break;
msleep(1);
}
if (!reg) {
rt2x00_err(... | false | false | false | false | false | 0 |
spseek(stream * s, gs_offset_t pos)
{
if_debug3m('s', s->memory, "[s]seek 0x%"PRIx64" to %"PRId64", position was %"PRId64"\n",
(uint64_t)s, (int64_t)pos, (int64_t)stell(s));
return (*(s)->procs.seek) (s, pos);
} | false | false | false | false | false | 0 |
un_create(const char *path,mode_t mode)
{
struct sockaddr_un addr;
mode_t old_umask;
int size;
int s;
s = socket(PF_UNIX,SOCK_DGRAM,0);
if (s < 0) return s;
(void) unlink(path);
size = mkaddr(path,&addr);
old_umask = umask(~mode);
if (bind(s,(struct sockaddr *) &addr,size) < 0) ... | false | false | false | false | true | 1 |
maildir_get_new_message_filename(struct maildir * md,
char * tmp_file)
{
char filename[PATH_MAX];
char basename[PATH_MAX];
int k;
time_t now;
int got_file;
int r;
got_file = 0;
now = time(NULL);
k = 0;
while (k < MAX_TRY_ALLOC) {
snprintf(basename, sizeof(basename), "%lu.%u_%u.%s",
... | false | false | false | false | false | 0 |
pr_memory_table(FILE *fp)
{
Memory_table *mempt;
if (memory_head != NULL) {
fputs("%%\nlocal {\n", fp);
mempt = memory_head;
while (mempt != NULL) {
fprintf(fp, " pe%d:", mempt->pe_no);
if (mempt->lm_size > 0)
fprintf(fp, " lm_size=%d;", mempt->lm_size);
if (mempt->dsm_size > 0)
fprintf(f... | false | false | false | false | false | 0 |
growOperands() {
unsigned e = getNumOperands();
unsigned NumOps = e + e / 2;
if (NumOps < 2) NumOps = 2; // 2 op PHI nodes are VERY common.
ReservedSpace = NumOps;
growHungoffUses(ReservedSpace, /* IsPhi */ true);
} | false | false | false | false | false | 0 |
get_next_record(struct dmesg_control *ctl, struct dmesg_record *rec)
{
size_t i;
const char *begin = NULL;
if (!rec->next || !rec->next_size)
return 1;
rec->mesg = NULL;
rec->mesg_size = 0;
rec->facility = -1;
rec->level = -1;
rec->tv.tv_sec = 0;
rec->tv.tv_usec = 0;
for (i = 0; i < rec->next_size; i++) ... | false | false | false | false | false | 0 |
AddStatusFiles(std::vector<pkgIndexFile *> &List)
{
if (d->StatusFile == 0)
d->StatusFile = new debStatusIndex(_config->FindFile("Dir::State::status"));
List.push_back(d->StatusFile);
return true;
} | false | false | false | false | false | 0 |
canMoveUp()
{
if (!m_CurrentView)
return false;
QModelIndex idx = m_CurrentView->currentIndex();
if (!idx.isValid())
return false;
if (idx.row() >= 1)
return true;
return false;
} | false | false | false | false | false | 0 |
findCommutedOpIndices(MachineInstr *MI,
unsigned &SrcOpIdx0,
unsigned &SrcOpIdx1) const {
const MCInstrDesc &MCID = MI->getDesc();
if (!MCID.isCommutable())
return false;
unsigned Opc = MI->getOpcode();
int Src0Idx = AMDGPU::ge... | false | false | false | false | false | 0 |
okToPrintHighRes(GBool ignoreOwnerPW) {
if (encrypted) {
if (2 == encRevision) {
return (okToPrint(ignoreOwnerPW));
} else if (encRevision >= 3) {
return (okToPrint(ignoreOwnerPW) && (permFlags & permHighResPrint));
} else {
// something weird - unknown security handler version
ret... | false | false | false | false | false | 0 |
DAC960_CreateProcEntries(DAC960_Controller_T *Controller)
{
struct proc_dir_entry *ControllerProcEntry;
if (DAC960_ProcDirectoryEntry == NULL) {
DAC960_ProcDirectoryEntry = proc_mkdir("rd", NULL);
proc_create("status", 0, DAC960_ProcDirectoryEntry,
&dac960_proc_fops);
}
sprintf(Controller->ControllerNa... | false | true | false | false | false | 1 |
initialiseAllResourceGroups(
ResourceBackgroundQueue::Listener* listener)
{
#if OGRE_THREAD_SUPPORT
// queue a request
ResourceRequest req;
req.type = RT_INITIALISE_ALL_GROUPS;
req.listener = listener;
return addRequest(req);
#else
// synchronous
Reso... | false | false | false | false | false | 0 |
add_option(struct option_state *options,
unsigned int option_num,
void *data,
unsigned int data_len)
{
struct option_cache *oc;
struct option *option;
/* INSIST(options != NULL); */
/* INSIST(data != NULL); */
option = NULL;
if (!option_code_hash_lookup(&option, dhcp_universe.code_hash,
&o... | false | false | false | false | false | 0 |
buffer_dump(const void* buf, int start, size_t len)
{
char asc[20];
int j, k;
memset(asc, 0, sizeof(asc));
k = 0;
for (j=start; j<start+len; j++) {
int c = ((const unsigned char *)(buf))[j];
if (k == 0) {
fprintf(stdout, "%04x ", j);
}
fprintf(stdout, "%02x ", c);
asc[k] = isprint(c) ? c : '.';
k+... | true | true | false | false | false | 1 |
finish_label_address_expr (tree label, location_t loc)
{
tree result;
pedwarn (input_location, OPT_Wpedantic, "taking the address of a label is non-standard");
if (label == error_mark_node)
return error_mark_node;
label = lookup_label (label);
if (label == NULL_TREE)
result = null_pointer_node;
e... | false | false | false | false | false | 0 |
mprRemoveItem(MprList *lp, cvoid *item)
{
int index;
mprAssert(lp);
lock(lp);
index = mprLookupItem(lp, item);
if (index < 0) {
unlock(lp);
return index;
}
index = mprRemoveItemAtPos(lp, index);
mprAssert(index >= 0);
unlock(lp);
return index;
} | false | false | false | false | false | 0 |
getPathPolyByPosition(const dtPolyRef* polyPath, uint32 polyPathSize, const float* point, float* distance) const
{
if (!polyPath || !polyPathSize)
return INVALID_POLYREF;
dtPolyRef nearestPoly = INVALID_POLYREF;
float minDist2d = FLT_MAX;
float minDist3d = 0.0f;
for (uint32 i = 0; i < poly... | false | false | false | false | false | 0 |
lgdt3302_read_status(struct dvb_frontend *fe,
enum fe_status *status)
{
struct lgdt330x_state* state = fe->demodulator_priv;
u8 buf[3];
*status = 0; /* Reset status result */
/* AGC status register */
i2c_read_demod_bytes(state, AGC_STATUS, buf, 1);
dprintk("%s: AGC_STATUS = 0x%02x\n", __func__, buf[0]);
i... | false | false | false | false | false | 0 |
xmp_files_open(XmpFilePtr xf, const char *path, XmpOpenFileOptions options)
{
CHECK_PTR(xf, false);
RESET_ERROR;
SXMPFiles *txf = (SXMPFiles*)xf;
try {
return txf->OpenFile(path, XMP_FT_UNKNOWN, options);
}
catch(const XMP_Error & e) {
set_error(e);
}
return false;
} | false | false | false | false | false | 0 |
touchfood(otmp)
register struct obj *otmp;
{
if (otmp->quan > 1L) {
if(!carried(otmp))
(void) splitobj(otmp, otmp->quan - 1L);
else
otmp = splitobj(otmp, 1L);
#ifdef DEBUG
debugpline("split object,");
#endif
}
if (!otmp->oeaten) {
if(((!carried(otmp) && costly_spot(otmp->ox, otmp->oy) &&
... | false | false | false | false | false | 0 |
reset() {
VertexArray = 0;
VertexArraySize = 0;
ColorArray = 0;
NormalArray = 0;
TexCoordArray = 0;
HaveColorArray = 0;
HaveNormalArray = 0;
HaveTexCoordArray = 0;
drawType = 0;
if(GemMan::windowExists()) {
GLStack *stacks;
get(GemState::_GL_STACKS, stacks);
stacks->reset();
}
set(... | false | false | false | false | false | 0 |
acpi_dev_new_resource_entry(struct resource_win *win,
struct res_proc_context *c)
{
struct resource_entry *rentry;
rentry = resource_list_create_entry(NULL, 0);
if (!rentry) {
c->error = -ENOMEM;
return AE_NO_MEMORY;
}
*rentry->res = win->res;
rentry->offset = win->offset;
resource_list_add_tail... | false | false | false | false | false | 0 |
sun4i_codec_create_link(struct device *dev,
int *num_links)
{
struct snd_soc_dai_link *link = devm_kzalloc(dev, sizeof(*link),
GFP_KERNEL);
if (!link)
return NULL;
link->name = "cdc";
link->stream_name = "CDC PCM";
link->codec_dai_name = "Codec";
link->cpu_dai_name = dev_name(dev);
link->co... | false | false | false | false | false | 0 |
nodeAtPoint(RenderObject::NodeInfo& i, int x, int y, int tx, int ty)
{
// Check children first.
for (InlineBox* curr = lastChild(); curr; curr = curr->prevOnLine()) {
if (!curr->object()->layer() && curr->nodeAtPoint(i, x, y, tx, ty)) {
object()->setInnerNode(i);
return true;
... | false | false | false | false | false | 0 |
presence_state_cached(const char *presence_provider, char **subtype, char **message)
{
enum ast_presence_state res = AST_PRESENCE_INVALID;
struct ast_event *event;
const char *_subtype;
const char *_message;
event = ast_event_get_cached(AST_EVENT_PRESENCE_STATE,
AST_EVENT_IE_PRESENCE_PROVIDER, AST_EVENT_IE_PLTY... | false | false | false | false | false | 0 |
empty(const char *elem)
{
DIR *dirp;
struct dirent *dp;
char dir[1024];
int any;
G__file_name(dir, elem, "", G_mapset());
any = 0;
if ((dirp = opendir(dir)) != NULL) {
while (!any && (dp = readdir(dirp)) != NULL) {
if (dp->d_name[0] != '.')
any = 1;
}
closedir(dirp);
}
r... | true | true | false | false | false | 1 |
xdf_write(Stream_t *Stream, char *buf, mt_off_t where, size_t len)
{
off_t begin, end;
size_t len2;
DeclareThis(Xdf_t);
decompose(This, truncBytes32(where), len, &begin, &end, 0);
len2 = load_bounds(This, begin, end);
if(len2 < 0)
return len2;
maximize(end, (off_t)len2);
len2 -= begin;
maximize(len, (off_t... | false | true | false | false | false | 1 |
oauth_sign_url2 (const char *url, char **postargs,
OAuthMethod method,
const char *http_method, //< HTTP request method
const char *c_key, //< consumer key - posted plain text
const char *c_secret, //< consumer secret - used as 1st part of secret-key
const char *t_key, //< token key - posted plain text in ... | false | false | false | false | false | 0 |
gen(void)
{
long long times = 0;
double starttime;
yajl_val * forest;
int i;
char ebuf[256];
starttime = mygettime();
printf("Stringify speed: ");
/* first we'll parse all three documents into a trees */
forest = (yajl_val *) calloc(sizeof(yajl_val *), num_docs());
for (i=0; ... | false | false | false | false | false | 0 |
xsh_detmon_compare_dits(const cpl_frame * frame1, const cpl_frame * frame2)
{
int comparison;
cpl_propertylist *plist1;
cpl_propertylist *plist2;
double dval1, dval2;
/* Test entries */
if(frame1 == NULL || frame2 == NULL)
return -1;
... | false | false | false | false | false | 0 |
summarizematches(file_t *files)
{
int numsets = 0;
double numbytes = 0.0;
int numfiles = 0;
file_t *tmpfile;
while (files != NULL)
{
if (files->hasdupes)
{
numsets++;
tmpfile = files->duplicates;
while (tmpfile != NULL)
{
numfiles++;
numbytes += files->size;
tmpfile = tm... | false | false | false | false | false | 0 |
megasas_build_io_fusion(struct megasas_instance *instance,
struct scsi_cmnd *scp,
struct megasas_cmd_fusion *cmd)
{
u16 sge_count;
u8 cmd_type;
struct MPI2_RAID_SCSI_IO_REQUEST *io_request = cmd->io_request;
/* Zero out some fields so they don't get reused */
memset(io_request->LUN, 0x0, 8);
io_request->C... | false | false | false | false | false | 0 |
__ecereNameSpace__ecere__com__eClass_FindProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name, struct __ecereNameSpace__ecere__com__Instance * module)
{
if(_class && name)
{
for(; _class; _class = _class->base)
{
struct __ecereNameSpace__ecere__com__BTNamedLink * link;
if(_class->templateClass)
_c... | false | false | false | false | false | 0 |
lock_hrtimer_base(const struct hrtimer *timer,
unsigned long *flags)
{
struct hrtimer_clock_base *base;
for (;;) {
base = timer->base;
if (likely(base != &migration_base)) {
raw_spin_lock_irqsave(&base->cpu_base->lock, *flags);
if (likely(base == timer->base))
return base;
/* The timer has... | false | false | false | false | false | 0 |
perf_event_task_match(struct perf_event *event)
{
return event->attr.comm || event->attr.mmap ||
event->attr.mmap2 || event->attr.mmap_data ||
event->attr.task;
} | false | false | false | false | false | 0 |
ves1820_get_frontend(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct ves1820_state* state = fe->demodulator_priv;
int sync;
s8 afc = 0;
sync = ves1820_readreg(state, 0x11);
afc = ves1820_readreg(state, 0x19);
if (verbose) {
/* AFC only valid when carrier has been... | false | false | false | false | false | 0 |
parse_partition(char *arg)
{
char* endchar;
int result;
if (arg == NULL) /* no option at all */
return -1;
result = strtol(arg, &endchar, 0);
if (('\0' != *endchar) || ( result < 0))
{
fprintf(stderr, "Invalid partition '%s'\n", arg);
exit(-1);
}
return result;
} | false | false | false | false | false | 0 |
generateVSlider(Tree sig, Tree path, Tree cur, Tree min, Tree max, Tree step)
{
string varname = getFreshID("{u_s}") + "(t)";
fLateq->addUISigFormula(getUIDir(path), prepareIntervallicUI(varname, path, cur, min, max));
gDocNoticeFlagMap["slidersigs"] = true;
return generateCacheCode(sig, varname);
} | false | false | false | false | false | 0 |
bus_message_cb (GstBus * bus, GstMessage * message, GMainLoop * mainloop)
{
switch (GST_MESSAGE_TYPE (message)) {
case GST_MESSAGE_ERROR:
g_printerr ("ERROR\n");
seenerrors = TRUE;
g_main_loop_quit (mainloop);
break;
case GST_MESSAGE_EOS:
if (repeat > 0) {
g_printerr ("Lo... | false | false | false | false | false | 0 |
obt_xml_node_string_unstripped(xmlNodePtr node)
{
xmlChar *c = xmlNodeGetContent(node);
gchar *s;
s = g_strdup(c ? (gchar*)c : "");
xmlFree(c);
return s;
} | false | false | false | false | false | 0 |
getOFDateTimeFromString(const OFString &dicomDateTime,
OFDateTime &dateTimeValue)
{
OFCondition l_error = EC_IllegalParameter;
/* clear result variable */
dateTimeValue.clear();
/* minimal check for valid format: YYYYMMDD */
if (dicomDateTime.length()... | false | false | false | false | false | 0 |
ExecUpdate(TupleTableSlot *slot,
ItemPointer tupleid,
TupleTableSlot *planSlot,
DestReceiver *dest,
EState *estate)
{
HeapTuple tuple;
ResultRelInfo *resultRelInfo;
Relation resultRelationDesc;
HTSU_Result result;
ItemPointerData update_ctid;
TransactionId update_xmax;
/*
* abort the opera... | false | false | false | false | false | 0 |
overwrite_const_check (const char *s, parser *p)
{
if (object_is_const(s)) {
p->err = overwrite_err(s);
return p->err;
} else {
return 0;
}
} | false | false | false | false | false | 0 |
acpi_pci_irq_check_entry(acpi_handle handle, struct pci_dev *dev,
int pin, struct acpi_pci_routing_table *prt,
struct acpi_prt_entry **entry_ptr)
{
int segment = pci_domain_nr(dev->bus);
int bus = dev->bus->number;
int device = pci_ari_enabled(dev->bus) ? 0 : PCI_SLOT(dev->devfn);
struct acpi_prt_entry ... | false | false | false | false | false | 0 |
rb_reg_check(VALUE re)
{
if (!RREGEXP(re)->ptr || !RREGEXP_SRC(re) || !RREGEXP_SRC_PTR(re)) {
rb_raise(rb_eTypeError, "uninitialized Regexp");
}
} | false | false | false | false | false | 0 |
kui_finalize_state(void *data, void *user_data)
{
struct kui_map_set *map_set = (struct kui_map_set *) data;
if (kui_tree_finalize_state(map_set->ktree) == -1)
return -1;
return 1;
} | false | false | false | false | false | 0 |
_create_album_cb (RestProxyCall *call,
const GError *error,
GObject *weak_object,
gpointer user_data)
{
DBusGMethodInvocation *context = (DBusGMethodInvocation *) user_data;
RestXmlNode *root = NULL;
RestXmlNode *album;
gchar *id;
GError *err = NULL;
if (error != NULL)
err = g_... | false | false | false | false | false | 0 |
raw_bytes_to_clean(const char *buffer, int buflen) {
static Stream *s = 0;
int i;
if(!s)
s = new_stream(100);
for (i = 0; i < buflen; i++) {
unsigned char c = buffer[i];
if (isgraph(c) || c == ' ')
stream_add_char(s, c);
/* else drop it on the floor */
}
return reset_stream(s);
} | false | false | false | false | false | 0 |
vAlignItems()
{
QList<QLanguageItem*> selectedItems = selectedLanguageItems();
//Sets the scale of all selected items to the size of the first selected
float y = mFirstSelectedItem->pos().y();
for ( int i = 0 ; i < selectedItems.size() ; i++ )
{
float x = selectedItems[i]->pos().x();
selectedItems[i]->setPos... | false | false | false | false | false | 0 |
rtw_xmit_entry(struct sk_buff *pkt, struct net_device *pnetdev)
{
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(pnetdev);
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
s32 res = 0;
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("+xmit_enry\n... | false | false | false | false | false | 0 |
sig_words() const
{
const word* x = data();
u32bit top_set = size();
while(top_set >= 4)
{
word sum = x[top_set-1] | x[top_set-2] | x[top_set-3] | x[top_set-4];
if(sum) break;
else top_set -= 4;
}
while(top_set && (x[top_set-1] == 0))
top_set--;
return top_set;
... | false | false | false | false | false | 0 |
xfs_btree_shift_keys(
struct xfs_btree_cur *cur,
union xfs_btree_key *key,
int dir,
int numkeys)
{
char *dst_key;
ASSERT(numkeys >= 0);
ASSERT(dir == 1 || dir == -1);
dst_key = (char *)key + (dir * cur->bc_ops->key_len);
memmove(dst_key, key, numkeys * cur->bc_ops->key_len);
} | false | false | false | false | false | 0 |
blk_queue_bounce_limit(struct request_queue *q, u64 max_addr)
{
unsigned long b_pfn = max_addr >> PAGE_SHIFT;
int dma = 0;
q->bounce_gfp = GFP_NOIO;
#if BITS_PER_LONG == 64
/*
* Assume anything <= 4GB can be handled by IOMMU. Actually
* some IOMMUs can handle everything, but I don't know of a
* way to test ... | false | false | false | false | false | 0 |
lcs__CREATE_(char *class)
{
struct CTX *ctx = malloc(sizeof *ctx);
ctx->thresh.arr = malloc(100 * sizeof *ctx->thresh.arr);
ctx->thresh.alloc = 100;
ctx->thresh.max = -1;
ctx->links.arr = malloc(100 * sizeof *ctx->links.arr);
ctx->links.alloc = 100;
ctx->links.m... | false | false | false | false | false | 0 |
handler2(const void *data, void *buffer, unsigned int nbyte)
{
char *str = (char *) buffer;
cout << "buffer2: " << str << ", size: " << nbyte << endl;
for (int i = 0; i < 30 && spin; ++i)
{
cout << "call2: " << g_client->Hello(str) << endl;
}
} | false | false | false | false | false | 0 |
dir_set_value (Dir* d, const gchar* relative_key,
const GConfValue* value, GError** err)
{
Entry* e;
if (d->doc == NULL)
dir_load_doc(d, err);
if (d->doc == NULL)
{
g_return_if_fail( (err == NULL) || (*err != NULL) );
return;
}
e = g_hash_table_lookup(d->entry_cache... | false | false | false | false | false | 0 |
send_line(curl_socket_t sock, char *s)
{
ssize_t len, sent = 0;
len = strlen(s);
s[len++] = '\n';
while (len > 0) {
struct timeval timeout = {0, 0};
ssize_t n;
fd_set wd;
FD_ZERO(&wd);
FD_SET(sock, &wd);
if (select(sock + 1, NULL, &wd, NULL, &timeout) < 1)
return false;
n = send(sock, s + sent,... | false | false | false | false | false | 0 |
is_like_expr(const char *sql, char *nextc)
{
if ((sql[0] == 'l' || sql[0] == 'L') &&
(sql[1] == 'i' || sql[1] == 'I') &&
(sql[2] == 'k' || sql[2] == 'K') &&
(sql[3] == 'e' || sql[3] == 'E'))
{
int i = 4;
while (IS_SPACE(sql[i]))
++i;
if (sql[i] == '\'') {
*nextc = '\'';
... | false | false | false | false | false | 0 |
copyElement(const DcmTagKey& tag, DcmItem& src, DcmItem& dest)
{
DcmElement *delem;
OFCondition cond;
// get (deep) copy of element
cond = src.findAndGetElement(tag, delem, OFFalse /*searchIntoSub*/, OFTrue /*createCopy*/);
if (cond.good())
{
// and insert into destination item
cond = dest.insert(de... | false | false | false | false | false | 0 |
gst_iir_equalizer_3bands_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec)
{
GstChildProxy *equ = GST_CHILD_PROXY (object);
switch (prop_id) {
case PROP_BAND0:
gst_child_proxy_get_property (equ, "band0::gain", value);
break;
case PROP_BAND1:
gst_child_... | false | false | false | false | false | 0 |
cddap_readtoc (cdrom_drive_t *d)
{
int i;
track_t i_track;
/* Save TOC Entries */
d->tracks = cdio_get_num_tracks(d->p_cdio) ;
if (CDIO_INVALID_TRACK == d->tracks) return 0;
i_track = cdio_get_first_track_num(d->p_cdio);
for ( i=0; i < d->tracks; i++) {
d->disc_toc[i].bTrack = i_track;
d->... | false | false | false | false | false | 0 |
nautilus_search_directory_set_query (NautilusSearchDirectory *search,
NautilusQuery *query)
{
NautilusFile *file;
if (search->details->query != query) {
search->details->modified = TRUE;
g_object_ref (query);
g_clear_object (&search->details->query);
search->details->query = query;
g_object_noti... | false | false | false | false | false | 0 |
routerReadDiversity( struct sProfile *psProfile ) {
struct sRouter *psRouter = getRouter( psProfile );
/* if we have a read diversity function, call it */
if ( psRouter != NULL && psRouter -> ReadDiversity != NULL ) {
return psRouter -> ReadDiversity( psProfile );
}
return 0;
} | false | false | false | false | false | 0 |
DumpAllTracks ( MIDIMultiTrack *mlt )
{
for ( int i = 0; i < mlt->GetNumTracks(); ++i )
{
if ( mlt->GetTrack ( i )->GetNumEvents() > 0 )
{
fprintf ( stdout, "DUMP OF TRACK #%2d:\n", i );
DumpMIDITrack ( mlt->GetTrack ( i ) );
fprintf ( stdout, "\n" );
... | false | false | false | false | false | 0 |
reset_item(int handle, void * data)
{
if(handle >= count || handle < 0) return 1;
items[handle] = data;
return 0;
} | false | false | false | false | false | 0 |
generate_report_log (int uid,
const char *seat,
const char *session_type)
{
GList *l;
for (l = all_events; l != NULL; l = l->next) {
CkLogEvent *event;
GString *str;
event = l->data;
st... | false | false | false | false | false | 0 |
ikrt_bnbnmult(ikptr x, ikptr y, ikpcb* pcb){
long int f1 = (long int)ref(x, -vector_tag);
long int f2 = (long int)ref(y, -vector_tag);
long int n1 = bnfst_limb_count(f1);
long int n2 = bnfst_limb_count(f2);
long int nr = n1 + n2;
pcb->root0 = &x;
pcb->root1 = &y;
ikptr bn = ik_safe_alloc(pcb, align(disp... | false | false | false | false | false | 0 |
Rijndael_padDecrypt(const uint8_t *input, int inputOctets, uint8_t *outBuffer)
{
int i, numBlocks, padLen;
uint8_t block[16];
uint32_t iv[4];
if(m_state != Valid)return RIJNDAEL_NOT_INITIALIZED;
if(m_direction != Decrypt)return RIJNDAEL_BAD_DIRECTION;
if(input == 0 || inputOctets <= 0)return 0;
if((inputOctet... | false | false | false | false | false | 0 |
on_item_created (GooCanvas *canvas,
GooCanvasItem *item,
GooCanvasItemModel *model,
gpointer data)
{
if (!goo_canvas_item_model_get_parent (model)) {
/* root item / canvas */
g_signal_connect (item, "motion_notify_event", (GtkSignalFunc) on_motion_... | false | false | false | false | false | 0 |
find_session (const ACE::HTBP::Session_Id_t &sid, ACE::HTBP::Session *&out)
{
ACE::HTBP::Session::Map_Entry *e = 0;
if (session_map_.find (sid,e) == -1)
{
out = 0;
return -1;
}
out = e->int_id_;
return 0;
} | false | false | false | false | false | 0 |
remove_msginfo_from_cache(FolderItem *item, MsgInfo *msginfo)
{
MsgInfoUpdate msginfo_update;
if (!item->cache)
folder_item_read_cache(item);
if (MSG_IS_NEW(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags))
msginfo->folder->new_msgs--;
if (MSG_IS_UNREAD(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo... | false | false | false | false | false | 0 |
file_exit(PyObject *f, PyObject *args)
{
PyObject *ret = PyObject_CallMethod(f, "close", NULL);
if (!ret)
/* If error occurred, pass through */
return NULL;
Py_DECREF(ret);
/* We cannot return the result of close since a true
* value will be interpreted as "yes, swallow the
* e... | false | false | false | false | false | 0 |
ms_event(struct hid_device *hdev, struct hid_field *field,
struct hid_usage *usage, __s32 value)
{
unsigned long quirks = (unsigned long)hid_get_drvdata(hdev);
struct input_dev *input;
if (!(hdev->claimed & HID_CLAIMED_INPUT) || !field->hidinput ||
!usage->type)
return 0;
input = field->hidinput->input;
... | false | false | false | false | false | 0 |
ekg_config_get(ekg_configObj * self, PyObject * key)
{
char *name = PyString_AsString(key);
variable_t *v;
debug("[python] Getting value for '%s' config option\n", name);
for (v = variables; v; v = v->next) {
if (!strcmp(v->name, name)) {
if (v->type == VAR_BOOL || v->type == VAR_INT
|| v->ty... | false | false | false | false | false | 0 |
butasan_get_bg0_tile_info(int tile_index)
{
int hi, lo;
int attrib;
attrib = (tile_index & 0x00f) | ((tile_index & 0x1e0) >> 1);
attrib |= ((tile_index & 0x200) >> 1) | ((tile_index & 0x010) << 5);
attrib ^= 0x0f0;
lo = butasan_bg0ram[ attrib << 1 ];
hi = butasan_bg0ram[ (attrib << 1) + 1 ];
SE... | false | false | false | false | false | 0 |
processLine(imap &imapAccount,
std::vector<const char *> &words)
{
if (words.size() >= 3 && strcmp(words[0], "*") == 0 &&
strcasecmp(words[1], "SNAPSHOTEXISTS") == 0)
{
restoringSnapshot=true;
presnapshotExists=exists=newSmapFolder->index.size();
return true;
}
if (words.size() >= 3 && strcmp(words... | false | false | false | false | false | 0 |
handle_reset(struct httpsqs* h, struct evhttp_request *req, struct sqs_queue_status *qs, struct evkeyvalq *args) {
if (httpsqs_reset(h, qs)) {
qs->total_info++;
struct evbuffer *buf = evbuffer_new();
evbuffer_add_printf(buf, "%s", "{'success':true}");
evhttp_send_reply(req, HTTP_OK, "OK", buf);
evbuffer... | false | false | false | false | false | 0 |
constant_folding_mad(struct rc_instruction * inst)
{
rc_swizzle swz = 0;
unsigned int negate= 0;
if (is_src_uniform_constant(inst->U.I.SrcReg[2], &swz, &negate)) {
if (swz == RC_SWIZZLE_ZERO) {
inst->U.I.Opcode = RC_OPCODE_MUL;
return;
}
}
if (is_src_uniform_constant(inst->U.I.SrcReg[1], &swz, &negate)... | false | false | false | false | false | 0 |
conn_closed_cb (GdaVirtualConnection *vcnc)
{
if (vcnc->priv->v_provider_data) {
if (vcnc->priv->v_provider_data_destroy_func)
vcnc->priv->v_provider_data_destroy_func (vcnc->priv->v_provider_data);
else
g_warning ("Provider did not clean ... | false | false | false | false | false | 0 |
GameAnalysed(listOLD * plGame)
{
listOLD *pl;
matchstate msAnalyse;
#if !defined(G_DISABLE_ASSERT)
moverecord *pmrx = (moverecord *) plGame->plNext->p;
g_assert(pmrx->mt == MOVE_GAMEINFO);
#endif
for (pl = plGame->plNext; pl != plGame; pl = pl->plNext) {
if (!MoveAnalysed(pl->p, &msAnalys... | false | false | false | false | false | 0 |
make_expr1(enum expr_type type, expr_t *expr)
{
expr_t *e;
e = xmalloc(sizeof(expr_t));
e->type = type;
e->ref = expr;
e->u.lval = 0;
e->is_const = FALSE;
/* check for compile-time optimization */
if (expr->is_const)
{
e->is_const = TRUE;
switch (type)
{
... | false | false | false | false | false | 0 |
sendMessage(const std::string& message, const std::string& arg)
{
std::string line;
line.reserve(message.length() + arg.length() + 3);
line.append(message);
if (!arg.empty())
{
line.append(" ");
line.append(arg);
}
line.append("\r\n");
sendString(line);
} | false | false | false | false | false | 0 |
i18nTypeName(Type t)
{
if (!_i18nTypeName) {
_i18nTypeName = new QString [MaxType+1];
for(int i=0;i<=MaxType;i++)
_i18nTypeName[i] = QObject::tr(typeName((Type)i).toUtf8());
}
if (t<0 || t> MaxType) t = MaxType;
return _i18nTypeName[t];
} | false | false | false | false | false | 0 |
mdc_inode_xatt_unset (xlator_t *this, inode_t *inode, char *name)
{
int ret = -1;
struct md_cache *mdc = NULL;
mdc = mdc_inode_prep (this, inode);
if (!mdc)
goto out;
if (!name)
goto out;
LOCK (&mdc->lock);
{
dict_... | false | false | false | false | false | 0 |
walread(Wal *w, job list, int min, int max)
{
File *f;
int i, fd;
int err = 0;
for (i = min; i < w->next; i++) {
f = new(File);
if (!f) {
twarnx("OOM");
exit(1);
}
if (!fileinit(f, w, i)) {
free(f);
twarnx("OOM");
... | false | false | false | false | true | 1 |
_g_file_get_free_space (GFile *file)
{
GFileInfo *info;
guint64 freespace = 0;
GError *error = NULL;
info = g_file_query_filesystem_info (file, G_FILE_ATTRIBUTE_FILESYSTEM_FREE, NULL, &error);
if (info != NULL) {
freespace = g_file_info_get_attribute_uint64 (info, G_FILE_ATTRIBUTE_FILESYSTEM_FREE);
g_ob... | false | false | false | false | false | 0 |
iface_postdown(interface_defn * iface)
{
if (!iface->method->down(iface, doit))
return 0;
set_environ(iface, "stop", "post-down");
if (!execute_scripts(iface, doit, "post-down"))
return 0;
if (!execute_options(iface, doit, "post-down"))
return 0;
return 1;
} | false | false | false | false | false | 0 |
get_cached_rowtype(Oid type_id, int32 typmod,
TupleDesc *cache_field, ExprContext *econtext)
{
TupleDesc tupDesc = *cache_field;
/* Do lookup if no cached value or if requested type changed */
if (tupDesc == NULL ||
type_id != tupDesc->tdtypeid ||
typmod != tupDesc->tdtypmod)
{
tupDesc = lookup_rowtyp... | false | false | false | false | false | 0 |
ahd_pci_read_config(ahd_dev_softc_t pci, int reg, int width)
{
switch (width) {
case 1:
{
uint8_t retval;
pci_read_config_byte(pci, reg, &retval);
return (retval);
}
case 2:
{
uint16_t retval;
pci_read_config_word(pci, reg, &retval);
return (retval);
}
case 4:
{
uint32_t retval;
pci_read_confi... | false | false | false | false | false | 0 |
USB_OTG_ActiveRemoteWakeup(USB_OTG_CORE_HANDLE *pdev)
{
USB_OTG_DCTL_TypeDef dctl;
USB_OTG_DSTS_TypeDef dsts;
USB_OTG_PCGCCTL_TypeDef power;
if (pdev->dev.DevRemoteWakeup)
{
dsts.d32 = USB_OTG_READ_REG32(&pdev->regs.DREGS->DSTS);
if(dsts.b.suspsts == 1)
{
if(pde... | 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.