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 |
|---|---|---|---|---|---|---|
user_read(int fd, void *buf, size_t count)
{
#ifdef HAVE_ZLIB_H
int status, len;
#endif
if (count == 0)
return 0;
#ifndef HAVE_ZLIB_H
return read(fd, buf, count);
#else
/* Only input from stdin can be compressed */
if (fd != STDIN_FILENO || !compression)
return read(fd, buf, count);
if (compression_error) ... | false | true | false | false | true | 1 |
input_filter(const unsigned char *id,
const unsigned char *prefix, unsigned short plen,
const unsigned char *neigh, unsigned int ifindex)
{
int res;
res = do_filter(input_filters, id, prefix, plen, neigh, ifindex, 0);
if(res < 0)
res = 0;
return res;
} | false | false | false | false | false | 0 |
_vala_main (gchar** args, int args_length1) {
gint result = 0;
GTestSuite* root = NULL;
GTestSuite* _tmp0_ = NULL;
FsoTestTestUsage* _tmp1_ = NULL;
FsoTestTestUsage* _tmp2_ = NULL;
GTestSuite* _tmp3_ = NULL;
#line 180 "/tmp/buildd/fso-usaged-0.12.0/tests/integration/main.vala"
g_test_init (&args_length1, &args, ... | false | false | false | false | false | 0 |
pcx_write_rle(const byte * from, const byte * end, int step, FILE * file)
{ /*
* The PCX format theoretically allows encoding runs of 63
* identical bytes, but some readers can't handle repetition
* counts greater than... | false | false | false | false | false | 0 |
cs_ipvec (const int *p, const double *b, double *x, int n)
{
int k ;
if (!x || !b) return (0) ; /* check inputs */
for (k = 0 ; k < n ; k++) x [p ? p [k] : k] = b [k] ;
return (1) ;
} | false | false | false | false | false | 0 |
maybe_optimize_var (tree var, bitmap addresses_taken, bitmap not_reg_needs)
{
bool update_vops = false;
/* Global Variables, result decls cannot be changed. */
if (is_global_var (var)
|| TREE_CODE (var) == RESULT_DECL
|| bitmap_bit_p (addresses_taken, DECL_UID (var)))
return false;
/* If the ... | false | false | false | false | false | 0 |
build_arrays (gimple swtch)
{
tree arr_index_type;
tree tidx, sub, tmp, utype;
gimple stmt;
gimple_stmt_iterator gsi;
int i;
location_t loc = gimple_location (swtch);
gsi = gsi_for_stmt (swtch);
/* Make sure we do not generate arithmetics in a subrange. */
utype = TREE_TYPE (info.index_expr);
if ... | false | false | false | false | false | 0 |
solve(vnl_vector<double> const& b) const
{
assert(b.size() == L_.columns());
vnl_vector<double> ret = b;
solve(b,&ret);
return ret;
} | false | false | false | false | false | 0 |
git_filebuf_printf(git_filebuf *file, const char *format, ...)
{
va_list arglist;
size_t space_left;
int len, res;
char *tmp_buffer;
ENSURE_BUF_OK(file);
space_left = file->buf_size - file->buf_pos;
do {
va_start(arglist, format);
len = p_vsnprintf((char *)file->buffer + file->buf_pos, space_left, format,... | false | false | false | false | false | 0 |
hb_icu_unicode_compose (hb_unicode_funcs_t *ufuncs HB_UNUSED,
hb_codepoint_t a,
hb_codepoint_t b,
hb_codepoint_t *ab,
void *user_data HB_UNUSED)
{
#if U_ICU_VERSION_MAJOR_NUM >= 49
{
UChar32 ret = unorm2_composePair (normalizer, a, b);
if (ret < 0) return false;
*ab... | false | false | false | false | false | 0 |
aesni_cbc_hmac_sha1_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr)
{
EVP_AES_HMAC_SHA1 *key = data(ctx);
switch (type)
{
case EVP_CTRL_AEAD_SET_MAC_KEY:
{
unsigned int i;
unsigned char hmac_key[64];
memset (hmac_key,0,sizeof(hmac_key));
if (arg > (int)sizeof(hmac_key)) {
SHA1_Init(&key->... | false | false | false | false | false | 0 |
open_scanner (Epson_Scanner * s)
{
SANE_Status status = 0;
DBG (5, "open_scanner()\n");
if (s->fd != -1)
{
DBG (5, "scanner is already open: fd = %d\n", s->fd);
return SANE_STATUS_GOOD; /* no need to open the scanner */
}
/* don't do this for OS2: */
#ifndef HAVE_OS2_H
#if 0
/* test the devi... | false | false | false | false | false | 0 |
load_file_data_new (GthBrowser *browser,
GthFileData *file_data,
gboolean view)
{
LoadFileData *data;
data = g_new0 (LoadFileData, 1);
data->ref = 1;
data->browser = g_object_ref (browser);
if (file_data != NULL)
data->file_data = gth_file_data_dup (file_data);
data->view = view;
data->cancel... | false | false | false | false | false | 0 |
_set_mode_raw (void)
{
struct termios tty;
if (tcgetattr (STDIN_FILENO, &saved_tty) < 0)
{
perror ("tcgetattr");
return (-1);
}
memcpy (&tty, &saved_tty, sizeof (struct termios));
tty.c_iflag = 0;
tty.c_oflag = 0;
tty.c_cflag &= ~CSIZE;
tty.c_cflag |= CS8;
tty.c_cflag &= ~PARENB;
... | false | false | false | false | false | 0 |
Boolean_getBoolean(JNIEnv *env, jobject obj , const char* p0 , jboolean* result, lList **alpp) {
jgdi_result_t ret = JGDI_SUCCESS;
static jmethodID mid = NULL;
jstring p0_obj = NULL;
jboolean temp = FALSE;
DENTER(BASIS_LAYER, "Boolean_getBoolean");
if (result == NULL ) {
answer_list_... | false | false | false | false | false | 0 |
streamDecode(unsigned char *buf, int size,
uint64_t iv64, const CipherKey &ckey) const
{
rAssert( size > 0 );
shared_ptr<SSLKey> key = dynamic_pointer_cast<SSLKey>(ckey);
rAssert(key->keySize == _keySize);
rAssert(key->ivLength == _ivLength);
Lock lock( key->mutex );
unsigned char ivec[ MAX_... | false | false | false | false | false | 0 |
clear_declarations()
{
// Free strings in memory we manage.
for (Declaration_map::iterator it = this->declarations_.begin();
it != this->declarations_.end();
++it)
{
if (it->second.parent_offset_ == -1)
delete[] it->second.name_;
}
this->declarations_.clear();
} | false | false | false | false | false | 0 |
tr_probe_num(const std::string& x)const
{
if (Umatch(x, "method ")) {untested();
return static_cast<double>(_method_a);
}else{
return ELEMENT::tr_probe_num(x);
}
} | false | false | false | false | false | 0 |
check(SylvParams& pars, const GeneralMatrix& m) const
{
// M - Q*B*inv(Q)
SqSylvMatrix c(getQ(), getB());
c.multRight(getInvQ());
c.add(-1.0, m);
pars.f_err1 = c.getNorm1();
pars.f_errI = c.getNormInf();
// I - Q*inv(Q)
c.setUnit();
c.mult(-1);
c.multAndAdd(getQ(), getInvQ());
pars.viv_err1 = c.getNorm1();
... | false | false | false | false | false | 0 |
eina_prefix_free(Eina_Prefix *pfx)
{
if (!pfx) return;
IF_FREE_NULL(pfx->exe_path);
IF_FREE_NULL(pfx->prefix_path);
IF_FREE_NULL(pfx->prefix_path_bin);
IF_FREE_NULL(pfx->prefix_path_data);
IF_FREE_NULL(pfx->prefix_path_lib);
IF_FREE_NULL(pfx->prefix_path_locale);
free(pfx);
} | false | false | false | false | false | 0 |
OnDragScrollEventRescan(wxCommandEvent& event )
// ----------------------------------------------------------------------------
{
// Received a request to rescan for child windows starting
// at the given event.GetWindow() pointer. This allows us
// to scroll windows not on the main frame tree.
// But ... | false | false | false | false | false | 0 |
listDirectory(const char *dir, std::vector<File> &files, bool mediaOnly)
{
if (!dir || !dir[0]) return;
DIR *dp;
struct dirent *dirp;
char path[1024], ext[10];
int len = strlen(dir);
struct stat st;
if (len > sizeof(path) - 2) {
fprintf(stderr, "directory name too long: %s\n", dir);
return;
... | false | false | false | false | false | 0 |
aat2870_reg_write_file(struct file *file,
const char __user *user_buf, size_t count,
loff_t *ppos)
{
struct aat2870_data *aat2870 = file->private_data;
char buf[32];
ssize_t buf_size;
char *start = buf;
unsigned long addr, val;
int ret;
buf_size = min(count, (size_t)(sizeof(buf)-1));
if (co... | true | true | false | false | false | 1 |
operator==(const CECTag& tag) const
{
return m_dataType == tag.m_dataType
&& m_tagName == tag.m_tagName
&& m_dataLen == tag.m_dataLen
&& (m_dataLen == 0
|| !memcmp(m_tagData, tag.m_tagData, m_dataLen))
&& m_tagList == tag.m_tagList;
} | false | false | false | false | false | 0 |
qla82xx_minidump_process_rdcrb(scsi_qla_host_t *vha,
qla82xx_md_entry_hdr_t *entry_hdr, uint32_t **d_ptr)
{
struct qla_hw_data *ha = vha->hw;
uint32_t r_addr, r_stride, loop_cnt, i, r_value;
struct qla82xx_md_entry_crb *crb_hdr;
uint32_t *data_ptr = *d_ptr;
crb_hdr = (struct qla82xx_md_entry_crb *)entry_hdr;
r_... | false | false | false | false | false | 0 |
goo_canvas_table_move_child (GooCanvasItem *item,
gint old_position,
gint new_position)
{
GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item;
GooCanvasTable *table = (GooCanvasTable*) item;
if (!simple->model)
goo_canvas_table_move_child_internal (table->table_data, old_... | false | false | false | false | false | 0 |
dump(ostream&o, unsigned ind) const
{
o << setw(ind) << "" << "-> " << event_->name() << "; "
<< "// " << get_fileline() << endl;
} | false | false | false | false | false | 0 |
fs_nvram_address_of(fs_nvram_t *fs, m_uint32_t offset)
{
if ((fs->flags & FS_NVRAM_FLAG_ADDR_ABSOLUTE))
return(fs->addr + offset);
else
return(offset - 8);
} | false | false | false | false | false | 0 |
gst_gaussianblur_transform_frame (GstVideoFilter * vfilter,
GstVideoFrame * in_frame, GstVideoFrame * out_frame)
{
GstGaussianBlur *filter = GST_GAUSSIANBLUR (vfilter);
GstClockTime timestamp;
gint64 stream_time;
gfloat sigma;
guint8 *src, *dest;
/* GstController: update the properties */
timestamp =... | false | false | false | false | false | 0 |
mgsl_load_tx_dma_buffer(struct mgsl_struct *info,
const char *Buffer, unsigned int BufferSize)
{
unsigned short Copycount;
unsigned int i = 0;
DMABUFFERENTRY *pBufEntry;
if ( debug_level >= DEBUG_LEVEL_DATA )
mgsl_trace_block(info,Buffer, min_t(int, BufferSize, DMABUFFERSIZE), 1);
if (info->params.flags & H... | false | true | false | false | false | 1 |
init_line(
rspl *s, /* this */
line *l, /* line structure */
double st[MXRO], /* start of line */
double de[MXRO] /* line direction and length */
) {
int f, fdi = s->fdi;
int **rpp;
int rgres_1 = s->rev.res - 1;
int nvalid = 0; /* Flag set if outside reverse grid range */
DBGV(("Line from ", fdi, " %f",... | false | false | false | false | false | 0 |
mjcxz()
{
if (opcode != defsize)
{
aprefix = 0x67;
++mcount; /* quick fix - mshort() needs to know */
}
opcode = 0xE3;
mshort();
if (aprefix != 0x0)
--mcount; /* quick fix - main routine bumps it again */
} | false | false | false | false | false | 0 |
relayMsgRepl(SPtr<TRelMsg> msg) {
int port;
SPtr<TRelCfgIface> cfgIface = RelCfgMgr().getIfaceByInterfaceID(msg->getDestIface());
if (!cfgIface) {
Log(Error) << "Unable to relay message: Invalid interfaceID value:" << msg->getDestIface() << LogEnd;
return;
}
SPtr<TIfaceIface> iface = RelIfaceMgr(... | false | false | false | false | false | 0 |
nautilus_window_sync_up_button (NautilusWindow *window)
{
GtkAction *action;
GtkActionGroup *action_group;
NautilusWindowSlot *slot;
gboolean allowed;
GFile *parent, *location;
slot = nautilus_window_get_active_slot (window);
location = nautilus_window_slot_get_location (slot);
allowed = FALSE;
if (location ... | false | false | false | false | false | 0 |
get(Tag tag) const
{
switch(tag) {
case Date: return pdnDate;
case Site: return pdnSite;
case Type: return pdnType;
case Event: return pdnEvent;
case Round: return pdnRound;
case White: return pdnWhite;
case Black: return pdnBlack;
default: return pdnResult;
}
} | false | false | false | false | false | 0 |
cbc_setiv(const unsigned char *IV, unsigned long len, symmetric_CBC *cbc)
{
LTC_ARGCHK(IV != NULL);
LTC_ARGCHK(cbc != NULL);
if (len != (unsigned long)cbc->blocklen) {
return CRYPT_INVALID_ARG;
}
XMEMCPY(cbc->IV, IV, len);
return CRYPT_OK;
} | false | false | false | true | false | 1 |
freeResolvedPolyData(Class *class) {
ClassBlock *cb = CLASS_CB(class);
ConstantPool *cp = &cb->constant_pool;
int i;
for(i = 1; i < cb->constant_pool_count; i++)
if(CP_TYPE(cp, i) >= CONSTANT_ResolvedPolyMethod)
gcPendingFree((void*)CP_INFO(cp, i));
else if(CP_TYPE(cp, i) =... | false | false | false | false | false | 0 |
send_release(SOCKET *sock,unsigned char reason,...)
{
va_list ap;
Q_DSC dsc;
int size;
q_create(&dsc,q_buffer,MAX_Q_MSG);
q_assign(&dsc,QF_msg_type,ATM_MSG_RELEASE);
q_assign(&dsc,QF_call_ref,sock->call_ref);
q_assign(&dsc,QF_cause,reason);
va_start(ap,reason);
switch (reason) {
c... | false | false | false | false | false | 0 |
fits_shuffle_2bytes(char *heap, LONGLONG length, int *status)
/* shuffle the bytes in an array of 2-byte integers in the heap */
{
LONGLONG ii;
char *ptr, *cptr, *heapptr;
ptr = malloc((size_t) (length * 2));
heapptr = heap;
cptr = ptr;
for (ii = 0; ii < length; ii++) {
*cptr ... | false | false | false | false | true | 1 |
dim2_read_ctr(u32 ctr_addr, u16 mdat_idx)
{
DIMCB_IoWrite(&g.dim2->MADR, ctr_addr);
/* wait till transfer is completed */
while ((DIMCB_IoRead(&g.dim2->MCTL) & 1) != 1)
continue;
DIMCB_IoWrite(&g.dim2->MCTL, 0); /* clear transfer complete */
return DIMCB_IoRead((&g.dim2->MDAT0) + mdat_idx);
} | false | false | false | false | false | 0 |
gfs2_statfs_change(struct gfs2_sbd *sdp, s64 total, s64 free,
s64 dinodes)
{
struct gfs2_inode *l_ip = GFS2_I(sdp->sd_sc_inode);
struct gfs2_statfs_change_host *l_sc = &sdp->sd_statfs_local;
struct gfs2_statfs_change_host *m_sc = &sdp->sd_statfs_master;
struct buffer_head *l_bh;
s64 x, y;
int need_sync = 0;
i... | false | false | false | false | false | 0 |
env_opt_end (register int emptyok)
{
register int len;
len = opt_replyp - opt_reply + 2;
if (emptyok || len > 6)
{
*opt_replyp++ = IAC;
*opt_replyp++ = SE;
if (NETROOM () > len)
{
ring_supply_data (&netoring, opt_reply, len);
printsub ('>', &opt_reply[2], len - 2);
}
/*@*/
els... | false | false | false | false | false | 0 |
lamp_type_apply(ob_methods *context, object *lamp, object *applier, int aflags) {
object *tmp;
if (object_get_player_container(lamp) != applier) {
draw_ext_info_format(NDI_UNIQUE, 0, applier, MSG_TYPE_APPLY, MSG_TYPE_APPLY_ERROR,
"You must get it first!\n");
return METHOD_ERROR;
... | false | false | false | false | false | 0 |
hist_put(double t, int hist[])
{
int i;
/* scale factor */
i = (int)(t * ((double)hist_n / 100.));
if (i < 1)
i = 1;
if (i > hist_n)
i = hist_n;
hist[i - 1] += 1;
} | false | false | false | false | false | 0 |
_roster_save_item(user_t user, item_t item) {
os_t os;
os_object_t o;
char filter[4096];
int i;
log_debug(ZONE, "saving roster item %s for %s", jid_full(item->jid), jid_user(user->jid));
os = os_new();
o = os_object_new(os);
os_object_put(o, "jid", jid_full(item->jid), os_type_STRING)... | false | false | false | false | false | 0 |
BM_create(int x, int y)
{
struct BM *map;
if (Mode == BM_SPARSE)
return BM_create_sparse(x, y);
if (NULL == (map = (struct BM *)malloc(sizeof(struct BM))))
return (NULL);
map->bytes = (x + 7) / 8;
if (NULL ==
(map->data = (unsigned char *)calloc(map->bytes * y, sizeof(char))))
return (NULL);... | false | false | false | false | true | 1 |
set_unicable_adapters(char *o, int type)
{
int i, la, a_id, slot, freq, pin, o13v;
char buf[100], *arg[20], *sep1, *sep2, *sep3;
adapter *ad;
strncpy(buf, o, sizeof(buf));
la = split(arg, buf, sizeof(arg), ',');
for (i = 0; i < la; i++)
{
a_id = map_intd(arg[i], NULL, -1);
if (a_id < 0 || a_id >= MAX_ADAPTER... | true | true | false | false | false | 1 |
FromBinHex(char *src,char *dst)
{
char b;
unsigned long bucle;
int zone=0;
for (bucle=0;bucle<strlen(src);bucle++)
{
switch (toupper(src[bucle]))
{
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
b=src[bucle]-48; break;
default:
b=src[bucle]... | false | false | false | false | false | 0 |
clear()
{
Q_EMIT aboutToClear();
qDeleteAll(_fragments);
_fragments.clear();
_items.clear();
if (_docOutput)
_docOutput->clear();
_posTrans.clear();
Q_EMIT cleared();
} | false | false | false | false | false | 0 |
toRational(long n) const
{
return p_->value_.get() == 0 ? Rational(-1, 1) : p_->value_->toRational(n);
} | false | false | false | false | false | 0 |
insert_field_init_byte(char *name, int index, int value)
{
if (value < -128 || value > 255) { return -1; }
int16_t n = value;
uint16_t v = (n & 0xffff);
fprintf(out, "; insert_field_init_byte\n");
fprintf(out, " lda #%d\n", (uint8_t)v & 0xff);
fprintf(out, " sta %s + 0\n", name);
fprintf(out, " lda #... | false | false | false | false | false | 0 |
resetStats(bool all)
{
mWin=0;
mLost=0;
mBrk=0;
mRemis=0;
if (all)
{
mAllWin=0;
mAllLost=0;
mAllBrk=0;
mAllRemis=0;
}
} | false | false | false | false | false | 0 |
clear_event_requests_for_assembly (MonoAssembly *assembly)
{
int i;
gboolean found;
mono_loader_lock ();
found = TRUE;
while (found) {
found = FALSE;
for (i = 0; i < event_requests->len; ++i) {
EventRequest *req = g_ptr_array_index (event_requests, i);
if (event_req_matches_assembly (req, assembly)) {
... | false | false | false | false | false | 0 |
branch_open(struct view *view)
{
const char *branch_log[] = {
"git", "log", "--no-color", "--pretty=raw",
"--simplify-by-decoration", "--all", NULL
};
if (!run_io_rd(&view->io, branch_log, NULL, FORMAT_NONE)) {
report("Failed to load branch data");
return TRUE;
}
setup_update(view, view->id);
foreach_r... | false | false | false | false | false | 0 |
operator+(const GNativeString &s2) const
{
GP<GStringRep> g = s2;
if (s2.ptr)
g = s2->toUTF8(true);
return GStringRep::UTF8::create(*this,g);
} | false | false | false | false | false | 0 |
disassemble(char *Instruction, char *Arg1, char *Arg2)
{
EXT_Instr Instr;
Memory_RetrWordFromPC(&Instr.Code);
if(Instr.Bits.OPMode==2) { /* Byte -> Word */
sprintf(Instruction, "EXT.W");
} else if(Instr.Bits.OPMode==3) { /* Word -> Long */
sprintf(Instruction, "EXT.L");
} else if(Instr.Bits.OPMode==7) { /* B... | false | true | false | false | false | 1 |
iser_reg_desc_get_fr(struct ib_conn *ib_conn)
{
struct iser_fr_pool *fr_pool = &ib_conn->fr_pool;
struct iser_fr_desc *desc;
unsigned long flags;
spin_lock_irqsave(&fr_pool->lock, flags);
desc = list_first_entry(&fr_pool->list,
struct iser_fr_desc, list);
list_del(&desc->list);
spin_unlock_irqrestore(&fr_po... | false | false | false | false | false | 0 |
__lock_inherit_locks(lt, sh_locker, flags)
DB_LOCKTAB *lt;
DB_LOCKER *sh_locker;
u_int32_t flags;
{
DB_LOCKER *sh_parent;
DB_LOCKOBJ *obj;
DB_LOCKREGION *region;
ENV *env;
int ret;
struct __db_lock *hlp, *lp;
roff_t poff;
env = lt->env;
region = lt->reginfo.primary;
/*
* Get the committing locker and m... | false | false | false | false | false | 0 |
_osd_xdr_decode_opaque_cred(struct pnfs_osd_opaque_cred *opaque_cred,
struct xdr_stream *xdr)
{
__be32 *p = xdr_inline_decode(xdr, 1);
if (!p)
return -EINVAL;
opaque_cred->cred_len = be32_to_cpu(*p++);
p = xdr_inline_decode(xdr, opaque_cred->cred_len);
if (!p)
return -EINVAL;
opaque_cred->cred = p;... | false | false | false | false | false | 0 |
h5_rmprefix(const char *filename)
{
const char *ret_ptr;
if ((ret_ptr = HDstrstr(filename, ":")) == NULL)
ret_ptr = filename;
else
ret_ptr++;
return(ret_ptr);
} | false | false | false | false | false | 0 |
sc_readyRead()
{
#ifdef S5B_DEBUG
printf("sc_readyRead\n");
#endif
// only targets check for activation, and only should do it if there is no pending outgoing iq-set
if(state == Target && !task && !proxy_task)
checkForActivation();
} | false | false | false | false | false | 0 |
updateStats(const Rational& c, const Expr& v)
{
TRACE("arith ineq", "updateStats("+c.toString()+", ", v, ")");
if(c > 0) {
if(d_countRight.count(v) > 0) d_countRight[v] = d_countRight[v] + 1;
else d_countRight[v] = 1;
}
else
if(d_countLeft.count(v) > 0) d_countLeft[v] = d_countLeft[v] + 1;
else ... | false | false | false | false | false | 0 |
expr_list_copy_constructor(expr_list_ty *to, const expr_list_ty *from)
{
size_t j;
trace(("expr_list_copy_constructor(to = %p, from = %p)\n{\n",
to, from));
expr_list_constructor(to);
for (j = 0; j < from->el_nexprs; j++)
expr_list_append(to, from->el_expr[j]);
trace(("... | false | false | false | false | false | 0 |
chomp(char *str)
{
char *s;
if (!str)
return set_errno(EINVAL);
if (str[0] == '\0')
return 0;
while (str[1])
++str;
for (s = str; *s == '\n' || *s == '\r'; --s)
*s = '\0';
return str - s;
} | false | false | false | false | true | 1 |
d_flags_for_inode(struct inode *inode)
{
unsigned add_flags = DCACHE_REGULAR_TYPE;
if (!inode)
return DCACHE_MISS_TYPE;
if (S_ISDIR(inode->i_mode)) {
add_flags = DCACHE_DIRECTORY_TYPE;
if (unlikely(!(inode->i_opflags & IOP_LOOKUP))) {
if (unlikely(!inode->i_op->lookup))
add_flags = DCACHE_AUTODIR_TYPE... | false | false | false | false | false | 0 |
arg_get_data (NODE *n, int ref, GretlType *type)
{
void *data = NULL;
if (n->t == VEC) {
if (ref) {
*type = GRETL_TYPE_SERIES_REF;
data = &n->vnum;
} else if (n->vname != NULL) {
*type = GRETL_TYPE_USERIES;
data = &n->vnum;
} else {
*type = GRETL_TYPE_SERIES;
data = n->v.xvec;
... | false | false | false | false | false | 0 |
streams_free(struct stream *streams)
{
while (streams) {
struct stream *s = streams;
streams = (struct stream *) s->base.next;
switch (s->base.type) {
case LMS_STREAM_TYPE_VIDEO:
free(s->base.video.aspect_ratio.str);
break;
default:
break;... | false | false | false | false | false | 0 |
snprint_hw_path_checker (char * buff, int len, void * data)
{
struct hwentry * hwe = (struct hwentry *)data;
if (!hwe->checker_name)
return 0;
if (conf->checker_name &&
!strcmp(hwe->checker_name, conf->checker_name))
return 0;
return snprintf(buff, len, "%s", hwe->checker_name);
} | false | false | false | false | false | 0 |
mouse_report(XButtonEvent * ev)
{
int button_number, key_state;
switch (ev->button) {
case AnyButton: /* Button release */
button_number = 3;
break;
case Button1: /* Button press */
case Button2:
case Button3:
pb = button_numbe... | false | false | false | false | false | 0 |
inf_user_table_foreach_local_user(InfUserTable* user_table,
InfUserTableForeachUserFunc func,
gpointer user_data)
{
InfUserTablePrivate* priv;
GSList* item;
g_return_if_fail(INF_IS_USER_TABLE(user_table));
g_return_if_fail(func != NULL);
pr... | false | false | false | false | false | 0 |
find_last_page(bgav_demuxer_context_t * ctx, int64_t pos1,
int64_t pos2,
int * serialno, int64_t * granulepos)
{
int64_t page_pos, last_page_pos = -1, start_pos;
int this_serialno, last_serialno = 0;
int64_t this_granulepos, last_granulepos = 0;
star... | false | false | false | false | false | 0 |
acdFindAssoc(const AcdPAcd thys, const AjPStr name,
const AjPStr noname)
{
AcdPAcd pa;
ajint ifound=0;
AcdPAcd ret=NULL;
AjPStr ambigList = NULL;
ambigList = ajStrNew();
for(pa=thys->AssocQuals; pa && pa->Assoc; pa=pa->Next)
if(ajStrPrefixS(pa->Name, name) ||
ajStrPrefixS(pa->Name,... | false | false | false | false | false | 0 |
push_create_temp_reply (GVfsBackendSftp *backend,
int reply_type,
GDataInputStream *reply,
guint32 len,
GVfsJob *job,
gpointer user_data)
{
SftpPushHandle *handle = user_data;
if (reply_type == S... | false | false | false | false | false | 0 |
update_live_status (dest, x, data)
rtx dest;
rtx x;
void *data ATTRIBUTE_UNUSED;
{
int first_regno, last_regno;
int i;
if (GET_CODE (dest) != REG
&& (GET_CODE (dest) != SUBREG || GET_CODE (SUBREG_REG (dest)) != REG))
return;
if (GET_CODE (dest) == SUBREG)
first_regno = subreg_regn... | false | false | false | false | false | 0 |
setAutoExclusive(bool state)
{
if (_first)
_first->setAutoExclusive(state);
if (_last)
_last->setAutoExclusive(state);
for(int i=0; i < _buttons.count(); ++i)
_buttons.at(i)->setAutoExclusive(state);
} | false | false | false | false | false | 0 |
e_table_extras_add_cell (ETableExtras *extras,
const gchar *id,
ECell *cell)
{
g_return_if_fail (E_IS_TABLE_EXTRAS (extras));
g_return_if_fail (id != NULL);
if (cell != NULL)
g_object_ref_sink (cell);
g_hash_table_insert (extras->priv->cells, g_strdup (id), cell... | false | false | false | false | false | 0 |
selectReadableAssociation(DcmTransportConnection *connections[], int connCount, int timeout)
{
OFBool canUseFastMode = OFTrue;
for (int i=0; i<connCount; i++)
{
if ((connections[i]) && (! connections[i]->isTransparentConnection())) canUseFastMode = OFFalse;
}
if (canUseFastMode) return fastSelectReadableA... | false | false | false | false | false | 0 |
ext2fs_group_desc_csum_verify(ext2_filsys fs, dgrp_t group)
{
if (EXT2_HAS_RO_COMPAT_FEATURE(fs->super,
EXT4_FEATURE_RO_COMPAT_GDT_CSUM) &&
(ext2fs_bg_checksum(fs, group) !=
ext2fs_group_desc_csum(fs, group)))
return 0;
return 1;
} | false | false | false | false | false | 0 |
StrictParseCppFile(const std::string& absFilename,
const std::vector<std::string>& headerExtensions,
std::map<std::string, std::string>& includedMocs)
{
cmsys::RegularExpression mocIncludeRegExp(
"[\n][ \t]*#[ \t]*include[ \t]+"
"... | false | false | false | false | false | 0 |
Balloc(int k)
{
int x;
Bigint *rv;
if (k > Kmax) {
zend_error(E_ERROR, "Balloc() allocation exceeds list boundary");
}
_THREAD_PRIVATE_MUTEX_LOCK(dtoa_mutex);
if ((rv = freelist[k])) {
freelist[k] = rv->next;
} else {
x = 1 << k;
rv = (Bigint *)MALLOC(sizeof(Bigint) + (x-1)*sizeof(Long));
if (!rv) {
... | false | false | false | true | true | 1 |
InitMedia() {
std::string client_unique = xmpp_client_->jid().Str();
talk_base::InitRandom(client_unique.c_str(), client_unique.size());
worker_thread_ = new talk_base::Thread();
// The worker thread must be started here since initialization of
// the ChannelManager will generate messages that need to be
/... | false | false | false | false | false | 0 |
LevelPresetChangedSlot()
{
int ix, i;
ix = mLevelPresetsCmb->itemData(mLevelPresetsCmb->currentIndex()).toInt();
if (ix < 0 || ix > 4)
{
return;
}
bool sup = SetSuppressSlots(true);
i = mColorCntCmb->findData(ColorCode::LEVEL_SETTINGS[ix][0]);
if (i != -1 && mColorCntCmb->curr... | false | false | false | false | false | 0 |
fs_strndup(const char *str, size_t n) {
char *new_str;
if (str) {
new_str = fs_new (char, n + 1);
strncpy(new_str, str, n);
new_str[n] = '\0';
}
else
new_str = NULL;
return new_str;
} | false | true | false | false | false | 1 |
isDerivation(Value & v)
{
if (v.type != tAttrs) return false;
Bindings::iterator i = v.attrs->find(sType);
return i != v.attrs->end() && forceStringNoCtx(i->second.value) == "derivation";
} | false | false | false | false | false | 0 |
hi_ncurses_help_redraw(hi_ncurses *ncurses)
{
int x;
werase(ncurses->help_win);
if (ncurses->show_help)
{
if (COLS < 80)
{
ncurses->activate_bell = TRUE;
mvwprintw(ncurses->help_win,0,0, "Please make the window bigger than 80 columns");
}
else
{
box(ncurses->help_win, ... | false | false | false | false | false | 0 |
subst_stack_regs (rtx insn, stack_ptr regstack)
{
rtx *note_link, note;
bool control_flow_insn_deleted = false;
int i;
if (CALL_P (insn))
{
int top = regstack->top;
/* If there are any floating point parameters to be passed in
registers for this call, make sure they are in the right
order.... | false | false | false | false | false | 0 |
tsubst_baselink (tree baselink, tree object_type,
tree args, tsubst_flags_t complain, tree in_decl)
{
tree name;
tree qualifying_scope;
tree fns;
tree template_args = 0;
bool template_id_p = false;
/* A baselink indicates a function from a base class. The
BASELINK_ACCESS_BINFO and BA... | false | false | false | false | true | 1 |
g_vfs_afp_connection_send_command (GVfsAfpConnection *afp_connection,
GVfsAfpCommand *command,
char *reply_buf,
GAsyncReadyCallback callback,
GCancellable ... | false | false | false | false | false | 0 |
fl_frame2(const char* s, int x, int y, int w, int h) {
uchar *g = fl_gray_ramp();
if (h > 0 && w > 0) for (;*s;) {
// draw bottom line:
fl_color(g[(int)*s++]);
fl_xyline(x, y+h-1, x+w-1);
if (--h <= 0) break;
// draw right line:
fl_color(g[(int)*s++]);
fl_yxline(x+w-1, y+h-1, y);
if ... | false | false | false | false | false | 0 |
file_util_details_get_message(UtilityData *ud, FileData *fd, const gchar **stock_id)
{
GString *message = g_string_new("");
gint error;
g_string_append_printf(message, _("File: '%s'\n"), fd->path);
if (ud->with_sidecars && fd->sidecar_files)
{
GList *work = fd->sidecar_files;
g_string_append(message, _("wit... | false | false | false | false | false | 0 |
got_addresses (SoupAddress *addr, guint status, gpointer user_data)
{
GTask *task = user_data;
GError *error;
error = g_object_get_data (G_OBJECT (addr), "async-resolved-error");
if (error)
g_task_return_error (task, g_error_copy (error));
else {
GSocketAddress *addr;
addr = next_address (g_task_get_source... | false | false | false | false | false | 0 |
add_repl(ParmString mis, ParmString cor, ParmString sl)
{
Str m;
SensitiveCompare cmp(lang()); // FIXME: I don't think this is completely correct
WordEntry we;
pair<WordLookup::iterator, WordLookup::iterator> p0(word_lookup->equal_range(mis));
WordLookup::iterator p = p0.first;
for (; p != p0.second && !... | false | false | false | false | false | 0 |
test_grandom (long nbtests, mpfr_prec_t prec, mpfr_rnd_t rnd,
int verbose)
{
mpfr_t *t;
mpfr_t av, va, tmp;
int i, inexact;
nbtests = (nbtests & 1) ? (nbtests + 1) : nbtests;
t = (mpfr_t *) malloc (nbtests * sizeof (mpfr_t));
if (t == NULL)
{
fprintf (stderr, "tgrandom: can't alloca... | false | false | false | false | false | 0 |
almanah_tag_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)
{
AlmanahTagPrivate *priv = ALMANAH_TAG (object)->priv;
switch (property_id) {
case PROP_TAG:
if (priv->tag)
g_free (priv->tag);
priv->tag = g_strdup (g_value_get_string (value));
if (PANGO_IS_LAYOUT ... | false | false | false | false | false | 0 |
uart_poll_get_char(struct tty_driver *driver, int line)
{
struct uart_driver *drv = driver->driver_state;
struct uart_state *state = drv->state + line;
struct uart_port *port;
if (!state || !state->uart_port)
return -1;
port = state->uart_port;
return port->ops->poll_get_char(port);
} | false | false | false | false | false | 0 |
mb_wst_next_lc(TokenStream *ts)
{
int i;
char *start;
char *t = ts->t;
wchar_t wchr;
wchar_t wbuf[MAX_WORD_SIZE + 1], *w, *w_end;
mbstate_t *state = &(MBTS(ts)->state);
w = wbuf;
w_end = &wbuf[MAX_WORD_SIZE];
i = mb_next_char(&wchr, t, state);
while (wchr != 0 && iswspace(wchr)... | false | false | false | false | false | 0 |
wdt_open(struct inode *inode, struct file *file)
{
/* If the watchdog is alive we don't need to start it again */
if (test_and_set_bit(0, &timer_alive))
return -EBUSY;
if (nowayout)
__module_get(THIS_MODULE);
wdt_start();
return nonseekable_open(inode, file);
} | false | false | false | false | false | 0 |
luaL_loadfile (lua_State *L, const char *filename) {
LoadF lf;
int status, readstatus;
int c;
int fnameindex = lua_gettop(L) + 1; /* index of filename on the stack */
lf.extraline = 0;
if (filename == NULL) {
lua_pushliteral(L, "=stdin");
lf.f = stdin;
}
else {
lua_pushfstring(L, "@%s", fil... | false | true | false | false | true | 1 |
readline_other(Unpicklerobject *self, char **s)
{
PyObject *str;
Py_ssize_t str_size;
if (!( str = PyObject_CallObject(self->readline, empty_tuple))) {
return -1;
}
if ((str_size = PyString_Size(str)) < 0)
return -1;
Py_XDECREF(self->last_string);
self->last_string = str;... | false | true | false | false | false | 1 |
Do()
{
int m=STALL;
if(!peer) {
// need to resolve addresses
if(!resolver) {
resolver=new Resolver(hostname,portname);
resolver->Roll();
m=MOVED;
}
if(!resolver->Done())
return m;
if(resolver->Error())
{
SetError(resolver->ErrorMsg());
return(MOVED);
}
p... | 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.