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 |
|---|---|---|---|---|---|---|
edifsavelofig( firstlofig )
lofig_list *firstlofig;
{
chain_list *chainl;
chain_list *chainp;
char filename[ 255 ];
char *pc;
int index;
edif_debug = mbkgetenv( DEBUG_MBKEDIF ) != NULL;
EDIF_LIBNAME = mbkgetenv( MBK_EDIF_LIBNAME );
if( !EDIF_LIBNAME )
EDIF_LIBNAME = namealloc( "... | false | false | false | false | false | 0 |
Nviz_set_vpoint_attr_default(int id)
{
int i;
geosite *gp;
gp = gp_get_site(id);
if (!gp)
return 0;
for (i = 0; i < GPT_MAX_ATTR; i++)
gp->use_attr[i] = ST_ATT_NONE;
return 1;
} | false | false | false | false | false | 0 |
PyvtkTimePointUtility_TimePointToISO8601(PyObject *, PyObject *args)
{
vtkPythonArgs ap(args, "TimePointToISO8601");
unsigned long long temp0;
int temp1 = vtkTimePointUtility::ISO8601_DATETIME_MILLIS;
PyObject *result = NULL;
if (ap.CheckArgCount(1, 2) &&
ap.GetValue(temp0) &&
(ap.NoArgsLeft() |... | false | false | false | false | false | 0 |
mlx4_master_activate_admin_state(struct mlx4_priv *priv, int slave)
{
int port, err;
struct mlx4_vport_state *vp_admin;
struct mlx4_vport_oper_state *vp_oper;
struct mlx4_active_ports actv_ports = mlx4_get_active_ports(
&priv->dev, slave);
int min_port = find_first_bit(actv_ports.ports,
priv->dev.caps... | false | false | false | false | true | 1 |
CKYCardContext_Destroy(CKYCardContext *ctx)
{
CKYStatus ret = CKYSUCCESS;
if (ctx == NULL) {
return CKYSUCCESS;
}
if (ctx->context) {
ret = ckyCardContext_release(ctx);
}
free(ctx);
return ret;
} | false | false | false | false | false | 0 |
cycle_triphone(char *p)
{
int i;
if (p == NULL) { /* initialize */
nophone[0]='\0';
for(i=0;i<3;i++) trbuf[i][0] = '\0';
trp_l = 0;
trp = 1;
trp_r = 2;
return NULL;
}
strcpy(trbuf[trp_r],p);
chbuf[0]='\0';
if (trbuf[trp_l][0] != '\0') {
strcat(chbuf,trbuf[trp_l]);
str... | false | true | false | false | false | 1 |
log_table_entry(const apr_table_t *table, const char *name,
char *buf, int buflen)
{
#ifndef AP_UNSAFE_ERROR_LOG_UNESCAPED
const char *value;
char scratch[MAX_STRING_LEN];
if ((value = apr_table_get(table, name)) != NULL) {
ap_escape_errorlog_item(scratch, value, MAX_STRI... | true | true | false | false | false | 1 |
vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i)
{
struct usb_usbvision *usbvision = video_drvdata(file);
usbvision->streaming = stream_on;
call_all(usbvision, video, s_stream, 1);
return 0;
} | false | false | false | false | false | 0 |
ois_close(SMSCenter *smsc)
{
ois_debug_level = smsc->ois_flags & OIS_FLAG_DEBUG;
SAY(2, "ois_close");
if (smsc->type != SMSC_TYPE_OIS) {
warning(0, "ois_close: closing a not-ois connection...");
}
ois_swap_buffering(smsc);
smscenter_remove_from_buffer(smsc, smsc->buflen);
ois_swap_bufferi... | false | false | false | false | false | 0 |
test_online_fetch__can_cancel(void)
{
git_remote *remote;
size_t bytes_received = 0;
cl_git_pass(git_remote_create(&remote, _repo, "test",
"http://github.com/libgit2/TestGitRepository.git"));
cl_git_pass(git_remote_connect(remote, GIT_DIRECTION_FETCH));
cl_git_fail_with(git_remote_download(remote, cancel_at_h... | false | false | false | false | false | 0 |
Entry(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& /* builder */)
:
Gtk::Entry(cobject),
m_glom_type(Field::TYPE_TEXT)
{
#ifndef GLOM_ENABLE_CLIENT_ONLY
setup_menu();
#endif // !GLOM_ENABLE_CLIENT_ONLY
init();
} | false | false | false | false | false | 0 |
check_existing_goa_accounts (AddAccountData *data)
{
GList *goa_accounts = NULL;
GList *l = NULL;
gboolean found = FALSE;
if (data->tp_account == NULL || data->goa_client == NULL)
return FALSE;
goa_accounts = goa_client_get_accounts (data->goa_client);
for (l = goa_accounts; l != NULL; l = l->next)
... | false | false | false | false | false | 0 |
EWMH_RestoreInitialStates(FvwmWindow *fw, int event_type)
{
EWMH_SetWMState(fw, True);
if (HAS_EWMH_INIT_WM_DESKTOP(fw) == EWMH_STATE_HAS_HINT)
{
ewmh_ChangeProperty(
FW_W(fw), "_NET_WM_DESKTOP",
EWMH_ATOM_LIST_CLIENT_WIN,
(unsigned char *)&(fw->ewmh_hint_desktop), 1);
}
else
{
ewmh_DeleteProperty(
... | false | false | false | false | false | 0 |
tm6000_read_write_usb(struct tm6000_core *dev, u8 req_type, u8 req,
u16 value, u16 index, u8 *buf, u16 len)
{
int ret, i;
unsigned int pipe;
u8 *data = NULL;
int delay = 5000;
if (len) {
data = kzalloc(len, GFP_KERNEL);
if (!data)
return -ENOMEM;
}
mutex_lock(&dev->usb_lock);
if (re... | false | false | false | false | false | 0 |
send (const Message * msg, /**< [in] Message to be sent. */
const char * topic, /**< [in] Optional topic of the message. */
bool block) /**< [in] Whether to block thread until message is sent. */
{
LOG4CP... | false | false | false | false | false | 0 |
flag_island()
{
if (flagged_ == true)
return;
schedule_generic(this, 0, false, false);
flagged_ = true;
} | false | false | false | false | false | 0 |
gx_dc_pattern2_clip_with_bbox_simple(const gx_device_color * pdevc, gx_device * pdev,
gx_clip_path *cpath_local)
{
int code = 0;
if (gx_dc_is_pattern2_color(pdevc) && gx_dc_pattern2_color_has_bbox(pdevc) &&
(*dev_proc(pdev, dev_spec_op))(pdev, gxdso_pattern_shading_are... | false | false | false | false | false | 0 |
AtPrepare_UpdateFlatFiles(void)
{
uint16 info = 0;
if (database_file_update_subid != InvalidSubTransactionId)
{
database_file_update_subid = InvalidSubTransactionId;
info |= FF_BIT_DATABASE;
}
if (auth_file_update_subid != InvalidSubTransactionId)
{
auth_file_update_subid = InvalidSubTransactionId;
info... | false | false | false | false | false | 0 |
dspi_transfer_one_message(struct spi_master *master,
struct spi_message *message)
{
struct fsl_dspi *dspi = spi_master_get_devdata(master);
struct spi_device *spi = message->spi;
struct spi_transfer *transfer;
int status = 0;
enum dspi_trans_mode trans_mode;
u32 spi_tcr;
regmap_read(dspi->regmap, SPI_TCR, &sp... | false | false | false | false | false | 0 |
flow_loop_free (struct loop *loop)
{
struct loop_exit *exit, *next;
VEC_free (loop_p, gc, loop->superloops);
/* Break the list of the loop exit records. They will be freed when the
corresponding edge is rescanned or removed, and this avoids
accessing the (already released) head of the list stored in ... | false | false | false | false | false | 0 |
pump_setxattr (call_frame_t *frame, xlator_t *this,
loc_t *loc, dict_t *dict, int32_t flags)
{
afr_private_t * priv = NULL;
afr_local_t * local = NULL;
call_frame_t *transaction_frame = NULL;
int ret = -1;
int op_ret = -1;
int op_errno = 0;
VALIDATE_OR_GOTO (frame, out);
VALIDATE_OR_GOT... | false | false | false | false | false | 0 |
gf2polmod(x,n,y,m)
word2 *x, *y;
int n,m;
{
int N, M, k, s;
if(m == 0)
return n;
N = bit_length(x,n) - 1;
M = bit_length(y,m) - 1;
if(M > N)
return n;
for(k=N; k>=M; --k) {
if(testbit(x,k)) {
s = k-M;
n = bitxorshift(x,n,y,m,s);
}
}
... | false | false | false | false | false | 0 |
config_edit_str_prepare(void)
{
static char prompt[CFGVAR_LEN + 32];
CSTR *pstr;
/* inherited panel = panel_cfg.pd */
pstr = config[panel_cfg.pd->curs].table;
textline = &line_tmp;
sprintf(prompt,"%s (%d chars max%s%s): ",
config[panel_cfg.pd->curs].var,CFGVALUE_LEN,
pstr->extra_val != 0 ? " or " : "",
... | true | true | false | false | false | 1 |
Initialize (Widget request_w, Widget new_w, ArgList args, Cardinal* num_args)
{
XmpGeometryWidget rw = (XmpGeometryWidget)request_w;
XmpGeometryWidget nw = (XmpGeometryWidget)new_w;
ConstraintReconfigure(nw) = False;
Instigator(nw) = NULL;
/* Remember application geometry settings */
ComputeW... | false | false | false | false | false | 0 |
VarRoot(const char *word, Boolean addSpace, Buffer *buf, void *dummy __unused)
{
char *dot;
if (addSpace) {
Buf_AddByte(buf, (Byte)' ');
}
dot = strrchr(word, '.');
if (dot != NULL) {
Buf_AppendRange(buf, word, dot);
} else {
Buf_Append(buf, word);
}
return (TRUE);
} | false | false | false | false | false | 0 |
validateIA(SPtr<TClntCfgIface> ptrIface, SPtr<TClntCfgIA> ptrIA) {
if ( ptrIA->getT2()<ptrIA->getT1() )
{
Log(Crit) << "T1 can't be lower than T2 for IA " << *ptrIA << "on the " << ptrIface->getName()
<< "/" << ptrIface->getID() << " interface." << LogEnd;
return false;
}
... | false | false | false | false | false | 0 |
gst_dfbvideosink_cleanup (GstDfbVideoSink * dfbvideosink)
{
g_return_if_fail (GST_IS_DFBVIDEOSINK (dfbvideosink));
GST_DEBUG_OBJECT (dfbvideosink, "cleaning up DirectFB environment");
/* Wait for our event thread */
if (dfbvideosink->event_thread) {
g_thread_join (dfbvideosink->event_thread);
dfbvideo... | false | false | false | false | false | 0 |
writeParamAllocateCode(Output& out, const TypePtr& type, const string& fixedName, const StringList& metaData,
int typeCtx)
{
out << nl << typeToString(type, metaData, typeCtx) << ' ' << fixedName;
StructPtr st = StructPtr::dynamicCast(type);
if(st && findMetaData(st->getMetaData()) ==... | false | false | false | false | false | 0 |
gst_a2dp_sink_init_fakesink (GstA2dpSink * self)
{
if (self->fakesink != NULL)
return TRUE;
g_mutex_lock (&self->cb_mutex);
self->fakesink = gst_a2dp_sink_init_element (self, "fakesink",
"fakesink", self->capsfilter);
g_mutex_unlock (&self->cb_mutex);
if (!self->fakesink)
return FALSE;
retu... | false | false | false | false | false | 0 |
create_directory(ext2_filsys fs, char *dir,
ext2_ino_t *ret_ino)
{
struct ext2_inode inode;
ext2_ino_t ino = EXT2_ROOT_INO;
ext2_ino_t newdir;
errcode_t retval = 0;
char *fn, *cp, *next;
fn = malloc(strlen(dir) + 1);
if (fn == NULL)
return ENOMEM;
strcpy(fn, dir);
cp = fn;
while(1) {
next = ... | false | true | false | false | false | 1 |
goo_canvas_table_get_child_property (GooCanvasItem *item,
GooCanvasItem *child,
guint property_id,
GValue *value,
GParamSpec *pspec)
{
GooCanvasGroup *group = (GooCanvasGroup*) item;
GooCanvasTable *table = (GooCanvasTable*) item;
GooCanva... | false | false | false | false | false | 0 |
ast_read_image(const char *filename, const char *preflang, struct ast_format *format)
{
struct ast_imager *i;
char buf[256];
char tmp[80];
char *e;
struct ast_imager *found = NULL;
int fd;
int len=0;
struct ast_frame *f = NULL;
AST_RWLIST_RDLOCK(&imagers);
AST_RWLIST_TRAVERSE(&imagers, i, list) {
/* if NUL... | false | false | false | false | false | 0 |
id_get_uidl (int n, char * uidl) {
int i;
rnd_init(n ^ 0xabcd);
for (i=0; i<20; i++) {
uidl[i] = id_char[(int) (62.0*rand()/(RAND_MAX+1.0))];
}
uidl[i] = 0;
} | false | false | false | false | false | 0 |
Set( const wxString& name, const wxVariant& value )
{
wxVariantData* data = value.GetData();
// Free old, if any
wxPGHashMapS2P::iterator it = m_map.find(name);
if ( it != m_map.end() )
{
((wxVariantData*)it->second)->DecRef();
if ( !data )
{
// If Null variant,... | false | false | false | false | false | 0 |
__ecereInstMeth___ecereNameSpace__ecere__gui__Timer_DelayExpired__00000002(struct __ecereNameSpace__ecere__com__Instance * this)
{
struct __ecereNameSpace__ecere__sys__RepButton * __ecerePointer___ecereNameSpace__ecere__sys__RepButton = (struct __ecereNameSpace__ecere__sys__RepButton *)(this ? (((char *)this) + __ecere... | false | false | false | false | false | 0 |
xmlRelaxNGValidErrorPush(xmlRelaxNGValidCtxtPtr ctxt,
xmlRelaxNGValidErr err, const xmlChar * arg1,
const xmlChar * arg2, int dup)
{
xmlRelaxNGValidErrorPtr cur;
#ifdef DEBUG_ERROR
xmlGenericError(xmlGenericErrorContext,
"Pushing error %d at... | false | false | false | false | false | 0 |
dlite_delete(int nargs, union arg_val_t args[], /* command arguments */
struct regs_t *regs, /* registers to access */
struct mem_t *mem) /* memory to access */
{
int id;
if (nargs != 1)
return "wrong number of arguments";
/* check bp id */
if (!EVAL_INTEGRAL(args[0].as_value.type))
ret... | false | false | false | false | false | 0 |
add_cusps(
vrml *s,
gamut *g,
double trans, /* Transparency level */
double cc[3] /* Surface color, cc[0] < 0.0 for natural color, NULL for default */
) {
double cusps[6][3];
double ccolors[6][3] = {
{ 1.0, 0.1, 0.1 }, /* Red */
{ 1.0, 1.0, 0.1 }, /* Yellow */
{ 0.1, 1.0, 0.1 }, /* Green */
{ 0.1, 1.0, 1.0... | false | false | false | false | false | 0 |
draw_tree(struct canvas *canvas, struct rooted_tree *tree,
const double scale, int align_leaves, double dmax,
enum inner_lbl_pos inner_label_pos)
{
struct list_elem *elem;
for (elem = tree->nodes_in_order->head;
NULL != elem; elem = elem->next) {
struct rnode *node = elem->data;
struct simple_node_pos *p... | false | false | false | false | false | 0 |
add(const char* commentText, const char* file, int line)
{
if (Config::keepComments) {
if (Config::commentsFirst) {
if (saved_) {
// C++ says that the order of value evaluation is undefined.
// Comment's constructor sets mostRecent_, so the innocent-
// looking mostRecent_->next_ = new Comment... does th... | false | false | false | false | false | 0 |
xmlSecNssX509StoreAdoptCert(xmlSecKeyDataStorePtr store, CERTCertificate* cert, xmlSecKeyDataType type ATTRIBUTE_UNUSED) {
xmlSecNssX509StoreCtxPtr ctx;
int ret;
xmlSecAssert2(xmlSecKeyDataStoreCheckId(store, xmlSecNssX509StoreId), -1);
xmlSecAssert2(cert != NULL, -1);
ctx = xmlSecNssX509StoreGetC... | false | false | false | false | false | 0 |
outlcpvalues(Lcpsubtab *lcpsubtab,
unsigned long width,
unsigned long posoffset)
{
unsigned long idx, lcpvalue;
Largelcpvalue *largelcpvalueptr;
gt_assert(lcpsubtab != NULL && lcpsubtab->lcp2file != NULL);
lcpsubtab->lcp2file->largelcpvalues.nextfreeLargelcpval... | false | false | false | false | false | 0 |
fft(x, n, c, s, rev)
REAL x[][2]; /* Input data points */
int n; /* Number of points, n = 2**nu */
REAL *c, *s; /* Arrays of cosine, sine */
int *rev; /* Array of bit reversals*/
{
char temparray=FALSE; /* Are we using internal c and s arrays? *... | false | false | false | false | false | 0 |
AddServer(int argcnt, char **line)
{
struct Server *tempserv;
#ifdef BLOCK_ALLOCATION
tempserv = (struct Server *) BlockSubAllocate(ServerHeap);
#else
tempserv = (struct Server *) MyMalloc(sizeof(struct Server));
#endif
memset(tempserv, 0, sizeof(struct Server));
/*
* check if the server is the hub - if so... | false | false | false | false | false | 0 |
xlsx_sst_begin (GsfXMLIn *xin, xmlChar const **attrs)
{
XLSXReadState *state = (XLSXReadState *)xin->user_state;
int count;
for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
if (attr_int (xin, attrs, "uniqueCount", &count))
g_array_set_size (state->sst, count);
state->count = 0;
} | false | false | false | false | false | 0 |
newPdn(const QString& event, bool freeplace)
{
m_freeplace = freeplace;
m_paused = !m_freeplace; // FIXME - needed to force view update.
set_mode(m_freeplace);
PdnGame* game = m_pdn->newGame();
game->set(PdnGame::Event, event);
int index = m_gamelist->count();
m_gamelist->insertItem(index, event);
m_gamelist-... | false | false | false | false | false | 0 |
getBookMark(GP<DjVuBookMark> &gpBookMark, int iPos)
{
GPosition pos = bookmark_list.nth(iPos);
if (pos)
gpBookMark = bookmark_list[pos];
else
gpBookMark = 0;
return (gpBookMark?true:false);
} | false | false | false | false | false | 0 |
AsssListDefault (
Obj list,
Obj poss,
Obj objs )
{
Int lenPoss; /* length of <positions> */
Obj p; /* <position> */
Int pos; /* <position> as integer ... | false | false | false | false | false | 0 |
fsp_get_last_free_frag_extent(
/*==========================*/
fsp_header_t* header, /*!< in: tablespace header */
ulint zip_size, /*!< in: compressed page size */
mtr_t* mtr) /*!< in/out: mini-transaction */
{
ulint space;
fil_addr_t node;
xdes_t* descr;
ut_ad(header && mtr);
node = flst_get_last(header... | false | false | false | false | false | 0 |
CRYPTO_nistcts128_encrypt_block(const unsigned char *in, unsigned char *out,
size_t len, const void *key,
unsigned char ivec[16], block128_f block)
{ size_t residue, n;
assert (in && out && key && ivec);
if (len < 16) return 0;
residue=len%16;
len -= residue;
CRYPTO_cbc128_encrypt(in,out,len,key,ivec,bl... | false | false | false | false | false | 0 |
touchscroll(window_textbuffer_t *dwin)
{
window_t *win = dwin->owner;
int i;
gli_clear_selection();
winrepaint(win->bbox.x0, win->bbox.y0, win->bbox.x1, win->bbox.y1);
for (i = 0; i < dwin->scrollmax; i++)
dwin->lines[i].dirty = 1;
} | false | false | false | false | false | 0 |
notify_cb(struct bufferevent *buffer, void *userdata) {
ad_server_t *server = (ad_server_t *)userdata;
event_base_loopexit(server->evbase, NULL);
DEBUG("Existing loop.");
} | false | false | false | false | false | 0 |
index_free_prefix (char* prefix)
{
if (prefix == NULL ||
prefix == prefix_PRESENCE ||
prefix == prefix_EQUALITY ||
prefix == prefix_APPROX ||
prefix == prefix_SUB) {
/* do nothing */
} else {
slapi_ch_free( (void**)&prefix);
}
} | false | false | false | false | false | 0 |
crypt_kernel_socket_init(struct sockaddr_alg *sa, int *tfmfd, int *opfd)
{
*tfmfd = socket(AF_ALG, SOCK_SEQPACKET, 0);
if (*tfmfd == -1)
return -ENOTSUP;
if (bind(*tfmfd, (struct sockaddr *)sa, sizeof(*sa)) == -1) {
close(*tfmfd);
*tfmfd = -1;
return -ENOENT;
}
*opfd = accept(*tfmfd, NULL, 0);
if (*opfd... | false | false | false | false | false | 0 |
enforce_constraints()
{
if(m_pCheck_PrimaryKey->get_active())
{
m_pCheck_Unique->set_active(true); //Primary keys must be unique.
m_pCheck_Unique->set_sensitive(false); //Stop the user from disagreeing with that.
}
else
m_pCheck_Unique->set_sensitive(true);
if(m_pCheck_Unique->get_active() || m_p... | false | false | false | false | false | 0 |
PQueue_Node_extract(PQueue_Node *pqn){
if(pqn->next)
pqn->next->prev = pqn->prev;
if(pqn->prev->left == pqn)
pqn->prev->left = pqn->next;
else
pqn->prev->next = pqn->next;
pqn->next = NULL;
return;
} | false | false | false | false | false | 0 |
table_closeXform (IP_XFORM_HANDLE hXform)
{
PTBL_INST g;
int i;
HANDLE_TO_PTR (hXform, g);
for (i=0; i<3; i++)
if (g->pwTables[i] != NULL)
IP_MEM_FREE (g->pwTables[i]);
g->dwValidChk = 0;
IP_MEM_FREE (g); /* free memory for the instance */
return IP_DONE;
... | false | false | false | false | false | 0 |
rb_big_cmp(x, y)
VALUE x, y;
{
long xlen = RBIGNUM(x)->len;
switch (TYPE(y)) {
case T_FIXNUM:
y = rb_int2big(FIX2LONG(y));
break;
case T_BIGNUM:
break;
case T_FLOAT:
return rb_dbl_cmp(rb_big2dbl(x), RFLOAT(y)->value);
default:
return rb_num_coerce_cmp(x, y);
}
if (R... | false | false | false | false | false | 0 |
gnm_sub_solver_spawn (GnmSubSolver *subsol,
char **argv,
GSpawnChildSetupFunc child_setup, gpointer setup_data,
GIOFunc io_stdout, gpointer stdout_data,
GIOFunc io_stderr, gpointer stderr_data,
GError **err)
{
GnmSolver *sol = GNM_SOLVER (subsol);
gboolean ok;
GSpawnFlags spfl... | false | false | false | false | true | 1 |
unset_ticscale()
{
unsigned int i;
int_warn(c_token,
"Deprecated syntax - please use 'set tics scale default'");
for (i = 0; i < AXIS_ARRAY_SIZE; ++i) {
axis_array[i].ticscale = 1.0;
axis_array[i].miniticscale = 0.5;
}
} | false | false | false | false | false | 0 |
getEndExist(int reqnum)
{
if(endExist == NULL) return false;
return endExist->find(reqnum);
} | false | false | false | false | false | 0 |
SelectT2AddrModeImm8Offset(SDNode *Op, SDValue N,
SDValue &OffImm){
unsigned Opcode = Op->getOpcode();
ISD::MemIndexedMode AM = (Opcode == ISD::LOAD)
? cast<LoadSDNode>(Op)->getAddressingMode()
: cast<StoreSDNode>(Op)->getAddressingMode();
int RHSC;
if (i... | false | false | false | false | false | 0 |
inotify_fdinfo(struct seq_file *m, struct fsnotify_mark *mark)
{
struct inotify_inode_mark *inode_mark;
struct inode *inode;
if (!(mark->flags & FSNOTIFY_MARK_FLAG_ALIVE) ||
!(mark->flags & FSNOTIFY_MARK_FLAG_INODE))
return;
inode_mark = container_of(mark, struct inotify_inode_mark, fsn_mark);
inode = igr... | false | false | false | false | false | 0 |
readNodeInstance(QvInput *in, const QvName &className,
const QvName &refName, QvNode *&node)
{
node = createInstance(in, className);
if (node == NULL)
return FALSE;
if (! (! refName))
in->addReference(refName, node);
return node->readInstance(in);
} | false | false | false | false | false | 0 |
FillHierarchyRoot( LabelSet& anchors )
{
LabelSet::iterator endRootAnchors;
if ( static_cast<int>( anchors.size() ) < this->Husk->GetTargetLabelCount() )
{
endRootAnchors = anchors.end();
}
else
{
endRootAnchors = anchors.begin();
for ( int i = 0; i < this->Husk->GetTargetLabelCount(); ++ ... | false | false | false | false | false | 0 |
hda_readable_reg(struct device *dev, unsigned int reg)
{
struct hdac_device *codec = dev_to_hdac_dev(dev);
unsigned int verb = get_verb(reg);
if (codec->caps_overwriting)
return true;
switch (verb) {
case AC_VERB_PARAMETERS:
case AC_VERB_GET_CONNECT_LIST:
case AC_VERB_GET_SUBSYSTEM_ID:
return true;
/* bel... | false | false | false | false | false | 0 |
ensDatabaseentryAddOntologylinkage(EnsPDatabaseentry dbe,
AjPStr linkagetype,
EnsPDatabaseentry source)
{
EnsPOntologylinkage ol = NULL;
if (!dbe)
return ajFalse;
ol = ensOntologylinkageNewIni(linkagetype, source);... | false | false | false | false | false | 0 |
parse_flags_option(struct isl_arg *decl, char **arg,
struct isl_prefixes *prefixes, void *opt)
{
int has_argument;
const char *flags;
const char *comma;
unsigned val;
flags = skip_name(decl, arg[0], prefixes, 0, &has_argument);
if (!flags)
return 0;
if (!has_argument && !arg[1])
return 0;
if (!has_argum... | false | false | false | false | false | 0 |
get_value()
{
if(t0con->value.get() & T0CON::TMR0ON) {
// If TMR0L:H is configured as an 8-bit timer, then treat as an 8-bit timer
if(t0con->value.get() & T0CON::T08BIT) {
if (tmr0h)
tmr0h->put_value( (value16>>8)&0xff);
return(TMR0::get_value());
}
value16 = (int) ((get_cycles().get()... | false | false | false | false | false | 0 |
read_device_pairable(bdaddr_t *bdaddr, gboolean *mode)
{
char filename[PATH_MAX + 1], *str;
create_filename(filename, PATH_MAX, bdaddr, "config");
str = textfile_get(filename, "pairable");
if (!str)
return -ENOENT;
*mode = strcmp(str, "yes") == 0 ? TRUE : FALSE;
free(str);
return 0;
} | false | false | false | false | false | 0 |
AddLinkDirectory(const char* d)
{
// Make sure we don't add unnecessary search directories.
if(this->LinkDirectoriesEmmitted.insert(d).second)
{
this->LinkDirectories.push_back(d);
}
} | false | false | false | false | false | 0 |
_mesa_validate_pbo_compressed_teximage(struct gl_context *ctx,
GLuint dimensions, GLsizei imageSize,
const GLvoid *pixels,
const struct gl_pixelstore_attrib *packing,
const char *funcName)... | false | false | false | false | false | 0 |
setParameterValueStrings(const char **names, size_t count)
{
_parameterValueStrings.clear();
for (size_t i=0; i<count; i++) {
_parameterValueStrings.push_back(std::string(names[i]));
}
} | false | false | false | false | false | 0 |
esas2r_initmem_free(struct esas2r_adapter *a,
struct esas2r_mem_desc *mem_desc)
{
if (mem_desc->virt_addr == NULL)
return;
/*
* Careful! phys_addr and virt_addr may have been adjusted from the
* original allocation in order to return the desired alignment. That
* means we have to use the original addre... | false | false | false | false | false | 0 |
download_tmpfile(char *outfile)
{
int fd;
char *cp, path[MAXPATHLEN];
if (outfile == NULL)
{
cp = getenv("TMPDIR");
if (cp == NULL)
cp = "/tmp";
snprintf(path, sizeof(path), "%s/download-XXXXXX", cp);
fd = mkstemp(path);
if (fd == -1)
{
fprintf(stderr, " ! cannot open temp file: "
"mkstemp(... | true | true | false | false | true | 1 |
ena_com_get_hash_ctrl(struct ena_com_dev *ena_dev,
enum ena_admin_flow_hash_proto proto,
u16 *fields)
{
struct ena_rss *rss = &ena_dev->rss;
struct ena_admin_get_feat_resp get_resp;
int rc;
rc = ena_com_get_feature_ex(ena_dev, &get_resp,
ENA_ADMIN_RSS_HASH_INPUT,
rss->hash_ctrl_dma_addr,
... | false | false | false | false | false | 0 |
readstrp()
{
uint8 l;
readx(&l, 1);
char *str = ht_malloc(l+1);
if (!str) throw std::bad_alloc();
try {
readx(str, l);
} catch (...) {
free(str);
throw;
}
str[l] = 0;
return str;
} | false | false | false | false | false | 0 |
request_enqueue(REQUEST *request)
{
/*
* If we haven't checked the number of child threads
* in a while, OR if the thread pool appears to be full,
* go manage it.
*/
if ((last_cleaned < request->timestamp) ||
(thread_pool.active_threads == thread_pool.total_threads)) {
thread_pool_manage(request->times... | false | false | false | false | false | 0 |
import( IOBUF inp, const char* fname,struct stats_s *stats,
unsigned char **fpr,size_t *fpr_len,unsigned int options )
{
PACKET *pending_pkt = NULL;
KBNODE keyblock = NULL;
int rc = 0;
getkey_disable_caches();
if( !opt.no_armor ) { /* armored reading is not disabled */
armor_filter_context_t *af... | false | false | false | false | false | 0 |
set_foreground_color(long c)
{
#ifdef X11
if (output_methods & TO_X) {
#ifdef USE_ARGB
if (have_argb_visual) {
current_color = c | (own_window_argb_value << 24);
} else {
#endif /* USE_ARGB */
current_color = c;
#ifdef USE_ARGB
}
#endif /* USE_ARGB */
XSetForeground(display, window.gc, current_color);
}... | false | false | false | false | false | 0 |
security_sid_mls_copy(u32 sid, u32 mls_sid, u32 *new_sid)
{
struct context *context1;
struct context *context2;
struct context newcon;
char *s;
u32 len;
int rc;
rc = 0;
if (!ss_initialized || !policydb.mls_enabled) {
*new_sid = sid;
goto out;
}
context_init(&newcon);
read_lock(&policy_rwlock);
rc = ... | false | false | false | false | false | 0 |
mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) {
if (m_rubberBandLeg) {
int bendpointIndex;
CursorLocation cursorLocation = findLocation(event->pos(), bendpointIndex);
switch (cursorLocation) {
case InBendpoint:
if (bendpointIndex < m_legPolygon.count() - 1) {
removeBendpoint(bendpointIndex);... | false | false | false | false | false | 0 |
OGR_G_DumpReadable( OGRGeometryH hGeom, FILE *fp, const char *pszPrefix )
{
VALIDATE_POINTER0( hGeom, "OGR_G_DumpReadable" );
((OGRGeometry *) hGeom)->dumpReadable( fp, pszPrefix );
} | false | false | false | false | false | 0 |
py_signal_connect (PyObject *pyfunc, int signal, PyObject *args)
{
// create the callback
py_callback *callback = new py_callback (pyfunc, args);
py_callbacks.push_back (callback);
// connect the signal
switch (signal)
{
case CLOSE:
{
set_callback_quit (makeFunctor (*callbac... | false | false | false | false | false | 0 |
set_a_bus_req(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
struct ci_hdrc *ci = dev_get_drvdata(dev);
if (count > 2)
return -1;
mutex_lock(&ci->fsm.lock);
if (buf[0] == '0') {
ci->fsm.a_bus_req = 0;
} else if (buf[0] == '1') {
/* If a_bus_drop is TRUE, a_bus_req ... | false | false | false | false | false | 0 |
addin(Rationel& res, const Rationel& n)
{
if (isZero(n)) return res;
if (isZero(res)) return res = n;
mpq_add( (mpq_ptr)&res.gmp_rep, (mpq_srcptr)&res.gmp_rep, (mpq_srcptr)&n.gmp_rep );
return res;
} | false | false | false | false | false | 0 |
plop_INT13h_check(void)
{
com32sys_t inregs, outregs;
/* Prepare the register set */
memset(&inregs, 0, sizeof inregs);
/*
* Check if PLoP already has booted a CDROM or USB drive by checking
* for the presence of the PLoP INT13h hook.
*
* The following assembly code (NASM) can dete... | false | false | false | false | false | 0 |
mcxTingEmpty
( mcxTing* ting
, dim len
)
{ if (!(ting = mcxTingEnsure(ting, len)))
return NULL
; *(ting->str+0) = '\0'
, ting->len = 0
; return ting
; } | false | false | false | false | false | 0 |
super_getattro(PyObject *self, PyObject *name)
{
superobject *su = (superobject *)self;
int skip = su->obj_type == NULL;
if (!skip) {
/* We want __class__ to return the class of the super object
(i.e. super, or a subclass), not the class of su->obj. */
skip = (PyUnicode_Check(nam... | false | false | false | true | true | 1 |
sysfs_readlink(struct sysfs_cxt *cxt, const char *attr,
char *buf, size_t bufsiz)
{
if (attr)
return readlink_at(cxt->dir_fd, cxt->dir_path, attr, buf, bufsiz);
/* read /sys/dev/block/<maj:min> link */
return readlink(cxt->dir_path, buf, bufsiz);
} | false | false | false | false | false | 0 |
show_sas_rphy_device_type(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct sas_rphy *rphy = transport_class_to_rphy(dev);
if (!rphy->identify.device_type)
return snprintf(buf, 20, "none\n");
return get_sas_device_type_names(
rphy->identify.device_type, buf);
} | false | false | false | false | false | 0 |
parse_long_option( struct Arg_parser * const ap,
const char * const opt, const char * const arg,
const struct ap_Option options[],
int * const argindp )
{
unsigned len;
int index = -1, i;
char exact = 0, ambig = 0;
f... | false | false | false | false | false | 0 |
MetaIndexFile(const char *Type) const
{
return _config->FindDir("Dir::State::lists") +
URItoFileName(MetaIndexURI(Type));
} | false | false | false | false | false | 0 |
qla8044_start_pex_dma(struct scsi_qla_host *vha,
struct qla8044_minidump_entry_rdmem_pex_dma *m_hdr)
{
struct qla_hw_data *ha = vha->hw;
int rval = QLA_SUCCESS, wait = 0;
uint32_t dma_eng_num = 0, cmd_sts_and_cntrl = 0;
uint64_t dma_base_addr = 0;
struct qla8044_minidump_template_hdr *tmplt_hdr = NULL;
tmplt_hd... | false | false | false | false | false | 0 |
ci_apply_disp_minimum_voltage_request(struct amdgpu_device *adev)
{
struct amdgpu_clock_voltage_dependency_table *disp_voltage_table =
&adev->pm.dpm.dyn_state.vddc_dependency_on_dispclk;
struct amdgpu_clock_voltage_dependency_table *vddc_table =
&adev->pm.dpm.dyn_state.vddc_dependency_on_sclk;
u32 requested_volt... | false | false | false | false | false | 0 |
gst_base_rtp_audio_payload_sample_bytes_to_time (GstBaseRTPAudioPayload *
payload, guint64 bytes)
{
guint64 rtptime;
/* avoid division when we can */
if (G_LIKELY (payload->sample_size != 8))
rtptime = gst_util_uint64_scale_int (bytes, 8, payload->sample_size);
else
rtptime = bytes;
return gst_u... | false | false | false | false | false | 0 |
ml_lineadd(buf, count)
BUF *buf;
int count;
{
int idx;
IPTR *ip;
PTR_BL *pp;
MEMFILE *mfp = buf->b_ml.ml_mfp;
BHDR *hp;
for (idx = buf->b_ml.ml_stack_top - 1; idx >= 0; --idx)
{
ip = &(buf->b_ml.ml_stack[idx]);
if ((hp = mf_get(mfp, ip->ip_bnum, 1)) == NULL)
break;
pp = (PTR_BL *)(hp->bh_da... | false | false | false | false | false | 0 |
describe_vote(struct vote *pvote, char *buf, int buflen)
{
int ret = 0;
/* NB We don't handle votes with multiple flags here. */
if (pvote->flags & VCF_NODISSENT) {
ret = fc_snprintf(buf, buflen,
/* TRANS: Describing a new vote that can only pass
* if there are no dissenting votes. */
... | false | false | false | false | false | 0 |
backslash_newline()
{
register int c;
nl_compensate++;
return (INPUT(c));
} | false | false | false | false | false | 0 |
switch_mknod (call_frame_t *frame, xlator_t *this,
loc_t *loc, mode_t mode, dev_t rdev, dict_t *params)
{
dht_local_t *local = NULL;
dht_conf_t *conf = NULL;
xlator_t *subvol = NULL;
xlator_t *avail_subvol = NULL;
int op_errno = -1;
VALIDAT... | 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.