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 |
|---|---|---|---|---|---|---|
nfs_auth_info_add(struct nfs_auth_info *auth_info,
rpc_authflavor_t flavor)
{
unsigned int i;
unsigned int max_flavor_len = ARRAY_SIZE(auth_info->flavors);
/* make sure this flavor isn't already in the list */
for (i = 0; i < auth_info->flavor_len; i++) {
if (flavor == auth_info->flavors[i])
return t... | false | false | false | false | false | 0 |
dwarf_formblock(Dwarf_Attribute attr,
Dwarf_Block ** return_block, Dwarf_Error * error)
{
Dwarf_CU_Context cu_context = 0;
Dwarf_Debug dbg = 0;
Dwarf_Unsigned length = 0;
Dwarf_Small *data = 0;
Dwarf_Word leb128_length = 0;
Dwarf_Block *ret_block = 0;
int res = get_attr_dbg(&dbg,&cu_co... | false | false | false | false | false | 0 |
url_encode(char * buffer, size_t buflen,
const char * source, size_t srclen) {
if (NULL == buffer)
return srclen * 3 + 1;
if (buflen <= 0)
return 0;
size_t srcpos = 0, bufpos = 0;
while ((srcpos < srclen) && (bufpos + 1 < buflen)) {
unsigned char ch = source[srcpos++];
if ((ch... | false | false | false | false | false | 0 |
evdns_count_nameservers(void)
{
const struct nameserver *server = server_head;
int n = 0;
if (!server)
return 0;
do {
++n;
server = server->next;
} while (server != server_head);
return n;
} | false | false | false | false | false | 0 |
dact_hdr_ext_alloc(uint32_t size) {
if (dact_hdr_ext_val==NULL) {
if (!(dact_hdr_ext_val=malloc(DACT_HEADER_BLKSIZE))) {
dact_hdr_ext_val=NULL;
return(0);
}
dact_hdr_ext_sze=DACT_HEADER_BLKSIZE;
}
if ((dact_hdr_ext_pos+size)>(dact_hdr_ext_sze)) {
dact_hdr_ext_sze=(((dact_hdr_ext_pos+size-1)/DACT_HEADER... | false | false | false | false | false | 0 |
kvm_vcpu_running(struct kvm_vcpu *vcpu)
{
return (vcpu->arch.mp_state == KVM_MP_STATE_RUNNABLE &&
!vcpu->arch.apf.halted);
} | false | false | false | false | false | 0 |
BIO_nread0(BIO *bio, char **buf)
{
long ret;
if (!bio->init)
{
BIOerr(BIO_F_BIO_NREAD0, BIO_R_UNINITIALIZED);
return -2;
}
ret = BIO_ctrl(bio, BIO_C_NREAD0, 0, buf);
if (ret > INT_MAX)
return INT_MAX;
else
return (int) ret;
} | false | false | false | false | false | 0 |
HdlrFunc19 (
Obj self,
Obj a_arg )
{
Obj t_1 = 0;
Obj t_2 = 0;
Obj t_3 = 0;
Obj t_4 = 0;
Obj t_5 = 0;
Bag oldFrame;
OLD_BRK_CURR_STAT
/* allocate new stack frame */
SWITCH_TO_NEW_FRAME(self,0,0,oldFrame);
REM_BRK_CURR_STAT();
SET_BRK_CURR_STAT(0);
/* if not IsType( arg[1] ) then */
t_4 = GF_IsType;... | false | false | false | false | false | 0 |
readresp(char c, netbuf *nControl)
{
char match[5];
if (readline(nControl->response,256,nControl) == -1)
{
perror("Control socket read failed");
return 0;
}
if (ftplib_debug > 1)
fprintf(stderr,"%s",nControl->response);
if (nControl->response[3] == '-')
{
strncpy(match,nControl->response... | false | false | false | false | false | 0 |
__ecereMethod_Debugger_UpdateRemovedBreakpoint(struct __ecereNameSpace__ecere__com__Instance * this, struct Breakpoint * bp)
{
struct Debugger * __ecerePointer_Debugger = (struct Debugger *)(this ? (((char *)this) + __ecereClass_Debugger->offset) : 0);
;
if(__ecerePointer_Debugger->targeted && bp->inserted)
{
int oldS... | false | false | false | true | false | 1 |
floor_log10 (mpfr_srcptr x)
{
mpfr_t y;
mpfr_exp_t exp;
/* make sure first that y can represent a mpfr_exp_t exactly
and can compare with x */
mpfr_prec_t prec = sizeof (mpfr_exp_t) * CHAR_BIT;
mpfr_init2 (y, MAX (prec, MPFR_PREC (x)));
exp = mpfr_ceil_mul (MPFR_GET_EXP (x), 10, 1) - 1;
mpfr_set_ex... | false | false | false | false | false | 0 |
exec_simple_check_plan(PLpgSQL_expr *expr)
{
_SPI_plan *spi_plan = (_SPI_plan *) expr->plan;
Plan *plan;
TargetEntry *tle;
expr->expr_simple_expr = NULL;
/*
* 1. We can only evaluate queries that resulted in one single execution
* plan
*/
if (list_length(spi_plan->ptlist) != 1)
return;
plan = (Pla... | false | false | false | false | false | 0 |
constructSubrangeDIE(DIE &Buffer, const DISubrange *SR,
DIE *IndexTy) {
DIE &DW_Subrange = createAndAddDIE(dwarf::DW_TAG_subrange_type, Buffer);
addDIEEntry(DW_Subrange, dwarf::DW_AT_type, *IndexTy);
// The LowerBound value defines the lower bounds which is typically zero for... | false | false | false | false | false | 0 |
digest_to_hex(const uint8_t digest[SHA1_DIGEST_SIZE], char *output)
{
int i,j;
char *c = output;
for (i = 0; i < SHA1_DIGEST_SIZE/4; i++) {
for (j = 0; j < 4; j++) {
sprintf(c,"%02X", digest[i*4+j]);
c += 2;
}
sprintf(c, " ");
c += 1;
}
*(c - ... | false | false | false | false | false | 0 |
oggpack_read1(oggpack_buffer *b){
u32 ret;
if(b->endbyte>=b->storage){
/* not the main path */
ret=(u32) (-1);
goto overflow;
}
ret=(b->ptr[0]>>b->endbit)&1;
overflow:
b->endbit++;
if(b->endbit>7){
b->endbit=0;
b->ptr++;
b->endbyte++;
}
return(ret);
} | false | false | false | false | false | 0 |
nautilus_view_get_containing_window (NautilusView *view)
{
GtkWidget *window;
g_assert (NAUTILUS_IS_VIEW (view));
window = gtk_widget_get_ancestor (GTK_WIDGET (view), GTK_TYPE_WINDOW);
if (window == NULL) {
return NULL;
}
return GTK_WINDOW (window);
} | false | false | false | false | false | 0 |
soc_remove_component(struct snd_soc_component *component)
{
if (!component->card)
return;
/* This is a HACK and will be removed soon */
if (component->codec)
list_del(&component->codec->card_list);
if (component->remove)
component->remove(component);
snd_soc_dapm_free(snd_soc_component_get_dapm(component)... | false | false | false | false | false | 0 |
ai_new(alloc_info *ai, int size, bool sec)
{
if(size < 0)
return false;
ai->size = size;
ai->sec = sec;
if(size == 0)
{
ai->sbuf = 0;
ai->qbuf = 0;
ai->data = 0;
return true;
}
if(sec)
{
try
{
ai->sbuf = new Botan::SecureVector<Botan::byte>((Botan::u32bit)size + 1);
}
catch(std::exceptio... | false | false | false | false | false | 0 |
address_length (struct sockaddr *address)
{
struct sockaddr_un* unix_address = (struct sockaddr_un*)address;
int length = 0;
switch (address->sa_family) {
case AF_INET:
length = sizeof(struct sockaddr_in);
break;
case AF_INET6:
length = sizeof(struct sockaddr_in6);
break;
case... | false | false | false | false | false | 0 |
CDB___usermem(listp, db_malloc)
char ***listp;
void *(*db_malloc) __P((size_t));
{
size_t len;
int ret;
char **array, **arrayp, **orig, *strp;
/* Find out how much space we need. */
for (len = 0, orig = *listp; *orig != NULL; ++orig)
len += sizeof(char *) + strlen(*orig) + 1;
len += sizeof(char *);
/* Allo... | false | false | false | false | false | 0 |
gtk_progress_dialog_set_button_close_enabled(GtkProgressDialog* dialog, gboolean enabled)
{
g_return_if_fail(dialog!=NULL);
g_return_if_fail(GTK_IS_PROGRESS_DIALOG(dialog));
GtkWidget* widget;
widget = gtk_dialog_get_widget_for_response (GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE);
gtk_widget_set_sensitive (widget,... | false | false | false | false | false | 0 |
play_autoplay_media (DriveButton *self, const char *autoplay_key,
const char *dflt)
{
GConfClient *gconf_client = gconf_client_get_default ();
char *command = gconf_client_get_string (gconf_client,
autoplay_key, NULL);
if (!command)
command = g_strdup (dflt);
run_command (self, command);
g_free ... | false | false | false | false | false | 0 |
awele_destroy_all_items ()
{
int i;
if (boardRootItem != NULL)
goo_canvas_item_remove(boardRootItem);
boardRootItem = NULL;
if(graphsElt)
{
for (i = 0; i < NBHOLE / 2; i++)
{
#if GDK_PIXBUF_MAJOR <= 2 && GDK_PIXBUF_MINOR <= 24
gdk_pixbuf_unref(graphsElt->pixbufButton[i]);
gdk_pixbuf_unre... | false | false | false | false | false | 0 |
singleCompactStage3(MBCSData *mbcsData) {
uint16_t *stage3=(uint16_t *)mbcsData->fromUBytes;
/* this array maps the ordinal number of a stage 3 block to its new stage 2 index */
uint16_t map[0x1000];
uint16_t i, start, prevEnd, newStart;
/* enter the all-unassigned first stage 3 block into the map... | false | false | false | false | false | 0 |
db__driver_open_database(dbHandle * handle)
{
char msg[OD_MSG];
const char *name;
char *emsg = NULL;
SQLRETURN ret;
SQLINTEGER err;
dbConnection connection;
/* Open connection */
if (open_connection() != DB_OK)
return DB_FAILED;
db_get_connection(&connection);
name = db_get_ha... | false | false | false | false | false | 0 |
SkipDBRecord_dealloc(SkipDBRecord *self)
{
#ifdef SKIPDB_DEBUG
if (!deallocedRecords) deallocedRecords = List_new();
printf("SkipDBRecord_dealloc(%p)\n", (void *)self);
List_append_(deallocedRecords, self);
#endif
SkipDB_noteWillFreeRecord_((SkipDB *)(self->sdb), self);
if (self->pointers)
{
// Commented ... | false | false | false | false | false | 0 |
check_bases_and_members (tree t)
{
/* Nonzero if we are not allowed to generate a default constructor
for this case. */
int cant_have_default_ctor;
/* Nonzero if the implicitly generated copy constructor should take
a non-const reference argument. */
int cant_have_const_ctor;
/* Nonzero if the the... | false | false | false | false | false | 0 |
run_test (void *user_data)
{
gint prev;
GstClock *sysclock = GST_CLOCK_CAST (user_data);
while (running) {
gst_clock_get_time (sysclock);
prev = g_atomic_int_add (&count, 1);
if (prev == G_MAXINT)
g_warning ("overflow");
}
g_thread_exit (NULL);
return NULL;
} | false | false | false | false | false | 0 |
remove_method(klass, mid)
VALUE klass;
ID mid;
{
NODE *body;
if (klass == rb_cObject) {
rb_secure(4);
}
if (ruby_safe_level >= 4 && !OBJ_TAINTED(klass)) {
rb_raise(rb_eSecurityError, "Insecure: can't remove method");
}
if (OBJ_FROZEN(klass)) rb_error_frozen("class/module");
if (mi... | false | false | false | false | false | 0 |
bid_keyword_list(const char *p, ssize_t len, int unset, int last_is_path)
{
int l;
int keycnt = 0;
while (len > 0 && *p) {
int blank = 0;
/* Test whether there are blank characters in the line. */
while (len >0 && (*p == ' ' || *p == '\t')) {
++p;
--len;
blank = 1;
}
if (*p == '\n' || *p == '\r... | false | false | false | false | false | 0 |
full_daytime_range(lList **dtrl) {
lListElem *tmr;
DENTER(TOP_LAYER, "full_daytime_range");
if (!*dtrl)
*dtrl = lCreateList("full day", TMR_Type);
/* DPRINTF(("FULL_DAYTIME_RANGE\n")); */
tmr = lCreateElem(TMR_Type);
lAddSubUlong(tmr, TM_hour, 0, TMR_begin, TM_Type);
lAddSubUlong(tmr, TM... | false | false | false | false | false | 0 |
_discover_create_message(discover_error_t **status, char *message)
{
if((*status)->message) {
free((*status)->message);
}
(*status)->message = _discover_xmalloc(strlen(message) + 1);
strcpy((*status)->message, message);
} | false | true | false | false | false | 1 |
lookup(enum wakefulness wakefulness,
const tw_instr *q, INT n, INT r, INT m)
{
twid *p;
for (p = twlist[hash(n,r)];
p && !ok_twid(p, wakefulness, q, n, r, m);
p = p->cdr)
;
return p;
} | false | false | false | false | false | 0 |
drawCylinder(bool vertical, GLfloat* pos, GLfloat len, GLfloat rad) {
GLUquadricObj* x = gluNewQuadric();
glPushMatrix();
glTranslatef(pos[0], pos[1], pos[2]);
if (vertical) {
glRotated(-90., 1., 0., 0.);
} else {
glRotated(90., 0., 1., 0.);
}
gluCylinder(x, rad, rad, len, 20... | false | false | false | false | false | 0 |
af9005_get_post_vit_err_cw_count(struct dvb_frontend *fe,
u32 * post_err_count,
u32 * post_cw_count,
u16 * abort_count)
{
struct af9005_fe_state *state = fe->demodulator_priv;
int ret;
u32 err_count;
u32 cw_count;
u8 temp, temp0, temp1, temp2;
u16 loc_abort_count;
*post_err_count = 0;... | false | false | false | false | false | 0 |
_glewInit_GL_NV_conditional_render (GLEW_CONTEXT_ARG_DEF_INIT)
{
GLboolean r = GL_FALSE;
r = ((glBeginConditionalRenderNV = (PFNGLBEGINCONDITIONALRENDERNVPROC)glewGetProcAddress((const GLubyte*)"glBeginConditionalRenderNV")) == NULL) || r;
r = ((glEndConditionalRenderNV = (PFNGLENDCONDITIONALRENDERNVPROC)glewGet... | false | false | false | false | false | 0 |
CsfSeekAttrSpace(
MAP *m, /* map handle */
CSF_ATTR_ID id, /* attribute identification only for check if avalaible */
size_t size) /* size to be seeked to */
{
ATTR_CNTRL_BLOCK b;
CSF_FADDR currBlockPos, prevBlockPos=USED_UNINIT_ZERO, newPos, endBlock, resultPos=0;
int noPosFound... | false | false | false | false | false | 0 |
getCenter()
{
Vec3 Center=Vec3(0.0,0.0,0.0);
for(vector<Vec3>::iterator iter=m_points.begin();
iter!=m_points.end();
iter++){
Center+=(*iter);
}
Center=Center/m_points.size();
return Center;
} | false | false | false | false | false | 0 |
add_substrings(char *buffer, size_t *length, ms_MediaCode *code,
const ms_Flag *flag_list)
{
int j;
size_t l;
j = 0;
buffer = strchr(buffer, '\0');
while (flag_list[j].code != 0) {
if (flag_list[j].code & *code) {
l = strlen(flag_list[j].name);
if (*length < l) {
errno = ERANGE;
... | false | true | false | false | false | 1 |
read_string (int star_if_braced)
{
char *stringbuf;
int saw_paren = 0;
int c, old_lineno;
c = read_skip_spaces ();
if (c == '(')
{
saw_paren = 1;
c = read_skip_spaces ();
}
old_lineno = read_md_lineno;
if (c == '"')
stringbuf = read_quoted_string ();
else if (c == '{')
{
... | false | false | false | false | false | 0 |
consider(JoinPointLoc* jpl, JPL_Aspect &hi, JPL_Aspect &lo) {
#endif
JoinPointPlan* jp_plan = jpl->plan();
if (jp_plan) {
ACAspectInfo *h = TI_Aspect::of (hi)->aspect_info ();
ACAspectInfo *l = TI_Aspect::of (lo)->aspect_info ();
jp_plan->consider(*h, *l);
}
} | false | false | false | false | false | 0 |
vmw_gmrid_man_init(struct ttm_mem_type_manager *man,
unsigned long p_size)
{
struct vmw_private *dev_priv =
container_of(man->bdev, struct vmw_private, bdev);
struct vmwgfx_gmrid_man *gman =
kzalloc(sizeof(*gman), GFP_KERNEL);
if (unlikely(gman == NULL))
return -ENOMEM;
spin_lock_init(&gman->lock);... | false | false | false | false | false | 0 |
j2k_read_rgn (
opj_j2k_t *p_j2k,
OPJ_BYTE * p_header_data,
OPJ_UINT32 p_header_size,
struct opj_event_mgr * p_manager
)
{
OPJ_UINT32 l_nb_comp;
opj_image_t * l_image = 00;
opj_cp_t *l_cp = 00;
opj_tcp_t *l_tcp = 00;
OPJ_UINT32 l_comp_room;
OPJ_UINT3... | false | false | false | false | false | 0 |
cib_remote_callback_dispatch(gpointer user_data)
{
cib_t *cib = user_data;
cib_remote_opaque_t *private = cib->variant_opaque;
xmlNode *msg = NULL;
int disconnected = 0;
crm_info("Message on callback channel");
crm_remote_recv(&private->callback, -1, &disconnected);
msg = crm_remote_pars... | false | false | false | false | false | 0 |
setupdefmt (filename, statbuf)
char * filename; /* File to open, if non-NULL */
struct stat * statbuf; /* Buffer to hold file status */
{
FILE* filteredfile; /* Access to the filtered file */
int inputfd; /* Fd for access to file to open */
int savedstdin; /* File descriptor saving stdin *... | false | false | false | false | false | 0 |
cin_isfuncdecl(sp, first_lnum)
char_u **sp;
linenr_T first_lnum;
{
char_u *s;
linenr_T lnum = first_lnum;
int retval = FALSE;
if (sp == NULL)
s = ml_get(lnum);
else
s = *sp;
while (*s && *s != '(' && *s != ';' && *s != '\'' && *s != '"')
{
if (cin_iscomment(s)) /* ignore commen... | false | false | false | false | false | 0 |
GDE_freeali(NA_Alignment *dataset) {
if (dataset) {
GDE_free((void**)&dataset->id);
GDE_free((void**)&dataset->description);
GDE_free((void**)&dataset->authority);
GDE_free((void**)&dataset->cmask);
GDE_free((void**)&dataset->selection_mask);
GDE_free((void**)&dataset... | false | false | false | false | false | 0 |
calcBotBorderThick(void)
{
m_iBotThick = 0;
if(getBlock() && !getBlock()->hasBorders())
{
m_iBotThick = 0;
}
else if(getBlock() && canDrawBotBorder())
{
m_iBotThick = getBlock()->getBottom().m_thickness + getBlock()->getBottom().m_spacing;
}
return m_iBotThick;
} | false | false | false | false | false | 0 |
style_symbol_draw(struct style *style, cairo_t *cairoctx, guint keyval, gdouble w, gdouble h)
{
START_FUNC
GSList *item=style->symbols;
gchar name[7];
guint keyval2=keyval;
while (item && !style_symbol_matches((struct symbol *)item->data, gdk_keyval_name(keyval))) {
item=g_slist_next(item);
}
/* No predifined... | false | false | false | false | false | 0 |
snd_em28xx_hw_capture_free(struct snd_pcm_substream *substream)
{
struct em28xx *dev = snd_pcm_substream_chip(substream);
struct em28xx_audio *adev = &dev->adev;
dprintk("Stop capture, if needed\n");
if (atomic_read(&adev->stream_started) > 0) {
atomic_set(&adev->stream_started, 0);
schedule_work(&adev->wq_tr... | false | false | false | false | false | 0 |
do_auth(const char *_login, const char *password, const char *service, const char *realm) {
struct cache_result lkup_result;
char *response;
int cached = 0;
char login_buff[MAX_LOGIN_REALM_LEN];
char *login;
/***********************************************************
* Check to concat the login and ... | false | false | false | false | false | 0 |
write_buf(fd, buf, cnt)
int fd;
voidp buf;
unsigned cnt;
{
unsigned n;
while ((n = write_buffer (fd, buf, cnt)) != cnt) {
if (n == (unsigned)(-1)) {
write_error();
}
cnt -= n;
buf = (voidp)((char*)buf+n);
}
} | false | false | false | false | false | 0 |
addJobs( AbstractJobProvider* provider, int count )
{
QMutexLocker locker( &m_mutex );
int pos = 0;
int priority = provider->priority();
while ( pos < m_pendingProviders.count() && m_pendingProviders[ pos ]->priority() >= priority )
pos++;
for ( int i = 0; i < count; i++ )
m_pendin... | false | false | false | false | false | 0 |
settings_gui_save_panes(void)
{
guint i;
for (i = 0; i < G_N_ELEMENTS(panes); i++) {
GtkPaned *paned;
paned = GTK_PANED(gui_main_window_lookup(panes[i].name));
if (GTK_WIDGET_VISIBLE(gtk_paned_get_child1(paned)))
paned_save_position(paned, panes[i].prop);
}
} | false | false | false | false | false | 0 |
transDo(m,e,qs) /* Translate do { qs ; e } */
Cell m;
Cell e;
List qs; {
if (nonNull(qs)) {
Cell q = hd(qs);
Cell qs1 = tl(qs);
switch (fst(q)) {
case FROMQUAL : { Cell ld = NIL;
Cell hVar = inventVar();
if (!failFree(fst(snd(q)))) {
Cell str = mkStr(findText("match fails"));... | false | false | false | false | false | 0 |
tty_ldisc_put(struct tty_ldisc *ld)
{
if (WARN_ON_ONCE(!ld))
return;
put_ldops(ld->ops);
kfree(ld);
} | false | false | false | false | false | 0 |
midgard_object_is_in_tree(MidgardObject *self, guint rootid, guint id)
{
g_return_val_if_fail(self != NULL, FALSE);
if(!MGD_OBJECT_CNC (self)) {
g_warning("Object has no connection pointer!");
return FALSE;
}
const gchar *table =
midgard_core_class_get_table(MIDGARD_DBOBJECT_GET_CLASS(self));
const gchar... | false | false | false | false | false | 0 |
_glcpp_parser_expand_node (glcpp_parser_t *parser,
token_node_t *node,
token_node_t **last)
{
token_t *token = node->token;
const char *identifier;
macro_t *macro;
/* We only expand identifiers */
if (token->type != IDENTIFIER) {
/* We change any COMMA into a COMMA_FINAL to prevent
* it being mis... | false | false | false | false | false | 0 |
clock_t_to_secs (t, sp, sfp)
clock_t t;
time_t *sp;
int *sfp;
{
static long clk_tck = -1;
if (clk_tck == -1)
clk_tck = get_clk_tck ();
*sfp = t % clk_tck;
*sfp = (*sfp * 1000) / clk_tck;
*sp = t / clk_tck;
/* Sanity check */
if (*sfp >= 1000)
{
*sp += 1;
*sfp -= 1000... | false | false | false | false | false | 0 |
mimetype( const KUrl& url )
{
kDebug(7113) << url;
if (!maybeSetRequestUrl(url))
return;
resetSessionSettings();
m_request.method = HTTP_HEAD;
m_request.cacheTag.policy= CC_Cache;
if (proceedUntilResponseHeader()) {
httpClose(m_request.isKeepAlive);
finished();
}
kDebug(7113) << m_mimeTy... | false | false | false | false | false | 0 |
instance_destructor(void *obj)
{
struct ast_rtp_instance *instance = obj;
/* Pass us off to the engine to destroy */
if (instance->data && instance->engine->destroy(instance)) {
ast_debug(1, "Engine '%s' failed to destroy RTP instance '%p'\n", instance->engine->name, instance);
return;
}
if (instance->srtp) ... | false | false | false | false | false | 0 |
visitMachineBasicBlockAfter(const MachineBasicBlock *MBB) {
MBBInfoMap[MBB].regsLiveOut = regsLive;
regsLive.clear();
if (Indexes) {
SlotIndex stop = Indexes->getMBBEndIdx(MBB);
if (!(stop > lastIndex)) {
report("Block ends before last instruction index", MBB);
errs() << "Block ends at " << s... | false | false | false | false | false | 0 |
mt9v022_init(struct i2c_client *client)
{
struct mt9v022 *mt9v022 = to_mt9v022(client);
int ret;
/*
* Almost the default mode: master, parallel, simultaneous, and an
* undocumented bit 0x200, which is present in table 7, but not in 8,
* plus snapshot mode to disable scan for now
*/
mt9v022->chip_control |=... | false | false | false | false | false | 0 |
appendBuffer (Buffer b, Buffer **buffs, int *newSpot, int *curLen)
{
if (*newSpot == *curLen)
{
*curLen += 10 ;
*buffs = xrealloc (*buffs, sizeof(Buffer) * *curLen) ;
}
(*buffs) [(*newSpot)++] = b ;
} | false | false | false | false | false | 0 |
check_client_encoding(char **newval, void **extra, GucSource source)
{
int encoding;
const char *canonical_name;
/* Look up the encoding by name */
encoding = pg_valid_client_encoding(*newval);
if (encoding < 0)
return false;
/* Get the canonical name (no aliases, uniform case) */
canonical_name = pg_encod... | false | false | false | false | false | 0 |
convolve_bytes (
PCONV_INST g, /* ptr to our instance variables */
PBYTE pbDest) /* output buffer */
{
PBYTE pbSrc, pbDestAfter;
int iSrcOffset, iSideOffset, iSum;
int *pMatrix;
int row, col;
pbDestAfter = pbDest + g->dwBytesPerRow;
iSrcOffset = 0;
iSideOffset = g->... | false | false | false | false | false | 0 |
PK11_DigestFinal(PK11Context *context,unsigned char *data,
unsigned int *outLen, unsigned int length)
{
CK_ULONG len;
CK_RV crv;
SECStatus rv;
/* if we ran out of session, we need to restore our previously stored
* state.
*/
PK11_EnterContextMonitor(context);
if (!context->ownSes... | false | false | false | false | false | 0 |
grl_registry_lookup_metadata_key_type (GrlRegistry *registry,
GrlKeyID key)
{
const gchar *key_name;
GParamSpec *key_pspec;
g_return_val_if_fail (GRL_IS_REGISTRY (registry), 0);
key_name = key_id_handler_get_name (®istry->priv->key_id_handler, key);
if (!key_name) {... | false | false | false | false | false | 0 |
FcCacheFindByAddrUnlocked (void *object)
{
int i;
FcCacheSkip **next = fcCacheChains;
FcCacheSkip *s;
if (!object)
return NULL;
/*
* Walk chain pointers one level at a time
*/
for (i = fcCacheMaxLevel; --i >= 0;)
while (next[i] && (char *) object >= ((char *) next[i]->cac... | false | false | false | false | false | 0 |
jxr_set_INTERNAL_CLR_FMT(jxr_image_t image, jxr_color_fmt_t fmt, int channels)
{
switch (fmt) {
case JXR_YONLY:
image->use_clr_fmt = fmt;
image->num_channels = 1;
break;
case JXR_YUV420:
case JXR_YUV422:
case JXR_YUV444:
image->use_clr_... | false | false | false | false | false | 0 |
job_get_queue_with_task_about_to_exit(lListElem *jep,
lListElem *jatep,
lListElem *petep,
const char *qualified_hostname,
... | false | false | false | false | false | 0 |
GetTransferCacheAtIndex(CTransfer*& transferPtr, int index) {
try {
transferPtr = m_TransferCache.at(index);
} catch ( std::out_of_range ) {
transferPtr = NULL;
return -1;
}
return 0;
} | false | false | false | false | false | 0 |
ArchArchiveOpen(const char *archive, const char *mode)
{
struct arfile *ar;
char magic[SARMAG];
ar = emalloc(sizeof(*ar));
ar->fname = estrdup(archive);
ar->mlen = 100;
ar->member = emalloc(ar->mlen);
ar->nametab = NULL;
ar->nametablen = 0;
if ((ar->fp = fopen(ar->fname, mode)) == NULL) {
DEBUGM(ARCH, ("%s... | false | false | false | false | false | 0 |
_gst_array_hasvalue_accumulator (GSignalInvocationHint * ihint,
GValue * return_accu, const GValue * handler_return, gpointer dummy)
{
gpointer array;
array = g_value_get_boxed (handler_return);
if (!(ihint->run_type & G_SIGNAL_RUN_CLEANUP))
g_value_set_boxed (return_accu, array);
if (array != NULL)
... | false | false | false | false | false | 0 |
StringAllocate(lenpos_t len) {
if (len != measure_length) {
return new char[len + 1];
} else {
return 0;
}
} | false | false | false | false | false | 0 |
op_entry_has_offset_access(Op_entry *op_entry, Module_table *mpt)
{
Iv_table *ipt;
Heap_table *hpt;
switch (op_entry->kind) {
case KIND_VAR :
case KIND_FILE :
return FALSE;
break;
case KIND_ARRAY :
return TRUE;
break;
case KIND_INVISIBLE :
ipt = searc... | false | false | false | false | false | 0 |
image_zoom_cb(PixbufRenderer *pr, gdouble zoom, gpointer data)
{
ImageWindow *imd = data;
if (imd->title_show_zoom) image_update_title(imd);
image_state_set(imd, IMAGE_STATE_IMAGE);
image_update_util(imd);
} | false | false | false | false | false | 0 |
push_front(node *n) {
if (first) {
first->prev = n;
n->prev = NULL;
n->next = first;
first = n;
} else {
assert(!last);
first = last = n;
n->prev = n->next = NULL;
}
n->parent = this;
} | false | false | false | false | false | 0 |
evutil_sockaddr_cmp(const struct sockaddr *sa1, const struct sockaddr *sa2,
int include_port)
{
int r;
if (0 != (r = (sa1->sa_family - sa2->sa_family)))
return r;
if (sa1->sa_family == AF_INET) {
const struct sockaddr_in *sin1, *sin2;
sin1 = (const struct sockaddr_in *)sa1;
sin2 = (const struct sockaddr... | false | false | false | false | false | 0 |
art_rgb_bitmap_affine_opaque (art_u8 *dst,
int x0, int y0, int x1, int y1,
int dst_rowstride,
const art_u8 *src,
int src_width, int src_height, int src_rowstride,
art_u32 rgb,
const double affine[6],
ArtFilterLevel level,
ArtAlphaGamma *alphagamma)... | false | false | false | false | false | 0 |
ai_goal_find_dockpoint(int shipnum, int dock_type)
{
int dock_index = -1;
int loop_count = 0;
ship *shipp = &Ships[shipnum];
object *objp = &Objects[shipp->objnum];
// only check 100 points for sanity's sake
while (loop_count < 100)
{
dock_index = model_find_dock_index(Ship_info[shipp->ship_info_index].model... | false | false | false | false | false | 0 |
event_rest(decorators,n,m,type)
/* rest of n/m in the abc */
int n, m,type;
int decorators[DECSIZE];
{
int num, denom;
num = n;
denom = m;
if (v == NULL) {
event_fatal_error("Internal error : no voice allocated");
};
if (v->inchord) v->chordcount = v->chordcount + 1;
if (tuplecount > 0) {
num = n... | false | false | false | false | false | 0 |
scm_evict_ports (int fd)
{
long i;
scm_i_scm_pthread_mutex_lock (&scm_i_port_table_mutex);
for (i = 0; i < scm_i_port_table_size; i++)
{
SCM port = scm_i_port_table[i]->port;
if (SCM_FPORTP (port))
{
scm_t_fport *fp = SCM_FSTREAM (port);
if (fp->fdes == fd)
{
fp->fdes = dup ... | false | false | false | false | false | 0 |
__ext4_journalled_writepage(struct page *page,
unsigned int len)
{
struct address_space *mapping = page->mapping;
struct inode *inode = mapping->host;
struct buffer_head *page_bufs = NULL;
handle_t *handle = NULL;
int ret = 0, err = 0;
int inline_data = ext4_has_inline_data(inode);
struct buffer_head ... | false | false | false | false | false | 0 |
modem_hw_on(const char* pm_base_dir)
{
LOG(LOG_DEBUG, "Enter");
SYSCHECK(modem_hw_off(pm_base_dir));
sleep(1);
SYSCHECK(modem_hw_(pm_base_dir, "power_on", 1));
sleep(1);
SYSCHECK(modem_hw_(pm_base_dir, "reset", 1));
sleep(1);
SYSCHECK(modem_hw_(pm_base_dir, "reset", 0));
sleep(4);
LOG(LOG_DEBUG, "Leave");
re... | false | false | false | false | false | 0 |
do_help()
{
Command *c;
int i, col = 0;
if( targc == 1 )
{
lprintf( stdout, "available commands:\n" );
for( c = cmds; c->name != NULL; c++ )
{
i = strlen( c->name ) + 1;
if( col + i >= MAXCOL )
{
lprintf( stdout, "\n" );
col = 0;
}
col += i;
lprintf(... | false | false | false | false | false | 0 |
symboltype(char *name)
{
GLOBAL *sp;
if (findparam(name) >= 0)
return SYM_PARAM;
if (findlocal(name) >= 0)
return SYM_LOCAL;
sp = findglobal(name);
if (sp) {
if (sp->g_filescope == SCOPE_GLOBAL)
return SYM_GLOBAL;
return SYM_STATIC;
}
return SYM_UNDEFINED;
} | false | false | false | false | false | 0 |
AED_undo_cb(AW_window *aw, AW_CL cd1, AW_CL undo_type){
GB_ERROR error = GB_undo(GLOBAL_gb_main,(GB_UNDO_TYPE)undo_type);
if (error) aw_message(error);
else{
GB_begin_transaction(GLOBAL_gb_main);
GB_commit_transaction(GLOBAL_gb_main);
aed_expose(aw,cd1,0);
}
} | false | false | false | false | false | 0 |
wait_and_poll(struct megasas_instance *instance, struct megasas_cmd *cmd,
int seconds)
{
int i;
struct megasas_header *frame_hdr = &cmd->frame->hdr;
struct fusion_context *fusion;
u32 msecs = seconds * 1000;
fusion = instance->ctrl_context;
/*
* Wait for cmd_status to change
*/
for (i = 0; (i < msecs) && ... | false | false | false | false | false | 0 |
analyze_array()
{
int i;
check_last_first(1);
for(i = 0; i < MAX_ARRAY_DIM; i++)
{
analyze_expr(0, RS_NONE);
if (!PATTERN_is(*current, RS_COMMA))
break;
current++;
}
if (!PATTERN_is(*current, RS_RSQR))
THROW("Missing ']'");
current++;
add_operator(RS_LSQR, i + 2);
} | false | false | false | false | false | 0 |
do_rsync_out (const char *src_orig, const char *remote,
int archive, int deletedest)
{
CLEANUP_FREE char *src = NULL;
src = sysroot_path (src_orig);
if (!src) {
reply_with_perror ("malloc");
return -1;
}
if (!(optargs_bitmask & GUESTFS_RSYNC_OUT_ARCHIVE_BITMASK))
archive = 0;
if ... | false | false | false | false | false | 0 |
SetInteractive()
{
if(!top_level)
return;
bool def=feeder?feeder->IsInteractive():false;
SetInteractive(ResMgr::QueryTriBool("cmd:interactive",0,def));
} | false | false | false | false | false | 0 |
CompileAtomString(RegExpNode **ptr)
{
int c;
for (;;)
{
c=curchar();
if (c == 0 || c == '|' || c == ')' || c == '!')
break;
ptr=CompileElement(ptr);
}
return (ptr);
} | false | false | false | false | false | 0 |
check_temp(char *output_table)
{
if (output_table[0] == 'b' &&
output_table[1] == '2' &&
is_an_integer(output_table + 2))
{
return true;
}
return false;
} | false | false | false | false | false | 0 |
image_loaded (MonoProfiler *prof, MonoImage *image, int result)
{
uint64_t now;
const char *name;
int nlen;
LogBuffer *logbuffer;
if (result != MONO_PROFILE_OK)
return;
name = mono_image_get_filename (image);
nlen = strlen (name) + 1;
logbuffer = ensure_logbuf (
EVENT_SIZE /* event */ +
LEB128_SIZE /* tim... | false | true | false | false | false | 1 |
bnad_vlan_rx_kill_vid(struct net_device *netdev, __be16 proto, u16 vid)
{
struct bnad *bnad = netdev_priv(netdev);
unsigned long flags;
if (!bnad->rx_info[0].rx)
return 0;
mutex_lock(&bnad->conf_mutex);
spin_lock_irqsave(&bnad->bna_lock, flags);
clear_bit(vid, bnad->active_vlans);
bna_rx_vlan_del(bnad->rx_i... | false | false | false | false | false | 0 |
Init(trpgr_Archive *inArch)
{
archive = inArch;
// We're resetting everything. In general, Init should only
// be called once, but it'll work fine if you call it more than once.
lastLoad = None;
lastTile = NULL;
lastLod = -1;
// Need to know the number of terrain LODs
const trpgHeade... | false | false | false | false | false | 0 |
SQLGetPrivateProfileString (LPCSTR lpszSection, LPCSTR lpszEntry,
LPCSTR lpszDefault, LPSTR lpszRetBuffer, int cbRetBuffer,
LPCSTR lpszFilename)
{
char pathbuf[1024];
int len = 0;
/* Check input parameters */
CLEAR_ERROR ();
if (!lpszRetBuffer || !cbRetBuffer)
{
PUSH_ERROR (ODBC_ERROR_INVA... | true | true | false | false | false | 1 |
linedup(xchar ax, xchar ay, xchar bx, xchar by)
{
tbx = ax - bx; /* These two values are set for use */
tby = ay - by; /* after successful return. */
/* sometimes displacement makes a monster think that you're at its
own location; prevent it from throwing and zapping in that case */
if (!tbx... | false | false | false | false | false | 0 |
fd_kill (EV_P_ int fd)
{
ev_io *w;
while ((w = (ev_io *)anfds [fd].head))
{
ev_io_stop (EV_A_ w);
ev_feed_event (EV_A_ (W)w, EV_ERROR | EV_READ | EV_WRITE);
}
} | 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.