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 |
|---|---|---|---|---|---|---|
MD5_Init (MD5_CTX * ctx)
{
ctx->handle = gnutls_malloc (sizeof (digest_hd_st));
if (!ctx->handle)
abort ();
_gnutls_hash_init (ctx->handle, GNUTLS_DIG_MD5);
} | false | false | false | false | false | 0 |
eet_data_stream_write(Eet_Data_Stream *ds,
const void *data,
int size)
{
char *p;
if ((ds->pos + size) > ds->size)
{
ds->data = realloc(ds->data, ds->size + size + 512);
if (!ds->data)
{
ds->pos = 0;
... | false | false | false | false | false | 0 |
uncompress_term(char *s, int *ip)
{
char c = s[(*ip)++];
if (c <= 0)
return get_variable_term(-c);
else {
int arity = sn_to_arity(c);
Term t = get_rigid_term_dangerously(c, arity);
int i;
for (i = 0; i < ARITY(t); i++)
ARG(t,i) = uncompress_term(s, ip);
return t;
}
} | false | false | false | false | false | 0 |
getContextName(const DIScope *Context, std::string &N) {
if (auto *NS = dyn_cast<DINamespace>(Context)) {
if (!NS->getName().empty()) {
getContextName(NS->getScope(), N);
N = N + NS->getName().str() + "::";
}
} else if (auto *TY = dyn_cast<DIType>(Context)) {
if (!TY->getName()... | false | false | false | false | false | 0 |
fiasco_image_delete (fiasco_image_t *image)
/*
* FIASCO image destructor.
* Free memory of FIASCO image struct.
*
* No return value.
*
* Side effects:
* structure 'image' is discarded.
*/
{
image_t *this = cast_image (image);
if (!this)
return;
try
{
free_image (this);
}
catc... | false | false | false | false | false | 0 |
process_timeout_value(char *t)
{
char *s = t;
char *ptr;
if (s == CN || *s == '\0') {
idle_ms = IDLE_MS;
idle_randomize = True;
return 0;
}
if (*s == '~') {
idle_randomize = True;
s++;
}
idle_n = strtoul(s, &ptr, 0);
if (idle_n <= 0)
goto bad_idle;
switch (*ptr) {
case 'H':
case 'h':
... | false | false | false | false | false | 0 |
replica_delete_by_name (const char *name)
{
Object *replica;
if (name == NULL)
{
slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "replica_delete_by_name: "
"NULL argument\n");
return -1;
}
if (s_hash == NULL || s_lock == NULL)
{
slapi_log_erro... | false | false | false | false | false | 0 |
static_list (GtkWidget *widget, void *data)
{
gamgi_window *window = GAMGI_CAST_WINDOW data;
GtkWidget *dialog = window->dialog0;
GtkWidget *label, *button;
gamgi_bool *sensitive;
sensitive = (gamgi_bool *) g_object_get_data (G_OBJECT (dialog), "sensitive_reference");
label = (GtkWidget *) g_object_get_data (G_OBJECT... | false | false | false | false | false | 0 |
DateCalc_week_of_year(Z_int *week,
Z_int *year, Z_int month, Z_int day)
{
if (DateCalc_check_date(*year,month,day))
{
*week = DateCalc_Week_Number(*year,month,day);
if (*week == 0) *week = DateCalc_Weeks_in_Year(--(*year));
else if (*week > DateCalc_Weeks_in... | false | false | false | false | false | 0 |
pk11_setAttributes(PK11SlotInfo *slot, CK_OBJECT_HANDLE id,
CK_ATTRIBUTE *setTemplate, CK_ULONG setTemplCount)
{
CK_RV crv;
CK_SESSION_HANDLE rwsession;
rwsession = PK11_GetRWSession(slot);
if (rwsession == CK_INVALID_SESSION) {
PORT_SetError(SEC_ERROR_BAD_DATA);
return SECFailure;
}
... | false | false | false | false | false | 0 |
removeRows(int row, int count, const QModelIndex & parent)
{
Q_ASSERT_X(!m_UID.isNull(), "DosageModel::removeRows", "before using the dosagemodel, you must specify the UID of the related drug");
if (WarnDebuggingData)
qWarning() << "DosageModel::removeRows (row:" << row << ";count" << count << ")" << pa... | false | false | false | false | false | 0 |
dgnc_tty_tiocmset(struct tty_struct *tty,
unsigned int set, unsigned int clear)
{
struct dgnc_board *bd;
struct channel_t *ch;
struct un_t *un;
int ret = -EIO;
unsigned long flags;
if (!tty || tty->magic != TTY_MAGIC)
return ret;
un = tty->driver_data;
if (!un || un->magic != DGNC_UNIT_MAGIC)
retu... | false | false | false | false | false | 0 |
IoSeq_rawClone(IoSeq *proto)
{
if (ISSYMBOL(proto))
{
return proto;
}
else
{
IoSeq *self = IoObject_rawClonePrimitive(proto);
IoObject_setDataPointer_(self, UArray_clone(DATA(proto)));
return self;
}
} | false | false | false | false | false | 0 |
ScanFolderToAdd(const CPath& folder, bool deletesource)
{
int count = 0;
CDirIterator finder(folder);
CPath file = finder.GetFirstFile(CDirIterator::File, wxT("*.part.met"));
while (file.IsOk()) {
ConvertToeMule(folder.JoinPaths(file), deletesource);
file = finder.GetNextFile();
count++;
}
/* Shareaza
fil... | false | false | false | false | false | 0 |
create_var(char* name, ExpListNode* list) {
Var *var;
ALLOC(var, Var);
var->line = yylineno;
var->name = name;
var->idxs = list;
return var;
} | false | false | false | false | false | 0 |
CleanObjComObjCopy (
Obj obj )
{
UInt i; /* loop variable */
/* remove the forwarding pointer */
ADDR_OBJ(obj)[0] = ELM_PLIST( ADDR_OBJ(obj)[0], 1 );
CHANGED_BAG(obj);
/* now it is cleaned ... | false | false | false | false | false | 0 |
get_bg0_tile_info( int offset )
{
int tile_number = grchamp_videoram[offset];
SET_TILE_INFO(
1,
tile_number,
palette_bank,
0)
} | false | false | false | false | false | 0 |
hit_structure()
{
int x1, y1;
int i, ch;
// Check bolts/objects
for(i = 0; i < MAX_BOLTS; i++)
{
if(!boltst[i])
continue;
x1 = (boltx[i] & (WORLD_SIZEX - 1)) >> 4;
y1 = (bolty[i] & (WORLD_SIZEY - 1)) >> 4;
ch = screen.get_map(x1, y1);
if(!IS_SPACE(ch) && (ch & HIT_MASK))
{
sound.g_bolt_hit(x1<<1... | false | false | false | false | false | 0 |
hashLookup(
DdLevelQueue * queue,
void * key)
{
int posn;
DdQueueItem *item;
posn = lqHash(key,queue->shift);
item = queue->buckets[posn];
while (item != NULL) {
if (item->key == key) {
return(item);
}
item = item->cnext;
}
return(NULL);
} | false | false | false | false | false | 0 |
set_own_mod(ATTR *attr, char *path, uid_t owner, gid_t group, mode_t mode)
{
if (chown(path, owner, group) != 0 && attr->uid == 0
#ifdef AFS
&& errno != EPERM
#endif
) {
berrno be;
Jmsg2(attr->jcr, M_WARNING, 0, _("Cannot change owner and/or group of %s: ERR=%s\n"),
path, be.bstrerr... | false | false | false | false | false | 0 |
PrintString(const Proto* tf, int n)
{
const char* s=tf->kstr[n]->str;
printf("%d\t; ",n);
putchar('"');
for (; *s; s++)
{
switch (*s)
{
case '"': printf("\\\""); break;
case '\a': printf("\\a"); break;
case '\b': printf("\\b"); break;
case '\f': printf("\\f"); break;
case '\n': printf("\\n"); br... | false | false | false | false | false | 0 |
allocate(u32bit n)
{
const u32bit BITMAP_SIZE = Memory_Block::bitmap_size();
const u32bit BLOCK_SIZE = Memory_Block::block_size();
Mutex_Holder lock(mutex);
if(n <= BITMAP_SIZE * BLOCK_SIZE)
{
const u32bit block_no = round_up(n, BLOCK_SIZE) / BLOCK_SIZE;
byte* mem = allocate_blocks(b... | false | false | false | false | false | 0 |
netsnmp_large_fd_set_resize(netsnmp_large_fd_set * fdset, int setsize)
{
int fd_set_bytes;
if (fdset->lfs_setsize == setsize)
return;
if (setsize > FD_SETSIZE) {
fd_set_bytes = NETSNMP_FD_SET_BYTES(setsize);
if (fdset->lfs_setsize > FD_SETSIZE)
fdset->lfs_se... | false | false | false | false | false | 0 |
parse_filename(Track *track) {
ExtraTrackData *etr;
gchar *template;
gchar **templates, **tplp;
g_return_if_fail (track);
etr = track->userdata;
g_return_if_fail (etr);
template = prefs_get_string("parsetags_template");
if (!template)
return;
templates = g_strsplit(template... | false | false | false | false | false | 0 |
toDocBuffer(OutBuffer *buf, Scope *sc)
{
//printf("AliasDeclaration::toDocbuffer() %s\n", toChars());
if (ident)
{
if (isDeprecated())
buf->writestring("deprecated ");
emitProtection(buf, protection);
buf->printf("alias %s = ", toChars());
if (Dsymbol *s = alias... | false | false | false | false | false | 0 |
HPDF_LoadTTFontFromFile (HPDF_Doc pdf,
const char *file_name,
HPDF_BOOL embedding)
{
HPDF_Stream font_data;
const char *ret;
HPDF_PTRACE ((" HPDF_LoadTTFontFromFile\n"));
if (!HPDF_HasDoc (pdf))
return NULL;
/* create f... | false | false | false | false | false | 0 |
greaterThan(const VersionThing & myVersionThing, const VersionThing & yourVersionThing)
{
// yourVersionThing > myVersionThing
bool newOne = false;
if (yourVersionThing.majorVersion > myVersionThing.majorVersion) {
newOne = true;
}
else if (yourVersionThing.majorVersion == myVersionThing.majorVersion) {
if (y... | false | false | false | false | false | 0 |
e_gadcon_layout_pack_request_set(Evas_Object *obj, int pos, int size)
{
E_Gadcon_Layout_Item *bi;
if (!obj) return;
bi = evas_object_data_get(obj, "e_gadcon_layout_data");
if (!bi) return;
bi->ask.res = bi->sd->w;
if (pos < 0) pos = 0;
if ((bi->ask.res - pos) < size) pos = bi->ask.res - size;
... | false | false | false | false | false | 0 |
start(void)
{
if (isRunning_)
return;
isRunning_ = true;
start_clock_ = clock();
start_time_ = time(0);
} | false | false | false | false | false | 0 |
resumeGC() {
d_postponeGC = false;
while(d_deleted.size() > 0) {
VariableValue* v = d_deleted.back();
d_deleted.pop_back();
delete v;
d_mm->deleteData(v);
}
} | false | false | false | false | false | 0 |
insertReload(unsigned NewVReg,
SlotIndex Idx,
MachineBasicBlock::iterator MI) {
MachineBasicBlock &MBB = *MI->getParent();
MachineInstrSpan MIS(MI);
TII.loadRegFromStackSlot(MBB, MI, NewVReg, StackSlot,
MRI.getRegClass(N... | false | false | false | false | false | 0 |
sms_extract_concatenation(const struct sms *sms, guint16 *ref_num,
guint8 *max_msgs, guint8 *seq_num)
{
struct sms_udh_iter iter;
enum sms_iei iei;
guint8 concat_hdr[4];
guint16 uninitialized_var(rn);
guint8 uninitialized_var(max), uninitialized_var(seq);
gboolean concatenated = FALSE;
/* We must ignore th... | false | false | false | false | true | 1 |
pthread_mutex_init(pthread_mutex_t*mutex,const pthread_mutexattr_t*mutexattr) {
memset(mutex,0,sizeof(pthread_mutex_t));
if (mutexattr) {
mutex->kind=mutexattr->__mutexkind;
}
mutex->lock.__spinlock=PTHREAD_SPIN_UNLOCKED;
return 0;
} | false | false | false | false | false | 0 |
vartable_iter_from_varno(gint var, GGobiData *d, GtkTreeModel **model, GtkTreeIter *iter)
{
GtkTreeModel *loc_model;
GtkTreePath *path;
gboolean valid;
loc_model = vartable_tree_model_get(d);
if (!loc_model)
return(FALSE);
path = gtk_tree_path_new_from_indices(var, -1);
valid = gtk_tree_model_get_it... | false | false | false | false | false | 0 |
_add_env2(struct job_descriptor *job_desc, char *key, char *val)
{
int len;
char *new_env;
if (!job_desc->environment || !key || !val)
return; /* Nothing we can do for interactive jobs */
len = strlen(key) + strlen(val) + 2;
new_env = xmalloc(len);
snprintf(new_env, len, "%s=%s", key, val);
_add_env(job_desc... | false | false | false | false | false | 0 |
pstore_column_matches(struct pstore_column *self, char *ref)
{
if (ref)
return id_or_name_matches(self->column_id, self->name, ref);
return true;
} | false | false | false | false | false | 0 |
refs_independent_p (mem_ref_p ref1, mem_ref_p ref2)
{
if (ref1 == ref2
|| bitmap_bit_p (ref1->indep_ref, ref2->id))
return true;
if (bitmap_bit_p (ref1->dep_ref, ref2->id))
return false;
if (!MEM_ANALYZABLE (ref1)
|| !MEM_ANALYZABLE (ref2))
return false;
if (dump_file && (dump_flags & T... | false | false | false | false | false | 0 |
close_func(LexState*ls){
lua_State*L=ls->L;
FuncState*fs=ls->fs;
Proto*f=fs->f;
removevars(ls,0);
luaK_ret(fs,0,0);
luaM_reallocvector(L,f->code,f->sizecode,fs->pc,Instruction);
f->sizecode=fs->pc;
luaM_reallocvector(L,f->lineinfo,f->sizelineinfo,fs->pc,int);
f->sizelineinfo=fs->pc;
luaM_reallocvector(L,f->k,f->sizek,f... | false | false | false | false | false | 0 |
i915_update_sprite_point_enable(struct gl_context *ctx)
{
struct intel_context *intel = intel_context(ctx);
/* _NEW_PROGRAM */
struct i915_fragment_program *p =
(struct i915_fragment_program *) ctx->FragmentProgram._Current;
const GLbitfield64 inputsRead = p->FragProg.Base.InputsRead;
struct i915_c... | false | false | false | false | false | 0 |
efx_ef10_sriov_assign_vf_vport(struct efx_nic *efx,
unsigned int vf_i)
{
struct efx_ef10_nic_data *nic_data = efx->nic_data;
struct ef10_vf *vf = nic_data->vf + vf_i;
int rc;
if (WARN_ON_ONCE(!nic_data->vf))
return -EOPNOTSUPP;
rc = efx_ef10_vport_alloc(efx, EVB_PORT_ID_ASSIGNED,
MC_CMD_VPORT_ALLO... | false | false | false | false | false | 0 |
FreeRedoListHead(void) {
if (RedoList) {
UndoScoreElement *elem = RedoList->data;
RedoList = g_list_remove(RedoList, elem);
g_free(elem);
}
} | false | false | false | false | false | 0 |
irq_domain_add_simple(struct device_node *of_node,
unsigned int size,
unsigned int first_irq,
const struct irq_domain_ops *ops,
void *host_data)
{
struct irq_domain *domain;
domain = __irq_domain_add(of_node_to_fwnode(of_node), size, size, 0, ops, host_data);
if (!domain)
return NULL;
if... | false | false | false | false | false | 0 |
gms_free(HMMWork *wrk)
{
free_gsset(wrk);
free_state2gs(wrk);
free(wrk->gsindex);
if (wrk->fallback_score != NULL) {
free(wrk->fallback_score[0]);
free(wrk->fallback_score);
free(wrk->gms_is_selected);
}
gms_gprune_free(wrk);
} | false | false | false | false | false | 0 |
get_sos (j_decompress_ptr cinfo)
/* Process a SOS marker */
{
IJG_INT32 length;
int i, ci, n, c, cc;
jpeg_component_info * compptr;
INPUT_VARS(cinfo);
if (! cinfo->marker->saw_SOF)
ERREXIT(cinfo, JERR_SOS_NO_SOF);
INPUT_2BYTES(cinfo, length, return FALSE);
INPUT_BYTE(cinfo, n, return FALSE); /* Num... | false | false | false | false | false | 0 |
Hierarchical(char genemetric, char arraymetric, char method, char* jobname)
{ int ok;
FILE* outputfile;
const int n = strlen(jobname) + strlen(".ext") + 1;
char* const filename = malloc(n*sizeof(char));
if (!filename)
{ printf("ERROR: Failed to allocate memory for file name\n");
return;
}
if (genemetr... | false | false | false | false | true | 1 |
fill(Home home,
Float::Linear::Term*& tf,
FloatVal m, FloatVal& d) const {
switch (this->t) {
case NT_CONST:
Float::Limits::check(m*c,"MiniModel::LinFloatExpr");
d += m*c;
break;
case NT_VAR:
Float::Limits::check(m*a,"MiniModel:... | false | false | false | false | false | 0 |
acpi_penalize_sci_irq(int irq, int trigger, int polarity)
{
if (irq >= 0 && irq < ARRAY_SIZE(acpi_irq_penalty)) {
if (trigger != ACPI_MADT_TRIGGER_LEVEL ||
polarity != ACPI_MADT_POLARITY_ACTIVE_LOW)
acpi_irq_penalty[irq] += PIRQ_PENALTY_ISA_ALWAYS;
else
acpi_irq_penalty[irq] += PIRQ_PENALTY_PCI_USING;
... | false | false | false | false | false | 0 |
ntb_store_save_message(struct ntb_store *store,
int64_t timestamp,
struct ntb_key *from_key,
const char *from_address,
struct ntb_key *to_key,
struct ntb_blob *blob)
{
struct ntb_store_task *task;
... | false | false | false | false | false | 0 |
conversion_error_other (int errnum, const char* infilename)
{
fflush(stdout);
if (column > 0)
putc('\n',stderr);
error(0,errnum,
/* TRANSLATORS: The first part of an error message.
It is followed by a colon and a detail message.
The placeholders expand to the input file name, a l... | false | false | false | false | false | 0 |
create_treenode(struct tt *tt, struct libmnt_table *tb,
struct libmnt_fs *fs, struct tt_line *parent_line)
{
struct libmnt_fs *chld = NULL;
struct libmnt_iter *itr = NULL;
struct tt_line *line;
int rc = -1;
if (!fs) {
/* first call, get root FS */
if (mnt_table_get_root_fs(tb, &fs))
goto leave;
par... | false | false | false | false | false | 0 |
match_graph_event(int action_id, xmlNode * event, const char *event_node,
int op_status, int op_rc, int target_rc)
{
const char *target = NULL;
const char *allow_fail = NULL;
const char *this_event = NULL;
crm_action_t *action = NULL;
action = get_action(action_id, FALSE);
if ... | false | false | false | false | false | 0 |
pt2258_stereo_volume_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_pt2258 *pt = kcontrol->private_data;
int base = kcontrol->private_value;
unsigned char bytes[2];
int val0, val1;
val0 = 79 - ucontrol->value.integer.value[0];
val1 = 79 - ucontrol->value.integer.valu... | true | true | false | false | false | 1 |
sa_filter_check_arguments(void *data, GtError *err)
{
GthSAFilter *sa_filter= (GthSAFilter*) data;
int had_err = 0;
gt_error_check(err);
gt_assert(sa_filter);
if (sa_filter->min_alignmentscore > sa_filter->max_alignmentscore) {
gt_error_set(err, "argument \"%.2f\" to option -%s must be smaller or "
... | false | false | false | false | false | 0 |
v_timer_advance(VUtilTimer *timer, double seconds)
{
if(timer == NULL)
return;
timer->seconds += (uint32) seconds;
timer->fractions += (uint32) ((seconds - (int) seconds) * (double) 0xffffffff);
} | false | false | false | false | false | 0 |
open_share_lock(SeqTable seq)
{
LocalTransactionId thislxid = MyProc->lxid;
/* Get the lock if not already held in this xact */
if (seq->lxid != thislxid)
{
ResourceOwner currentOwner;
currentOwner = CurrentResourceOwner;
PG_TRY();
{
CurrentResourceOwner = TopTransactionResourceOwner;
LockRelationOi... | false | false | false | false | false | 0 |
advOpCleanupSpace()
{
tsh_put_it in ;
tsh_put_ot out ;
char wid[100], *var, *sid ;
space1_t *s, *t ;
/* send tuple name, priority, length */
if (!readn(newsock, (char *)&in, sizeof(tsh_put_it)))
{
return ;
}
in.proc_id = ntohl(in.p... | false | false | false | false | false | 0 |
isdn_audio_put_dle_code(modem_info *info, u_char code)
{
struct sk_buff *skb;
int di;
int ch;
char *p;
skb = dev_alloc_skb(2);
if (!skb) {
printk(KERN_WARNING
"isdn_audio: Could not alloc skb for ttyI%d\n",
info->line);
return;
}
p = (char *) skb_put(skb, 2);
p[0] = 0x10;
p[1] = code;
... | false | false | false | false | false | 0 |
EmitAssemblerFlag(MCAssemblerFlag Flag) {
switch (Flag) {
default: llvm_unreachable("not implemented");
case MCAF_SyntaxUnified:
case MCAF_Code16:
break;
}
} | false | false | false | false | false | 0 |
adjust_task_time ( offset )
int offset;
{
TaskData *td;
int st = get_selected_task ();
if ( st < 0 ) {
create_confirm_window ( CONFIRM_ERROR,
gettext("Error"),
gettext("You have not selected\na task to adjust the time for."),
gettext("Ok"), NULL, NULL,
NULL, NULL, NULL,
NULL );
... | false | false | false | false | false | 0 |
fm10k_mbx_process_error(struct fm10k_hw *hw,
struct fm10k_mbx_info *mbx)
{
const u32 *hdr = &mbx->mbx_hdr;
u16 head;
/* we will need to pull all of the fields for verification */
head = FM10K_MSG_HDR_FIELD_GET(*hdr, HEAD);
switch (mbx->state) {
case FM10K_STATE_OPEN:
case FM10K_STATE_DISCONNECT:
/* fl... | false | false | false | false | false | 0 |
store_data_bypass_p (rtx out_insn, rtx in_insn)
{
rtx out_set, in_set;
in_set = single_set (in_insn);
if (! in_set)
abort ();
if (GET_CODE (SET_DEST (in_set)) != MEM)
return false;
out_set = single_set (out_insn);
if (out_set)
{
if (reg_mentioned_p (SET_DEST (out_set), SET_DEST (in_set)... | false | false | false | false | false | 0 |
get_official_ip(void)
{
gw_assert(official_ip != NULL);
return official_ip;
} | false | false | false | false | false | 0 |
hol_append (struct hol *hol, struct hol *more)
{
struct hol_cluster **cl_end = &hol->clusters;
/* Steal MORE's cluster list, and add it to the end of HOL's. */
while (*cl_end)
cl_end = &(*cl_end)->next;
*cl_end = more->clusters;
more->clusters = 0;
/* Merge entries. */
if (more->num_entries > 0)
... | false | false | false | false | false | 0 |
gdata_youtube_video_set_category (GDataYouTubeVideo *self, GDataMediaCategory *category)
{
g_return_if_fail (GDATA_IS_YOUTUBE_VIDEO (self));
g_return_if_fail (GDATA_IS_MEDIA_CATEGORY (category));
gdata_media_group_set_category (self->priv->media_group, category);
g_object_notify (G_OBJECT (self), "category");
} | false | false | false | false | false | 0 |
jbitmap_check(struct jbitmaps *bms)
{
if (bms->msize == ((Job_seg.dptr->js_maxjobs + 31) >> 5) << 2)
return 1;
jbitmap_free(bms);
return jbitmap_init(bms);
} | false | false | false | false | false | 0 |
writeToElement(QDomElement & ercElement, QDomDocument & doc) {
switch (m_eType) {
case Ground:
ercElement.setAttribute("etype", "ground");
writeCurrent(ercElement, doc);
break;
case VCC:
ercElement.setAttribute("etype", "VCC");
writeCurrent(ercElement, doc);
writeVoltage(ercElement, doc);
brea... | false | false | false | false | false | 0 |
knh_class_Generics(CTX ctx, kclass_t bcid, kParam *pa)
{
const knh_ClassTBL_t *t = ClassTBL(bcid);
while(t != NULL) {
if(t->cparam != NULL && knh_Param_equalsType(pa, t->cparam)) {
return t->cid;
}
t = t->simTBL;
}
if(bcid == CLASS_Immutable) {
kclass_t p1 = knh_Param_get(pa,0)->type;
if(p1 < ctx->shar... | false | false | false | false | false | 0 |
gvrender_end_graph(GVJ_t * job)
{
gvrender_engine_t *gvre = job->render.engine;
if (gvre) {
if (gvre->end_graph)
gvre->end_graph(job);
}
gvdevice_format(job);
} | false | false | false | false | false | 0 |
address_is_invalid_destination(const char *address, int client)
{
if (client) {
if (get_options()->AllowNonRFC953Hostnames)
return 0;
} else {
if (get_options()->ServerDNSAllowNonRFC953Hostnames)
return 0;
}
while (*address) {
if (TOR_ISALNUM(*address) ||
*address == '-' ||
... | false | false | false | false | false | 0 |
originalString() const
{
return element() ? element()->string() : 0;
} | false | false | false | false | false | 0 |
SendKillMessage(int id, int victim)
{
int suicide = 0;
if (id == 0) {id = victim; suicide = 1;}
byte sHealth[4];
byte sArmor[4]; //= player[id].health
int sHealthLength = sprintf((char*)sHealth, "%i", (int) player[id].health);
int sArmorLength = sprintf((char*)sArmor, "%i", (int) player[id].armor);
int sNameLeng... | false | false | false | false | false | 0 |
search_table_chain_for_operator (TABLE_T * s, char * n, MOID_T * x, MOID_T * y)
{
if (is_mode_isnt_well (x)) {
return (error_tag);
} else if (y != NO_MOID && is_mode_isnt_well (y)) {
return (error_tag);
}
while (s != NO_TABLE) {
TAG_T *z = search_table_for_operator (OPERATORS (s), n, x, y);
if (... | false | false | false | false | false | 0 |
rfio_lasthost() /* returns last succesfully connected host */
{
char *last_host = NULL;
int last_host_len = 256;
Cglobals_get(&last_host_key, (void**)&last_host, last_host_len);
TRACE(4, "rfio", "connect: last_host_name: %s", last_host);
return(last_host);
} | false | false | false | false | false | 0 |
FnCallExecResult(struct FnCall *fp,struct Rlist *finalargs)
/* execresult("/programpath",useshell|noshell) */
{
struct Rval rval;
char buffer[CF_EXPANDSIZE];
int ret = false;
buffer[0] = '\0';
/* begin fn specific content */
if (!IsAbsoluteFileName(finalargs->item))
{
CfOut(cf_error,"","execres... | false | false | false | false | false | 0 |
dumpGraph (mcGraph* mcG, char* fname)
{
FILE* fp = fopen (fname, "w");
int id, id2, idx;
mcLevel *l;
mcLevel *nextl;
mcNode *n;
mcNode *nn;
mcEdge *e;
int dely = 72;
int delx = 100;
char* color;
char buf[512];
char buf2[512];
int width, maxl;
if (!fp) {
fprintf ... | true | true | false | false | true | 1 |
escape_text(const char *prepend, const char *str, unsigned escapee)
{
unsigned retlen, remainlen, chunklen;
char *ret, *found;
char append;
append = (char)escapee;
escapee >>= 8;
remainlen = strlen(str);
retlen = strlen(prepend);
ret = xmalloc(retlen + remainlen * 2 + 1 + 1);
strcpy(ret, prepend);
for (;;)... | false | false | false | false | false | 0 |
io_hci_data(void)
{
unsigned char buf[HCI_MAX_FRAME_SIZE], *ptr;
int type;
ssize_t len;
ptr = buf;
len = read(vdev.dev_fd, buf, sizeof(buf));
if (len < 0) {
if (errno == EAGAIN)
return;
syslog(LOG_ERR, "Read failed: %s (%d)", strerror(errno), errno);
__io_canceled = 1;
return;
}
type = *ptr++;
... | false | false | false | false | false | 0 |
push(int a){
stackElement.push_back(a);
if(stackMin.empty() || stackMin.back()>=a)
stackMin.push_back(a);
} | false | false | false | false | false | 0 |
gst_audio_encoder_set_hard_resync (GstAudioEncoder * enc, gboolean enabled)
{
g_return_if_fail (GST_IS_AUDIO_ENCODER (enc));
GST_LOG_OBJECT (enc, "enabled: %d", enabled);
GST_OBJECT_LOCK (enc);
enc->priv->hard_resync = enabled;
GST_OBJECT_UNLOCK (enc);
} | false | false | false | false | false | 0 |
startHumanMove (int x, int y)
{
int index = x * m_side + y;
bool humanPlayer = (! isComputer (m_currentPlayer));
qDebug() << "CLICK" << x << y << "index" << index;
if (! humanPlayer) {
buttonClick();
}
else if (humanPlayer && ((m_currentPlayer == m_box->owner(index)) ||
(m_box->owner(ind... | false | false | false | false | false | 0 |
ethif_probe2(int unit)
{
unsigned long base_addr = netdev_boot_base("eth", unit);
if (base_addr == 1)
return;
(void)( probe_list2(unit, m68k_probes, base_addr == 0) &&
probe_list2(unit, isa_probes, base_addr == 0));
} | false | false | false | false | false | 0 |
remove_conditions_and_labels (loop_p loop)
{
gimple_stmt_iterator gsi;
unsigned int i;
for (i = 0; i < loop->num_nodes; i++)
{
basic_block bb = ifc_bbs[i];
if (bb_with_exit_edge_p (loop, bb)
|| bb == loop->latch)
continue;
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); )
s... | false | false | false | false | false | 0 |
N106_Power(void)
{
int x;
SetReadHandler(0x8000,0xFFFF,CartBR);
SetWriteHandler(0x8000,0xffff,Mapper19_write);
SetWriteHandler(0x4020,0x5fff,Mapper19_write);
if(!is210)
{
SetWriteHandler(0xc000,0xdfff,Mapper19C0D8_write);
SetReadHandler(0x4800,0x4fff,Namco_Read4800);
... | false | false | false | false | false | 0 |
btmrvl_sdio_register_dev(struct btmrvl_sdio_card *card)
{
struct sdio_func *func;
u8 reg;
int ret = 0;
if (!card || !card->func) {
BT_ERR("Error: card or function is NULL!");
ret = -EINVAL;
goto failed;
}
func = card->func;
sdio_claim_host(func);
ret = sdio_enable_func(func);
if (ret) {
BT_ERR("sdi... | false | false | false | false | false | 0 |
get_fg_tile_info(int tile_index)
{
int code = (gomoku_videoram[tile_index]);
int attr = (gomoku_colorram[tile_index]);
int color = (attr& 0x0f);
int flipyx = (attr & 0xc0) >> 6;
SET_TILE_INFO(
0,
code,
color,
TILE_FLIPYX(flipyx))
} | false | false | false | false | false | 0 |
anyUsePart(const QString & moduleID) {
foreach (QWidget *widget, QApplication::topLevelWidgets()) {
MainWindow *mainWindow = qobject_cast<MainWindow *>(widget);
if (mainWindow == NULL) continue;
if (mainWindow->usesPart(moduleID)) {
return true;
}
}
return fals... | false | false | false | false | false | 0 |
stringio_read(stringio *self, PyObject *args)
{
Py_ssize_t size, n;
Py_UCS4 *output;
PyObject *arg = Py_None;
CHECK_INITIALIZED(self);
if (!PyArg_ParseTuple(args, "|O:read", &arg))
return NULL;
CHECK_CLOSED(self);
if (PyNumber_Check(arg)) {
size = PyNumber_AsSsize_t(arg, Py... | false | false | false | false | false | 0 |
fc_rpsc2_build(struct fchs_s *fchs, struct fc_rpsc2_cmd_s *rpsc2, u32 d_id,
u32 s_id, u32 *pid_list, u16 npids)
{
u32 dctlr_id = FC_DOMAIN_CTRLR(bfa_hton3b(d_id));
int i = 0;
fc_els_req_build(fchs, bfa_hton3b(dctlr_id), s_id, 0);
memset(rpsc2, 0, sizeof(struct fc_rpsc2_cmd_s));
rpsc2->els_cmd.els_code = FC_EL... | false | false | false | false | false | 0 |
mapToSource( const QModelIndexList& list ) const
{
QModelIndexList originalList;
foreach( const QModelIndex &index, list )
{
QModelIndex originalIndex = mapToSource( index );
if( originalIndex.isValid() )
originalList << originalIndex;
}
return originalList;
} | false | false | false | false | false | 0 |
slotOff(OPLL_SLOT * slot) {
if (slot->eg_mode == ATTACK)
slot->eg_phase = EXPAND_BITS(AR_ADJUST_TABLE[HIGHBITS(slot->eg_phase, EG_DP_BITS - EG_BITS)], EG_BITS, EG_DP_BITS);
slot->eg_mode = RELEASE;
} | false | false | false | false | false | 0 |
kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx,
struct kvm_io_device *dev)
{
int i;
struct kvm_io_bus *new_bus, *bus;
bus = kvm->buses[bus_idx];
if (!bus)
return;
for (i = 0; i < bus->dev_count; i++)
if (bus->range[i].dev == dev) {
break;
}
if (i == bus->dev_count)
return;... | false | true | false | false | false | 1 |
Set(size_t idx)
{
if(idx >= nbits) return;
if( !_isfull() && !_isset(idx) ){
b[idx / 8] |= BIT_HEX[idx % 8];
nset++;
if( _isfull() && b){ delete []b; b = (unsigned char*) 0;}
}
} | false | false | false | false | false | 0 |
create_form_expr(Bounds *b, uint histid)
{
ht_expr_search_form *form = new ht_expr_search_form();
form->init(b, 0, (List*)getAtomValue(histid));
return form;
} | false | false | false | false | false | 0 |
scm_to_bool (SCM x)
{
if (scm_is_eq (x, SCM_BOOL_F))
return 0;
else if (scm_is_eq (x, SCM_BOOL_T))
return 1;
else
scm_wrong_type_arg (NULL, 0, x);
} | false | false | false | false | false | 0 |
init_cifs_idmap(void)
{
struct cred *cred;
struct key *keyring;
int ret;
cifs_dbg(FYI, "Registering the %s key type\n",
cifs_idmap_key_type.name);
/* create an override credential set with a special thread keyring in
* which requests are cached
*
* this is used to prevent malicious redirections from bei... | false | false | false | false | false | 0 |
produce_socket(struct mg_context *ctx, const struct socket *sp) {
(void) pthread_mutex_lock(&ctx->mutex);
// If the queue is full, wait
while (ctx->stop_flag == 0 &&
ctx->sq_head - ctx->sq_tail >= (int) ARRAY_SIZE(ctx->queue)) {
(void) pthread_cond_wait(&ctx->sq_empty, &ctx->mutex);
}
... | false | false | false | false | false | 0 |
makedir(std::string &dirname) {
if(plug) {
plug->error_description="";
std::string dname=remove_head_dir_s(dirname,point.length());
return plug->makedir(dname);
};
return 1;
} | false | false | false | false | false | 0 |
sanei_genesys_set_buffer_address (Genesys_Device * dev, uint32_t addr)
{
SANE_Status status;
if(dev->model->asic_type==GENESYS_GL847
|| dev->model->asic_type==GENESYS_GL846
|| dev->model->asic_type==GENESYS_GL124)
{
DBG (DBG_warn,
"sanei_genesys_set_buffer_address: shouldn't be used for GL846+... | false | false | false | false | false | 0 |
dup_bsock(BSOCK *osock)
{
BSOCK *bsock = (BSOCK *)malloc(sizeof(BSOCK));
memcpy(bsock, osock, sizeof(BSOCK));
bsock->msg = get_pool_memory(PM_BSOCK);
bsock->errmsg = get_pool_memory(PM_MESSAGE);
if (osock->who()) {
bsock->set_who(bstrdup(osock->who()));
}
if (osock->host()) {
bsock->set... | false | false | false | false | false | 0 |
IntrUnbComObjName (
UInt rnam )
{
Obj record; /* record, left operand */
/* ignore or code */
if ( IntrReturning > 0 ) { return; }
if ( IntrIgnoring > 0 ) { return; }
if ( IntrCoding > 0 )... | 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.