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 |
|---|---|---|---|---|---|---|
getName( ) const
{
if ( !name.empty() )
return name;
else
return description;
} | false | false | false | false | false | 0 |
soup_header_g_string_append_param_quoted (GString *string,
const char *name,
const char *value)
{
g_return_if_fail (string != NULL);
g_return_if_fail (name != NULL);
g_return_if_fail (value != NULL);
append_param_internal (string, name, value, FALSE);
} | false | false | false | false | false | 0 |
clutter_behaviour_rotate_set_direction (ClutterBehaviourRotate *rotate,
ClutterRotateDirection direction)
{
ClutterBehaviourRotatePrivate *priv;
g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ROTATE (rotate));
priv = rotate->priv;
if (priv->direction != direction)
{
... | false | false | false | false | false | 0 |
lookup_header_set(struct ctl_table_root *root, struct nsproxy *namespaces)
{
struct ctl_table_set *set = &root->default_set;
if (root->lookup)
set = root->lookup(root, namespaces);
return set;
} | false | false | false | false | false | 0 |
init(const XmlAttributes &attr)
{
iImp = new Imp;
iImp->iRefCount = 1;
iImp->iObjNum = Lex(attr["id"]).getInt();
iImp->iRender = 0;
iImp->iWidth = Lex(attr["width"]).getInt();
iImp->iHeight = Lex(attr["height"]).getInt();
iImp->iColorKey = -1;
int length = Lex(attr["length"]).getInt();
assert(iImp->iW... | false | false | false | false | false | 0 |
SetupParserExpat()
{
// Cleanup any old parser.
if( oParser != NULL )
CleanupParser();
oParser = OGRCreateExpatXMLParser();
m_poGMLHandler = new GMLExpatHandler( this, oParser );
XML_SetElementHandler(oParser, GMLExpatHandler::startElementCbk, GMLExpatHandler::endElementCbk);
XML_SetCh... | false | false | false | false | false | 0 |
gw_db_category_can_removed ( GWDBCategory *category) {
if ( category != NULL ) {
if ( (gw_db_category_get_nb_disks ( category) == 0) && (gw_db_category_get_nb_files ( category) == 0) ) {
return TRUE;
}
}
return FALSE;
} | false | false | false | false | false | 0 |
GC_lookup_thread(pthread_t id)
{
int hv = ((word)id) % THREAD_TABLE_SZ;
register GC_thread p = GC_threads[hv];
while (p != 0 && !pthread_equal(p -> id, id)) p = p -> next;
return(p);
} | false | false | false | false | false | 0 |
add_arc (state_t from_state, state_t to_state, ainsn_t ainsn)
{
arc_t new_arc;
new_arc = find_arc (from_state, to_state, ainsn);
if (new_arc != NULL)
return;
if (first_free_arc == NULL)
{
#ifndef NDEBUG
allocated_arcs_num++;
#endif
new_arc = XCREATENODE (struct arc);
new_arc->to_state... | false | false | false | false | false | 0 |
add2header(const char *p, unsigned l, struct rwmsginfo *msginfo)
{
if (l + msginfo->headerbuflen > msginfo->headerbufsize)
{
unsigned ll=(msginfo->headerbufsize + l + 1023) & ~1023;
char *buf=courier_malloc(ll);
if (msginfo->headerbufsize)
memcpy(buf, msginfo->headerbuf, msginfo->headerbufsize);
if (msginfo... | false | true | false | false | false | 1 |
insert_wstring(const CORBA::WChar* value)
{
CHECK_NOT_DESTROYED;
if( !value || pd_curr_index != 1 )
throw DynamicAny::DynAny::InvalidValue();
if( pd_member_kind != CORBA::tk_wstring )
throw DynamicAny::DynAny::TypeMismatch();
CORBA::ULong maxlen = pd_member->actualTc()->NP_length();
cdrAnyMemorySt... | false | false | false | false | false | 0 |
synusb_disconnect(struct usb_interface *intf)
{
struct synusb *synusb = usb_get_intfdata(intf);
struct usb_device *udev = interface_to_usbdev(intf);
if (synusb->flags & SYNUSB_IO_ALWAYS)
synusb_close(synusb->input);
input_unregister_device(synusb->input);
usb_free_coherent(udev, SYNUSB_RECV_SIZE, synusb->data... | false | false | false | false | false | 0 |
goa_utils_parse_email_address (const gchar *email, gchar **out_username, gchar **out_domain)
{
gchar *at;
gchar *dot;
if (email == NULL || email[0] == '\0')
return FALSE;
at = strchr (email, '@');
if (at == NULL || *(at + 1) == '\0')
return FALSE;
dot = strchr (at + 1, '.');
if (dot == NULL || ... | false | false | false | false | false | 0 |
canAppend(GR_RenderInfo &ri) const
{
GR_PangoRenderInfo & RI = (GR_PangoRenderInfo &)ri;
GR_CairoPangoItem * pItem1 = (GR_CairoPangoItem *)m_pItem;
GR_CairoPangoItem * pItem2 = (GR_CairoPangoItem *)RI.m_pItem;
/* Do not merger runs that have not been shapped yet */
if (!pItem1 || !pItem2)
return false;
/* If ... | false | false | false | false | false | 0 |
asn_parse_int(u_char * data,
size_t * datalength,
u_char * type, long *intp, size_t intsize)
{
/*
* ASN.1 integer ::= 0x02 asnlength byte {byte}*
*/
static const char *errpre = "parse int";
register u_char *bufp = data;
u_long asn_length;
register long ... | false | false | false | false | false | 0 |
DBInfoFileName (const char *workSpace,const char *infoName)
{
FILE *inFile;
static char fileName [DBDataFileNameLen];
DBInt swap = DBByteOrder () == DBByteOrderLITTLE ? true : false;
DBInt notFound = true;
ARCDirRecord arcDirRecord;
sprintf (fileName,"%s/info/arcdr9",workSpace);
if (access (fileName,R_OK) =... | false | false | false | false | false | 0 |
set_geometry(gint k)
{
AtomGrid* listOfAtoms = NULL;
gint nAtoms = 0;
gint j;
if(k<0 || k >= animationGrids.numberOfFiles) return FALSE;
if(!GeomOrb) return FALSE;
if(Ncenters<1) return FALSE;
nAtoms = Ncenters;
listOfAtoms = g_malloc(nAtoms*sizeof(AtomGrid));
for(j=0;j<nAtoms;j++)
{
sprintf(listOfAto... | false | false | false | false | false | 0 |
BackgroundPreviewRequest(OFLibDlg *d,int onefont) {
struct ofl_download_urls *du;
PreviewThread *newp;
int is_image = true;
if ( d->show[onefont]->downloading_in_background )
return;
if ( getOFLibDir()==NULL )
return;
du = OFLibHasImage(d,onefont);
if ( du==NULL ) {
du = OFLibHasFont(d,one... | false | false | false | false | false | 0 |
InitHashCode (void)
/***************************************************************************
*
* The hash code for the various pieces standing on the various squares
* are initialized here. When a particular piece is move from square A
* to square B, the current hashkey is XORed against the hash code for
*... | false | false | false | false | false | 0 |
res_readreply(rb_fde_t *F, void *data)
{
while (res_read_single_reply(F, data))
;
rb_setselect(F, RB_SELECT_READ, res_readreply, NULL);
} | false | false | false | false | false | 0 |
isValid() const
{
ensureInited();
return d->mEnabled && d->mValid;
} | false | false | false | false | false | 0 |
s_write_module_prefs(void *inListItem, void *inData)
{
eb_PLUGIN_INFO *plugin_info = inListItem;
FILE *fp = (FILE *)inData;
LList *master_prefs = NULL;
LList *current_prefs = NULL;
eb_debug(DBG_CORE, "Writing prefs for %s\n", plugin_info->name);
fprintf(fp, "\t%s\n", plugin_info->name);
master_prefs = GetPref... | false | false | false | false | false | 0 |
read_packed_sha1(const unsigned char *sha1,
enum object_type *type, unsigned long *size)
{
struct pack_entry e;
if (!find_pack_entry(sha1, &e, NULL))
return NULL;
else
return cache_or_unpack_entry(e.p, e.offset, size, type, 1);
} | false | false | false | false | false | 0 |
cb_launch_entry(GtkWidget *widget, DiskMon *disk)
{
if (disk->enabled)
gkrellm_apply_launcher(&disk->launch_entry, &disk->tooltip_entry,
disk->chart->panel, &disk->launch, gkrellm_launch_button_cb);
} | false | false | false | false | false | 0 |
memset(void* s, int c, size_t n)
{
size_t i;
char *ss = (char*)s;
for (i=0;i<n;i++) ss[i] = c;
return s;
} | false | false | false | false | false | 0 |
chknargs(fun,n)
truc fun;
int n;
{
struct symbol *sptr;
char *ss;
int k, k1, k2;
int ret;
int sflg;
sptr = symptr(fun);
sflg = *FLAGPTR(sptr);
if(sflg == sFBINARY || sflg == sSBINARY) {
ss = SigString[sptr->cc.yy.ww];
k = (byte)ss[0];
if(k != MAXBYTE && n+1 == k)... | false | false | false | false | false | 0 |
asd_ascb_alloc_list(struct asd_ha_struct
*asd_ha, int *num,
gfp_t gfp_flags)
{
struct asd_ascb *first = NULL;
for ( ; *num > 0; --*num) {
struct asd_ascb *ascb = asd_ascb_alloc(asd_ha, gfp_flags);
if (!ascb)
break;
else if (!first)
first = ascb;
else {
struct asd_ascb *last = list... | false | false | false | false | false | 0 |
stv0297_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
{
struct stv0297_state *state = fe->demodulator_priv;
if (enable) {
stv0297_writereg(state, 0x87, 0x78);
stv0297_writereg(state, 0x86, 0xc8);
}
return 0;
} | false | false | false | false | false | 0 |
PrintRefLVar (
Expr expr )
{
if ( IS_REFLVAR(expr) )
Pr( "%I", (Int)NAME_LVAR( LVAR_REFLVAR(expr) ), 0L );
else
Pr( "%I", (Int)NAME_LVAR( (UInt)(ADDR_EXPR(expr)[0]) ), 0L );
} | false | false | false | false | false | 0 |
make_df_info_for_acc_block(Module_table *head)
{
Module_table *mpt;
dataflow_anal(head);
for (mpt = head; mpt != NULL; mpt = mpt->next) {
if (mpt->kind != MODULE_BLOCKDATA) {
make_df_info_for_acc_block_for_blocks(mpt->block_head);
}
}
} | false | false | false | false | false | 0 |
claimeven (struct board *board)
{
short x1, y1, q1, q2;
short sln, *grp, j;
for (y1 = 1; y1 < BOARDY; y1 += 2)
for (x1 = 0; x1 < BOARDX; x1++) {
if (!board->sqused[ELM (x1, y1)])
continue;
board->solution[board->sp]->solgroupsnumb = 0;
q1 = ELM (x1, y1);
q2 = ELM (x1, y1 - 1);
... | false | false | false | false | false | 0 |
agent_write(struct ast_channel *ast, struct ast_frame *f)
{
struct agent_pvt *p = ast_channel_tech_pvt(ast);
int res = -1;
CHECK_FORMATS(ast, p);
ast_mutex_lock(&p->lock);
if (!p->chan)
res = 0;
else {
if ((f->frametype != AST_FRAME_VOICE) ||
(f->frametype != AST_FRAME_VIDEO) ||
(ast_format_cmp(&... | false | false | false | false | false | 0 |
main(int argc, char* argv[])
{
Header headfirst;
Infoheader headsecond;
Single_pixel single_pixel;
char* bmp = argv[1]; //"/test/reference.24.bmp";
char* rgb = "../test/output.rgb565.bin";
int byte_border;
/* binary opening of the input image file (24bit bmp) */
FILE *infile;
... | false | false | false | false | true | 1 |
pcie_aspm_remove_sysfs_dev_files(struct pci_dev *pdev)
{
struct pcie_link_state *link_state = pdev->link_state;
if (!link_state)
return;
if (link_state->aspm_support)
sysfs_remove_file_from_group(&pdev->dev.kobj,
&dev_attr_link_state.attr, power_group);
if (link_state->clkpm_capable)
sysfs_remove_file_fr... | false | false | false | false | false | 0 |
sw_sort_check(Statement *sw_stm)
{
Quadruple *qpt;
for(qpt = sw_stm->qr_head; qpt != NULL;
qpt = qpt->next){
if(qpt->ope == OPE_CASE)
break;
}
for(;qpt->op[1] != NULL; qpt = qpt->next){
sw_qr_sort_check(qpt);
}
for(qpt = sw_stm->qr_head;
qpt != NULL; qpt = qpt->next){
if(qpt->ope ... | false | false | false | false | false | 0 |
pcan_usb_get_serial(struct peak_usb_device *dev, u32 *serial_number)
{
u8 args[PCAN_USB_CMD_ARGS_LEN];
int err;
err = pcan_usb_wait_rsp(dev, 6, 1, args);
if (err) {
netdev_err(dev->netdev, "getting serial failure: %d\n", err);
} else if (serial_number) {
__le32 tmp32;
memcpy(&tmp32, args, 4);
*serial_num... | false | true | false | false | true | 1 |
heap_adjust(TimerHeap *heap, long index)
{
Timer *t;
Timer *parent;
long child_index;
/*
* We can assume that the heap was fine before this element's
* elapse time was changed. There are three cases to deal
* with:
* - Element's new elapse time is too small; it should be
* ... | false | false | false | false | false | 0 |
rsa_is_prime(mp_int *p) {
int res;
/* run a Fermat test */
res = mpp_fermat(p, 2);
if (res != MP_OKAY) {
return res;
}
/* If that passed, run some Miller-Rabin tests */
res = mpp_pprime(p, 2);
return res;
} | false | false | false | false | false | 0 |
add_component(int col, int row, CL_Component *component, int span)
{
impl->elements.push_back(new CL_LayoutItem(component));
} | false | false | false | false | false | 0 |
eraseItemFromContentMap(const InventoryItem& item)
{
if (item.locationOnReceiverX() == -1 || item.locationOnReceiverY() == -1)
return;
for (int y = 0; y < item.contentHeight(); ++y)
{
const int map_y = item.locationOnReceiverY() + y;
for (int x = 0; x < item.contentWidth(); ++x)
... | false | false | false | false | false | 0 |
str2int(const char *str)
{
int a;
unsigned long value;
char *endptr, buf[11];
strncpy(buf, str, 10);
buf[10] = '\0';
a = 2;
while ((buf[a] != '\0') && (strchr("0123456789abcdefABCDEF", buf[a]) != NULL))
a++;
buf[a] = '\0';
if (a < 3)
return -1;
value = strtoul(buf, &endptr, 0);
if (*endpt... | false | false | false | false | false | 0 |
checkDepth () {
XWindowAttributes xwattributes;
XGetWindowAttributes (_display, _rootWindow, &xwattributes);
_depth = xwattributes.depth;
if (_depth != 15 && _depth != 16 && _depth != 24 && _depth != 32)
_depth = 24;
if (!XMatchVisualInfo (_display, DefaultScreen (_display), _depth, TrueColor, &_XVInfo)... | false | false | false | false | false | 0 |
port_name(int i)const {
assert(i >= 0);
assert(i < 2);
static std::string names[] = {"p", "n"};
return names[i];
} | false | false | false | false | false | 0 |
uea_read_cmv_e4(struct uea_softc *sc,
u8 size, u16 group, u16 address, u16 offset, u32 *data)
{
int ret = uea_cmv_e4(sc, E4_MAKEFUNCTION(E4_MEMACCESS,
E4_REQUESTREAD, size),
group, address, offset, 0);
if (ret < 0)
uea_err(INS_TO_USBDEV(sc),
"reading cmv failed with error %d\n", ret);
else {
*da... | false | false | false | false | false | 0 |
get_line(FILE *f, char *buf, unsigned size, int *lineno,
const char *file)
{
int too_long = 0;
if (fgets_unlocked(buf, 128, f)) {
/* remove newline */
char *ptr = strchr(buf, 0x0a);
if (ptr) {
if (!too_long) {
*ptr = 0;
return buf;
}
// Reset and start with the next line
too_long = 0;
*... | false | false | false | false | false | 0 |
quorem(Bigint *b, Bigint *S)
{
int n;
ULong *bx, *bxe, q, *sx, *sxe;
ULLong borrow, carry, y, ys;
n= S->wds;
if (b->wds < n)
return 0;
sx= S->p.x;
sxe= sx + --n;
bx= b->p.x;
bxe= bx + n;
q= *bxe / (*sxe + 1); /* ensure q <= true quotient */
if (q)
{
borrow= 0;
carry= 0;
do
... | false | false | false | false | false | 0 |
elan_i2c_get_baseline_data(struct i2c_client *client,
bool max_baseline, u8 *value)
{
int error;
u8 val[3];
error = elan_i2c_read_cmd(client,
max_baseline ? ETP_I2C_MAX_BASELINE_CMD :
ETP_I2C_MIN_BASELINE_CMD,
val);
if (error)
return error;
*value = le16_to_cpup((__le16 *)val);
r... | false | false | false | false | false | 0 |
yywrap(void)
{
if (found_defaults) {
if (freopen(PREFIX, "r", stdin) == NULL)
err(2, "%s", PREFIX);
yyfile = PREFIX;
yyline = 0;
found_defaults = 0;
return 0;
}
return 1;
} | false | false | false | false | false | 0 |
parseHeaders(const HeaderContainer& headers)
{
contentLength = 0;
contentLoaded = 0;
contentType = "";
HeaderContainer::const_iterator it = headers.begin();
HeaderContainer::const_iterator end = headers.end();
for (; it != end; ++it)
{
std::stringstream ss(*it);
std::string descr;
if (!std::getline(ss, d... | false | false | false | false | false | 0 |
priority_maplist_to_stringlist (GSList *list)
{
GSList *strlist = NULL, *iter;
for (iter = list; iter; iter = g_slist_next (iter)) {
PriorityMap *item = iter->data;
strlist = g_slist_prepend (strlist, g_strdup_printf ("%d:%d", item->from, item->to));
}
return g_slist_reverse (strlist);
} | false | false | false | false | false | 0 |
gf_odf_del_ipmp_tool(GF_IPMP_Tool *ipmpt)
{
if (!ipmpt) return GF_BAD_PARAM;
if (ipmpt->tool_url) gf_free(ipmpt->tool_url);
gf_free(ipmpt);
return GF_OK;
} | false | false | false | false | false | 0 |
recv(char* buf, size_t len)
{
bool ret = this->recv_soft(buf, len);
if (ret)
this->recv_skip(len);
return ret;
} | false | false | false | false | false | 0 |
compute_etail()
{
if (force->pair && force->pair->tail_flag) {
double volume = domain->xprd * domain->yprd * domain->zprd;
dvalue = force->pair->etail / volume;
if (normflag) dvalue /= natoms;
} else dvalue = 0.0;
} | false | false | false | false | false | 0 |
rocker_port_vlans_del(struct rocker_port *rocker_port,
const struct switchdev_obj_port_vlan *vlan)
{
u16 vid;
int err;
for (vid = vlan->vid_begin; vid <= vlan->vid_end; vid++) {
err = rocker_port_vlan_del(rocker_port, vid, vlan->flags);
if (err)
return err;
}
return 0;
} | false | false | false | false | false | 0 |
operator() (Ekiga::BookPtr book_)
{
Evolution::BookPtr book = boost::dynamic_pointer_cast<Evolution::Book> (book_);
if (book) {
EBook *book_ebook = book->get_ebook ();
ESource *book_source = e_book_get_source (book_ebook);
#if EDS_CHECK_VERSION(3,5,3)
if (e_source_equal (source, book_source... | false | false | false | false | false | 0 |
ceph_mdsc_destroy(struct ceph_fs_client *fsc)
{
struct ceph_mds_client *mdsc = fsc->mdsc;
dout("mdsc_destroy %p\n", mdsc);
ceph_mdsc_stop(mdsc);
/* flush out any connection work with references to us */
ceph_msgr_flush();
fsc->mdsc = NULL;
kfree(mdsc);
dout("mdsc_destroy %p done\n", mdsc);
} | false | false | false | false | false | 0 |
getByteArrayFieldValue(JNIEnv *env,
jobject obj,
const char *fieldName,
jfieldID *fieldID,
int *size)
{
jclass objClass = 0;
jfieldID objFieldID = 0;
jobjec... | false | false | false | false | false | 0 |
objdump_print_symname (bfd *abfd, struct disassemble_info *inf,
asymbol *sym)
{
char *alloc;
const char *name;
alloc = NULL;
name = bfd_asymbol_name (sym);
if (do_demangle && name[0] != '\0')
{
/* Demangle the name. */
alloc = bfd_demangle (abfd, name, DMGL_ANSI | DMGL_PARAMS);
... | false | false | false | false | false | 0 |
sync_idle_dosync_collectedevents_rsync_exclistpush(gpointer fpath_gp, gpointer flags_gp, gpointer arg_gp) {
struct dosync_arg *dosync_arg_p = (struct dosync_arg *)arg_gp;
char *fpath = (char *)fpath_gp;
FILE *excf = dosync_arg_p->outf;
eventinfo_flags_t flags = GPOINTER_TO_INT(flags_gp);
// options_t *optio... | false | false | false | false | false | 0 |
vhost_net_ubuf_put(struct vhost_net_ubuf_ref *ubufs)
{
int r = atomic_sub_return(1, &ubufs->refcount);
if (unlikely(!r))
wake_up(&ubufs->wait);
return r;
} | false | false | false | false | false | 0 |
GetEndColumn() const {
i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
if (IsDeadCheck(isolate, "v8::Message::GetEndColumn()")) return kNoColumnInfo;
ENTER_V8(isolate);
i::HandleScope scope(isolate);
i::Handle<i::JSObject> data_obj = Utils::OpenHandle(this);
EXCEPTION_PREAMBLE(isolate);
i::Ha... | false | false | false | false | false | 0 |
flat_edge(graph_t * g, edge_t * e)
{
elist_append(e, ND_flat_out(agtail(e)));
elist_append(e, ND_flat_in(aghead(e)));
GD_has_flat_edges(agroot(g)) = GD_has_flat_edges(g) = TRUE;
} | false | false | false | false | false | 0 |
saveHypotheses(vector<BaseLearner*>& weakHypotheses)
{
// save the weak hypotheses one by one.
for (int i = 0; i < (int)weakHypotheses.size(); ++i)
appendHypothesis(i, weakHypotheses[i]);
} | false | false | false | false | false | 0 |
cd_interp_insert (CdInterp *interp, gdouble x, gdouble y)
{
g_return_if_fail (CD_IS_INTERP (interp));
g_return_if_fail (!interp->priv->prepared);
g_array_append_val (interp->priv->x, x);
g_array_append_val (interp->priv->y, y);
} | false | false | false | false | false | 0 |
_bcp47ToLDMLKey(const char* bcpKey, int32_t bcpKeyLen,
char* key, int32_t keyCapacity,
UErrorCode *status) {
UResourceBundle *rb;
char bcpKeyBuf[MAX_BCP47_SUBTAG_LEN];
int32_t resultLen = 0;
int32_t i;
const char *resKey = NULL;
UResourceBundle *keyMap;
if (b... | true | true | false | false | false | 1 |
done(int r)
{
if (r == QDialog::Rejected) {
// TODO: code here
// bool yes = Utils::yesNoMessageBox(tr("WARNING! You did not save this user."),
// tr("If you continue without saving, changes will be lost."
// "Do y... | false | false | false | false | false | 0 |
runPgDump(const char *dbname)
{
PQExpBuffer connstrbuf = createPQExpBuffer();
PQExpBuffer cmd = createPQExpBuffer();
int ret;
appendPQExpBuffer(cmd, "\"%s\" %s", pg_dump_bin,
pgdumpopts->data);
/*
* If we have a filename, use the undocumented plain-append pg_dump
* format.
*/
if (filename)
appe... | false | false | false | false | true | 1 |
asn1PE_H245IS11172AudioMode_audioLayer (OOCTXT* pctxt, H245IS11172AudioMode_audioLayer* pvalue)
{
int stat = ASN_OK;
/* Encode choice index value */
stat = encodeConsUnsigned (pctxt, pvalue->t - 1, 0, 2);
if (stat != ASN_OK) return stat;
/* Encode root element data value */
switch (pvalue->t)
{... | false | false | false | false | false | 0 |
iommu_request_dm_for_dev(struct device *dev)
{
struct iommu_domain *dm_domain;
struct iommu_group *group;
int ret;
/* Device must already be in a group before calling this function */
group = iommu_group_get_for_dev(dev);
if (IS_ERR(group))
return PTR_ERR(group);
mutex_lock(&group->mutex);
/* Check if the ... | false | false | false | false | false | 0 |
bypass_conditional_jumps ()
{
basic_block bb;
int changed;
rtx setcc;
rtx insn;
rtx dest;
/* Note we start at block 1. */
if (ENTRY_BLOCK_PTR->next_bb == EXIT_BLOCK_PTR)
return 0;
changed = 0;
FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR->next_bb->next_bb,
EXIT_BLOCK_PTR, next_bb)
{
/* Che... | false | false | false | false | false | 0 |
__get_segment_type_4(struct page *page, enum page_type p_type)
{
if (p_type == DATA) {
struct inode *inode = page->mapping->host;
if (S_ISDIR(inode->i_mode))
return CURSEG_HOT_DATA;
else
return CURSEG_COLD_DATA;
} else {
if (IS_DNODE(page) && is_cold_node(page))
return CURSEG_WARM_NODE;
else
re... | false | false | false | false | false | 0 |
md5_append(md5_state_t *pms, const md5_byte_t *data, unsigned int nbytes)
{
const md5_byte_t *p = data;
unsigned int left = nbytes;
unsigned int offset = (pms->count[0] >> 3) & 63;
md5_word_t nbits = (md5_word_t)(nbytes << 3);
if (nbytes <= 0)
return;
/* this special case is handled re... | false | true | false | false | false | 1 |
showSegments(bool toggle, SegmentSettings seg, QList<QRect>* updateRectList)
{
int minPixels = (seg.minPoints - 1) * seg.pointSeparation;
Segment* segment;
for (segment = segments.first(); segment; segment = segments.next())
{
// no matter the value of toggle, never show segments that are too short
ASS... | false | false | false | false | false | 0 |
build_indexed_triangle_fan_set(GF_Node *node, Drawable3D *stack, GF_TraverseState *tr_state)
{
MFInt32 fanList;
u32 i, nb_fans;
X_IndexedTriangleFanSet *itfs = (X_IndexedTriangleFanSet *)node;
gf_node_dirty_clear(node, 0);
if (!itfs->coord) return;
fanList.count = 0; fanList.vals = NULL;
nb_fans = 0;
for (i=0;... | false | false | false | false | false | 0 |
gee_concurrent_set_tower_help_marked (GeeConcurrentSetTower* self, GeeConcurrentSetTower* prev_tower, guint8 level) {
GeeConcurrentSetTower* _tmp0_ = NULL;
guint8 _tmp1_ = 0U;
GeeConcurrentSetTower* _tmp2_ = NULL;
GeeConcurrentSetTower* _tmp3_ = NULL;
guint8 _tmp4_ = 0U;
g_return_if_fail (self != NULL);
g_return... | false | false | false | false | false | 0 |
getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
{
if (propertyName == exec->propertyNames().length) {
descriptor.setPropertyDescriptorValues(exec, jsNumber(m_length), m_lengthAttributes);
return true;
}
bool isArrayIndex;
unsigne... | false | false | false | false | false | 0 |
SetName(v8::Handle<v8::String> name) {
i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
ENTER_V8(isolate);
USE(isolate);
i::Handle<i::JSFunction> func = Utils::OpenHandle(this);
func->shared()->set_name(*Utils::OpenHandle(*name));
} | false | false | false | false | false | 0 |
create ( void ) throw ( Exception )
{
int fd;
if ( isOpen() ) {
return false;
}
if ( (fd = ::creat( fileName, S_IRUSR | S_IWUSR)) == -1 ) {
reportEvent( 3, "can't create file", fileName, errno);
return false;
}
::close( fd);
return true;... | false | false | false | false | false | 0 |
gnc_html_register_object_handler( const char * classid,
GncHTMLObjectCB hand )
{
g_return_if_fail( classid != NULL );
if ( gnc_html_object_handlers == NULL )
{
gnc_html_object_handlers = g_hash_table_new( g_str_hash, g_str_equal );
}
gnc_html_unregister_ob... | false | false | false | false | false | 0 |
slookup(symbol, file)
register char *symbol;
register struct inclist *file;
{
register int first = 0;
register int last = file->i_ndefs - 1;
if (file) while (last >= first)
{
/* Fast inline binary search */
register char *s1;
register char *s2;
register int middle = (f... | false | false | false | false | false | 0 |
missingInclude(const std::string &filename, unsigned int linenr, const std::string &header, bool userheader)
{
std::list<ErrorLogger::ErrorMessage::FileLocation> locationList;
if (!filename.empty())
{
ErrorLogger::ErrorMessage::FileLocation loc;
loc.line = linenr;
loc.setfile(filenam... | false | false | false | false | false | 0 |
read_max_uid_value(FolderItem *item, guint * pmax_uid)
{
gchar * path;
gchar * file;
FILE * f;
guint max_uid;
size_t r;
path = folder_item_get_path(item);
file = g_strconcat(path, G_DIR_SEPARATOR_S, MAX_UID_FILE, NULL);
g_free(path);
f = fopen(file, "... | false | false | false | false | true | 1 |
module_hup_module(CONF_SECTION *cs, module_instance_t *node, time_t when)
{
void *insthandle = NULL;
fr_module_hup_t *mh;
if (!node ||
!node->entry->module->instantiate ||
((node->entry->module->type & RLM_TYPE_HUP_SAFE) == 0)) {
return 1;
}
cf_log_module(cs, "Trying to reload module \"%s\"", node->n... | false | false | false | false | false | 0 |
xmalloc_fgets_str_len(FILE *file, const char *terminating_string, size_t *maxsz_p)
{
size_t maxsz;
if (!maxsz_p) {
maxsz = INT_MAX - 4095;
maxsz_p = &maxsz;
}
return xmalloc_fgets_internal(file, terminating_string, 0, maxsz_p);
} | false | false | false | false | false | 0 |
set_program_behaviour(void)
{
static const char enca_name[] = "enca";
static const char enconv_name[] = "enconv";
static const size_t nenca = sizeof(enca_name) - 1;
static const size_t nenconv = sizeof(enconv_name) - 1;
if (strncmp(program_name, enca_name, nenca) == 0
&& !isalpha(program_name[nenca])) ... | false | false | false | false | false | 0 |
_ds_del_spamrecord (DSPAM_CTX * CTX, unsigned long long token)
{
struct _pgsql_drv_storage *s = (struct _pgsql_drv_storage *) CTX->storage;
struct passwd *p;
char *name;
char query[256];
PGresult *result;
char tok_buf[30];
if (s->dbh == NULL)
{
LOGDEBUG ("_ds_del_spamrecord: invalid database handle... | true | true | false | false | false | 1 |
operator>>(char& n_)
{
int c = 0;
int len = sizeof (int);
XDR xdrs;
xdrmem_create (&xdrs, (caddr_t) &c, len, XDR_DECODE);
if (read ((char* ) &c, len) == len) {
xdr_char (&xdrs, &n_);
}
else {
setstate (Socket::eofbit|Socket::failbit);
}
xdr_destroy(&xdrs);
return *this;
} | false | false | false | false | false | 0 |
matches(const QString &name, const QString &id) const
{
if (serviceName == name && (credentialID == id)) {
return true;
}
if (targets.testFlag(AuthorizationRule::AllUsers) && (serviceName == name)) {
return true;
}
if (targets.testFlag(AuthorizationRule::AllServices) && (credential... | false | false | false | false | false | 0 |
drm_dp_dpcd_access(struct drm_dp_aux *aux, u8 request,
unsigned int offset, void *buffer, size_t size)
{
struct drm_dp_aux_msg msg;
unsigned int retry;
int err = 0;
memset(&msg, 0, sizeof(msg));
msg.address = offset;
msg.request = request;
msg.buffer = buffer;
msg.size = size;
mutex_lock(&aux->hw_mu... | false | false | false | false | false | 0 |
putline_r210 (ColorspaceConvert * convert, guint8 * dest, const guint8 * src,
int j)
{
int i;
guint8 *destline = FRAME_GET_LINE (dest, 0, j);
for (i = 0; i < convert->width / 2; i++) {
guint32 x = 0;
x |= src[i * 4 + 1] << 22;
x |= (src[i * 4 + 1] & 0xc0) << 14;
x |= src[i * 4 + 2] << 12;
... | false | false | false | false | false | 0 |
addRead(_fcd filename , fortint filename_len) {
integer thisFile;
if( DEBUG2 ) {
_fcd pfile;
copyName(&pfile, filename, filename_len);
printf("PBG_addRead: add for reading filename = %s\n", pfile);
free(pfile);
}
thisFile = addFile(filename,filename_len,'r');
pbgindx( thisFile);
return thi... | false | false | false | false | false | 0 |
fsl_asrc_dma_prepare_and_submit(struct snd_pcm_substream *substream)
{
u8 dir = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? OUT : IN;
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_pcm_runtime *runtime = substream->runtime;
struct fsl_asrc_pair *pair = runtime->private_data;
struct devi... | false | false | false | false | false | 0 |
release_buffer(struct AVCodecContext* avctx, AVFrame* pic)
{
if (pic->type == FF_BUFFER_TYPE_USER)
{
FFVideoDecoder* d = (FFVideoDecoder*) avctx->opaque;
d->m_pReleased = (CImage*) pic->opaque;
Debug printf("FF: >>>> Released buffer %p %p\n", pic->opaque, pic);
memset(pic->data, 0, sizeof(void*) * 4);
pic... | false | false | false | false | false | 0 |
check(ErrorHandler *errh)
{
// HEADER FORMAT:
// USHORT coverageFormat
// USHORT glyphCount
const uint8_t *data = _str.udata();
if (_str.length() < 6) // NB: prevents empty format-2 tables
return errh->error("OTF class def table too small for header");
int classFormat = USHORT_AT(data);
in... | false | false | false | false | false | 0 |
ERR_set_error_data(char *data, int flags)
{
ERR_STATE *es;
int i;
es=ERR_get_state();
i=es->top;
if (i == 0)
i=ERR_NUM_ERRORS-1;
err_clear_data(es,i);
es->err_data[i]=data;
es->err_data_flags[i]=flags;
} | false | false | false | false | false | 0 |
sell_callback(struct impr_type *pimprove, gpointer data)
{
GtkWidget *shl;
struct city_dialog *pdialog = (struct city_dialog *) data;
pdialog->sell_id = improvement_number(pimprove);
int price;
if (!can_client_issue_orders()) {
return;
}
if (test_player_sell_building_now(client.conn.playing, pdial... | false | false | false | false | false | 0 |
cddb_cache_query_init(void)
{
static int query_cache_init = FALSE;
int i;
if (!query_cache_init) {
for (i = 0; i < sizeof(QUERY_CACHE_SIZE); i++) {
query_cache[i].category = CDDB_CAT_INVALID;
}
query_cache_init = TRUE;
}
} | false | false | false | false | false | 0 |
mxl111sf_stream_config_bulk(struct usb_data_stream_properties *stream, u8 endpoint)
{
pr_debug("%s: endpoint=%d size=8192\n", __func__, endpoint);
stream->type = USB_BULK;
stream->count = 5;
stream->endpoint = endpoint;
stream->u.bulk.buffersize = 8192;
} | false | false | false | false | false | 0 |
totem_pl_parser_add_asf_parser (TotemPlParser *parser,
GFile *file,
GFile *base_file,
TotemPlParseData *parse_data,
gpointer data)
{
TotemPlParserResult retval = TOTEM_PL_PARSER_RESULT_UNHANDLED;
char *contents, *ref;
gsize size;
/* NSC files are handled directly by GStreamer */
if (g_str_has_pref... | false | true | false | false | false | 1 |
vtos(const std::vector<double>& ds,std::string sep) { return vtos(&*ds.begin(),&*ds.end(),sep); } | 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.