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 |
|---|---|---|---|---|---|---|
FormatStatus(xstring& s,int v,const char *prefix)
{
SessionJob::FormatStatus(s,v,prefix);
if(builtin)
{
xstring_ca ac(args->Combine());
return s.appendf(_("\tExecuting builtin `%s' [%s]\n"),ac.get(),session->CurrentStatus());
}
if(queue_feeder)
{
if(IsSuspended())
s.appendf("%s%s\n... | false | false | false | false | false | 0 |
draw(Canvas* c, const Allocation& a) const {
Coord x = a.x();
Coord y = a.y();
const Font* f = font_;
const Color* color = color_;
const char* p = text_->string();
const char* q = &p[text_->length()];
Coord* cw = &char_widths_[0];
for (; p < q; p++, cw++) {
Coord width = *cw;
c->charac... | false | false | false | false | false | 0 |
drx39xxj_release(struct dvb_frontend *fe)
{
struct drx39xxj_state *state = fe->demodulator_priv;
struct drx_demod_instance *demod = state->demod;
/* if device is removed don't access it */
if (fe->exit != DVB_FE_DEVICE_REMOVED)
drxj_close(demod);
kfree(demod->my_ext_attr);
kfree(demod->my_common_attr);
kfree... | false | true | false | false | false | 1 |
fcoe_ctlr_vn_probe_req(struct fcoe_ctlr *fip,
struct fc_rport_priv *rdata)
{
struct fcoe_rport *frport = fcoe_ctlr_rport(rdata);
if (rdata->ids.port_id != fip->port_id)
return;
switch (fip->state) {
case FIP_ST_VNMP_CLAIM:
case FIP_ST_VNMP_UP:
fcoe_ctlr_vn_send(fip, FIP_SC_VN_PROBE_REP,
frport->... | false | false | false | false | false | 0 |
isPadCore(int textEditorPos)
{
PadCore *core = dynamic_cast<PadCore*>(d_th->_pad->padFragmentForOutputPosition(textEditorPos));
return (core!=0);
} | false | false | false | false | false | 0 |
mr_pass(struct Client *client_p, struct Client *source_p,
int parc, char *parv[])
{
char *password = parv[1];
if (EmptyString(password))
{
sendto_one(client_p, form_str(ERR_NEEDMOREPARAMS),
me.name, EmptyString(parv[0]) ? "*" : parv[0], "PASS");
return;
}
MyFree(client_p->loca... | false | false | false | false | true | 1 |
create_vbltimes(uint16 * table,const uint8 *vbl,unsigned int rate)
{
int i;
for (i=0;i<0x20;i++)
table[i]=vbl[i]*rate;
} | false | false | false | false | false | 0 |
u_getbot()
{
u_entry_T *uep;
linenr_T extra;
uep = u_get_headentry(); /* check for corrupt undo list */
if (uep == NULL)
return;
uep = curbuf->b_u_newhead->uh_getbot_entry;
if (uep != NULL)
{
/*
* the new ue_bot is computed from the number of lines that has been
* inserted (0 - delet... | false | false | false | false | false | 0 |
add_builtin_variable(exec_list *instructions, glsl_symbol_table *symtab,
const builtin_variable *proto)
{
/* Create a new variable declaration from the description supplied by
* the caller.
*/
const glsl_type *const type = symtab->get_type(proto->type);
assert(type != NULL);
if (proto->mode... | false | false | false | false | false | 0 |
wasp_compact_string( wasp_string str ){
AUDIT_STRING( str );
if( str->origin ){
if( str->length ){
memmove( str->pool,
str->pool + str->origin,
str->length );
str->pool[str->length + 1] = 0;
};
str->origin = 0;
};
... | false | false | false | false | false | 0 |
hsu_dma_terminate_all(struct dma_chan *chan)
{
struct hsu_dma_chan *hsuc = to_hsu_dma_chan(chan);
unsigned long flags;
LIST_HEAD(head);
spin_lock_irqsave(&hsuc->vchan.lock, flags);
hsu_dma_stop_channel(hsuc);
if (hsuc->desc) {
hsu_dma_desc_free(&hsuc->desc->vdesc);
hsuc->desc = NULL;
}
vchan_get_all_desc... | false | false | false | false | false | 0 |
cell_renderer_transition_get_size(GtkCellRenderer *cell,
GtkWidget *widget,
GdkRectangle *cell_area,
gint *x_offset,
gint *y_offset,
gint *width,
gint *height) {
CellRendererTransition *self... | false | false | false | false | false | 0 |
extract_ipv4_route(struct rtmsg *msg, int bytes, int *index,
struct in_addr *dst,
struct in_addr *gateway)
{
struct rtattr *attr;
for (attr = RTM_RTA(msg); RTA_OK(attr, bytes);
attr = RTA_NEXT(attr, bytes)) {
switch (attr->rta_type) {
case RTA_DST:
if (dst != NULL)
*dst = *((struct in_add... | false | false | false | false | false | 0 |
gen_reserv (rtx def)
{
decl_t decl;
decl = create_node (sizeof (struct decl));
decl->mode = dm_reserv;
decl->pos = 0;
DECL_RESERV (decl)->name = check_name ((char *) XSTR (def, 0), decl->pos);
DECL_RESERV (decl)->regexp = gen_regexp ((char *) XSTR (def, 1));
VLA_PTR_ADD (decls, decl);
num_dfa_decls++;
... | false | false | false | false | false | 0 |
print_cmpd_type(h5tools_str_t *buffer, hid_t type, int ind)
{
char *name=NULL; /* member name */
size_t size; /* total size of type in bytes */
hid_t subtype; /* member data type */
int nmembs; /* number of members */
int n; ... | false | false | false | false | false | 0 |
finish_template_type_parm (tree aggr, tree identifier)
{
if (aggr != class_type_node)
{
permerror (input_location, "template type parameters must use the keyword %<class%> or %<typename%>");
aggr = class_type_node;
}
return build_tree_list (aggr, identifier);
} | false | false | false | false | false | 0 |
effectiveSystemIdPointer() const
{
if (externalId_.effectiveSystemId().size() > 0)
return &externalId_.effectiveSystemId();
return 0;
} | false | false | false | false | false | 0 |
pp_suspend(void *handle)
{
struct pp_instance *pp_handle;
struct pp_eventmgr *eventmgr;
struct pem_event_data event_data = { {0} };
if (handle == NULL)
return -EINVAL;
pp_handle = (struct pp_instance *)handle;
eventmgr = pp_handle->eventmgr;
pem_handle_event(eventmgr, AMD_PP_EVENT_SUSPEND, &event_data);
ret... | false | false | false | false | false | 0 |
load_bitmap_info()
{
FirmBitmapRec *firmBitmapRec;
FirmDieBitmap *firmBitmap;
int i;
uint32_t bitmapOffset;
Database *dbFirmBitmap = game_set.open_db(FIRM_BITMAP_DB);
firm_bitmap_count = (short) dbFirmBitmap->rec_count();
firm_bitmap_array = (FirmDieBitmap*) mem_add( sizeof(FirmDieBitmap)*firm_bitma... | false | false | false | false | false | 0 |
finalize_nrv_r (tree *tp, int *walk_subtrees, void *data)
{
struct walk_stmt_info *wi = (struct walk_stmt_info *) data;
struct nrv_data *dp = (struct nrv_data *) wi->info;
/* No need to walk into types. */
if (TYPE_P (*tp))
*walk_subtrees = 0;
/* Otherwise replace all occurrences of VAR with RESULT. *... | false | false | false | false | false | 0 |
print_default(struct isl_arg *decl, const char *def, int pos)
{
const char *default_prefix = "[default: ";
const char *default_suffix = "]";
int len;
len = strlen(default_prefix) + strlen(def) + strlen(default_suffix);
if (!decl->help_msg) {
if (pos >= 29)
printf("\n%30s", "");
else
printf("%*s", 30 - ... | false | false | false | false | false | 0 |
_nrrdGzDoFlush(gzFile file, int flush) {
static const char me[]="_nrrdGzDoFlush";
uInt len;
int done = 0;
_NrrdGzStream *s = (_NrrdGzStream*)file;
if (s == NULL || s->mode != 'w') {
biffAddf(NRRD, "%s: invalid stream or file mode", me);
return Z_STREAM_ERROR;
}
s->stream.avail_in = 0; /* should ... | false | false | false | false | false | 0 |
_bd_cb_dialog_close(void *data __UNUSED__, E_Dialog *dia)
{
if (dia->data)
_free_data(dia, dia->data);
e_object_del(E_OBJECT(dia));
} | false | false | false | false | false | 0 |
bdb_env_init(void){
int ret;
/* db env init */
if ((ret = db_env_create(&envp, 0)) != 0) {
fprintf(stderr, "db_env_create: %s\n", db_strerror(ret));
exit(EXIT_FAILURE);
}
/* set err&msg display */
envp->set_errpfx(envp, PACKAGE);
/* env->set_errfile(env, stderr); */
/* e... | false | false | false | false | false | 0 |
ghosted( unsigned char *dest, unsigned char *src,
unsigned char transparency )
{
double alphamax = ((double) 255*((double) 255/(double) transparency));
for( int y = height; y--; dest += padding )
for( int x = width; x--; )
if( !(*((int *) src) & 0xff000000) )
{
src += 4;
dest += 2;
}
else
... | false | false | false | false | false | 0 |
OGRLayerShadow_GetExtent(OGRLayerShadow *self,double argout[4],int *isvalid=NULL,int force=1,int can_return_null=0){
OGRErr eErr = OGR_L_GetExtent(self, (OGREnvelope*)argout, force);
if (can_return_null)
*isvalid = (eErr == OGRERR_NONE);
else
*isvalid = TRUE;
return;
} | false | false | false | false | false | 0 |
rend_service_intro_established(origin_circuit_t *circuit,
const uint8_t *request,
size_t request_len)
{
rend_service_t *service;
char serviceid[REND_SERVICE_ID_LEN_BASE32+1];
(void) request;
(void) request_len;
if (circuit->_base.purpose != CIRCUI... | false | false | false | false | false | 0 |
where_the_bit_differ(char *str1, char *str2)
{
int p = 0;
int bitloc;
int slen1, slen2;
/* step: char, bit */
while(str1[p] == str2[p]) p++;
bitloc = p * 8;
slen1 = strlen(str1);
slen2 = strlen(str2);
while(testbit(str1, slen1, bitloc) == testbit(str2, slen2, bitloc)) bitloc++;
return(bitloc);
} | false | false | false | false | false | 0 |
gnomemeeting_progress_dialog (GtkWindow *parent,
const char *prim_text,
const char *format,
...)
{
GtkWidget *dialog = NULL;
GtkWidget *label = NULL;
GtkWidget *progressbar = NULL;
gchar *primary_text = NULL;
gchar *dialog_text = NULL;
char buffer [1025];
guint id = 0;
va_... | true | true | false | false | false | 1 |
omap_hsmmc_do_irq(struct omap_hsmmc_host *host, int status)
{
struct mmc_data *data;
int end_cmd = 0, end_trans = 0;
int error = 0;
data = host->data;
dev_vdbg(mmc_dev(host->mmc), "IRQ Status is %x\n", status);
if (status & ERR_EN) {
omap_hsmmc_dbg_report_irq(host, status);
if (status & (CTO_EN | CCRC_EN))... | false | false | false | false | false | 0 |
_c4iw_write_mem_dma(struct c4iw_rdev *rdev, u32 addr, u32 len, void *data)
{
u32 remain = len;
u32 dmalen;
int ret = 0;
dma_addr_t daddr;
dma_addr_t save;
daddr = dma_map_single(&rdev->lldi.pdev->dev, data, len, DMA_TO_DEVICE);
if (dma_mapping_error(&rdev->lldi.pdev->dev, daddr))
return -1;
save = daddr;
w... | false | false | false | false | false | 0 |
save_cycles (int *len, uae_u8 *dstptr)
{
uae_u8 *dstbak, *dst;
if (dstptr)
dstbak = dst = dstptr;
else
dstbak = dst = xmalloc (uae_u8, 1000);
save_u32 (1);
save_u32 (CYCLE_UNIT);
save_u64 (get_cycles ());
save_u32 (extra_cycle);
write_log (_T("SAVECYCLES %08lX\n"), get_cycles ());
*len = dst - dstbak;
ret... | false | false | false | false | false | 0 |
ValidateFieldOptions(FieldDescriptor* field,
const FieldDescriptorProto& proto) {
if (field->options().has_experimental_map_key()) {
ValidateMapKey(field, proto);
}
// Only repeated primitive fields may be packed.
if (field->options().packed() && !field->is_packable()) {
AddError(
field->full... | false | false | false | false | false | 0 |
index_thread_free(Thread *thread)
{
Thread *child;
/* free the head node */
if (thread->msgdata) index_msgdata_free(thread->msgdata);
/* free the children recursively */
child = thread->child;
while (child) {
index_thread_free(child);
child = child->next;
}
} | false | false | false | false | false | 0 |
pgd_text_free (PgdTextDemo *demo)
{
if (!demo)
return;
if (demo->doc) {
g_object_unref (demo->doc);
demo->doc = NULL;
}
if (demo->buffer) {
g_object_unref (demo->buffer);
demo->buffer = NULL;
}
if (demo->text_attrs) {
poppler_page_free_text_attributes (demo->text_attrs);
... | false | false | false | false | false | 0 |
resize_image( uchar* &image, int h, int w, int nh, int nw, bool in_place )
{
uchar* out = kutility::zeros<uchar>( nh*nw );
double ratioy = h / (double)nh;
double ratiox = w / (double)nw;
int y, x, ynw;
double ny, nx;
#ifdef USE_OPENMP
#pragma omp parallel for private( y, x, ny, ... | false | false | false | false | false | 0 |
find_frozen(char *name)
{
struct _frozen *p;
for (p = PyImport_FrozenModules; ; p++) {
if (p->name == NULL)
return NULL;
if (strcmp(p->name, name) == 0)
break;
}
return p;
} | false | false | false | false | false | 0 |
agp_find_controller_by_pid(pid_t id)
{
struct agp_controller *controller;
controller = agp_fe.controllers;
while (controller != NULL) {
if (controller->pid == id)
return controller;
controller = controller->next;
}
return NULL;
} | false | false | false | false | false | 0 |
yp_unbind_locked (const char *indomain)
{
dom_binding *ydbptr, *ydbptr2;
ydbptr2 = NULL;
ydbptr = ypbindlist;
while (ydbptr != NULL)
{
if (strcmp (ydbptr->dom_domain, indomain) == 0)
{
dom_binding *work;
work = ydbptr;
if (ydbptr2 == NULL)
ypbindlist = ypbindlist->dom_pnext;
else
... | false | false | false | false | false | 0 |
stmpe_work(struct work_struct *work)
{
int int_sta;
u32 timeout = 40;
struct stmpe_touch *ts =
container_of(work, struct stmpe_touch, work.work);
int_sta = stmpe_reg_read(ts->stmpe, STMPE_REG_INT_STA);
/*
* touch_det sometimes get desasserted or just get stuck. This appears
* to be a silicon bug, We st... | false | false | false | false | false | 0 |
free_mem_page(Uint8 **page,Uint16 nb_page)
{
int i;
for(i=0;i<nb_page;i++) {
free(page[i]);
page[i]=NULL;
}
free(page);
} | false | false | false | false | false | 0 |
xmlRead(const QDomElement &father, const QString &name, const int defaultValue)
{
QString defaultStr = QString::number(defaultValue);
QString strValue = Utils::xmlRead(father, name, defaultStr);
bool ok;
int val = strValue.toInt(&ok);
if (ok)
return val;
else
return defaultValue;... | false | false | false | false | false | 0 |
initialization (JPEG_ENCODER_STRUCTURE * jpeg, UINT32 image_format,
UINT32 image_width, UINT32 image_height)
{
UINT16 mcu_width, mcu_height, bytes_per_pixel;
lcode = 0;
bitindex = 0;
if (image_format == FOUR_ZERO_ZERO || image_format == FOUR_FOUR_FOUR)
{
jpeg->mcu_width = mcu_width = ... | false | false | false | false | false | 0 |
gretl_get_random_matrix (int dist, const double *parm,
int rows, int cols,
int *err)
{
gretl_matrix *m = NULL;
int n = rows * cols;
if (n <= 0) {
*err = E_INVARG;
} else {
m = gretl_matrix_alloc(rows, cols);
if (m == NULL) {
*err = E_ALLOC;
return NULL;
} else {
... | false | false | false | false | false | 0 |
snippets_make_replacements(GeanyEditor *editor, GString *pattern)
{
GHashTable *specials;
/* replace 'special' completions */
specials = g_hash_table_lookup(snippet_hash, "Special");
if (G_LIKELY(specials != NULL))
{
g_hash_table_foreach(specials, snippets_replace_specials, pattern);
}
/* now transform other... | false | false | false | false | false | 0 |
format_min(char *str, double dval)
{
double dtmp;
sprintf(str, "%.17g", dval);
/* Note that G_trim_decimal() does not trim e.g. 1.0000000e-20 */
G_trim_decimal(str);
sscanf(str, "%lf", &dtmp);
if (dtmp != dval) { /* if no zeros after decimal point were trimmed */
/* lower dval by GRASS_EPSILO... | false | false | false | false | false | 0 |
UpdateAI(const uint32 uiDiff) override
{
if (m_bBothDead) // This is the case while fighting Thaddius
{
return;
}
if (m_bFakeDeath)
{
if (m_uiReviveTimer < uiDiff)
{
if (Creature* pOther =... | false | false | false | false | false | 0 |
sq_resume(HSQUIRRELVM v,SQBool retval,SQBool raiseerror)
{
if(type(v->GetUp(-1))==OT_GENERATOR){
v->Push(_null_); //retval
if(!v->Execute(v->GetUp(-2),v->_top,0,v->_top,v->GetUp(-1),raiseerror,SQVM::ET_RESUME_GENERATOR))
{v->Raise_Error(v->_lasterror); return SQ_ERROR;}
if(!retval)
v->Pop();
return SQ_OK;... | false | false | false | false | false | 0 |
json_keytab(krb5_context context, krb5_keytab keytab, k5_json_value *val_out)
{
krb5_error_code ret;
k5_json_string str;
char name[1024];
*val_out = NULL;
if (keytab == NULL)
return k5_json_null_create_val(val_out);
ret = krb5_kt_get_name(context, keytab, name, sizeof(name));
if (re... | true | true | true | false | false | 1 |
games_scores_set_category (GamesScores * self, const gchar * category)
{
GamesScoresPrivate *priv = self->priv;
g_return_if_fail (self != NULL);
if (category == NULL)
category = priv->defcat;
g_free (priv->currentcat);
priv->currentcat = g_strdup (category);
/* FIXME: Check validity of category (Nul... | false | false | false | false | false | 0 |
_pager_popup_cb_mouse_down(void *data __UNUSED__, int type __UNUSED__, void *event)
{
Ecore_Event_Mouse_Button *ev;
Pager_Popup *pp = act_popup;
ev = event;
if (ev->window != input_window) return ECORE_CALLBACK_PASS_ON;
evas_event_feed_mouse_down(pp->popup->evas, ev->buttons,
... | false | false | false | false | false | 0 |
bonobo_dock_forall (GtkContainer *container,
gboolean include_internals,
GtkCallback callback,
gpointer callback_data)
{
BonoboDock *dock;
GList *lp;
g_return_if_fail (container != NULL);
g_return_if_fail (BONOBO_IS_DOCK (container));
g_return_if_fail ... | false | false | false | false | false | 0 |
getPrevContainerInSection(void) const
{
if (getPrev())
{
return static_cast<fp_Container *>(getPrev());
}
fl_ContainerLayout* pPrev = static_cast<fl_ContainerLayout *>(m_pBlock->getPrev());
while(pPrev &&
((pPrev->getContainerType() == FL_CONTAINER_ENDNOTE) ||
(pPrev->getContainerType() == FL_CONTAI... | false | false | false | false | false | 0 |
dpm_get_gfr_by_pfn(dbfd, bol, pfn, gfr_entry, lock, rec_addr, endlist, dblistptr)
struct dpm_dbfd *dbfd;
int bol;
char *pfn;
struct dpm_get_filereq *gfr_entry;
int lock;
dpm_dbrec_addr *rec_addr;
int endlist;
DBLISTPTR *dblistptr;
{
char escaped_name[CA_MAXSFNLEN*2+1];
char func[19];
static char query[] =
"SELECT... | false | false | false | false | false | 0 |
openOriginalToCurrentMappingFiles()
{
dmtcp::ostringstream pidMapFile, pidMapCountFile;
dmtcp::ostringstream shmidListFile, shmidMapFile;
int fd;
shmidMapFile << dmtcpTmpDir << "/dmtcpShmidMap."
<< compGroup << "." << std::hex << coordTstamp;
shmidListFile << dmtcpTmpDir << "/dmtcpShmidList."
<< co... | false | false | false | false | false | 0 |
xaccTransSetIsClosingTxn (Transaction *trans, gboolean is_closing)
{
if (!trans) return;
xaccTransBeginEdit(trans);
if (is_closing)
kvp_frame_set_gint64 (trans->inst.kvp_data, trans_is_closing_str, 1);
else
kvp_frame_replace_value_nc (trans->inst.kvp_data, trans_is_closing_str, NULL);
... | false | false | false | false | false | 0 |
backtick(sl* cmd, anbool verbose) {
char* cmdstr = sl_implode(cmd, " ");
sl* lines;
logverb("Running: %s\n", cmdstr);
if (run_command_get_outputs(cmdstr, &lines, NULL)) {
ERROR("Failed to run command: %s", cmdstr);
free(cmdstr);
exit(-1);
}
free(cmdstr);
sl_remove_all... | false | false | false | false | false | 0 |
PCR_Primer_create(PCR_Experiment *pcr_experiment,
gchar *primer){
register PCR_Primer *pcr_primer = g_new(PCR_Primer, 1);
g_assert(pcr_experiment);
g_assert(primer);
pcr_primer->pcr_experiment = pcr_experiment;
pcr_primer->length = strlen(primer);
if((pcr_exp... | false | false | false | false | false | 0 |
ario_shell_lyrics_add_to_queue (ArioShellLyrics *shell_lyrics)
{
ARIO_LOG_FUNCTION_START;
ArioLyricsEditorData *data;
gchar *window_title;
data = (ArioLyricsEditorData *) g_malloc0 (sizeof (ArioLyricsEditorData));
if (!ario_server_is_connected ()
|| ario_server_get_... | false | false | false | false | false | 0 |
read(bool readProperties, Properties::ReadStyle propertiesStyle)
{
ByteVector opusHeaderData = packet(0);
if(!opusHeaderData.startsWith("OpusHead")) {
setValid(false);
debug("Opus::File::read() -- invalid Opus identification header");
return;
}
ByteVector commentHeaderData = packet(1);
if(!comm... | false | false | false | false | false | 0 |
setOversamp (int osamp)
{
FTprocI::setOversamp(osamp);
for (unsigned int i=1; i<A_TBL; i++) {
_as[i] = expf(-1.0f / ((_sampleRate/(_oversamp*(float)_fftN)) * (float)i / (float)A_TBL));
}
} | false | false | false | false | false | 0 |
GetContainer(CWIDGET *control)
{
if (!control) return NULL;
if (!CLASS_UserContainer) CLASS_UserContainer=GB.FindClass("UserContainer");
if (!CLASS_UserControl) CLASS_UserControl=GB.FindClass("UserControl");
if ( GB.Is (control,CLASS_UserContainer) || GB.Is (control,CLASS_UserControl) )
return (CWIDGET*)((CUS... | false | false | false | false | false | 0 |
read_rules(const string &infile)
{
ifstream ifs, ifs1, *ifsP;
vector<string> vs;
char buffer[BUFF_SIZE];
char tmp_str[BUFF_SIZE];
string patty_dir;
OBSmartsPattern *sp;
ifs.open(infile.c_str());
ifsP= &ifs;
if (!ifs)
{
if (getenv("BABEL_DATADIR") == NULL)
{... | false | false | false | false | false | 0 |
shpchp_enable_slot (struct slot *p_slot)
{
u8 getstatus = 0;
int rc, retval = -ENODEV;
struct controller *ctrl = p_slot->ctrl;
/* Check to see if (latch closed, card present, power off) */
mutex_lock(&p_slot->ctrl->crit_sect);
rc = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus);
if (rc || !getstatus) {... | false | false | false | false | false | 0 |
gkm_credential_real_get_attribute (GkmObject *base, GkmSession *session, CK_ATTRIBUTE *attr)
{
GkmCredential *self = GKM_CREDENTIAL (base);
CK_OBJECT_HANDLE handle;
gconstpointer value;
gsize n_value;
switch (attr->type) {
case CKA_CLASS:
return gkm_attribute_set_ulong (attr, CKO_G_CREDENTIAL);
case CKA_PRI... | false | false | false | false | false | 0 |
first_arch_pass(FILE *fp) {
archetype *at, *head = NULL, *last_more = NULL;
int i, first = LO_NEWFILE;
at = get_archetype_struct();
first_archetype = at;
while ((i = load_object(fp, &at->clone, first, 0))) {
first = 0;
at->clone.speed_left = (float)(-0.1);
switch (i) {
... | false | false | false | true | false | 1 |
init_dma_setup_reg(struct cpssp * _sb, int dma8, int dma16)
{
int dma_setup_reg = 0;
switch (dma8) {
case 0:
dma_setup_reg |= 0x1;
break;
case 1:
dma_setup_reg |= 0x2;
break;
case 3:
dma_setup_reg |= 0x8;
break;
default:
/* No available DMA channel */
assert(0);
break;
}
switch (dma16) {
cas... | false | false | false | false | false | 0 |
dbg_help(void)
{
C **sv,**svb;
for(sv=dbg_helpmsg0;*sv;++sv) H("\343 %s\n",*sv);
for(sv=dbg_helpflagsA,svb=dbg_helpflagsB;
*sv||*svb;
sv+=(*sv)?1:0,svb+=(*svb?1:0))
H("\343 %-32s%s\n",*sv?*sv:"",*svb?*svb:"");
for(sv=dbg_helpmsg1;*sv;++sv) H("\343 %s\n",*sv);
H("\343 Current Settings\n");
db... | false | false | false | false | false | 0 |
insert_sort(unsigned char *first_p, unsigned char *last_p,
unsigned char *holder_p,
const unsigned int ele_size)
{
unsigned char *inner_p, *outer_p;
for (outer_p = first_p + ele_size; outer_p <= last_p; ) {
/* look for the place to insert the entry */
for (inner_p = outer_p - ele_size;... | false | false | false | false | false | 0 |
simulatorAddSource(simulator_ *r,
char *refdes,
char *pNode, char *nNode,
char type, double *dc, char stimulus, double *args[7])
{
device_ *device;
ReturnErrIf(r == NULL);
ReturnErrIf(r->locked, "Can't add a device to a simulator that has run.");
/* Create a new device and add it to the device list*/
devic... | false | false | false | false | false | 0 |
IsTimerEnabled() {
itimerval current_timer;
EXPECT_EQ(0, getitimer(timer_type_, ¤t_timer));
if ((current_timer.it_value.tv_sec == 0) &&
(current_timer.it_value.tv_usec != 0)) {
// May be the timer has expired. Sleep for a bit and check again.
Delay(kTimerResetInterval);
EXPECT_EQ(0, getiti... | false | false | false | false | false | 0 |
modelPrintP ( void * modelptr, FILE * fp )
{
model_t * mp = ( model_t * ) modelptr;
if ( !mp ) return;
fprintf ( fp, "#\n");
fprintf ( fp, "# modelID %d\n", mp->self);
fprintf ( fp, "#\n");
fprintf ( fp, "self = %d\n", mp->self );
fprintf ( fp, "used = %d\n", mp->used );
fprintf ( ... | false | false | false | false | false | 0 |
TextEmitPass(RegExpCompiler* compiler,
TextEmitPassType pass,
bool preloaded,
Trace* trace,
bool first_element_checked,
int* checked_up_to) {
RegExpMacroAssembler* assembler = co... | false | false | false | false | false | 0 |
genericProcessKeyword(size_t msgNum,
updateKeywordHelper &helper)
{
if (msgNum >= index.size())
return true;
helper.doUpdateKeyword(index[msgNum].keywords, keywordHashtable);
return true;
} | false | false | false | false | false | 0 |
max77802_rtc_stop_alarm(struct max77802_rtc_info *info)
{
int ret;
if (!mutex_is_locked(&info->lock))
dev_warn(info->dev, "%s: should have mutex locked\n", __func__);
ret = max77802_rtc_update(info, MAX77802_RTC_READ);
if (ret < 0)
goto out;
ret = regmap_write(info->max77802->regmap,
MAX77802_RTC_AE1,... | false | false | false | false | false | 0 |
loc_delschnet( HeadNet )
schnet_list *HeadNet;
{
schnet_list *ScanNet;
schnet_list *DelNet;
ScanNet = HeadNet;
while ( ScanNet != (schnet_list *)0 )
{
DelNet = ScanNet;
ScanNet = ScanNet->NEXT;
loc_delschwir( DelNet->WIRE );
if ( DelNet->CON_NET != (chain_list *)0 )
{
... | false | false | false | false | false | 0 |
dlz_findzonedb(void *dbdata, const char *name) {
struct dlz_example_data *state = (struct dlz_example_data *)dbdata;
if (strcasecmp(state->zone_name, name) == 0)
return (ISC_R_SUCCESS);
return (ISC_R_NOTFOUND);
} | false | false | false | false | false | 0 |
get_lens(struct lens *lens, struct state *state) {
struct tree *tree = NULL;
switch(lens->tag) {
case L_DEL:
tree = get_del(lens, state);
break;
case L_STORE:
tree = get_store(lens, state);
break;
case L_VALUE:
tree = get_value(lens, state);
break;
... | false | false | false | false | false | 0 |
pilQcGroupEnd()
{
if (!pafFile)
return EXIT_FAILURE;
if (!pilPAFIsEmpty(pafFile)) {
pilPAFWrite(pafFile);
pafIndex++;
}
deletePilPAF(pafFile);
pafFile = NULL;
return EXIT_SUCCESS;
} | false | false | false | false | false | 0 |
check_repository_dirs(git_repository *repo)
{
char path_aux[GIT_PATH_MAX];
if (gitfo_isdir(repo->path_repository) < GIT_SUCCESS)
return GIT_ENOTAREPO;
/* Ensure GIT_OBJECT_DIRECTORY exists */
if (gitfo_isdir(repo->path_odb) < GIT_SUCCESS)
return GIT_ENOTAREPO;
/* Ensure HEAD file exists */
git__joinpath(pa... | true | true | false | false | false | 1 |
l2tp_session_apses_finished(void *data)
{
struct l2tp_conn_t *conn = l2tp_tunnel_self();
struct l2tp_sess_t *sess;
intptr_t sid = (intptr_t)data;
sess = l2tp_tunnel_get_session(conn, sid);
if (sess == NULL)
return;
/* Here, the only valid session state is STATE_ESTB. If the session's
* state was STATE_CLOSE... | false | false | false | false | false | 0 |
_eio_eet_data_write_cipher_job(void *data, Ecore_Thread *thread)
{
Eio_Eet_Write *ew = data;
ew->result = eet_data_write_cipher(ew->ef, ew->edd,
ew->name, ew->cipher_key,
ew->write_data,
ew->compress... | false | false | false | false | false | 0 |
ahlog(ArchiveHandle *AH, int level, const char *fmt,...)
{
va_list ap;
if (AH->debugLevel < level && (!AH->public.verbose || level > 1))
return;
va_start(ap, fmt);
_write_msg(NULL, fmt, ap);
va_end(ap);
} | false | false | false | false | false | 0 |
process_family(blist, ofp, pfp)
struct blocks_list *blist;
FILE *ofp, *pfp;
{
if (blist != NULL && blist->nblock > 0)
{
switch (Type)
{
case 1: /* percentage */
printf("Type 1: Consensus based on percentage: %d\n",
(int) (100. * CProp) );
break;
case 2: /* subst. with counts */
... | false | false | false | false | false | 0 |
free_rx_resources(struct sge *sge)
{
struct pci_dev *pdev = sge->adapter->pdev;
unsigned int size, i;
if (sge->respQ.entries) {
size = sizeof(struct respQ_e) * sge->respQ.size;
pci_free_consistent(pdev, size, sge->respQ.entries,
sge->respQ.dma_addr);
}
for (i = 0; i < SGE_FREELQ_N; i++) {
struct fr... | false | false | false | false | false | 0 |
gcr_unlock_options_widget_set_ttl (GcrUnlockOptionsWidget *self, guint ttl)
{
GtkSpinButton *spin;
guint amount;
g_return_if_fail (GCR_IS_UNLOCK_OPTIONS_WIDGET (self));
amount = ttl / 60;
if (!amount || ttl % 60)
amount += 1;
spin = builder_get_spin_button (self->pv->builder, "lock_minutes_spin");
gtk_spin_... | false | false | false | false | false | 0 |
isAliasThisTuple(Expression *e)
{
if (!e->type)
return NULL;
Type *t = e->type->toBasetype();
Lagain:
if (Dsymbol *s = t->toDsymbol(NULL))
{
AggregateDeclaration *ad = s->isAggregateDeclaration();
if (ad)
{
s = ad->aliasthis;
if (s && s->isVarDecl... | false | false | false | false | false | 0 |
elementWindowEnd()
{
// pop a window from the window stack
if (!d_stack.empty())
{
d_stack.back().first->endInitialisation();
d_stack.pop_back();
}
} | false | false | false | false | false | 0 |
goa_oauth_provider_ensure_credentials_sync (GoaProvider *_provider,
GoaObject *object,
gint *out_expires_in,
GCancellable *cancellable,
... | false | false | false | false | false | 0 |
csr1212_new_extended_immediate(u_int32_t spec, u_int32_t key,
u_int32_t value)
{
struct csr1212_keyval *kvs, *kvk, *kvv;
kvs = csr1212_new_immediate(CSR1212_KV_ID_EXTENDED_KEY_SPECIFIER_ID, spec);
kvk = csr1212_new_immediate(CSR1212_KV_ID_EXTENDED_KEY, key);
kvv = csr1212_new_immediate(CSR1212_KV_ID_EX... | false | false | false | false | false | 0 |
mt9m032_update_geom_timing(struct mt9m032 *sensor)
{
struct i2c_client *client = v4l2_get_subdevdata(&sensor->subdev);
int ret;
ret = mt9m032_write(client, MT9M032_COLUMN_SIZE,
sensor->crop.width - 1);
if (!ret)
ret = mt9m032_write(client, MT9M032_ROW_SIZE,
sensor->crop.height - 1);
if (!ret)
r... | false | false | false | false | false | 0 |
pp_c_cv_qualifier (c_pretty_printer *pp, const char *cv)
{
const char *p = pp_last_position_in_text (pp);
if (p != NULL && *p == '*')
pp_c_whitespace (pp);
pp_c_identifier (pp, cv);
} | false | false | false | false | false | 0 |
qfits_zeropad(const char * filename)
{
struct stat sta;
int size;
int remaining;
FILE * out;
char * buf;
if (filename==NULL) return;
/* Get file size in bytes */
if (stat(filename, &sta)!=0) {
return;
}
size = (int)sta.st_size;
/* Compute n... | false | false | false | false | false | 0 |
Cddb_Destroy_Window (GtkWidget *widget, GdkEvent *event, gpointer data)
{
CddbStopSearch = TRUE;
if (CddbWindow)
{
Cddb_Window_Apply_Changes();
if (CddbAlbumList)
{
Cddb_Free_Album_List ();
CddbAlbumList = NULL;
}
gtk_widget_destroy(CddbWind... | false | false | false | false | false | 0 |
slotHelpAbout()
{
QMessageBox::information(this,
tr("FractalGenerator II"),
tr("FractalGenerator II\n") +
"Copyright (C) 2003-2011 by Thomas Dreibholz",
tr("Okay"));
} | false | false | false | false | false | 0 |
revertToDefault(const char *key)
{
Q_ASSERT_X(isValid(), "KConfigGroup::revertToDefault", "accessing an invalid group");
Q_ASSERT_X(!d->bConst, "KConfigGroup::revertToDefault", "writing to a read-only group");
config()->d_func()->revertEntry(d->fullName(), key);
} | false | false | false | false | false | 0 |
GetCurrentFrame()
{
jack_time_t time = GetMicroSeconds();
JackEngineControl *control = GetEngineControl();
JackTimer timer;
control->ReadFrameTime(&timer);
return timer.Time2Frames(time, control->fBufferSize);
} | false | false | false | false | false | 0 |
max14577_i2c_remove(struct i2c_client *i2c)
{
struct max14577 *max14577 = i2c_get_clientdata(i2c);
mfd_remove_devices(max14577->dev);
regmap_del_irq_chip(max14577->irq, max14577->irq_data);
if (max14577->dev_type == MAXIM_DEVICE_TYPE_MAX77836)
max77836_remove(max14577);
return 0;
} | false | false | false | false | false | 0 |
runtime_error (int errnum)
{
int wasfirst;
if (errnum <= 0 || errnum > ERR_NUM_ERRORS)
return;
if (option_err_report_mode == ERR_REPORT_FATAL
|| (!option_ignore_errors && errnum <= ERR_MAX_FATAL)) {
flush_buffer ();
os_fatal (err_messages[errnum - 1]);
return;
}
wasfirst = (error_count[e... | false | false | false | false | false | 0 |
get_mime_type_from_magic_numbers (char *buffer)
{
static struct {
const char *mime_type;
const char *first_bytes;
int offset;
int len;
} sniffer_data [] = {
{ "application/x-bzip2", "BZh", 0, 3 },
{ "application/x-gzip", "\037\213", 0, 2 },
{ "application/x-xz", "\3757zXZ\000", 0, 6 },
... | 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.