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 |
|---|---|---|---|---|---|---|
vect_analyze_data_ref_accesses (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo)
{
unsigned int i;
vec<data_reference_p> datarefs;
struct data_reference *dr;
if (dump_enabled_p ())
dump_printf_loc (MSG_NOTE, vect_location,
"=== vect_analyze_data_ref_accesses ===");
if (loop_vinfo)
... | false | false | false | false | false | 0 |
r200LightModelfv( struct gl_context *ctx, GLenum pname,
const GLfloat *param )
{
r200ContextPtr rmesa = R200_CONTEXT(ctx);
switch (pname) {
case GL_LIGHT_MODEL_AMBIENT:
update_global_ambient( ctx );
break;
case GL_LIGHT_MODEL_LOCAL_VIEWER:
r200UpdateLocalViewer( ctx );
break;
... | false | false | false | false | false | 0 |
handleRead(int rpipe, unsigned int &result)
{
char type = 0;
if (read(rpipe, &type, 1) <= 0) {
if (errno == EAGAIN)
return 0;
return -1;
}
if (type != REPORT_OUT && type != REPORT_ERROR && type != CHILD_END) {
std::cerr << "#### You found a bug from cppcheck.\nThrea... | false | false | false | false | false | 0 |
arch_dma_alloc_attrs(struct device **dev, gfp_t *gfp)
{
if (!*dev)
*dev = &x86_dma_fallback_dev;
*gfp &= ~(__GFP_DMA | __GFP_HIGHMEM | __GFP_DMA32);
*gfp = dma_alloc_coherent_gfp_flags(*dev, *gfp);
if (!is_device_dma_capable(*dev))
return false;
return true;
} | false | false | false | false | false | 0 |
gammln( double X )
// Returns the value ln[gamma(X)] for X.
// The gamma function is defined by the integral gamma(z) = int(0, +inf, t^(z-1).e^(-t)dt).
// When the argument z is an integer, the gamma function is just the familiar factorial
// function, but offset by one, n! = gamma(n + 1).
{
double x, y, tmp, ser;... | false | false | false | false | false | 0 |
gauss_guess(gint n_dat,
const gdouble *x,
const gdouble *y,
gdouble *param,
gboolean *fres)
{
gint i, imax;
param[1] = G_MAXDOUBLE;
param[2] = -G_MAXDOUBLE;
imax = 0;
for (i = 0; i < n_dat; i++) {
param[0] += x[i]/n_dat;
if (param[1] >... | false | false | false | false | false | 0 |
dc_sound_set_kill(int script, int* yield, int* preturnint,
int sound_bank)
{
if (sound_on && sound_bank > 0)
sound_set_kill(sound_bank);
} | false | false | false | false | false | 0 |
isShort(const size_t flags) const
{
return (FrameList.isEmpty()) || !(flags & DSRTypes::HF_renderFullData);
} | false | false | false | false | false | 0 |
fopen_log(const char *fname,const char *access)
{//==================================================
// performs fopen, but produces error message to f_log if it fails
FILE *f;
if((f = fopen(fname,access)) == NULL)
{
if(f_log != NULL)
fprintf(f_log,"Can't access (%s) file '%s'\n",access,fname);
}
return(f);... | false | false | false | false | false | 0 |
scriptlevel( const QwtMmlNode *child ) const
{
int sl = QwtMmlNode::scriptlevel();
QwtMmlNode *sub = subscript();
QwtMmlNode *sup = superscript();
if ( child != 0 && ( child == sup || child == sub ) )
return sl + 1;
else
return sl;
} | false | false | false | false | false | 0 |
mprJoinPath(cchar *path, cchar *other)
{
MprFileSystem *fs;
char *join, *drive, *cp;
int sep;
fs = mprLookupFileSystem(path);
if (other == NULL || *other == '\0' || strcmp(other, ".") == 0) {
return sclone(path);
}
if (isAbsPath(fs, other)) {
if (fs-... | false | false | false | false | false | 0 |
crypt(const QString &text, const QString &key)
{
QByteArray texteEnBytes = text.toUtf8();
QString k = key;
if (key.isEmpty())
k = QCryptographicHash::hash(qApp->applicationName().left(qApp->applicationName().indexOf("_d")).toUtf8(), QCryptographicHash::Sha1);
QByteArray cle = k.toUtf8().toBase64... | false | false | false | false | false | 0 |
__sha1_transform(u32 hash[SHA1_DIGEST_WORDS],
const u32 in[SHA1_BLOCK_WORDS],
u32 W[SHA1_WORKSPACE_WORDS])
{
register u32 a, b, c, d, e, t;
int i;
for (i = 0; i < SHA1_BLOCK_WORDS; i++)
W[i] = cpu_to_be32(in[i]);
for (i = 0; i < 64; i++)
W[i+16] = rol32(W[i+13] ^ W[i+8] ^ W[i+2] ^ ... | false | false | false | false | false | 0 |
opal_graph_print(opal_graph_t *graph)
{
opal_adjacency_list_t *aj_list;
opal_list_item_t *aj_list_item;
opal_graph_edge_t *edge;
opal_list_item_t *edge_item;
char *tmp_str1, *tmp_str2;
bool need_free1, need_free2;
/* print header */
opal_output(0, " Graph ");
opal_outpu... | false | false | false | false | false | 0 |
decrease_mouse_visibility () {
DEBUG3("decrease_mouse_visibility: Entering\n");
/* Lock visual before operation */
VISUAL_MUTEX(global_vwk, VISUAL_MUTEX_LOCK);
mouse_visibility--;
if (mouse_visibility == 0) {
VISUAL_SET_WRITE_MODE(global_vwk, MD_REPLACE);
VISUAL_RESTORE_MOUSE_BG(global_vwk);
}
... | false | false | false | false | false | 0 |
_insert_and_free_related_list (GrlKeyID key,
GList *relkeys_list,
GrlData *data)
{
GList *p = relkeys_list;
while (p) {
grl_data_add_related_keys (data, (GrlRelatedKeys *) p->data);
p = g_list_next (p);
}
g_list_free (relkeys_list);
} | false | false | false | false | false | 0 |
twofish_enc_blk_ctr(void *ctx, u128 *dst, const u128 *src, le128 *iv)
{
be128 ctrblk;
if (dst != src)
*dst = *src;
le128_to_be128(&ctrblk, iv);
le128_inc(iv);
twofish_enc_blk(ctx, (u8 *)&ctrblk, (u8 *)&ctrblk);
u128_xor(dst, dst, (u128 *)&ctrblk);
} | false | false | false | false | false | 0 |
__free_1glb_flds(struct gref_t *grp)
{
/* if using this for local qualifed name will be set to nil */
if (grp->gnam != NULL) __my_free((char *) grp->gnam, strlen(grp->gnam + 1));
grp->gnam = NULL;
/* also free glb ref exprssion - always in malloced memory here */
__free_xtree(grp->glbref);
/* only sized targu is... | false | false | false | false | false | 0 |
tpg_g_interleaved_plane(const struct tpg_data *tpg, unsigned buf_line)
{
switch (tpg->fourcc) {
case V4L2_PIX_FMT_SBGGR8:
case V4L2_PIX_FMT_SGBRG8:
case V4L2_PIX_FMT_SGRBG8:
case V4L2_PIX_FMT_SRGGB8:
case V4L2_PIX_FMT_SBGGR10:
case V4L2_PIX_FMT_SGBRG10:
case V4L2_PIX_FMT_SGRBG10:
case V4L2_PIX_FMT_SRGGB10:
ca... | false | false | false | false | false | 0 |
execute(const QString &fileName)
{
if (fileName.isEmpty()) {
kDebug() << "File name empty!";
return;
}
KDeclarative kdeclarative;
kdeclarative.setDeclarativeEngine(engine);
kdeclarative.initialize();
//binds things like kconfig and icons
kdeclarative.setupBindings();
co... | false | false | false | false | false | 0 |
field_index_eq(const void *p1, const void *p2)
{
FieldIndex *fi1 = (FieldIndex *)p1;
FieldIndex *fi2 = (FieldIndex *)p2;
return (fi1->field == fi2->field) &&
(fi1->klass->type == fi2->klass->type);
} | false | false | false | false | false | 0 |
free_hist_datum(void *datum, const char *file, int line)
{
Stringfree_fl(datum, file, line);
} | false | false | false | false | false | 0 |
quote_blob(char *data, int len, DB_FORMAT_CALLBACK add)
{
#ifdef ODBC_DEBUG_HEADER
fprintf(stderr,"[ODBC][%s][%d]\n",__FILE__,__LINE__);
fprintf(stderr,"\tquote_blob\n");
fflush(stderr);
#endif
int i;
unsigned char c;
//char buffer[8];
(*add)("'", 1);
for (i = 0; i < len; i++)
{
c = (unsigned char)data[i];
i... | false | false | false | false | false | 0 |
jswrap_graphics_stringWidth(JsVar *parent, JsVar *var) {
JsGraphics gfx; if (!graphicsGetFromVar(&gfx, parent)) return 0;
JsVar *customWidth = 0;
int customFirstChar;
if (gfx.data.fontSize == JSGRAPHICS_FONTSIZE_CUSTOM) {
customWidth = jsvObjectGetChild(parent, JSGRAPHICS_CUSTOMFONT_WIDTH, 0);
customFi... | false | false | false | false | false | 0 |
S_NameValueList_FindValue( const char *key,
int entry_count,
EnvisatNameValue **entries,
const char *default_value )
{
int i;
i = S_NameValueList_FindKey( key, entry_count, entries );
if... | false | false | false | false | false | 0 |
_vkMarkThis (edict_t * self, edict_t * other)
{
if (self->client->resp.kickvote == other)
return true;
return false;
} | false | false | false | false | false | 0 |
dirfile(dirname, filename)
char *dirname;
char *filename;
{
char *pathname;
char *qpathname;
int f;
if (dirname == NULL || *dirname == '\0')
return (NULL);
/*
* Construct the full pathname.
*/
pathname = (char *) calloc(strlen(dirname) + strlen(filename) + 2,
sizeof(char));
if (pathname == NULL)
... | false | false | false | false | false | 0 |
garbage_left(enum ARRAY_TYPE isarray, char *scan_length, enum COMPAT_MODE compat)
{
/*
* INFORMIX allows for selecting a numeric into an int, the result is
* truncated
*/
if (isarray == ECPG_ARRAY_NONE && INFORMIX_MODE(compat) && *scan_length == '.')
return false;
if (isarray == ECPG_ARRAY_ARRAY && *scan_le... | false | false | false | false | false | 0 |
check_handlers_1 (tree master, tree_stmt_iterator i)
{
tree type = TREE_TYPE (master);
for (; !tsi_end_p (i); tsi_next (&i))
{
tree handler = tsi_stmt (i);
if (TREE_TYPE (handler) && can_convert_eh (type, TREE_TYPE (handler)))
{
warning_at (EXPR_LOCATION (handler), 0,
"exception of type... | false | false | false | false | false | 0 |
send_fragment(private_task_manager_t *this, bool request,
host_t *src, host_t *dst, fragment_payload_t *fragment)
{
message_t *message;
packet_t *packet;
status_t status;
message = message_create(IKEV1_MAJOR_VERSION, IKEV1_MINOR_VERSION);
/* other implementations seem to just use 0 as message ID, so here we ... | false | false | false | false | false | 0 |
MagickWordStreamLSBRead(WordStreamReadHandle *word_stream,
const unsigned int requested_bits)
{
register unsigned int
remaining_quantum_bits,
quantum;
remaining_quantum_bits = requested_bits;
quantum = 0;
while (remaining_quantum_bits != 0)
{
register unsigned int
word_bits;... | false | false | false | false | true | 1 |
simple_action(Packet *p)
{
if (p->length() > _nbytes) {
p->take(p->length() - _nbytes);
}
return p;
} | false | false | false | false | false | 0 |
httpOpenPassHandler(Http *http)
{
HttpStage *stage;
if ((stage = httpCreateHandler(http, "passHandler", HTTP_STAGE_ALL, NULL)) == 0) {
return MPR_ERR_CANT_CREATE;
}
http->passHandler = stage;
stage->open = openPass;
stage->process = processPass;
/*
PassHandler has an al... | false | false | false | false | false | 0 |
queryMaker()
{
QList<QueryMaker*> list;
foreach( Collections::Collection *collection, m_idCollectionMap )
{
list.append( collection->queryMaker() );
}
return new Collections::AggregateQueryMaker( this, list );
} | false | false | false | false | false | 0 |
select_transform (JXFORM_CODE transform)
/* Silly little routine to detect multiple transform options,
* which we can't handle.
*/
{
#if TRANSFORMS_SUPPORTED
if (transformoption.transform == JXFORM_NONE ||
transformoption.transform == transform) {
transformoption.transform = transform;
} else {
fpri... | false | false | false | false | false | 0 |
reset_conn(conn c)
{
connwant(c, 'r', &dirty);
/* was this a peek or stats command? */
if (c->out_job && c->out_job->r.state == Copy) job_free(c->out_job);
c->out_job = NULL;
c->reply_sent = 0; /* now that we're done, reset this */
c->state = STATE_WANTCOMMAND;
} | false | false | false | false | false | 0 |
SetCurrentWaypoint(uint32 uiPointId)
{
if (!(HasEscortState(STATE_ESCORT_PAUSED))) // Only when paused
{
return;
}
if (uiPointId == CurrentWP->uiId) // Already here
{
return;
}
bool bFoundWaypoint = false;
for (std::list<Escort_Waypoint... | false | false | false | false | false | 0 |
pixCloseSafeBrick(PIX *pixd,
PIX *pixs,
l_int32 hsize,
l_int32 vsize)
{
l_int32 maxtrans, bordsize;
PIX *pixsb, *pixt, *pixdb;
SEL *sel, *selh, *selv;
PROCNAME("pixCloseSafeBrick");
if (!pixs)
return (PIX *)ERROR_PTR("pixs not de... | false | false | false | false | false | 0 |
_elm_win_state_eval(void *data __UNUSED__)
{
Eina_List *l;
Evas_Object *obj;
_elm_win_state_eval_job = NULL;
if (_elm_config->auto_norender_withdrawn)
{
EINA_LIST_FOREACH(_elm_win_list, l, obj)
{
if ((elm_win_withdrawn_get(obj)) ||
((elm_win_iconi... | false | false | false | false | false | 0 |
kvm_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event)
{
vcpu->arch.hflags = 0;
atomic_set(&vcpu->arch.nmi_queued, 0);
vcpu->arch.nmi_pending = 0;
vcpu->arch.nmi_injected = false;
kvm_clear_interrupt_queue(vcpu);
kvm_clear_exception_queue(vcpu);
memset(vcpu->arch.db, 0, sizeof(vcpu->arch.db));
kvm_update_dr01... | false | false | false | false | false | 0 |
findToolbar() const
{
if ( element.attribute("toolbar") == "yes" )
return element;
for (QDomElement e = element.firstChildElement("folder"); !e.isNull();
e = e.nextSiblingElement("folder") )
{
QDomElement result = KBookmarkGroup(e).findToolbar();
if (!result.isNull())
... | false | false | false | false | false | 0 |
update()
{
updateFixture(createShape());
m_interactionOutline = m_activationOutline = QPainterPath();
createOutlines(m_activationOutline, m_interactionOutline);
//propagate update to overlays
if (m_citem)
{
Kolf::Overlay* overlay = m_citem->overlay(false);
if (overlay) //may be 0 if the overlay has not yet be... | false | false | false | false | false | 0 |
make_about_panel() {
{ about_panel = new Fl_Double_Window(345, 180, "About FLUID");
about_panel->color(FL_LIGHT1);
about_panel->selection_color(FL_DARK1);
about_panel->hotspot(about_panel);
{ Fl_Box* o = new Fl_Box(10, 10, 115, 120);
o->image(image_fluid);
} // Fl_Box* o
{ Fl_Box* o = ne... | false | false | false | false | false | 0 |
ali_ircc_probe_53(ali_chip_t *chip, chipio_t *info)
{
int cfg_base = info->cfg_base;
int hi, low, reg;
/* Enter Configuration */
outb(chip->entr1, cfg_base);
outb(chip->entr2, cfg_base);
/* Select Logical Device 5 Registers (UART2) */
outb(0x07, cfg_base);
outb(0x05, cfg_base+1);
/* Read address contro... | false | false | false | false | false | 0 |
Perl_localize(pTHX_ OP *o, I32 lex)
{
dVAR;
PERL_ARGS_ASSERT_LOCALIZE;
if (o->op_flags & OPf_PARENS)
/* [perl #17376]: this appears to be premature, and results in code such as
C< our(%x); > executing in list mode rather than void mode */
#if 0
list(o);
#else
NOOP;
#endif
else {
if ( PL_parser->... | false | false | false | false | true | 1 |
rle_run(float *dc, unsigned char *dc_mask, float avg, unsigned int start, unsigned int width, const float maxerror) {
unsigned int left = start, right = start;
float acc = dc[start];
bool left_stuck = false, right_stuck = false;
do {
const float len = right - left + 1;
if (!left_stuck ... | false | false | false | false | false | 0 |
NewItem(R2 A,const Metric & mm) {
register int n;
if(!Size || Norme2_2(lIntTria[Size-1].x-A)) {
if (Size==MaxSize) ReShape();
lIntTria[Size].t=0;
lIntTria[Size].x=A;
lIntTria[Size].m=mm;
#ifdef DEBUG1
if (SHOW) cout << "SHOW ++ NewItem A" << Size << A << endl;
#endif
n=Size++;
}... | false | false | false | false | false | 0 |
UURemoveTemp (uulist *thefile)
{
if (thefile == NULL)
return UURET_ILLVAL;
if (thefile->binfile) {
if (unlink (thefile->binfile)) {
UUMessage (uulib_id, __LINE__, UUMSG_WARNING,
uustring (S_TMP_NOT_REMOVED),
thefile->binfile,
strerror (uu_errno = errno));
}
_FP_free (thefile->binfile... | false | false | false | false | false | 0 |
dlm_plock_callback(struct plock_op *op)
{
struct file *file;
struct file_lock *fl;
struct file_lock *flc;
int (*notify)(struct file_lock *fl, int result) = NULL;
struct plock_xop *xop = (struct plock_xop *)op;
int rv = 0;
spin_lock(&ops_lock);
if (!list_empty(&op->list)) {
log_print("dlm_plock_callback: op o... | false | false | false | false | false | 0 |
Open( const char * pszFilename, int bUpdateIn)
{
if (bUpdateIn)
{
return FALSE;
}
pszName = CPLStrdup( pszFilename );
// --------------------------------------------------------------------
// Does this appear to be an openair file?
// ---------------------------------------------------... | false | false | false | false | false | 0 |
rdbGenericLoadStringObject(FILE*fp, int encode) {
int isencoded;
uint32_t len;
sds val;
len = rdbLoadLen(fp,&isencoded);
if (isencoded) {
switch(len) {
case REDIS_RDB_ENC_INT8:
case REDIS_RDB_ENC_INT16:
case REDIS_RDB_ENC_INT32:
return rdbLoadIntegerObjec... | false | false | false | false | false | 0 |
cb_undo_activated (GOActionComboStack *a, WorkbookControl *wbc)
{
unsigned n = workbook_find_command (wb_control_get_workbook (wbc), TRUE,
go_action_combo_stack_selection (a));
while (n-- > 0)
command_undo (wbc);
} | false | false | false | false | false | 0 |
__ecereNameSpace__ecere__com__eClass_SetProperty(struct __ecereNameSpace__ecere__com__Class * _class, char * name, int value)
{
void * __ecereTemp1;
struct __ecereNameSpace__ecere__com__ClassProperty * _property = __ecereNameSpace__ecere__com__eClass_FindClassProperty(_class, name);
if(_property)
{
if(_property->Set)
... | false | false | false | false | false | 0 |
majority(potrace_bitmap_t *bm, int x, int y) {
int i, a, ct;
for (i=2; i<5; i++) { /* check at "radius" i */
ct = 0;
for (a=-i+1; a<=i-1; a++) {
ct += BM_GET(bm, x+a, y+i-1) ? 1 : -1;
ct += BM_GET(bm, x+i-1, y+a-1) ? 1 : -1;
ct += BM_GET(bm, x+a-1, y-i) ? 1 : -1;
ct += BM_GET(bm, x-... | false | false | false | false | false | 0 |
TagToPythonString(uint32 tag,int ismac) {
char foo[30];
if ( ismac ) {
sprintf( foo,"<%d,%d>", tag>>16, tag&0xffff );
} else {
foo[0] = tag>>24;
foo[1] = tag>>16;
foo[2] = tag>>8;
foo[3] = tag;
foo[4] = '\0';
}
return( STRING_TO_PY(foo));
} | false | false | false | false | false | 0 |
rtw_aes_decrypt23a(struct rtw_adapter *padapter,
struct recv_frame *precvframe)
{ /* exclude ICV */
struct sta_info *stainfo;
struct rx_pkt_attrib *prxattrib = &precvframe->attrib;
struct security_priv *psecuritypriv = &padapter->securitypriv;
struct sk_buff *skb = precvframe->pkt;
int length;
u8 *pfram... | false | false | false | false | false | 0 |
ColorSlotsWithFreeRegs(SmallVector<int, 16> &SlotMapping,
SmallVector<SmallVector<int, 4>, 16> &RevMap,
BitVector &SlotIsReg) {
if (!(ColorWithRegs || ColorWithRegsOpt) || !VRM->HasUnusedRegisters())
return false;
bool Changed = false;
DEB... | false | false | false | false | false | 0 |
bf_chparent_chparents(Var arglist, Byte next, void *vdata, Objid progr)
{ /* (OBJ what, OBJ|LIST new_parent) */
if (!is_obj_or_list_of_objs(arglist.v.list[2])) {
free_var(arglist);
return make_error_pack(E_TYPE);
}
Objid what = arglist.v.list[1].v.obj;
if (!valid(what)
|| (arglist.v.list[2].type... | false | false | false | false | false | 0 |
setDate( const QDate& date )
{
m_date.setDate( date );
m_refDate = date;
m_weekDayFirstOfMonth = m_date.firstDayOfMonth().dayOfWeek();
m_numDaysThisMonth = m_date.daysInMonth();
m_numDayColumns = m_date.daysInWeek();
} | false | false | false | false | false | 0 |
GVL_get_volname(int id, char *filename)
{
geovol *gvl;
if (NULL == (gvl = gvl_get_vol(id))) {
return (-1);
}
if (0 > gvl->hfile) {
return (-1);
}
G_strcpy(filename, gvl_file_get_name(gvl->hfile));
return (1);
} | false | false | false | false | false | 0 |
H5O_link_copy(const void *_mesg, void *_dest)
{
const H5O_link_t *lnk = (const H5O_link_t *) _mesg;
H5O_link_t *dest = (H5O_link_t *) _dest;
void *ret_value; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
/* Check args */
HDassert(lnk);
if(!dest && NULL == (dest ... | false | false | false | false | false | 0 |
Load(FILE *stream, ReadFunction loadFn,void *arg)
{
size_t i;
char *buf;
Deque D,*d;
if (fread(&D,1,sizeof(Deque),stream) == 0)
return NULL;
d = Create(D.ElementSize);
if (d == NULL)
return NULL;
buf = malloc(D.ElementSize);
if (buf == NULL) {
Finalize(d);
iError.Rai... | false | false | false | false | true | 1 |
handle_input_chunk(input_state * restrict input, char * restrict chunk)
{
client_state *client = input->data;
char *request;
char *data = skip_newlines(chunk);
if (*data == '\0') { /* Ignore empty input lines. */
free(chunk);
input_read_chunk(input, handle_input_chunk);
return;
}
if (client->mode == CLIEN... | false | false | false | false | false | 0 |
CopyAttributeOutCSV(CopyState cstate, char *string,
bool use_quote, bool single_attr)
{
char *ptr;
char *start;
char c;
char delimc = cstate->delim[0];
char quotec = cstate->quote[0];
char escapec = cstate->escape[0];
/* force quoting if it matches null_print (before conversion!) */
if (!use_quo... | false | false | false | false | false | 0 |
gtkalignment_gtk_alignment_set_padding(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
{
ScmObj alignment_scm;
GtkAlignment* alignment;
ScmObj padding_top_scm;
u_int padding_top;
ScmObj padding_bottom_scm;
u_int padding_bottom;
ScmObj padding_left_scm;
u_int padding_left;
ScmObj padding_right_scm;
u_in... | false | false | false | false | false | 0 |
CLG_Initialise(void)
{
clear_subnet(&top_subnet4);
clear_subnet(&top_subnet6);
if (CNF_GetNoClientLog()) {
active = 0;
} else {
active = 1;
}
nodes = NULL;
max_nodes = 0;
n_nodes = 0;
alloced = 0;
alloc_limit = CNF_GetClientLogLimit();
alloc_limit_reached = 0;
} | false | false | false | false | false | 0 |
snd_pcm_meter_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
{
snd_pcm_meter_t *meter = pcm->private_data;
snd_pcm_sframes_t err = snd_pcm_rewind(meter->gen.slave, frames);
if (err > 0 && pcm->stream == SND_PCM_STREAM_PLAYBACK)
meter->rptr = *pcm->appl.ptr;
return err;
} | false | false | false | false | false | 0 |
_dxfIrregShrink(Object object)
{
int i;
Object child;
struct shrinkTask task;
Class class;
class = DXGetObjectClass(object);
switch(class)
{
case CLASS_FIELD:
if (! DXEmptyField((Field)object))
if (! IrregShrinkField((Pointer)&object))
goto error;
break;
... | false | false | false | false | false | 0 |
print_table_r4_ivy(FILE *fp, struct symbol *s)
{
int i, j, k, l, v;
char *s1;
int n0=s->args[0].n;
int n1=s->args[1].n;
int n2=s->args[2].n;
int n3=s->args[3].n;
fprintf(fp, " ((%s . 4) . (\n", s->name);
for (i = 0; i < n0; i++) {
for (j = 0; j < n1; j++) {
for (k = 0; k < n2; k++) {
for (... | false | false | false | false | false | 0 |
get_env(std::string const& var, std::string* value)
{
// This was basically ripped out of wxWindows.
#ifdef _WIN32
# ifdef NO_GET_ENVIRONMENT
return false;
# else
// first get the size of the buffer
DWORD len = ::GetEnvironmentVariable(var.c_str(), NULL, 0);
if (len == 0)
{
// this means... | false | false | false | false | false | 0 |
ascii_to_big5(unsigned char ch)
{
ch -= ' ';
if (ch >= (unsigned char)(127 - ' '))
ch = '@' - ' ';
return ascii_to_big5_table[ch];
} | false | false | false | false | false | 0 |
ddf_LPSolve0(ddf_LPPtr lp,ddf_LPSolverType solver,ddf_ErrorType *err)
/*
The original version of ddf_LPSolve that solves an LP with specified arithimetics.
When LP is inconsistent then *re returns the evidence row.
When LP is dual-inconsistent then *se returns the evidence column.
*/
{
int i;
ddf_boolean found=dd... | false | false | false | false | false | 0 |
cx88_enum_input (struct cx88_core *core,struct v4l2_input *i)
{
static const char * const iname[] = {
[ CX88_VMUX_COMPOSITE1 ] = "Composite1",
[ CX88_VMUX_COMPOSITE2 ] = "Composite2",
[ CX88_VMUX_COMPOSITE3 ] = "Composite3",
[ CX88_VMUX_COMPOSITE4 ] = "Composite4",
[ CX88_VMUX_SVIDEO ] = "S-Video",
[ ... | false | false | false | false | false | 0 |
InitStorage(char *path) {
char *p, *np;
char ns[256], pa[12];
int changed = 0;
/* First, take this opportunity to clear the seek optimisation
table. If we're changing the file name format, none of the
items in it will be valid in any case. */
memset(seekOpt, 0, sizeof seekOpt);
/* Set the path... | false | false | false | false | true | 1 |
murmurhash2(const char *key, size_t len)
{
const uint32_t m = 0x5bd1e995;
const int r = 24;
const uint32_t seed = 0x34a4b627;
// Initialize the hash to a 'random' value
uint32_t h = seed ^ len;
// Mix 4 bytes at a time into the hash
while (len >= 4) {
uint32_t k = *(uint32_t *) key;
k *= m;
k ^= k >> r;... | false | false | false | false | false | 0 |
set_rx_mode(struct nic *nic __unused)
{
int i;
u16 mc_filter[4]; /* Multicast hash filter */
u32 rx_mode;
memset(mc_filter, 0xff, sizeof(mc_filter));
rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys;
if (sdc->mii_if.full_duplex && sdc->flowctrl)
mc_filter[3] |= 0x0200;
for (i = 0; i < 4; i++)
out... | false | false | false | false | false | 0 |
t1_sge_intr_enable(struct sge *sge)
{
u32 en = SGE_INT_ENABLE;
u32 val = readl(sge->adapter->regs + A_PL_ENABLE);
if (sge->adapter->port[0].dev->hw_features & NETIF_F_TSO)
en &= ~F_PACKET_TOO_BIG;
writel(en, sge->adapter->regs + A_SG_INT_ENABLE);
writel(val | SGE_PL_INTR_MASK, sge->adapter->regs + A_PL_ENABLE);... | false | false | false | false | false | 0 |
PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
os << indent << "PickedAxis1: " << this->PickedAxis1 << endl;
os << indent << "PickedAxis2: " << this->PickedAxis2 << endl;
os << indent << "PickedCenter: " << this->PickedCenter << endl;
os << indent << "ResliceCursorAlgorith... | false | false | false | false | false | 0 |
connection_requested_handles (TpConnection *self,
const GArray *handles,
const GError *error,
gpointer user_data,
GObject *weak_object)
{
RequestHandlesContext *context = user_data;
g_object_ref ... | false | false | false | false | false | 0 |
OnMessage(talk_base::Message* /*pmsg*/) {
int waiting_time_ms = 0;
if (capturer_ && capturer_->ReadFrame(false, &waiting_time_ms)) {
PostDelayed(waiting_time_ms, this);
} else {
Quit();
}
} | false | false | false | false | false | 0 |
initTable(void) {
int i;
hashSize = INITIAL_HASH_SIZE;
while (!isPrime(hashSize)) {
hashSize++;
}
buckets = (Sym **) allocate(hashSize * sizeof(Sym *));
for (i = 0; i < hashSize; i++) {
buckets[i] = NULL;
}
numEntries = 0;
} | false | false | false | false | false | 0 |
drm_handle_vblank_events(struct drm_device *dev, unsigned int pipe)
{
struct drm_pending_vblank_event *e, *t;
struct timeval now;
unsigned int seq;
assert_spin_locked(&dev->event_lock);
seq = drm_vblank_count_and_time(dev, pipe, &now);
list_for_each_entry_safe(e, t, &dev->vblank_event_list, base.link) {
if (... | false | false | false | false | false | 0 |
genie_make_ref_row_row (NODE_T * p, MOID_T * dst_mode, MOID_T * src_mode, ADDR_T sp)
{
A68_REF name, new_row, old_row;
A68_ARRAY *new_arr, *old_arr;
A68_TUPLE *new_tup, *old_tup;
int k;
dst_mode = DEFLEX (dst_mode);
src_mode = DEFLEX (src_mode);
name = *(A68_REF *) STACK_ADDRESS (sp);
/* ROWING NIL yields... | false | false | false | false | false | 0 |
Blt_Arg(WamWord arg_no_word, WamWord term_word, WamWord sub_term_word)
{
WamWord *arg_adr;
int func, arity;
int arg_no;
Set_C_Bip_Name("arg", 3);
arg_no = Rd_Positive_Check(arg_no_word) - 1;
arg_adr = Rd_Compound_Check(term_word, &func, &arity);
Unset_C_Bip_Name();
return (unsigned) arg_no < (unsign... | false | false | false | false | false | 0 |
search_operand_body_inner(Block *body)
{
if (body != NULL) {
search_operand_pe(body->pre_head);
if (body->inner != NULL)
insert_assign_stm_for_acc_func_blocks(body->inner);
}
} | false | false | false | false | false | 0 |
tps65090_i2c_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
struct tps65090_platform_data *pdata = dev_get_platdata(&client->dev);
int irq_base = 0;
struct tps65090 *tps65090;
int ret;
if (!pdata && !client->dev.of_node) {
dev_err(&client->dev,
"tps65090 requires platform data or... | false | false | false | false | false | 0 |
pixmap(const QString &elementID)
{
if (elementID.isNull() || d->multipleImages) {
return d->findInCache(elementID, size());
} else {
return d->findInCache(elementID);
}
} | false | false | false | false | false | 0 |
parse_opt (int key, char *arg, struct argp_state *state)
{
char *endptr;
static unsigned char pattern[16];
switch (key)
{
case 'c':
count = ping_cvt_number (arg, 0, 0);
break;
case 'd':
socket_type |= SO_DEBUG;
break;
case 'f':
if (!is_root)
error (EXIT_FAI... | true | true | false | false | false | 1 |
pt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
struct pt_unit *tape = file->private_data;
struct mtop __user *p = (void __user *)arg;
struct mtop mtop;
switch (cmd) {
case MTIOCTOP:
if (copy_from_user(&mtop, p, sizeof(struct mtop)))
return -EFAULT;
switch (mtop.mt_op) {
case MTREW:
... | false | false | false | false | false | 0 |
ap_linexpr0_copy(ap_linexpr0_t* a)
{
ap_linexpr0_t* e;
size_t i;
e = (ap_linexpr0_t*)malloc(sizeof(ap_linexpr0_t));
ap_coeff_init_set(&e->cst,&a->cst);
e->discr = a->discr;
e->size = a->size;
switch (a->discr){
case AP_LINEXPR_DENSE:
e->p.coeff = a->size==0 ? NULL : (ap_coeff_t*)malloc(a->size*size... | false | true | false | false | false | 1 |
removeKey(Dictionary* dict, char* key) {
DictValue* next;
DictValue* toRelease;
next = dict->values;
while(next != NULL) {
if(strcmp(next->key, key) == 0) {
toRelease = next;
if(toRelease->prev) {
toRelease->prev->next = toRelease->next;
} else {
dict->values = toRelease->next;
}
if(toRelea... | false | false | false | false | false | 0 |
PushBackCopy(VP8LBackwardRefs* const refs, int length) {
int size = refs->size;
while (length >= MAX_LENGTH) {
refs->refs[size++] = PixOrCopyCreateCopy(1, MAX_LENGTH);
length -= MAX_LENGTH;
}
if (length > 0) {
refs->refs[size++] = PixOrCopyCreateCopy(1, length);
}
refs->size = size;
} | false | false | false | false | false | 0 |
job_local_read_cleanuptime(const JobId &id,const GMConfig &config,time_t &cleanuptime) {
std::string fname = config.ControlDir() + "/job." + id + sfx_local;
std::string str;
if(!job_local_read_var(fname,"cleanuptime",str)) return false;
cleanuptime=Arc::Time(str).GetTime();
return true;
} | false | false | false | false | false | 0 |
verifyData(V,A a_)
{
return (0!=a_&&QA(a_)&&a_->t==Ct&&a_->r==2)?MSTrue:MSFalse;
} | false | false | false | false | false | 0 |
test_double (void) {
{
gdouble a = 0.0;
a = -10.0;
{
gboolean _tmp0_ = FALSE;
_tmp0_ = TRUE;
while (TRUE) {
gdouble _tmp2_ = 0.0;
Number* z = NULL;
gdouble _tmp3_ = 0.0;
Number* _tmp4_ = NULL;
Number* _tmp5_ = NULL;
gdouble _tmp6_ = 0.0;
gdouble _tmp7_ = 0.0;
if (!_tmp0_)... | false | false | false | false | false | 0 |
der_get_octet_string_ber (const unsigned char *p, size_t len,
heim_octet_string *data, size_t *size)
{
int e;
Der_type type;
Der_class cls;
unsigned int tag, depth = 0;
size_t l, datalen, oldlen = len;
data->length = 0;
data->data = NULL;
while (len) {
e = der_get_tag (p, len, &c... | false | false | false | false | false | 0 |
hx509_certs_iter_f(hx509_context context,
hx509_certs certs,
int (*func)(hx509_context, void *, hx509_cert),
void *ctx)
{
hx509_cursor cursor;
hx509_cert c;
int ret;
ret = hx509_certs_start_seq(context, certs, &cursor);
if (ret)
return ret;
while (1) {
ret = hx509_certs_next_c... | false | false | false | false | false | 0 |
main()
{
srand(time(0));
const size_t length = 1<<24;
timer tim;
LinkedList<int> list(length);
cout << "constructing list of " << length << " random integers... ";
cout.flush();
for(size_t i = 0; i < length; ++i){
list.addFirst( rand() % (length << 1) );
}
cout << "done" << endl;
... | false | false | false | false | false | 0 |
IN_DrawTime(int x, int y, int h, int m, int s)
{
if (h)
{
IN_DrawNumber(h, x, y, 2);
IN_DrTextB(DEH_String(":"), x + 26, y);
}
x += 34;
if (m || h)
{
IN_DrawNumber(m, x, y, 2);
}
x += 34;
if (s)
{
IN_DrTextB(DEH_String(":"), x - 8, y);
IN_D... | false | false | false | false | false | 0 |
recv (void *buf,
size_t n,
int flags,
const ACE_Time_Value *timeout)
{
ssize_t result = 0;
if (this->pre_recv() == -1 && this->leftovers_.length() == 0)
return -1;
if (this->leftovers_.length() > 0)
{
result = ACE_MIN (n,this->leftovers_.length());
... | 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.