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 |
|---|---|---|---|---|---|---|
clear(bool allImages )
{
if ( !initialized )
return;
overviewMapImage.Fill( Surface::transparent );
if ( allImages ) {
if ( completedMapImage.valid() )
completedMapImage.Fill( Surface::transparent );
secondMapReady = false;
}
startUpdate();
} | false | false | false | false | false | 0 |
elf_load ( struct image *image, physaddr_t *entry ) {
Elf_Ehdr ehdr;
Elf_Phdr phdr;
Elf_Off phoff;
unsigned int phnum;
int rc;
/* Read ELF header */
copy_from_user ( &ehdr, image->data, 0, sizeof ( ehdr ) );
if ( memcmp ( &ehdr.e_ident[EI_MAG0], ELFMAG, SELFMAG ) != 0 ) {
DBGC ( image, "ELF %p has invalid si... | false | false | false | false | false | 0 |
pcnet32_dwio_read_csr ( unsigned long addr, int index )
{
outl ( index, addr + PCNET32_DWIO_RAP );
return ( inl ( addr + PCNET32_DWIO_RDP ) & 0xffff );
} | false | false | false | false | false | 0 |
emit_bt (LogBuffer *logbuffer, FrameData *data)
{
/* FIXME: this is actually tons of data and we should
* just output it the first time and use an id the next
*/
if (data->count > num_frames)
printf ("bad num frames: %d\n", data->count);
emit_value (logbuffer, 0); /* flags */
emit_value (logbuffer, data->coun... | false | false | false | false | false | 0 |
validate_switches (const char *start)
{
const char *p = start;
const char *atom;
size_t len;
int i;
bool suffix = false;
bool starred = false;
#define SKIP_WHITE() do { while (*p == ' ' || *p == '\t') p++; } while (0)
next_member:
SKIP_WHITE ();
if (*p == '!')
p++;
SKIP_WHITE ();
if (*p == '... | false | false | false | false | false | 0 |
server3_3_opendir (rpcsvc_request_t *req)
{
server_state_t *state = NULL;
call_frame_t *frame = NULL;
gfs3_opendir_req args = {{0,},};
int ret = -1;
int op_errno = 0;
if... | false | false | false | false | false | 0 |
_midgard_connection_set_property (GObject *object, guint property_id,
const GValue *value, GParamSpec *pspec) {
MidgardConnection *self = (MidgardConnection *) object;
switch (property_id) {
case PROPERTY_CONFIG:
/* Read only */
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object,property_id,... | false | false | false | false | false | 0 |
lists_equal (GList *a,
GList *b)
{
GList *a_iter;
GList *b_iter;
a_iter = a;
b_iter = b;
while (a_iter && b_iter)
{
if (a_iter->data != b_iter->data)
return FALSE;
a_iter = a_iter->next;
b_iter = b_iter->next;
}
if (a_iter || b_iter)
return FALSE;... | false | false | false | false | false | 0 |
inspect_int(int level, int optname, VALUE data, VALUE ret)
{
if (RSTRING_LEN(data) == sizeof(int)) {
int i;
memcpy((char*)&i, RSTRING_PTR(data), sizeof(int));
rb_str_catf(ret, " %d", i);
return 1;
}
else {
return 0;
}
} | false | false | false | false | false | 0 |
marloss(game *g, player *p, item *it, bool t)
{
if (p->is_npc())
return;
// If we have the marloss in our veins, we are a "breeder" and will spread
// alien lifeforms.
if (p->has_trait(PF_MARLOSS)) {
g->add_msg("As you eat the berry, you have a near-religious experience, feeling at one with your surroundings...")... | false | false | false | false | false | 0 |
_self_heal_entry (xlator_t *this, afr_crawl_data_t *crawl_data, gf_dirent_t *entry,
loc_t *child, loc_t *parent, struct iatt *iattr)
{
struct iatt parentbuf = {0};
int ret = 0;
dict_t *xattr_rsp = NULL;
gf_log (this->name, GF_LOG_DEBUG, "loo... | false | false | false | false | false | 0 |
js_PopStatement(JSTreeContext *tc)
{
JSStmtInfo *stmt;
stmt = tc->topStmt;
tc->topStmt = stmt->down;
if (STMT_LINKS_SCOPE(stmt)) {
tc->topScopeStmt = stmt->downScope;
if (stmt->flags & SIF_SCOPE) {
tc->blockChain = STOBJ_GET_PARENT(stmt->blockObj);
JS_SCOPE_DEPTH... | false | false | false | false | false | 0 |
log_curve (curve_type curve, at_bool print_t)
{
unsigned this_point;
if (!log_file) return;
LOG1 ("curve id = %lx:\n", (unsigned long) curve);
LOG1 (" length = %u.\n", CURVE_LENGTH (curve));
if (CURVE_CYCLIC (curve))
LOG (" cyclic.\n");
/* It should suffice to check just one of the tangents for bei... | false | false | false | false | false | 0 |
printsense(SynsetPtr synptr, int sense)
{
char tbuf[256];
/* Append lexicographer filename after Sense # if flag is set. */
if (fnflag)
sprintf(tbuf,"\nSense %d in file \"%s\"\n",
sense, lexfiles[synptr->fnum]);
else
sprintf(tbuf,"\nSense %d\n", sense);
printbuffer(tbuf);
/* update count... | true | true | false | false | false | 1 |
ProcessGraphSyncMaster()
{
// fBeginDateUst is set in the "low level" layer, fEndDateUst is from previous cycle
if (fEngine->Process(fBeginDateUst, fEndDateUst)) {
if (ResumeRefNum() < 0) {
jack_error("JackAudioDriver::ProcessGraphSyncMaster: ResumeRefNum error");
}
if (Pro... | false | false | false | false | false | 0 |
twl_initconnection(TW_Device_Extension *tw_dev, int message_credits,
u32 set_features, unsigned short current_fw_srl,
unsigned short current_fw_arch_id,
unsigned short current_fw_branch,
unsigned short current_fw_build,
unsigned short *fw_on_ctlr_srl,
unsigned... | false | false | false | false | false | 0 |
gst_rtp_base_audio_payload_set_sample_based (GstRTPBaseAudioPayload *
rtpbaseaudiopayload)
{
g_return_if_fail (rtpbaseaudiopayload != NULL);
g_return_if_fail (rtpbaseaudiopayload->priv->time_to_bytes == NULL);
g_return_if_fail (rtpbaseaudiopayload->priv->bytes_to_time == NULL);
g_return_if_fail (rtpbaseaudi... | false | false | false | false | false | 0 |
is_secure_file_path(char *path)
{
char buff1[FN_REFLEN], buff2[FN_REFLEN];
size_t opt_secure_file_priv_len;
/*
All paths are secure if opt_secure_file_path is 0
*/
if (!opt_secure_file_priv)
return TRUE;
opt_secure_file_priv_len= strlen(opt_secure_file_priv);
if (strlen(path) >= FN_REFLEN)
r... | false | false | false | false | false | 0 |
mfile_name_concat (char const *dir, char const *abase, char **base_in_result)
{
char const *dirbase = last_component (dir);
size_t dirbaselen = base_len (dirbase);
size_t dirlen = dirbase - dir + dirbaselen;
size_t needs_separator = (dirbaselen && ! ISSLASH (dirbase[dirbaselen - 1]));
char const *base = long... | false | false | false | false | false | 0 |
_SSL_check_server_cert(SSL *ssl, const char *hostname)
{
X509 *cert;
X509_NAME *subject;
const GENERAL_NAME *altname;
STACK_OF(GENERAL_NAME) *altnames;
ASN1_STRING *tmp;
int i, n, match = -1;
const char *p;
if (SSL_get_verify_mode(ssl) == SSL_VERI... | false | false | false | false | false | 0 |
store(longlong nr, bool unsigned_val)
{
ASSERT_COLUMN_MARKED_FOR_WRITE;
int error= 0;
int32 res;
if (unsigned_flag)
{
if (nr < 0 && !unsigned_val)
{
res=0;
error= 1;
}
else if ((ulonglong) nr >= (LL(1) << 32))
{
res=(int32) (uint32) ~0L;
error= 1;
}
else
... | false | false | false | false | false | 0 |
advance_by_rule_name(const char *name)
{
const char *qname = Qn_(name);
advance_iterate(A_NONE, padvance) {
if (0 == fc_strcasecmp(advance_rule_name(padvance), qname)) {
return padvance;
}
} advance_iterate_end;
return NULL;
} | false | false | false | false | false | 0 |
matrix_yuv_bt470_6_to_yuv_bt709 (ColorspaceConvert * convert)
{
int i;
int r, g, b;
int y, u, v;
guint8 *tmpline = convert->tmpline;
for (i = 0; i < convert->width; i++) {
y = tmpline[i * 4 + 1];
u = tmpline[i * 4 + 2];
v = tmpline[i * 4 + 3];
r = (256 * y - 30 * u - 53 * v + 10600) >> 8;
... | false | false | false | false | false | 0 |
LookupOperandIndex(int occurrence_index, HValue* op) {
for (int i = 0; i < OperandCount(); ++i) {
if (OperandAt(i) == op) {
if (occurrence_index == 0) return i;
--occurrence_index;
}
}
return -1;
} | false | false | false | false | false | 0 |
snd_emu10k1_pcm_mixer_notify1(struct snd_emu10k1 *emu, struct snd_kcontrol *kctl, int idx, int activate)
{
struct snd_ctl_elem_id id;
if (! kctl)
return;
if (activate)
kctl->vd[idx].access &= ~SNDRV_CTL_ELEM_ACCESS_INACTIVE;
else
kctl->vd[idx].access |= SNDRV_CTL_ELEM_ACCESS_INACTIVE;
snd_ctl_notify(emu->ca... | false | false | false | false | false | 0 |
fso_data_mbpi_access_point_finalize (FsoDataMBPIAccessPoint* obj) {
FsoDataMBPIAccessPoint * self;
self = G_TYPE_CHECK_INSTANCE_CAST (obj, FSO_DATA_MBPI_TYPE_ACCESS_POINT, FsoDataMBPIAccessPoint);
_g_free0 (self->description);
_g_free0 (self->name);
_g_free0 (self->user);
_g_free0 (self->password);
_g_object_unr... | false | false | false | false | false | 0 |
ShowStatusbarSlot()
{
mSettings->mShowStatusBar = mActShowStatusbar->isChecked();
if (!mActShowStatusbar->isChecked())
{
statusBar()->hide();
}
else
{
statusBar()->show();
}
Scale();
} | false | false | false | false | false | 0 |
print()
{
int i;
printf("**********************\n");
printf("GRUPPENTABELLE:\n");
for (i=0; i< length_of_group_tabs; i++)
printf("%d %d \n", i, group_tab[i]);
printf("NON_GRUPPENTABELLE:\n");
for (i=0; i< length_of_group_tabs; i++)
printf("%d %d\n", i, non_group_tab[i]);
... | false | false | false | false | false | 0 |
make_random_salt(krb5_context context, krb5_keysalt *salt_out)
{
krb5_error_code retval;
unsigned char rndbuf[8];
krb5_data salt, rnd = make_data(rndbuf, sizeof(rndbuf));
unsigned int i;
/*
* Salts are limited by RFC 4120 to 7-bit ASCII. For ease of examination
* and to avoid certain fol... | true | true | false | false | false | 1 |
SaveHistory(const string& name)
{
int icount = 0;
Lock histLock(histMutex);
if (pHead == NULL)
return icount;
ofstream hf(name.c_str()); // Open the output file
if (hf.good()) { //if no open errors go ahead and write data
aprsString *hp = pHead;
for (;;) {
... | false | false | false | false | false | 0 |
ibus_bus_get_name_owner_async_finish (IBusBus *bus,
GAsyncResult *res,
GError **error)
{
g_assert (IBUS_IS_BUS (bus));
g_assert (g_simple_async_result_is_valid (res, (GObject *) bus,
... | false | false | false | false | false | 0 |
ibus_bus_unwatch_dbus_signal (IBusBus *bus)
{
g_return_if_fail (bus->priv->watch_dbus_signal_id != 0);
g_dbus_connection_signal_unsubscribe (bus->priv->connection,
bus->priv->watch_dbus_signal_id);
bus->priv->watch_dbus_signal_id = 0;
} | false | false | false | false | false | 0 |
print (string cmd) {
int errors = aikido->numErrors ;
Value v = exec (cmd) ;
if (aikido->numErrors == errors) {
std::cout << cmd << " = " ;
void (*oldint)(int) = signal (SIGINT, localinterrupt) ;
printValue (std::cout, v) ;
std::cout << '\n';
localinterrupted = false... | false | false | false | false | false | 0 |
display_char(char key){
BYTE character = 0;
switch(key){
case ' ':
character = 0x00;
break;
case '-':
character = 0x40;
break;
case '=':
character = 0x48;
break;
case '.':
character = 0x80;
break;
case '?':
character = 0x83;
break;
... | false | false | false | false | false | 0 |
headerData( int section, Qt::Orientation, int role ) const
{
if ( role != Qt::DisplayRole )
return QVariant();
switch ( section ) {
case 0:
return tr( "Type" );
break;
case 1:
return tr( "Name" );
break;
case 2:
return tr( "Email" );
break;
case 3:
retu... | false | false | false | false | false | 0 |
spi_event_is_subtype (gchar **needle, gchar **haystack)
{
while (*haystack && **haystack)
{
if (g_strcmp0 (*needle, *haystack))
return FALSE;
needle++;
haystack++;
}
return TRUE;
} | false | false | false | false | false | 0 |
chipmem_agnus_bput (uaecptr addr, uae_u32 b)
{
#ifdef FSUAE
#ifdef DEBUG_MEM
printf("chipmem_agnus_bput %08x %08x\n", addr, b);
#endif
#endif
addr &= chipmem_full_mask;
if (addr >= chipmem_full_size)
return;
chipmemory[addr] = b;
} | false | false | false | false | false | 0 |
netsnmp_get_stash_cache_handler(void)
{
netsnmp_mib_handler *handler = netsnmp_get_bare_stash_cache_handler();
if (handler && handler->next) {
handler->next->next = netsnmp_get_stash_to_next_handler();
}
return handler;
} | false | false | false | false | false | 0 |
parse_xml_groups_element_end(void *data, const char *element)
{
char *el;
Groups **gp;
Parse_xml_groups_state *state;
if (parse_xmlns_name(element, NULL, &el) == -1) {
parse_xml_set_error(ds_xprintf("Invalid namespace: %s", element));
return;
}
gp = (Groups **) data;
if (parse_xml_is_error(NULL))
re... | false | false | false | false | false | 0 |
__HpingRecvCmd(ClientData clientData, Tcl_Interp *interp,
int objc, Tcl_Obj *CONST objv[], int rapd, int hexdata)
{
Tcl_Obj *result;
struct recv_handler *ra;
char *ifname;
int timeout = -1; /* specified in ms */
int maxpackets = 1;
if (objc != 3 && objc != 4 && objc != 5) {
Tcl_WrongNumArgs(interp, 2, objv, ... | false | false | false | false | false | 0 |
ipoe_drop_sessions(struct ipoe_serv *serv, struct ipoe_session *skip)
{
struct ipoe_session *ses;
list_for_each_entry(ses, &serv->sessions, entry) {
if (ses == skip)
continue;
ses->terminating = 1;
if (ses->ifcfg) {
ipoe_ifcfg_del(ses, 0);
ses->ifcfg = 0;
}
if (ses->ses.state == AP_STATE_ACTIVE)... | false | false | false | false | false | 0 |
gf_bifs_dec_node_list(GF_BifsDecoder * codec, GF_BitStream *bs, GF_Node *node, Bool is_proto)
{
u8 flag;
GF_Err e;
u32 numBitsALL, numBitsDEF, field_all, field_ref, numProtoBits;
GF_FieldInfo field;
e = GF_OK;
numProtoBits = numBitsALL = 0;
if (codec->pCurrentProto) {
numProtoBits = gf_get_bit_size(gf_sg_pro... | false | false | false | false | false | 0 |
glade_project_init (GladeProject *project)
{
GladeProjectPrivate *priv;
GList *list;
project->priv = priv =
G_TYPE_INSTANCE_GET_PRIVATE ((project), GLADE_TYPE_PROJECT,
GladeProjectPrivate);
priv->path = NULL;
priv->model = GTK_TREE_MODEL (gtk_tree_store_new (1, G_TYP... | false | false | false | false | false | 0 |
acc_handle_hiconn(handle obj)
{
if (pli_trace) {
fprintf(pli_trace, "acc_handle_hiconn: enter.\n");
fflush(pli_trace);
}
fprintf(stderr, "acc_handle_hiconn: XXXX not implemented. XXXX\n");
if (pli_trace) {
fprintf(pli_trace, "acc_handle_hiconn: return.\n");
fflush(pli_trace... | false | false | false | false | false | 0 |
ch_markdown_strstr_spaces (const gchar *haystack, const gchar *needle)
{
gchar *found;
const gchar *haystack_new = haystack;
retry:
/* don't find if surrounded by spaces */
found = strstr (haystack_new, needle);
if (found == NULL)
return NULL;
/* start of the string, always valid */
if (found == haystack)
... | false | false | false | false | false | 0 |
krb5_fwd_tgt_creds (krb5_context context,
krb5_auth_context auth_context,
const char *hostname,
krb5_principal client,
krb5_principal server,
krb5_ccache ccache,
int forwardable,
krb5_data *out_data)
{
krb5_flags flags = 0;
krb5_creds creds;
krb5_error_code ret... | false | false | false | false | false | 0 |
finalizeSlicedFindPath(dtPolyRef* path, int* pathCount, const int maxPath)
{
*pathCount = 0;
if (dtStatusFailed(m_query.status))
{
// Reset query.
memset(&m_query, 0, sizeof(dtQueryData));
return DT_FAILURE;
}
int n = 0;
if (m_query.startRef == m_query.endRef)
{
// Special case: the search starts and... | false | false | false | false | false | 0 |
drbd_insert_interval(struct rb_root *root, struct drbd_interval *this)
{
struct rb_node **new = &root->rb_node, *parent = NULL;
sector_t this_end = this->sector + (this->size >> 9);
BUG_ON(!IS_ALIGNED(this->size, 512));
while (*new) {
struct drbd_interval *here =
rb_entry(*new, struct drbd_interval, rb);
... | false | false | false | false | false | 0 |
load_random_fish(gboolean smallish)
{
int fish;
const gchar **extraFish;
const gchar **surpriseFish;
int num_extra;
int num_surprise;
if (smallish) {
extraFish = smallFish;
num_extra = NUM_SMALLFISH;
surpriseFish = bigFish;
num_surprise = NUM_BIGFISH;
} else {
extraFish = bigFish;
... | false | false | false | false | false | 0 |
gst_ghost_pad_setcaps_default (GstPad * pad, GstCaps * caps)
{
g_return_val_if_fail (GST_IS_GHOST_PAD (pad), FALSE);
g_return_val_if_fail (caps == NULL || GST_IS_CAPS (caps), FALSE);
if (GST_PAD_DIRECTION (pad) == GST_PAD_SRC)
return TRUE;
return gst_proxy_pad_setcaps_default (pad, caps);
} | false | false | false | false | false | 0 |
hermes_bap_seek(struct hermes *hw, int bap, u16 id, u16 offset)
{
int sreg = bap ? HERMES_SELECT1 : HERMES_SELECT0;
int oreg = bap ? HERMES_OFFSET1 : HERMES_OFFSET0;
int k;
u16 reg;
/* Paranoia.. */
if ((offset > HERMES_BAP_OFFSET_MAX) || (offset % 2))
return -EINVAL;
k = HERMES_BAP_BUSY_TIMEOUT;
reg = herm... | false | false | false | false | false | 0 |
aclgroup_init ()
{
aclUserGroups = ( aclGroupCache * ) slapi_ch_calloc (1, sizeof ( aclGroupCache ) );
if ( NULL == (aclUserGroups->aclg_rwlock = slapi_new_rwlock())) {
slapi_log_error(SLAPI_LOG_FATAL, plugin_name, "Unable to allocate RWLOCK for group cache\n");
return 1;
}
return 0;
} | false | false | false | false | false | 0 |
mono_verifier_verify_class (MonoClass *class)
{
/*Neither <Module>, object or ifaces have parent.*/
if (!class->parent &&
class != mono_defaults.object_class &&
!MONO_CLASS_IS_INTERFACE (class) &&
(!class->image->dynamic && class->type_token != 0x2000001)) /*<Module> is the first type in the assembly*/
retur... | false | false | false | false | false | 0 |
backslash(int c) /* get next char with \'s interpreted */
{
static char transtab[] = "b\bf\fn\nr\rt\t";
if (c != '\\')
return c;
c = Bgetc(bin);
if (islower(c) && strchr(transtab, c))
return strchr(transtab, c)[1];
return c;
} | false | false | false | false | false | 0 |
net_add_dummy_tn3270e(void)
{
tn3270e_header *h;
if (!IN_E || tn3270e_submode == E_NONE)
return False;
space3270out(EH_SIZE);
h = (tn3270e_header *)obptr;
switch (tn3270e_submode) {
case E_NONE:
break;
case E_NVT:
h->data_type = TN3270E_DT_NVT_DATA;
break;
case E_SSCP:
h->data_type = TN3270E_DT_SSC... | false | false | false | false | false | 0 |
copy_Name(const Name *from, Name *to)
{
memset(to, 0, sizeof(*to));
{ int ret;
ret = der_copy_octet_string(&(from)->_save, &(to)->_save);
if (ret) goto fail;
}
(to)->element = (from)->element;
switch((from)->element) {
case choice_Name_rdnSequence:
if(copy_RDNSequence(&(from)->u.rdnSequence, &(to)->u.rdnSequence)) goto... | false | false | false | false | false | 0 |
is_same_dim_in_type_table (Array_table *dim1, Array_table *dim2)
{
int i;
if (dim1 == dim2) return TRUE;
if (dim1 == NULL || dim2 == NULL) return FALSE;
if (dim1->dim != dim2->dim) return FALSE;
for (i = 0; i < dim1->dim; i++) {
if (dim1->bas.ct != dim2->bas.ct) return FALSE;
if (di... | false | false | false | false | false | 0 |
f_43 (ats_ptr_type arg0, ats_int_type arg1) {
/* local vardec */
ATSlocal (ats_ptr_type, tmp158) ;
ATSlocal (ats_bool_type, tmp159) ;
// ATSlocal_void (tmp160) ;
// ATSlocal_void (tmp161) ;
// ATSlocal_void (tmp162) ;
// ATSlocal_void (tmp163) ;
__ats_lab_f_43:
tmp159 = atspre_eq_int_int (arg1, 0) ;
if (tmp159) {
tmp1... | false | false | false | false | false | 0 |
xmlParseXMLCatalogNodeList(xmlNodePtr cur, xmlCatalogPrefer prefer,
xmlCatalogEntryPtr parent, xmlCatalogEntryPtr cgroup) {
while (cur != NULL) {
if ((cur->ns != NULL) && (cur->ns->href != NULL) &&
(xmlStrEqual(cur->ns->href, XML_CATALOGS_NAMESPACE))) {
xml... | false | false | false | false | false | 0 |
call_stub_wipe_args_cbk (call_stub_t *stub)
{
if (stub->args_cbk.inode)
inode_unref (stub->args_cbk.inode);
GF_FREE ((char *)stub->args_cbk.buf);
GF_FREE (stub->args_cbk.vector);
if (stub->args_cbk.iobref)
iobref_unref (stub->args_cbk.iobref);
if (stub->args_cbk.fd)
fd_unref (stub->args_cbk.fd);
if (st... | false | false | false | false | false | 0 |
_mem_checkpad(struct memstamp *ms, char *file, int line) {
char *ptr;
ptr = (char *)ms + sizeof(struct memstamp);
if (strncmp(ptr, MEMPREBUFF, strlen(MEMPREBUFF))) {
char *data;
data = (char *)malloc(strlen(MEMPREBUFF) + 1);
strncpy(data, ptr, strlen(MEMPREBUFF));
data[strlen(MEMPREBUFF)] = 0;
... | false | true | false | false | false | 1 |
transformFromMsDos(const char* buffer)
{
quint16 time = (uchar)buffer[0] | ( (uchar)buffer[1] << 8 );
int h = time >> 11;
int m = ( time & 0x7ff ) >> 5;
int s = ( time & 0x1f ) * 2 ;
QTime qt(h, m, s);
quint16 date = (uchar)buffer[2] | ( (uchar)buffer[3] << 8 );
int y = ( date >> 9 ) + 1980... | false | false | false | false | false | 0 |
s5k5baf_configure_subdevs(struct s5k5baf *state,
struct i2c_client *c)
{
struct v4l2_subdev *sd;
int ret;
sd = &state->cis_sd;
v4l2_subdev_init(sd, &s5k5baf_cis_subdev_ops);
sd->owner = THIS_MODULE;
v4l2_set_subdevdata(sd, state);
snprintf(sd->name, sizeof(sd->name), "S5K5BAF-CIS %d-%04x",
i2c_adapt... | false | false | false | false | false | 0 |
removeButtonForTabContent(Window* wnd)
{
// get
TabButton* tb = static_cast<TabButton*>(
getTabButtonPane()->getChild(makeButtonName(wnd)));
// remove
TabButtonVector::iterator i;
for (i = d_tabButtonVector.begin (); i < d_tabButtonVector.end (); ++i)
if (*i == tb)
{
... | false | false | false | false | false | 0 |
handle_signal (int signo)
{
switch (signo)
{
#ifndef HAVE_W32_SYSTEM
case SIGHUP:
log_info ("SIGHUP received - "
"re-reading configuration and resetting cards\n");
/* reread_configuration (); */
break;
case SIGUSR1:
log_info ("SIGUSR1 received - printing internal i... | false | false | false | false | false | 0 |
GetExporter(FlowSource_t *fs, uint32_t exporter_id) {
#define IP_STRING_LEN 40
char ipstr[IP_STRING_LEN];
exporter_v9_domain_t **e = (exporter_v9_domain_t **)&(fs->exporter_data);
while ( *e ) {
if ( (*e)->info.id == exporter_id && (*e)->info.version == 9 &&
(*e)->info.ip.v6[0] == fs->ip.v6[0] && (*e)->info.... | false | false | false | false | false | 0 |
mpd_sendAddIdCommand(mpd_Connection *connection, const char *file)
{
int retval = -1;
char *sFile = mpd_sanitizeArg(file);
int len = strlen("addid") + 2 + strlen(sFile) + 3;
char *string = malloc(len);
snprintf(string, len, "addid \"%s\"\n", sFile);
mpd_sendInfoCommand(connection, string);
free(string);
free(s... | false | false | false | false | false | 0 |
getEnergy(vector<sRates>& mu, AlphaReal& alpha, vector<AlphaReal>& v)
{
const int numClasses = mu.size();
sRates eps;
// Get the overall error and correct rates
for (int l = 0; l < numClasses; ++l)
{
eps.rMin += mu[l].rMin;
eps.rPls += mu[l].rPls;
}
//if( eps.rMin < 0 ) eps.rMin = -eps.rMi... | false | false | false | false | false | 0 |
asDebugInfo(void) const
{
MSString result("MSSymbol(@");
result+=MSString((unsigned long)this).d2x().lowerCase();
result+=",_atom=";
result+=MSString(atom());
result+=")";
return result;
} | false | false | false | false | false | 0 |
elfboot_load ( struct image *image ) {
Elf32_Ehdr ehdr;
static const uint8_t e_ident[] = {
[EI_MAG0] = ELFMAG0,
[EI_MAG1] = ELFMAG1,
[EI_MAG2] = ELFMAG2,
[EI_MAG3] = ELFMAG3,
[EI_CLASS] = ELFCLASS32,
[EI_DATA] = ELFDATA2LSB,
[EI_VERSION] = EV_CURRENT,
};
int rc;
/* Read ELF header */
copy_from_user... | false | false | false | false | false | 0 |
iks_stack_strcat (ikstack *s, char *old, size_t old_len, const char *src, size_t src_len)
{
char *ret;
ikschunk *c;
if (!old) {
return iks_stack_strdup (s, src, src_len);
}
if (0 == old_len) old_len = strlen (old);
if (0 == src_len) src_len = strlen (src);
for (c = s->data; c; c = c->next) {
if (c->data + ... | false | false | false | false | false | 0 |
aggregate_conversion_cost (pVAUL_AmbgAggregate a, pIIR_Type t, IR_Kind k)
{
if(t) {
t = vaul_get_base (t);
k = t->kind();
}
#if 1
return tree_is(k, IR_COMPOSITE_TYPE)? 0 : -1;
#else // no need to be this clever.
int cost = 0;
for(pVAUL_ElemAssoc ea = a->first_assoc; ea; ea = ea->next)
for(nChoi... | false | false | false | false | false | 0 |
deemp_(real *x, integer *n, struct lpc10_decoder_state *st)
{
/* Initialized data */
real *dei1;
real *dei2;
real *deo1;
real *deo2;
real *deo3;
/* System generated locals */
integer i__1;
real r__1;
/* Local variables */
integer k;
real dei0;
/* Arguments */
/*... | false | false | false | true | false | 1 |
Xsimple(void)
{
word *a;
thread *p = runq;
var *v;
struct builtin *bp;
int pid;
globlist();
a = runq->argv->words;
if(a==0){
Xerror1("empty argument list");
return;
}
if(flag['x'])
pfmt(err, "%v\n", p->argv->words); /* wrong, should do redirs */
v = gvlook(a->word);
if(v->fn)
execfunc(v);
else{
i... | false | false | false | false | false | 0 |
lindna_ReadInput(AjPFile infile, float *Start, float *End)
{
AjPStr line;
line = ajStrNew();
while(ajReadlineTrim(infile, &line))
{
/* read the start and end positions */
if(ajStrPrefixC(line, "Start"))
sscanf(ajStrGetPtr(line), "%*s%f", Start);
if(ajStrPrefixC(line, "End"))
sscanf(ajStrGe... | false | false | false | false | false | 0 |
nvc0_bo_move_m2mf(struct nouveau_channel *chan, struct ttm_buffer_object *bo,
struct ttm_mem_reg *old_mem, struct ttm_mem_reg *new_mem)
{
struct nvkm_mem *node = old_mem->mm_node;
u64 src_offset = node->vma[0].offset;
u64 dst_offset = node->vma[1].offset;
u32 page_count = new_mem->num_pages;
int ret;
page_co... | false | false | false | false | false | 0 |
blk_register_tracepoints(void)
{
int ret;
ret = register_trace_block_rq_abort(blk_add_trace_rq_abort, NULL);
WARN_ON(ret);
ret = register_trace_block_rq_insert(blk_add_trace_rq_insert, NULL);
WARN_ON(ret);
ret = register_trace_block_rq_issue(blk_add_trace_rq_issue, NULL);
WARN_ON(ret);
ret = register_trace_blo... | false | false | false | false | false | 0 |
SwigPyPacked_repr(SwigPyPacked *v)
{
char result[SWIG_BUFFER_SIZE];
if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
return SWIG_Python_str_FromFormat("<Swig Packed at %s%s>", result, v->ty->name);
} else {
return SWIG_Python_str_FromFormat("<Swig Packed %s>", v->ty->name);
}
} | false | false | false | false | false | 0 |
WriteVarLen(unsigned long value) {
unsigned long buffer;
buffer = value & 0x7f;
while((value >>= 7) > 0) {
buffer <<= 8;
buffer |= 0x80;
buffer += (value & 0x7f);
}
while(1) {
eputc((unsigned)(buffer & 0xff));
if (buffer & 0x80)
buffer >>= 8;
else
return;
}
} | false | false | false | false | false | 0 |
mb_std_get_apostrophe(char *input)
{
char *t = input;
wchar_t wchr;
int i;
mbstate_t state; ZEROSET(&state, mbstate_t);
i = mb_next_char(&wchr, t, &state);
while (iswalpha(wchr) || wchr == L'\'') {
t += i;
i = mb_next_char(&wchr, t, &state);
}
return (int)(t - input);
} | false | false | false | false | false | 0 |
snd_mixer_selem_compare(const snd_mixer_elem_t *c1, const snd_mixer_elem_t *c2)
{
sm_selem_t *s1 = c1->private_data;
sm_selem_t *s2 = c2->private_data;
int res = strcmp(s1->id->name, s2->id->name);
if (res)
return res;
return s1->id->index - s2->id->index;
} | false | false | false | false | false | 0 |
convic(ftnint n)
#endif
{
static char s[20];
register char *t;
s[19] = '\0';
t = s+19;
do {
*--t = '0' + n%10;
n /= 10;
} while(n > 0);
return(t);
} | false | false | false | false | false | 0 |
dma_thread_create_new_register_list (CpuRegisters *self, gint thread)
{
DmaThreadRegisterList *regs;
GtkListStore *store;
if ((self->list != NULL)
&& (((DmaThreadRegisterList *)g_list_first (self->list)->data)->thread == 0))
{
/* List as been created but not associated to a thread */
regs = ((DmaThreadRe... | false | false | false | false | false | 0 |
xmlSecTransformCreate(xmlSecTransformId id) {
xmlSecTransformPtr transform;
int ret;
xmlSecAssert2(id != NULL, NULL);
xmlSecAssert2(id->klassSize >= sizeof(xmlSecTransformKlass), NULL);
xmlSecAssert2(id->objSize >= sizeof(xmlSecTransform), NULL);
xmlSecAssert2(id->name != NULL, NULL);
... | false | false | false | false | false | 0 |
pxenv_file_exit_hook ( struct s_PXENV_FILE_EXIT_HOOK
*file_exit_hook ) {
DBG ( "PXENV_FILE_EXIT_HOOK" );
/* Check to see if we have a PXE exit hook */
if ( pxe_exit_hook.segment | pxe_exit_hook.offset ) {
/* We'll jump to the specified SEG16:OFF16 during exit */
pxe_exit_hook.segment = file_exit_hook->Hook... | false | false | false | false | false | 0 |
recent_backend_read (GVfsBackend *vfs_backend,
GVfsJobRead *job,
GVfsBackendHandle handle,
char *buffer,
gsize bytes_requested)
{
GError *error = NULL;
gssize bytes;
bytes = g_input_stream_r... | false | false | false | false | false | 0 |
replaceback(node **oldback, node *item, node *forknode,
node **grbg, long *zeros)
{ /* replaces back node of item with another */
node *p;
p = forknode;
while (p->next->back != item)
p = p->next;
*oldback = p->next;
gnutreenode(grbg, &p->next, forknode->index, endsite, zeros);
p... | false | false | false | false | false | 0 |
kvm_ioapic_send_eoi(struct kvm_lapic *apic, int vector)
{
int trigger_mode;
/* Eoi the ioapic only if the ioapic doesn't own the vector. */
if (!kvm_ioapic_handles_vector(apic, vector))
return;
/* Request a KVM exit to inform the userspace IOAPIC. */
if (irqchip_split(apic->vcpu->kvm)) {
apic->vcpu->arch.pen... | false | false | false | false | false | 0 |
wonky_pointer(explain_string_buffer_t *sb, char *const *array,
const char *array_caption)
{
int n;
/* This isn't quite right */
if (explain_is_efault_pointer(array, sizeof(*array)))
{
explain_buffer_efault(sb, array_caption);
return 0;
}
for (n = 0; array[n]; ++n... | false | false | false | false | false | 0 |
ecp_group_load( ecp_group *grp,
const t_uint *p, size_t plen,
const t_uint *a, size_t alen,
const t_uint *b, size_t blen,
const t_uint *gx, size_t gxlen,
const t_uint *gy, size_t gyl... | false | false | false | false | false | 0 |
evaluatePDF(
const CPoint3D &x,
bool sumOverAllZs ) const
{
if (!sumOverAllZs)
{
// Normal evaluation:
CMatrixDouble31 X = CMatrixDouble31(x);
double ret = 0;
CMatrixDouble31 MU;
for (CListGaussianModes::const_iterator it=m_modes.begin();it!=m_modes.end();++it)
{
MU = CMatrixDouble31(it->val.mean);... | false | false | false | false | false | 0 |
check_type_compatible(Type *type, Exp **right, int line) {
if((type->dimensions != (*right)->type->dimensions)){
print_error("expression is of an incompatible type", line);
}
else if ((*right)->type->type == TK_TVOID){
print_error("expression cannot be of type void", line);
}
else {
sw... | false | false | false | false | false | 0 |
_mesa_set_varying_vp_inputs( struct gl_context *ctx,
GLbitfield64 varying_inputs )
{
if (ctx->varying_vp_inputs != varying_inputs) {
ctx->varying_vp_inputs = varying_inputs;
/* Only the fixed-func generated programs need to use the flag
* and the fixed-func fragment p... | false | false | false | false | false | 0 |
log_event_stamp(Log_desc *logd, Log_level level, void *arg)
{
Ds ds;
if (logd != NULL) {
ds_init(&ds);
ds_asprintf(&ds, "[%s:\"%s\", %s:%d:%s]",
logd->event.program ? logd->event.program : "?",
logd->event.module ? logd->event.module : "?",
logd->event.filename ? logd->event.filename : "?",
logd-... | false | false | false | false | false | 0 |
ec_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg i2c_msgs[],
int num)
{
struct ec_i2c_device *bus = adap->algo_data;
struct device *dev = bus->dev;
const u16 bus_num = bus->remote_bus;
int request_len;
int response_len;
int alloc_size;
int result;
struct cros_ec_command *msg;
request_len = ec_i2c... | false | false | false | false | false | 0 |
initProc() {
//Typecast to the correct couplings
coupSUSYPtr = (CoupSUSY*) couplingsPtr;
// Construct name of process.
nameSave = "q qbar' -> " + particleDataPtr->name(id3) + " "
+ particleDataPtr->name(id4);
// Secondary open width fraction.
openFracPair = particleDataPtr->resOpenFrac(id3, id4);
... | false | false | false | false | false | 0 |
idea_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
const unsigned char *in, size_t inl)
{
BLOCK_CIPHER_ecb_loop()
idea_ecb_encrypt(in + i, out + i, ctx->cipher_data);
return 1;
} | false | false | false | false | false | 0 |
vlistInqVarEnsemble( int vlistID, int varID, int *ensID, int *ensCount, int *forecast_type )
{
vlist_t *vlistptr;
int status = 0;
vlistptr = vlist_to_pointer(vlistID);
vlistCheckVarID(__func__, vlistID, varID);
if ( vlistptr->vars[varID].ensdata )
{
*ensID = vlistptr->vars[varID].ensdata->ens_ind... | false | false | false | false | false | 0 |
maki_dcc_send_free (makiDCCSend* dcc)
{
if (dcc->status & s_incoming)
{
guint i;
for (i = 0; i < s_in_num; i++)
{
if (dcc->d.in.sources[i] != 0)
{
g_source_remove(dcc->d.in.sources[i]);
}
}
}
else
{
guint i;
for (i = 0; i < s_out_num; i++)
{
if (dcc->d.out.sources[i] != 0)
{
... | false | false | false | false | false | 0 |
validCodeAddress(Address *Addr)
{
Location *a = getLocationByAddress(Addr);
if (a) {
if ((a->type.type != dt_code) && (a->type.type != dt_unknown)) return false;
}
return validAddress(Addr, sccode);
} | 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.