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 |
|---|---|---|---|---|---|---|
z80_reset(void *param)
{
Z80_DaisyChain *daisy_chain = (Z80_DaisyChain *)param;
memset(&Z80, 0, sizeof(Z80));
_IX = _IY = 0xffff; /* IX and IY are FFFF after a reset! */
_F = ZF; /* Zero flag is set */
Z80.request_irq = -1;
Z80.service_irq = -1;
Z80.nmi_state = CLEAR_LINE;
Z80.irq_state = CLEAR_LINE;... | false | false | false | false | false | 0 |
gfs_l_gfork_free_write_cb(
globus_xio_handle_t handle,
globus_result_t result,
globus_xio_iovec_t * iovec,
int count,
globus_size_t nbytes,
globus_xio_data_descriptor_t data_desc,
... | false | false | false | false | false | 0 |
__indirect_glIndexubv(const GLubyte * c)
{
struct glx_context * const gc = __glXGetCurrentContext();
const GLuint cmdlen = 8;
emit_header(gc->pc, X_GLrop_Indexubv, cmdlen);
(void) memcpy((void *)(gc->pc + 4), (void *)(c), 1);
gc->pc += cmdlen;
if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRend... | false | true | false | false | false | 1 |
ensCacheStore(EnsPCache cache, void *key, void **Pvalue)
{
CachePNode node = NULL;
if (!cache)
return ajFalse;
if (!key)
return ajFalse;
if (!Pvalue)
return ajFalse;
/* Is a node already cached under this key? */
node = (CachePNode) ajTableFetchmodV(cache->Table, key... | false | false | false | false | false | 0 |
g_putch(int in_ch)
{
char ch = (char)in_ch;
# if defined(ASCIIGRAPH) && !defined(NO_TERMS)
if (iflags.IBMgraphics || iflags.eight_bit_tty) {
/* IBM-compatible displays don't need other stuff */
putchar(ch);
} else if (ch & 0x80) {
if (!GFlag || HE_resets_AS) {
graph_on();
GFlag = true;
}
put... | false | false | false | false | false | 0 |
setfsd(utype_t *ups)
{
char buf[SMALLBUF];
int ret;
/* this shouldn't happen */
if (!ups->upsname) {
upslogx(LOG_ERR, "setfsd: programming error: no UPS name set [%s]",
ups->sys);
return;
}
upsdebugx(2, "Setting FSD on UPS %s", ups->sys);
snprintf(buf, sizeof(buf), "FSD %s\n", ups->upsname);
ret = up... | false | false | false | false | false | 0 |
gst_value_intersect_int64_int64_range (GValue * dest, const GValue * src1,
const GValue * src2)
{
if (src2->data[0].v_int64 <= src1->data[0].v_int64 &&
src2->data[1].v_int64 >= src1->data[0].v_int64) {
if (dest)
gst_value_init_and_copy (dest, src1);
return TRUE;
}
return FALSE;
} | false | false | false | false | false | 0 |
_gcry_pk_util_get_nbits (gcry_sexp_t list, unsigned int *r_nbits)
{
char buf[50];
const char *s;
size_t n;
*r_nbits = 0;
list = sexp_find_token (list, "nbits", 0);
if (!list)
return 0; /* No NBITS found. */
s = sexp_nth_data (list, 1, &n);
if (!s || n >= DIM (buf) - 1 )
{
/* NBITS give... | false | false | false | false | false | 0 |
check_local_mod(unsigned char *head, int index_only)
{
/* items in list are already sorted in the cache order,
* so we could do this a lot more efficiently by using
* tree_desc based traversal if we wanted to, but I am
* lazy, and who cares if removal of files is a tad
* slower than the theoretical maximum spe... | true | true | false | false | false | 1 |
get_split_list(exec_list *instructions,
bool linked)
{
visit_list_elements(this, instructions);
/* If the shaders aren't linked yet, we can't mess with global
* declarations, which need to be matched by name across shaders.
*/
if (!linked) {
foreach_list(node, instructions) {
ir_variab... | false | false | false | false | false | 0 |
nfs3_funge_root_dotdot_dirent (gf_dirent_t *ent, struct nfs3_fh *dfh)
{
if ((!ent) || (!dfh))
return;
if (nfs3_fh_is_root_fh (dfh) &&
nfs3_is_parentdir_entry (ent->d_name)) {
ent->d_ino = 1;
ent->d_stat.ia_ino = 1;
}
if (nfs3_... | false | false | false | false | false | 0 |
searchForward()
{
LOG(logDEBUG) << "CrawlerWidget::searchForward";
activeView()->searchForward();
} | false | false | false | false | false | 0 |
rehash_tresvs(struct Client *source_p)
{
struct ConfItem *aconf;
rb_dlink_node *ptr;
rb_dlink_node *next_ptr;
int i;
sendto_realops_flags(UMODE_ALL, L_ALL, "%s is clearing temp resvs",
get_oper_name(source_p));
HASH_WALK_SAFE(i, R_MAX, ptr, next_ptr, resvTable)
{
aconf = ptr->data;
if((aconf->flag... | false | false | false | false | false | 0 |
concat_options(char *left, char *right)
{
char buf[MAX_ERR_BUF];
char *ret;
if (left == NULL || *left == '\0') {
ret = strdup(right);
free(right);
return ret;
}
if (right == NULL || *right == '\0') {
ret = strdup(left);
free(left);
return ret;
}
ret = malloc(strlen(left) + strlen(right) + 2);
if... | false | false | false | false | false | 0 |
alloc_obj (GCVTable vtable, size_t size, gboolean pinned, gboolean has_references)
{
int size_index = MS_BLOCK_OBJ_SIZE_INDEX (size);
MSBlockInfo * volatile * free_blocks = FREE_BLOCKS (pinned, has_references);
void *obj;
if (!free_blocks [size_index]) {
if (G_UNLIKELY (!ms_alloc_block (size_index, pinned, has_r... | false | false | false | false | false | 0 |
getStoredPass()
{
FILE *fp;
struct stat buf;
char *h = getenv("HOME");
if (!h) {
return NULL;
}
char* resfile = (char*) calloc(strlen(h)+21,1);
strcpy(resfile, h);
strcat(resfile, "/.anyRemote/password");
if(stat(resfile, &buf) == -1) {
free(resfile);
retu... | false | false | false | false | false | 0 |
cl_com_setup_connection(cl_com_handle_t* handle, cl_com_connection_t** connection) {
int ret_val = CL_RETVAL_HANDLE_NOT_FOUND;
if (handle != NULL) {
switch(handle->framework) {
case CL_CT_TCP: {
ret_val = cl_com_tcp_setup_connection(connection,
... | false | false | false | false | false | 0 |
irmo_slist_prepend(IrmoSListEntry **list, IrmoSListValue data)
{
IrmoSListEntry *newentry;
/* Create new entry */
newentry = malloc(sizeof(IrmoSListEntry));
if (newentry == NULL) {
return NULL;
}
newentry->data = data;
/* Hook into the list start */
newentry->next = *list;
*list = newentry;
return n... | false | false | false | false | false | 0 |
setSelectable(int now,
CORBA::Boolean data_in_buffer,
CORBA::Boolean hold_lock)
{
OMNIORB_ASSERT(pd_belong_to);
ASSERT_OMNI_TRACEDMUTEX_HELD(pd_belong_to->pd_collection_lock, hold_lock);
omni_optional_lock l(pd_belong_to->pd_collection_lock, hold_lock, hold_lock);
if (now == 2 && !pd_... | false | false | false | true | false | 1 |
process_jobs(int argc, char **argv, int what)
{
/* Delete every argument (job - ID) given
*/
int i;
struct stat buf;
DIR *spool;
struct dirent *dirent;
unsigned long ctm;
char queue;
long jobno;
int rc = EXIT_SUCCESS;
int done;
for (i = optind; i < argc; i++) {
done = ... | false | false | true | false | true | 1 |
query(uint32_t type, const Element *e, const String &name, void *value, size_t vsize)
{
while (1) {
NameDB *db = getdb(type, e, vsize, false);
while (db) {
if (db->query(name, value, vsize))
return true;
db = db->context_parent();
}
if (!e)
return false;
e = 0;
}
} | false | false | false | false | false | 0 |
determineAccess()
{
mAccess = 0;
if (mInStream)
mAccess |= READ;
if (mFStream)
mAccess |= WRITE;
} | false | false | false | false | false | 0 |
amdlibCopyPiston(amdlibPISTON *srcOpd,
amdlibPISTON *dstOpd,
amdlibERROR_MSG errMsg)
{
int band;
/* Update thisPtr field (not allocated if destination structure comes from
* yorick) */
if (dstOpd->thisPtr != dstOpd)
{
... | false | false | false | false | false | 0 |
worklist_peek_ith(const struct worklist *pwl,
struct universal *prod, int idx)
{
/* Out of possible bounds. */
if (idx < 0 || pwl->length <= idx) {
prod->kind = VUT_NONE;
prod->value.building = NULL;
return FALSE;
}
*prod = pwl->entries[idx];
return TRUE;
} | false | false | false | false | false | 0 |
write_rgb_data (char *name, unsigned char *image, SANE_Int width,
SANE_Int height)
{
FILE *fdbg = NULL;
fdbg = fopen (name, "wb");
if (fdbg == NULL)
return;
fprintf (fdbg, "P6\n%d %d\n255\n", width, height);
fwrite (image, width * 3, height, fdbg);
fclose (fdbg);
} | false | false | false | false | true | 1 |
setSearchProviders(KUriFilterData &data, const QList<KUriFilterSearchProvider*>& providers) const
{
Q_FOREACH(KUriFilterSearchProvider* searchProvider, providers) {
data.d->searchProviderList << searchProvider->name();
data.d->searchProviderMap.insert(searchProvider->name(), searchProvider);
}
} | false | false | false | false | false | 0 |
UpdateFileDetails(ProjectBuildTarget* target)
{
if (!project)
return;
if (!compile && !link)
return;
// update PCH output name (in case project PCH mode was changed)
if (FileTypeOf(relativeFilename) == ftHeader)
SetObjName(relativeToCommonTopLevelPath);
if (!target) // upd... | false | false | false | false | false | 0 |
event(QEvent* ev)
{
if (ev->type() == QEvent::ShortcutOverride) {
QKeyEvent *e = static_cast<QKeyEvent *>( ev );
if (d->overrideShortcut(e)) {
e->accept();
return true;
}
}
return QTextEdit::event(ev);
} | false | false | false | false | false | 0 |
read_file( char* vfilename, char* filename, FILE* fp )
{
int ich;
int state;
/* Copy it to output, while running a state-machine to look for
** SSI directives.
*/
state = ST_GROUND;
while ( ( ich = getc( fp ) ) != EOF )
{
switch ( state )
{
case ST_GROUND:
if ( ich == '... | false | false | false | false | false | 0 |
lwo_cb_PTAG(G3DIffGlobal *global, G3DIffLocal *local)
{
LwoObject *obj;
G3DObject *object;
G3DMaterial *material, *tmat;
G3DFace *face;
GSList *mlist;
gint32 id, fmax;
guint32 poly, tag;
obj = (LwoObject *)global->user_data;
g_return_val_if_fail(obj != NULL, FALSE);
object = (G3DObject *)obj->object;
g_ret... | false | false | false | false | false | 0 |
gst_bz2dec_chain (GstPad * pad, GstObject * parent, GstBuffer * in)
{
GstFlowReturn flow;
GstBuffer *out;
GstBz2dec *b;
int r = BZ_OK;
GstMapInfo map, omap;
b = GST_BZ2DEC (parent);
if (!b->ready)
goto not_ready;
gst_buffer_map (in, &map, GST_MAP_READ);
b->stream.next_in = (char *) map.data;
... | false | false | false | false | false | 0 |
generateBinOp(Tree sig, int opcode, Tree arg1, Tree arg2, int priority)
{
string s;
int thisPriority = gBinOpLateqTable[opcode]->fPriority;
/* Priority parenthesis handling. */
string lpar = "";
string rpar = "";
if ( (thisPriority < priority) || ((thisPriority == priority) && !associative(opcode)) ) {
... | false | false | false | false | false | 0 |
cpu_has_cpufreq(unsigned int cpu)
{
struct cpufreq_policy policy;
if (!acpi_thermal_cpufreq_is_init || cpufreq_get_policy(&policy, cpu))
return 0;
return 1;
} | false | false | false | false | false | 0 |
ldns_resolver_query_status(ldns_pkt** pkt,
ldns_resolver *r, const ldns_rdf *name,
ldns_rr_type t, ldns_rr_class c, uint16_t flags)
{
ldns_rdf *newname;
ldns_status status;
if (!ldns_resolver_defnames(r) || !ldns_resolver_domain(r)) {
return ldns_resolver_send(pkt, r, name, t, c, flags);
}
newname = ldns_d... | false | false | false | false | false | 0 |
XmtWorkingBoxSetScaleValue(Widget w, int value)
#else
void XmtWorkingBoxSetScaleValue(w, value)
Widget w;
int value;
#endif
{
XmtWorkingBoxWidget wd = (XmtWorkingBoxWidget) w;
XmtAssertWidgetClass(w,xmtWorkingBoxWidgetClass,
"XmtWorkingBoxSetScaleValue");
if (wd->working_box.scale_value != value) {
wd... | false | false | false | false | false | 0 |
regmap_calc_tot_len(struct regmap *map,
void *buf, size_t count)
{
/* Calculate the length of a fixed format */
if (!map->debugfs_tot_len) {
map->debugfs_reg_len = regmap_calc_reg_len(map->max_register),
map->debugfs_val_len = 2 * map->format.val_bytes;
map->debugfs_tot_len = map->debugfs_reg_len +
... | false | false | false | false | false | 0 |
sr_mdio_read(struct net_device *netdev, int phy_id, int loc)
{
struct usbnet *dev = netdev_priv(netdev);
__le16 res;
int rc = 0;
if (phy_id) {
netdev_dbg(netdev, "Only internal phy supported\n");
return 0;
}
/* Access NSR_LINKST bit for link status instead of MII_BMSR */
if (loc == MII_BMSR) {
u8 value;
... | false | false | false | false | false | 0 |
technisat_usb2_disconnect(struct usb_interface *intf)
{
struct dvb_usb_device *dev = usb_get_intfdata(intf);
/* work and stuff was only created when the device is is hot-state */
if (dev != NULL) {
struct technisat_usb2_state *state = dev->priv;
if (state != NULL)
cancel_delayed_work_sync(&state->green_led_w... | false | false | false | false | false | 0 |
new_alias_set (void)
{
if (flag_strict_aliasing)
{
if (alias_sets == 0)
vec_safe_push (alias_sets, (alias_set_entry) 0);
vec_safe_push (alias_sets, (alias_set_entry) 0);
return alias_sets->length () - 1;
}
else
return 0;
} | false | false | false | false | false | 0 |
TestCommandAddAssoc( String )
char *String;
{
bddassoc *BddAssoc;
bddnode *BddNodeIn;
bddnode *BddNodeOut;
char *Scan;
char *NameIn;
bddvar Variable;
if ( String != (char *)0 )
{
Scan = strchr( String, ' ' );
if ( Scan == (char *)0 ) return;
*Scan = '\0';
NameIn = Tes... | false | false | false | false | false | 0 |
nhrp_packet_dequeue(struct nhrp_packet *packet)
{
ev_timer_stop(&packet->timeout);
if (list_hashed(&packet->request_list_entry))
list_del(&packet->request_list_entry);
nhrp_packet_put(packet);
} | false | false | false | false | false | 0 |
term2point(ErlNifEnv* env, ERL_NIF_TERM term,
EC_GROUP *group, EC_POINT **pptr)
{
int ret = 0;
ErlNifBinary bin;
EC_POINT *point;
if (!enif_inspect_binary(env,term,&bin)) {
return 0;
}
if ((*pptr = point = EC_POINT_new(group)) == NULL) {
return 0;
}
/* set the point c... | false | false | false | false | false | 0 |
__ecereNameSpace__ecere__sys__ChangeCh(char * string, char ch1, char ch2)
{
int c;
for(c = 0; string[c]; c++)
if(string[c] == ch1)
string[c] = ch2;
} | false | false | false | false | false | 0 |
grokparms (parms_info, funcdef_flag)
tree parms_info;
int funcdef_flag;
{
tree first_parm = TREE_CHAIN (parms_info);
last_function_parms = TREE_PURPOSE (parms_info);
last_function_parm_tags = TREE_VALUE (parms_info);
if (warn_strict_prototypes && first_parm == 0 && !funcdef_flag
&& !in_system_... | false | false | false | false | false | 0 |
extract_leading_promoters_starting_after( int32_t pos, ae_list<ae_rna*>* extracted_promoters )
{
assert( pos >= 0 && pos < _dna->get_length() );
ae_list_node<ae_rna*>* rna_node = NULL;
// Find the first promoters in the interval
ae_list_node<ae_rna*>* node_first = NULL;
rna_node = _rna_list[LEADING]->ge... | false | false | false | false | false | 0 |
ajResourceoutprintBook(AjPFile outf)
{
ajint i = 0;
ajFmtPrintF(outf, "<para>The supported data resource output "
"formats are summarised "
"in the table below. The columns are as follows: "
"<emphasis>Output format</emphasis> (format name), "
"<... | false | false | false | false | false | 0 |
tomoyo_filetype(const umode_t mode)
{
switch (mode & S_IFMT) {
case S_IFREG:
case 0:
return tomoyo_condition_keyword[TOMOYO_TYPE_IS_FILE];
case S_IFDIR:
return tomoyo_condition_keyword[TOMOYO_TYPE_IS_DIRECTORY];
case S_IFLNK:
return tomoyo_condition_keyword[TOMOYO_TYPE_IS_SYMLINK];
case S_IFIFO:
return to... | false | false | false | false | false | 0 |
ensMiscellaneoussetNewIni(
EnsPMiscellaneoussetadaptor msa,
ajuint identifier,
AjPStr code,
AjPStr name,
AjPStr description,
ajuint maxlen)
{
EnsPMiscellaneousset ms = NULL;
AJNEW0(ms);
ms->Use = 1U;
ms->Identifier = identifier;
ms->Adaptor = msa;
if (code)
... | false | false | false | false | false | 0 |
set_property (GObject *object, guint prop_id,
const GValue *value, GParamSpec *pspec)
{
NMSettingWirelessPrivate *priv = NM_SETTING_WIRELESS_GET_PRIVATE (object);
switch (prop_id) {
case PROP_SSID:
if (priv->ssid)
g_byte_array_free (priv->ssid, TRUE);
priv->ssid = g_value_dup_boxed (value);
break;
c... | false | false | false | false | false | 0 |
HandleQuestgiverChooseRewardOpcode(WorldPacket& recv_data)
{
uint32 quest, reward;
ObjectGuid guid;
recv_data >> guid >> quest >> reward;
if (reward >= QUEST_REWARD_CHOICES_COUNT)
{
sLog.outError("Error in CMSG_QUESTGIVER_CHOOSE_REWARD - %s tried to get invalid reward (%u) (probably packet ... | false | false | false | false | false | 0 |
OnCleanAll(cb_unused wxCommandEvent& event)
{
AnnoyingDialog dlg(_("Clean project"),
_("Cleaning ALL the open projects will cause the deletion "
"of all relevant object files.\nThis means that you will "
"have to build ALL your projects from sc... | false | false | false | false | false | 0 |
merge_options (void)
{
struct xscreensaver_function_table *ft = xscreensaver_function_table;
const XrmOptionDescRec *options = ft->options;
const char * const *defaults = ft->defaults;
const char *progclass = ft->progclass;
int def_opts_size, opts_size;
int def_defaults_size, defaults_size;
... | false | false | false | false | false | 0 |
iiamax(int n, int *x, int incx) {
int i, v, mx, idx = 0;
idx = 0;
mx = (x[0] < 0 ? -x[0] : x[0]);
for (i = 0; i < n; i += incx) {
v = (x[i] < 0 ? -x[i] : x[i]);
if (mx < v) {mx = v; idx = i;}
}
return idx;
} | false | false | false | false | false | 0 |
draw_arrow (GdkWindow *window,
GdkGC *gc,
GdkRectangle *area,
GtkArrowType arrow_type,
gint x,
gint y,
gint width,
gint height)
{
gint i, j;
if (area)
gdk_gc_set_clip_rectangle (gc, area);
if (arrow_type == GTK_ARROW_D... | false | false | false | false | false | 0 |
ptraCompactArray(L_PTRA *pa)
{
l_int32 i, imax, nactual, index;
PROCNAME("ptraCompactArray");
if (!pa)
return ERROR_INT("pa not defined", procName, 1);
ptraGetMaxIndex(pa, &imax);
ptraGetActualCount(pa, &nactual);
if (imax + 1 == nactual) return 0;
/* Compact the array */
fo... | false | false | false | false | false | 0 |
zx_DEC_ATTR_wsse_BinarySecurityToken(struct zx_ctx* c, struct zx_wsse_BinarySecurityToken_s* x)
{
switch (x->gg.attr->g.tok) {
case zx_EncodingType_ATTR: x->EncodingType = x->gg.attr; return 1;
case zx_ValueType_ATTR: x->ValueType = x->gg.attr; return 1;
case zx_Id_ATTR|zx_wsu_NS: x->Id = x->gg.attr; r... | false | false | false | false | false | 0 |
type_set_abstractmethods(PyTypeObject *type, PyObject *value, void *context)
{
/* __abstractmethods__ should only be set once on a type, in
abc.ABCMeta.__new__, so this function doesn't do anything
special to update subclasses.
*/
int res;
if (value != NULL) {
res = PyDict_SetItemS... | false | false | false | false | false | 0 |
glade_gtk_grid_child_insert_remove_action (GladeWidgetAdaptor *adaptor,
GObject *container,
GObject *object,
const gchar *group_format,
... | false | false | false | false | false | 0 |
GPS_Protocol_Error(US tag, US data)
{
char s[GPS_ARB_LEN];
(void) sprintf(s,"PROTOCOL ERROR: Unknown tag/data [%c/%d]\n",tag,data);
GPS_Error(s);
if (gps_n_tag_unknown < GPS_TAGUNK) {
gps_tag_unknown[gps_n_tag_unknown] = tag;
gps_tag_data_unknown[gps_n_tag_unknown++] = data;
}
return;
} | false | false | false | false | false | 0 |
printline(FILE *outf, char *start, char *addr, char *rest, char *domain) {
if (domain)
fprintf(outf, "%.*s%s%s", (int)(addr - start), start, domain, rest);
else
fputs(start, outf);
if (ferror(outf)) aargh("write output");
} | false | false | false | false | false | 0 |
ao_uri_has_scheme(const gchar *uri)
{
const gchar *p;
gchar c;
g_return_val_if_fail (uri != NULL, FALSE);
p = uri;
if (! g_ascii_isalpha(*p))
return FALSE;
while (1)
{
c = *p++;
if (c == ':' && strncmp(p, "//", 2) == 0)
return TRUE;
if (! (g_ascii_isalnum(c) || c == '+' || c == '-' || c == '.')... | false | false | false | false | false | 0 |
GetFeature(const uint32 i ) const
{
uint32 count = 0;
uint32 len = 0;
for(uint32 specI=0; specI < GetSpecListLength(); specI++){
len = GetSpec(specI)->GetFeatureListLength();
if(count <= i && i < count + len){
gnBaseFeature* feat = GetSpec(specI)->GetFeature(i - count);
feat->MovePositive(GetSpecStartBase(... | false | false | false | false | false | 0 |
dns_util_sacmp_wop(struct sockaddr *a, struct sockaddr *b)
{
switch (a->sa_family) {
case AF_INET:
return util_compare_sin_wop((struct sockaddr_in *) a, (struct sockaddr_in *) b);
case AF_INET6:
return util_compare_sin6_wop((struct sockaddr_in6 *) a, (struct sockaddr_in6 *) b);
}
re... | false | false | false | false | false | 0 |
vbo_New(void)
{
struct vbo *vbo;
uint16_t nhttp;
ssize_t http_space;
assert(cache_param->http_max_hdr < 65536);
nhttp = (uint16_t)cache_param->http_max_hdr;
http_space = HTTP_estimate(nhttp);
vbo = malloc(sizeof *vbo + 2 * http_space);
AN(vbo);
memset(vbo, 0, sizeof *vbo);
vbo->magic = VBO_MAGIC;
vbo->nh... | false | false | false | false | false | 0 |
ackToClient(const int& sock, const char* clientString,
const struct sockaddr_in& echoClntAddr ){
char localString[strLen+1];
strcpy(localString, clientString);
int bytesSent = sendto( sock, localString, strLen+1, 0,
(struct sockaddr *) &echoClntAddr, sizeof(echoClntAddr) );
#i... | false | false | false | false | false | 0 |
test_session_safe_save( Fixture *fixture, gconstpointer pData )
{
fixture->session->backend = g_new0 (QofBackend, 1);
fixture->session->backend->safe_sync = safe_sync;
qof_session_safe_save( fixture->session, percentage_fn );
g_assert_cmpint( ERR_BACKEND_DATA_CORRUPT, == ,
qof_sessi... | false | false | false | false | false | 0 |
mgrib_lights( LmLighting *lm, struct mgastk *astk )
{
int i, lightsused;
LtLight *light, **lp;
static int prevused = 0;
lightsused = 0;
LM_FOR_ALL_LIGHTS(lm, i,lp) {
light = *lp;
++lightsused;
if (light->Private == 0) {
/* this is a new light */
light->Private = lightsused;
... | false | false | false | false | false | 0 |
bfad_pci_slot_reset(struct pci_dev *pdev)
{
struct bfad_s *bfad = pci_get_drvdata(pdev);
u8 byte;
dev_printk(KERN_ERR, &pdev->dev,
"bfad_pci_slot_reset flags: 0x%x\n", bfad->bfad_flags);
if (pci_enable_device(pdev)) {
dev_printk(KERN_ERR, &pdev->dev, "Cannot re-enable "
"PCI device after reset.\n");
... | false | false | false | false | false | 0 |
mxuport_open(struct tty_struct *tty, struct usb_serial_port *port)
{
struct mxuport_port *mxport = usb_get_serial_port_data(port);
struct usb_serial *serial = port->serial;
int err;
/* Set receive host (enable) */
err = mxuport_send_ctrl_urb(serial, RQ_VENDOR_SET_RX_HOST_EN,
1, port->port_number);
if (er... | false | false | false | false | false | 0 |
addUserLayout( const QString &name, PlaylistLayout layout )
{
layout.setEditable( true );
if( m_layouts.find( name ) != m_layouts.end() )
m_layouts.remove( name );
else
m_layoutNames.append( name );
m_layouts.insert( name, layout );
QDomDocument doc( "layouts" );
QDomElement l... | false | false | false | false | false | 0 |
nukeSlave(EventSelector *es,
int fd,
unsigned int flags,
void *data)
{
Slave *s = (Slave *) data;
s->termHandler = NULL;
if (s->pid != (pid_t) -1) {
if (DOLOG) {
syslog(LOG_INFO,
"Slave %d (pid %lu) taking way too long to exit; sending SIGKILL",
SLAVENO(s), (unsigned long) s->pid);
... | false | false | false | false | false | 0 |
isMatch(const char *sref, char *s)
{
// match per-line delimiter - must kill trailing CR if CRLF
int i = strlen(s);
if (i != 0 && s[i - 1] == '\r')
s[i - 1] = '\0';
return (strcmp(sref, s) == 0);
} | false | false | false | false | false | 0 |
has_selection() {
Gtk::TextIter a, b;
return _text_view.get_buffer()->get_selection_bounds(a, b);
} | false | false | false | false | false | 0 |
_open_slurmdbd_fd(slurm_addr_t dbd_addr)
{
if (dbd_addr.sin_port == 0) {
error("sin_port == 0 in the slurmdbd backup");
return;
}
slurmdbd_fd = slurm_open_msg_conn(&dbd_addr);
if (slurmdbd_fd >= 0)
fd_set_nonblocking(slurmdbd_fd);
} | false | false | false | false | false | 0 |
on_mount_op_reply (GMountOperation *mount_operation,
GMountOperationResult result,
gpointer user_data)
{
UnmountData *data = user_data;
gint choice;
/* disconnect the signal handler */
g_warn_if_fail (data->mount_op_reply_handler_id != 0);
g_signal_han... | false | false | false | false | false | 0 |
vector_mem_rw_count(
vector* vec, /*!< Pointer to vector to parse */
int lsb, /*!< Least-significant bit of memory element to get information for */
int msb, /*!< Most-significant bit of memory element to get information for */
unsigned int* wr_cnt, /*!< Pointer to number ... | false | false | false | false | false | 0 |
gst_mpdparser_get_initializationURL (GstActiveStream * stream,
GstURLType * InitializationURL)
{
const gchar *url_prefix;
g_return_val_if_fail (stream != NULL, NULL);
g_return_val_if_fail (InitializationURL != NULL, NULL);
url_prefix = InitializationURL->sourceURL ? InitializationURL->sourceURL :
st... | false | false | false | false | false | 0 |
readCards( const char *string, const int maxCards,
uint8_t *cards, int *charsConsumed )
{
int i, c, r;
c = 0;
for( i = 0; i < maxCards; ++i ) {
r = readCard( &string[ c ], &cards[ i ] );
if( r < 0 ) {
break;
}
c += r;
}
*charsConsumed = c;
return i;
} | false | false | false | false | false | 0 |
ReadImageInternal( void* vtkNotUsed(in), void* outPtr,
int* outExt,
unsigned int vtkNotUsed(size) )
{
int width = this->GetInternalImage()->Width;
int height = this->GetInternalImage()->Height;
this->OutputExtent = outExt;
if ( !thi... | false | false | false | false | false | 0 |
verify_case(int Case, const long long &Expected, const long long &Received) { cerr << "Test Case #" << Case << "..."; if (Expected == Received) cerr << "PASSED" << endl; else { cerr << "FAILED" << endl; cerr << "\tExpected: \"" << Expected << '\"' << endl; cerr << "\tReceived: \"" << Received << '\"' << endl; } } | false | false | false | false | false | 0 |
init (void)
{
ibus_init ();
bus = ibus_bus_new ();
g_object_ref_sink (bus);
g_signal_connect (bus, "disconnected", G_CALLBACK (ibus_disconnected_cb),
NULL);
ibus_libthai_init (bus);
factory = ibus_factory_new (ibus_bus_get_connection (bus));
g_object_ref_sink (factory);
ibus_fact... | false | false | false | false | false | 0 |
DecodeTimezoneAbbrev(int field, char *lowtoken,
int *offset, pg_tz **tz)
{
int type;
const datetkn *tp;
tp = abbrevcache[field];
/* use strncmp so that we match truncated tokens */
if (tp == NULL || strncmp(lowtoken, tp->token, TOKMAXLEN) != 0)
{
if (zoneabbrevtbl)
tp = datebsearch(lowtoken, zoneabb... | false | false | false | false | false | 0 |
afSetVirtualSampleFormat (AFfilehandle file, int trackid,
int sampleFormat, int sampleWidth)
{
if (!_af_filehandle_ok(file))
return -1;
Track *track = file->getTrack(trackid);
if (!track)
return -1;
if (_af_set_sample_format(&track->v, sampleFormat, sampleWidth) == AF_FAIL)
return -1;
track->ms->setDirty... | false | false | false | false | false | 0 |
handle_deliver_response(Octstr *packet, Octstr *out, int sequence) {
awaiting_response = 0;
if (logging == LOG_packets)
printf("RCV: Deliver response\n");
deliveries++;
if (max_deliveries > 0 && deliveries == max_deliveries) {
time_t elapsed = time(NULL) - start_time;
printf("LOG: %ld deliveries in %ld second... | false | false | false | false | false | 0 |
authsess_xsap_hmac(struct authsess *sess, TPM_DIGEST *digest)
{
TSS_RESULT result;
/* If no auth session was established using this authsess object, return success */
if (!sess->pAuth)
return TSS_SUCCESS;
/* XXX Placeholder for future continueAuthSession support:
* conditionally bump NonceOdd if continue... | false | false | false | false | false | 0 |
Terminate()
{
CALLSTACK_INFO();
try
{
throw; // re-throw
}
catch (const std::exception &e)
{
LOG_ERROR << "Fatal error: " << e.what() << std::endl;
}
catch (...)
{
LOG_ERROR << "Unknown fatal error." << std::endl;
}
LOG_ERROR << std::endl;
... | false | false | false | false | false | 0 |
mq_xattr_updation_done (call_frame_t *frame,
void *cookie,
xlator_t *this,
int32_t op_ret,
int32_t op_errno,
dict_t *dict, dict_t *xdata)
{
QUOTA_STACK_DESTROY (frame, this);
return 0;... | false | false | false | false | false | 0 |
q_deref(Query *self)
{
if (--(self->ref_cnt) == 0) {
self->destroy_i(self);
}
} | false | false | false | false | false | 0 |
RenderTranslucentPolygonalGeometry(vtkViewport *v)
{
int count=0;
if ( this->Representation != VTK_SPHERE_OFF )
{
count += this->SphereActor->RenderTranslucentPolygonalGeometry(v);
}
if ( this->HandleVisibility )
{
count += this->HandleActor->RenderTranslucentPolygonalGeometry(v);
}
i... | false | false | false | false | false | 0 |
JABBERInstantMessage(void *data)
{
JABBER_InstantMessage_PTR im = (JABBER_InstantMessage_PTR) data;
eb_account *sender = NULL;
eb_account *ea;
eb_local_account *ela = find_local_account_by_conn(im->JConn);
if (!ela) {
eb_debug(DBG_JBR, "no ela\n");
sender = find_account_by_handle(im->sender,
SERVICE_INFO.p... | false | false | false | false | false | 0 |
getOutlinePageNum(OutlineItem *item)
{
LinkAction *action = item->getAction();
LinkGoTo *link = NULL;
LinkDest *linkdest = NULL;
int pagenum = -1;
if (!action || action->getKind() != actionGoTo)
return pagenum;
link = dynamic_cast<LinkGoTo*>(action);
if (!link |... | false | false | false | false | false | 0 |
test_object_message__message_prettify(void)
{
git_buf buffer;
memset(&buffer, 0, sizeof(buffer));
cl_git_pass(git_message_prettify(&buffer, "", 0, '#'));
cl_assert_equal_s(buffer.ptr, "");
git_buf_free(&buffer);
cl_git_pass(git_message_prettify(&buffer, "", 1, '#'));
cl_assert_equal_s(buffer.ptr, "");
git_buf_... | false | false | false | false | false | 0 |
dump_tsinfo(const struct ethtool_ts_info *info)
{
int i;
fprintf(stdout, "Capabilities:\n");
for (i = 0; i < N_SOTS; i++) {
if (info->so_timestamping & (1 << i))
fprintf(stdout, "\t%s\n", so_timestamping_labels[i]);
}
fprintf(stdout, "PTP Hardware Clock: ");
if (info->phc_index < 0)
fprintf(stdout, "no... | false | false | false | false | false | 0 |
CreateBandwidthElem(const buzz::QName& name, int bps) {
int kbps = bps / 1000;
buzz::XmlElement* elem = new buzz::XmlElement(name);
elem->AddAttr(buzz::QN_TYPE, "AS");
SetXmlBody(elem, kbps);
return elem;
} | false | false | false | false | false | 0 |
fmaxf(float x, float y)
{
union IEEEf2bits u[2];
u[0].f = x;
u[1].f = y;
/* Check for NaNs to avoid raising spurious exceptions. */
if (u[0].bits.exp == 255 && u[0].bits.man != 0)
return (y);
if (u[1].bits.exp == 255 && u[1].bits.man != 0)
return (x);
/* Handle comparisons of signed zeroes. */
if (u[0].b... | false | false | false | false | false | 0 |
PHIsEqualValue(PHINode *PN, Value *NonPhiInVal,
SmallPtrSetImpl<PHINode*> &ValueEqualPHIs) {
// See if we already saw this PHI node.
if (!ValueEqualPHIs.insert(PN).second)
return true;
// Don't scan crazily complex things.
if (ValueEqualPHIs.size() == 16)
return false;
// ... | false | false | false | false | false | 0 |
cpia2_mmap(struct file *file, struct vm_area_struct *area)
{
struct camera_data *cam = video_drvdata(file);
int retval;
if (mutex_lock_interruptible(&cam->v4l2_lock))
return -ERESTARTSYS;
retval = cpia2_remap_buffer(cam, area);
if(!retval)
cam->stream_fh = file->private_data;
mutex_unlock(&cam->v4l2_lock);
... | false | false | false | false | false | 0 |
get_ipaddress_port(const char *arg, char *ip, char *port)
{
regex_t regex;
size_t num_regex_groups;
regmatch_t *groups;
if(!regcomp(®ex, "(.*):(.*)", REG_EXTENDED|REG_ICASE))
{
num_regex_groups = regex.re_nsub + 1;
groups =
(regmatch_t*)malloc(sizeof(regmatch_t) * nu... | false | false | false | false | false | 0 |
update_pmkid(struct usbnet *usbdev,
struct ndis_80211_pmkid *pmkids,
struct cfg80211_pmksa *pmksa,
int max_pmkids)
{
struct ndis_80211_pmkid *new_pmkids;
int i, err, newlen;
unsigned int count;
count = le32_to_cpu(pmkids->bssid_info_count);
if (count > max_pmkids)
count = max_pmkids;
/* upd... | false | false | false | false | false | 0 |
clearWidgetry() {
delete expander;
expander = 0;
delete label;
label = 0;
foreach (InternalNode * child, children)
child->clearWidgetry();
}
} | 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.