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 |
|---|---|---|---|---|---|---|
P_Display_Image_Byte_Order (Object d) {
Check_Type (d, T_Display);
return Bits_To_Symbols ((unsigned long)ImageByteOrder (DISPLAY(d)->dpy),
0, Byte_Order_Syms);
} | false | false | false | false | false | 0 |
set_orientation (TrackerSparqlCursor *cursor,
gint column,
GrlMedia *media,
GrlKeyID key)
{
const gchar *str = tracker_sparql_cursor_get_string (cursor, column, NULL);
if (g_str_has_suffix (str, "nfo#orientation-top"))
gr... | false | false | false | false | false | 0 |
find_file_nocase(const char * dir, const char * file)
{
DIR * d;
struct dirent * res;
char * ret;
d = opendir(dir);
while( (res=readdir(d)) )
{
if(!res)
break;
/* Check, if the filenames match */
if(!strcasecmp(res->d_name, file))
{
ret = bgav_sprintf("%s/%s", dir, re... | false | false | false | false | false | 0 |
msi001_s_ctrl(struct v4l2_ctrl *ctrl)
{
struct msi001_dev *dev = container_of(ctrl->handler, struct msi001_dev, hdl);
struct spi_device *spi = dev->spi;
int ret;
dev_dbg(&spi->dev, "id=%d name=%s val=%d min=%lld max=%lld step=%lld\n",
ctrl->id, ctrl->name, ctrl->val, ctrl->minimum, ctrl->maximum,
ctrl->step);... | false | false | false | false | false | 0 |
fm_job_pause(FmJob *job)
{
g_return_val_if_fail(job != NULL && FM_IS_JOB(job), FALSE);
if (!job->cancellable)
return FALSE;
_ensure_job_locked(job); /* acquire lock */
job->suspended = TRUE; /* mark appropriately */
return TRUE;
} | false | false | false | false | false | 0 |
rb_enc_path_next(const char *s, const char *e, rb_encoding *enc)
{
while (s < e && !isdirsep(*s)) {
Inc(s, e, enc);
}
return (char *)s;
} | false | false | false | false | false | 0 |
rbtree_insert(rbtree_tree *tree,void *key,void *value)
{
rbtree_node *x,*y;
int exists;
/* insert a new node (if necessary) */
x = rbtree_insert_new(tree,key,value,&exists);
if (exists) return(0);
if (!x) return(-1);
tree->node_count++;
/* maintains red-black properties */
x->color = RBTR... | false | false | false | false | false | 0 |
make_good_string(char *str)
{
/*
* find all the tabs and make them \<tab>s
*
* 1. find # of tabs
* 2. make new string
*
* we dont escape already escaped tabs
*/
char *result;
char *ptr, *optr;
int toescape = 0;
size_t size;
#ifdef HAVE_ICONV
char *utf8str=NULL;
if ( encoding )
{
utf8str=utf8(... | false | false | false | false | false | 0 |
mg_tabwindow_kill_cb (GtkWidget *win, gpointer userdata)
{
GSList *list, *next;
session *sess;
/* puts("enter mg_tabwindow_kill_cb");*/
hexchat_is_quitting = TRUE;
/* see if there's any non-tab windows left */
list = sess_list;
while (list)
{
sess = list->data;
next = list->next;
if (!sess->gui->is_tab)
... | false | false | false | false | false | 0 |
pop()
{
ckdb::Key *k = ckdb::ksPop(ks);
if (k==0) throw KeySetOutOfRange();
Key key(k);
return key;
} | false | false | false | false | false | 0 |
_gl_read_config_string(GetLine *gl, const char *buffer, KtBinder who)
{
const char *bptr; /* A pointer into buffer[] */
int waserr = 0; /* True if an error occurred while reading */
int lineno = 1; /* The line number being processed */
/*
* Check the arguments.
*/
if(!gl || !buffer... | false | false | false | false | false | 0 |
marker_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode,
struct iatt *buf, struct iatt *preparent,
struct iatt *postparent, dict_t *xdata)
{
marker_local_t *local = NULL;
... | false | false | false | false | false | 0 |
test_diff_tree__0(void)
{
/* grabbed a couple of commit oids from the history of the attr repo */
const char *a_commit = "605812a";
const char *b_commit = "370fe9ec22";
const char *c_commit = "f5b0af1fb4f5c";
git_tree *c;
g_repo = cl_git_sandbox_init("attr");
cl_assert((a = resolve_commit_oid_to_tree(g_repo, a... | false | false | false | false | false | 0 |
csr1212_new_keyval(u_int8_t type, u_int8_t key)
{
struct csr1212_keyval *kv;
if (key < 0x30 && ((csr1212_key_id_type_map[key] & (1 << type)) == 0))
return NULL;
kv = CSR1212_MALLOC(sizeof(*kv));
if (!kv)
return NULL;
kv->key.type = type;
kv->key.id = key;
kv->associate = NULL;
kv->refcnt = 1;
kv->next... | false | false | false | false | false | 0 |
get_net (LoadGraph *graph)
{
glibtop_netlist netlist;
char **ifnames;
guint32 i;
guint64 in = 0, out = 0;
GTimeVal time;
guint64 din, dout;
gboolean first = true;
ifnames = glibtop_get_netlist(&netlist);
for (i = 0; i < netlist.number; ++i)
{
glibtop_netload netload;
... | false | false | false | false | false | 0 |
isWaitingForCd() const
{
DEBUG_BLOCK
debug() << "waiting?: " << m_waitingForCd;
return m_waitingForCd;
} | false | false | false | false | false | 0 |
jk_b_copy(jk_msg_buf_t *smsg, jk_msg_buf_t *dmsg)
{
if (smsg == NULL || dmsg == NULL)
return (-1);
if (dmsg->maxlen < smsg->len)
return (-2);
memcpy(dmsg->buf, smsg->buf, smsg->len);
dmsg->len = smsg->len;
return (smsg->len);
} | false | true | false | false | false | 1 |
get_class(FILE * fd, struct SigSet *S)
{
char tag[1024];
struct ClassSig *C;
C = I_NewClassSig(S);
while (gettag(fd, tag)) {
if (eq(tag, "endclass:"))
break;
if (eq(tag, "classnum:"))
get_classnum(fd, C);
if (eq(tag, "classtype:"))
get_classtype(fd, C);
if (eq(tag, "classtitle:"))
... | true | true | false | false | false | 1 |
AlterSeqNamespaces(Relation classRel, Relation rel,
Oid oldNspOid, Oid newNspOid, const char *newNspName, LOCKMODE lockmode)
{
Relation depRel;
SysScanDesc scan;
ScanKeyData key[2];
HeapTuple tup;
/*
* SERIAL sequences are those having an auto dependency on one of the
* table's columns (we don't c... | false | false | false | false | false | 0 |
DERReencode(BufferedTransformation &source, BufferedTransformation &dest)
{
byte tag;
source.Peek(tag);
BERGeneralDecoder decoder(source, tag);
DERGeneralEncoder encoder(dest, tag);
if (decoder.IsDefiniteLength())
decoder.TransferTo(encoder, decoder.RemainingLength());
else
{
while (!decoder.EndReached())
... | false | false | false | false | false | 0 |
fec_free(struct fec_parms *p)
{
if (p==NULL ||
p->magic != (((FEC_MAGIC ^ p->k) ^ p->n) ^ (unsigned long)(p->enc_matrix))) {
fprintf(stderr, "bad parameters to fec_free\n");
return ;
}
free(p->enc_matrix);
free(p);
} | false | false | false | false | false | 0 |
gst_shape_wipe_video_sink_query (GstPad * pad, GstQuery * query)
{
GstShapeWipe *self = GST_SHAPE_WIPE (gst_pad_get_parent (pad));
gboolean ret;
GstPad *peer = gst_pad_get_peer (self->srcpad);
GST_LOG_OBJECT (pad, "Handling query of type '%s'",
gst_query_type_get_name (GST_QUERY_TYPE (query)));
if (!p... | false | false | false | false | false | 0 |
parse_longlink_mfc(tuple_t *tuple, cistpl_longlink_mfc_t *link)
{
u_char *p;
int i;
p = (u_char *)tuple->TupleData;
link->nfn = *p; p++;
if (tuple->TupleDataLen <= link->nfn*5)
return -EINVAL;
for (i = 0; i < link->nfn; i++) {
link->fn[i].space = *p; p++;
link->fn[i].addr = get_unaligned_le32(p);
p += 4... | false | false | false | false | false | 0 |
is_packet_keyframe_theora (GstOggStream * pad, ogg_packet * packet)
{
if (packet->bytes == 0)
return FALSE;
return (packet->packet[0] & 0xc0) == 0x00;
} | false | false | false | false | false | 0 |
feature_selector_new(ObjSynthControls *controls)
{
GtkWidget *combo;
GwyEnum *model;
guint n, i;
n = G_N_ELEMENTS(features);
model = g_new(GwyEnum, n);
for (i = 0; i < n; i++) {
model[i].value = features[i].type;
model[i].name = features[i].name;
}
combo = gwy_enum_comb... | false | false | false | false | false | 0 |
is_pseudo_reg (rtl)
rtx rtl;
{
return (((GET_CODE (rtl) == REG) && (REGNO (rtl) >= FIRST_PSEUDO_REGISTER))
|| ((GET_CODE (rtl) == SUBREG)
&& (REGNO (SUBREG_REG (rtl)) >= FIRST_PSEUDO_REGISTER)));
} | false | false | false | false | false | 0 |
output_used_types (void)
{
if (cfun && cfun->used_types_hash)
{
VEC(tree, heap) *types;
int i;
tree type;
types = VEC_alloc (tree, heap, htab_elements (cfun->used_types_hash));
htab_traverse (cfun->used_types_hash, output_used_types_helper, &types);
/* Sort by UID to prevent ... | false | false | false | false | false | 0 |
vidioc_enum_fmt(struct file *file, struct v4l2_fmtdesc *f,
bool out)
{
struct s5p_mfc_dev *dev = video_drvdata(file);
struct s5p_mfc_fmt *fmt;
int i, j = 0;
for (i = 0; i < ARRAY_SIZE(formats); ++i) {
if (out && formats[i].type != MFC_FMT_DEC)
continue;
else if (!out && formats[i].type != MFC_FMT_RAW... | false | false | false | false | false | 0 |
radeon_uvd_validate_codec(struct radeon_cs_parser *p,
unsigned stream_type)
{
switch (stream_type) {
case 0: /* H264 */
case 1: /* VC1 */
/* always supported */
return 0;
case 3: /* MPEG2 */
case 4: /* MPEG4 */
/* only since UVD 3 */
if (p->rdev->family >= CHIP_PALM)
return 0;
/* fall throu... | false | false | false | false | false | 0 |
gth_input_add_genomic_file(GthInput *input, const char *filename)
{
gt_assert(input && filename);
gt_str_array_add_cstr(input->genomicfiles, filename);
} | false | false | false | false | false | 0 |
init_server_long(int *sock, int port, char *ip, int type)
{
int ret=0;
struct sockaddr_in server;
int s= -1;
if (!ssl_sock_init()) return(0);
memset((char *)&server,0,sizeof(server));
server.sin_family=AF_INET;
server.sin_port=htons((unsigned short)port);
if (ip == NULL)
server.sin_addr.s_addr=INADDR_ANY;
... | false | true | false | false | false | 1 |
iio_check_for_dynamic_events(struct iio_dev *indio_dev)
{
int j;
for (j = 0; j < indio_dev->num_channels; j++) {
if (indio_dev->channels[j].num_event_specs != 0)
return true;
}
return false;
} | false | false | false | false | false | 0 |
run(const rpt_expr::pointer &, size_t,
rpt_value::pointer *argv) const
{
rpt_value::pointer arg = rpt_value::undefer(argv[0]);
return rpt_value_string::create(arg->type_of());
} | false | false | false | false | false | 0 |
SyncChr(void) {
int i;
for (i = 0; i < 8; i++)
setchr1(i << 10, chr[i]);
} | false | false | false | false | false | 0 |
lad_sm_change_csm_to_lm(Module_table *module, int entry)
{
Array_table *a, *c, *csm;
for (a = module->array_head; a != NULL; a = a->next) {
if(a->entry == entry) {
break;
}
}
csm = a;
for (c = module->array_head; c != NULL; c = c->next) {
if (!strcmp(c->name, csm->name)) {
if (c... | false | false | false | true | false | 1 |
goc_path_distance (GocItem *item, double x, double y, GocItem **near_item)
{
GocPath *path = GOC_PATH (item);
GOStyle *style = go_styled_object_get_style (GO_STYLED_OBJECT (item));
double tmp_width = 0;
double res = 20;
double ppu = goc_canvas_get_pixels_per_unit (item->canvas);
cairo_surface_t *surface;
cairo_t... | false | false | false | false | false | 0 |
parseString(bool allowNoString,
bool stringWithQuotationMarks)
throw(GsmException)
{
// handle case of empty parameter
std::string result;
if (checkEmptyParameter(allowNoString)) return result;
result = parseString2(stringWithQuotationMarks);
return result;
} | false | false | false | false | false | 0 |
midi_process(audio_patch_t *p, audio_channel_t *c, unsigned frames)
{
unsigned eframes = frames ? frames : 1;
while(aev_next(&c->port, 0) < eframes)
{
aev_event_t *ev = aev_read(&c->port);
switch(ev->type)
{
case CE_START:
EDBG(log_printf(DLOG, "midi: CE_START %d\n", p->param[APP_WAVE]);)
midi_start(p, ... | false | false | false | false | false | 0 |
opcode_label_define(opcode_label_ty *lp, size_t where)
{
size_t j;
trace(("opcode_label_define(lp = %08lX)\n{\n", (long)lp));
assert(lp->pc == (size_t)(-1));
lp->pc = where;
trace(("pc = %ld\n", (long)lp->pc));
for (j = 0; j < lp->npending; ++j)
*lp->pending[j] = lp->pc;
if... | false | false | false | false | false | 0 |
PushConnection(RakNet::Connection_RM3 *newConnection, WorldId worldId)
{
if (newConnection==0)
return false;
if (GetConnectionByGUID(newConnection->GetRakNetGUID(), worldId))
return false;
// Was this intended?
RakAssert(newConnection->GetRakNetGUID()!=rakPeerInterface->GetMyGUID());
RakAssert(world... | false | false | false | false | false | 0 |
alc283_fixup_sense_combo_jack(struct hda_codec *codec,
const struct hda_fixup *fix, int action)
{
struct alc_spec *spec = codec->spec;
switch (action) {
case HDA_FIXUP_ACT_PRE_PROBE:
spec->gen.hp_automute_hook = alc283_hp_automute_hook;
break;
case HDA_FIXUP_ACT_INIT:
/* MIC2-VREF control */
/* Set... | false | false | false | false | false | 0 |
sysfs_backlight_fix_config(void)
{
if (lcd_sysfs_cfg.init < 0)
lcd_sysfs_cfg.init = -1;
if (lcd_sysfs_cfg.init > lcd_bck_info.max)
lcd_sysfs_cfg.init = lcd_bck_info.max;
if (lcd_sysfs_cfg.step < 1)
lcd_sysfs_cfg.step = 1;
if (lcd_sysfs_cfg.step > (lcd_bck_info.max / 2))
lcd_sysfs_cfg.step = l... | false | false | false | false | false | 0 |
detect_charset_japanese (const guchar *text)
{
guchar c;
gchar *charset = NULL;
while ((c = *text++) != '\0')
{
if (c >= 0x81 && c <= 0x9F)
{
if (c == 0x8E) /* SS2 */
{
c = *text++;
if ((c >= 0x40 && c <= 0xA0) || (c >= 0xE0 && c <= 0xFC))
{
charset = "CP932";
break;
}
}
e... | false | false | false | false | false | 0 |
event()
{
pthread_mutex_lock(&EventLock);
if(Events.size() == 0)
{
pthread_mutex_unlock(&EventLock);
return DeltaEvent(0, 0);
}
DeltaEvent ev=Events[Events.size()-1];;
Events.pop_back();
pthread_mutex_unlock(&EventLock);
return ev;
} | false | false | false | false | false | 0 |
stpi_unquote(char *s) /* IO - Original string */
{
char *d = s; /* Destination pointer */
while (*s)
{
if (*s == '\\')
{
s ++;
if (isdigit(*s))
{
*d = 0;
while (isdigit(*s))
{
*d = *d * 8 + *s - '0';
s ++;
}
d ++;
}
else
{
if (*s == 'n')
*d ++ = '\... | false | false | false | false | false | 0 |
compute(int eflag, int vflag)
{
if (eflag || vflag) {
ev_setup(eflag,vflag);
} else evflag = vflag_fdotr = 0;
const int nall = atom->nlocal + atom->nghost;
const int nthreads = comm->nthreads;
const int inum = list->inum;
const int * const line = atom->line;
const int * const type = atom->type;
//... | false | false | false | false | false | 0 |
DoDownloadFile(CommandLine &CmdL)
{
if (CmdL.FileSize() <= 2)
return _error->Error(_("Must specify at least one pair url/filename"));
pkgAcquire Fetcher;
AcqTextStatus Stat(ScreenWidth, _config->FindI("quiet",0));
Fetcher.Setup(&Stat);
std::string download_uri = CmdL.FileList[1];
std::string t... | false | false | false | false | false | 0 |
pack_pixels3_6(unsigned char* buf,int len)
{
int read_pos = 0;
int write_pos = 0;
int shift = 7;
while(read_pos < len)
{
/* read 3pixels at 3 bit */
unsigned short value = buf[read_pos] << 8;
if(read_pos+1 < len)
value += buf[read_pos + 1];
if(shift)
value >>= shift;
/* write 8... | false | false | false | false | false | 0 |
fso_framework_wakelock_acquire (FsoFrameworkWakelock* self) {
gboolean _tmp0_ = FALSE;
const gchar* _tmp1_ = NULL;
g_return_if_fail (self != NULL);
_tmp0_ = self->priv->wakelocks_supported;
if (!_tmp0_) {
return;
}
_tmp1_ = self->priv->_name;
fso_framework_file_system_write (_tmp1_, FSO_FRAMEWORK_WAKELOCK_sys... | false | false | false | false | false | 0 |
vidioc_s_input(struct file *file, void *_fh,
unsigned int index)
{
struct hdpvr_device *dev = video_drvdata(file);
int retval;
if (index >= HDPVR_VIDEO_INPUTS)
return -EINVAL;
if (dev->status != STATUS_IDLE)
return -EBUSY;
retval = hdpvr_config_call(dev, CTRL_VIDEO_INPUT_VALUE, index+1);
if (!retval) ... | false | false | false | false | false | 0 |
enqueue_cmd_and_start_io(ctlr_info_t *h,
CommandList_struct *c)
{
unsigned long flags;
set_performant_mode(h, c);
spin_lock_irqsave(&h->lock, flags);
addQ(&h->reqQ, c);
h->Qdepth++;
if (h->Qdepth > h->maxQsinceinit)
h->maxQsinceinit = h->Qdepth;
start_io(h);
spin_unlock_irqrestore(&h->lock, flags);
} | false | false | false | false | false | 0 |
preprocess()
{
// check sanity
if (!sanityCheck())
return false;
// this worker class can only handle known families
if (familyMask() & KResolver::UnknownFamily)
{
setError(KResolver::UnsupportedFamily);
return false; // we don't know about this
}
// check the socket types
if (soc... | false | false | false | false | false | 0 |
IsPointInTriangle(const XY *point, const XY *tr_point1, const XY *tr_point2, const XY *tr_point3) {
// check bounds
if (point->y > tr_point1->y && point->y > tr_point2->y && point->y > tr_point3->y) return false;
if (point->y < tr_point1->y && point->y < tr_point2->y && point->y < tr_point3->y) return false;
if (po... | false | false | false | false | false | 0 |
ajGraphOpenWin(AjPGraph thys, float xmin, float xmax,
float ymin, float ymax)
{
AjPTime ajtime;
ajGraphicsSetDevice(thys);
if (thys)
{
/* Calling funclist graphType() */
(*graphType[thys->displaytype].GOpen)(thys,
graphType[thys->displaytype].Ext);... | false | false | false | false | false | 0 |
soup_content_decoder_content_processor_wrap_input (SoupContentProcessor *processor,
GInputStream *base_stream,
SoupMessage *msg,
GError **error)
{
GSList *decoders, *d;
GInputStream *istream;
decoders = soup_content_decoder_get_decoders_for_msg (SOUP_CONTENT_DECODER (processor), msg);
if... | false | false | false | false | false | 0 |
v_norm3(vector, v_result)
const hvec3_t *vector;
hvec3_t *v_result;
{
double length = hypot(v_x(*vector), hypot(v_y(*vector), v_z(*vector)));
v_result = gm_ALLOC(hvec3_t, v_result, "v_norm3()");
v_x(*v_result) = gm_DIV(v_x(*vector), length, "v_norm2()");
v_y(*v_result) = v_y(*vector) / length;
v_z(*v_... | false | false | false | true | true | 1 |
xatos(const char *token)
{
long port = xatol(token);
if (port & ~0xFFFF)
self_destruct();
return port;
} | false | false | false | false | false | 0 |
rad_auth_sent(struct rad_req_t *req, int res)
{
if (res) {
rad_auth_finalize(req->rpd, PWDB_DENIED);
return;
}
__sync_add_and_fetch(&req->serv->stat_auth_sent, 1);
if (!req->hnd.tpd) {
triton_md_register_handler(req->rpd->ses->ctrl->ctx, &req->hnd);
triton_md_enable_handler(&req->hnd, MD_MODE_READ);
}
... | false | false | false | false | false | 0 |
ws_buffer_append(WsBuffer *buffer, unsigned char *data, size_t len)
{
unsigned char *p;
if (!ws_buffer_append_space(buffer, &p, len))
return WS_FALSE;
memcpy(p, data, len);
return WS_TRUE;
} | false | false | false | false | false | 0 |
copy_ancestor_tree (dw_die_ref unit, dw_die_ref die, htab_t decl_table)
{
dw_die_ref parent = die->die_parent;
dw_die_ref new_parent = unit;
dw_die_ref copy;
void **slot = NULL;
struct decl_table_entry *entry = NULL;
if (decl_table)
{
/* Check if the entry has already been copied to UNIT. */
... | false | false | false | false | false | 0 |
luaC_step (lua_State *L) {
global_State *g = G(L);
l_mem lim = (GCSTEPSIZE/100) * g->gcstepmul;
if (lim == 0)
lim = (MAX_LUMEM-1)/2; /* no limit */
g->gcdept += g->totalbytes - g->GCthreshold;
do {
lim -= singlestep(L);
if (g->gcstate == GCSpause)
break;
} while (lim > 0);
if (g->gcstat... | false | false | false | false | false | 0 |
leak_add(leak_set_t *ls, size_t size, const char *file, int line)
{
char key[1024];
struct leak_record *lr;
bool found;
void *v;
leak_set_check(ls);
g_assert(file);
g_assert(line >= 0);
concat_strings(key, sizeof key,
file, ":", uint64_to_string(line), (void *) 0);
found = htable_lookup_extended(ls->places... | true | true | false | false | false | 1 |
PlanCacheRelCallback(Datum arg, Oid relid)
{
ListCell *lc1;
foreach(lc1, cached_plans_list)
{
CachedPlanSource *plansource = (CachedPlanSource *) lfirst(lc1);
CachedPlan *plan = plansource->plan;
/* No work if it's already invalidated */
if (!plan || plan->dead)
continue;
/*
* Check the list we ... | false | false | false | false | false | 0 |
_bfd_count_link_order_relocs (struct bfd_link_order *link_order)
{
register unsigned int c;
register struct bfd_link_order *l;
c = 0;
for (l = link_order; l != NULL; l = l->next)
{
if (l->type == bfd_section_reloc_link_order
|| l->type == bfd_symbol_reloc_link_order)
++c;
}
return c;
} | false | false | false | false | false | 0 |
ffimport_file( char *filename, /* Text file to read */
char **contents, /* Pointer to pointer to hold file */
int *status ) /* CFITSIO error code */
/*
Read and concatenate all the lines from the given text file. User
must free t... | false | false | false | false | false | 0 |
GMT_right_conic (double y)
{
double x_es, y_es, x_en, y_en, dy;
GMT_geo_to_xy (project_info.e, project_info.s, &x_es, &y_es);
GMT_geo_to_xy (project_info.e, project_info.n, &x_en, &y_en);
dy = y_en - y_es;
if (GMT_IS_ZERO (dy)) return (GMT_map_width);
return (x_es - ((x_es - x_en) * (y - y_es) / dy));
} | false | false | false | false | false | 0 |
getMaxBits() {
if (isIndexed()) {
if (m_Colors > 16) {
/* More than 16 colors -> 8 bits (5,6,7 bits are not supported by postscript!) */
return 8;
} else if (m_Colors >= 5) {
/* At most 16 colors */
return 4;
} else if (m_Colors >= 3) {
/* At most 4 colors */
return 2;
} else {
/* Monochro... | false | false | false | false | false | 0 |
cache_draw(hwloc_topology_t topology, struct draw_methods *methods, int logical, hwloc_obj_t level, void *output, unsigned depth, unsigned x, unsigned *retwidth, unsigned y, unsigned *retheight)
{
unsigned myheight = gridsize + (fontsize ? (fontsize + gridsize) : 0) + gridsize, totheight;
unsigned mywidth = 0, totw... | true | true | false | false | false | 1 |
dict_int_null_param(const ref * pdict, const char *kstr, int minval,
int maxval, int defaultval, int *pvalue)
{
ref *pdval;
int code, ival;
if (pdict == 0 || dict_find_string(pdict, kstr, &pdval) <= 0) {
ival = defaultval;
code = 1;
} else {
switch (r_type(pd... | false | false | false | false | false | 0 |
readModuleStoresFrom(const char *path, std::list<ModuleStore> &slist) {
DIR *d;
int loaded=0;
d=opendir(path);
if (d==NULL) {
fprintf(stderr, "No module store found at [%s]\n", path);
return false;
}
else {
struct dirent *de;
while( (de=readdir(d)) ) {
if (de->d_name[0]!='.') {
std:... | false | false | false | false | false | 0 |
sandisk_enable_wireless(struct net_device *dev)
{
int res, ret = 0;
struct hostap_interface *iface = netdev_priv(dev);
local_info_t *local = iface->local;
struct hostap_cs_priv *hw_priv = local->hw_priv;
if (resource_size(hw_priv->link->resource[0]) < 0x42) {
/* Not enough ports to be SanDisk multi-function car... | false | false | false | false | false | 0 |
import_tex_obj_state( r200ContextPtr rmesa,
int unit,
radeonTexObjPtr texobj )
{
/* do not use RADEON_DB_STATE to avoid stale texture caches */
GLuint *cmd = &rmesa->hw.tex[unit].cmd[TEX_CMD_0];
R200_STATECHANGE( rmesa, tex[unit] );
cmd[TEX_PP_TXFILTER] &= ~TEXOBJ_TXFILTER_MASK;
cmd[TEX_PP_TXF... | false | false | false | false | false | 0 |
z1_push(void *callback_data, const fixed * pf, int count)
{
gs_type1exec_state *pcxs = callback_data;
i_ctx_t *i_ctx_p = pcxs->i_ctx_p;
const fixed *p = pf + count - 1;
int i;
check_ostack(count);
for (i = 0; i < count; i++, p--) {
osp++;
make_real(osp, fixed2float(*p));
}
... | false | false | false | false | false | 0 |
getUnderlyingObjectForInstr(const MachineInstr *MI,
const MachineFrameInfo *MFI,
bool &MayAlias) {
MayAlias = true;
if (!MI->hasOneMemOperand() ||
!(*MI->memoperands_begin())->getValue() ||
(*MI->memoperands_... | false | false | false | false | false | 0 |
pinmux_pins_show(struct seq_file *s, void *what)
{
struct pinctrl_dev *pctldev = s->private;
const struct pinctrl_ops *pctlops = pctldev->desc->pctlops;
const struct pinmux_ops *pmxops = pctldev->desc->pmxops;
unsigned i, pin;
if (!pmxops)
return 0;
seq_puts(s, "Pinmux settings per pin\n");
if (pmxops->stric... | false | false | false | false | false | 0 |
url_decode(char *str) {
char *pstr = str, *buf = malloc(strlen(str) + 1), *pbuf = buf;
while (*pstr) {
if (*pstr == '%') {
if (pstr[1] && pstr[2]) {
*pbuf++ = from_hex(pstr[1]) << 4 | from_hex(pstr[2]);
pstr += 2;
}
} else if (*pstr == '+') {
*pbuf++ = ' ';
} else {
*pbuf++ = *pstr;
}
p... | false | false | false | false | false | 0 |
get_treeview_model(void) {
GtkTreeStore *store = gtk_tree_store_new(TREEVIEW_N_COLUMNS,
GDK_TYPE_PIXBUF,
G_TYPE_STRING,
G_TYPE_STRING,
G_TYPE_STRING,
G_TYPE_DOUBLE,
G_TYPE_INT,
G_TYPE_BOOLEAN);
int nr_of_user_profiles = 0;
... | false | false | false | false | false | 0 |
xccf_color_compare(
int r1,
int g1,
int b1,
int r2,
int g2,
int b2)
{
if(lf_abs(r1 - r2) > 6) return false;
if(lf_abs(g1 - g2) > 3) return false;
if(lf_abs(b1 - b2) > 6) return false;
return true;
} | false | false | false | false | false | 0 |
tpa6130a2_i2c_write(int reg, u8 value)
{
struct tpa6130a2_data *data;
int val = 0;
if (WARN_ON(!tpa6130a2_client))
return -EINVAL;
data = i2c_get_clientdata(tpa6130a2_client);
if (data->power_state) {
val = i2c_smbus_write_byte_data(tpa6130a2_client, reg, value);
if (val < 0) {
dev_err(&tpa6130a2_client... | false | false | false | false | false | 0 |
operator=( const aint32_t & anOther )
{
if (this != & anOther) {
setValue(anOther.getValue());
}
return *this;
} | false | false | false | false | false | 0 |
CopyHistinfo(struct histinfo *src, struct histinfo *dst)
{
/* first do a straight copy of the struct.
* then zero all the pointers so they don't point into the src lists.
* then allocate new space and copy any lists.
* (if you don't zero the pointers first, you can't do meaningful
* cleanup on... | false | true | false | false | false | 1 |
jme_mdio_read(struct net_device *netdev, int phy, int reg)
{
struct jme_adapter *jme = netdev->priv;
int i, val, again = (reg == MII_BMSR) ? 1 : 0;
read_again:
jwrite32(jme, JME_SMI, SMI_OP_REQ |
smi_phy_addr(phy) |
smi_reg_addr(reg));
for (i = JME_PHY_TIMEOUT * 50 ; i > 0 ; --i) {
udelay(20);
val = j... | false | false | false | false | false | 0 |
log_msg(int level, const char* format, ...) {
#ifdef SIM
#else
switch(level) {
case SUMMARY:
if (!config.debug_send) return;
break;
case WORKLOAD:
if (!config.debug_edf_sim_workload) return;
break;
case DETAIL:
if (!config.debug_edf_sim_detail) return;
bre... | false | false | false | false | false | 0 |
reparentValidator( QWidget *widget,
QValidator *validator )
{
if ( !validator->parent() )
validator->setParent( widget );
} | false | false | false | false | false | 0 |
fn_Sd_1arg_linear_monotonic(const gs_function_Sd_t *const pfn, double T0, double T1,
uint *mask /* 1 - non-monotonic or don't know, 0 - monotonic. */)
{
int i0 = (int)floor(T0);
int i1 = (int)ceil(T1), code;
double V0[MAX_FAST_COMPS], V1[MAX_FAST_COMPS];
if (i1 - i0 > 1) {
... | false | false | false | false | false | 0 |
Pair_print_coordinates (FILE *fp, struct T *pairs, int npairs, Chrnum_T chrnum,
Genomicpos_T chroffset, IIT_T chromosome_iit,
bool watsonp, int invertmode) {
T this;
struct T *save = NULL;
int i;
char *chrstring = NULL;
if (watsonp == true) {
/* ptr = pairs; */
} else if (invertmode == 0) {
... | false | false | false | false | false | 0 |
process_pipe_term_ack ()
{
peer = NULL;
delete pipe;
} | false | false | false | false | false | 0 |
CloseFile(size_t nfile)
{
if( nfile && nfile <= m_nfiles )
_btf_close(m_file[nfile-1]);
} | false | false | false | false | false | 0 |
gnumeric_mmult (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
{
GnmMatrix *A = NULL;
GnmMatrix *B = NULL;
GnmMatrix *C = NULL;
GnmValue *res = NULL;
A = gnm_matrix_from_value (argv[0], &res, ei->pos);
if (!A) goto out;
B = gnm_matrix_from_value (argv[1], &res, ei->pos);
if (!B) goto out;
if (A->cols !=... | false | false | false | false | false | 0 |
sbcat(sb, string, len)
str_buf *sb; /* String-buffer */
char *string; /* String to be appended */
int len; /* Length of string. Excludes NUL */
{
if (sb != NULL) {
if (sbinsure(sb, sb->len+len) == NULL)
return NULL;
strncpy(sb->buf+sb->len, string, len);
sb->len += len;
}
return sb;... | false | false | false | false | false | 0 |
get_exons(GtArray *exon_ranges, const void *sa)
{
GtFeatureNode *fn = *(GtFeatureNode**) sa;
GT_UNUSED int had_err;
gt_assert(exon_ranges && fn && gt_feature_node_has_type(fn, gt_ft_gene));
had_err = gt_feature_node_traverse_children(fn, exon_ranges,
csa_visitor_sav... | false | false | false | false | false | 0 |
scaleFromLATTS( string sEllips, double phits, double &scale )
{
if( EQUALN( sEllips.c_str(), "Sphere", 6 ) )
{
scale = cos(phits);
}
else
{
const IlwisEllips *piwEllips = iwEllips;
double e2 = 0.0;
while ( piwEllips->pszIlwisEllips )
{
if( EQUALN... | false | false | false | false | false | 0 |
_equinox_draw_arrow (cairo_t * cr, EquinoxRGB * color,
float alpha, EquinoxDirection dir, EquinoxArrowType type,
double x, double y, double width, double height)
{
double rotate;
if (dir == EQX_DIRECTION_LEFT)
rotate = M_PI * 1.5;
else if (dir == EQX_DIRECTION_RIGHT)
rotate = M_PI * 0.5;
else if (d... | false | false | false | false | false | 0 |
collector_encode_hex_htmlnumericentity(int c, void *data)
{
struct collector_htmlnumericentity_data *pc = (struct collector_htmlnumericentity_data *)data;
int f, n, s, r, d, size, *mapelm;
size = pc->mapsize;
f = 0;
n = 0;
while (n < size) {
mapelm = &(pc->convmap[n*4]);
if (c >= mapelm[0] && c <= mapelm[1])... | false | false | false | false | false | 0 |
DtsSetColorSpace(
HANDLE hDevice,
BC_OUTPUT_FORMAT Mode422
)
{
BC_STATUS sts = BC_STS_SUCCESS;
//unused uint32_t Val = 0;
DTS_LIB_CONTEXT *Ctx = NULL;
DTS_GET_CTX(hDevice,Ctx);
if(Ctx->DevId == BC_PCI_DEVID_LINK)
{
Ctx->b422Mode = Mode422;
sts = DtsSetLinkIn422Mode(hDevice);
}
else if (Ctx->DevId =... | false | false | false | false | false | 0 |
reset() {
pos_=initialPos_;
remainingMatchLength_=initialRemainingMatchLength_;
int32_t length=remainingMatchLength_+1; // Remaining match length.
if(maxLength_>0 && length>maxLength_) {
length=maxLength_;
}
str_->truncate(length);
pos_+=length;
remainingMatchLength_-=length;
... | false | false | false | false | false | 0 |
nflog_print(const struct xt_nflog_info *info, char *prefix)
{
if (info->prefix[0] != '\0') {
printf(" %snflog-prefix ", prefix);
xtables_save_string(info->prefix);
}
if (info->group)
printf(" %snflog-group %u", prefix, info->group);
if (info->len)
printf(" %snflog-range %u", prefix, info->len);
if (info->t... | false | false | false | false | false | 0 |
cp_parser_function_definition_from_specifiers_and_declarator
(cp_parser* parser,
cp_decl_specifier_seq *decl_specifiers,
tree attributes,
const cp_declarator *declarator)
{
tree fn;
bool success_p;
/* Begin the function-definition. */
success_p = start_function (decl_specifiers, declarator, attribu... | false | false | false | false | false | 0 |
handleMotion(const XMotionEvent &motion) {
if (motion.x_root >= x() &&
motion.y_root >= y() &&
motion.x_root < int (x() + width()) &&
motion.y_root < int (y() + height()) &&
motion.window == handle())
{
YWindow::handleMotion(motion);
dispatchMotionOutside(true, mo... | false | false | false | false | false | 0 |
parse_resvconf(void)
{
char *p;
char *opt;
char *arg;
char input[MAXLINE];
FBFILE *file;
/* XXX "/etc/resolv.conf" should be from a define in config.h perhaps
* for cygwin support etc. this hardcodes it to unix for now -db
*/
if ((file = fbopen("/etc/resolv.conf", "r")) == NULL)
return -1;
w... | true | true | false | false | false | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.