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 |
|---|---|---|---|---|---|---|
treat_directory(struct dir_struct *dir,
const char *dirname, int len,
const struct path_simplify *simplify)
{
/* The "len-1" is to strip the final '/' */
switch (directory_exists_in_index(dirname, len-1)) {
case index_directory:
return recurse_into_directory;
case index_gitdir:
if (dir->flags & DIR_SHOW_OTHE... | false | false | false | false | false | 0 |
ips_putq_copp_tail(ips_copp_queue_t * queue, ips_copp_wait_item_t * item)
{
METHOD_TRACE("ips_putq_copp_tail", 1);
if (!item)
return;
item->next = NULL;
if (queue->tail)
queue->tail->next = item;
queue->tail = item;
if (!queue->head)
queue->head = item;
queue->count++;
} | false | false | false | false | false | 0 |
select_card(struct rtsx_chip *chip, int card)
{
int retval;
if (chip->cur_card != card) {
u8 mod;
if (card == SD_CARD)
mod = SD_MOD_SEL;
else if (card == MS_CARD)
mod = MS_MOD_SEL;
else if (card == XD_CARD)
mod = XD_MOD_SEL;
else if (card == SPI_CARD)
mod = SPI_MOD_SEL;
else {
rtsx_trace(... | false | false | false | false | false | 0 |
shell_grab (const char *arg, char **sout)
{
int err = 0;
if (arg == NULL || *arg == '\0') {
return E_PARSE;
}
if (!libset_get_bool(SHELL_OK)) {
gretl_errmsg_set(_("The shell command is not activated."));
return 1;
}
gretl_shell_grab(arg, sout);
if (sout != NULL && *sout != NULL) {... | true | true | false | false | true | 1 |
state_change_to_finished(void)
{
if (finished_rep != true) {
ECA_LOG_MSG_NOPREFIX(ECA_LOGGER::info, "");
ECA_LOG_MSG(ECA_LOGGER::subsystems, "Engine - Processing finished");
}
finished_rep = true;
} | false | false | false | false | false | 0 |
e1000e_init_hw_80003es2lan(struct e1000_hw *hw)
{
struct e1000_mac_info *mac = &hw->mac;
u32 reg_data;
s32 ret_val;
u16 i;
e1000e_initialize_hw_bits_80003es2lan(hw);
/* Initialize identification LED */
ret_val = mac->ops.id_led_init(hw);
if (ret_val) {
e_dbg("Error initializing identification LED\n");
/* ... | false | false | false | false | false | 0 |
tg3_frag_free(bool is_frag, void *data)
{
if (is_frag)
skb_free_frag(data);
else
kfree(data);
} | false | false | false | false | false | 0 |
ParsePrefix(State *state) {
bool has_something = false;
while (true) {
MaybeAppendSeparator(state);
if (ParseTemplateParam(state) ||
ParseSubstitution(state) ||
ParseUnscopedName(state)) {
has_something = true;
MaybeIncreaseNestLevel(state);
continue;
}
MaybeCancelL... | false | false | false | false | false | 0 |
rb_gets(void)
{
VALUE line;
if (rb_rs != rb_default_rs) {
return rb_f_gets(0, 0, argf);
}
retry:
if (!next_argv()) return Qnil;
line = rb_io_gets(ARGF.current_file);
if (NIL_P(line) && ARGF.next_p != -1) {
rb_io_close(ARGF.current_file);
ARGF.next_p = 1;
goto retry;
}
rb_lastline... | false | false | false | false | false | 0 |
file_is_der_or_pem (const char *filename,
gboolean privkey,
gboolean *out_privkey_encrypted)
{
int fd;
unsigned char buffer[8192];
ssize_t bytes_read;
gboolean success = FALSE;
fd = open (filename, O_RDONLY);
if (fd < 0)
return FALSE;
bytes_read = read (fd, buffer, siz... | true | true | false | false | true | 1 |
gatt_example_adapter_free(struct gatt_example_adapter *gadapter)
{
while (gadapter->sdp_handles != NULL) {
uint32_t handle = GPOINTER_TO_UINT(gadapter->sdp_handles->data);
attrib_free_sdp(handle);
gadapter->sdp_handles = g_slist_remove(gadapter->sdp_handles,
gadapter->sdp_handles->data);
}
if (gadapter... | false | false | false | false | false | 0 |
valueForBorderRadii(BorderRadii radii)
{
CSSPrimitiveValueImpl* h = new CSSPrimitiveValueImpl(radii.horizontal, CSSPrimitiveValue::CSS_PX);
CSSPrimitiveValueImpl* v = new CSSPrimitiveValueImpl(radii.vertical, CSSPrimitiveValue::CSS_PX);
return new CSSPrimitiveValueImpl(new PairImpl(h, v));
} | false | false | false | false | false | 0 |
mousePressEvent(QMouseEvent *event) {
if (event->pos().x() < m_leftScaleWidth) {
QWidget::mousePressEvent(event);
return;
}
d_body->m_pressDateTime = d_body->quantized(d_body->getDateTime(event->pos()));
d_body->m_previousDateTime = d_body->m_pressDateTime;
d_body->m_pressPos = even... | false | false | false | false | false | 0 |
DoesSingleFlagMatch(
const CommandLineFlagInfo &flag,
const CompletionOptions &options,
const string &match_token) {
// Is there a prefix match?
string::size_type pos = flag.name.find(match_token);
if (pos == 0) return true;
// Is there a substring match if we want it?
if (options.flag_name_subst... | false | false | false | false | false | 0 |
tg3_nvram_exec_cmd(struct tg3 *tp, u32 nvram_cmd)
{ DBGP("%s\n", __func__);
int i;
tw32(NVRAM_CMD, nvram_cmd);
for (i = 0; i < NVRAM_CMD_TIMEOUT; i++) {
udelay(10);
if (tr32(NVRAM_CMD) & NVRAM_CMD_DONE) {
udelay(10);
break;
}
}
if (i == NVRAM_CMD_TIMEOUT)
return -EBUSY;
return 0;
} | false | false | false | false | false | 0 |
list_free(list_t *list, const list_link_free_t freefunc)
{
link_t *link, *next;
if (list == NULL)
return;
for (link = list->head; link; link = next) {
next = link->next;
if (link->data && freefunc)
freefunc(link->data);
free(link);
}
} | false | false | false | false | false | 0 |
pkix_pl_ByteArray_Equals(
PKIX_PL_Object *first,
PKIX_PL_Object *second,
PKIX_Boolean *pResult,
void *plContext)
{
PKIX_UInt32 secondType;
PKIX_Int32 cmpResult = 0;
PKIX_ENTER(BYTEARRAY, "pkix_pl_ByteArray_Equals");
PKIX_NULLCHECK_THREE(first, second, pRe... | false | false | false | false | false | 0 |
Set_Unallocated( const Glib::ustring & device_path,
Sector sector_start,
Sector sector_end,
Byte_Value sector_size,
bool inside_extended )
{
Reset() ;
Set( device_path,
Utils::get_filesystem_string( GParted::FS_UNALLOCATED ),
-1,
GParted::TYPE_UNALLOCATED,
GParted::FS_UNA... | false | false | false | false | false | 0 |
ns_listenelt_destroy(ns_listenelt_t *elt) {
if (elt->acl != NULL)
dns_acl_detach(&elt->acl);
isc_mem_put(elt->mctx, elt, sizeof(*elt));
} | false | false | false | false | false | 0 |
RExit(OMPragma* p, bool end_outer = false) {
OMPRegion* r = RTop(p);
#if defined(__GNUC__) && (__GNUC__ < 3)
if ( p->name[0] != '$' && p->name.substr(3) != r->name ) {
#else
if ( p->name[0] != '$' && p->name.compare(3, string::npos, r->name) != 0 ) {
#endif
cerr << infile << ":" << r->begin_first_lin... | false | false | false | false | false | 0 |
sortExpr (expr, func, direction)
chain_list *expr;
long (*func) ();
long direction;
{
chain_list *expr1;
long okPermu = 1;
if (!ATOM (expr)) /* ce n'est pas un atome */
{
while (okPermu)
{
expr1 = CDR (expr);
okPermu = 0;
while (CDR (expr1))
{
if ((direction == 1 &... | false | false | false | false | false | 0 |
cpl_fit_imagelist_polynomial_bpm(cpl_imagelist * self,
const cpl_mask * redo,
const cpl_vector * x_pos,
const cpl_imagelist * values,
... | false | false | false | false | false | 0 |
pio2_gpio_reset(struct pio2_card *card)
{
int retval = 0;
int i, j;
u8 data = 0;
/* Zero output registers */
for (i = 0; i < 4; i++) {
retval = vme_master_write(card->window, &data, 1,
PIO2_REGS_DATA[i]);
if (retval < 0)
return retval;
card->bank[i].value = 0;
}
/* Set input interrupt masks */
fo... | false | false | false | false | false | 0 |
v_range(void)
#else
v_range()
#endif
{
#line 1627 "./verilog.g"
zzRULE;
zzBLOCK(zztasp1);
zzMake0;
{
#line 1627 "./verilog.g"
zzmatch(V_LBRACK); zzCONSUME;
#line 1627 "./verilog.g"
v_expression();
#line 1628 "./verilog.g"
zzmatch(V_COLON); zzCONSUME;
#line 1628 "./verilog.g"
v_expression();
#line 1628 "... | false | false | false | false | false | 0 |
my_xpath_parse_EqualityExpr(MY_XPATH *xpath)
{
MY_XPATH_LEX operator_context;
if (!my_xpath_parse_RelationalExpr(xpath))
return 0;
operator_context= xpath->lasttok;
while (my_xpath_parse_EqualityOperator(xpath))
{
Item *prev= xpath->item;
int oper= xpath->extra;
if (!my_xpath_parse_Relational... | false | false | false | false | false | 0 |
add_or_del_win(char *str, int add) {
Window win = parse_win(str);
if (win != None) {
int f = find_win(win);
if (add) {
if (f < 0 && win_attr(win)) {
add_win(win);
}
} else {
if (f >= 0) {
destroy_win(win);
}
}
} else if (!strcmp(str, "all")) {
if (!add) {
int i;
for (i=0; i < WMA... | false | false | false | false | false | 0 |
parsevector(char *str, float data[], int maxdata)
{
int i;
char *p, *op;
memset(data, 0, maxdata*sizeof(float));
if(str == NULL)
return -1;
for(i = 0, p = str; i < maxdata && *p; i++) {
op = p;
data[i] = strtod(p, &p);
if(p == op)
break;
while(*p == ',' || *p == ' ') p++;
}
return... | false | false | false | false | false | 0 |
mlx4_en_dcbnl_ieee_getqcn(struct net_device *dev,
struct ieee_qcn *qcn)
{
struct mlx4_en_priv *priv = netdev_priv(dev);
struct mlx4_congestion_control_mb_prio_802_1_qau_params *hw_qcn;
struct mlx4_cmd_mailbox *mailbox_out = NULL;
u64 mailbox_in_dma = 0;
u32 inmod = 0;
int i, err;
if (!(priv->mdev->dev-... | false | false | false | false | false | 0 |
_flt_base64_encode (const char *iptr, size_t isize,
char *optr, size_t osize,
size_t *pnbytes)
{
size_t consumed = 0;
int pad = 0;
const unsigned char* ptr = (const unsigned char*) iptr;
size_t nbytes = 0;
if (isize <= 3)
pad = 1;
while ((consumed + 3 <= isize && nbytes + 4 <= os... | false | false | false | false | false | 0 |
P_LoadBlockMap(int lump)
{
int i, count;
int lumplen;
lumplen = W_LumpLength(lump);
blockmaplump = Z_Malloc(lumplen, PU_LEVEL, NULL);
W_ReadLump(lump, blockmaplump);
blockmap = blockmaplump + 4;
// Swap all short integers to native byte ordering:
count = lumplen / 2;
for (i = 0; ... | false | false | false | false | false | 0 |
SVGIMAGE_begin(CSVGIMAGE *_object)
{
if (!SURFACE)
{
if (THIS->width <= 0 || THIS->height <= 0)
{
GB.Error("SvgImage size is not defined");
return NULL;
}
THIS->file = GB.NewZeroString(GB.TempFile(NULL));
SURFACE = cairo_svg_surface_create(THIS->file, THIS->width, THIS->height);
if (HANDLE)
... | false | false | false | false | false | 0 |
def_char_to_objclass(ch)
char ch;
{
int i;
for (i = 1; i < MAXOCLASSES; i++)
if (ch == def_oc_syms[i]) break;
return i;
} | false | false | false | false | false | 0 |
draw()
{
on_draw();
if(visible_) on_draw_visible();
return visible_;
} | false | false | false | false | false | 0 |
compare_for_auto_lex_order(void *d1,
void *d2)
{
struct sym_ent *p1, *p2;
int i;
p1 = (struct sym_ent *) d1;
p2 = (struct sym_ent *) d2;
if (p1->arity == p2->arity) {
i = strcmp(p1->name, p2->name);
if (i < 0)
return(LESS_THAN);
else if (i > 0)
return(GREATER_THAN);
els... | false | false | false | false | false | 0 |
AddCompilerPredefinedMacros(cbProject* project, ParserBase* parser)
{
if (!parser)
return false;
if (!parser->Options().wantPreprocessor)
return true;
TRACE(_T("NativeParser::AddCompilerPredefinedMacros(): Enter"));
// Default compiler is used for for single file parser (non project)
... | false | false | false | false | false | 0 |
cddb_site_set_location(cddb_site_t *site,
float latitude, float longitude)
{
ASSERT_NOT_NULL(site);
ASSERT_RANGE(latitude, -90.0, 90.0);
ASSERT_RANGE(longitude, -180.0, 180.0);
site->latitude = latitude;
site->longitude = longitude;
return CDDB_ERR_OK;
} | false | false | false | false | false | 0 |
canAddAction(Command *action) const
{
return action && action->action();
} | false | false | false | false | false | 0 |
verify_address(char *s)
{
char errbuf[500];
addrptr = s;
addrerr[0] = '\0'; /* paranoia */
if (addrparse()) {
snprintf(errbuf, sizeof(errbuf), "address '%s': %s", s, addrerr);
yyerror(errbuf);
return 0;
}
return 1;
} | true | true | false | false | false | 1 |
ParseInstanceBinary (const char* pCur,DOM* p_pcOut,bool p_bBE)
{
ai_assert(NULL != pCur && NULL != p_pcOut);
DefaultLogger::get()->debug("PLY::DOM::ParseInstanceBinary() begin");
if(!p_pcOut->ParseHeader(pCur,&pCur,true))
{
DefaultLogger::get()->debug("PLY::DOM::ParseInstanceBinary() failure");
return false;
... | false | false | false | false | false | 0 |
ci_requests_show(struct seq_file *s, void *data)
{
struct ci_hdrc *ci = s->private;
unsigned long flags;
struct list_head *ptr = NULL;
struct ci_hw_req *req = NULL;
struct td_node *node, *tmpnode;
unsigned i, j, qsize = sizeof(struct ci_hw_td)/sizeof(u32);
if (ci->role != CI_ROLE_GADGET) {
seq_printf(s, "no... | false | false | false | false | false | 0 |
iobfeof(IOBFILE *iobf)
{
if (iobf->ungetc != EOF) {
return 0;
} else if (iobf->ioblist.tot_pos < iobf->ioblist.tot_size) {
return 0;
} else if (iobf->eof == -1) {
if (feof(iobf->istream)) {
return 1;
}
iobf->eof = 0;
return 0;
} else {
return 0;
}
} | false | false | false | false | false | 0 |
_add_dir(const char *dir, struct dm_list *dir_list)
{
struct dir_list *dl;
if (dm_create_dir(dir)) {
if (!(dl = dm_malloc(sizeof(struct dm_list) + strlen(dir) + 1))) {
log_error("_add_dir allocation failed");
return 0;
}
log_very_verbose("Adding text format metadata dir: %s", dir);
strcpy(dl->dir, dir)... | false | true | false | false | false | 1 |
show_graph(Graph g, int nsp)
{
Curve c;
String s;
spaces(nsp); printf("x_translate %f y_translate %f\n",
ptoin(g->x_translate), ptoin(g->y_translate));
spaces(nsp); printf("xaxis\n"); show_axis(g->x_axis, nsp+2, g);
spaces(nsp); printf("yaxis\n"); show_axis(g->y_axis, nsp+2, g);
... | false | false | false | false | false | 0 |
dceiswholesegment(DCEsegment* seg)
{
int i,whole;
if(!seg->slicesdefined) return 0; /* actually, we don't know */
whole = 1; /* assume so */
for(i=0;i<seg->rank;i++) {
if(!dceiswholeslice(&seg->slices[i])) {whole = 0; break;}
}
return whole;
} | false | false | false | false | false | 0 |
boot_cpu_is_amd(void)
{
WARN_ON_ONCE(!tdp_enabled);
return shadow_x_mask == 0;
} | false | false | false | false | false | 0 |
drv_MI_init(const char *section, const int quiet)
{
WIDGET_CLASS wc;
int ret;
info("%s: %s", Name, "$Rev: 840 $");
/* display preferences */
XRES = 5; /* pixel width of one char */
YRES = 8; /* pixel height of one char */
CHARS = 8; /* number of user-defineable characters */
CH... | false | false | false | false | false | 0 |
unlink( pfs_name *name ) {
int result;
if(!pfs_acl_check(name,IBOX_ACL_WRITE)) return -1;
debug(D_LOCAL,"unlink %s",name->rest);
result = ::unlink(name->rest);
END
} | false | false | false | false | false | 0 |
vtkShaderGetType(const char* type)
{
if (!type)
{
return 0;
}
if (strcmp(type,"double")==0 ||
strcmp(type,"double1")==0 ||
strcmp(type,"double2")==0 ||
strcmp(type,"double3")==0 ||
strcmp(type,"double4")==0 )
{
return VTK_DOUBLE;
}
// XML attributes should reflect ... | false | false | false | false | false | 0 |
tweak_weights(gammapweights out[14], int dst_cmymap, int rel_oride) {
int i;
for (i = 0; i < 14; i++) {
if (((dst_cmymap & 0x1) && (out[i].ch & gmc_cyan))
|| ((dst_cmymap & 0x2) && (out[i].ch & gmc_magenta))
|| ((dst_cmymap & 0x4) && (out[i].ch & gmc_yellow))) {
//printf("~1 Setting %d 0x%x to 100% cusp map... | false | false | false | false | false | 0 |
readyReadStandardOutput()
{
if( canReadLine() )
emit readReady( this );
} | false | false | false | false | false | 0 |
cfag12864b_setbit(unsigned char state, unsigned char n)
{
if (state)
cfag12864b_state |= bit(n);
else
cfag12864b_state &= ~bit(n);
} | false | false | false | false | false | 0 |
field_get_num(struct field *f, u_int8_t *buf)
{
u_int32_t val;
if (extract_val(buf + f->offset, f->len, &val))
return 0;
return val;
} | false | false | false | false | false | 0 |
_e_mod_notify_merge(E_Notification *n)
{
Ind_Notify_Win *nwin;
const Eina_List *l;
const char *appname, *bold, *bnew;
if (!n) return NULL;
if (!(appname = e_notification_app_name_get(n))) return NULL;
EINA_LIST_FOREACH(_nwins, l, nwin)
{
const char *name;
if (!nwin->notify) co... | false | false | false | false | false | 0 |
build_xlate_map (asection *sec, xtensa_relax_info *relax_info)
{
xlate_map_t *map = (xlate_map_t *) bfd_malloc (sizeof (xlate_map_t));
text_action_list *action_list = &relax_info->action_list;
unsigned num_actions = 0;
text_action *r;
int removed;
xlate_map_entry_t *current_entry;
if (map == NULL)
re... | false | false | false | false | false | 0 |
regrepeat( char *p )
{
register int count = 0;
register const char *scan;
register char *opnd;
scan = reginput;
opnd = OPERAND(p);
switch (OP(p)) {
case ANY:
count = strlen(scan);
scan += count;
break;
case EXACTLY:
while (*opnd == *scan) {
count++;
scan++;
}
break;
case ANYOF:
while (*sca... | false | false | false | false | false | 0 |
fuse_req_init_context(struct fuse_conn *fc, struct fuse_req *req)
{
req->in.h.uid = from_kuid(fc->user_ns, current_fsuid());
req->in.h.gid = from_kgid(fc->user_ns, current_fsgid());
req->in.h.pid = pid_nr_ns(task_pid(current), fc->pid_ns);
} | false | false | false | false | false | 0 |
focus(Client *c) {
if(!c || !ISVISIBLE(c))
for(c = selmon->stack; c && !ISVISIBLE(c); c = c->snext);
/* was if(selmon->sel) */
if(selmon->sel && selmon->sel != c)
unfocus(selmon->sel, False);
if(c) {
if(c->mon != selmon)
selmon = c->mon;
if(c->isurgent)
clearurgent(c);
detachstack(c);
attachstack(... | false | false | false | false | false | 0 |
HTS_Engine_set_msd_threshold(HTS_Engine * engine, size_t stream_index, double f)
{
if (f < 0.0)
f = 0.0;
if (f > 1.0)
f = 1.0;
engine->condition.msd_threshold[stream_index] = f;
} | false | false | false | false | false | 0 |
PKCS7_bio_add_digest(BIO **pbio, X509_ALGOR *alg)
{
BIO *btmp;
const EVP_MD *md;
if ((btmp=BIO_new(BIO_f_md())) == NULL)
{
PKCS7err(PKCS7_F_PKCS7_BIO_ADD_DIGEST,ERR_R_BIO_LIB);
goto err;
}
md=EVP_get_digestbyobj(alg->algorithm);
if (md == NULL)
{
PKCS7err(PKCS7_F_PKCS7_BIO_ADD_DIGEST,PKCS7_R_UNKNOWN_... | false | false | false | false | false | 0 |
CDB___db_map_rmid(rmid, env)
int rmid;
DB_ENV *env;
{
env->xa_rmid = rmid;
TAILQ_INSERT_TAIL(&DB_GLOBAL(db_envq), env, links);
return (0);
} | false | false | false | false | false | 0 |
tp_connection_rename_group_async (TpConnection *self,
const gchar *old_name,
const gchar *new_name,
GAsyncReadyCallback callback,
gpointer user_data)
{
GSimpleAsyncResult *result;
g_return_if_fail (TP_IS_CONNECTION (self));
g_return_if_fail (old_name != NULL);
g_return_if_fail (new_name... | false | false | false | false | false | 0 |
do_hexdump (FILE *out_file, char *buf, int blocksize)
{
int i,j;
int *intp;
char *charp;
unsigned char c;
intp = (int *) buf;
charp = (char *) buf;
for (i=0; i<blocksize; i+=16) {
fprintf(out_file, " %04x: ", i);
for (j=0; j<16; j+=4)
fprintf(out_file, "%08x ", *intp++);
for (j=0; j<16; j++) {
... | false | false | false | false | false | 0 |
fs_session_set_send_codec (FsSession *session, FsCodec *send_codec,
GError **error)
{
FsSessionClass *klass;
g_return_val_if_fail (session, FALSE);
g_return_val_if_fail (FS_IS_SESSION (session), FALSE);
klass = FS_SESSION_GET_CLASS (session);
if (klass->set_send_codec) {
retur... | false | false | false | true | false | 1 |
suna8_vh_start_common(int dim)
{
suna8_text_dim = dim;
tilemap = tilemap_create( get_tile_info, tilemap_scan_cols,
TILEMAP_TRANSPARENT,
8,8,0x20*((suna8_text_dim > 0)?4:8),0x20);
if ( tilemap == NULL ) return 1;
if (!(suna8_text_dim > 0))
{
paletteram = memory_region(REGION_USER1);
... | false | false | false | false | false | 0 |
xmlSecNSSPKIKeyDataCtxDup(xmlSecNssPKIKeyDataCtxPtr ctxDst,
xmlSecNssPKIKeyDataCtxPtr ctxSrc)
{
xmlSecNSSPKIKeyDataCtxFree(ctxDst);
ctxDst->privkey = NULL ;
ctxDst->pubkey = NULL ;
if (ctxSrc->privkey != NULL) {
ctxDst->privkey = SECKEY_CopyPrivateKey(ctxSrc->privkey);
if(ct... | false | false | false | false | false | 0 |
ClearPacketsAndDatagrams(void)
{
unsigned int i;
for (i=0; i < packetsToDeallocThisUpdate.Size(); i++)
{
// packetsToDeallocThisUpdate holds a boolean indicating if packetsToSendThisUpdate at this index should be freed
if (packetsToDeallocThisUpdate[i])
{
RemoveFromUnreliableLinkedList(packetsToSend... | false | false | false | false | false | 0 |
on_ignore_case(GtkToggleAction* act, FmFolderView* fv)
{
gboolean active = gtk_toggle_action_get_active(act);
FmFolderModel *model = fm_folder_view_get_model(fv);
FmSortMode mode;
if(model)
{
fm_folder_model_get_sort(model, NULL, &mode);
mode &= ~FM_SORT_CASE_SENSITIVE;
if (... | false | false | false | false | false | 0 |
i915_gem_context_unpin(struct intel_context *ctx,
struct intel_engine_cs *engine)
{
if (i915.enable_execlists) {
intel_lr_context_unpin(ctx, engine);
} else {
if (engine->id == RCS && ctx->legacy_hw_ctx.rcs_state)
i915_gem_object_ggtt_unpin(ctx->legacy_hw_ctx.rcs_state);
i915_gem_context_unreference(c... | false | false | false | false | false | 0 |
suggest_writeback_time(void)
{
FILE *file;
char buffer[1024];
int i;
file = fopen("/proc/sys/vm/dirty_writeback_centisecs", "r");
if (!file)
return;
memset(buffer, 0, 1024);
if (!fgets(buffer, 1023, file)) {
fclose(file);
return;
}
i = strtoull(buffer, NULL, 10);
if (i<1400) {
char line[1024];
sprin... | false | false | false | false | false | 0 |
iwl_mvm_te_check_disconnect(struct iwl_mvm *mvm,
struct ieee80211_vif *vif,
const char *errmsg)
{
if (vif->type != NL80211_IFTYPE_STATION)
return false;
if (vif->bss_conf.assoc && vif->bss_conf.dtim_period)
return false;
if (errmsg)
IWL_ERR(mvm, "%s\n", errmsg);
iwl_mvm_connection_loss(mvm, vif, er... | false | false | false | false | false | 0 |
interface_ipv4(const char *ifname, unsigned char *addr_r)
{
struct ifreq req;
int s, rc;
s = socket(AF_INET, SOCK_DGRAM, 0);
if(s < 0)
return -1;
memset(&req, 0, sizeof(req));
strncpy(req.ifr_name, ifname, sizeof(req.ifr_name));
req.ifr_addr.sa_family = AF_INET;
rc = ioctl(s, S... | false | true | false | false | false | 1 |
checkforintercaloperators(const node *np)
{
if(!np) return;
switch(np->opcode)
{ /* This only comes up in binary. */
case AND: case OR: case XOR: case MINGLE: case SELECT:
optuple->warn018 = true;
break;
default:
checkforintercaloperators(np->lval);
checkforintercaloperators(np->rval);
ret... | false | false | false | false | false | 0 |
rand(Vect &v)
{
if(diagrand)
{
double xrdran= xrandme(nbeval+nbevalp);
for(int ii=0;ii<ndim;++ii)
{
v(ii)=xmin(ii)+xrdran*(xmax(ii)-xmin(ii));
v(ii)=max(min(v(ii),xmax(ii)),xmin(ii));
}
}
else
for(int ii=0;ii<ndim;++ii)
{
double xrdran= xrandme(nbeval+nbevalp);... | false | false | false | false | false | 0 |
e_unicode_get_utf8 (const gchar *text,
gunichar *out)
{
*out = g_utf8_get_char (text);
return (*out == (gunichar) - 1) ? NULL : g_utf8_next_char (text);
} | false | false | false | false | false | 0 |
F_switch_on_integer(ArgVal arg[])
{
#ifdef SWT_INT_NO_OPT
SwtTbl *t;
SwtElt *elem;
DEF_INTEGER(n);
DEF_INTEGER(label);
Args1(INTEGER(nb_elem));
t = Create_Switch_Table(TBL_INT, nb_elem);
for (elem = t->elem; nb_elem--; elem++)
{
LOAD_INTEGER(n);
LOAD_INTEGER(label);
elem->n = n;
... | false | false | false | false | false | 0 |
e_mail_autoconfig_finish (GAsyncResult *result,
GError **error)
{
GObject *source_object;
GObject *autoconfig;
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), NULL);
source_object = g_async_result_get_source_object (result);
g_return_val_if_fail (source_object != NULL, NULL);
autoco... | false | false | false | false | false | 0 |
zCompatPhases(int positive_strand, zPhase_t from, zPhase_t to) {
/* return ((from+to) % 3 == 0); */
zPhase_t temp;
if (0 == positive_strand) {
temp = from;
from = to;
to = temp;
}
/* switch (from) { */
/* case Phase0: */
/* return (Phase0 == to); */
/* case Phase1: */
/* return (Phase1 == t... | false | false | false | false | false | 0 |
ucftp_open_conn(struct ucftpconn *conn)
{
int res;
if(conn->sock != -1) {
res = ucftp_command(conn, "NOOP");
if(res < 0)
return res;
if(res != 421)
return 0;
}
res = av_sock_connect(conn->host, 21);
if(res < 0)
return res;
conn-... | false | false | false | false | false | 0 |
store_synchronize_sync (CamelStore *store,
gboolean expunge,
GCancellable *cancellable,
GError **error)
{
GPtrArray *folders;
gboolean success = TRUE;
gint ii;
GError *local_error = NULL;
if (expunge) {
/* ensure all folders are used when e... | false | false | false | false | false | 0 |
VDI_RecycleFd(struct worker *wrk, struct vbc **vbp)
{
struct backend *bp;
struct vbc *vc;
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
AN(vbp);
vc = *vbp;
*vbp = NULL;
CHECK_OBJ_NOTNULL(vc, VBC_MAGIC);
CHECK_OBJ_NOTNULL(vc->backend, BACKEND_MAGIC);
assert(vc->fd >= 0);
bp = vc->backend;
WSL(wrk, SLT_BackendReuse... | false | false | false | true | false | 1 |
output_options(FILE *pfile)
{
int idx;
const option_map_value *ptr;
fprintf(pfile, "-== Options ==-\n");
for (idx = 0; idx < UO_option_count; idx++)
{
ptr = get_option_name(idx);
if (ptr != NULL)
{
if (ptr->type == AT_STRING)
{
fprintf(pfile, "%3d) %32s = ... | false | false | false | false | false | 0 |
radeon_ring_backup(struct radeon_device *rdev, struct radeon_ring *ring,
uint32_t **data)
{
unsigned size, ptr, i;
/* just in case lock the ring */
mutex_lock(&rdev->ring_lock);
*data = NULL;
if (ring->ring_obj == NULL) {
mutex_unlock(&rdev->ring_lock);
return 0;
}
/* it doesn't make sense to save ... | false | false | false | false | false | 0 |
file_table_init(int table_size)
{
int i;
GFARM_MALLOC_ARRAY(file_table, table_size);
if (file_table == NULL) {
errno = ENOMEM; fatal_errno(GFARM_MSG_1000462, "file table");
}
for (i = 0; i < table_size; i++)
file_table[i].local_fd = -1;
file_table_size = table_size;
} | false | false | false | false | false | 0 |
_hash_form_tuple(Relation index, Datum *values, bool *isnull)
{
IndexTuple itup;
uint32 hashkey;
Datum hashkeydatum;
TupleDesc hashdesc;
if (isnull[0])
hashkeydatum = (Datum) 0;
else
{
hashkey = _hash_datum2hashkey(index, values[0]);
hashkeydatum = UInt32GetDatum(hashkey);
}
hashdesc = RelationGetDesc... | false | false | false | false | false | 0 |
dlm_migration_can_proceed(struct dlm_ctxt *dlm,
struct dlm_lock_resource *res,
u8 mig_target)
{
int can_proceed;
spin_lock(&res->spinlock);
can_proceed = !!(res->state & DLM_LOCK_RES_MIGRATING);
spin_unlock(&res->spinlock);
/* target has died, so make the caller break out of the
* wait_event, ... | false | false | false | false | false | 0 |
rgbe_write_line (FILE *f, gchar *line)
{
size_t written;
guint len = strlen (line);
g_return_val_if_fail (g_str_has_suffix (line, "\n"), FALSE);
written = fwrite (line, sizeof (line[0]), len, f);
g_free (line);
return written == len ? TRUE : FALSE;
} | false | false | false | false | false | 0 |
valuate_combinable_pattern_chain(struct matched_patterns_list_data *list,
int pos)
{
/* FIXME: This is just a first attempt at pattern combination.
* Improve it. The first idea is to differentiate between
* move reason types. For instance, when there is a secure
* eye already, a threat to ... | false | false | false | false | false | 0 |
pr_regexp(struct info *info, struct value *r) {
print_regexp(stdout, r->regexp);
return make_unit(ref(info));
} | false | false | false | false | false | 0 |
arizona_underclocked(int irq, void *data)
{
struct arizona *arizona = data;
unsigned int val;
int ret;
ret = regmap_read(arizona->regmap, ARIZONA_INTERRUPT_RAW_STATUS_8,
&val);
if (ret != 0) {
dev_err(arizona->dev, "Failed to read underclock status: %d\n",
ret);
return IRQ_NONE;
}
if (val & ARIZONA... | false | false | false | false | false | 0 |
cirrus_crtc_load_lut(struct drm_crtc *crtc)
{
struct cirrus_crtc *cirrus_crtc = to_cirrus_crtc(crtc);
struct drm_device *dev = crtc->dev;
struct cirrus_device *cdev = dev->dev_private;
int i;
if (!crtc->enabled)
return;
for (i = 0; i < CIRRUS_LUT_SIZE; i++) {
/* VGA registers */
WREG8(PALETTE_INDEX, i);
... | false | false | false | false | false | 0 |
e_scrollframe_custom_edje_file_set(Evas_Object *obj, const char *file, const char *group)
{
API_ENTRY return 0;
if (!edje_object_file_set(sd->edje_obj, file, group)) return 0;
if (sd->pan_obj)
edje_object_part_swallow(sd->edje_obj, "e.swallow.content", sd->pan_obj);
sd->vbar_visible = !sd->vbar_visibl... | false | false | false | false | false | 0 |
read_pnp_ids (void)
{
gchar *contents;
gchar **lines;
gchar *line;
gchar *code, *name;
gint i;
if (pnp_ids)
return;
pnp_ids = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
if (g_file_get_contents (PNP_IDS, &contents, NULL, NULL))
{
lines = g_strspl... | false | false | false | false | false | 0 |
es_fname_get (estream_t stream)
{
const char *fname;
ESTREAM_LOCK (stream);
fname = stream->intern->printable_fname;
if (fname)
stream->intern->printable_fname_inuse = 1;
ESTREAM_UNLOCK (stream);
if (!fname)
fname = "[?]";
return fname;
} | false | false | false | false | false | 0 |
fs_emu_queue_input_event(int input_event) {
if (input_event & 0x8000) {
int state = (input_event & 0xff0000) >> 16;
int action = input_event & 0xffff;
// local action
if (input_event & 0xc000) {
// local libfsemu action
fs_emu_handle_libfsemu_action(action, st... | false | false | false | false | false | 0 |
aircable_prepare_write_buffer(struct usb_serial_port *port,
void *dest, size_t size)
{
int count;
unsigned char *buf = dest;
count = kfifo_out_locked(&port->write_fifo, buf + HCI_HEADER_LENGTH,
size - HCI_HEADER_LENGTH, &port->lock);
buf[0] = TX_HEADER_0;
buf[1] = TX_HEADER_1;
put_unaligned_le16(count... | false | false | false | false | false | 0 |
crypto_aead_encrypt(unsigned char *c, unsigned long long *clen,
const unsigned char *m, unsigned long long mlen,
const unsigned char *ad, unsigned long long adlen,
const unsigned char *nsec,
const unsigned char *npub,
... | false | false | false | false | false | 0 |
cmListFileLexer_yylex_destroy (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* Pop the buffer stack, destroying each element. */
while(YY_CURRENT_BUFFER){
cmListFileLexer_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
YY_CURRENT_BUFFER_LV... | false | false | false | false | false | 0 |
ipmi_oem_intel_set_power_restore_delay (ipmi_oem_state_data_t *state_data)
{
uint8_t bytes_rq[IPMI_OEM_MAX_BYTES];
uint8_t bytes_rs[IPMI_OEM_MAX_BYTES];
unsigned int tmp;
char *endptr;
uint16_t delay = 0;
int rs_len;
int rv = -1;
assert (state_data);
assert (state_data->prog_data->args->oem_options_... | false | false | false | false | false | 0 |
config_entry_to_option(GtkWidget *entry, gchar **option, gchar *(*func)(const gchar *))
{
const gchar *buf;
g_free(*option);
*option = NULL;
buf = gtk_entry_get_text(GTK_ENTRY(entry));
if (buf && strlen(buf) > 0)
{
if (func)
*option = func(buf);
else
*option = g_strdup(buf);
}
} | false | false | false | false | false | 0 |
run_once(void* arg)
{
#ifndef ENABLE_THREADS
// If there is no threads support, we don't need to use pthread_once.
if (!this->was_run_)
this->internal_run(arg);
#else // defined(ENABLE_THREADS)
if (parameters->options_valid() && !parameters->options().threads())
{
// If we are not using threads, ... | 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.