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 |
|---|---|---|---|---|---|---|
cavan_gsensor_event_handler(struct cavan_input_device *dev, struct input_event *event, void *data)
{
cavan_input_message_t *message;
struct cavan_input_service *service = data;
struct cavan_gsensor_device *sensor = (struct cavan_gsensor_device *) dev;
switch (event->type)
{
case EV_ABS:
switch (event->code)
... | false | false | false | false | false | 0 |
readKeyword(istrstream* strm, char* buffer, int buffer_len)
{
if ( strm->eof() )
return false;
strm->getline(buffer, buffer_len, ',');
// Trim trailing blanks
int len = strlen(buffer);
int pos = len - 1;
while ( pos >= 0 && buffer[pos] == ' ' )
pos--;
buffer[1 + pos] = '\0';
return true;
} | false | false | false | false | false | 0 |
addme(const netid_t mid)
{
unsigned nhval = calcnhash(mid);
struct hhash *hp;
time_t now = time((time_t *) 0);
if (!(hp = (struct hhash *) malloc(sizeof(struct hhash))))
nomem();
BLOCK_ZERO(hp, sizeof(struct hhash));
hp->hn_next = nhashtab[nhval];
nhashtab[nhval] = hp;
hp->rem.hostid = mid;
hp->rem.ht_fla... | false | false | false | false | false | 0 |
sdp_set_uuidseq_attr(sdp_record_t *rec, uint16_t aid, sdp_list_t *seq)
{
int status = 0, i, len;
void **dtds, **values;
uint8_t uuid16 = SDP_UUID16;
uint8_t uuid32 = SDP_UUID32;
uint8_t uuid128 = SDP_UUID128;
sdp_list_t *p;
len = sdp_list_len(seq);
if (!seq || len == 0)
return -1;
dtds = malloc(len * sizeof... | false | true | false | false | false | 1 |
rb_setselect_epoll(rb_fde_t *F, unsigned int type, PF * handler, void *client_data)
{
struct epoll_event ep_event;
int old_flags = F->pflags;
int op = -1;
lrb_assert(IsFDOpen(F));
/* Update the list, even though we're not using it .. */
if(type & RB_SELECT_READ)
{
if(handler != NULL)
F->pflags |= EPOLLIN;... | false | false | false | false | false | 0 |
free_xd_data(gxml_data * xd)
{
if( xd->da_list ){ free(xd->da_list); xd->da_list = NULL; }
if( xd->xdata ){ free(xd->xdata); xd->xdata = NULL; } /* xform matrix */
if( xd->zdata) { free(xd->zdata); xd->zdata = NULL; } /* compress buff */
if( xd->ddata ){ free(xd->ddata); xd->ddata = NULL; } /* Data bu... | false | false | false | false | false | 0 |
newJob( const KUrl & directory )
{
DirectorySizeJobPrivate *d = new DirectorySizeJobPrivate;
DirectorySizeJob *job = new DirectorySizeJob(*d);
job->setUiDelegate(new JobUiDelegate);
d->startNextJob(directory);
return job;
} | false | false | false | false | false | 0 |
str_copy(char *out,const char *in) {
register char* s=out;
register const char* t=in;
for (;;) {
if (!(*s=*t)) break; ++s; ++t;
if (!(*s=*t)) break; ++s; ++t;
if (!(*s=*t)) break; ++s; ++t;
if (!(*s=*t)) break; ++s; ++t;
}
return s-out;
} | false | false | false | false | false | 0 |
sol_codec_type(int magic, int type)
{
if (magic == 0x0B8D) return 1;//SOL_DPCM_OLD;
if (type & SOL_DPCM)
{
if (type & SOL_16BIT) return 3;//SOL_DPCM_NEW16;
else if (magic == 0x0C8D) return 1;//SOL_DPCM_OLD;
else return 2;//SOL_DPCM_NEW8;
}
return -1;
} | false | false | false | false | false | 0 |
coop_cut(std::vector<unsigned int>& cut, std::vector<bool>& node_labels,
ImageGraph* im_graph, double lambda, double theta, int max_iter) {
// Create a cost function and set the edge regularization weight lambda.
// Set the potentials from the unaries, edge weights, and edge classes.
Costfun* cost = new Costf... | false | false | false | false | false | 0 |
pkcs11_export_chain(FILE * outfile, const char *url, unsigned int login_flags,
common_info_st * info)
{
gnutls_pkcs11_obj_t obj;
gnutls_x509_crt_t xcrt;
gnutls_datum_t t;
int ret;
unsigned int obj_flags = 0;
if (login_flags) obj_flags = login_flags;
pkcs11_common();
FIX(url);
ret = gnutls_pkcs11_obj... | false | false | false | false | false | 0 |
test_qof_session_load (Fixture *fixture, gconstpointer pData)
{
/* Method initializes a new book and loads data into it
* if load fails old books are restored
*/
QofBackend *be = NULL;
QofBook *newbook = NULL;
/* init */
fixture->session->book_id = g_strdup ("my book");
be = g_new0 (Q... | false | false | false | false | false | 0 |
dwc2_driver_remove(struct platform_device *dev)
{
struct dwc2_hsotg *hsotg = platform_get_drvdata(dev);
dwc2_debugfs_exit(hsotg);
if (hsotg->hcd_enabled)
dwc2_hcd_remove(hsotg);
if (hsotg->gadget_enabled)
dwc2_hsotg_remove(hsotg);
if (hsotg->ll_hw_enabled)
dwc2_lowlevel_hw_disable(hsotg);
return 0;
} | false | false | false | false | false | 0 |
check_xrandr_event(char *msg) {
XEvent xev;
RAWFB_RET(0)
/* it is assumed that X_LOCK is on at this point. */
if (subwin) {
return handle_subwin_resize(msg);
}
#if LIBVNCSERVER_HAVE_LIBXRANDR
if (! xrandr_present) {
return 0;
}
if (! xrandr && ! xrandr_maybe) {
return 0;
}
if (xrandr_base_event_typ... | false | false | false | false | true | 1 |
copyout (cc, cnt)
unsigned char ** cc; /* Char in filteredbuf to start at */
register int cnt; /* Number of chars to copy */
{
register char * cp; /* Char in contextbufs[0] to copy */
cp = (char *) &contextbufs[0][*cc - filteredbuf];
*cc += cnt;
while (--cnt >= 0)
{
if (*cp == '\0'... | false | false | false | false | false | 0 |
hud_squadmsg_ship_order_valid( int shipnum, int order )
{
// Goober5000
Assert( shipnum >= 0 && shipnum < MAX_SHIPS );
switch ( order )
{
case DEPART_ITEM:
// disabled ships can't depart.
if (Ships[shipnum].flags & SF_DISABLED)
return 0;
// Goober5000: also can't depart if no subspace drives and n... | false | false | false | false | false | 0 |
__vval_is1(register word32 *wp, int32 blen)
{
register int32 i;
register word32 mask;
int32 wlen;
wlen = wlen_(blen);
for (i = 0; i < wlen - 1; i++) if (wp[i] != ALL1W) return(FALSE);
mask = __masktab[ubits_(blen)];
if ((wp[wlen - 1] & mask) != mask) return(FALSE);
return(TRUE);
} | false | false | false | false | false | 0 |
jinit_c_coef_controller (oe_j_compress_ptr cinfo, boolean need_full_buffer)
{
my_coef_ptr coef;
coef = (my_coef_ptr)
(*cinfo->mem->alloc_small) ((oe_j_common_ptr) cinfo, OE_JPOOL_IMAGE,
SIZEOF(my_coef_controller));
cinfo->coef = (struct openexif_jpeg_c_coef_controller *) coef;
coef->pub.start_pass = st... | false | false | false | false | false | 0 |
prd_psort(const struct ltab *lt)
{
mvaddstr(lt->row, lt->col, Displayopts.opt_sortptrs != SORTP_NONE? lt->prompts[1]: lt->prompts[0]);
} | false | false | false | false | false | 0 |
_k_insert_after(K_LIST *list, K_ITEM *item, K_ITEM *after, KLIST_FFL_ARGS)
{
if (item->name != list->name) {
quithere(1, "List %s can't %s() a %s item" KLIST_FFL,
list->name, __func__, item->name, KLIST_FFL_PASS);
}
if (!after) {
quithere(1, "%s() (%s) can't after a null item" KLIST_FFL,
__func__, list-... | false | false | false | true | false | 1 |
compute_attributes_sql_style(List *options,
List **as,
char **language,
char *volatility_p,
bool *strict_p,
bool *security_definer)
{
ListCell *option;
DefElem *as_item = NULL;
DefElem *language_item = NULL;
DefElem *volatility_item = NULL;
DefElem *strict_item... | false | false | false | false | false | 0 |
circuit_free_all(void)
{
circuit_t *next;
while (global_circuitlist) {
next = global_circuitlist->next;
if (! CIRCUIT_IS_ORIGIN(global_circuitlist)) {
or_circuit_t *or_circ = TO_OR_CIRCUIT(global_circuitlist);
while (or_circ->resolving_streams) {
edge_connection_t *next_conn;
nex... | false | false | false | false | false | 0 |
compact_multitext_string(char *str)
{
unsigned int i;
unsigned int len = strlen(str);
int num_cr = 0;
for (i=0; i<len; i++)
{
// skip CR
// convert LF to space
// copy characters backwards if any CRs previously encountered
if (str[i] == '\r')
num_cr++;
else if (str[i] == '\n')
str[i-num_cr] = ' ';... | false | false | false | false | false | 0 |
double2icS15Fixed16Number(float number_in)
{
short s;
unsigned short m;
icS15Fixed16Number temp;
float number;
if (number_in < 0) {
number = -number_in;
s = (short) number;
m = (unsigned short) ((number - s) * 65536.0);
temp = (icS15Fixed16Number) ((s << 16) | m);
... | false | false | false | false | false | 0 |
tyan_lcdm_set_char (Driver *drvthis, int n, unsigned char *dat)
{
PrivateData *p = drvthis->private_data;
unsigned char mask = (1 << p->cellwidth) - 1;
unsigned char out[p->cellheight + 1];
int row;
if ((n < 0) || (n >= NUM_CCs))
return;
if (dat == NULL)
return;
for (row = 0; row < p->cellheight; row++) {
... | true | true | false | false | false | 1 |
MoveForInsertDelete(bool insertion, int startChange, int length) {
if (insertion) {
if (position > startChange) {
position += length;
}
} else {
if (position > startChange) {
int endDeletion = startChange + length;
if (position > endDeletion) {
position -= length;
} else {
position = startCh... | false | false | false | false | false | 0 |
platform_get_runlevel()
{
char runlevel;
struct utmp ut, save, *next = NULL;
struct timeval tv;
int flag = 0, counter = 0;
MUTEX_LOCK(utmp_lock);
memset(&ut, 0, sizeof(struct utmp));
memset(&save, 0, sizeof(struct utmp));
memset(&tv, 0, sizeof(struct timeval));
ut.ut_type = RUN_LVL;
setutent();
next = ge... | false | false | false | false | false | 0 |
_xmmsv_utf8_charlen (unsigned char c)
{
if ((c & 0x80) == 0) {
return 1;
} else if ((c & 0x60) == 0x40) {
return 2;
} else if ((c & 0x70) == 0x60) {
return 3;
} else if ((c & 0x78) == 0x70) {
return 4;
}
return 0;
} | false | false | false | false | false | 0 |
rtl8188ee_bt_var_init(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
rtlpriv->btcoexist.bt_coexistence =
rtlpriv->btcoexist.eeprom_bt_coexist;
rtlpriv->btcoexist.bt_ant_num = rtlpriv->btcoexist.eeprom_bt_ant_num;
rtlpriv->btcoexist.bt_coexist_type = rtlpriv->btcoexist.eeprom_bt_type;
if (r... | false | false | false | false | false | 0 |
nodes_gui_node_flags_changed(const struct nid *node_id)
{
if (!hset_contains(ht_node_flags_changed, node_id)) {
const struct nid *key = nid_ref(node_id);
hset_insert(ht_node_flags_changed, key);
}
} | false | false | false | false | false | 0 |
Coding2Coding_Data_init(Coding2Coding_Data *c2cd,
Sequence *query, Sequence *target){
g_assert(query->alphabet->type == Alphabet_Type_DNA);
g_assert(target->alphabet->type == Alphabet_Type_DNA);
Affine_Data_init(&c2cd->ad, query, target, TRUE);
if(!Coding2Coding_Data_get_Frame... | false | false | false | false | false | 0 |
modem_added (DBusGProxy *proxy, const char *path, gpointer user_data)
{
NmaBtDevice *self = NMA_BT_DEVICE (user_data);
NmaBtDevicePrivate *priv = NMA_BT_DEVICE_GET_PRIVATE (self);
DBusGProxy *props_proxy;
g_return_if_fail (path != NULL);
g_message ("%s: (%s) modem found", __func__, path);
/* Create a proxy for... | false | false | false | false | false | 0 |
vn_reference_lookup_or_insert_for_pieces (tree vuse,
alias_set_type set,
tree type,
VEC (vn_reference_op_s,
heap) *operands,
tree value)
{
struct vn_reference_s vr1;
vn_reference_t result;
unsigned value_id;
vr1.vuse = vuse;
vr1.operands = operands;
vr1.type = type;
... | true | true | false | false | false | 1 |
next_conversion (conversion *conv)
{
if (conv == NULL
|| conv->kind == ck_identity
|| conv->kind == ck_ambig
|| conv->kind == ck_list)
return NULL;
return conv->u.next;
} | false | false | false | false | false | 0 |
mcam_vb_start_streaming(struct vb2_queue *vq, unsigned int count)
{
struct mcam_camera *cam = vb2_get_drv_priv(vq);
unsigned int frame;
int ret;
if (cam->state != S_IDLE) {
mcam_vb_requeue_bufs(vq, VB2_BUF_STATE_QUEUED);
return -EINVAL;
}
cam->frame_state.frames = 0;
cam->frame_state.singles = 0;
cam->fram... | false | false | false | false | false | 0 |
avision_close (Avision_Connection* av_con)
{
if (av_con->connection_type == AV_SCSI) {
sanei_scsi_close (av_con->scsi_fd);
av_con->scsi_fd = -1;
}
else {
sanei_usb_close (av_con->usb_dn);
av_con->usb_dn = -1;
}
} | false | false | false | false | false | 0 |
c_snk(state_t *s)
{
int callk_index;
char *endptr;
if (!_debugstate_valid) {
sciprintf("Not in debug state\n");
return 1;
}
if (cmd_paramlength > 0) {
/* Try to convert the parameter to a number. If the conversion stops
before end of string, assume that the parameter is a function name
and scan t... | false | false | false | false | false | 0 |
CompareVersions(const int version1[],
const int version2[],
int num_segments) {
for (int i = 0; i < num_segments; ++i) {
int diff = version1[i] - version2[i];
if (diff != 0) {
return diff;
}
}
return 0;
} | false | false | false | false | false | 0 |
sysfs_write_string(struct sysfs_cxt *cxt, const char *attr, const char *str)
{
int fd = sysfs_open(cxt, attr, O_WRONLY|O_CLOEXEC);
int rc, errsv;
if (fd < 0)
return -errno;
rc = write_all(fd, str, strlen(str));
errsv = errno;
close(fd);
errno = errsv;
return rc;
} | false | false | false | false | false | 0 |
jffs2_stop_garbage_collect_thread(struct jffs2_sb_info *c)
{
int wait = 0;
spin_lock(&c->erase_completion_lock);
if (c->gc_task) {
jffs2_dbg(1, "Killing GC task %d\n", c->gc_task->pid);
send_sig(SIGKILL, c->gc_task, 1);
wait = 1;
}
spin_unlock(&c->erase_completion_lock);
if (wait)
wait_for_completion(&c->... | false | false | false | false | false | 0 |
circoLayout(Agraph_t * g)
{
Agraph_t **ccs;
Agraph_t *sg;
int ncc;
int i;
if (agnnodes(g)) {
ccs = circomps(g, &ncc);
if (ncc == 1) {
circularLayout(ccs[0], g);
copyPosns(ccs[0]);
adjustNodes(g);
} else {
Agraph_t *dg = ccs[0]->root;
pack_info pinfo;
getPackInfo(g,... | false | false | false | false | false | 0 |
GC_signal_mark_stack_overflow(mse *msp)
{
GC_mark_state = MS_INVALID;
GC_mark_stack_too_small = TRUE;
GC_COND_LOG_PRINTF("Mark stack overflow; current size = %lu entries\n",
(unsigned long)GC_mark_stack_size);
return(msp - GC_MARK_STACK_DISCARDS);
} | false | false | false | false | false | 0 |
main(int argc, char **argv)
{
int fd;
struct stat stat;
__u8 *db;
struct regdb_file_header *header;
struct regdb_file_reg_country *countries;
int dblen, siglen, num_countries, i, r = 0;
struct ieee80211_regdomain *rd = NULL;
if (argc != 2) {
fprintf(stderr, "Usage: %s <filename>\n", argv[0]);
return 2;
}
... | false | false | false | false | false | 0 |
binprint (const char *str, size_t len)
{
size_t i;
printf ("\t;; ");
for (i = 0; i < len; i++)
{
printf ("%d%d%d%d%d%d%d%d ",
(str[i] & 0xFF) & 0x80 ? 1 : 0,
(str[i] & 0xFF) & 0x40 ? 1 : 0,
(str[i] & 0xFF) & 0x20 ? 1 : 0,
(str[i] & 0xFF) & 0x10 ? 1 : 0,
(str[i] & 0xFF... | false | false | false | false | false | 0 |
expandToCol(int col) {
while ((int)m_ColInfo.size() <= col) {
m_ColInfo.push_back(KeyRCInfo());
}
return &m_ColInfo[col];
} | false | false | false | false | false | 0 |
hasActionGroup(const QString &group) const
{
return hasGroup(QString(QLatin1String("Desktop Action ") + group).toUtf8().constData());
} | false | false | false | false | false | 0 |
efi_snp_hii_package_list ( struct efi_snp_device *snpdev ) {
struct net_device *netdev = snpdev->netdev;
struct device *dev = netdev->dev;
struct efi_ifr_builder ifr;
EFI_HII_PACKAGE_LIST_HEADER *package;
const char *product_name;
EFI_GUID package_guid;
EFI_GUID formset_guid;
EFI_GUID varstore_guid;
unsigned i... | false | false | false | false | false | 0 |
ipath_lkey_ok(struct ipath_qp *qp, struct ipath_sge *isge,
struct ib_sge *sge, int acc)
{
struct ipath_lkey_table *rkt = &to_idev(qp->ibqp.device)->lk_table;
struct ipath_mregion *mr;
unsigned n, m;
size_t off;
int ret;
/*
* We use LKEY == zero for kernel virtual addresses
* (see ipath_get_dma_mr and ipa... | false | false | false | false | false | 0 |
nautilus_canvas_view_can_rename_file (NautilusView *view, NautilusFile *file)
{
if (!(nautilus_canvas_view_get_zoom_level (view) > NAUTILUS_ZOOM_LEVEL_SMALLEST)) {
return FALSE;
}
return NAUTILUS_VIEW_CLASS(nautilus_canvas_view_parent_class)->can_rename_file (view, file);
} | false | false | false | false | false | 0 |
matches(str, relation, cond)
char *str;
int relation;
struct condition_rec *cond;
{
switch(relation){
case RE:
if (cond->regex == NULL)
cond->regex = regcomp(cond->argument1);
if (regexec(cond->regex, str)) {
last_regexp = cond->regex;
return TRUE;
} else {
return FALSE;
}
case EQ:
ret... | false | false | false | false | false | 0 |
rescale(void)
{
vwtp = vwtp*dt_lb/dx_lb;
vwbt = vwbt*dt_lb/dx_lb;
bodyforcex = bodyforcex*dt_lb*dt_lb/dx_lb;
bodyforcey = bodyforcey*dt_lb*dt_lb/dx_lb;
bodyforcez = bodyforcez*dt_lb*dt_lb/dx_lb;
tau=(3.0*viscosity/densityinit_real)*dt_lb*dt_lb/dx_lb/dx_lb;
tau /= dt_lb;
if(typeLB==1)
tau = tau... | false | false | false | false | false | 0 |
call_maybe(PyObject *o, _Py_Identifier *nameid, char *format, ...)
{
va_list va;
PyObject *args, *func = 0, *retval;
va_start(va, format);
func = lookup_maybe(o, nameid);
if (func == NULL) {
va_end(va);
if (!PyErr_Occurred())
Py_RETURN_NOTIMPLEMENTED;
return NULL... | false | false | false | false | false | 0 |
Set(const int index, const bool value)
{
if (value){
Data[(index>>3)] |= (1 << (index&7));
} else {
unsigned char mask = 0xFF;
mask ^= (1 << (index&7));
Data[(index>>3)] &= mask;
}
} | false | false | false | false | false | 0 |
faxEncode_closeXform (IP_XFORM_HANDLE hXform)
{
PENC_INST g;
HANDLE_TO_PTR (hXform, g);
if (g->prior_p != NULL)
IP_MEM_FREE (g->prior_p);
g->dwValidChk = 0;
IP_MEM_FREE (g); /* free memory for the instance */
return IP_DONE;
fatal_error:
return IP_FATAL_ERROR;
} | false | false | false | false | false | 0 |
WriteMoveTo(FILE* fdes, at_real_coord *pt)
{
int recsize = sizeof(UI32) * 4;
if(fdes != NULL)
{
write32(fdes, ENMT_MOVETO);
write32(fdes, (UI32) recsize);
write32(fdes, (UI32) X_FLOAT_TO_UI32(pt->x));
write32(fdes, (UI32) Y_FLOAT_TO_UI32(pt->y));
}
return recsize;
} | false | false | false | false | false | 0 |
char1 (uaecptr addr)
{
static uae_char buf[1024];
static TCHAR bufx[1024];
unsigned int i = 0;
do {
buf[i] = get_byte (addr);
addr++;
} while (buf[i++] && i < sizeof (buf));
return au_fs_copy (bufx, sizeof (bufx) / sizeof (TCHAR), buf);
} | false | false | false | false | false | 0 |
phy_set_bw_mode_callback(struct adapter *adapt)
{
struct hal_data_8188e *hal_data = GET_HAL_DATA(adapt);
u8 reg_bw_opmode;
u8 reg_prsr_rsc;
if (hal_data->rf_chip == RF_PSEUDO_11N)
return;
/* There is no 40MHz mode in RF_8225. */
if (hal_data->rf_chip == RF_8225)
return;
if (adapt->bDriverStopped)
retur... | false | false | false | false | false | 0 |
yp_add (const char *mount)
{
struct yp_server *server;
/* make sure YP thread is not modifying the lists */
thread_rwlock_rlock (&yp_lock);
/* make sure we don't race against another yp_add */
thread_mutex_lock (&yp_pending_lock);
server = (struct yp_server *)active_yps;
while (server)
... | false | false | false | false | false | 0 |
slapi_has8thBit(unsigned char *s)
{
#define MY8THBITWIDTH 4 /* sizeof(PRUint32) */
#define MY8THBITFILTER 0x80808080
unsigned char *p, *stail, *ltail;
PRUint32 *uip;
size_t len = strlen((const char *)s);
ltail = s + len;
stail = ltail - (len % MY8THBITWIDTH);
for (p = s; p < stail; p += MY8THBIT... | false | false | false | false | false | 0 |
MatchCallback(JSContext *cx, size_t count, void *p)
{
JS_ASSERT(count <= JSVAL_INT_MAX); /* by max string length */
jsval &arrayval = *static_cast<jsval *>(p);
JSObject *arrayobj = JSVAL_TO_OBJECT(arrayval);
if (!arrayobj) {
arrayobj = js_NewArrayObject(cx, 0, NULL);
if (!arrayobj)
... | false | false | false | false | false | 0 |
parse_daemon2(const lnode *n, search_items *s)
{
char *str, saved, *term = n->message;
if (event_hostname) {
str = strstr(term, "addr=");
if (str) {
str += 5;
term = strchr(str, ':');
if (term == NULL) {
term = strchr(str, ' ');
if (term == NULL)
return 1;
}
saved = *term;
*term = ... | false | false | false | false | false | 0 |
__mm_rotate_right(struct ibv_mem_node *node)
{
struct ibv_mem_node *tmp;
tmp = node->left;
node->left = tmp->right;
if (node->left)
node->left->parent = node;
if (node->parent) {
if (node->parent->right == node)
node->parent->right = tmp;
else
node->parent->left = tmp;
} else
mm_root = tmp;
tmp... | false | false | false | false | false | 0 |
getData(const PosChunkIdx& ci)
{
int e = getEntryNum(ci);
int state = chunktable.getDiskState(ci);
if (state == ChunkSet::CHUNK_UNKNOWN)
stats.misses++;
else
stats.hits++;
// if we've already tried and failed to read the chunk, don't try again
if (state == ChunkSet::CHUNK_CORRUPTED || state == Ch... | false | false | false | false | false | 0 |
autohelperowl_attackpat179(int trans, int move, int color, int action)
{
int b, c, d, e, A;
UNUSED(color);
UNUSED(action);
b = AFFINE_TRANSFORM(722, trans, move);
c = AFFINE_TRANSFORM(721, trans, move);
d = AFFINE_TRANSFORM(647, trans, move);
e = AFFINE_TRANSFORM(720, trans, move);
A = AFFINE_TRANSFORM... | false | false | false | false | false | 0 |
ncx_get_int_schar(const void *xp, schar *ip)
{
ix_int xx;
get_ix_int(xp, &xx);
*ip = xx;
if(xx > SCHAR_MAX || xx < SCHAR_MIN)
return NC_ERANGE;
return ENOERR;
} | false | false | false | false | false | 0 |
mlx4_en_fill_hwtstamps(struct mlx4_en_dev *mdev,
struct skb_shared_hwtstamps *hwts,
u64 timestamp)
{
unsigned long flags;
u64 nsec;
read_lock_irqsave(&mdev->clock_lock, flags);
nsec = timecounter_cyc2time(&mdev->clock, timestamp);
read_unlock_irqrestore(&mdev->clock_lock, flags);
memset(hwts, 0, s... | false | false | false | false | false | 0 |
changedEntriesVariable(GtkWidget *entry, gpointer data)
{
G_CONST_RETURN gchar* entrytext = NULL;
MolcasTypeVariable* type;
if(!GTK_IS_WIDGET(entry)) return;
type = g_object_get_data(G_OBJECT (entry), "Type");
if(type == NULL) return ;
entrytext = gtk_entry_get_text(GTK_ENTRY(entry));
if(strlen(entrytext)<1... | false | true | false | false | false | 1 |
enableDisableSelectionClicked(bool isEnable)
{
const bool prevBlockItemChanged = m_blockItemChanged;
m_blockItemChanged = true;
foreach(QTreeWidgetItem *twItem, m_ui.treeWidget->selectedItems()) {
CaCertificateItem *item = dynamic_cast<CaCertificateItem *>(twItem);
Q_ASSERT(item);
if... | false | false | false | false | false | 0 |
ffi_checkctype(lua_State *L, CTState *cts, TValue *param)
{
TValue *o = L->base;
if (!(o < L->top)) {
err_argtype:
lj_err_argtype(L, 1, "C type");
}
if (tvisstr(o)) { /* Parse an abstract C type declaration. */
GCstr *s = strV(o);
CPState cp;
int errcode;
cp.L = L;
cp.cts = cts;
c... | false | false | false | false | false | 0 |
verbose_updatetags(char *path, int seqno, int skip)
{
if (total)
fprintf(stderr, " [%d/%d]", seqno, total);
else
fprintf(stderr, " [%d]", seqno);
fprintf(stderr, " adding tags of %s", path);
if (skip)
fprintf(stderr, " (skipped)");
fputc('\n', stderr);
} | false | false | false | false | false | 0 |
compare_decls_by_uid (const void *pa, const void *pb)
{
const numbered_tree *nt_a = ((const numbered_tree *)pa);
const numbered_tree *nt_b = ((const numbered_tree *)pb);
if (DECL_UID (nt_a->t) != DECL_UID (nt_b->t))
return DECL_UID (nt_a->t) - DECL_UID (nt_b->t);
return nt_a->num - nt_b->num;
} | false | false | false | false | false | 0 |
FetchData( IDirectFBDataBuffer *buffer, void *data, unsigned int len )
{
DFBResult ret = DFB_OK;
do {
unsigned int read = 0;
ret = buffer->WaitForData( buffer, len );
if (ret == DFB_OK)
ret = buffer->GetData( buffer, len, data, &read );
if (re... | false | true | false | false | true | 1 |
snd_err_msg_default(const char *file, int line, const char *function, int err, const char *fmt, ...)
{
va_list arg;
const char *verbose;
verbose = getenv("LIBASOUND_DEBUG");
if (! verbose || ! *verbose)
return;
va_start(arg, fmt);
fprintf(stderr, "ALSA lib %s:%i:(%s) ", file, line, function);
vfprintf(stderr... | false | false | false | false | true | 1 |
_cmd_cipher_suite_id (char **argv)
{
assert (argv);
if (argv[1])
{
char *endptr;
int tmp;
errno = 0;
tmp = strtol (argv[1], &endptr, 10);
if (errno
|| endptr[0] != '\0'
|| tmp < IPMI_CIPHER_SUITE_ID_MIN
|| tmp > IPMI_CIPHER_SUITE_ID_MAX)
ipmipower_c... | false | false | false | false | false | 0 |
fill_buffer_with_pattern(XferSourcePattern *self, char *buf,
size_t len)
{
char *src = self->pattern, *dst = buf;
size_t plen = self->pattern_buffer_length, offset = self->current_offset;
size_t pos = 0;
src += offset;
while (pos < len) {
*dst++ = *src++;
pos++, offset++;
... | false | false | false | false | false | 0 |
ReadNeededConstraints(
void *theEnv)
{
GenReadBinary(theEnv,(void *) &ConstraintData(theEnv)->NumberOfConstraints,(unsigned long)
sizeof(unsigned long int));
if (ConstraintData(theEnv)->NumberOfConstraints == 0) return;
ConstraintData(theEnv)->ConstraintArray = (CO... | false | false | false | false | false | 0 |
CControlStartConversion(w, clientwindow, valuemask, value)
Widget w;
Window clientwindow;
unsigned long valuemask;
ConversionAttributes *value;
{
ConversionControlWidget ccw = (ConversionControlWidget)w;
ConversionControlWidgetClass class = (ConversionControlWidgetClass)w->core.widget_class;
TRACE(("CContr... | false | false | false | false | false | 0 |
thermal_init(struct ibm_init_struct *iibm)
{
u8 t, ta1, ta2;
int i;
int acpi_tmp7;
int res;
vdbg_printk(TPACPI_DBG_INIT, "initializing thermal subdriver\n");
acpi_tmp7 = acpi_evalf(ec_handle, NULL, "TMP7", "qv");
if (thinkpad_id.ec_model) {
/*
* Direct EC access mode: sensors at registers
* 0x78-0x7F,... | false | false | false | false | false | 0 |
RFG_Filter_getRegionRules( RFG_Filter* filter, const char* regionName,
const char* groupName, int32_t* r_callLimit,
uint32_t* r_stackBounds, uint8_t* r_flags )
{
uint32_t i;
if( !filter )
return 0;
if( !regionName && !groupName )
{
fprintf(... | false | false | false | false | false | 0 |
skip_idletters(srcPosn pos)
{
int c;
#ifdef DEBUG_IS_KEYWORD
if(debug_lexer && getenv("VERBOSE"))
(void)fprintf(list_fd,": skipping letters...");
#endif
while(c=pos.Line->line[pos.idx],
(isidletter(c) || isadigit(c) || isspace(c)))
stepPosn(&pos);
return pos;
} | false | false | false | false | true | 1 |
capacity() const
{
if (_fromFile)
return _sortedPhonebook.max_size();
else
return _mePhonebook->capacity();
} | false | false | false | false | false | 0 |
pfind(C *v,C *d,C *f,I m)
{
Z C s[MAXPATHLEN];
if(*f=='/')R unloadable(f,m)?0:f;
for((v&&(v=getenv(v)))?d=v:0;d;) {
if(v=(C *)strchr(d,':'))*s=0,strncat(s,d,v-d),d=v+1;
else strcpy(s,d),d=0;
strcat(s,"/"),strcat(s,f);
if(!unloadable(s,m))R s;
}
R 0;
} | false | false | false | false | false | 0 |
bcma_pcicore_serdes_workaround(struct bcma_drv_pci *pc)
{
u16 tmp;
bcma_pcie_mdio_write(pc, BCMA_CORE_PCI_MDIODATA_DEV_RX,
BCMA_CORE_PCI_SERDES_RX_CTRL,
bcma_pcicore_polarity_workaround(pc));
tmp = bcma_pcie_mdio_read(pc, BCMA_CORE_PCI_MDIODATA_DEV_PLL,
BCMA_... | false | false | false | false | false | 0 |
client3_getspec_cbk (struct rpc_req *req, struct iovec *iov, int count,
void *myframe)
{
gf_getspec_rsp rsp = {0,};
call_frame_t *frame = NULL;
int ret = 0;
frame = myframe;
if (!frame || !frame->this) {
... | false | false | false | true | false | 1 |
rand_gauss()
{
static bool is_saved = false;
static double saved;
if (!is_saved) {
double rsq, x1, x2;
while(1) {
x1 = rand_1_1();
x2 = rand_1_1();
rsq = x1 * x1 + x2 * x2;
if (rsq >= TINY && rsq < 1)
break;
}
do... | false | false | false | false | false | 0 |
removeGridlines(char *pixels, int width, int height,
const Transform *transform, CoordSettings coordSettings,
GridRemovalSettings gridSettings, PixelState pixelStateRemoved)
{
ASSERT_ENGAUGE(transform != 0);
if (transform->validAxes())
{
// get removal gridlines
GridMesh gridMesh;
GridlinesScreen ... | false | false | false | true | false | 1 |
message_add_redirect_header (SoupMessage *msg,
GFileQueryInfoFlags flags)
{
const char *header_redirect;
/* RFC 4437 */
if (flags & G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS)
header_redirect = "F";
else
header_redirect = "T";
soup_message_headers_append (msg->req... | false | false | false | false | false | 0 |
create_dll_header()
{
dll_header *THIS = (dll_header *)calloc(sizeof(dll_header), 1);
if(!THIS){ aisc_server_error = "Malloc error in create_dll_header !"; return 0;}
return THIS; } | false | false | false | false | false | 0 |
Normalize(R3Grid *grid, int normalization_type)
{
// Check normalization type
if (normalization_type == 0) return;
// Start statistics
RNTime start_time;
start_time.Read();
// Compute statistics of non-zero entries
int count = 0;
RNScalar sum = 0;
RNScalar mean = 0;
RNScalar variance = 0;
RNSca... | false | false | false | false | false | 0 |
set_temp(struct device *dev, struct device_attribute *devattr,
const char *buf, size_t count)
{
struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
struct jc42_data *data = dev_get_drvdata(dev);
int err, ret = count;
int nr = attr->index;
long val;
if (kstrtol(buf, 10, &val) < 0)
return -EIN... | false | false | false | false | false | 0 |
textiowrapper_read(textio *self, PyObject *args)
{
Py_ssize_t n = -1;
PyObject *result = NULL, *chunks = NULL;
CHECK_INITIALIZED(self);
if (!PyArg_ParseTuple(args, "|O&:read", &_PyIO_ConvertSsize_t, &n))
return NULL;
CHECK_CLOSED(self);
if (self->decoder == NULL)
return _unsu... | false | false | false | false | false | 0 |
_loadMap(unsigned int pMapId, const std::string& basePath, uint32 tileX, uint32 tileY)
{
InstanceTreeMap::iterator instanceTree = iInstanceMapTrees.find(pMapId);
if (instanceTree == iInstanceMapTrees.end())
{
std::string mapFileName = getMapFileName(pMapId);
StaticMap... | false | false | false | false | false | 0 |
UndominateInitializers(JSParseNode *left, JSParseNode *right, JSTreeContext *tc)
{
FindPropValData fpvd;
JSParseNode *lhs, *rhs;
JS_ASSERT(left->pn_type != TOK_ARRAYCOMP);
JS_ASSERT(right);
#if JS_HAS_DESTRUCTURING_SHORTHAND
if (right->pn_arity == PN_LIST && (right->pn_xflags & PNX_DESTRUCT)) {
... | false | false | false | false | false | 0 |
__ecereProp___ecereNameSpace__ecere__gui__controls__MenuItem_Set_bitmap(struct __ecereNameSpace__ecere__com__Instance * this, struct __ecereNameSpace__ecere__com__Instance * value)
{
struct __ecereNameSpace__ecere__gui__controls__MenuItem * __ecerePointer___ecereNameSpace__ecere__gui__controls__MenuItem = (struct __ece... | false | false | false | false | false | 0 |
R_PointOnSegSide
( fixed_t x,
fixed_t y,
seg_t* line )
{
fixed_t lx;
fixed_t ly;
fixed_t ldx;
fixed_t ldy;
fixed_t dx;
fixed_t dy;
fixed_t left;
fixed_t right;
lx = line->v1->x;
ly = line->v1->y;
ldx = line->v2->x - lx;
ldy = line->v2->y - ly;
if (!ldx)
... | false | false | false | false | false | 0 |
free_list(cfg_parser_t *pctx, cfg_obj_t *obj) {
cfg_listelt_t *elt, *next;
for (elt = ISC_LIST_HEAD(obj->value.list);
elt != NULL;
elt = next)
{
next = ISC_LIST_NEXT(elt, link);
free_list_elt(pctx, elt);
}
} | false | false | false | false | false | 0 |
pkey_hmac_copy(EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src)
{
HMAC_PKEY_CTX *sctx, *dctx;
if (!pkey_hmac_init(dst))
return 0;
sctx = src->data;
dctx = dst->data;
dctx->md = sctx->md;
HMAC_CTX_init(&dctx->ctx);
if (!HMAC_CTX_copy(&dctx->ctx, &sctx->ctx))
return 0;
if (sctx->ktmp.data)
{
if (!ASN1_OCTET_... | false | false | false | false | false | 0 |
create_account_list ( GtkTreeModel * model )
{
GSList *list_tmp;
GtkTreeIter parent, child;
GtkTreePath * path;
gtk_tree_model_get_iter_first ( GTK_TREE_MODEL(navigation_model), &parent );
/* Remove childs if any. */
while ( gtk_tree_model_iter_children ( model, &child, &parent ) )
{
gtk_... | false | false | false | false | false | 0 |
rc_sys_v1(void)
{
#ifdef PREFIX
return RC_SYS_PREFIX;
#else
#ifdef __FreeBSD__
int jailed = 0;
size_t len = sizeof(jailed);
if (sysctlbyname("security.jail.jailed", &jailed, &len, NULL, 0) == 0)
if (jailed == 1)
return RC_SYS_JAIL;
#endif
#ifdef __NetBSD__
if (exists("/kern/xen/privcmd"))
return RC_SYS_X... | false | false | false | false | false | 0 |
expWriteBytesAndLogIfTtyU(esPtr,buf,lenChars)
ExpState *esPtr;
Tcl_UniChar *buf;
int lenChars;
{
int wc;
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
if (esPtr->valid)
wc = expWriteCharsUni(esPtr,buf,lenChars);
if (tsdPtr->logChannel && ((esPtr->fdout == 1) || expDevttyIs(esPtr)))... | false | false | false | false | true | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.