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 |
|---|---|---|---|---|---|---|
execute(int& image, int& drawableId, Location& file) {
if (! _enabled) {
return true;
}
GimpCall call(_gimpFnName);
call.param(GIMP_RUN_NONINTERACTIVE);
call.imageParam(image);
call.drawableParam(drawableId);
addParams(call);
bool result;
call.execute(result);
return result;
} | false | false | false | false | false | 0 |
trie_add(trie_t *s, const char *u, size_t len)
{
size_t i;
int index;
trie_node_t *t;
s->entries++;
/* Loop over the length of the string to add and traverse the trie... */
for (t = s->root, i = 0; i < len; i++)
{
/* The character in u we are processing... */
index = (unsi... | false | false | false | false | false | 0 |
should_remove_suid(struct dentry *dentry)
{
struct inode *inode = d_inode(dentry);
umode_t mode = inode->i_mode;
int kill = 0;
/* suid always must be killed */
if (unlikely(mode & S_ISUID))
kill = ATTR_KILL_SUID;
/*
* sgid without any exec bits is just a mandatory locking mark; leave
* it alone. If some ... | false | false | false | false | false | 0 |
setCurrentHole(int hole)
{
if (!holeAction || holeAction->items().count() < hole)
return;
// Golf is 1-based, KListAction is 0-based
holeAction->setCurrentItem(hole - 1);
} | false | false | false | false | false | 0 |
tsys01_i2c_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
struct tsys01_dev *dev_data;
struct iio_dev *indio_dev;
if (!i2c_check_functionality(client->adapter,
I2C_FUNC_SMBUS_WORD_DATA |
I2C_FUNC_SMBUS_WRITE_BYTE |
I2C_FUNC_SMBUS_READ_I2C_BLOCK)) {
dev_err(&cl... | false | false | false | false | false | 0 |
read_url_async (const gchar *url,
GCancellable *cancellable,
AsyncReadCbFunc callback,
gpointer user_data)
{
AsyncReadCb *arc;
GrlNetWc *wc;
wc = get_wc ();
if (!wc)
return;
arc = g_slice_new0 (AsyncReadCb);
arc->url = g_strdup (url);
arc->callback = c... | false | false | false | false | false | 0 |
FinishLoadingWorkspace(cbProject *activeProject, const wxString &workspaceTitle)
{
RebuildTree();
if (activeProject)
m_pTree->Expand(activeProject->GetProjectNode());
m_pTree->Expand(m_TreeRoot); // make sure the root node is open
m_pTree->SetItemText(m_TreeRoot, workspaceTitle);
UnfreezeTr... | false | false | false | false | false | 0 |
sprint_realloc_opaque(u_char ** buf, size_t * buf_len,
size_t * out_len, int allow_realloc,
const netsnmp_variable_list * var,
const struct enum_list *enums,
const char *hint, const char *units)
{
if ((var->type != ASN_OPAQUE
#i... | false | false | false | false | false | 0 |
jp2_jp_putdata(jp2_box_t *box, jas_stream_t *out)
{
jp2_jp_t *jp = &box->data.jp;
if (jp2_putuint32(out, jp->magic)) {
return -1;
}
return 0;
} | false | false | false | false | false | 0 |
Open(const char *pszFname, const char *pszAccess,
GBool bTestOpenNoError /*= FALSE*/ )
{
char nStatus = 0;
if (m_poIndexTable)
{
CPLError(CE_Failure, CPLE_AssertionFailed,
"Open() failed: object already contains an open file");
return -1;
}
... | false | false | false | false | false | 0 |
gst_queue2_read_data_at_offset (GstQueue2 * queue, guint64 offset, guint length,
guint8 * dst, gint64 * read_return)
{
guint8 *ring_buffer;
size_t res;
ring_buffer = queue->ring_buffer;
if (QUEUE_IS_USING_TEMP_FILE (queue) && FSEEK_FILE (queue->temp_file, offset))
goto seek_failed;
/* this should n... | false | true | false | false | false | 1 |
proxy_connect_helper(const host_addr_t *addr, size_t n, void *udata)
{
bool *in_progress = udata;
g_assert(addr);
g_assert(in_progress);
*in_progress = FALSE;
if (n > 0) {
/* Just pick the first address */
gnet_prop_set_ip_val(PROP_PROXY_ADDR, addr[0]);
g_message("resolved proxy name \"%s\" to %s",
GNET... | false | false | false | false | false | 0 |
url_open_dyn_buf_internal(ByteIOContext **s, int max_packet_size)
{
DynBuffer *d;
int ret;
unsigned io_buffer_size = max_packet_size ? max_packet_size : 1024;
if(sizeof(DynBuffer) + io_buffer_size < io_buffer_size)
return -1;
d = av_mallocz(sizeof(DynBuffer) + io_buffer_size);
if (!d)
... | false | false | false | false | false | 0 |
encryptQueue(void* parameters)
{
pdebug("encryptQueue()\n");
bool first_chunk = true;
cryptParams* params = parameters;
chunk* encrypt_chunk = NULL;
uint64_t* chain = NULL;
chain = calloc(params->tf_key->stateSize/8, sizeof(uint64_t));
if(chain == NULL) //check that calloc succeeded
... | false | false | false | false | false | 0 |
isInFront(WorldObject const* target, float distance, float arc) const
{
return IsWithinDist(target, distance) && HasInArc(arc, target);
} | false | false | false | false | false | 0 |
G3d_writeTileDouble(G3D_Map * map, int tileIndex, const void *tile)
{
int status;
if ((status = G3d_writeTile(map, tileIndex, tile, DCELL_TYPE)))
return status;
G3d_error("G3d_writeTileDouble: error in G3d_writeTile");
return 0;
} | false | false | false | false | false | 0 |
TryToIdentify()
{
TokenType t;
TokenValue v;
if (reserved_words.Identify(buffer_low, t, v))
{
MakeToken(t, v);
return true;
}
return false;
} | false | false | false | false | false | 0 |
oldmda_read_params(MDAXMLParams *par, OldMDAFile *mdafile)
{
MDAAxis axis;
mdafile->zres = par->res;
mdafile->xdata = par->xdata;
axis = g_array_index(par->axes, MDAAxis, 0);
if (axis.unitname)
mdafile->siunitz = gwy_si_unit_new(axis.unitname);
else
mdafile->siunitz = gwy_si_unit... | false | false | false | false | false | 0 |
next_runtime_abi_02_string_decl (tree type, const char *name, string_section where)
{
tree var = start_var_decl (type, name);
switch (where)
{
case class_names:
OBJCMETA (var, objc_meta, meta_class_name);
break;
case meth_var_names:
OBJCMETA (var, objc_meta, meta_meth_name);
break;
case m... | false | false | false | false | false | 0 |
add_alt_server(const char *saddr, int default_port, turn_server_addrs_list_t *list)
{
if(saddr && list) {
ioa_addr addr;
turn_mutex_lock(&(list->m));
if(make_ioa_addr_from_full_string((const u08bits*)saddr, default_port, &addr)!=0) {
TURN_LOG_FUNC(TURN_LOG_LEVEL_ERROR, "Wrong IP address format: %s\n",saddr)... | false | false | false | false | false | 0 |
__db_zero_extend(env, fhp, pgno, last_pgno, pgsize)
ENV *env;
DB_FH *fhp;
db_pgno_t pgno, last_pgno;
u_int32_t pgsize;
{
int ret;
size_t nwrote;
u_int8_t *buf;
if ((ret = __os_calloc(env, 1, pgsize, &buf)) != 0)
return (ret);
memset(buf, 0, pgsize);
for (; pgno <= last_pgno; pgno++)
if ((ret = __os_io(en... | false | false | false | false | false | 0 |
brd_lookup_page(struct brd_device *brd, sector_t sector)
{
pgoff_t idx;
struct page *page;
/*
* The page lifetime is protected by the fact that we have opened the
* device node -- brd pages will never be deleted under us, so we
* don't need any further locking or refcounting.
*
* This is strictly true for... | false | false | false | false | false | 0 |
read_cb (GObject *source_object, GAsyncResult *res, gpointer user_data)
{
GVfsAfpVolume *volume = G_VFS_AFP_VOLUME (source_object);
GVfsJobRead *job = G_VFS_JOB_READ (user_data);
AfpHandle *afp_handle = (AfpHandle *)job->handle;
GError *err = NULL;
gsize bytes_read;
if (!g_vfs_afp_volume_read_from_fork_fi... | false | false | false | false | false | 0 |
tc358743_g_edid(struct v4l2_subdev *sd,
struct v4l2_subdev_edid *edid)
{
struct tc358743_state *state = to_state(sd);
if (edid->pad != 0)
return -EINVAL;
if (edid->start_block == 0 && edid->blocks == 0) {
edid->blocks = state->edid_blocks_written;
return 0;
}
if (state->edid_blocks_written == 0)
retur... | false | false | false | false | false | 0 |
ExecARDeleteTriggers(EState *estate, ResultRelInfo *relinfo,
ItemPointer tupleid)
{
TriggerDesc *trigdesc = relinfo->ri_TrigDesc;
if (trigdesc && trigdesc->trig_delete_after_row)
{
HeapTuple trigtuple = GetTupleForTrigger(estate, NULL, relinfo,
tupleid, NULL);
AfterTriggerSaveEvent(estate,... | false | false | false | false | false | 0 |
setAnchorItem(FXint r,FXint c){
anchor.row=FXCLAMP(-1,r,nrows-1);
anchor.col=FXCLAMP(-1,c,ncols-1);
} | false | false | false | false | false | 0 |
_getRequiredSize(struct SFNTContainer *ctr)
{
unsigned ret = 12; /* for offset table */
ret += _getTableDirectorySize(ctr);
for (unsigned i = 0; i < ctr->numTables; ++i)
{
struct SFNTTable *tbl = &ctr->tables[i];
ret += ((tbl->bufSize + 3) / 4) * 4; /* pads out to 4-byte boundary */
}
return ret;
} | false | false | false | false | false | 0 |
gimple_build_debug_bind_stat (tree var, tree value, gimple stmt MEM_STAT_DECL)
{
gimple p = gimple_build_with_ops_stat (GIMPLE_DEBUG,
(unsigned)GIMPLE_DEBUG_BIND, 2
PASS_MEM_STAT);
gimple_debug_bind_set_var (p, var);
gimple_debug_bind_set_value (p, value);
if (stmt)
gimple_set_location (p, gimp... | false | false | false | false | false | 0 |
picolcd_init_framebuffer(struct picolcd_data *data)
{
struct device *dev = &data->hdev->dev;
struct fb_info *info = NULL;
struct picolcd_fb_data *fbdata = NULL;
int i, error = -ENOMEM;
u32 *palette;
/* The extra memory is:
* - 256*u32 for pseudo_palette
* - struct fb_deferred_io
*/
info = framebuffer_allo... | false | false | false | false | false | 0 |
_print_events(BLURAY *bd)
{
BD_EVENT ev;
do {
bd_read_ext(bd, NULL, 0, &ev);
_print_event(&ev);
} while (ev.event != BD_EVENT_NONE && ev.event != BD_EVENT_ERROR);
} | false | false | false | false | false | 0 |
SSL_pthreads_locking_callback(int mode, int type, char *file, int line)
{
if( my.debug == 4 ){
fprintf(
stderr,"thread=%4d mode=%s lock=%s %s:%d\n", (int)CRYPTO_thread_id(),
(mode&CRYPTO_LOCK)?"l":"u", (type&CRYPTO_READ)?"r":"w",file,line
);
}
if(mode & CRYPTO_LOCK){
pthread_mute... | false | false | false | false | false | 0 |
compress2_cmd(void){
Blob f1, f2;
if( g.argc!=5 ) usage("INPUTFILE1 INPUTFILE2 OUTPUTFILE");
blob_read_from_file(&f1, g.argv[2]);
blob_read_from_file(&f2, g.argv[3]);
blob_compress2(&f1, &f2, &f1);
blob_write_to_file(&f1, g.argv[4]);
} | false | false | false | false | false | 0 |
dw210x_op_rw(struct usb_device *dev, u8 request, u16 value,
u16 index, u8 * data, u16 len, int flags)
{
int ret;
u8 *u8buf;
unsigned int pipe = (flags == DW210X_READ_MSG) ?
usb_rcvctrlpipe(dev, 0) : usb_sndctrlpipe(dev, 0);
u8 request_type = (flags == DW210X_READ_MSG) ? USB_DIR_IN : USB_DIR_OUT;
u8buf = km... | false | true | false | false | false | 1 |
lookupkeywords (char *name, char **keyword, char **value, int nkey)
#else
static char *lookupkeywords(name, keyword, value, nkey)
char *name;
char **keyword;
char **value;
int nkey;
#endif
{
int i;
for(i=0; i<nkey; i++){
if( !strcmp(name, keyword[i]) )
return(value[i]);
}
return(NU... | false | false | false | false | false | 0 |
release_input_file (const void *handle)
{
ASSERT (called_plugin);
handle = handle;
return LDPS_ERR;
} | false | false | false | false | false | 0 |
fixmatch(const char *pattern, char *line, int ignore_case, regmatch_t *match)
{
char *hit;
if (ignore_case)
hit = strcasestr(line, pattern);
else
hit = strstr(line, pattern);
if (!hit) {
match->rm_so = match->rm_eo = -1;
return REG_NOMATCH;
}
else {
match->rm_so = hit - line;
match->rm_eo = match->rm... | false | false | false | false | false | 0 |
writeNlist(MachSymbolData &MSD,
const MCAsmLayout &Layout) {
const MCSymbol *Symbol = MSD.Symbol;
const MCSymbol &Data = *Symbol;
const MCSymbol *AliasedSymbol = &findAliasedSymbol(*Symbol);
uint8_t SectionIndex = MSD.SectionIndex;
uint8_t Type = 0;
uint64_t Address = 0;
... | false | false | false | false | false | 0 |
atoo( char * string )
/*!
Return Value: returns the unsigned long value
Parameters:
Type Name IO Description
------------ ----------- -- ----------- */
#ifdef DOC
char * string ;/* I String to be converted. */
#endif
/*!
Description:
`atoo` converts a ... | false | false | false | false | false | 0 |
invalidate_loops_containing_label (label)
rtx label;
{
struct loop *loop;
for (loop = uid_loop[INSN_UID (label)]; loop; loop = loop->outer)
loop->invalid = 1;
} | false | false | false | false | false | 0 |
usb_debugfs_init(void)
{
usb_debug_root = debugfs_create_dir("usb", NULL);
if (!usb_debug_root)
return -ENOENT;
usb_debug_devices = debugfs_create_file("devices", 0444,
usb_debug_root, NULL,
&usbfs_devices_fops);
if (!usb_debug_devices) {
debugfs_remove(usb_debug_root);
usb_debug_root = NULL;
r... | false | false | false | false | false | 0 |
get_object1(struct alisp_instance *instance, const char *id)
{
struct alisp_object_pair *p;
struct list_head *pos;
list_for_each(pos, &instance->setobjs_list[get_string_hash(id)]) {
p = list_entry(pos, struct alisp_object_pair, list);
if (!strcmp(p->name, id))
return p->value;
}
return &alsa_lisp_nil;
} | false | false | false | false | false | 0 |
SCSubBy(SplineChar *sc) {
int i,j,k,tot;
char **deps = NULL;
SplineChar **depsc;
char ubuf[200];
SplineFont *sf, *_sf;
PST *pst;
char *buts[3];
buts[0] = _("Show");
buts[1] = _("_Cancel");
buts[2] = NULL;
if ( sc==NULL )
return;
_sf = sc->parent;
if ( _sf->cidmaste... | false | false | false | false | false | 0 |
tcs_wrap_RegisterKey(struct tcsd_thread_data *data)
{
TCS_CONTEXT_HANDLE hContext;
TSS_UUID WrappingKeyUUID;
TSS_UUID KeyUUID;
UINT32 cKeySize;
BYTE *rgbKey;
UINT32 cVendorData;
BYTE *gbVendorData;
TSS_RESULT result;
if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm))
return TCSERR(TSS_E_INT... | false | false | false | false | false | 0 |
PMI_Get_clique_size( int *size )
{
char *env;
if (pmi_debug)
fprintf(stderr, "In: PMI_Get_clique_size\n");
if (size == NULL)
return PMI_ERR_INVALID_ARG;
if (pmi_init == 0)
return PMI_FAIL;
/* Simple operation without srun */
if ((pmi_jobid == 0) && (pmi_stepid == 0)) {
*size = 1;
return PMI_SUCCESS;
... | false | false | false | false | true | 1 |
fill_classic_mro(PyObject *mro, PyObject *cls)
{
PyObject *bases, *base;
Py_ssize_t i, n;
assert(PyList_Check(mro));
assert(PyClass_Check(cls));
i = PySequence_Contains(mro, cls);
if (i < 0)
return -1;
if (!i) {
if (PyList_Append(mro, cls) < 0)
return -1;
}
... | false | false | false | false | true | 1 |
paintEvent(QPaintEvent *)
{
generateShade();
QPainter p(this);
p.drawImage(0, 0, m_shade);
p.setPen(QColor(146, 146, 146));
p.drawRect(0, 0, width() - 1, height() - 1);
} | false | false | false | false | false | 0 |
grokclassfn (tree ctype, tree function, enum overload_flags flags, tree quals)
{
tree fn_name = DECL_NAME (function);
int this_quals = TYPE_UNQUALIFIED;
/* Even within an `extern "C"' block, members get C++ linkage. See
[dcl.link] for details. */
SET_DECL_LANGUAGE (function, lang_cplusplus);
if (fn_n... | false | false | false | false | false | 0 |
eprn_fetch_scan_line(eprn_Device *dev, eprn_OctetString *line)
{
int rc;
const eprn_Octet *str;
rc = gdev_prn_copy_scan_lines((gx_device_printer *)dev, dev->eprn.next_y,
line->str, dev->eprn.octets_per_line);
/* gdev_prn_copy_scan_lines() returns the number of scan lines it fetched
or a negative val... | false | false | false | false | false | 0 |
ComputeLinkInterface(const char* config)
{
// Construct the property name suffix for this configuration.
std::string suffix = "_";
if(config && *config)
{
suffix += cmSystemTools::UpperCase(config);
}
else
{
suffix += "NOCONFIG";
}
// Lookup the link interface libraries.
const char*... | false | false | false | false | false | 0 |
m_cdfg_emit_expr (pIIR_TypeConversion tc, string &str, RegionStack &rstack, id_type t)
{
if (valid_folded_value(tc)) {
// Print folded value if available
cdfg_emit_folded_value(folded_value(tc), str, rstack, tc->type_mark);
return true;
}
pIIR_Type target_base_type = get_base_type(tc->type_mark);
p... | false | false | false | false | false | 0 |
clean_rt(int force) {
int i;
for (i = 0; i < ann_len; i++) {
if (difftime(time(NULL), ann_ips[i].l_update) > 10 || force) {
/* network not more reachable */
DEFandNULL(struct rtentry, rtentry)
((struct sockaddr_in *)&rtentry.rt_dst)->sin_family = \
((struct sockaddr_in *)&rtentry.rt_gateway)->sin_family... | false | false | false | false | false | 0 |
print_element_list (gboolean print_all)
{
int plugincount = 0, featurecount = 0, blacklistcount = 0;
GList *plugins, *orig_plugins;
orig_plugins = plugins = gst_default_registry_get_plugin_list ();
while (plugins) {
GList *features, *orig_features;
GstPlugin *plugin;
plugin = (GstPlugin *) (plugin... | false | false | false | true | false | 1 |
Perimeter(const Point* verts) const
{
if(!verts) return 0.0f;
const Point& p0 = verts[0];
const Point& p1 = verts[1];
const Point& p2 = verts[2];
return p0.Distance(p1)
+ p0.Distance(p2)
+ p1.Distance(p2);
} | false | false | false | false | false | 0 |
sg_load_map_owner(struct loaddata *loading)
{
int x, y;
struct player *owner = NULL;
struct tile *claimer = NULL;
/* Check status and return if not OK (sg_success != TRUE). */
sg_check_ret();
if (game.info.is_new_game) {
/* No owner/source information for a new game / scenario. */
return;
}
/... | true | true | false | false | false | 1 |
is_source_positiv(int oper)
{
switch (OPER) {
case ABL_AND: case ABL_NAND:
switch (oper) {
case ABL_AND: case ABL_NAND: return 1;
case ABL_OR: case ABL_NOR: return 0;
default: return -1;
}
case ABL_OR: case ABL_NOR:
switch (oper) {
case ABL_OR: case ABL_NOR: return ... | false | false | false | false | false | 0 |
evconnlistener_disable(struct evconnlistener *lev)
{
int r;
LOCK(lev);
lev->enabled = 0;
r = lev->ops->disable(lev);
UNLOCK(lev);
return r;
} | false | false | false | false | false | 0 |
do_timings (mvapich_state_t *st, const char *fmt, ...)
{
static int initialized = 0;
static struct timeval initv = { 0, 0 };
struct timeval tv;
struct timeval result;
char *msg;
va_list ap;
if (!st->do_timing)
return;
if (!initialized) {
if (gettimeofday (&initv, NULL) < 0)
error ("mvapich: do_timings... | false | false | false | false | false | 0 |
GetArraySetting(int index)
{
if(index >= 0 && index < this->GetNumberOfArrays())
{
return this->Internal->ArraySettings[index];
}
return 0;
} | false | false | false | false | false | 0 |
stonith_api_add_callback(stonith_t * stonith, int call_id, int timeout, int options,
void *user_data, const char *callback_name,
void (*callback) (stonith_t * st, stonith_callback_data_t * data))
{
stonith_callback_client_t *blob = NULL;
stonith_private_t *priva... | false | false | false | false | false | 0 |
snd_emu10k1_del_controls(struct snd_emu10k1 *emu,
struct snd_emu10k1_fx8010_code *icode)
{
unsigned int i;
struct snd_ctl_elem_id id;
struct snd_ctl_elem_id __user *_id;
struct snd_emu10k1_fx8010_ctl *ctl;
struct snd_card *card = emu->card;
for (i = 0, _id = icode->gpr_del_controls;
i < icode->gpr... | false | false | false | false | false | 0 |
test_close_parent(hid_t fapl)
{
hid_t fid1 = -1, fid2 = -1; /* File IDs */
hid_t gidA = -1; /* Group IDs in file #1 */
hid_t gidM = -1; /* Group IDs in file #2 */
char name[NAME_BUF_SIZE]; /* Buffer for filename retrieved */
ssize_t name_len; ... | true | true | true | false | false | 1 |
InitHighscores (void)
{
int i;
char fname[255];
FILE *file = NULL;
if (ConfigDir[0] != '\0')
{
sprintf (fname, "%s/highscores", ConfigDir);
if ( (file = fopen (fname, "r")) == NULL)
DebugPrintf (1, "WARNING: no highscores file found... \n");
}
num_highscores = MAX_HIGHSCORES; /* ha... | true | true | false | false | true | 1 |
uxcopy_stdin (e)
FILE *e;
{
CATCH_PROTECT size_t cread;
char ab[1024];
do
{
size_t cwrite;
/* I want to use fread here, but there is a bug in some versions
of SVR4 which causes fread to return less than a complete
buffer even if EOF has not been reached. This is not online
time, so s... | false | false | false | false | false | 0 |
ImportTIFF_CheckStandardMapping ( const TIFF_Manager::TagInfo & tagInfo, const TIFF_MappingToXMP & mapInfo )
{
XMP_Assert ( (kTIFF_ByteType <= tagInfo.type) && (tagInfo.type <= kTIFF_LastType) );
XMP_Assert ( mapInfo.type <= kTIFF_LastType );
if ( (tagInfo.type < kTIFF_ByteType) || (tagInfo.type > kTIFF_LastType) )... | false | false | false | false | false | 0 |
rt2x00queue_unpause_queue(struct data_queue *queue)
{
if (!test_bit(DEVICE_STATE_PRESENT, &queue->rt2x00dev->flags) ||
!test_bit(QUEUE_STARTED, &queue->flags) ||
!test_and_clear_bit(QUEUE_PAUSED, &queue->flags))
return;
switch (queue->qid) {
case QID_AC_VO:
case QID_AC_VI:
case QID_AC_BE:
case QID_AC... | false | false | false | false | false | 0 |
on_treeview_row_expanded(GtkWidget *widget, GtkTreeIter *iter, GtkTreePath *path, gpointer user_data)
{
gchar *uri;
gtk_tree_model_get(GTK_TREE_MODEL(treestore), iter, TREEBROWSER_COLUMN_URI, &uri, -1);
if (uri == NULL)
return;
if (flag_on_expand_refresh == FALSE)
{
flag_on_expand_refresh = TRUE;
treebrows... | false | false | false | false | false | 0 |
yy_create_buffer( FILE *file, int size )
#else
YY_BUFFER_STATE yy_create_buffer( file, size )
FILE *file;
int size;
#endif
{
YY_BUFFER_STATE b;
b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
b->yy_bu... | false | false | false | false | false | 0 |
io_stats_readv_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno,
struct iovec *vector, int32_t count,
struct iatt *buf, struct iobref *iobref, dict_t *xdata)
{
int len = 0;
fd_t *f... | false | false | false | false | false | 0 |
user_print2(hid_t err_stack, FILE *stream)
{
/* Customized way to print errors */
fprintf(stderr, "\n********* Print error stack in customized way *********\n");
if(H5Ewalk2(err_stack, H5E_WALK_UPWARD, (H5E_walk2_t)custom_print_cb2, stream) < 0)
TEST_ERROR;
return 0;
error:
return -1;
} | false | false | false | false | false | 0 |
PR_StringToNetAddr(const char *string, PRNetAddr *addr)
{
if (!_pr_initialized) _PR_ImplicitInitialization();
if (!addr || !string || !*string)
{
PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
return PR_FAILURE;
}
#if !defined(_PR_HAVE_GETADDRINFO)
return pr_StringToNetAddrFB(string, a... | false | false | false | false | false | 0 |
crypto_unregister_aeads(struct aead_alg *algs, int count)
{
int i;
for (i = count - 1; i >= 0; --i)
crypto_unregister_aead(&algs[i]);
} | false | false | false | false | false | 0 |
Reset(void)
{
mActiveNum = 0;
for (PRUint32 i = 0; i < NUM_OF_PROBERS; i++)
{
if (mProbers[i])
{
mProbers[i]->Reset();
mIsActive[i] = PR_TRUE;
++mActiveNum;
}
else
mIsActive[i] = PR_FALSE;
}
mBestGuess = -1;
mState = eDetecting;
mKeepNext = 0;
} | false | false | false | false | false | 0 |
openLogFile(const wchar_t* filename)
{
CMT3LOG("L3: openLogFile \"%S\"\n",filename?filename:L"");
CMT3EXITLOG;
m_logging = false;
if (m_serial.isOpen())
return m_lastResult = XRV_INVALIDOPERATION;
if (m_logFile.isOpen())
return m_lastResult = XRV_ALREADYOPEN;
m_lastResult = m_logFile.open(filename,true);
if... | false | false | false | false | false | 0 |
FreeKMeansResult(bisecting_kmeans_result_t **prResult_p)
{
int iAux;
CKFREE((*prResult_p)->piNObjsPerCluster);
for (iAux=0; iAux<(*prResult_p)->iNClusters; iAux++) {
CKFREE((*prResult_p)->ppiObjIndicesPerCluster[iAux]);
CKFREE((*prResult_p)->ppdClusterCenters[iAux]);
}
CKFREE((*prRes... | false | false | false | false | false | 0 |
pf_ctx_init (pf_ctx_t *ctx, const pf_conf_t *conf, struct pf_stat_s *stat)
{
int rc = 0;
memset (ctx, 0, sizeof (*ctx));
ctx->conf = conf;
ctx->stat = stat;
ctx->fd = -1;
ctx->state = PF_CTX_AVAIL;
if (conf->do_init)
rc = conf->do_init(ctx);
return rc;
} | false | false | false | false | false | 0 |
clear_newcaps_for_pt (GstRtpPtDemux * rtpdemux, guint8 pt)
{
GSList *walk;
GST_OBJECT_LOCK (rtpdemux);
for (walk = rtpdemux->srcpads; walk; walk = g_slist_next (walk)) {
GstRtpPtDemuxPad *pad = walk->data;
if (pad->pt == pt) {
pad->newcaps = FALSE;
break;
}
}
GST_OBJECT_UNLOCK (rtpde... | false | false | false | false | false | 0 |
slapiControlOp2SlapControlMask(unsigned long slapi_mask,
slap_mask_t *slap_mask)
{
*slap_mask = 0;
if ( slapi_mask & SLAPI_OPERATION_BIND )
*slap_mask |= SLAP_CTRL_BIND;
if ( slapi_mask & SLAPI_OPERATION_UNBIND )
*slap_mask |= SLAP_CTRL_UNBIND;
if ( slapi_mask & SLAPI_OPERATION_SEARCH )
*slap_mask |= SLAP... | false | false | false | false | false | 0 |
do_cmd_toggle_search(cmd_code code, cmd_arg args[])
{
/* Stop searching */
if (p_ptr->searching)
{
/* Clear the searching flag */
p_ptr->searching = FALSE;
/* Recalculate bonuses */
p_ptr->update |= (PU_BONUS);
/* Redraw the state */
p_ptr->redraw |= (PR_STATE);
}
/* Start searching */
else
{
/*... | false | false | false | false | false | 0 |
select_detect(jit_State *J)
{
BCIns ins = J->pc[1];
if (bc_op(ins) == BC_CALLM && bc_b(ins) == 2 && bc_c(ins) == 1) {
cTValue *func = &J->L->base[bc_a(ins)];
if (tvisfunc(func) && funcV(func)->c.ffid == FF_select)
return 1;
}
return 0;
} | false | false | false | false | false | 0 |
char2str(const char c)
{
string ret = "";
ret += c;
return ret;
} | false | false | false | false | false | 0 |
serveroperator()
{
loopv(clients) if(clients[i]->type!=ST_EMPTY && clients[i]->role > CR_DEFAULT) return i;
return -1;
} | false | false | false | false | false | 0 |
powr1220_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
struct powr1220_data *data;
struct device *hwmon_dev;
if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
return -ENODEV;
data = devm_kzalloc(&client->dev, sizeof(*data), GFP_KERNEL);
if (!data)
return -ENOMEM;... | false | false | false | false | false | 0 |
addModule( const QString& module )
{
/* In case it doesn't exist we just silently drop it.
* This allows people to easily extend containers.
* For example, KCM monitor gamma can be in kdegraphics.
*/
KService::Ptr service = KService::serviceByDesktopName( module );
if ( !service )
{
kDebug(713) << "KCModule... | false | false | false | false | false | 0 |
get_stored_layout_timestamp (NemoIconContainer *container,
NemoIconData *icon_data,
time_t *timestamp,
NemoIconView *view)
{
NemoFile *file;
NemoDirectory *directory;
if (icon_data == NULL) {
directory = nemo_view_get_model (NEMO_VIEW (view));
if (directory == NULL) {
return FALSE;
... | false | false | false | false | false | 0 |
ja_euc_char_type(chasen_tok_t *tok, unsigned char *str, int len)
{
int mblen = tok->mblen(str, len);
if (mblen == 1) {
if (isalpha(str[0])) {
return HALF_LATIN;
} else if (is_space(str[0])) {
return JA_SPACE;
}
} else if (mblen == 2) {
if ((str[0] == 0xa1) && (str[1] == 0xbc)) {
return P... | false | false | false | false | false | 0 |
SetLogFile(char const* strNewLogFile)
{
if (m_strLogFile == NULL ||
strNewLogFile == NULL ||
strcmp(m_strLogFile,strNewLogFile) != 0)
{
free((void*)m_strLogFile);
m_strLogFile = strNewLogFile == NULL ? (char *)NULL : strdup(strNewLogFile);
m_bOpened = false;
}
} | false | false | false | false | false | 0 |
e132xs_xori(void)
{
UINT32 op1, op2, ret;
op1 = immediate_value();
if( D_BIT )
{
op2 = GET_L_REG(D_CODE);
}
else
{
op2 = GET_G_REG(D_CODE);
}
ret = op1 ^ op2;
SET_RD(ret, NOINC);
SET_Z((ret == 0 ? 1: 0));
e132xs_ICount -= 1;
} | false | false | false | false | false | 0 |
IO_getval(IOobject *self, PyObject *args) {
PyObject *use_pos=Py_None;
int b;
Py_ssize_t s;
if (!IO__opencheck(self)) return NULL;
if (!PyArg_UnpackTuple(args,"getval", 0, 1,&use_pos)) return NULL;
b = PyObject_IsTrue(use_pos);
if (b < 0)
return NULL;
if (b) {
s=s... | false | false | false | false | false | 0 |
NewSceneStats()
{
GF_SceneStatistics *tmp;
GF_SAFEALLOC(tmp, GF_SceneStatistics);
tmp->node_stats = gf_list_new();
tmp->proto_stats = gf_list_new();
tmp->max_2d.x = FIX_MIN;
tmp->max_2d.y = FIX_MIN;
tmp->max_3d.x = FIX_MIN;
tmp->max_3d.y = FIX_MIN;
tmp->max_3d.z = FIX_MIN;
tmp->min_2d.x = FIX_MAX;
tmp->min_... | false | false | false | true | false | 1 |
netsnmp_arch_defaultrouter_container_load(netsnmp_container *container,
u_int load_flags)
{
int rc = 0;
DEBUGMSGTL(("access:defaultrouter:entry:arch", "load (linux)\n"));
rc = _load(container);
if (rc < 0) {
u_int flags = NETSNMP_ACCESS_DEFAULTROUTER_F... | false | false | false | false | false | 0 |
text_attribute(gpaint_tool* tool, gpaint_attribute attrib, gpointer data)
{
debug_fn();
GtkStyle *style;
GtkWidget *widget = NULL;
if ((tool->canvas == NULL) || (tool->canvas->drawing_area == NULL)) return FALSE;
widget = GTK_WIDGET(tool->canvas->drawing_area);
style = gtk_widget_get_style(widg... | false | false | false | false | false | 0 |
TIFFReadDirEntryData(TIFF* tif, uint64 offset, tmsize_t size, void* dest)
{
assert(size>0);
if (!isMapped(tif)) {
if (!SeekOK(tif,offset))
return(TIFFReadDirEntryErrIo);
if (!ReadOK(tif,dest,size))
return(TIFFReadDirEntryErrIo);
} else {
size_t ma,mb;
ma=(size_t)offset;
mb=ma+size;... | false | false | false | false | false | 0 |
vTaskSwitchContext( void )
{
if( uxSchedulerSuspended != ( UBaseType_t ) pdFALSE )
{
/* The scheduler is currently suspended - do not allow a context
switch. */
xYieldPending = pdTRUE;
}
else
{
xYieldPending = pdFALSE;
traceTASK_SWITCHED_OUT();
#if ( configGENERATE_RUN_TIME_STATS == 1 )
... | false | false | false | false | false | 0 |
_comedi_dio_write(comedi_t *it,unsigned int subdev,unsigned int chan,
unsigned int val)
{
subdevice *s;
if(!valid_chan(it,subdev,chan))
return -1;
s = it->subdevices+subdev;
if(s->type!=COMEDI_SUBD_DIO &&
s->type!=COMEDI_SUBD_DO)
return -1;
if(it->has_insnlist_ioctl){
comedi_insn insn;
lsampl_t dat... | false | false | false | false | false | 0 |
_read_record_id_range (int *flag,
uint16_t *range1,
uint16_t *range2,
char *arg)
{
char *endptr;
char *range_str = NULL;
char *start_ptr = NULL;
char *range1_str = NULL;
char *range2_str = NULL;
int value = 0;
assert (flag);
assert (r... | false | false | false | false | false | 0 |
dav_fs_patch_rollback(const dav_resource *resource,
int operation,
void *context,
dav_liveprop_rollback *rollback_ctx)
{
apr_fileperms_t perms = resource->info->finfo.protection & ~APR_UEXECUTE;
... | false | false | false | false | false | 0 |
e_cal_backend_refresh (ECalBackend *backend,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
GSimpleAsyncResult *simple;
g_return_if_fail (E_IS_CAL_BACKEND (backend));
simple = g_simple_async_result_new (
G_OBJECT... | false | false | false | false | false | 0 |
iflinux_add_physical(struct lldpd *cfg,
struct interfaces_device_list *interfaces)
{
struct interfaces_device *iface;
/* White-list some drivers */
const char * const *rif;
const char * const regular_interfaces[] = {
"dsa",
"veth",
NULL
};
TAILQ_FOREACH(iface, interfaces, next) {
if (iface->type & (I... | false | false | false | false | false | 0 |
fill_wedge_from_list_rec(patch_fill_state_t *pfs,
wedge_vertex_list_elem_t *beg, const wedge_vertex_list_elem_t *end,
int level, const patch_color_t *c0, const patch_color_t *c1)
{
if (beg->next == end)
return 0;
else if (beg->next->next == end) {
if (beg->next->divide_co... | false | false | false | false | false | 0 |
DoubleOr(struct Expression * exp, struct Operand * op1, struct Operand * op2)
{
double value2 = op2->d;
exp->type = 2;
exp->string = PrintDouble(op1->d || value2);
if(!exp->expType)
{
exp->expType = op1->type;
if(op1->type)
op1->type->refCount++;
}
return 0x1;
} | 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.