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 |
|---|---|---|---|---|---|---|
window_slide_up(Win *win, int lines) {
Cursor *cursor = &win->cursor;
if (window_viewport_down(win, lines)) {
if (cursor->line == win->topline)
window_cursor_set(win, win->topline, cursor->col);
else
window_cursor_to(win, cursor->pos);
} else {
window_screenline_down(win);
}
return cursor->pos;
} | false | false | false | false | false | 0 |
OnRead()
{
uint8 _cmd;
while (1)
{
if(!recv_soft((char *)&_cmd, 1))
return;
size_t i;
///- Circle through known commands and call the correct command handler
for (i = 0; i < AUTH_TOTAL_COMMANDS; ++i)
{
if ((uint8)table[i].cmd == _cmd &&
... | false | false | false | false | false | 0 |
gkm_object_destroy (GkmObject *self, GkmTransaction *transaction)
{
GkmSession *session;
GkmManager *manager;
GkmModule *module;
g_return_if_fail (GKM_IS_OBJECT (self));
g_return_if_fail (GKM_IS_TRANSACTION (transaction));
g_return_if_fail (!gkm_transaction_get_failed (transaction));
g_return_if_fail (self->pv-... | false | false | false | false | false | 0 |
brcmf_chip_sb_resetcore(struct brcmf_core_priv *core, u32 prereset,
u32 reset, u32 postreset)
{
struct brcmf_chip_priv *ci;
u32 regdata;
u32 base;
ci = core->chip;
base = core->pub.base;
/*
* Must do the disable sequence first to work for
* arbitrary current core state.
*/
brcmf_chip_sb_coredisabl... | false | false | false | false | false | 0 |
GetAPIURL() const
{
const char* pszAPIURL = CPLGetConfigOption("GFT_API_URL", NULL);
if (pszAPIURL)
return pszAPIURL;
else if (bUseHTTPS)
return "https://www.googleapis.com/fusiontables/v1/query";
else
return "http://www.googleapis.com/fusiontables/v1/query";
} | false | false | false | false | false | 0 |
send(const void* buf, size_t size)
{
long sSize;
if (!fEncrypted) {
sSize = pnSocket::send(buf, size);
} else {
unsigned char* cBuf = new unsigned char[size];
fSendLock.lock();
RC4(&fSend, size, (const unsigned char*)buf, cBuf);
sSize = pnSocket::send(cBuf, size);
... | false | false | false | false | false | 0 |
bdx_sw_reset(struct bdx_priv *priv)
{
int i;
ENTER;
/* 1. load MAC (obsolete) */
/* 2. disable Rx (and Tx) */
WRITE_REG(priv, regGMAC_RXF_A, 0);
mdelay(100);
/* 3. disable port */
WRITE_REG(priv, regDIS_PORT, 1);
/* 4. disable queue */
WRITE_REG(priv, regDIS_QU, 1);
/* 5. wait until hw is disabled */
for (... | false | false | false | false | false | 0 |
nfs3_readdir_process (nfs3_call_state_t *cs)
{
int ret = -EFAULT;
nfs_user_t nfu = {0, };
if (!cs)
return ret;
nfs_request_user_init (&nfu, cs->req);
ret = nfs_readdirp (cs->nfsx, cs->vol, &nfu, cs->fd, cs->dircount,
... | false | false | false | false | false | 0 |
add_next_index_string(zval *arg, const char *str, int duplicate) /* {{{ */
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_STRING(tmp, str, duplicate);
return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL);
} | false | false | false | false | false | 0 |
parse_tcp_mssvalue(const char *mssvalue)
{
unsigned int mssvaluenum;
if (xtables_strtoui(mssvalue, NULL, &mssvaluenum, 0, UINT16_MAX))
return mssvaluenum;
xtables_error(PARAMETER_PROBLEM,
"Invalid mss `%s' specified", mssvalue);
} | false | false | false | false | false | 0 |
pyepoll_internal_close(pyEpoll_Object *self)
{
int save_errno = 0;
if (self->epfd >= 0) {
int epfd = self->epfd;
self->epfd = -1;
Py_BEGIN_ALLOW_THREADS
if (close(epfd) < 0)
save_errno = errno;
Py_END_ALLOW_THREADS
}
return save_errno;
} | false | false | false | false | false | 0 |
_gnutls_x509_write_value (ASN1_TYPE c, const char *root,
const gnutls_datum_t * data, int str)
{
int result;
ASN1_TYPE c2 = ASN1_TYPE_EMPTY;
gnutls_datum_t val = { NULL, 0 };
if (str)
{
/* Convert it to OCTET STRING
*/
if ((result = asn1_create_element
... | false | false | false | false | false | 0 |
crypto_aead_decrypt(
unsigned char *m,unsigned long long *mlen,
unsigned char *nsec,
const unsigned char *c,unsigned long long clen,
const unsigned char *ad,unsigned long long adlen,
const unsigned char *npub,
const unsigned char *k
)
{
hs1siv_ctx_t ctx;
(void)nsec;
if (mlen) *mlen =... | false | false | false | false | false | 0 |
alloc_avg(avg_data_t *avgdata, int width, int depth)
{
int i,j;
avgdata->avgwidth = width;
avgdata->avgdepth = depth;
avgdata->avgarray = malloc(width*sizeof(double));
for (i=0; i<width; i++)
{
avgdata->avgarray[i] = (double *) malloc(depth*sizeof(double));
for (j=0; j<depth; j++)
avgdata-... | false | true | false | false | true | 1 |
gotoInstance(const OFString &instanceUID)
{
InstanceStruct *instance = NULL;
/* start with the first list item */
Iterator = SeriesList.begin();
const OFListIterator(SeriesStruct *) last = SeriesList.end();
/* search for given series UID */
while ((Iterator != last) && (instance == NULL))
{
... | false | false | false | false | false | 0 |
keyGetItem(GinState *ginstate, MemoryContext tempCtx, GinScanKey key)
{
ItemPointerData minItem;
ItemPointerData curPageLossy;
uint32 i;
uint32 lossyEntry;
bool haveLossyEntry;
GinScanEntry entry;
bool res;
MemoryContext oldCtx;
Assert(!key->isFinished);
/*
* Find the minimum of the active entry curIt... | false | false | false | false | false | 0 |
gfire_game_client_data_parse(const gchar *p_datastring)
{
if(!p_datastring)
return NULL;
static const gchar delimit_pairs[] = {0x02, 0x00};
static const gchar delimit_values[] = {0x01, 0x00};
GList *ret = NULL;
gchar **pieces = g_strsplit(p_datastring, delimit_pairs, 0);
if(!pieces)
return NULL;
int i;
... | false | false | false | false | false | 0 |
fillSurface( int playerView )
{
checkViewPosition( offset );
if ( !lock ) {
paintTerrain( *surface, actmap, playerView, field.viewPort, offset );
lastDisplayedMap = actmap;
}
else
paintBackground();
dirty = Curs;
} | false | false | false | false | false | 0 |
clear_workspace(WORKSPACE *ws)
{
if (!ws) return;
alberta_free(ws->work, ws->size);
ws->work = nil;
ws->size = 0;
return;
} | false | false | false | false | false | 0 |
windows_conn_delete(Repl_Connection *conn)
{
PRBool destroy_it = PR_FALSE;
LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_conn_delete\n", 0, 0, 0 );
PR_ASSERT(NULL != conn);
PR_Lock(conn->lock);
if (conn->linger_active)
{
if (slapi_eq_cancel(conn->linger_event) == 1)
{
/* Event was found and cancelled. Destroy... | false | false | false | false | false | 0 |
Unpad(const byte *oaepBlock, size_t oaepBlockLen, byte *output, const NameValuePairs ¶meters) const
{
bool invalid = false;
// convert from bit length to byte length
if (oaepBlockLen % 8 != 0)
{
invalid = (oaepBlock[0] != 0) || invalid;
oaepBlock++;
}
oaepBlockLen /= 8;
std::auto_ptr<HashTransformation... | false | false | false | false | false | 0 |
EmitCFIInstructions(MCStreamer &streamer,
const std::vector<MCCFIInstruction> &Instrs,
MCSymbol *BaseLabel) {
for (unsigned i = 0, N = Instrs.size(); i < N; ++i) {
const MCCFIInstruction &Instr = Instrs[i];
MCSymbol *Label = Instr.... | false | false | false | false | false | 0 |
init_hashtable(struct hashtable *h,
unsigned int minsize,
unsigned int (*hashf) (void*),
int (*eqf) (void*,void*))
{
unsigned int pindex, size = primes[0];
/* Enforce size as prime */
for (pindex=0; pindex < prime_table_length; pindex++) {
if (primes[pind... | false | true | false | false | false | 1 |
JimCheckWaitStatus(Jim_Interp *interp, pidtype pid, int waitStatus)
{
Jim_Obj *errorCode = Jim_NewListObj(interp, NULL, 0);
int rc = JIM_ERR;
if (WIFEXITED(waitStatus)) {
if (WEXITSTATUS(waitStatus) == 0) {
Jim_ListAppendElement(interp, errorCode, Jim_NewStringObj(interp, "NONE", -1));
... | false | false | false | false | false | 0 |
pmt_mapstreamtype(uint8_t type) {
switch (type) {
case 1: /* ISO/IEC 11172 Video */
case 2: /* ITU-T Rec. H.262 */
/* ISO/IEC 13818-2 Video */
/* ISO/IEC 11172-2 */
case 27: /* ITU-T Rec. H.264 */
/* ISO/IEC 14496-10 Video */
return PID_VIDEO;
break;
case 3: /* ISO/IEC 11172 Audio */
... | false | false | false | false | false | 0 |
cert_ReleaseNamedCRLCache(NamedCRLCache* ncc)
{
if (!ncc)
{
return SECFailure;
}
if (!ncc->lock)
{
PORT_Assert(0);
return SECFailure;
}
PR_Unlock(namedCRLCache.lock);
return SECSuccess;
} | false | false | false | false | false | 0 |
SEC_DeletePermCRL(CERTSignedCrl *crl)
{
PRStatus status;
NSSToken *token;
nssCryptokiObject *object;
PK11SlotInfo *slot = crl->slot;
if (slot == NULL) {
PORT_Assert(slot);
/* shouldn't happen */
PORT_SetError( SEC_ERROR_CRL_INVALID);
return SECFailure;
}
token = PK11Slot_GetNSSTo... | false | false | false | false | false | 0 |
read_fits_size(plotimage_t* args, int* W, int* H) {
anqfits_t* anq;
const anqfits_image_t* img;
anq = anqfits_open(args->fn);
if (!anq) {
ERROR("Failed to read input file: \"%s\"", args->fn);
return -1;
}
img = anqfits_get_image_const(anq, args->fitsext);
if (!img) {
ERROR(... | false | false | false | false | false | 0 |
taitof2_update_sprites_active_area(void)
{
int off;
update_spritebanks();
/* if the frame was skipped, we'll have to do the buffering now */
taitof2_handle_sprite_buffering();
/* safety check to avoid getting stuck in bank 2 for games using only one bank */
if (sprites_active_area == 0x8000 &&
sp... | false | false | false | false | false | 0 |
set_up_query_comments (QueryCommentsData *data, gconstpointer service)
{
GDataPicasaWebComment *comment_;
/* Set up some test albums and files. */
set_up_query_files ((QueryFilesData*) data, service);
gdata_test_mock_server_start_trace (mock_server, "setup-query-comments");
/* Insert four test comments on the f... | false | false | false | false | false | 0 |
draw_sprites( struct mame_bitmap *bitmap, const struct rectangle *cliprect, int scrollx, int scrolly,
int priority, unsigned char sprite_partition )
{
const struct GfxElement *gfx = Machine->gfx[3];
const unsigned char *source, *finish;
if( sprite_partition>0x64 ) sprite_partition = 0x64;
if( priority )... | false | false | false | false | false | 0 |
_MD_lseek64(PRFileDesc *fd, PROffset64 offset, PRSeekWhence whence)
{
PRInt32 where;
PROffset64 rv;
switch (whence)
{
case PR_SEEK_SET:
where = SEEK_SET;
break;
case PR_SEEK_CUR:
where = SEEK_CUR;
break;
case PR_SEEK_END:
... | false | false | false | false | false | 0 |
crypt_verify_password(const char *uinput, const char *pass)
{
const char *cstr = crypt_string(uinput, pass);
if (!strcmp(cstr, pass))
return true;
return false;
} | false | false | false | false | false | 0 |
URLResolve(mp, c, p)
MemPool mp;
URLParts *c, *p;
{
URLParts *r;
/*
* If the protocols are different then just return the original with
* some empty fields filled in.
*/
if (c->scheme != NULL && p->scheme != NULL &&
strcasecmp(c->scheme, p->scheme) != 0)
{
r = URLDup(mp, c);
if (r->hostn... | false | false | false | false | false | 0 |
match_stack_pop(match_stack_ty *msp)
{
const match_ty *field;
trace(("match_stack_pop()\n{\n"));
assert(msp->stack_depth);
if (msp->stack_depth > 0)
{
--msp->stack_depth;
field = msp->stack[msp->stack_depth];
}
else
field = 0;
trace(("return %p;\n", field));
... | false | false | false | false | false | 0 |
isight_decode(struct uvc_video_queue *queue, struct uvc_buffer *buf,
const __u8 *data, unsigned int len)
{
static const __u8 hdr[] = {
0x11, 0x22, 0x33, 0x44,
0xde, 0xad, 0xbe, 0xef,
0xde, 0xad, 0xfa, 0xce
};
unsigned int maxlen, nbytes;
__u8 *mem;
int is_header = 0;
if (buf == NULL)
return 0;
if ((... | false | false | false | false | false | 0 |
pedwarn_strange_white_space (ch)
int ch;
{
switch (ch)
{
case '\f': pedwarn ("formfeed in preprocessing directive"); break;
case '\r': pedwarn ("carriage return in preprocessing directive"); break;
case '\v': pedwarn ("vertical tab in preprocessing directive"); break;
default: abort ();
}... | false | false | false | false | false | 0 |
parseInteger(const UnicodeString& rule, int32_t& pos, int32_t limit) {
int32_t count = 0;
int32_t value = 0;
int32_t p = pos;
int8_t radix = 10;
if (p < limit && rule.charAt(p) == 48 /*0*/) {
if (p+1 < limit && (rule.charAt(p+1) == 0x78 /*x*/ || rule.charAt(p+1) == 0x58 /*X*/)) {
... | false | false | false | false | false | 0 |
write_book_parts(FILE *out, QofBook *book)
{
xmlNodePtr domnode;
domnode = guid_to_dom_tree(book_id_string, qof_book_get_guid(book));
xmlElemDump(out, NULL, domnode);
xmlFreeNode (domnode);
if (ferror(out) || fprintf(out, "\n") < 0)
return FALSE;
if (qof_book_get_slots(book))
{
... | false | false | false | false | false | 0 |
usbhs_pipe_running(struct usbhs_pipe *pipe, int running)
{
if (running)
usbhsp_flags_set(pipe, IS_RUNNING);
else
usbhsp_flags_clr(pipe, IS_RUNNING);
} | false | false | false | false | false | 0 |
excel_read_ROW (BiffQuery *q, ExcelReadSheet *esheet)
{
guint16 row, height;
guint16 flags = 0;
guint16 flags2 = 0;
guint16 xf;
gboolean is_std_height;
XL_CHECK_CONDITION (q->length >= (q->opcode == BIFF_ROW_v2 ? 16 : 8));
row = GSF_LE_GET_GUINT16 (q->data);
#if 0
/* Unnecessary info for now.
* do we want t... | false | false | false | false | false | 0 |
hashtable_put(hashtable_t **hashtable_ptr, void *key, void *value)
{
int mod;
unsigned long hash;
hashtable_t *hashtable;
hashtable_entry_t *possible_hit;
float table_usage;
hashtable = *hashtable_ptr;
mod = hashtable->capacity - 1;
hash = hashtab... | false | false | false | false | false | 0 |
rs_genalea (int *x0)
{
int m = 2147483647;
int a = 16807 ;
int b = 127773 ;
int c = 2836 ;
int x1, k;
k = static_cast<int> ((*x0)/b) ;
x1 = a*(*x0 - k*b) - k*c ;
if(x1 < 0) x1 = x1 + m;
*x0 = x1;
return(static_cast<double>(x1)/static_cast<double>(m));
} | false | false | false | false | false | 0 |
integerBitOrMatch(
int *matchp,
slap_mask_t flags,
Syntax *syntax,
MatchingRule *mr,
struct berval *value,
void *assertedValue )
{
SLAP_LONG lValue, lAssertedValue;
errno = 0;
/* safe to assume integers are NUL terminated? */
lValue = SLAP_STRTOL(value->bv_val, NULL, 10);
if( errno == ERANGE )
{
return L... | false | false | false | false | false | 0 |
get_str_prop (const char* prop) {
char *str = (char*)xmlGetProp (_node, (xmlChar*)prop);
string result (str);
free (str);
return result;
} | false | false | false | false | false | 0 |
freeAtt (XMLAtt *a)
{
if (!a)
return;
freeString (&a->name);
freeString (&a->valu);
(*myfree)(a);
} | false | false | false | false | false | 0 |
item(unsigned long index) const
{
if (index < (unsigned)m_queries.size()) {
MediaQuery* query = m_queries[index];
return query->cssText();
}
return DOMString();
} | false | false | false | false | false | 0 |
gtk_led_init (GtkLed *led)
{
GtkMisc *misc;
misc = GTK_MISC (led);
GTK_WIDGET_SET_FLAGS (led, GTK_NO_WINDOW);
led->is_on = FALSE;
led->gc = NULL;
} | false | false | false | false | false | 0 |
on_tool_enable (GtkCellRendererToggle *cell_renderer, const gchar *path, gpointer user_data)
{
ATPToolDialog *this = (ATPToolDialog *)user_data;
GtkTreeModel *model;
GtkTreeIter iter;
ATPUserTool *tool;
model = gtk_tree_view_get_model (this->view);
if (gtk_tree_model_get_iter_from_string (model, &iter, path))
{... | false | false | false | false | false | 0 |
cob_file_sort_using (cob_file *sort_file, cob_file *data_file)
{
int ret;
cob_open (data_file, COB_OPEN_INPUT, 0, NULL);
while (1) {
cob_read (data_file, NULL, NULL, COB_READ_NEXT);
if (data_file->file_status[0] != '0') {
break;
}
cob_copy_check (sort_file, data_file);
ret = cob_file_sort_submit (sort... | false | false | false | false | false | 0 |
tds_convert_real(int srctype, const TDS_CHAR * src, int desttype, CONV_RESULT * cr)
{
TDS_REAL the_value;
/* FIXME how many big should be this buffer ?? */
char tmp_str[128];
TDS_INT mymoney4;
TDS_INT8 mymoney;
memcpy(&the_value, src, 4);
switch (desttype) {
case TDS_CONVERT_CHAR:
case CASE_ALL_CHAR:
sprin... | true | true | false | false | false | 1 |
FetchClientEntData(edict_t * ent)
{
ent->health = ent->client->pers.health;
ent->max_health = ent->client->pers.max_health;
if (ent->client->pers.powerArmorActive)
ent->flags |= FL_POWER_ARMOR;
if (coop->value)
ent->client->resp.score = ent->client->pers.score;
} | false | false | false | false | false | 0 |
println(KBlocksPiece * piece, int x, int y, bool full)
{
if(full)
{
if (x != -1)
{
gotoXY(x, y++);
}
println(piece);
if (x != -1)
{
gotoXY(x, y++);
}
println("STATE");
if (x != -1)
{
gotoXY(x, y++... | false | false | false | false | false | 0 |
yuv444_to_rgb(jxr_image_t image, int mx)
{
int px;
for (px = 0 ; px < 256 ; px += 1) {
int Y = image->strip[0].up3[mx].data[px];
int U = image->strip[1].up3[mx].data[px];
int V = image->strip[2].up3[mx].data[px];
int G = Y - _jxr_floor_div2(-U);
int R = G - U - _jxr_ceil_... | false | false | false | false | false | 0 |
set_prga(struct wstate *ws, unsigned char* iv,
unsigned char* cipher, unsigned char* clear, int len)
{
int i;
int fd;
if (ws->ws_pi.pi_len != 0)
free(ws->ws_pi.pi_prga);
ws->ws_pi.pi_prga = (unsigned char*) malloc(len);
if (!ws->ws_pi.pi_prga) {
perror("malloc()");
exit(1);
}
ws->ws_pi.pi_len = l... | false | false | false | false | false | 0 |
numaTransform(NUMA *nas,
l_float32 shift,
l_float32 scale)
{
l_int32 i, n;
l_float32 val;
NUMA *nad;
PROCNAME("numaTransform");
if (!nas)
return (NUMA *)ERROR_PTR("nas not defined", procName, NULL);
n = numaGetCount(nas);
if ((nad = numaCreate(n)) ==... | false | false | false | false | false | 0 |
get_free_cmdtab_slot()
{
int slot;
for ( slot = 0; slot < MAXJOBS; ++slot )
if ( !cmdtab[ slot ].pid )
return slot;
printf( "no slots for child!\n" );
exit( EXITBAD );
} | false | false | false | false | false | 0 |
if_usb_fw_timeo(unsigned long priv)
{
struct if_usb_card *cardp = (void *)priv;
if (cardp->fwdnldover) {
lbs_deb_usb("Download complete, no event. Assuming success\n");
} else {
pr_err("Download timed out\n");
cardp->surprise_removed = 1;
}
wake_up(&cardp->fw_wq);
} | false | false | false | false | false | 0 |
DisplaySize(
const FvwmWindow *tmp_win, const XEvent *eventp, int width,
int height, Bool Init, Bool resetLast)
{
char str[100];
int dwidth,dheight,offset;
size_borders b;
static int last_width = 0;
static int last_height = 0;
FlocaleWinString fstr;
if (Scr.gs.do_hide_resize_window)
{
return;
}
position_... | false | false | false | false | false | 0 |
EM_error( int pos, const char * message, ... )
{
va_list ap;
IntList lines = linePos;
int num = lineNum;
anyErrors = TRUE;
while( lines && lines->i >= pos )
{
lines = lines->rest;
num--;
}
fprintf( stderr, "[%s]:", *fileName ? mini(fileName) : "chuck" );
sprintf( g... | false | false | false | false | false | 0 |
lldpctl_release(lldpctl_conn_t *conn)
{
if (conn == NULL) return 0;
free(conn->ctlname);
if (conn->send == sync_send) {
struct lldpctl_conn_sync_t *data = conn->user_data;
if (data->fd != -1) close(data->fd);
free(conn->user_data);
}
free(conn->input_buffer);
free(conn->output_buffer);
free(conn);
return ... | false | false | false | false | false | 0 |
gap_layer_create_layer_from_layermask(gint32 src_layer_id
, gint32 image_id
, const char *name_prefix, const char *name_suffix)
{
gboolean l_has_already_layermask;
gint32 l_layermask_id;
gint32 l_new_layer_id;
gint32 l_new_layermask_id;
/* make a copy of the layer (but witho... | false | false | false | false | false | 0 |
wakeup_count_store(struct kobject *kobj,
struct kobj_attribute *attr,
const char *buf, size_t n)
{
unsigned int val;
int error;
error = pm_autosleep_lock();
if (error)
return error;
if (pm_autosleep_state() > PM_SUSPEND_ON) {
error = -EBUSY;
goto out;
}
error = -EINVAL;
if (sscanf(buf, "%u", &v... | false | false | false | false | false | 0 |
elm_photo_size_set(Evas_Object *obj,
int size)
{
ELM_PHOTO_CHECK(obj);
ELM_PHOTO_DATA_GET(obj, sd);
sd->size = (size > 0) ? size : 0;
elm_image_prescale_set(sd->icon, sd->size);
_sizing_eval(obj);
} | false | false | false | false | false | 0 |
pre_exchange()
{
if (!nevery) return;
if (!force->kspace) return;
if (!force->pair) return;
if (next_reneighbor != update->ntimestep) return;
next_reneighbor = update->ntimestep + nevery;
double time = get_timing_info();
if (strcmp(force->kspace_style,"ewald") == 0) ewald_time = time;
if (strcmp(force... | false | false | false | false | false | 0 |
defined_rv_to_string (CK_RV rv)
{
#define GKM_X(rv) case rv: return #rv;
switch (rv) {
/* These are not really errors, or not current */
GKM_X (CKR_OK)
GKM_X (CKR_NO_EVENT)
GKM_X (CKR_FUNCTION_NOT_PARALLEL)
GKM_X (CKR_SESSION_PARALLEL_NOT_SUPPORTED)
GKM_X (CKR_CANCEL)
GKM_X (CKR_FUNCTION_CANCELED)
GKM_X (CKR... | false | false | false | false | false | 0 |
single_click(int x1, int y1, int x2, int y2,int buttonId)
{
if( !has_mouse_event )
return 0;
MouseClick* cptr;
if( buttonId==0 || buttonId==2 ) // left button
{
cptr = click_buffer+LEFT_BUTTON;
if( mouse_event_type == LEFT_BUTTON
&& cptr->count == 1
&& cptr->x >= x1 && cptr->y >= y1
&& cptr... | false | false | false | false | false | 0 |
vcard_unescape(char *src)
{
char *ans = NULL, *p;
int done = 0;
if(src){
p = ans = (char *)fs_get(strlen(src) + 1);
while(!done){
switch(*src){
case '\\':
src++;
if(*src == 'n' || *src == 'N'){
*p++ = '\n';
src++;
}
else if(*src)
*p++ = *src++;
break;
... | false | false | false | false | false | 0 |
loadFromSvg(const QString& filename, const QSize& size)
{
QFileInfo fi(filename);
if (!fi.exists()) {
return QPixmap();
} else if (fi.lastModified().toTime_t() > timestamp()) {
// Cache is obsolete, will be regenerated
discard();
}
QPixmap pix;
QString key = QString("fil... | false | false | false | false | false | 0 |
get_thinkpad_model_data(
struct thinkpad_id_data *tp)
{
const struct dmi_device *dev = NULL;
char ec_fw_string[18];
char const *s;
if (!tp)
return -EINVAL;
memset(tp, 0, sizeof(*tp));
if (dmi_name_in_vendors("IBM"))
tp->vendor = PCI_VENDOR_ID_IBM;
else if (dmi_name_in_vendors("LENOVO"))
tp->vendor... | false | false | false | false | false | 0 |
cb_alert_config(GkrellmAlert *ap, DiskMon *disk)
{
GtkTreeModel *model;
GtkTreeIter iter, citer;
DiskMon *disk_test;
GdkPixbuf *pixbuf;
gboolean valid;
disk->alert_uses_read =
GTK_TOGGLE_BUTTON(disk->alert_config_read_button)->active;
disk->alert_uses_write =
GTK_TOGGLE_BUTTON(disk->alert_config_w... | false | false | false | false | false | 0 |
ustring(long nl,long nh)
{
unsigned char *v;
v=(unsigned char *)malloc((size_t) (sizeof(unsigned char)* (nh-nl+1)));
if (!v) {
fprintf(stderr,"Can't allocate %ld bytes\n",nh-nl+1);
while(1)
{
}
exit_with_msg_and_exit_code("Memory allocation failure in ustring()",MEMORY_ALLOCATION_ERROR_IN_U... | false | false | false | false | false | 0 |
usb_hcd_flush_endpoint(struct usb_device *udev,
struct usb_host_endpoint *ep)
{
struct usb_hcd *hcd;
struct urb *urb;
if (!ep)
return;
might_sleep();
hcd = bus_to_hcd(udev->bus);
/* No more submits can occur */
spin_lock_irq(&hcd_urb_list_lock);
rescan:
list_for_each_entry_reverse(urb, &ep->urb_list, ur... | false | false | false | false | false | 0 |
filter_rebuild(void)
{
GList *work;
guint i;
string_list_free(extension_list);
extension_list = NULL;
string_list_free(file_writable_list);
file_writable_list = NULL;
string_list_free(file_sidecar_list);
file_sidecar_list = NULL;
for (i = 0; i < FILE_FORMAT_CLASSES; i++)
{
string_list_free(file_class_e... | false | false | false | false | false | 0 |
etgc_get_cell_geometry (ETableGroup *etg,
gint *row,
gint *col,
gint *x,
gint *y,
gint *width,
gint *height)
{
ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg);
gi... | false | false | false | false | false | 0 |
frsw_start(char *filename)
{
frsw_table_t *t;
if (!(t = frsw_create_table("default"))) {
fprintf(stderr,"FRSW: unable to create virtual fabric table.\n");
return(-1);
}
if (frsw_read_cfg_file(t,filename) == -1) {
fprintf(stderr,"FRSW: unable to parse configuration file.\n");
return... | false | false | false | false | false | 0 |
printer_add (GDBusProxy *proxy,
const char *printer_name,
const char *printer_uri,
const char *ppd_file,
const char *info,
const char *location,
GError **error)
{
GVariant *result;
char *ret_error;
*erro... | false | false | false | false | false | 0 |
config_hook_exec(const char *filename, const char *module, struct ast_config *cfg)
{
struct ao2_iterator it;
struct cfg_hook *hook;
if (!(cfg_hooks)) {
return;
}
it = ao2_iterator_init(cfg_hooks, 0);
while ((hook = ao2_iterator_next(&it))) {
if (!strcasecmp(hook->filename, filename) &&
!strcasecmp(hook->m... | false | false | false | false | false | 0 |
vl_get_thread_specific_state (void)
{
#ifdef VL_DISABLE_THREADS
return vl_get_state()->threadState ;
#else
VlState * state ;
VlThreadState * threadState ;
vl_lock_state() ;
state = vl_get_state() ;
#if defined(VL_THREADS_POSIX)
threadState = (VlThreadState *) pthread_getspecific(state->threadKey) ;
#elif ... | false | false | false | false | false | 0 |
unquote (const char *str)
{
gint slen;
const char *end;
if (str == NULL)
return NULL;
slen = strlen (str);
if (slen < 2)
return NULL;
if (*str != '\'' && *str != '\"')
return NULL;
end = str + slen - 1;
if (*str != *end)
return NULL;
return g_strndup (str + 1, slen - 2);
} | false | false | false | false | false | 0 |
stripe_pathinfo_aggregate (char *buffer, stripe_local_t *local, int32_t *total)
{
int32_t i = 0;
int32_t ret = -1;
int32_t len = 0;
char *sbuf = NULL;
stripe_xattr_sort_t *xattr = NULL;
if (!buffer || !local ... | false | true | false | false | false | 1 |
s_server(int ac, char **av)
{
char sendstr[MAXLINE + 1];
char **line;
struct Server *tempserv;
if (ac < 4)
return;
/*
* make sure av[2] isn't in the server list - one reason it might
* be is if services squit'd it and created a fake server
* in the connect burst, but the hub would send the server line
... | false | false | false | false | false | 0 |
IoLexer_readExponent(IoLexer *self)
{
if (IoLexer_readCharAnyCase_(self, 'e'))
{
if (!IoLexer_readChar_(self, '-'))
{
IoLexer_readChar_(self, '+');
}
if (!IoLexer_readDigits(self))
{
return -1;
}
return 1;
}
return 0;
} | false | false | false | false | false | 0 |
tryadd(node *p, node **item, node **nufork)
{ /* temporarily adds one fork and one tip to the tree.
if the location where they are added yields greater
likelihood than other locations tested up to that
time, then keeps that location as there */
long grcategs;
grcategs = (categs > rcategs) ? categ... | false | false | false | false | false | 0 |
WindowsCharsetName() const
{
char* cpname = wvLIDToCodePageConverter(getWinLanguageCode());
bool is_default;
const char* ret = search_map(MSCodepagename_to_charset_name_map,cpname,&is_default);
return is_default ? cpname : ret;
} | false | false | false | false | false | 0 |
Write(const void* data, size_t data_len,
size_t* written, int* error) {
if (error) *error = -1;
return SR_ERROR;
} | false | false | false | false | false | 0 |
btr_def_live_range (btr_def def, HARD_REG_SET *btrs_live_in_range)
{
if (!def->live_range)
{
btr_user user;
def->live_range = BITMAP_ALLOC (NULL);
bitmap_set_bit (def->live_range, def->bb->index);
COPY_HARD_REG_SET (*btrs_live_in_range,
(flag_btr_bb_exclusive
? btrs_live : btrs_... | false | false | false | false | false | 0 |
parse_params_obsolete_callback(CS& cmd)
{
return ONE_OF
|| Get(cmd, "l", &_length)
|| Get(cmd, "w", &_width)
|| EVAL_BM_ACTION_BASE::parse_params_obsolete_callback(cmd)
;
} | false | false | false | false | false | 0 |
moov_recov_parse_mdia (MoovRecovFile * moovrf, TrakRecovData * trakrd)
{
guint32 size;
guint32 fourcc;
/* make sure we are on a tkhd atom */
if (!read_atom_header (moovrf->file, &fourcc, &size))
return FALSE;
if (fourcc != FOURCC_mdia)
return FALSE;
trakrd->mdia_file_offset = ftell (moovrf->file) ... | false | false | false | false | false | 0 |
vorbis_encode_setup_vbr(vorbis_info *vi,
long channels,
long rate,
float quality){
codec_setup_info *ci=vi->codec_setup;
highlevel_encode_setup *hi=&ci->hi;
quality+=.0000001;
if(quality>=1.)quality=.9999;
get_setup_template(vi,channels,rate,quality,0);
if(!hi->setup)return O... | false | false | false | false | false | 0 |
Perl_sv_bless(pTHX_ SV *const sv, HV *const stash)
{
dVAR;
SV *tmpRef;
PERL_ARGS_ASSERT_SV_BLESS;
if (!SvROK(sv))
Perl_croak(aTHX_ "Can't bless non-reference value");
tmpRef = SvRV(sv);
if (SvFLAGS(tmpRef) & (SVs_OBJECT|SVf_READONLY)) {
if (SvREADONLY(tmpRef) && !SvIsCOW(tmpRef))
... | false | false | false | false | false | 0 |
qla4_83xx_poll_list(struct scsi_qla_host *ha,
struct qla4_83xx_reset_entry_hdr *p_hdr)
{
long delay;
struct qla4_83xx_entry *p_entry;
struct qla4_83xx_poll *p_poll;
uint32_t i;
uint32_t value;
p_poll = (struct qla4_83xx_poll *)
((char *)p_hdr + sizeof(struct qla4_83xx_reset_entry_hdr));
/* Entries start... | false | false | false | false | false | 0 |
xdmcp_write (XDMCPClient *client, const guint8 *buffer, gssize buffer_length)
{
gssize n_written;
GError *error = NULL;
n_written = g_socket_send (client->priv->socket, (const gchar *) buffer, buffer_length, NULL, &error);
if (n_written < 0)
g_warning ("Failed to send XDMCP request: %s", error-... | false | false | false | false | false | 0 |
dbchange(DBPROCESS * dbproc)
{
tdsdump_log(TDS_DBG_FUNC, "dbchange(%p)\n", dbproc);
CHECK_PARAMETER(dbproc, SYBENULL, NULL);
if (dbproc->envchange_rcv & (1 << (TDS_ENV_DATABASE - 1))) {
return dbproc->dbcurdb;
}
return NULL;
} | false | false | false | false | false | 0 |
seqWriteFastqIllumina(AjPSeqout outseq)
{
ajuint j;
ajuint ilen;
AjPStr seq = NULL;
ajint qchar;
ajDebug("seqWriteFastqIllumina Name '%S'\n",
outseq->Name);
seqDbName(&outseq->Name, outseq->Setoutdb);
ajWritebinByte(outseq->File, '@');
ajWriteline(outseq->File, outseq->Name);
... | false | false | false | false | false | 0 |
computeFSAdditions(StringRef FS, CodeGenOpt::Level OL,
const Triple &TT) {
std::string FullFS = FS;
// Make sure 64-bit features are available when CPUname is generic
if (TT.getArch() == Triple::ppc64 || TT.getArch() == Triple::ppc64le) {
if (!FullFS.empty())
FullF... | false | false | false | false | false | 0 |
rowCount(const QModelIndex& /* parent */) const
{
return(m_pCertificateDirectory->entryList().size());
} | false | false | false | false | false | 0 |
mgr_get_resource(struct rsc_mgr *mgr, unsigned int n, unsigned int *ridx)
{
int err;
if (n > mgr->avail)
return -ENOENT;
err = get_resource(mgr->rscs, mgr->amount, n, ridx);
if (!err)
mgr->avail -= n;
return err;
} | false | false | false | false | false | 0 |
_rtl92de_update_rxsignalstatistics(struct ieee80211_hw *hw,
struct rtl_stats *pstats)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
int weighting = 0;
if (rtlpriv->stats.recv_signal_power == 0)
rtlpriv->stats.recv_signal_power = pstats->recvsignalpower;
if (pstats->recvsignalpower > rtlpriv->stats.recv_... | false | false | false | false | false | 0 |
EnableCellUserIds()
{
if(this->CellProperties->NoUserIds())
{
vtkIdType *ids = new vtkIdType[this->NumberOfCells];
//the cell properties will delete the ghost array when needed
this->CellProperties->SetMaterialIdArray(ids);
vtkIdTypeArray *userIds = vtkIdTypeArray::New();
userIds->SetName("U... | 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.