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 |
|---|---|---|---|---|---|---|
getFarbEintragOhneDefault(const Str & schluessel,
const Version & version) const {
ListenKnoten * e = getListenEintrag(schluessel,version,false);
if (e->getLaenge() != 3)
throw Fehler("%s",_("Color (r,g,b) expected"));
return Color(e->getDatum(0)->assert_datatype(type_ZahlDatum)->getZahl... | false | false | false | false | false | 0 |
_tpf_persona_store_change_user_details_data_free (gpointer _data) {
TpfPersonaStoreChangeUserDetailsData* _data_;
_data_ = _data;
_g_object_unref0 (_data_->persona);
_g_object_unref0 (_data_->details);
_g_free0 (_data_->field_name);
_g_object_unref0 (_data_->self);
g_slice_free (TpfPersonaStoreChangeUserDetailsD... | false | false | false | false | false | 0 |
SetCaseFileName(const char* fileName)
{
char *endingSlash;
char *path, *newFileName;
int position, numChars;
if ( this->CaseFileName && fileName &&
(!strcmp(this->CaseFileName, fileName)))
{
return;
}
if (this->CaseFileName)
{
delete [] this->CaseFileName;
}
if (fileName)
... | false | false | false | false | false | 0 |
ChildChanged( wxVariant& thisValue, int ind, wxVariant& childValue ) const
{
wxFont& font = wxFontFromVariant(thisValue);
if ( ind == 0 )
{
font.SetPointSize( wxPGVariantToInt(childValue) );
}
else if ( ind == 1 )
{
int fam = childValue.GetLong();
if ( fam < wxDEFAULT ||... | false | false | false | false | false | 0 |
wi_base64_string_from_data(wi_data_t *data) {
static char base64_table[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
wi_mutable_string_t *base64;
const unsigned char *bytes;
unsigned char inbuffer[3], outbuffer[4];
wi_uinteger_t i, length, count, position, remaining;
size_t ... | false | false | false | false | false | 0 |
obj_malloc(struct page *first_page,
struct size_class *class, unsigned long handle)
{
unsigned long obj;
struct link_free *link;
struct page *m_page;
unsigned long m_objidx, m_offset;
void *vaddr;
handle |= OBJ_ALLOCATED_TAG;
obj = (unsigned long)first_page->freelist;
obj_to_location(obj, &m_page, &m_objidx... | false | false | false | false | false | 0 |
get_loop(decode_proto_t *dp)
{
if (lkentry->dlt_linktype == DLT_LOOP)
decode_proto_add(dp, "LOOP");
else
decode_proto_add(dp, "NULL");
add_offset(dp, 4);
get_ip(dp);
} | false | false | false | false | false | 0 |
mlxsw_sp_port_obj_del(struct net_device *dev,
const struct switchdev_obj *obj)
{
struct mlxsw_sp_port *mlxsw_sp_port = netdev_priv(dev);
int err = 0;
switch (obj->id) {
case SWITCHDEV_OBJ_ID_PORT_VLAN:
err = mlxsw_sp_port_vlans_del(mlxsw_sp_port,
SWITCHDEV_OBJ_PORT_VLAN(obj));
break;
case SWIT... | false | false | false | false | false | 0 |
me2(const int , const Particle & inpart,
const ParticleVector & decay,MEOption meopt) const {
// work out which is the fermion and antifermion
int iferm(1),ianti(0);
int itype[2];
for(unsigned int ix=0;ix<2;++ix) {
if(decay[ix]->dataPtr()->CC()) itype[ix] = decay[ix]->id()>0 ? 0:1;
else ... | false | false | false | false | false | 0 |
sbb (mp_limb_t *w, mp_limb_t x, mp_limb_t y, mp_limb_t c)
{
mp_limb_t r;
ASSERT_LIMB (x);
ASSERT_LIMB (y);
ASSERT (c == 0 || c == 1);
r = ref_subc_limb (w, x, y);
return r + ref_subc_limb (w, *w, c);
} | false | false | false | false | false | 0 |
operator()(int m, int n)
{
REPORT
int w = lower_val+1;
if (m>=n)
{
REPORT
int i = lower_val+n-m;
if ( m>nrows_val || n<=0 || i<0 )
Throw(IndexException(m,n,*this));
return store[w*(m-1)+i];
}
else
{
REPORT
int i = lower_val+m-n;
if ( n>nrows_val ||... | false | false | false | false | false | 0 |
find_node(xmlNode *node, const char *name)
{
while (node != NULL) {
if ((!xmlStrcmp(node->name, (const xmlChar *)name))) {
break;
}
node = node->next;
}
return node;
} | false | false | false | false | false | 0 |
sync_end(char *hdr)
{
int tok;
if(hdr) { DEBUG(fprintf(stderr,"%s",hdr)); }
for(;;)
{
tok=get_token();
if((tok==T_END)||(tok==T_EOF)) break;
if(hdr) { DEBUG(fprintf(stderr," %s",yytext)); }
}
if(hdr) { DEBUG(fprintf(stderr,"\n")); }
} | false | true | false | false | false | 1 |
create_branch(
git_reference **branch,
git_repository *repo,
const git_oid *target,
const char *name)
{
git_commit *head_obj = NULL;
git_reference *branch_ref = NULL;
int error;
/* Find the target commit */
if ((error = git_commit_lookup(&head_obj, repo, target)) < 0)
return error;
/* Create the new branc... | false | false | false | false | false | 0 |
main(int argc, char *argv[])
{
char line[255];
char cmd1[] = "pppd /dev/irnet 9600 local ";
char cmd2[] = "noauth nolock connect-delay 0 idle 10 ";
char cmd3[] = "connect \"echo addr \0";
char cmd[255];
char *endp;
char aux[10]= "01235678\"\0";
int i;
FILE *irnet;
/* Start building our command */
... | true | true | false | false | true | 1 |
send_floats(Sock *sock, double *vals, int num)
{
int i;
for(i=0; i<num; i++)
if (send_float(sock, *vals++) == -1)
return -1;
return 0;
} | false | false | false | false | false | 0 |
nodoka_style_draw_handle (DRAW_ARGS, GtkOrientation orientation)
{
NodokaStyle *nodoka_style = NODOKA_STYLE (style);
NodokaColors *colors = &nodoka_style->colors;
cairo_t *cr = nodoka_begin_paint (window, area);
gboolean is_horizontal;
nodoka_sanitize_size (window, &width, &height);
/* Evil hack to work around ... | false | false | false | false | false | 0 |
deflate_rect(unsigned char *p, int x, int y, int w, int h, int bpp, int stride, unsigned char * row_buf, int zbuf_size, int n)
{
int j;
unsigned char * row = p + y*stride + x*bpp;
op[n].valid = 1;
op[n].zstream.next_out = op[n].zbuf;
op[n].zstream.avail_out = zbuf_size;
for (j=0; j<h; j++)
{
... | false | false | false | false | false | 0 |
gst_opengl_glScalev (OOP scaleOOP)
{
GLfloat scale[3];
GLfloat *p;
scale[2] = 1.0;
p = gst_opengl_oop_to_array_2 (scale, scaleOOP, 2, 3);
if (!p)
return GL_INVALID_VALUE;
glScalef (p[0], p[1], p[2]);
return 0;
} | false | false | false | false | false | 0 |
sources() const
{
QStringList trackNames;
foreach ( TrackPtr track, m_playlist->tracks() )
{
trackNames << track->prettyUrl();
}
return trackNames;
} | false | false | false | false | false | 0 |
G3d_isNullValueNum(const void *n, int type)
{
if (type == FCELL_TYPE)
return G_is_f_null_value(n);
else
return G_is_d_null_value(n);
} | false | false | false | false | false | 0 |
smq_force_mapping(struct dm_cache_policy *p,
dm_oblock_t current_oblock, dm_oblock_t new_oblock)
{
unsigned long flags;
struct smq_policy *mq = to_smq_policy(p);
spin_lock_irqsave(&mq->lock, flags);
__force_mapping(mq, current_oblock, new_oblock);
spin_unlock_irqrestore(&mq->lock, flags);
} | false | false | false | false | false | 0 |
gtktexttagtable_gtk_text_tag_table_new(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
{
ScmObj SCM_SUBRARGS[0];
int SCM_i;
SCM_ENTER_SUBR("gtk-text-tag-table-new");
for (SCM_i=0; SCM_i<0; SCM_i++) {
SCM_SUBRARGS[SCM_i] = SCM_ARGREF(SCM_i);
}
{
{
GtkTextTagTable* SCM_RESULT;
SCM_RESULT = gtk_text_tag_table... | false | false | false | false | false | 0 |
comm_command(int tty, unsigned char command, unsigned char argument,
int (*response_callback)(char *, size_t))
{
char cmd[16], response[64];
int cmd_size, response_size, read_timeout = 0;
if (argument > 0) {
snprintf(cmd, sizeof(cmd), "\xE6\xE6\xE6\xE6" "%c" "%c" "%c" "%c",
command, argument, command... | false | false | false | false | false | 0 |
CreateTables( struct state *st, unsigned int nDegrees )
{
double nRadian;
unsigned int iDegree;
st->anSinTable = calloc( nDegrees, sizeof(double) );
st->anCosTable = calloc( nDegrees, sizeof(double) );
for( iDegree=0; iDegree<nDegrees; iDegree++ )
{
nRadian = ( (double)(2*iDegree) / (double)nDegrees ) * M_PI;
... | false | false | false | false | false | 0 |
decode(uint8 code)
{
acc += jedi_table[decstep + code];
if ((acc & ~0x7ff) != 0) // acc is > 2047
acc |= ~0xfff;
else acc &= 0xfff;
decstep += step_adj[code & 7] * 16;
if (decstep < 0) decstep = 0;
if (decstep > 48 * 16) decstep = 48 * 16;
return (acc >> 8) & 0xff;
} | false | false | false | false | false | 0 |
ia32_handle_prefix( x86_insn_t *insn, unsigned int prefixes ) {
insn->prefix = (enum x86_insn_prefix) prefixes & PREFIX_MASK; // >> 20;
if (! (insn->prefix & PREFIX_PRINT_MASK) ) {
/* no printable prefixes */
insn->prefix = insn_no_prefix;
}
/* concat all prefix strin... | false | false | false | false | false | 0 |
canTreatAsByteVector(EVT VT) {
return VT.isVector() && VT.getVectorElementType().getSizeInBits() % 8 == 0;
} | false | false | false | false | false | 0 |
rolloff_put(struct snd_kcontrol *ctl,
struct snd_ctl_elem_value *value)
{
struct oxygen *chip = ctl->private_data;
struct generic_data *data = chip->model_data;
unsigned int i;
int changed;
u8 reg;
mutex_lock(&chip->mutex);
reg = data->ak4396_regs[0][AK4396_CONTROL_2];
if (value->value.enumerated.item... | false | false | false | false | false | 0 |
UTF8_to_UCS4 (const char *& buffer, size_t & length)
{
if(!buffer || !length)
return 0;
UT_UCS4Char ucs4 = g_utf8_get_char_validated (buffer, length);
if ((UT_sint32)ucs4 == -1 || (UT_sint32)ucs4 == -2)
return 0;
const char * p = g_utf8_next_char (buffer);
UT_uint32 diff = p - buffer;
buffer += diff;
len... | false | false | false | false | false | 0 |
DrawReliefRect(int x, int y, int width, int height, struct XObj *xobj,
unsigned int LiC, unsigned int ShadC)
{
XSegment segm[2];
int i;
int j;
width--;
height--;
for (i=0; i<2; i++)
{
j = -1-i;
segm[0].x1 = i+x;
segm[0].y1 = i+y;
segm[0].x2 = i+x;
segm[0].y2 = height+j+y+1;
segm[1].x1 = i+x;
... | false | false | false | false | false | 0 |
conversation (int num_msg, const struct pam_message **msgs,
struct pam_response **resp, void *appdata_ptr)
{
int i;
struct pam_response* responses;
char *password = appdata_ptr;
/* safety check */
if (num_msg <= 0) {
fatal("Internal PAM error: num_msgs <= 0");
return PAM_CONV_ERR;
}
... | false | false | false | false | false | 0 |
build_full_name (CamelEwsStoreSummary *ews_summary, const gchar *fid)
{
gchar *pfid, *dname, *ret;
gchar *pname = NULL;
dname = camel_ews_store_summary_get_folder_name (ews_summary, fid, NULL);
if (!dname)
return NULL;
pfid = camel_ews_store_summary_get_parent_folder_id (ews_summary, fid, NULL);
if (pfid) {
... | false | false | false | false | false | 0 |
check_locale(void)
{
if(param.force_utf8) utf8env = 1;
else
{
const char *cp;
/* Check for env vars in proper oder. */
if((cp = getenv("LC_ALL")) == NULL && (cp = getenv("LC_CTYPE")) == NULL)
cp = getenv("LANG");
if(is_utf8(cp)) utf8env = 1;
}
#if defined(HAVE_SETLOCALE) && defined(LC_CTYPE)
/* To que... | false | false | false | false | false | 0 |
InstrAlloc(int n, int instrument_options)
{
Instrumentation *instr;
/* initialize all fields to zeroes, then modify as needed */
instr = palloc0(n * sizeof(Instrumentation));
if (instrument_options & (INSTRUMENT_BUFFERS | INSTRUMENT_TIMER))
{
bool need_buffers = (instrument_options & INSTRUMENT_BUFFERS) != 0;
... | false | false | false | false | false | 0 |
do_gradient(int width, unsigned long first_colour, unsigned long last_colour)
{
int red1, green1, blue1; // first colour
int red2, green2, blue2; // last colour
int reddiff, greendiff, bluediff; // difference
short redshift = (2 * colour_depth / 3 + colour_depth % 3);
short greenshift = (colour_depth / 3);
... | false | true | false | false | false | 1 |
FcDefaultFini (void)
{
FcChar8 *lang;
FcStrSet *langs;
lang = fc_atomic_ptr_get (&default_lang);
if (lang && fc_atomic_ptr_cmpexch (&default_lang, lang, NULL)) {
free (lang);
}
langs = fc_atomic_ptr_get (&default_langs);
if (langs && fc_atomic_ptr_cmpexch (&default_langs, langs, NULL)) {... | false | false | false | false | false | 0 |
H5Tclose(hid_t type_id)
{
H5T_t *dt; /* Pointer to datatype to close */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE1("e", "i", type_id);
/* Check args */
if(NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
HGOTO_ER... | false | false | false | false | false | 0 |
fill_cmd_get_configurable_commands (uint8_t channel_number,
uint8_t net_fn,
uint8_t operation,
uint8_t lun,
uint32_t net_fn_data,
fiid_obj_t obj_cmd_rq)
{
if (!IPMI_CHANNEL_NUMBER_VALID (channel_number)
|| !IPMI_NET_FN_VALID (net_fn)
|| !IPMI_FIRMWARE_FIREWALL_COMMA... | false | false | false | false | false | 0 |
flmStartBackgrndIxThrds(
FDB * pDb)
{
RCODE rc = FERR_OK;
FLMBOOL bStartedAutoTrans;
FLMUINT uiLoop;
IXD * pIxd;
bStartedAutoTrans = FALSE;
if( RC_BAD( rc = fdbInit( pDb, FLM_READ_TRANS,
FDB_TRANS_GOING_OK, 0, &bStartedAutoTrans)))
{
goto Exit;
}
for( uiLoop = 0, pIxd = pDb->pDict->pIxdTbl;
... | false | false | false | false | false | 0 |
guiItem( StandardItem ui_enum )
{
switch (ui_enum ) {
case Ok : return ok();
case Cancel : return cancel();
case Yes : return yes();
case No : return no();
case Discard : return discard();
case Save : return save();
case DontSave : return dontSave();
case SaveAs : return save... | false | false | false | false | false | 0 |
drawable_del_ex(Drawable *dr, GF_Compositor *compositor)
{
StrikeInfo2D *si;
Bool is_reg = 0;
DRInfo *dri, *cur;
BoundInfo *bi, *_cur;
/*remove node from all visuals it's on*/
dri = dr->dri;
while (dri) {
is_reg = compositor ? gf_sc_visual_is_registered(compositor, dri->visual) : 0;
bi = dri->current_bou... | false | false | false | false | false | 0 |
store_temp_crit_hyst(struct device *dev, struct device_attribute
*devattr, const char *buf, size_t count)
{
int temp, index = to_sensor_dev_attr(devattr)->index;
struct tmp401_data *data = tmp401_update_device(dev);
long val;
u8 reg;
if (IS_ERR(data))
return PTR_ERR(data);
if (kstrtol(buf, 10, &val))
retur... | false | false | false | false | false | 0 |
in_packet(
struct sl811 *sl811,
struct sl811h_ep *ep,
struct urb *urb,
u8 bank,
u8 control
)
{
u8 addr;
u8 len;
void __iomem *data_reg;
/* avoid losing data on overflow */
len = ep->maxpacket;
addr = SL811HS_PACKET_BUF(bank == 0);
if (!(control & SL11H_HCTLMASK_ISOCH)
&& usb_gettoggle(urb->de... | false | false | false | false | false | 0 |
CORD_ncmp(CORD x, size_t x_start, CORD y, size_t y_start, size_t len)
{
CORD_pos xpos;
CORD_pos ypos;
register size_t count;
register long avail, yavail;
CORD_set_pos(xpos, x, x_start);
CORD_set_pos(ypos, y, y_start);
for(count = 0; count < len;) {
if (!CORD_pos_valid(xpos)) {
... | false | false | false | false | false | 0 |
xsh_mdark_measure_ron(xsh_pre* preFrame,cpl_parameterlist* parameters)
{
int ron_llx=-1;
int ron_lly=-1;
int ron_urx=-1;
int ron_ury=-1;
//int ron_nsamp=100;
//int ron_hsize=4;
int sx=0;
int sy=0;
check(ron_llx=xsh_parameters_get_int(parameters,"xsh_mdark","ron_llx"));
check(ron_lly=xsh_parameter... | false | false | false | false | false | 0 |
Process(float *Inp, int InpLen)
{ int i,lev,bit,Flag;
for(i=0; i<InpLen; i++)
{ lev=Inp[i]>0;
bit=(lev^(PrevLev&RxDiff))^RxInvert; PrevLev=lev;
ShiftReg=(ShiftReg>>1)|(bit<<7); BitCount+=1; Flag=0;
if(bit) Count1s+=1; else
{ if(Count1s>=7) Len=(-1);
else if(Count1s==6) Flag=1;
else if(C... | false | false | false | false | false | 0 |
unmount_fuse_locked(const char *mnt, int quiet, int lazy)
{
char *copy;
const char *last;
int res;
if (getuid() != 0) {
res = may_unmount(mnt, quiet);
if (res == -1)
return -1;
}
copy = strdup(mnt);
if (copy == NULL) {
fprintf(stderr, "%s: failed to allocate memory\n", progname);
return -1;
}
res... | false | false | false | false | false | 0 |
krb5_rc_io_move(krb5_context context, krb5_rc_iostuff *new1,
krb5_rc_iostuff *old)
{
#if defined(_WIN32) || defined(__CYGWIN__)
char *new_fn = NULL;
char *old_fn = NULL;
off_t offset = 0;
krb5_error_code retval = 0;
/*
* Initial work around provided by Tom Sanfilippo to work aro... | false | false | false | false | false | 0 |
gst_value_serialize_any_list (const GValue * value, const gchar * begin,
const gchar * end)
{
guint i;
GArray *array = value->data[0].v_pointer;
GString *s;
GValue *v;
gchar *s_val;
guint alen = array->len;
/* estimate minimum string length to minimise re-allocs in GString */
s = g_string_sized_new... | false | false | false | false | false | 0 |
TIFFScanlineSize64(TIFF* tif)
{
static const char module[] = "TIFFScanlineSize64";
TIFFDirectory *td = &tif->tif_dir;
uint64 scanline_size;
if (td->td_planarconfig==PLANARCONFIG_CONTIG)
{
if ((td->td_photometric==PHOTOMETRIC_YCBCR)&&
(td->td_samplesperpixel==3)&&
(!isUpSampled(tif)))
{
uint16 yc... | false | false | false | false | false | 0 |
s_PNGPE_process(stream_state * st, stream_cursor_read * pr,
stream_cursor_write * pw, bool last)
{
stream_PNGP_state *const ss = (stream_PNGP_state *) st;
int bpp = ss->bpp;
int status = 0;
while (pr->ptr < pr->limit) {
uint count;
if (ss->row_left == 0) {
/... | false | true | false | false | false | 1 |
gen_cb(int p, int n, void *param) {
char c=' ';
if (p == 0) c='.';
if (p == 1) c='+';
if (p == 2) c='*';
if (p == 3) c='\n';
BIO_write(bio_err, &c, 1);
(void)BIO_flush(bio_err);
return;
} | false | false | false | false | false | 0 |
ap_linexpr0_is_integer(ap_linexpr0_t* a, size_t intdim)
{
size_t i;
ap_coeff_t* coeff;
ap_dim_t dim;
switch (a->discr){
case AP_LINEXPR_DENSE:
for (dim=intdim; dim<a->size; dim++){
if (! ap_coeff_zero(&a->p.coeff[dim]))
return false;
}
break;
case AP_LINEXPR_SPARSE:
ap_linexpr0_Forea... | false | false | false | false | false | 0 |
gf_mpd_parse_program_info(GF_MPD *mpd, GF_XMLNode *root)
{
GF_MPD_ProgramInfo *info;
u32 att_index, child_index;
GF_XMLAttribute *att;
GF_XMLNode *child;
GF_SAFEALLOC(info, GF_MPD_ProgramInfo);
if (!info) return GF_OUT_OF_MEM;
att_index = 0;
while (1) {
att = gf_list_get(root->attributes, att_index);
if (... | false | false | false | false | false | 0 |
local_and_domain_part_escaped(const char *username,
const char *defdomain,
char **local_ret,
char **domain_ret)
{
if ((*local_ret=local_part_escaped(username)) == NULL)
return 0;
if ((*domain_ret=domain_part_escaped(username, defdomain)) == NULL)
{
free(*local_ret);
return 0;
}
return 1;
... | true | true | false | false | true | 1 |
AcpiDbExecuteMethod (
ACPI_DB_METHOD_INFO *Info,
ACPI_BUFFER *ReturnObj)
{
ACPI_STATUS Status;
ACPI_OBJECT_LIST ParamObjects;
ACPI_OBJECT Params[ACPI_DEBUGGER_MAX_ARGS + 1];
UINT32 i;
ACPI_FUNCTION_TRACE (DbExecuteMethod);
... | false | false | false | false | false | 0 |
addressbook_custom_attr_edit()
{
if (!custom_attr_window.window)
custom_attr_window_create();
manage_window_set_transient(GTK_WINDOW(custom_attr_window.window));
gtk_widget_grab_focus(custom_attr_window.ok_btn);
custom_attr_window_load_list(prefs_common.addressbook_custom_attributes);
gtk_widget_show(custom_... | false | false | false | false | false | 0 |
_pickle_Unpickler___init___impl(UnpicklerObject *self, PyObject *file, int fix_imports, const char *encoding, const char *errors)
/*[clinic end generated code: output=b9ed1d84d315f3b5 input=30b4dc9e976b890c]*/
{
_Py_IDENTIFIER(persistent_load);
/* In case of multiple __init__() calls, clear previous content. *... | false | false | false | false | false | 0 |
LI33(V261)
object V261;
{ VMB33 VMS33 VMV33
goto TTL;
TTL:;
{register object V262;
V262= Cnil;
V262= coerce_to_string((V261));
{register object V263;
register object V264;
V263= one_minus((((object)VV[73])->s.s_dbind));
base[0]= (V263);
vs_top=(vs_base=base+0)+1;
(void) (*Lnk217)();
vs_top=sup;
V264= vs_b... | false | false | false | false | false | 0 |
handle_io_busy(int ndx)
{
/* Probably an answer */
int res;
res = relay_reply(&busy_workers[ndx]);
if (res < 0) {
/* Bad worker */
if (busy_workers[ndx].que_size) {
restart_worker(&busy_workers[ndx]);
start_que_request(&busy_workers[ndx]);
return 0;
} else {
kill_worker(&busy_work... | false | false | false | false | false | 0 |
rocker_tlv_ok(const struct rocker_tlv *tlv, int remaining)
{
return remaining >= (int) ROCKER_TLV_HDRLEN &&
tlv->len >= ROCKER_TLV_HDRLEN &&
tlv->len <= remaining;
} | false | false | false | false | false | 0 |
alpha_map_clone (const AlphaMap *a_map)
{
AlphaMap *alpha_map;
AlphaRange *range;
alpha_map = alpha_map_new ();
if (!alpha_map)
return NULL;
for (range = a_map->first_range; range; range = range->next) {
if (alpha_map_add_range (alpha_map, range->begin, range->end) != 0) {
... | false | false | false | false | false | 0 |
drm_legacy_ctxbitmap_cleanup(struct drm_device * dev)
{
if (!drm_core_check_feature(dev, DRIVER_KMS_LEGACY_CONTEXT) &&
drm_core_check_feature(dev, DRIVER_MODESET))
return;
mutex_lock(&dev->struct_mutex);
idr_destroy(&dev->ctx_idr);
mutex_unlock(&dev->struct_mutex);
} | false | false | false | false | false | 0 |
stream_array_from_fd_set(zval *stream_array, fd_set *fds TSRMLS_DC)
{
zval **elem, **dest_elem;
php_stream *stream;
HashTable *new_hash;
php_socket_t this_fd;
int ret = 0;
if (Z_TYPE_P(stream_array) != IS_ARRAY) {
return 0;
}
ALLOC_HASHTABLE(new_hash);
zend_hash_init(new_hash, zend_hash_num_elements(Z_ARRVA... | false | false | false | false | false | 0 |
iax_pvt_callid_get(int callno)
{
if (iaxs[callno]->callid) {
return ast_callid_ref(iaxs[callno]->callid);
}
return NULL;
} | false | false | false | false | false | 0 |
get_user_icon (gchar *path, gint width, gint height)
{
GdkPixbuf *pix_return=NULL;
GdkPixbuf *pix_return_tmp=NULL;
if (debug) printf ("get_user_icon: path: %s\n", path);
if (g_file_test (path, G_FILE_TEST_EXISTS)) {
GError *error=NULL;
pix_return_tmp=gdk_pixbuf_new_from_file (path, &error);
... | false | false | false | false | false | 0 |
substitutivityRule(const Expr& e,
const int changed,
const Theorem& thm)
{
// Get the arity of the expression
int size = e.arity();
// The changed must be within the arity
DebugAssert(size >= changed, "Bad call ... | false | false | false | false | false | 0 |
kdbDelTrie(Trie *trie, CloseMapper close_backend)
{
int i;
if (trie==NULL) return 0;
for (i=0;i<MAX_UCHAR;i++) {
if (trie->text[i]!=NULL) {
kdbDelTrie(trie->childs[i],close_backend);
if (trie->value[i])
close_backend(trie->value[i]);
free(trie->text[i]);
}
}
if (trie->empty_value)
close_backend(... | false | false | false | false | false | 0 |
dib7000pc_detection(struct i2c_adapter *i2c_adap)
{
u8 *tx, *rx;
struct i2c_msg msg[2] = {
{.addr = 18 >> 1, .flags = 0, .len = 2},
{.addr = 18 >> 1, .flags = I2C_M_RD, .len = 2},
};
int ret = 0;
tx = kzalloc(2*sizeof(u8), GFP_KERNEL);
if (!tx)
return -ENOMEM;
rx = kzalloc(2*sizeof(u8), GFP_KERNEL);
if (... | false | false | false | false | false | 0 |
Resolve(const char *defp,const char *ser,const char *pr)
{
int m=STALL;
if(!resolver)
{
peer.unset();
if(proxy)
resolver=new Resolver(proxy,proxy_port,defp);
else
resolver=new Resolver(hostname,portname,defp,ser,pr);
if(!resolver)
return MOVED;
resolver->Roll();
m=MOV... | false | false | false | false | false | 0 |
graph_selected(GwySelection *selection, gint hint, FractalControls *controls)
{
FractalArgs *args;
gint nselections;
gdouble sel[2];
g_return_if_fail(hint <= 0);
nselections = gwy_selection_get_data(selection, NULL);
gwy_selection_get_object(selection, 0, sel);
args = controls->args;
... | false | false | false | false | false | 0 |
parse_comparison(CdlExpression expr)
{
CYG_REPORT_FUNCNAME("parse_comparison");
parse_shift(expr);
while ((T_LessThan == current_token) || (T_LessEqual == current_token) ||
(T_GreaterThan == current_token) || (T_GreaterEqual == current_token)) {
CdlSubexpression subexpr;
... | false | false | false | false | false | 0 |
extend() {
std::sort(heap_,heap_+filled_,bincomp_rev);
int solid = 0;
for(int i=1; i<filled_; i++)
if (!heap_[i].within(heap_[solid]))
heap_[++solid] = heap_[i];
filled_ = solid+1;
if (2*filled_>size_) {
size_ <<= 1;
heap_ = (bin64_t*) realloc(heap_,size_*sizeof(b... | false | false | false | false | false | 0 |
sweep_proxy_list(void)
{
if (!managed_proxy_list)
return;
assert_unconfigured_count_ok();
SMARTLIST_FOREACH_BEGIN(managed_proxy_list, managed_proxy_t *, mp) {
if (mp->marked_for_removal) {
SMARTLIST_DEL_CURRENT(managed_proxy_list, mp);
managed_proxy_destroy(mp, 1);
}
} SMARTLIST_FOREACH_... | false | false | false | false | false | 0 |
thrd_done_cleanup(register struct thread_t *parthp)
{
free_thd_stuff(__cur_thd);
/* move up and continue in parent */
parthp->thofscnt -= 1;
/* one thread of fork/join done - link it out after redundant cnt dec */
if (__cur_thd->thleft != NULL)
__cur_thd->thleft->thright = __cur_thd->thright;
/* adjust parent'... | false | false | false | false | false | 0 |
log_from_idx(uint32_t idx, char *logbuf)
{
char *logptr;
uint16_t msglen;
logptr = logbuf + idx;
/*
* A length == 0 record is the end of buffer marker.
* Wrap around and return the message at the start of
* the buffer.
*/
msglen = USHORT(logptr + OFFSET(log_len));
if (!msglen)
logptr = logbuf;
re... | false | false | false | false | false | 0 |
gnc_dense_cal_realize (GtkWidget *widget, gpointer user_data)
{
GncDenseCal *dcal;
g_return_if_fail(widget != NULL);
g_return_if_fail(GNC_IS_DENSE_CAL (user_data));
dcal = GNC_DENSE_CAL(user_data);
recompute_x_y_scales(dcal);
gdc_reconfig(dcal);
gtk_style_set_background(widget->style, wid... | false | false | false | false | false | 0 |
builtin_char STDVAR
{
Function F = (Function) cd;
BADARGS(2, 2, " handle");
CHECKVALIDITY(builtin_char);
F(argv[1]);
return TCL_OK;
} | false | false | false | false | false | 0 |
ci_update_uvd_dpm(struct radeon_device *rdev, bool gate)
{
struct ci_power_info *pi = ci_get_pi(rdev);
u32 tmp;
if (!gate) {
if (pi->caps_uvd_dpm ||
(rdev->pm.dpm.dyn_state.uvd_clock_voltage_dependency_table.count <= 0))
pi->smc_state_table.UvdBootLevel = 0;
else
pi->smc_state_table.UvdBootLevel =
... | false | false | false | false | false | 0 |
gnutls_x509_crl_get_authority_key_id (gnutls_x509_crl_t crl, void *ret,
size_t * ret_size,
unsigned int *critical)
{
int result, len;
gnutls_datum_t id;
ASN1_TYPE c2 = ASN1_TYPE_EMPTY;
if (crl == NULL)
{
gnutls_assert ();
... | false | false | false | false | false | 0 |
ec_i2c_parse_response(const u8 *buf, struct i2c_msg i2c_msgs[],
int *num)
{
const struct ec_response_i2c_passthru *resp;
const u8 *in_data;
int i;
in_data = buf + sizeof(struct ec_response_i2c_passthru);
resp = (const struct ec_response_i2c_passthru *)buf;
if (resp->i2c_status & EC_I2C_STATUS_TIMEOUT)
re... | false | true | false | false | false | 1 |
parse_ssi_fail_resp(fetion_account *ac, const gchar *response)
{
xmlnode *root;
xmlnode *node;
Verification *ver;
gchar *pos;
ver = fetion_verification_create();
if (!(pos = strstr(response, "\r\n\r\n"))) {
return HYBRID_ERROR;
}
pos += 4;
root = xmlnode_... | false | false | false | false | false | 0 |
xmlSecDSigReferenceCtxDebugDump(xmlSecDSigReferenceCtxPtr dsigRefCtx, FILE* output) {
xmlSecAssert(dsigRefCtx != NULL);
xmlSecAssert(dsigRefCtx->dsigCtx != NULL);
xmlSecAssert(output != NULL);
if(dsigRefCtx->dsigCtx->operation == xmlSecTransformOperationSign) {
fprintf(output, "= REFERENCE CALCULA... | false | false | false | false | false | 0 |
WrCmd (uint32_t cmd)
{
USB_DEVINTCLR = CCEMTY_INT;
USB_CMDCODE = cmd;
while ((USB_DEVINTST & (CCEMTY_INT | DEV_STAT_INT)) == 0);
} | false | false | false | false | false | 0 |
isInstanceReferenceWord(int wordIndex) {
return isNounWord(wordIndex) || isAdjectiveWord(wordIndex) || isAllWord(wordIndex)
|| isLiteralWord(wordIndex) || isItWord(wordIndex) || isThemWord(wordIndex) || isPronounWord(wordIndex);
} | false | false | false | false | false | 0 |
requestDictionary(const char *szLang)
{
if (!loadDictionaryForLanguage (szLang))
{
// handle a shortened version of the language tag: en_US => en
std::string shortened_dict (szLang);
size_t uscore_pos;
if ((uscore_pos = shortened_dict.rfind ('_')) != ((size_t)-1)) {
shortened_dict = shortened_dic... | false | false | false | false | false | 0 |
cmd_brief_close()
{
int i;
if (Cmd_brief_inited) {
cmd_brief_stop_anim();
generic_anim_unload(&Cur_Anim);
for (i=0; i<Cur_cmd_brief->num_stages; i++) {
if (Cur_cmd_brief->stage[i].wave >= 0)
audiostream_close_file(Cur_cmd_brief->stage[i].wave, 0);
}
// so that the same ani will reload properly upo... | false | false | false | false | false | 0 |
static_conflict_find (int v1, int v2,
int v3, int v, int f, static_polytope *polytope)
{
static_face *face;
static_vertex *vertex;
int offset_f, offset_v;
int mix;
/***************************************************
* v1, v2, v3 must be orientated counter-clockwise *
* when seen from the outside of the polytope! ... | false | false | false | false | false | 0 |
test_refs_iterator__list(void)
{
git_reference_iterator *iter;
git_vector output;
git_reference *ref;
int error;
size_t i;
cl_git_pass(git_vector_init(&output, 32, &refcmp_cb));
cl_git_pass(git_reference_iterator_new(&iter, repo));
do {
error = git_reference_next(&ref, iter);
cl_assert(error == 0 || error... | false | false | false | false | false | 0 |
pixel_resize(psdf_binary_writer * pbw, int width, int num_components,
int bpc_in, int bpc_out)
{
gs_memory_t *mem = pbw->dev->v_memory;
const stream_template *templat;
stream_1248_state *st;
int code;
if (bpc_out == bpc_in)
return 0;
if (bpc_in != 8) {
static const ... | false | false | false | false | false | 0 |
idbm_discovery_write(discovery_rec_t *rec)
{
FILE *f;
char *portal;
int rc = 0;
if (rec->type > 1)
return ISCSI_ERR_INVAL;
portal = malloc(PATH_MAX);
if (!portal) {
log_error("Could not alloc portal");
return ISCSI_ERR_NOMEM;
}
rc = idbm_lock();
if (rc)
goto free_portal;
snprintf(portal, PATH_MAX,... | false | false | false | false | false | 0 |
createServer(void)
{
// GNASH_REPORT_FUNCTION;
short port;
if (_port) {
port = _port;
} else {
port = DEFAULTPORT;
}
return createServer(port);
} | false | false | false | false | false | 0 |
drm_legacy_addmap(struct drm_device * dev, resource_size_t offset,
unsigned int size, enum drm_map_type type,
enum drm_map_flags flags, struct drm_local_map **map_ptr)
{
struct drm_map_list *list;
int rc;
rc = drm_addmap_core(dev, offset, size, type, flags, &list);
if (!rc)
*map_ptr = list->map;
... | false | false | false | false | false | 0 |
get_relationship_chosen() const
{
sharedptr<Relationship> result;
Glib::RefPtr<Gtk::TreeSelection> refTreeSelection = m_treeview->get_selection();
if(refTreeSelection)
{
Gtk::TreeModel::iterator iter = refTreeSelection->get_selected();
if(iter)
{
Gtk::TreeModel::Row row = *iter;
result ... | false | false | false | false | false | 0 |
xz_lzma_bidder_init(struct archive_read_filter *self)
{
static const size_t out_block_size = 64 * 1024;
void *out_block;
struct private_data *state;
int ret;
state = (struct private_data *)calloc(sizeof(*state), 1);
out_block = (unsigned char *)malloc(out_block_size);
if (state == NULL || out_block == NULL) {
... | false | false | false | false | false | 0 |
getDocLayout(void) const
{
const fl_ContainerLayout * pMyContainer = static_cast<const fl_ContainerLayout *>(this);
while(pMyContainer->getContainerType() != FL_CONTAINER_DOCSECTION && pMyContainer->myContainingLayout())
{
pMyContainer = pMyContainer->myContainingLayout();
}
return static_cast<const fl_DocSectio... | false | false | false | false | false | 0 |
smartlist_del_keeporder(smartlist_t *sl, int idx)
{
tor_assert(sl);
tor_assert(idx>=0);
tor_assert(idx < sl->num_used);
--sl->num_used;
if (idx < sl->num_used)
memmove(sl->list+idx, sl->list+idx+1, sizeof(void*)*(sl->num_used-idx));
} | false | false | false | false | false | 0 |
clear_stream(const bool release)
{
DEBUG_MSG("DataPool::clear_stream()\n");
DEBUG_MAKE_INDENT(3);
if(fstream)
{
GCriticalSectionLock lock1(&class_stream_lock);
GP<OpenFiles_File> f=fstream;
if(f)
{
GCriticalSectionLock lock2(&(f->stream_lock));
fstream=0;
if(release)
Op... | false | false | false | false | false | 0 |
wsp_convert_http_status_to_wsp_status(long http_status) {
long hundreds, singles;
/*
* The table is regular, and can be expected to stay regular in
* future versions of WSP. The status value is read as XYY,
* so that X is the first digit and Y is the value of the
* second two digits. This is encoded as a h... | 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.