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 |
|---|---|---|---|---|---|---|
pkix_pl_HttpCertStore_DecodeCertPackage
(const char *certbuf,
int certlen,
CERTImportCertificateFunc f,
void *arg,
void *plContext)
{
PRStatus status;
SECStatus rv;
PKIX_ENTER
(HTTPCERTSTORECONTEXT,
"pkix_pl_HttpCertSto... | false | false | false | false | false | 0 |
keyctl_setperm_key(key_serial_t id, key_perm_t perm)
{
struct key *key;
key_ref_t key_ref;
long ret;
ret = -EINVAL;
if (perm & ~(KEY_POS_ALL | KEY_USR_ALL | KEY_GRP_ALL | KEY_OTH_ALL))
goto error;
key_ref = lookup_user_key(id, KEY_LOOKUP_CREATE | KEY_LOOKUP_PARTIAL,
KEY_NEED_SETATTR);
if (IS_ERR(key_re... | false | false | false | false | false | 0 |
compression_algorithm_by_name(const char *s)
{
size_t len = strlen(s);
if (len)
{
for (table_t *tp = table; tp < ENDOF(table); ++tp)
{
//
// No need to worry about length of tp->name; if is longer,
// only compare leading prefix (unique, so far); if it is
// shorte... | false | false | false | false | false | 0 |
qty_sugg_compare (q1, q2)
int q1, q2;
{
int tem = QTY_CMP_SUGG (q1) - QTY_CMP_SUGG (q2);
if (tem != 0)
return tem;
return QTY_CMP_PRI (q2) - QTY_CMP_PRI (q1);
} | false | false | false | false | false | 0 |
xstrmatch (pattern, string, flags)
char *pattern;
char *string;
int flags;
{
#if HANDLE_MULTIBYTE
int ret;
size_t n;
wchar_t *wpattern, *wstring;
if (MB_CUR_MAX == 1)
return (internal_strmatch ((unsigned char *)pattern, (unsigned char *)string, flags));
n = xdupmbstowcs (&wpattern, NULL, ... | false | false | false | false | false | 0 |
type_rename_structunionenum(
struct type *t,
enum type_type type,
const char *old,
const char *new
)
{
switch (t->type) {
case TYPE_POINTER:
case TYPE_ARRAY:
case TYPE_FUNCTION:
type_rename_structunionenum(t->declarator, type, old, new);
break;
default:
if (t->type == type
&& strcmp(t->identifier, old... | false | false | false | false | false | 0 |
fetch_ptr(void)
{
struct joborptr *result;
lockxbuf();
if (Xfer_shmp->xf_nonq == 0)
report(8118); /* {No messages on queue} */
result = &Xfer_shmp->xf_queue[Xfer_shmp->xf_head];
Xfer_shmp->xf_head = (Xfer_shmp->xf_head + 1) % (TRANSBUF_NUM + 1);
Xfer_shmp->xf_nonq--;
#ifdef USING_MMAP
msync((char *) Xfer_shm... | false | false | false | false | false | 0 |
SHA1Input( SHA1Context *context,
const void *data,
size_t length)
{
const unsigned char *message_array = data;
if (!length)
{
return shaSuccess;
}
if (!context || !message_array)
{
return shaNull;
}
if (context->Computed... | false | false | false | false | false | 0 |
cmdline_parser2 (int argc, char * const *argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
{
int result;
result = cmdline_parser_internal (argc, argv, args_info, override, initialize, check_required, NULL);
if (result == EXIT_FAILURE)
{
cmdline_parser_free ... | false | false | false | false | false | 0 |
ShouldCompressMemCheckOutput()
{
if(!this->ComputedCompressMemCheckOutput)
{
std::string cdashVersion = this->GetCDashVersion();
bool compressionSupported = cmSystemTools::VersionCompare(
cmSystemTools::OP_GREATER, cdashVersion.c_str(), "1.9.0");
this->CompressMemCheckOutput &= compressionSuppo... | false | false | false | false | false | 0 |
ep93xx_spi_enable(const struct ep93xx_spi *espi)
{
u8 regval;
int err;
err = clk_enable(espi->clk);
if (err)
return err;
regval = ep93xx_spi_read_u8(espi, SSPCR1);
regval |= SSPCR1_SSE;
ep93xx_spi_write_u8(espi, SSPCR1, regval);
return 0;
} | false | false | false | false | false | 0 |
__get_parameters_collector(MidgardObject *object,
const gchar *domain)
{
if(!object->priv->_params) {
object->priv->_params = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL);
g_hash_table_insert(object->priv->_params, (gpointer) g_strdup(domain), NULL);
return NULL;
}
return g_hash_table_loo... | false | false | false | false | false | 0 |
mptctl_init(void)
{
int err;
int where = 1;
show_mptmod_ver(my_NAME, my_VERSION);
mpt_device_driver_register(&mptctl_driver, MPTCTL_DRIVER);
/* Register this device */
err = misc_register(&mptctl_miscdev);
if (err < 0) {
printk(KERN_ERR MYNAM ": Can't register misc device [minor=%d].\n", MPT_MINOR);
goto ... | false | false | false | false | false | 0 |
e_maximize_border_shelf_fill(E_Border *bd, int *x1, int *yy1, int *x2, int *y2, E_Maximize dir)
{
Eina_List *l, *rects = NULL;
E_Shelf *es;
E_Maximize_Rect *r;
EINA_LIST_FOREACH(e_shelf_list(), l, es)
{
Eina_List *ll;
E_Config_Shelf_Desk *sd;
if (es->cfg->overlap) continue;
if (es->zone != bd->zo... | false | false | false | false | false | 0 |
dconf_dir_view_construct (GType object_type) {
DConfDirView * self = NULL;
GtkCellRendererText* _tmp0_;
GtkCellRendererText* _tmp1_;
self = (DConfDirView*) g_object_new (object_type, NULL);
gtk_tree_view_set_headers_visible ((GtkTreeView*) self, FALSE);
_tmp0_ = (GtkCellRendererText*) gtk_cell_renderer_text_new (... | false | false | false | false | false | 0 |
paste(at, after, retend)
MARK at; /* where to insert the text */
int after; /* boolean: insert after mark? (rather than before) */
int retend; /* boolean: return end of text? (rather than start) */
{
REG struct cutbuf *cb;
REG int i;
/* decide which cut buffer to use */
if (cbname >= 'A' && cbname <= 'Z')
{
... | false | false | false | false | false | 0 |
_lookup(const xstring& key)
{
int hash=make_hash(key);
entry **ep=&map[hash];
entry *e=*ep;
while(e) {
if(e->key.eq(key))
return ep;
ep=&e->next;
e=*ep;
}
return ep;
} | false | false | false | false | false | 0 |
ContinueSSL() {
LOG(LS_INFO) << "ContinueSSL";
ASSERT(state_ == SSL_CONNECTING);
int code = SSL_connect(ssl_);
switch (SSL_get_error(ssl_, code)) {
case SSL_ERROR_NONE:
LOG(LS_INFO) << " -- success";
if (!SSLPostConnectionCheck(ssl_, ssl_host_name_.c_str())) {
LOG(LS_ERROR) << "TLS post connec... | false | false | false | false | false | 0 |
RecalcProxyTweaks(void)
{
ProxyWindow *proxy;
for (proxy=firstProxy; proxy != NULL; proxy=proxy->next)
{
proxy->tweakx=proxy->proxyx -
(proxy->x + (proxy->w-proxy->proxyw)/2);
proxy->tweaky=proxy->proxyy -
(proxy->y + (proxy->h-proxy->proxyh)/2);
}
} | false | false | false | false | false | 0 |
mlx4_en_tx_timeout(struct net_device *dev)
{
struct mlx4_en_priv *priv = netdev_priv(dev);
struct mlx4_en_dev *mdev = priv->mdev;
int i;
if (netif_msg_timer(priv))
en_warn(priv, "Tx timeout called on port:%d\n", priv->port);
for (i = 0; i < priv->tx_ring_num; i++) {
if (!netif_tx_queue_stopped(netdev_get_tx_... | false | true | false | false | false | 1 |
migrateDot (int rowDiff, int colDiff, int step, Player player)
{
migrating = 2;
qreal scale = (step < 4) ? 1.0 - 0.3 * step : 0.0;
m_rowDiff = rowDiff * scale; // Calculate relative position of dot.
m_colDiff = colDiff * scale;
// If owner changes, fade in new color as dot approaches centre of cube.
... | false | false | false | false | false | 0 |
pixDilate(PIX *pixd,
PIX *pixs,
SEL *sel)
{
l_int32 i, j, w, h, sx, sy, cx, cy, seldata;
PIX *pixt;
PROCNAME("pixDilate");
if ((pixd = processMorphArgs1(pixd, pixs, sel, &pixt)) == NULL)
return (PIX *)ERROR_PTR("processMorphArgs1 failed", procName, pixd);
pixGetDimensi... | false | false | false | false | false | 0 |
xmalloc(size_t size) {
void *p = malloc(size);
if (p == NULL && size != 0)
die("%s: error allocating %lu bytes: %s\n",
prog_name, (unsigned long)size, strerror(errno));
return p;
} | false | false | false | false | false | 0 |
gsm_L_asl P2((a,n), longword a, int n)
{
if (n >= 32) return 0;
if (n <= -32) return -(a < 0);
if (n < 0) return gsm_asr(a, -n);
return a << n;
} | false | false | false | false | false | 0 |
voc_read_oops(voccxdef *ctx, char *oopsbuf, size_t oopsbuflen,
const char *unknown_word)
{
char *p;
/* display the error */
vocerr(ctx, VOCERR(2), "I don't know the word \"%s\".", unknown_word);
/* read a new command */
if (vocread(ctx, MCMONINV, MCMONINV,
... | false | false | false | false | false | 0 |
hasCharm(tcPDPtr par1, tcPDPtr par2, tcPDPtr par3) {
long id1 = par1 ? par1->id(): 0;
if (!par2 && !par3) {
return
abs(id1) == ThePEG::ParticleID::c ||
isDiquarkWithC(par1) ||
( MesonMatcher::Check(id1) &&
((abs(id1)/100)%10 == ThePEG::ParticleID::c ||
(abs(id... | false | false | false | false | false | 0 |
gnc_combo_box_search_get_active (GtkComboBox *combo)
{
GtkTreeModel *model;
GtkTreeIter iter;
guint value;
g_return_val_if_fail(GTK_IS_COMBO_BOX(combo), 0);
model = gtk_combo_box_get_model(combo);
if (!gtk_combo_box_get_active_iter(combo, &iter))
return 0;
gtk_tree_model_get(model... | false | false | false | false | false | 0 |
handle_writertc(CMD_Request *rx_message, CMD_Reply *tx_message)
{
switch (RTC_WriteParameters()) {
case RTC_ST_OK:
tx_message->status = htons(STT_SUCCESS);
break;
case RTC_ST_NODRV:
tx_message->status = htons(STT_NORTC);
break;
case RTC_ST_BADFILE:
tx_message->status = htons(... | false | false | false | false | false | 0 |
main(int argc, char* argv[]) {
if (argc < 7) {
printf("Usage: rsem-run-gibbs reference_name sample_name imdName BURNIN CHAINLEN GAP [-q]\n");
exit(-1);
}
BURNIN = atoi(argv[4]);
CHAINLEN = atoi(argv[5]);
GAP = atoi(argv[6]);
load_data(argv[1], argv[2], argv[3]);
quiet = false;
if (argc > 7 && !strcmp(argv... | false | true | false | false | true | 1 |
sysaufs_si_xi_path(struct seq_file *seq, struct super_block *sb)
{
int err;
SiMustAnyLock(sb);
err = 0;
if (au_opt_test(au_mntflags(sb), XINO)) {
err = au_xino_path(seq, au_sbi(sb)->si_xib);
seq_putc(seq, '\n');
}
return err;
} | false | false | false | false | false | 0 |
get_string_buf(Sock *sock, char *buf, int buf_len)
{
int val;
if(!str_len) str_len = get_int(sock);
if (str_len > buf_len) {
val = fill_buf(sock, buf, buf_len, "buffered string");
str_len = str_len - buf_len;
if (val == -1)
return NULL;
return buf;
}
else {
val = fi... | false | false | false | false | false | 0 |
get_pylong(PyObject *v)
{
assert(v != NULL);
if (!PyLong_Check(v)) {
/* Not an integer; try to use __index__ to convert. */
if (PyIndex_Check(v)) {
v = PyNumber_Index(v);
if (v == NULL)
return NULL;
}
else {
PyErr_SetString(Str... | false | false | false | false | false | 0 |
getSegments(char *path, int *countp)
{
char *cp, **segments;
int count, i;
/*
Count path segments
*/
for (count = 1, cp = path; *cp; cp++) {
if (*cp == '/') {
count++;
}
}
/*
Allocate space for each directory segment
*/
segments ... | false | false | false | false | true | 1 |
mbfl_filt_conv_base64dec_flush(mbfl_convert_filter *filter)
{
int status, cache;
status = filter->status;
cache = filter->cache;
filter->status = 0;
filter->cache = 0;
/* flush fragments */
if (status >= 2) {
CK((*filter->output_function)((cache >> 16) & 0xff, filter->data));
if (status >= 3) {
CK((*filt... | false | false | false | false | false | 0 |
load(ObjectStream &s)
{
GET_STRING(s, desc);
uint size;
GET_INT32D(s, size);
if (size) {
datafile = new MemoryFile();
data = new ObjectStreamBin(datafile, false);
byte d[size];
GETX_BINARY(s, d, size, "data");
datafile->write(d, size);
} else {
datafile = NULL;
data = NULL;
}
} | false | false | false | false | false | 0 |
knuth_morris_pratt (const char *haystack, const char *needle,
const char **resultp)
{
size_t m = strlen (needle);
/* Allocate the table. */
size_t *table = (size_t *) malloca (m * sizeof (size_t));
if (table == NULL)
return false;
/* Fill the table.
For 0 < i < m:
0 < table[i] <= i is ... | false | false | false | false | true | 1 |
find(const char *n, int W, int H) {
Fl_Shared_Image *key, // Image key
**match; // Matching image
if (num_images_) {
key = new Fl_Shared_Image();
key->name_ = new char[strlen(n) + 1];
strcpy((char *)key->name_, n);
key->w(W);
key->h(H);
match = (Fl_Shared_Image **)bsearch(&key, images_... | false | false | false | false | false | 0 |
sgl_unmap_user_pages(struct st_buffer *STbp,
const unsigned int nr_pages, int dirtied)
{
int i;
for (i=0; i < nr_pages; i++) {
struct page *page = STbp->mapped_pages[i];
if (dirtied)
SetPageDirty(page);
/* FIXME: cache flush missing for rw==READ
* FIXME: call the correct reference counting function
... | false | false | false | false | false | 0 |
op_mul_mask_color_pt_get(DATA32 col, RGBA_Image *dst)
{
int s = SP_N, m = SM_AS, c = SC_AN, d = DP;
if (dst)
dst->cache_entry.flags.alpha = 1;
if ((col >> 24) < 255)
c = SC;
if (col == (col | 0x00ffffff))
c = SC_AA;
if (col == 0xffffffff)
c = SC_N;
return mul_gfx_pt_func_cpu(s, m, c, d);
} | false | false | false | false | false | 0 |
Csec_client_establish_context_ID(FP, ctx, s)
FPARG;
Csec_context_t *ctx;
int s;
{
uid_t uid;
gid_t gid;
csec_buffer_desc send_tok;
char *func = "client_establish_context";
char buf[MSGBUFCSEC];
struct passwd *p;
Csec_trace(func, "Entering\n");
/* will need the peer_name, so check it is av... | false | false | false | false | false | 0 |
ast_datastore_free(struct ast_datastore *datastore)
{
int res = 0;
/* Using the destroy function (if present) destroy the data */
if (datastore->info->destroy != NULL && datastore->data != NULL) {
datastore->info->destroy(datastore->data);
datastore->data = NULL;
}
/* Free allocated UID memory */
if (datast... | false | false | false | false | false | 0 |
_delete_reconfig_global_opt (dict_t *this, char *key, data_t *value, void *data)
{
int32_t *is_force = 0;
GF_ASSERT (data);
is_force = (int32_t*)data;
if (strcmp (GLUSTERD_GLOBAL_OPT_VERSION, key) == 0)
goto out;
_delete_reconfig_opt (this, key, value, d... | false | false | false | false | false | 0 |
SendFirewallCheckUDPRequest()
{
wxASSERT(GetKadState() == KS_FWCHECK_UDP);
if (!Kademlia::CKademlia::IsRunning()) {
SetKadState(KS_NONE);
return;
} else if (GetUploadState() != US_NONE || GetDownloadState() != DS_NONE || GetChatState() != MS_NONE || GetKadVersion() <= 5 || GetKadPort() == 0) {
Kademlia::CUDPF... | false | false | false | false | false | 0 |
repair1(unsigned char *gbuf, long gbufsize)
{
long i;
int nerr;
unsigned char *pds = NULL, *gds = NULL, *bms = NULL, *bds = NULL;
/* int recLen; */
unsigned char *source;
size_t sourceLen;
int bds_len, bds_nbits, bds_flag, lspherc, lcomplex /*, lcompress */;
int bds_head = 11;
int bds_ext = 0, bds_ubi... | false | false | false | true | false | 1 |
gc_db_get_profile_from_id(gint profile_id)
{
SUPPORT_OR_RETURN(FALSE);
#ifdef USE_SQLITE
GcomprisProfile *profile = NULL;
char *zErrMsg;
char **result;
int rc;
int nrow;
int ncolumn;
gchar *request;
int i;
GList *ids;
/* get section_id */
request = g_strdup_printf(GET_PROFILE(profile_id));
... | false | false | false | false | false | 0 |
check_ieee_overflow (void)
{
static long exp;
mp_limb_t n = 1;
long i;
mp_size_t sign;
double want, got;
if (! _GMP_IEEE_FLOATS)
return;
if (tests_setjmp_sigfpe() == 0)
{
exp = 1010;
want = 1.0;
for (i = 0; i < exp; i++)
want *= 2.0;
for ( ; exp < 105... | false | false | false | false | false | 0 |
_UPT_get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dil_addr,
void *arg)
{
int count, ret;
Debug (12, "looking for dyn_info list\n");
if ((ret = get_list_addr (as, dil_addr, arg, &count)) < 0)
return ret;
/* If multiple dynamic-info list addresses are found, we would have
to determ... | false | false | false | false | false | 0 |
__find_sym(char *nam)
{
register int32 sti;
struct sy_t *syp;
struct tnode_t *tnp;
struct symtab_t *sytp;
/* top module level is lowest in task/function symbol table stack */
for (sti = __top_sti; sti >= 0; sti--)
{
sytp = __venviron[sti];
if ((syp = __get_sym(nam, sytp)) != NULL)
{ __sym_is_new = FA... | false | false | false | false | false | 0 |
find_object(unsigned char *sha1)
{
unsigned int h = sha1[0] << 8 | sha1[1];
struct object_entry *e;
for (e = object_table[h]; e; e = e->next)
if (!hashcmp(sha1, e->sha1))
return e;
return NULL;
} | false | false | false | false | false | 0 |
cancelAll()
{
FastMutex::ScopedLock lock(_mutex);
for (TaskList::iterator it = _taskList.begin(); it != _taskList.end(); ++it)
{
(*it)->cancel();
}
} | false | false | false | false | false | 0 |
prepare_udp (packetinfo *pi)
{
config.pr_s.udp_recv++;
if (pi->af==AF_INET) {
vlog(0x3, "[*] IPv4 PROTOCOL TYPE UDP:\n");
pi->udph = (udp_header *) (pi->packet + pi->eth_hlen + (IP_HL(pi->ip4) * 4));
pi->plen = pi->pheader->caplen - UDP_HEADER_LEN -
(IP_HL(pi->ip4) * ... | false | false | false | false | false | 0 |
eaptls_detach(void *arg)
{
EAP_TLS_CONF *conf;
eap_tls_t *inst;
inst = (eap_tls_t *) arg;
conf = inst->conf;
if (conf) {
memset(conf, 0, sizeof(*conf));
free(inst->conf);
inst->conf = NULL;
}
if (inst->ctx) SSL_CTX_free(inst->ctx);
inst->ctx = NULL;
#ifdef HAVE_OPENSSL_OCSP_H
if (inst->store) X509... | false | false | false | false | false | 0 |
setAttributeNode( const Attr &newAttr )
{
if (!impl || newAttr.isNull())
throw DOMException(DOMException::NOT_FOUND_ERR);
// WRONG_DOCUMENT_ERR and INUSE_ATTRIBUTE_ERR are already tested & thrown by setNamedItem
int exceptioncode = 0;
Attr r = static_cast<ElementImpl*>(impl)->setAttributeNode(
... | false | false | false | false | false | 0 |
main(int argc, const char *argv[])
{
CdIo_t *p_cdio = cdio_open (NULL, DRIVER_UNKNOWN);
cdio_fs_anal_t fs=0;
track_t num_tracks;
track_t first_track_num;
lsn_t start_track; /* first sector of track */
lsn_t data_start =0; /* start of data area */
int first_data = -1; /* # of fir... | false | false | false | false | false | 0 |
leo (int a, int b, double c, double d)
{
int x;
if (a < b)
b = a;
if (b < c || c < 0)
c = b;
x = ceil(c/d);
return x < 1 ? 1 : x;
} | false | false | false | false | false | 0 |
fb_compat_ioctl(struct file *file, unsigned int cmd,
unsigned long arg)
{
struct fb_info *info = file_fb_info(file);
struct fb_ops *fb;
long ret = -ENOIOCTLCMD;
if (!info)
return -ENODEV;
fb = info->fbops;
switch(cmd) {
case FBIOGET_VSCREENINFO:
case FBIOPUT_VSCREENINFO:
case FBIOPAN_DISPLAY:
case F... | false | false | false | false | false | 0 |
start(struct sl811 *sl811, u8 bank)
{
struct sl811h_ep *ep;
struct urb *urb;
int fclock;
u8 control;
/* use endpoint at schedule head */
if (sl811->next_periodic) {
ep = sl811->next_periodic;
sl811->next_periodic = ep->next;
} else {
if (sl811->next_async)
ep = sl811->next_async;
else if (!list_... | false | false | false | false | false | 0 |
schedule_host_domain(const char *path, const char *domain,
int *nhostsp, struct gfarm_host_sched_info **hostsp)
{
gfarm_error_t e;
struct gfm_connection *gfm_server;
int (*compare)(const void *, const void *);
if ((e = gfm_client_connection_and_process_acquire_by_path(path,
&gfm_server)) != GFARM_ERR_NO_ERRO... | false | false | false | false | false | 0 |
file_temporary(Buffer *buffer, int ulink)
{
/* `template' for temporary file creation */
static const char *TMP_PREFIX = "/tmp/" PACKAGE_TARNAME;
File *file = NULL;
char *pfname = NULL;
int fd;
int i;
/* try thrice to generate a unique file name */
for (i = 0; i < 16; i++) {
file_free(file);
p... | false | false | false | false | false | 0 |
adb_read_status(int sockfd, char *buff, size_t size)
{
int ret;
ssize_t recvlen;
recvlen = inet_recv(sockfd, buff, size > 8 ? 8 : size - 1);
if (recvlen < 0)
{
text_copy(buff, "protocol fault (no status)");
return recvlen;
}
buff[recvlen] = 0;
ret = text_lhcmp("OKAY", buff) ? -EFAULT : 0;
if (recvlen ==... | false | false | false | false | false | 0 |
execute_writing_input (const char *progname,
const char *prog_path, char **prog_argv,
void *private_data)
{
struct locals *l = (struct locals *) private_data;
pid_t child;
int fd[1];
FILE *fp;
int exitstatus;
/* Open a pipe to the C# execution engine. */
chi... | false | false | false | false | false | 0 |
isMapped(const Identifier &index) const
{
bool indexIsNumber;
int indexAsNumber = index.toStrictUInt32(&indexIsNumber);
if (!indexIsNumber)
return false;
if (indexAsNumber >= _size)
return false;
if (_map[indexAsNumber].isNull())
return false;
return true;
} | false | false | false | false | false | 0 |
field_to_index(s, f)
A s;
S f;
{
int i;
S *fields = (S*)(*(A*)s->p)->p;
for (i = 0; i < (*(A*)s->p)->n; i++) {
if (fields[i] == f) {
#ifdef DEBUG
(void)printf("field_to_index: field <%s>, index %d\n", XS(f)->n, i);
#endif /* DEBUG */
return i;
}
}
q = ERR_DOMAIN;
return -1;
} | false | false | false | false | true | 1 |
devide_omp_pre_post(Omp_directive *ompdir,
Omp_directive **omp_post_head,
Omp_directive **omp_pre_head )
{
Omp_directive *temp_ompdir;
*omp_post_head = NULL;
*omp_pre_head = NULL;
for(temp_ompdir = ompdir; temp_ompdir !=NULL;
... | false | false | false | false | false | 0 |
kvaser_usb_rx_error_update_can_state(struct kvaser_usb_net_priv *priv,
const struct kvaser_usb_error_summary *es,
struct can_frame *cf)
{
struct kvaser_usb *dev = priv->dev;
struct net_device_stats *stats = &priv->netdev->stats;
enum can_state cur_state, new_state, tx_state, rx_state;
netdev_dbg(priv... | false | false | false | false | false | 0 |
gsb_assistant_run ( GtkWidget * assistant )
{
GtkWidget * notebook, * button_prev;
GtkWidget *button_select;
button_prev = g_object_get_data ( G_OBJECT(assistant), "button_prev" );
button_select = g_object_get_data ( G_OBJECT ( assistant ), "button_select" );
gtk_widget_show_all ( assistant );
... | false | false | false | false | false | 0 |
gtk_term_scroll_to_pos(GtkTerm *term)
{
gint w,h,dy;
dy = term->cur - term->top;
if (dy>=term->theight)
gtk_term_adjustment_safe_set_value(term, (gfloat)(term->cur-term->theight+1));
else if (dy<0)
gtk_term_adjustment_safe_set_value(term, (gfloat)term->cur);
else{
gtk_term_adjustment_safe_set_value(term, ... | false | false | false | false | false | 0 |
gt_pch_nx_edge_def (void *x_p)
{
struct edge_def * const x = (struct edge_def *)x_p;
if (gt_pch_note_object (x, x, gt_pch_p_8edge_def, gt_ggc_e_8edge_def))
{
gt_pch_n_15basic_block_def ((*x).src);
gt_pch_n_15basic_block_def ((*x).dest);
switch (current_ir_type () == IR_GIMPLE)
{
... | false | false | false | false | false | 0 |
srtp_aes_cbc_encrypt(aes_cbc_ctx_t *c,
unsigned char *data,
unsigned int *bytes_in_data) {
int i;
unsigned char *input = data; /* pointer to data being read */
unsigned char *output = data; /* pointer to data being written */
int bytes_to_encr = *bytes_in_data;
/*
* verify that we're 16-octet... | false | false | false | false | false | 0 |
append_quoted_word (GString *str,
const char *s,
gboolean in_single_quotes,
gboolean in_double_quotes)
{
const char *p;
if (!in_single_quotes && !in_double_quotes)
g_string_append_c (str, '\'');
else if (!in_single_quotes && in_double_quotes)
g_string_append (str, "\"'");
if... | false | false | false | false | false | 0 |
getSupportedAtom(Atom* supportedAtoms,
unsigned long atomCount,
const char* atomName)
{
unsigned long i;
const Atom atom = XInternAtom(_glfw.x11.display, atomName, False);
for (i = 0; i < atomCount; i++)
{
if (supportedAtoms[i] == atom... | false | false | false | false | false | 0 |
ncclose( cdfid )
int cdfid ;
{
NC *handle ;
cdf_routine_name = "ncclose" ;
handle = NC_check_id(cdfid) ;
if(handle == NULL)
return(-1) ;
if( handle->flags & NC_INDEF)
{
if( NC_endef(cdfid, handle) == -1 )
{
return( ncabort(cdfid) ) ;
}
}
else if(h... | false | false | false | false | false | 0 |
compare_row_cols( const void *obj_a, const void *obj_b )
{
int32 *row_a, *row_b;
int32 ii;
int ret = 0;
row_a = (int32 *) obj_a;
row_b = (int32 *) obj_b;
/* output( "%p %d\n", ic, n_c ); */
for (ii = 0; ii < n_c; ii++) {
/* output( "%d %d\n", row_a[ic[ii]], row_b[ic[ii]] ); */
/* output( "%d\... | false | false | false | false | false | 0 |
is_list_ref_els(Lex_state *e, Dsvec *ref, Token *ref_type)
{
int st;
Token end_token;
if (token_matches(e, T_LBRACKET)) {
end_token = T_RBRACKET;
*ref_type = T_LIST;
}
else if (token_matches(e, T_LBRACE)) {
end_token = T_RBRACE;
*ref_type = T_ALIST;
}
else
return(-1);
if (token_matches(e, end_tok... | false | false | false | false | false | 0 |
bb_to_key (basic_block bb)
{
edge e;
int priority = 0;
/* Do not start in probably never executed blocks. */
if (probably_never_executed_bb_p (bb))
return BB_FREQ_MAX;
/* Prefer blocks whose predecessor is an end of some trace
or whose predecessor edge is EDGE_DFS_BACK. */
for (e = bb->pred; e... | false | false | false | false | false | 0 |
ide_cd_error_cmd(ide_drive_t *drive, struct ide_cmd *cmd)
{
unsigned int nr_bytes = cmd->nbytes - cmd->nleft;
if (cmd->tf_flags & IDE_TFLAG_WRITE)
nr_bytes -= cmd->last_xfer_len;
if (nr_bytes > 0) {
ide_complete_rq(drive, 0, nr_bytes);
return true;
}
return false;
} | false | false | false | false | false | 0 |
dokey(rfbBool down,rfbKeySym k,rfbClientPtr cl)
{
char buffer[1024+32];
sprintf(buffer,"%s: %s (0x%x)",
down?"down":"up",keys[k&0x3ff]?keys[k&0x3ff]:"",(unsigned int)k);
output(cl->screen,buffer);
} | true | true | false | false | false | 1 |
ddp_clear_map(struct cxgbi_hba *chba, unsigned int tag,
unsigned int idx, unsigned int npods)
{
struct cxgbi_device *cdev = chba->cdev;
struct cxgbi_ddp_info *ddp = cdev->ddp;
unsigned int pm_addr = (idx << PPOD_SIZE_SHIFT) + ddp->llimit;
int i;
log_debug(1 << CXGBI_DBG_DDP,
"cdev 0x%p, idx %u, npods %u, t... | false | false | false | false | false | 0 |
nm_ap_check_compatible (NMAccessPoint *self,
NMConnection *connection)
{
NMAccessPointPrivate *priv;
NMSettingWireless *s_wireless;
NMSettingWirelessSecurity *s_wireless_sec;
const char *mode;
const char *band;
const GByteArray *bssid;
guint32 channel;
g_return_val_if_fail (NM_IS_AP (se... | false | false | false | false | false | 0 |
parse_address(struct in_addr *addr)
{
const struct hostent *hp;
char *token = strtok(NULL, w_space);
if (token == NULL)
self_destruct();
if (safe_inet_addr(token, addr) == 1)
(void) 0;
else if ((hp = gethostbyname(token))) /* dont use ipcache */
*addr = inaddrFromHostent(hp);
else
self_dest... | false | false | false | false | false | 0 |
attack_wpa(struct network *n)
{
switch (n->n_astate) {
case ASTATE_READY:
n->n_astate = ASTATE_DEAUTH;
/* fallthrough */
case ASTATE_DEAUTH:
deauth(n);
break;
case ASTATE_WPA_CRACK:
wpa_crack(n);
break;
}
} | false | false | false | false | false | 0 |
stpui_printrc_load(void)
{
FILE *fp; /* Printrc file */
char line[1024]; /* Line in printrc file */
int format = 0; /* rc file format version */
const char *filename = stpui_get_printrc_file();
initialize_default_parameters();
check_plist(1);
/*
* Get the printer list...
*/
stpui_get_system_pr... | true | true | false | false | true | 1 |
drmCreateDrawable(int fd, drm_drawable_t *handle)
{
drm_draw_t draw;
memclear(draw);
if (drmIoctl(fd, DRM_IOCTL_ADD_DRAW, &draw))
return -errno;
*handle = draw.handle;
return 0;
} | false | false | false | false | false | 0 |
match_antecessor_r (ccss_selector_t const *self,
ccss_node_t *node)
{
ccss_node_t *container;
bool is_matching;
container = ccss_node_get_container (node);
if (container) {
is_matching = ccss_selector_query (self, container);
if (!is_matching) {
is_matching = match_antecessor_r (self, container... | false | false | false | false | false | 0 |
outstanding_commentary(const string_list_ty &wl, long narch)
{
static string_ty *s;
if (s)
{
str_free(s);
s = 0;
}
if (!wl.nstrings || wl.nstrings >= (size_t)narch)
s = str_from_c("");
else
{
sub_context_ty *scp;
string_ty *t1;
string_ty *t2;
size_t j;
t1 = str_format("\"%s\"", wl... | false | false | false | false | false | 0 |
handle_befunge98(char *libbuf, size_t libbuf_size,
/*@observer@*/ const char* libdir,
/*@observer@*/ const char* argv0,
/*@observer@*/ const char* filename)
{
/* AIS: Compile the .b98 file into a .cio so that it can be used
la... | true | true | false | false | true | 1 |
depth() const
{
QRect cr;
if ( firstChild() == 0 )
cr = QRect( 0, 0, 0, 0 );
else
cr = firstChild()->myRect();
QString value = explicitAttribute( "depth" );
if ( value.isNull() )
return cr.bottom();
bool ok;
int h = interpretSpacing( value, cr.bottom(), &ok );
i... | false | false | false | false | false | 0 |
find(UChar ch, int pos) const
{
if (pos < 0)
pos = 0;
const UChar* data_ = data();
const UChar *end = data_ + size();
for (const UChar *c = data_ + pos; c < end; c++)
if (*c == ch)
return (c - data_);
return -1;
} | false | false | false | false | false | 0 |
uncore_types_init(struct intel_uncore_type **types)
{
int i, ret;
for (i = 0; types[i]; i++) {
ret = uncore_type_init(types[i]);
if (ret)
goto fail;
}
return 0;
fail:
while (--i >= 0)
uncore_type_exit(types[i]);
return ret;
} | false | false | false | false | false | 0 |
bms_is_subset_singleton(const Bitmapset *s, int x)
{
switch (bms_membership(s))
{
case BMS_EMPTY_SET:
return true;
case BMS_SINGLETON:
return bms_is_member(x, s);
case BMS_MULTIPLE:
return false;
}
/* can't get here... */
return false;
} | false | false | false | false | false | 0 |
RemovePublicKey(const char *id)
{
char keysdir[CF_BUFSIZE];
snprintf(keysdir, CF_BUFSIZE, "%s/ppkeys", CFWORKDIR);
MapName(keysdir);
CFDIR *dirh;
const struct dirent *dirp;
char suffix[CF_BUFSIZE];
int removed = 0;
if ((dirh = OpenDirLocal(keysdir)) == NULL)
{
if (errno == ENOENT)
{
return 0;
}... | true | true | false | false | false | 1 |
postquel_start(execution_state *es, SQLFunctionCachePtr fcache)
{
DestReceiver *dest;
Assert(es->qd == NULL);
/* Caller should have ensured a suitable snapshot is active */
Assert(ActiveSnapshotSet());
/*
* If this query produces the function result, send its output to the
* tuplestore; else discard any out... | false | false | false | false | false | 0 |
copy_argv(int argc, const char **argv)
{
char **vector;
size_t vector_size;
int i;
vector_size = (argc + 1) * sizeof(char *);
vector = (char **) malloc(vector_size);
if (!vector)
return NULL;
for (i = 0; i < argc; i++) {
if (argv[i]) {
vector[i] = strdup(argv[i]);
if (!vector[i]) {
logerr("failed... | false | false | false | false | false | 0 |
first()
{
if( last < 0 ) return (Vertex *) 0;
Vertex *v = store[0];
if( last > 0 ) remove( v );
else
{
v->setHeap( -1 );
last = -1;
store[0] = (Vertex *) 0;
}
return v;
} | false | false | false | false | false | 0 |
GetElementsTransitionMap(ElementsKind elements_kind,
bool safe_to_add_transition) {
Heap* current_heap = heap();
DescriptorArray* descriptors = instance_descriptors();
String* elements_transition_sentinel_name = current_heap->empty_symbol();
if (safe_to_add_transition... | false | false | false | false | false | 0 |
ravb_ptp_update_compare(struct ravb_private *priv, u32 ns)
{
struct net_device *ndev = priv->ndev;
/* When the comparison value (GPTC.PTCV) is in range of
* [x-1 to x+1] (x is the configured increment value in
* GTI.TIV), it may happen that a comparison match is
* not detected when the timer wraps around.
*/
... | false | false | false | false | false | 0 |
my_init(void)
{
/* Initialize variables */
const int audio_rate = MIX_DEFAULT_FREQUENCY;
const int audio_format = MIX_DEFAULT_FORMAT;
const int audio_channels = 2;
int i;
if (init_sdl_audio() < 0) {
return FALSE;
}
if (Mix_OpenAudio(audio_rate, audio_format, audio_channels, buf_size) < 0) {
lo... | false | false | false | false | false | 0 |
GetPosition(Iterator *it)
{
struct ListIterator *li = (struct ListIterator *) it;
if (li->Magic != LIST_MAGIC_NUMBER) {
iError.RaiseError("List.GetPosition",CONTAINER_ERROR_WRONG_ITERATOR);
return (size_t)-1;
}
return li->index;
} | false | false | false | false | false | 0 |
external_spinner_param_get(void *data __UNUSED__, const Evas_Object *obj, Edje_External_Param *param)
{
if (!strcmp(param->name, "label format"))
{
if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
{
param->s = elm_spinner_label_format_get(obj);
return EINA_TRUE;
}
}
else if (!strcm... | false | false | false | false | false | 0 |
createItemWidgets() const
{
QList<QWidget*> widgetList;
QCheckBox *enabledCheckBox = new QCheckBox;
connect(enabledCheckBox, SIGNAL(clicked(bool)), this, SLOT(slotStateChanged(bool)));
connect(enabledCheckBox, SIGNAL(clicked(bool)), this, SLOT(emitChanged()));
KPushButton *aboutPushButton = new KP... | 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.