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 |
|---|---|---|---|---|---|---|
FilterFrame( uint8_t *io, int width, int height, double position, double frame_delta )
{
GtkWidget* widget = glade_xml_get_widget( kinoplus_glade, "checkbutton_panzoom_interlace" );
interlace_on = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( widget ) );
widget = glade_xml_get_widget( kinoplus_glade, "ch... | false | false | false | false | false | 0 |
vector_set_and_comb_evals(
vector* tgt, /*!< Pointer to target vector to set eval_a/b/c supplemental bits */
vector* left, /*!< Pointer to target vector on the left */
vector* right /*!< Pointer to target vector on the right */
) { PROFILE(VECTOR_SET_AND_COMB_EVALS);
switch( tgt->suppl.part.data_type ) {
... | false | false | false | false | false | 0 |
mg_load_dll(const char *dll_name, struct mg_dll_symbol *syms) {
void *dll_handle;
int i;
if ((dll_handle = mg_open_dll(dll_name)) == NULL) {
return dll_name;
} else {
for (i = 0; syms != NULL && syms[i].symbol_name != NULL; i++) {
syms[i].symbol_address.ptr = mg_find_dll_sym(dll_handle,
... | false | false | false | false | false | 0 |
posix_setattr (call_frame_t *frame, xlator_t *this,
loc_t *loc, struct iatt *stbuf, int32_t valid, dict_t *xdata)
{
int32_t op_ret = -1;
int32_t op_errno = 0;
char * real_path = 0;
struct iatt statpre = {0,};
struct iatt statpost... | false | false | false | false | false | 0 |
hns_xgmac_config(struct hns_mac_cb *mac_cb, struct mac_params *mac_param)
{
struct mac_driver *mac_drv;
mac_drv = devm_kzalloc(mac_cb->dev, sizeof(*mac_drv), GFP_KERNEL);
if (!mac_drv)
return NULL;
mac_drv->mac_init = hns_xgmac_init;
mac_drv->mac_enable = hns_xgmac_enable;
mac_drv->mac_disable = hns_xgmac_dis... | false | false | false | false | false | 0 |
getColour(AbstractNodeList::const_iterator i, AbstractNodeList::const_iterator end, ColourValue *result, int maxEntries)
{
int n = 0;
while(i != end && n < maxEntries)
{
float v = 0;
if(getFloat(*i, &v))
{
switch(n)
{
... | false | false | false | false | false | 0 |
scsi_data_dir_opcode(unsigned char op)
{
enum data_direction dir;
switch (op) {
case WRITE_6:
case WRITE_10:
case WRITE_VERIFY:
case WRITE_12:
case WRITE_16:
dir = DATA_WRITE;
break;
default:
dir = DATA_READ;
break;
}
return dir;
} | false | false | false | false | false | 0 |
connection_event_update(int epfd, int fd, uint32_t events){
assert(fd != 0 || fd);
ev.events = events;
ev.data.fd = fd;
int res = epoll_ctl(epfd, EPOLL_CTL_MOD, fd, &ev);
if (res != 0){
DEBUG("[#] epoll_ctl() update failed on fd: %d.\n", fd);
}
return res == 0;
} | false | false | false | false | false | 0 |
MixCoder_Free(CMixCoder *p)
{
int i;
for (i = 0; i < p->numCoders; i++)
{
IStateCoder *sc = &p->coders[i];
if (p->alloc && sc->p)
sc->Free(sc->p, p->alloc);
}
p->numCoders = 0;
if (p->buf)
p->alloc->Free(p->alloc, p->buf);
} | false | false | false | true | false | 1 |
H5O_dec_rc_by_loc(const H5O_loc_t *loc, hid_t dxpl_id)
{
H5O_t *oh = NULL; /* Object header */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
/* check args */
HDassert(loc);
/* Get header */
if(NULL == (oh = H5O_protect(loc, dxpl_id, H5AC_R... | false | false | false | false | false | 0 |
uv_walk(uv_loop_t* loop, uv_walk_cb walk_cb, void* arg) {
QUEUE* q;
uv_handle_t* h;
QUEUE_FOREACH(q, &loop->handle_queue) {
h = QUEUE_DATA(q, uv_handle_t, handle_queue);
if (h->flags & UV__HANDLE_INTERNAL) continue;
walk_cb(h, arg);
}
} | false | false | false | false | false | 0 |
click_action_emit_long_press (gpointer data)
{
ClutterClickAction *action = data;
ClutterClickActionPrivate *priv = action->priv;
ClutterActor *actor;
gboolean result;
priv->long_press_id = 0;
actor = clutter_actor_meta_get_actor (data);
g_signal_emit (action, click_signals[LONG_PRESS], 0,
... | false | false | false | false | false | 0 |
sge_htable_destroy(htable ht)
{
int i;
Bucket *bucket, *next;
for(i=0; i < ht->mask+1; i++) {
for (bucket = ht->table[i]; bucket; bucket = next) {
next = bucket->next;
if(bucket->key != NULL) {
free((char *)bucket->key);
}
free((char *)... | false | false | false | false | false | 0 |
mei_cl_device_uevent(struct device *dev, struct kobj_uevent_env *env)
{
struct mei_cl_device *cldev = to_mei_cl_device(dev);
const uuid_le *uuid = mei_me_cl_uuid(cldev->me_cl);
u8 version = mei_me_cl_ver(cldev->me_cl);
if (add_uevent_var(env, "MEI_CL_VERSION=%d", version))
return -ENOMEM;
if (add_uevent_var(en... | false | false | false | false | false | 0 |
text_dirname_base(char *buff, const char *path)
{
const char *last;
last = path;
while (*last)
{
last++;
}
while (--last > path && *last == '/');
while (last > path && *last-- != '/');
while (last > path && *last == '/')
{
last--;
}
if (path == last && *path != '/')
{
*buff++ = '.';
goto out_buff... | false | false | false | false | false | 0 |
battery_level(DBusConnection *conn, DBusMessage *msg,
void *data)
{
dbus_uint32_t level;
if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_UINT32, &level,
DBUS_TYPE_INVALID))
return btd_error_invalid_args(msg);
if (level > 5)
return btd_error_invalid_args(msg);
telephony_update_indicator(dummy_indic... | false | false | false | false | false | 0 |
bnxt_hwrm_vnic_free(struct bnxt *bp)
{
u16 i;
for (i = 0; i < bp->nr_vnics; i++)
bnxt_hwrm_vnic_free_one(bp, i);
} | false | false | false | false | false | 0 |
gf_w128_sse_bytwo_b_multiply(gf_t *gf, gf_val_128_t a128, gf_val_128_t b128, gf_val_128_t c128)
{
#if defined(INTEL_SSE4)
__m128i a, b, lmask, hmask, pp, c, middle_one;
gf_internal_t *h;
uint64_t topbit, middlebit;
h = (gf_internal_t *) gf->scratch;
c = _mm_setzero_si128();
lmask = _mm_insert_epi64(c, 1... | false | false | false | false | false | 0 |
insert (tree *tr, nodeptr p, nodeptr q, boolean glob)
/* glob -- Smooth tree globally? */
/* q
/.
add/ .
/ .
pn .
s ---- p .remove
pnn .
\ .
add\ .
\. pn = p->next;
... | false | false | false | false | false | 0 |
load_maps(){
int i;
for(i = 0;i < 256;i++){
S5MAP[i] = -1;
S16MAP[i] = -1;
}
S5MAP['A'] = 0;
S5MAP['a'] = 0;
S5MAP['C'] = 1;
S5MAP['c'] = 1;
S5MAP['G'] = 2;
S5MAP['g'] = 2;
S5MAP['T'] = 3;
S5MAP['t'] = 3;
S5MAP['R'] = 4;
S5MAP['r'] = 4;
S5MAP['Y'] = 4;
S5MAP['y'] = 4;
S5MAP['M'] = 4;
S5MAP['m'] =... | false | false | false | false | false | 0 |
openDosageDialog()
{
if (m_CurrentView) {
Q_ASSERT(m_CurrentView->prescriptionView());
m_CurrentView->prescriptionView()->showDosageDialog();
}
} | false | false | false | false | false | 0 |
add_dense_dense(const DenseMatrix &A, const DenseMatrix &B, DenseMatrix &C)
{
CSYMPY_ASSERT(A.row_ == B.row_ && A.col_ == B.col_ &&
A.row_ == C.row_ && A.col_ == C.col_);
unsigned row = A.row_, col = A.col_;
for (unsigned i = 0; i < row; i++) {
for (unsigned j = 0; j < col; j++) {
... | false | false | false | false | false | 0 |
_exvGettext(const char* str)
{
static bool exvGettextInitialized = false;
if (!exvGettextInitialized) {
bindtextdomain(EXV_PACKAGE, EXV_LOCALEDIR);
# ifdef EXV_HAVE_BIND_TEXTDOMAIN_CODESET
bind_textdomain_codeset (EXV_PACKAGE, "UTF-8");
# endif
exvGettextInitialized = true;
}
r... | false | false | false | false | false | 0 |
ecore_con_url_proxy_password_set(Ecore_Con_Url *url_con, const char *password)
{
#ifdef HAVE_CURL
int res = -1;
if (!ECORE_MAGIC_CHECK(url_con, ECORE_MAGIC_CON_URL))
{
ECORE_MAGIC_FAIL(url_con, ECORE_MAGIC_CON_URL, "ecore_con_url_proxy_password_set");
return EINA_FALSE;
}
if (!url_con... | false | false | false | false | false | 0 |
createAsmStreamer(MCContext &Context,
std::unique_ptr<formatted_raw_ostream> OS,
bool isVerboseAsm, bool useDwarfDirectory,
MCInstPrinter *IP, MCCodeEmitter *CE,
MCAsmBackend *... | false | false | false | false | false | 0 |
nfs_idmap_lookup_id(const char *name, size_t namelen, const char *type,
__u32 *id, struct idmap *idmap)
{
char id_str[NFS_UINT_MAXLEN];
long id_long;
ssize_t data_size;
int ret = 0;
data_size = nfs_idmap_get_key(name, namelen, type, id_str, NFS_UINT_MAXLEN, idmap);
if (data_size <= 0) {
ret = -EINVAL... | true | true | false | false | true | 1 |
set_width(unsigned w, bool)
{
unsigned sum = 0;
for (unsigned idx = 0 ; idx < parms_.count() ; idx += 1)
if (parms_[idx] != 0)
sum += parms_[idx]->expr_width();
sum *= repeat();
expr_width(sum);
if (sum != w) return false;
return true;
} | false | false | false | false | false | 0 |
_Py_dg_infinity(int sign)
{
U rv;
word0(&rv) = POSINF_WORD0;
word1(&rv) = POSINF_WORD1;
return sign ? -dval(&rv) : dval(&rv);
} | false | false | false | false | false | 0 |
img_color_allocate_alpha_tri(img, r, g, b, a)
VALUE img, r, g, b, a;
{
gdImagePtr im;
int c;
Data_Get_Struct(img, gdImage, im);
c = gdImageColorAllocateAlpha(im, NUM2INT(r), NUM2INT(g), NUM2INT(b), NUM2INT(a));
return INT2NUM(c);
} | false | false | false | false | false | 0 |
hash_setup(char *str)
{
struct ima_template_desc *template_desc = ima_template_desc_current();
int i;
if (hash_setup_done)
return 1;
if (strcmp(template_desc->name, IMA_TEMPLATE_IMA_NAME) == 0) {
if (strncmp(str, "sha1", 4) == 0)
ima_hash_algo = HASH_ALGO_SHA1;
else if (strncmp(str, "md5", 3) == 0)
im... | false | false | false | false | false | 0 |
ffm_write_data(AVFormatContext *s,
const uint8_t *buf, int size,
int64_t dts, int header)
{
FFMContext *ffm = s->priv_data;
int len;
if (header && ffm->frame_offset == 0) {
ffm->frame_offset = ffm->packet_ptr - ffm->packet + FFM_HEADER_SIZE;
... | false | true | false | false | false | 1 |
AcpiUtDeleteGenericState (
ACPI_GENERIC_STATE *State)
{
ACPI_FUNCTION_ENTRY ();
/* Ignore null state */
if (State)
{
(void) AcpiOsReleaseObject (AcpiGbl_StateCache, State);
}
return;
} | false | false | false | false | false | 0 |
wincursor(pdfapp_t *app, int curs)
{
if (curs == ARROW)
XDefineCursor(xdpy, xwin, xcarrow);
if (curs == HAND)
XDefineCursor(xdpy, xwin, xchand);
if (curs == WAIT)
XDefineCursor(xdpy, xwin, xcwait);
if (curs == CARET)
XDefineCursor(xdpy, xwin, xccaret);
XFlush(xdpy);
} | false | false | false | false | false | 0 |
htmlize_to_blob(Blob *p, const char *zIn, int n){
int c, i, j;
if( n<0 ) n = strlen(zIn);
for(i=j=0; i<n; i++){
c = zIn[i];
switch( c ){
case '<':
if( j<i ) blob_append(p, zIn+j, i-j);
blob_append(p, "<", 4);
j = i+1;
break;
case '>':
if( j<i ) blob_a... | false | false | false | false | false | 0 |
cache_rrset_register(cache_hash_t *hash, dns_cache_rrset_t *rrset, unsigned hvalue, dns_tls_t *tls)
{
int index;
if (cache_rrset_retain(rrset) < 0)
return -1;
index = hvalue % NELEMS(hash->hash_array);
if (hash->hash_array[index] == NULL) {
if (ATOMIC_CAS_PTR(&hash->hash_array[index], ... | false | false | false | false | false | 0 |
CDMakePolygon(SymbolDesc,Layer,Path,Pointer)
struct s *SymbolDesc;
int Layer;
struct p *Path;
struct o **Pointer;
{
struct po *PolygonDesc;
struct o *ObjectDesc;
struct p *Pair;
int i;
CDCheckPath(Path);
for (i = 0, Pair = Path; Pair; Pair = Pair->pSucc, i++) ;
if (!CDBogusPoly && i < 4) {... | false | false | false | false | false | 0 |
orte_grpcomm_base_pack_collective(opal_buffer_t *relay,
orte_jobid_t jobid,
orte_grpcomm_collective_t *coll,
orte_grpcomm_internal_stage_t stg)
{
opal_dss.pack(relay, &coll->id, 1, ORTE_GRPCOMM_COLL_... | false | false | false | false | false | 0 |
TMX_TestStepOffset(void)
{
struct timex txc;
/* Zero maxerror and check it's reset to a maximum after ADJ_SETOFFSET.
This seems to be the only way how to verify that the kernel really
supports the ADJ_SETOFFSET mode as it doesn't return an error on unknown
mode. */
txc.modes = ADJ_MAXERROR;
txc... | false | false | false | false | false | 0 |
GetSpatialRef()
{
if (m_nMainTableIndex == -1)
{
CPLError(CE_Failure, CPLE_AssertionFailed,
"GetSpatialRef() failed: file has not been opened yet.");
return NULL;
}
return m_papoTABFiles[m_nMainTableIndex]->GetSpatialRef();
} | false | false | false | false | false | 0 |
ProcessPreview(OFLibDlg *d,PreviewThread *cur) {
char *pt, *name;
FILE *final;
int ch;
cur->fi->downloading_in_background = false;
if ( cur->result==NULL ) /* Finished, but didn't work */
return;
rewind(cur->result);
pt = strrchr(cur->active->url,'/');
if ( pt==NULL ) { /* Can't happe... | false | true | false | false | true | 1 |
send_echo (PING * ping)
{
size_t off = 0;
int rc;
if (PING_TIMING (data_length))
{
struct timeval tv;
gettimeofday (&tv, NULL);
ping_set_data (ping, &tv, 0, sizeof (tv), USE_IPV6);
off += sizeof (tv);
}
if (data_buffer)
ping_set_data (ping, data_buffer, off,
data_length... | false | false | false | false | false | 0 |
doc2000_read_byte(struct mtd_info *mtd)
{
struct nand_chip *this = mtd->priv;
struct doc_priv *doc = this->priv;
void __iomem *docptr = doc->virtadr;
u_char ret;
ReadDOC(docptr, CDSNSlowIO);
DoC_Delay(doc, 2);
ret = ReadDOC(docptr, 2k_CDSN_IO);
if (debug)
printk("read_byte returns %02x\n", ret);
return ret;... | false | false | false | false | false | 0 |
setSize(int x, int y)
{
if (x == xTiles() && y == yTiles()) {
return;
}
delete [] m_field;
m_field = new int[ x * y ];
m_xTiles = x;
m_yTiles = y;
for (int i = 0; i < x; ++i) {
for (int j = 0; j < y; ++j) {
setField(i, j, EMPTY);
}
}
// set the ... | false | false | false | false | false | 0 |
sdbm_datfno(DBM *db)
{
sdbm_check(db);
if G_UNLIKELY(db->flags & DBM_BROKEN)
return -1;
#ifdef BIGDATA
return big_datfno(db);
#else
return -1;
#endif
} | false | false | false | false | false | 0 |
handle_subagent_response(int op, netsnmp_session * session, int reqid,
netsnmp_pdu *pdu, void *magic)
{
ns_subagent_magic *smagic = (ns_subagent_magic *) magic;
netsnmp_variable_list *u = NULL, *v = NULL;
int rc = 0;
if (_invalid_op_and_magic(op, magic)) {
r... | false | false | false | false | false | 0 |
irmo_server_assign_id(IrmoServer *server)
{
IrmoClientID result;
// Loop until next_id reaches an unused ID.
do {
result = server->next_id;
server->next_id = (server->next_id + 1) & 0xffff;
} while (irmo_hash_table_lookup(server->clients_by_id,
... | false | false | false | false | false | 0 |
__lambda9_ (FsoTestGsmCallTest* self, GAsyncResult* res, GError** error) {
FreeSmartphoneGSMNetwork* _tmp0_ = NULL;
GAsyncResult* _tmp1_ = NULL;
GError * _inner_error_ = NULL;
#line 157 "/tmp/buildd/fso-gsmd-0.12.0/tests/integration/calltests.vala"
g_return_if_fail (res != NULL);
#line 157 "/tmp/buildd/fso-gsmd-0.1... | false | false | false | false | false | 0 |
EmptyIA()
{
EmptyAddr();
ClntCfgIALst.append(new TClntCfgIA());
ClntCfgIALst.getLast()->setOptions(ParserOptStack.getLast());
//ClntCfgIALst.getLast()->addAddr(ClntCfgAddrLst.getLast());
} | false | false | false | false | false | 0 |
run_remote_archiver(const char *remote, int argc,
const char **argv)
{
char *url, buf[LARGE_PACKET_MAX];
int fd[2], i, len, rv;
pid_t pid;
const char *exec = "git-upload-archive";
int exec_at = 0;
for (i = 1; i < argc; i++) {
const char *arg = argv[i];
if (!prefixcmp(arg, "--exec=")) {
if (exec_... | false | false | false | false | false | 0 |
eprn_map_rgb_color_for_RGB(gx_device *device,
const gx_color_value cv[])
{
gx_color_value red = cv[0], green = cv[1], blue = cv[2];
static const gx_color_value half = gx_max_color_value/2;
gx_color_index value = 0;
const eprn_Device *dev = (eprn_Device *)device;
#ifdef EPRN_TRACE
if_debug3(EPRN_TRACE_CHAR,... | false | false | false | false | false | 0 |
readFillStyles(ShapeRecord::FillStyles& styles, SWFStream& in,
SWF::TagType tag, movie_definition& m, const RunResources& /*r*/)
{
in.ensureBytes(1);
boost::uint16_t fillcount = in.read_u8();
if (tag != SWF::DEFINESHAPE) {
if (fillcount == 0xff) {
in.ensureBytes(2);
... | false | false | false | false | false | 0 |
cleanup_fdlpenv_plans()
{
for (int i = 0; i < num_fdlpenv_plans; i++)
{
if (fdlpenv_plans != NULL)
{
if (fdlpenv_plans[i] != NULL)
{
lock_mutex(&fftw_mutex);
fftw_destroy_plan(fdlpenv_plans[i]);
unlock_mutex(&fftw_mutex);
}
}
if (fdlpenv_input_buffers != NULL)
{
if (fdlpenv_input_... | false | false | false | false | false | 0 |
nvidiafb_copyarea(struct fb_info *info, const struct fb_copyarea *region)
{
struct nvidia_par *par = info->par;
if (info->state != FBINFO_STATE_RUNNING)
return;
if (par->lockup) {
cfb_copyarea(info, region);
return;
}
NVDmaStart(info, par, BLIT_POINT_SRC, 3);
NVDmaNext(par, (region->sy << 16) | region->s... | false | false | false | false | false | 0 |
listCert(char* tokenName) {
/* int expired = 0; */
CERTCertList *certList;
CERTCertListNode *cln;
PK11SlotInfo *slot = PK11_FindSlotByName(tokenName);
PK11SlotInfo *internal_slot;
char *internalTokenName;
if (!slot) {
errorRpt(GENERAL_FAILURE, getResourceString(DBT_TOKEN_NAME));
return;
}
if ... | false | false | false | false | false | 0 |
nodir(spec, file)
STR spec, file; {
pchar ch;
ch = strrchr(spec, SLASH_CHAR);
if (!ch) ch = file; else ch++;
strcpy(file, ch);
} | false | false | false | false | true | 1 |
aac_decode_close(AVCodecContext * avccontext) {
AACContext * ac = avccontext->priv_data;
int i, type;
for (i = 0; i < MAX_ELEM_ID; i++) {
for(type = 0; type < 4; type++)
av_freep(&ac->che[type][i]);
}
ff_mdct_end(&ac->mdct);
ff_mdct_end(&ac->mdct_small);
return 0 ;
} | false | false | false | false | false | 0 |
d_identifier (struct d_info *di, int len)
{
const char *name;
name = d_str (di);
if (di->send - name < len)
return NULL;
d_advance (di, len);
/* A Java mangled name may have a trailing '$' if it is a C++
keyword. This '$' is not included in the length count. We just
ignore the '$'. */
i... | false | false | false | false | false | 0 |
from_file_input(void *buf, unsigned int buf_len, void *handle)
{
FILE *fstream = handle;
size_t result;
result = fread(buf, 1, buf_len, fstream);
if (result <= 0) {
if (feof(fstream)) {
return 0;
} else {
return -1;
}
} else {
return (int) result;
}
} | false | false | false | false | true | 1 |
cleanUp(imp_sth_t *imp_sth) {
int i;
int numCols = DBIc_NUM_FIELDS(imp_sth);
for (i = 0; i < numCols; ++i) {
if (imp_sth->coldata[i].type == CS_CHAR_TYPE
|| imp_sth->coldata[i].type == CS_LONGCHAR_TYPE
|| imp_sth->coldata[i].type == CS_TEXT_TYPE
|| imp_sth->coldata[i].type == CS_IMAGE_TYPE) {
Safefr... | false | false | false | false | false | 0 |
addPlanet(Sector *sector, Player *player, int production, double killpercentage)
{
new Planet(UniquePlanetName(), sector, player, production, killpercentage);
} | false | false | false | false | false | 0 |
l2t_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{
v = l2t_get_idx(seq, *pos);
if (v)
++*pos;
return v;
} | false | false | false | false | false | 0 |
calc_filter_buf_size(TABLE *table, const prep_stmt& pst,
const record_filter *filters)
{
size_t filter_buf_len = 0;
for (const record_filter *f = filters; f->op.begin() != 0; ++f) {
if (f->val.begin() == 0) {
continue;
}
const uint32_t fn = pst.get_filter_fields()[f->ff_offset];
filter_buf_l... | false | false | false | false | false | 0 |
libmail_gpg_deletekey(const char *gpgdir, int secret,
const char *fingerprint,
int (*dump_func)(const char *, size_t, void *),
void *voidarg)
{
char *argvec[8];
int rc;
argvec[0]="gpg";
argvec[1]="--command-fd";
argvec[2]="0";
argvec[3]= secret ? "--delete-secret-key":"--delete-key";
argvec[4]="-... | true | true | false | false | false | 1 |
add_graph_edge (constraint_graph_t graph, unsigned int to,
unsigned int from)
{
if (to == from)
{
return false;
}
else
{
bool r = false;
if (!graph->succs[from])
graph->succs[from] = BITMAP_ALLOC (&pta_obstack);
if (bitmap_set_bit (graph->succs[from], to))
{
r = true;
... | false | false | false | false | false | 0 |
__update_selected(struct lacpdu *lacpdu, struct port *port)
{
if (lacpdu && port) {
const struct port_params *partner = &port->partner_oper;
/* check if any parameter is different then
* update the state machine selected variable.
*/
if (ntohs(lacpdu->actor_port) != partner->port_number ||
ntohs(lac... | false | false | false | false | false | 0 |
tdb_direct(struct tdb_context *tdb, tdb_off_t off, size_t len,
bool write_mode)
{
enum TDB_ERROR ecode;
if (unlikely(!tdb->file->map_ptr))
return NULL;
ecode = tdb_oob(tdb, off + len, false);
if (unlikely(ecode != TDB_SUCCESS))
return TDB_ERR_PTR(ecode);
return (char *)tdb->file->map_ptr + off;
} | false | false | false | false | false | 0 |
waitForThread( ThreadIdentifierCref anId )
throw ( InvalidThreadException )
{
ThreadContextCref aContext(Thread::getThreadContext(anId));
Int aStatus(0);
waitpid(anId.getScalar(),&aStatus,0);
return aStatus;
} | false | false | false | false | false | 0 |
font_family_convert (font_family_t const *self,
ccss_property_type_t target,
void *value)
{
/* Only conversion to string is supported. */
if (CCSS_PROPERTY_TYPE_STRING == target) {
* (char **) value = g_strdup (self->font_family);
return true;
}
return false;
} | false | false | false | false | false | 0 |
visit(ir_dereference_record *ir)
{
const glsl_type *struct_type = ir->record->type;
ir->record->accept(this);
unsigned int offset = 0;
for (unsigned int i = 0; i < struct_type->length; i++) {
if (strcmp(struct_type->fields.structure[i].name, ir->field) == 0)
break;
offset += type_size(struct... | false | false | false | false | false | 0 |
entangle_camera_picker_finalize(GObject *object)
{
EntangleCameraPicker *picker = ENTANGLE_CAMERA_PICKER(object);
EntangleCameraPickerPrivate *priv = picker->priv;
ENTANGLE_DEBUG("Finalize camera picker");
gtk_list_store_clear(priv->model);
if (priv->cameras)
g_object_unref(priv->cameras);... | false | false | false | false | false | 0 |
elf_copy_symbol_attributes (symbolS *dest, symbolS *src)
{
struct elf_obj_sy *srcelf = symbol_get_obj (src);
struct elf_obj_sy *destelf = symbol_get_obj (dest);
if (srcelf->size)
{
if (destelf->size == NULL)
destelf->size = (expressionS *) xmalloc (sizeof (expressionS));
*destelf->size = *srcelf-... | false | false | false | false | false | 0 |
DoParseProgram(Handle<String> source,
bool in_global_context,
StrictModeFlag strict_mode,
ZoneScope* zone_scope) {
ASSERT(target_stack_ == NULL);
if (pre_data_ != NULL) pre_data_->Initialize();
... | false | false | false | false | false | 0 |
selectExtractValue(const User *U) {
const ExtractValueInst *EVI = dyn_cast<ExtractValueInst>(U);
if (!EVI)
return false;
// Make sure we only try to handle extracts with a legal result. But also
// allow i1 because it's easy.
EVT RealVT = TLI.getValueType(DL, EVI->getType(), /*AllowUnknown=*/true);
if... | false | false | false | false | false | 0 |
newJob( const KFileItemList & lstItems )
{
DirectorySizeJobPrivate *d = new DirectorySizeJobPrivate(lstItems);
DirectorySizeJob *job = new DirectorySizeJob(*d);
job->setUiDelegate(new JobUiDelegate);
QTimer::singleShot( 0, job, SLOT(processNextItem()) );
... | false | false | false | false | false | 0 |
qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
Q_ASSERT(staticMetaObject.cast(_o));
AddSearch *_t = static_cast<AddSearch *>(_o);
switch (_id) {
case 0: _t->initializePage(); break;
case 1: { int _r = _t-... | false | false | false | false | false | 0 |
internalOpen(void)
{
havePose = false;
myFD = fopen(myLogFile, "r");
if (myFD == NULL)
{
myStatus = STATUS_OPEN_FAILED;
return OPEN_FILE_NOT_FOUND;
}
char buf[100];
if (fgets(buf,100,myFD) != NULL)
{
if (strncmp(buf, "// Saphira log file", 19) != 0)
{
myStatus ... | false | false | false | false | true | 1 |
vmlfb_alloc_vram_area(struct vram_area *va, unsigned max_order,
unsigned min_order)
{
gfp_t flags;
unsigned long i;
max_order++;
do {
/*
* Really try hard to get the needed memory.
* We need memory below the first 32MB, so we
* add the __GFP_DMA flag that guarantees that we are
* below the first... | false | false | false | false | false | 0 |
marker_mkdir (call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
dict_t *params)
{
int32_t ret = 0;
marker_local_t *local = NULL;
marker_conf_t *priv = NULL;
priv = this->private;
if (priv->feature_enabled == 0)
goto wind;... | false | false | false | false | false | 0 |
_generate_resv_name(resv_desc_msg_t *resv_ptr)
{
char *key, *name, *sep;
int len;
/* Generate name prefix, based upon the first account
* name if provided otherwise first user name */
if (resv_ptr->accounts && resv_ptr->accounts[0])
key = resv_ptr->accounts;
else
key = resv_ptr->users;
if (key[0] == '-')
... | false | false | false | false | false | 0 |
PyFFContour_init(PyFF_Contour *self, PyObject *args, PyObject *kwds) {
int quad=0;
if ( args!=NULL && !PyArg_ParseTuple(args, "|i", &quad))
return -1;
self->is_quadratic = (quad!=0);
return 0;
} | false | true | false | false | false | 1 |
nm_client_get_version (NMClient *client)
{
NMClientPrivate *priv;
g_return_val_if_fail (NM_IS_CLIENT (client), NULL);
priv = NM_CLIENT_GET_PRIVATE (client);
_nm_object_ensure_inited (NM_OBJECT (client));
return priv->manager_running ? priv->version : NULL;
} | false | false | false | false | false | 0 |
cap_drop(gr_cap_t a, gr_cap_t b)
{
int i;
gr_cap_t ret;
for (i = 0; i < 2; i++)
ret.cap[i] = a.cap[i] &~ b.cap[i];
return ret;
} | false | false | false | false | false | 0 |
spawn_apt_cache (GIOChannel **available, GError **error)
{
const gchar *argv[] = {"apt-cache", "dumpavail", NULL};
const gchar *envbinary;
gint cstdo;
envbinary = g_getenv (UNITY_WEBAPPS_APT_CACHE_BINARY_ENV_VARIABLE);
if (envbinary != NULL)
{
argv[0] = envbinary;
}
g_spawn_async_with_pi... | false | false | false | false | false | 0 |
PropagateUpdateExtentCallback(int* extent)
{
if (this->GetInput())
{
this->GetInput()->SetUpdateExtent(extent);
}
} | false | false | false | false | false | 0 |
http_parse_host(const char * buf, struct http_parser_url *u, int found_at) {
enum http_host_state s;
const char *p;
size_t buflen = u->field_data[UF_HOST].off + u->field_data[UF_HOST].len;
u->field_data[UF_HOST].len = 0;
s = found_at ? s_http_userinfo_start : s_http_host_start;
for (p = buf + u->field_d... | false | false | false | false | false | 0 |
Aggro(Unit* /*pWho*/) override
{
DoScriptText(SAY_AGGRO, m_creature);
// Note: on aggro the bats from the cave behind the boss should fly outside!
if (DoCastSpellIfCan(m_creature, SPELL_BAT_FORM) == CAST_OK)
{
m_creature->SetLevitate(true);
// override MMaps,... | false | false | false | false | false | 0 |
gst_asf_demux_add_video_stream (GstASFDemux * demux,
asf_stream_video_format * video, guint16 id,
guint8 ** p_data, guint64 * p_size)
{
GstTagList *tags = NULL;
GstBuffer *extradata = NULL;
GstPad *src_pad;
GstCaps *caps;
gchar *str;
gchar *name = NULL;
gchar *codec_name = NULL;
gint size_left =... | false | false | false | false | false | 0 |
setImage( const QImage &image )
{
if( m_artworkCapability && m_artworkCapability.data()->canUpdateCover() )
{
// reset to initial values, let next call to image() re-fetch it
m_hasImagePossibility = true;
m_hasImageChecked = false;
m_artworkCapability.data()->setCover( MediaDevi... | false | false | false | false | false | 0 |
left(void)
{
if (myPrinting)
printf("left\n");
myRotRatio = 100;
} | false | false | false | false | false | 0 |
scriptlevel( const QwtMmlNode *node ) const
{
QwtMmlNode *base = firstChild();
Q_ASSERT( base != 0 );
QwtMmlNode *under = base->nextSibling();
Q_ASSERT( under != 0 );
int sl = QwtMmlNode::scriptlevel();
if ( node != 0 && node == under )
return sl + 1;
else
return sl;
} | false | false | false | false | false | 0 |
syncevo_config_set_value (SyncevoConfig *config,
const char *source,
const char *key,
const char *value)
{
gboolean changed;
char *name;
char *old_value;
GHashTable *source_config;
g_return_val_if_fail (config, FALSE);
... | false | false | false | false | false | 0 |
charTo2byte (char d[], char s[], int len)
{
/*
* copy ASCII string to 2 byte unicode string
* len is length of destination buffer
* Returns: number of characters copied
*/
int done = 0;
int copied = 0;
int i;
len = len / 2;
for (i = 0; i < len; i++)
{
d[2 * i] = '\0';
if (s[i] ... | false | false | false | false | true | 1 |
attach() {
if (!omni::internalLock) omni::internalLock = new omni_tracedmutex;
if (!omni::poRcLock) omni::poRcLock = new omni_tracedmutex;
if (!omni::objref_rc_lock) omni::objref_rc_lock = new omni_tracedmutex;
numObjectsInTable = 0;
minNumObjects = 0;
if( orbParameters::object... | false | false | false | false | false | 0 |
wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic)
{
wilc_wlan_inp_t nwi;
perInterface_wlan_t *nic = p_nic;
int ret = 0;
struct wilc *wl = nic->wilc;
if (!wl->initialized) {
wl->mac_status = WILC_MAC_STATUS_INIT;
wl->close = 0;
wlan_init_locks(dev);
linux_to_wlan(&nwi, wl);
ret = ... | true | true | false | false | false | 1 |
_gda_postgres_meta_udt (G_GNUC_UNUSED GdaServerProvider *prov, GdaConnection *cnc,
GdaMetaStore *store, GdaMetaContext *context, GError **error,
const GValue *udt_catalog, const GValue *udt_schema)
{
GdaDataModel *model;
gboolean retval = TRUE;
GdaPostgresReuseable *rdata;
rdata = GDA_POSTGRES_GET_REUSEABLE_... | false | false | false | false | false | 0 |
add_transaction_credits(journal_t *journal, int blocks,
int rsv_blocks)
{
transaction_t *t = journal->j_running_transaction;
int needed;
int total = blocks + rsv_blocks;
/*
* If the current transaction is locked down for commit, wait
* for the lock to be released.
*/
if (t->t_state == T_LOCKED) {
w... | false | false | false | false | false | 0 |
xd_get_unused_block(struct rtsx_chip *chip, int zone_no)
{
struct xd_info *xd_card = &(chip->xd_card);
struct zone_entry *zone;
u32 phy_blk;
if (zone_no >= xd_card->zone_cnt) {
dev_dbg(rtsx_dev(chip), "Get unused block from invalid zone (zone_no = %d, zone_cnt = %d)\n",
zone_no, xd_card->zone_cnt);
return B... | false | false | false | false | false | 0 |
namcos1_set_flipscreen(int flip)
{
int i;
int pos_x[] = {0x0b0,0x0b2,0x0b3,0x0b4};
int pos_y[] = {0x108,0x108,0x108,0x008};
int neg_x[] = {0x1d0,0x1d2,0x1d3,0x1d4};
int neg_y[] = {0x1e8,0x1e8,0x1e8,0x0e8};
flipscreen = flip;
if(!flip)
{
for ( i = 0; i < 4; i++ ) {
scrolloffsX[i] = pos_x[i];
... | false | false | false | false | false | 0 |
blank_frameset(Gt_Frameset *fset, int f1, int f2, int delete_object)
{
int i;
if (delete_object) f1 = 0, f2 = -1;
if (f2 < 0) f2 = fset->count - 1;
for (i = f1; i <= f2; i++) {
/* We may have deleted stream and image earlier to save on memory; see
above in merge_frame_interval(); but if we didn't, do... | false | false | false | false | false | 0 |
TransformPoints(const float *inPts, float *outPts, int n)
{
double *M = this->Matrix->GetData();
for (int i = 0; i < n; ++i)
{
vtkHomogeneousTransformPoint2D(M, &inPts[2*i], &outPts[2*i]);
}
} | 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.