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 |
|---|---|---|---|---|---|---|
loadSugarDef(CTX ctx, kLang *lang, struct sugardef_t *sd, struct opdef_t *od)
{
while(sd->key != NULL) {
kSugar *sgr = new_(Sugar);
sgr->sugar = sd->sugar;
KNH_SETv(ctx, sgr->key, new_T(sd->key));
KNH_SETv(ctx, sgr->rules, new_Array0(ctx, 0));
tenv_t tenvbuf = {
0,/*uline*/
sgr->rules,
{sd->rule}, s... | false | false | false | false | false | 0 |
wantdoor(x, y, distance)
int x, y;
genericptr_t distance;
{
int ndist;
if (*(int*)distance > (ndist = distu(x, y))) {
gx = x;
gy = y;
*(int*)distance = ndist;
}
} | false | false | false | false | false | 0 |
GetNextFeature()
{
if (fp == NULL || bEOF == TRUE || poInterestLayer == NULL)
return FALSE;
Read();
return TRUE;
} | false | false | false | false | false | 0 |
t_tasks2(void) {
uintptr_t ntasks;
int result;
char *p;
isc_event_t *event;
unsigned int workers;
isc_result_t isc_result;
T2_manager = NULL;
T2_done = 0;
T2_nprobs = 0;
T2_nfails = 0;
T2_ntasks = 0;
workers = 2;
p = t_getenv("ISC_TASK_WORKERS");
if (p != NULL)
workers = atoi(p);
if (workers ... | false | false | false | false | true | 1 |
path_excluded(const char *truepath) {
string_t *pnext;
int result;
result=0;
pnext=__instw.exclude;
while(pnext!=NULL) {
if(strstr(truepath,pnext->string)==truepath) {
result=1;
break;
}
pnext=pnext->next;
}
return result;
} | false | false | false | false | false | 0 |
insert_(node *p, node *q, boolean contin_)
{
/* put p and q together and iterate info. on resulting tree */
double x=0.0, oldlike;
hookup(p->next->next, q->back);
hookup(p->next, q);
x = q->v / 2.0;
p->v = 0.0;
p->back->v = 0.0;
p->next->v = x;
p->next->back->v = x;
p->next->next->back->v = x;
p->... | false | false | false | false | false | 0 |
DestructCloningTable(FlexCloningTable *pTopTbl)
{
FlexCloningTable *pNextTbl = NULL;
FlexCloningTable *pCurrTbl = NULL;
if(pTopTbl != NULL){
pCurrTbl = pTopTbl;
while(pCurrTbl != NULL){
pNextTbl = pCurrTbl->next;
destruct_IntSet(pCurrTbl->groupMTSet);
free(pCurrTbl);
pCurrTbl = pNextT... | false | false | false | false | false | 0 |
read_section(stl_list(DnsRR)& section, int count, message_buff &buff, int &pos) {
while (--count >= 0)
section.push_back(read_rr(buff, pos, (OPCODE == OPCODE_UPDATE) ? 1 : 0));
} | false | false | false | false | false | 0 |
iso_get_track_info(UINT32 tn, UINT32 * ctrl, UINT32 * idx, UINT32 * fad){
if(tn < iso_track_first || tn > iso_track_last)
return(1);
*fad = iso_track[tn-1].fad;
*ctrl = iso_track[tn-1].ctrl;
*idx = iso_track[tn-1].idx;
return(0);
} | false | false | false | false | false | 0 |
set_addressing(ide_drive_t *drive, int arg)
{
if (arg < 0 || arg > 2)
return -EINVAL;
if (arg && ((drive->hwif->host_flags & IDE_HFLAG_NO_LBA48) ||
ata_id_lba48_enabled(drive->id) == 0))
return -EIO;
if (arg == 2)
arg = 0;
if (arg)
drive->dev_flags |= IDE_DFLAG_LBA48;
else
drive->dev_flags &= ~ID... | false | false | false | false | false | 0 |
freopen(const char* path, const char* mode, FILE* stream)
{
FILE* ret;
CHECK_INIT;
ret = libc_freopen(path, mode, stream);
if (ret && strpbrk(mode, "wa+"))
lp_log(path, "freopen(\"%s\", \"%s\")", path, mode);
return ret;
} | false | false | false | false | false | 0 |
info_hash_lookup_varinfo (struct info_hash_table *hash_table,
asymbol *sym,
bfd_vma addr,
const char **filename_ptr,
unsigned int *linenumber_ptr)
{
const char *name = bfd_asymbol_name (sym);
asection *sec = bfd_get_section (sym);
struct varinfo* each;
struct info_list_node *node;
for (no... | false | false | false | false | false | 0 |
compare_section_lma (const void *arg1, const void *arg2)
{
const asection *const *sec1 = (const asection * const *) arg1;
const asection *const *sec2 = (const asection * const *) arg2;
flagword flags1, flags2;
/* Sort non loadable sections to the front. */
flags1 = (*sec1)->flags;
flags2 = (*sec2)->flags;... | false | false | false | false | false | 0 |
mapToUnicode(CharCode c, Unicode **u) {
int i;
if (isIdentity) {
map[0] = (Unicode)c;
*u = map;
return 1;
}
if (c >= mapLen) {
return 0;
}
if (map[c]) {
*u = &map[c];
return 1;
}
for (i = sMapLen - 1; i >= 0; --i) { // in reverse so CMap takes precedence
if (sMap[i].c == c) ... | false | false | false | false | false | 0 |
EditArrayStringDlg_Dtor(SQUserPointer up, cb_unused SQInteger size)
{
SQ_DELETE_CLASS(EditArrayStringDlg);
} | false | false | false | false | false | 0 |
create_tmp_base_dir (GFile *base_dir,
const char *destination)
{
GFile *temp_dir;
char *destination_parent;
GFile *parent_dir;
GFile *dir;
char *path;
GError *error = NULL;
if ((destination == NULL) || (*destination == '\0')|| (strcmp (destination, "/") == 0))
return g_object_ref (base_dir)... | false | false | false | false | false | 0 |
vnc_display_keyval_set_entries(void)
{
size_t i;
if (ref_count_for_untranslated_keys == 0)
for (i = 0; i < sizeof(untranslated_keys) / sizeof(untranslated_keys[0]); i++)
gdk_keymap_get_entries_for_keyval(gdk_keymap_get_default(),
untranslated_keys[i].keyval,
&untranslated_keys[i].keys,
... | false | false | false | false | false | 0 |
reset_trx_data(ecif_FaceGeometry_X& tx)
{
delete[] tx.definingPoints;
delete[] tx.location;
delete[] tx.knots_u;
delete[] tx.knots_v;
delete[] tx.cpoints;
purgeMatcValueTable(tx.matcTable);
init_trx_data(tx);
} | false | false | false | false | false | 0 |
LoadAreaTriggerScripts()
{
m_AreaTriggerScripts.clear(); // need for reload case
QueryResult* result = WorldDatabase.Query("SELECT entry, ScriptName FROM scripted_areatrigger");
uint32 count = 0;
if (!result)
{
BarGoLink bar(1);
bar.step();
sLog.o... | false | false | false | false | false | 0 |
emitSinglePredicateMatch(raw_ostream &o, StringRef str,
std::string PredicateNamespace) {
if (str[0] == '!')
o << "!(Bits & " << PredicateNamespace << "::"
<< str.slice(1,str.size()) << ")";
else
o << "(Bits & " << PredicateNamespace << "::" << str << ")";
} | false | false | false | false | false | 0 |
handle_group_exit(struct tcb *tcp, int sig)
{
/* We need to locate our records of all the clone threads
related to TCP, either its children or siblings. */
struct tcb *leader = NULL;
if (tcp->flags & TCB_CLONE_THREAD)
leader = tcp->parent;
else if (tcp->nclone_detached > 0)
leader = tcp;
if (sig < 0) {
... | false | false | false | false | false | 0 |
OTF_File_iofsl_getIndexEntries( OTF_File* file ) {
OTF_File_iofsl *iofsl;
size_t pos;
if ( file == NULL || file->iofsl == NULL )
return -1; /* tilsche: Do we really need to be THIS graceful? */
iofsl = file->iofsl;
if ( iofsl->id_str == NULL )
return 0; /* there are no indices to read */
if ( iofsl->indexf... | false | false | false | false | false | 0 |
regmatch_ref(ScmRegMatch *rm, ScmObj obj)
{
struct ScmRegMatchSub *sub = NULL;
if (SCM_INTP(obj)) {
int i = SCM_INT_VALUE(obj);
if (i < 0 || i >= rm->numMatches)
Scm_Error("submatch index out of range: %d", i);
sub = rm->matches[i];
if (!sub->startp || !sub->endp) ret... | false | false | false | false | false | 0 |
search_sortlist_qsort( const void *a, const void *b )
{
if( ((search_t *)a)->speed < 0 && ((search_t *)b)->speed > 0 )
return( 1 );
if( ((search_t *)a)->speed > 0 && ((search_t *)b)->speed < 0 )
return( -1 );
if( ((search_t *)a)->speed < ((search_t *)b)->speed )
return( -1 );
else
return( ((search_t *)a)->s... | false | false | false | false | false | 0 |
dds_op_rename( Operation *op, SlapReply *rs )
{
slap_overinst *on = (slap_overinst *)op->o_bd->bd_info;
dds_info_t *di = on->on_bi.bi_private;
if ( DDS_OFF( di ) ) {
return SLAP_CB_CONTINUE;
}
/* we don't allow dynamicObjects to have static subordinates */
if ( op->orr_nnewSup != NULL ) {
Entry *e = NULL;
... | false | false | false | false | false | 0 |
GetGroupList()
{
/*
* If we are not flagged to use local hash, call NGetGroupList.
* That could potentially fail (server no answer, etc) in which
* case we fall back to standard INN and scream bloody murder.
*/
if (! GRPuselocalhash) {
if (NGetGroupList() == FALSE) {
syslog(L_ERROR, "%s N... | false | false | false | false | false | 0 |
print_omni_key(_CORBA_Unbounded_Sequence_Octet& key, int hexflag)
{
_CORBA_Unbounded_Sequence_String poas;
int is_transient;
_CORBA_Unbounded_Sequence_Octet id;
if( get_poa_info(key, poas, is_transient, id) ) {
cout << "POA(" << (char*)poas[0];
for( unsigned i = 1; i < poas.length(); i++ )
cout <... | false | false | false | false | false | 0 |
mpd_qshiftn(mpd_t *result, const mpd_t *a, mpd_ssize_t n, const mpd_context_t *ctx,
uint32_t *status)
{
if (mpd_isspecial(a)) {
if (mpd_qcheck_nan(result, a, ctx, status)) {
return;
}
mpd_qcopy(result, a, status);
return;
}
if (n >= 0 && n <= ctx->pre... | false | false | false | false | false | 0 |
ch_util_get_measure_mode (ChUtilPrivate *priv, gchar **values, GError **error)
{
gboolean ret;
ChMeasureMode measure_mode = CH_MEASURE_MODE_FREQUENCY;
/* get from HW */
ch_device_queue_get_measure_mode (priv->device_queue,
priv->device,
&measure_mode);
ret = ch_device_queue_process (priv->device_que... | false | false | false | false | false | 0 |
clk_div_even(uint32_t a)
{
return max_t(uint32_t, 1, a & ~1);
} | false | false | false | false | false | 0 |
is_minimum(const DenseMatrix &t, const std::vector<DenseMatrix> &basis, unsigned n)
{
if (n == 0) {
return true;
}
return !order(t, basis, n - 1) && is_minimum(t, basis, n - 1);
} | false | false | false | false | false | 0 |
procValueArray(parseUnion * lvalp, ParserControl * parm)
{
static XmlElement elm[] = {
{NULL}
};
XmlAttr attr[1];
if (tagEquals(parm->xmb, "VALUE.ARRAY")) {
if (attrsOk(parm->xmb, elm, attr, "VALUE.ARRAY",
ZTOK_VALUEARRAY)) {
lvalp->xtokValueArray.max = 16;
lvalp->xt... | false | false | false | false | false | 0 |
getShapeType(const string& s)
{
for (unsigned int i = 0; i < m_shapeTypes.size(); i++) {
if (s == m_shapeTypes[i].name) {
return m_shapeTypes[i].shapeType;
}
}
return newShape;
} | false | false | false | false | false | 0 |
_elm_dayselector_smart_content_unset(Evas_Object *obj,
const char *item)
{
int day;
char buf[1024];
Evas_Object *content;
Elm_Dayselector_Item *it = NULL;
ELM_DAYSELECTOR_DATA_GET(obj, sd);
day = atoi(item + (strlen(item) - 1));
if (day < 0 || day > ELM_DAYSEL... | false | false | false | false | false | 0 |
create_node(NODE* father, int32_t start, int32_t end, int32_t position,SuffixTree *tree)
{
ContainerAllocator *allocator;
if (tree == NULL) {
iError.RaiseError("SuffixTree.CreateNode",CONTAINER_ERROR_BADARG);
return NULL;
}
allocator = tree->allocator;
/*Allocate a node.*/
NODE* no... | false | false | false | false | false | 0 |
rio_disc_peer(struct rio_net *net, struct rio_mport *port, u16 destid,
u8 hopcount, struct rio_dev *prev, int prev_port)
{
u8 port_num, route_port;
struct rio_dev *rdev;
u16 ndestid;
/* Setup new RIO device */
if ((rdev = rio_setup_device(net, port, destid, hopcount, 0))) {
/* Add device to the global an... | false | false | false | false | false | 0 |
setBargraphValue( const ASCString& widgetName, float fraction )
{
BarGraphWidget* bgw = dynamic_cast<BarGraphWidget*>( FindChild( widgetName, true ) );
if ( bgw )
bgw->setFraction( fraction );
} | false | false | false | false | false | 0 |
readn(int f, void *av, long n)
{
char *a;
long m, t;
a = av;
t = 0;
while(t < n){
m = read(f, a+t, n-t);
if(m <= 0){
if(t == 0)
return m;
break;
}
t += m;
}
return t;
} | false | false | false | false | false | 0 |
display_time( const timeval &tv )
{
std::string number;
std::stringstream strstream;
strstream << tv.tv_sec << "." << tv.tv_usec << " seconds";
strstream >> number;
return number;
} | false | false | false | false | false | 0 |
scm_is_vector (SCM obj)
{
if (SCM_I_IS_VECTOR (obj))
return 1;
if (SCM_I_ARRAYP (obj) && SCM_I_ARRAY_NDIM (obj) == 1)
{
SCM v = SCM_I_ARRAY_V (obj);
return SCM_I_IS_VECTOR (v);
}
return 0;
} | false | false | false | false | false | 0 |
ds_getc(Ds *ds, FILE *fp, int *ch_ptr)
{
int ch;
ds_errmsg = NULL;
if (ds->len_limit > 0 && ds->len == ds->len_limit) {
ds_errmsg = "max limit exceeded";
return(-2);
}
if ((ch = getc(fp)) == EOF) {
if (feof(fp))
return(0);
if (ferror(fp))
return(-1);
}
if (ds_appendc(ds, ch) == -1)
return(-1... | false | true | false | false | true | 1 |
eng_image_size_get(void *data __UNUSED__, void *image, int *w, int *h)
{
Image_Entry *im;
im = image;
if (w) *w = im->w;
if (h) *h = im->h;
} | false | false | false | false | false | 0 |
add_newsuffix(struct regex_matcher *matcher, struct regex_list *info, const char *suffix, size_t len)
{
struct cli_matcher *root = &matcher->suffixes;
struct cli_ac_patt *new = mpool_calloc(matcher->mempool,1,sizeof(*new));
size_t i;
int ret;
if(!new)
return CL_EMEM;
assert(root && suffix);
new->rtype = 0;
... | false | false | false | false | false | 0 |
CreateKdSubsurfaceMaterial(const Transform &xform,
const TextureParams &mp) {
float Kd[3] = { .5, .5, .5 };
Reference<Texture<Spectrum> > kd = mp.GetSpectrumTexture("Kd", Spectrum::FromRGB(Kd));
Reference<Texture<float> > mfp = mp.GetFloatTexture("meanfreepath", 1.f);
Reference<Texture<float> > ... | false | false | false | false | false | 0 |
intel_ddi_get_config(struct intel_encoder *encoder,
struct intel_crtc_state *pipe_config)
{
struct drm_i915_private *dev_priv = encoder->base.dev->dev_private;
struct intel_crtc *intel_crtc = to_intel_crtc(encoder->base.crtc);
enum transcoder cpu_transcoder = pipe_config->cpu_transcoder;
struct intel_hdmi *int... | false | false | false | false | false | 0 |
cryptd_hash_digest(struct crypto_async_request *req_async, int err)
{
struct cryptd_hash_ctx *ctx = crypto_tfm_ctx(req_async->tfm);
struct crypto_shash *child = ctx->child;
struct ahash_request *req = ahash_request_cast(req_async);
struct cryptd_hash_request_ctx *rctx = ahash_request_ctx(req);
struct shash_desc *d... | false | false | false | false | false | 0 |
SyncToUnitStart()
{
// locate parse-unit prefix
string byte_buffer;
while(CanRead()==true && mp_stream->tellg() >= 0)
{
// ensure current buffer length
if((int)byte_buffer.size() == PU_PREFIX_SIZE)
{
byte_buffer.assign(byte_buffer.substr(1,PU_PREFIX_SIZE-1));
... | false | false | false | false | false | 0 |
on_widget_button_release (GtkWidget *widget,
GdkEventButton *event,
char *item_id)
{
GdkDevice *device = gdk_event_get_device ((GdkEvent*) event);
g_print ("%s received 'button-release' signal\n", item_id);
if (device && strstr (item_id, "explicit"))
{
gdk_device_ungrab (device, event->time)... | false | false | false | false | false | 0 |
out_cancel(void)
{
if (espeak)
{
ecore_exe_interrupt(espeak);
espeak = NULL;
}
if (tmpf)
{
unlink(tmpf);
free(tmpf);
tmpf = NULL;
close(tmpfd);
}
} | false | false | false | false | false | 0 |
ario_radio_finalize (GObject *object)
{
ARIO_LOG_FUNCTION_START;
ArioRadio *radio;
guint i;
g_return_if_fail (object != NULL);
g_return_if_fail (IS_ARIO_RADIO (object));
radio = ARIO_RADIO (object);
g_return_if_fail (radio->priv != NULL);
if (radio->pri... | false | false | false | false | false | 0 |
_hs_bytestring_long_long_uint_hex (long long unsigned int x, char* buf) {
// write hex representation in reverse order
char c, *ptr = buf, *next_free;
do {
*ptr++ = digits[x & 0xf];
x >>= 4;
} while ( x );
// invert written digits
next_free = ptr--;
while(buf < ptr) {
... | false | false | false | false | false | 0 |
VoiceKeyOn(opl_channel_data_t *channel,
genmidi_instr_t *instrument,
unsigned int instrument_voice,
unsigned int key,
unsigned int volume)
{
opl_voice_t *voice;
// Find a voice to use for this new note.
voice = Get... | false | false | false | false | false | 0 |
wrap( const std::string &text,
int wrapColumn )
{
const char lineBreak = '\n';
Strings lines = split( text, lineBreak );
std::string wrapped;
for ( Strings::const_iterator it = lines.begin(); it != lines.end(); ++it )
{
if ( it != lines.begin() )
wrapped += lineBreak;
const ... | false | false | false | false | false | 0 |
dialog_fhelp(File *f)
{
ht_help_lexer *l = new ht_help_lexer();
l->init();
ht_ltextfile *t = new ht_ltextfile(f, true, NULL);
Bounds b, c;
app->getbounds(&c);
b = c;
b.w = 70;
b.h = 19;
b.x = (c.w - b.w) / 2,
b.y = (c.h - b.h) / 2;
c = b;
ht_dialog dialog;
dialog.init(&b, "eval() - functions", FS_KILLER... | false | false | false | false | false | 0 |
gt_str_append_uint(GtStr *dest, unsigned int uint)
{
char buf[BUFSIZ];
GT_UNUSED int rval;
gt_assert(dest);
rval = snprintf(buf, BUFSIZ, "%u", uint);
gt_assert(rval < BUFSIZ);
gt_str_append_cstr(dest, buf);
} | true | true | false | false | false | 1 |
print_ldapvi_message(FILE *s, LDAP *ld, LDAPMessage *entry, int key,
tentroid *entroid)
{
char *dn, *ad;
BerElement *ber;
fprintf(s, "\n%d", key);
dn = ldap_get_dn(ld, entry);
print_attrval(s, dn, strlen(dn), 1);
ldap_memfree(dn);
fputc('\n', s);
if (entroid)
fputs(entroid->comment->str, s);
for (ad ... | false | false | false | false | false | 0 |
smack_file_open(struct file *file, const struct cred *cred)
{
struct task_smack *tsp = cred->security;
struct inode *inode = file_inode(file);
struct smk_audit_info ad;
int rc;
if (smack_privileged(CAP_MAC_OVERRIDE))
return 0;
smk_ad_init(&ad, __func__, LSM_AUDIT_DATA_PATH);
smk_ad_setfield_u_fs_path(&ad, fi... | false | false | false | false | false | 0 |
is_empty(fd_set *fds)
{
int i, ret = 1;
if (!fds) {
ret = -1;
goto out;
}
for (i = 0; i <= loop_set.nfds; i++) {
if (FD_ISSET(i, fds)) {
ret = 0;
goto out;
}
}
out:
return ret;
} | false | false | false | false | false | 0 |
fips186_2prf(uint8_t mk[20], uint8_t finalkey[160])
{
fr_SHA1_CTX context;
int j;
onesixty xval, xkey, w_0, w_1, sum, one;
uint8_t *f;
uint8_t zeros[64];
/*
* let XKEY := MK,
*
* Step 3: For j = 0 to 3 do
* a. XVAL = XKEY
* b. w_0 = SHA1(XVAL)
* c. XKEY = (1 + XKEY + w_0) m... | false | true | false | false | false | 1 |
convert_pathname(CONVERT *cv, const char *path)
{
static char buf[MAXPATHLEN+1];
const char *a, *b;
/*
* print without conversion.
*/
if (cv->type == PATH_THROUGH)
return path;
/*
* make absolute path name.
* 'path + 1' means skipping "." at the head.
*/
strbuf_setlen(cv->abspath, cv->start_point);
... | false | false | false | false | false | 0 |
IsLocal(char* ip)
{
if (strcmp(ip, "127.0.0.1") == 0) {
return true;
}
char host_name[32];
gethostname(host_name, sizeof(host_name));
struct hostent* host = gethostbyname(host_name);
if (host) {
for (int i = 0; host->h_addr_list[i] != 0; ++i)... | false | false | false | false | false | 0 |
main(int argc, char **argv)
{
int port = DEFAULT_STUN_PORT;
char local_addr[256]="\0";
int c=0;
int forceRfc5780 = 0;
set_logfile("stdout");
set_system_parameters(0);
ns_bzero(local_addr, sizeof(local_addr));
while ((c = getopt(argc, argv, "p:L:f")) != -1) {
switch(c) {
case 'f':
force... | true | true | false | false | true | 1 |
_eina_value_type_hash_compare_each(const Eina_Hash *hash __UNUSED__, const void *key, void *_ptr, void *user_data)
{
struct _eina_value_type_hash_compare_each_ctx *ctx = user_data;
const void *self_ptr = _ptr;
const void *other_ptr = eina_hash_find(ctx->other, key);
if (!other_ptr) return EINA_TRUE;
ctx-... | false | false | false | false | false | 0 |
compute_outgoing_frequencies (basic_block b)
{
edge e, f;
if (b->succ && b->succ->succ_next && !b->succ->succ_next->succ_next)
{
rtx note = find_reg_note (BB_END (b), REG_BR_PROB, NULL);
int probability;
if (!note)
return;
probability = INTVAL (XEXP (note, 0));
e = BRANCH_EDGE ... | false | false | false | false | false | 0 |
initialize_fs_variables(exec_list *instructions,
struct _mesa_glsl_parse_state *state)
{
switch (state->language_version) {
case 100:
generate_100ES_fs_variables(instructions, state);
break;
case 110:
generate_110_fs_variables(instructions, state);
break;
case 120:
generate... | false | false | false | false | false | 0 |
calc_cp_length(Block *head, real *cp, Boolean *flg, int no)
{
real max = 0.0;
Block *bpt;
Block *target;
target = search_block_from_no(head, no);
for (bpt = head; bpt != NULL; bpt = bpt->next) {
if (in_IntSet(target->succ, bpt->no)) {
if (flg[bpt->no] == FALSE) {
... | false | false | false | false | false | 0 |
MPI_Irecv(void* buf, VT_MPI_INT count, MPI_Datatype datatype,
VT_MPI_INT source, VT_MPI_INT tag, MPI_Comm comm,
MPI_Request* request)
{
VT_MPI_INT result;
uint32_t tid;
GET_THREAD_ID(tid);
if (IS_MPI_TRACE_ON(tid))
{
uint64_t time;
uint8_t was_recorded... | false | false | false | false | false | 0 |
heap_restrpos(HeapScanDesc scan)
{
/* XXX no amrestrpos checking that ammarkpos called */
if (!ItemPointerIsValid(&scan->rs_mctid))
{
scan->rs_ctup.t_data = NULL;
/*
* unpin scan buffers
*/
if (BufferIsValid(scan->rs_cbuf))
ReleaseBuffer(scan->rs_cbuf);
scan->rs_cbuf = InvalidBuffer;
scan->rs_cb... | false | false | false | true | false | 1 |
excxt(CX cx)
{
I i;V v;
if (!cx||Rx==cx) R 1;
for(i=0;i<cx->ht->nb;++i)for(v=(V)cx->ht->b[i];v;v=v->v)
if(qv0(v))R 1;
cx->flag&=~1;
R 0;
} | false | false | false | false | true | 1 |
refs_foreach_cancel_cb(git_reference *reference, void *payload)
{
int *cancel_after = payload;
git_reference_free(reference);
if (!*cancel_after)
return -333;
(*cancel_after)--;
return 0;
} | false | false | false | false | false | 0 |
CountUTF8 ( const XMP_Uns8 * charStart, const XMP_Uns8 * bufEnd )
{
XMP_Assert ( charStart < bufEnd ); // Catch this in debug builds.
if ( charStart >= bufEnd ) return 0; // Don't run-on in release builds.
if ( (*charStart & 0xC0) != 0xC0 ) return 0; // Must have at least 2 high bits set.
int byteCount = 2;
XMP... | false | false | false | false | false | 0 |
decodeData(GAGCore::InputStream* stream, Uint32 versionMinor)
{
texts.clear();
hidden.clear();
completed.clear();
failed.clear();
types.clear();
scriptNumbers.clear();
stream->readEnterSection("GameObjectives");
Uint32 size = stream->readUint32("size");
for(int i=0; i<size; ++i)
{
stream->readEnterSection(i... | false | false | false | false | false | 0 |
command_print_photoset(flickcurl_photoset* photoset)
{
fprintf(stdout,
"%s: Found photoset with ID %s primary photo: '%s' secret: %s server: %d farm: %d photos count: %d title: '%s' description: '%s'\n",
program,
photoset->id, photoset->primary, photoset->secret,
photoset->serv... | false | false | false | false | false | 0 |
hwloc_read_linux_cpuset_mask(const char *cgroup_mntpnt, const char *cpuset_mntpnt, const char *cpuset_name, const char *attr_name, int fsroot_fd)
{
#define CPUSET_FILENAME_LEN 256
char cpuset_filename[CPUSET_FILENAME_LEN];
FILE *fd;
char *info = NULL, *tmp;
ssize_t ssize;
size_t size;
if (cgroup_mntpnt) {
... | false | false | false | false | false | 0 |
alarm_timer_update (Alarm *alarm)
{
time_t now;
time (&now);
if (now >= alarm->timestamp) {
alarm_trigger (alarm);
// Remove callback only if we don't intend to repeat the alarm
return alarm_should_repeat (alarm);
} else if (alarm->timestamp - now <= 10) {
g_debug ("Alarm(%p) #%d: -%2d...", alarm, al... | false | false | false | false | false | 0 |
set_icon(ManagedWindowHintInfo& info) {
if (icon_ == nil) {
info.hints_->flags &= ~IconWindowHint;
info.hints_->icon_window = None;
return true;
} else {
XWindow i = icon_->Window::rep()->xwindow_;
if (i != WindowRep::unbound) {
info.hints_->flags |= IconWindowHint;
info.hints_->icon_window = i;
... | false | false | false | false | false | 0 |
timer_del(void *b, char *id) {
struct timer *t, *l;
l = 0;
t = timers;
while (t) {
if ((b == t->boundto) && !strcmp(id, t->id)) {
if (l) {
l->next = t->next;
} else {
timers = t->next;
}
debug("Timer %s will not be triggered (%d on the clock)",
t->id, ... | false | false | false | false | false | 0 |
gt_queue_remove(GtQueue *q, void *elem)
{
long i, elemidx;
gt_assert(q && gt_queue_size(q));
if (q->front < q->back) { /* no wraparound */
for (i = q->back-1; i >= q->front; i--) {
if (q->contents[i] == elem)
break;
}
elemidx = i;
gt_assert(elemidx >= q->front); /* valid element fou... | false | false | false | false | false | 0 |
startParagraph(const ParagraphNIC &nic)
{
startDisplay(nic);
Block *block = new Block(makeParaStyleClass());
nextFlowObject_.parentLeftMargin += nextFlowObject_.leftMargin;
nextFlowObject_.parentRightMargin += nextFlowObject_.rightMargin;
nextFlowObject_.leftMargin = 0;
nextFlowObject_.rightMargin = 0;
de... | false | false | false | false | false | 0 |
dtls1_guess_mtu(unsigned int curr_mtu)
{
unsigned int i;
if ( curr_mtu == 0 )
return g_probable_mtu[0] ;
for ( i = 0; i < sizeof(g_probable_mtu)/sizeof(g_probable_mtu[0]); i++)
if ( curr_mtu > g_probable_mtu[i])
return g_probable_mtu[i];
return curr_mtu;
} | false | false | false | false | false | 0 |
AB_EditUserDialog_new(AB_BANKING *ab, AB_USER *u, int doLock) {
GWEN_DIALOG *dlg;
AB_EDIT_USER_DIALOG *xdlg;
GWEN_BUFFER *fbuf;
int rv;
dlg=GWEN_Dialog_new("ab_edit_user");
GWEN_NEW_OBJECT(AB_EDIT_USER_DIALOG, xdlg);
GWEN_INHERIT_SETDATA(GWEN_DIALOG, AB_EDIT_USER_DIALOG, dlg, xdlg,
AB_EditUserDi... | false | false | false | false | false | 0 |
keystr_from_desc(KEYDB_SEARCH_DESC *desc)
{
switch(desc->mode)
{
case KEYDB_SEARCH_MODE_LONG_KID:
case KEYDB_SEARCH_MODE_SHORT_KID:
return keystr(desc->u.kid);
case KEYDB_SEARCH_MODE_FPR20:
{
u32 keyid[2];
keyid[0] = buf32_to_u32 (desc->u.fpr+12);
keyid[1] = buf32_to_u32 (desc->u.fpr+... | false | false | false | false | false | 0 |
wait_for_input(int fd, int timeout)
{
fd_set fds;
struct timeval tv, *tvp;;
tvp = 0;
if (timeout >= 0)
{
tv.tv_sec = timeout / 1000;
tv.tv_usec = timeout % 1000 * 1000;
tvp = &tv;
}
FD_ZERO(&fds);
FD_SET(fd, &fds);
return select(fd + 1, &fds, NULL, NULL, tvp);
} | false | false | false | false | false | 0 |
Compile() {
if (compiled_) {
LOG(DFATAL) << "RE2::Set::Compile multiple times";
return false;
}
compiled_ = true;
Regexp::ParseFlags pf = static_cast<Regexp::ParseFlags>(
options_.ParseFlags());
re2::Regexp* re = re2::Regexp::Alternate(const_cast<re2::Regexp**>(&re_[0]),
... | false | false | false | false | false | 0 |
activationAction() const
{
Link* action = 0;
if (::LinkAction *act = m_formData->fm->getActivationAction())
{
action = PageData::convertLinkActionToLink(act, m_formData->doc, QRectF());
}
return action;
} | false | false | false | false | false | 0 |
clutter_table_layout_set_use_animations (ClutterTableLayout *layout,
gboolean animate)
{
ClutterTableLayoutPrivate *priv;
g_return_if_fail (CLUTTER_IS_TABLE_LAYOUT (layout));
priv = layout->priv;
animate = !!animate;
if (priv->use_animations != animate)
... | false | false | false | false | false | 0 |
int_size_in_bytes (const_tree type)
{
tree t;
if (type == error_mark_node)
return 0;
type = TYPE_MAIN_VARIANT (type);
t = TYPE_SIZE_UNIT (type);
if (t == 0
|| TREE_CODE (t) != INTEGER_CST
|| TREE_INT_CST_HIGH (t) != 0
/* If the result would appear negative, it's too big to represent. ... | false | false | false | false | false | 0 |
HSP_Display_print_ruler(HSP_Display *hd, gint width,
gint pos, gboolean is_query){
register gint i, adv;
if(is_query){
if(HSP_target_advance(hd->hsp) == 1)
return; /* opposite padding */
adv = HSP_target_advance(hd->hsp);
} else { /* Is target ... | false | false | false | false | false | 0 |
init()
{
for (htstate=0; htstate<(int)(sizeof initdone / sizeof initdone[0]); htstate++) {
if (!initdone[htstate].i()) return false;
}
return true;
} | false | false | false | false | false | 0 |
readstring()
{
int c;
char *s;
char *start;
align(tableptr);
start = s = ((struct symstruct *) tableptr)->name;
while (TRUE)
{
/* Stats: need a checkused against 's', maybe. */
if (s >= tableend)
outofmemory();
if ((c = readchar()) < 0)
prematureeof();
if ((*s++ = c) ==... | false | false | false | false | true | 1 |
evaluate(){
//Evaluate the Rules; Mark the fired rules
for (int i=0; i < indexRule; i++){
FuzzyRule* f = &baseRules[i];
f->evaluate();
}
//Truncate the outputs of the fired rules
truncate();
} | false | false | false | false | false | 0 |
imap_store(struct mailbox *mp, struct message *m, int n,
int c, const char *sp, int needstat)
{
char o[LINESIZE];
FILE *queuefp = NULL;
if (mp->mb_type == MB_CACHE && (queuefp = cache_queue(mp)) == NULL)
return STOP;
if (m->m_uid)
snprintf(o, sizeof o,
"%s UID STORE %lu %cFLAGS (%s)\r\n",
tag(1), m->... | false | false | false | false | false | 0 |
rdbSaveRio(rio *rdb, int *error) {
dictIterator *di = NULL;
dictEntry *de;
char magic[10];
int j;
long long now = mstime();
uint64_t cksum;
if (server.rdb_checksum)
rdb->update_cksum = rioGenericUpdateChecksum;
snprintf(magic,sizeof(magic),"REDIS%04d",REDIS_RDB_VERSION);
if ... | false | false | false | false | false | 0 |
vsl_wrap(void)
{
assert(vsl_ptr >= vsl_start + 1);
assert(vsl_ptr < vsl_end);
vsl_start[1] = VSL_ENDMARKER;
do
vsl_start[0]++;
while (vsl_start[0] == 0);
VWMB();
if (vsl_ptr != vsl_start + 1) {
*vsl_ptr = VSL_WRAPMARKER;
vsl_ptr = vsl_start + 1;
}
VSC_C_main->shm_cycles++;
} | false | false | false | false | false | 0 |
network_sockaddr_tostring(const struct sockaddr *addr, char *buff, size_t size)
{
if (buff == NULL || size == 0)
{
static char static_buff[128];
buff = static_buff;
size = sizeof(static_buff);
}
switch (addr->sa_family)
{
case AF_INET:
network_sockaddr_in_tostring((const struct sockaddr_in *) addr, buff... | false | false | false | false | false | 0 |
store(output::pointer dest)
{
nstring_list names;
database.keys(names);
names.sort();
for (size_t j = 0; j < names.size(); ++j)
{
const nstring &name = names[j];
dest << name.capitalize() << ": ";
//
// We have to make sure that the value is written in an RFC822
// compliant form... | false | false | false | false | true | 1 |
mk_env_string (name, value)
const char *name, *value;
{
int name_len, value_len;
char *p;
name_len = strlen (name);
value_len = STRLEN (value);
p = (char *)xmalloc (2 + name_len + value_len);
strcpy (p, name);
p[name_len] = '=';
if (value && *value)
strcpy (p + name_len + 1, value);
else
... | false | false | false | false | false | 0 |
pni_detect(const GwyFileDetectInfo *fileinfo,
gboolean only_name)
{
gint score = 0;
guint32 xres, yres;
if (only_name)
return g_str_has_suffix(fileinfo->name_lowercase, EXTENSION) ? 20 : 0;
if (fileinfo->buffer_len >= 0xa0
&& (memcmp(fileinfo->head, MAGIC1, MAGIC_SIZE) == 0
... | false | false | false | false | false | 0 |
setAffiliation(MUCItem::Affiliation affiliation)
{
affiliation_ = affiliation;
ui_.tabs->setTabEnabled(ui_.tabs->indexOf(ui_.tab_general),affiliation == MUCItem::Owner);
if (ui_.tabs->currentWidget() == ui_.tab_general) {
refreshGeneral();
}
else if (ui_.tabs->currentWidget() == ui_.tab_affiliations) {
refresh... | false | false | false | false | false | 0 |
gsb_data_currency_link_init_variables ( void )
{
if ( currency_link_list )
{
GSList* tmp_list = currency_link_list;
while ( tmp_list )
{
struct_currency_link *currency_link;
currency_link = tmp_list -> data;
tmp_list = tmp_list -> next;
_g_data_currency_link_fr... | 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.