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 |
|---|---|---|---|---|---|---|
compute_peratom()
{
invoked_peratom = update->ntimestep;
// grow tvector array if necessary
if (atom->nlocal > nmax) {
memory->sfree(tvector);
nmax = atom->nmax;
tvector = (double *) memory->smalloc(nmax*sizeof(double),"tvector/atom:tvector");
vector_atom = tvector;
}
double *e = atom->e;
... | false | false | false | false | false | 0 |
msg_scroll_up()
{
#ifdef FEAT_GUI
/* Remove the cursor before scrolling, ScreenLines[] is going
* to become invalid. */
if (gui.in_use)
gui_undraw_cursor();
#endif
/* scrolling up always works */
screen_del_lines(0, 0, 1, (int)Rows, TRUE, NULL);
if (!can_clear((char_u *)" "))
{
/* Scroll... | false | false | false | false | false | 0 |
print_mem_expr (outfile, expr)
FILE *outfile;
tree expr;
{
if (TREE_CODE (expr) == COMPONENT_REF)
{
if (TREE_OPERAND (expr, 0))
print_mem_expr (outfile, TREE_OPERAND (expr, 0));
else
fputs (" <variable>", outfile);
if (DECL_NAME (TREE_OPERAND (expr, 1)))
fprintf (outfile, ".%s",
... | false | false | false | false | true | 1 |
plugrack_use_by_type( plugrack_t rack,
const char *full_type )
{
ListIterator it;
plugrack_entry_t *e;
if ( (!rack) || (!full_type) )
return PLUGIN_INVALID_HANDLE;
it = list_iterator_create(rack->entries);
while ((e = list_next(it))) {
plugin_err_t err;
if (strcmp(full_type, e->full_type) != 0)
... | false | false | false | false | false | 0 |
ecdsa_address_decode(const char *addr, uint8_t *out)
{
if (!addr) return 0;
return base58_decode_check(addr, out, 21) == 21;
} | false | false | false | false | false | 0 |
mpu_synth_ioctl(int dev, unsigned int cmd, void __user *arg)
{
int midi_dev;
struct mpu_config *devc;
midi_dev = synth_devs[dev]->midi_dev;
if (midi_dev < 0 || midi_dev >= num_midis || midi_devs[midi_dev] == NULL)
return -ENXIO;
devc = &dev_conf[midi_dev];
switch (cmd)
{
case SNDCTL_SYNTH_INFO:
if (c... | false | false | false | false | false | 0 |
DGG_copyConstraint(DGG_constraint_t* c)
{
DGG_constraint_t *nc = NULL;
if (!c || c->max_nz <= 0) return nc;
nc = DGG_newConstraint(c->max_nz);
if (nc == NULL) return nc;
nc->nz = c->nz;
nc->rhs = c->rhs;
nc->sense = c->sense;
memcpy(nc->coeff, c->coeff, sizeof(double)*nc->nz);
memcpy(nc->index, c->... | false | false | false | false | false | 0 |
on_expose_event(GdkEventExpose* event)
{
Glib::RefPtr<Gdk::Window> window = get_window();
if (window)
{
float len, x, y, xscale, yscale;
Gtk::Allocation allocation = get_allocation();
const int width = allocation.get_width();
const int height = allocation.get_height();
Cairo::RefPtr<Cairo::Context> cr = ... | false | false | false | false | false | 0 |
ath9k_hw_wow_set_arwr_reg(struct ath_hw *ah)
{
u32 wa_reg;
if (!ah->is_pciexpress)
return;
/*
* We need to untie the internal POR (power-on-reset)
* to the external PCI-E reset. We also need to tie
* the PCI-E Phy reset to the PCI-E reset.
*/
wa_reg = REG_READ(ah, AR_WA);
wa_reg &= ~AR_WA_UNTIE_RESET_E... | false | false | false | false | false | 0 |
kill_object()
{
ED4_species_manager *species_manager = get_parent( ED4_L_SPECIES )->to_species_manager();
ED4_manager *parent_manager = species_manager->parent;
ED4_group_manager *group_manager = 0;
if (species_manager->flag.is_consensus) // whole group has to be ki... | false | false | false | false | false | 0 |
host_address_extract_port(uschar *address)
{
int skip = -3; /* Skip 3 dots in IPv4 addresses */
address--;
while (*(++address) != 0)
{
int ch = *address;
if (ch == ':') skip = 0; /* Skip 0 dots in IPv6 addresses */
else if (ch == '.' && skip++ >= 0) break;
}
if (*address == 0) re... | false | false | false | false | false | 0 |
transUpdFlds(e,cs,flds)/* Translate e{flds} */
Cell e; /* (cs is corresp list of constrs) */
List cs;
List flds; {
Cell nv = inventVar();
Cell body = ap(nv,translate(e));
List fs = flds;
List args = NIL;
List alts = NIL;
for (; nonNull(fs); fs=tl... | false | false | false | false | false | 0 |
lpfc_els_rsp_reject(struct lpfc_vport *vport, uint32_t rejectError,
struct lpfc_iocbq *oldiocb, struct lpfc_nodelist *ndlp,
LPFC_MBOXQ_t *mbox)
{
struct lpfc_hba *phba = vport->phba;
IOCB_t *icmd;
IOCB_t *oldcmd;
struct lpfc_iocbq *elsiocb;
uint8_t *pcmd;
uint16_t cmdsize;
int rc;
cmdsize = 2 * si... | false | false | false | false | false | 0 |
readarheader(parchentry)
char **parchentry;
{
struct ar_hdr arheader;
char *endptr;
char *nameptr;
if (readineofok((char *) &arheader, sizeof arheader))
return 0;
strncpy (*parchentry = nameptr = ourmalloc(sizeof arheader.ar_name + 1),
arheader.ar_name, sizeof arheader.ar_name);
endptr =... | false | false | false | false | false | 0 |
lpfc_bsg_sli_cfg_dma_desc_setup(struct lpfc_hba *phba, enum nemb_type nemb_tp,
uint32_t index, struct lpfc_dmabuf *mbx_dmabuf,
struct lpfc_dmabuf *ext_dmabuf)
{
struct lpfc_sli_config_mbox *sli_cfg_mbx;
/* pointer to the start of mailbox command */
sli_cfg_mbx = (struct lpfc_sli_config_mbox *)mbx_dmabuf->vi... | false | false | false | false | false | 0 |
delay_store(struct device_driver *ddp, const char *buf,
size_t count)
{
int delay, res;
if ((count > 0) && (1 == sscanf(buf, "%d", &delay))) {
res = count;
if (scsi_debug_delay != delay) {
unsigned long iflags;
int k;
spin_lock_irqsave(&queued_arr_lock, iflags);
k = find_first_bit(queued_in_us... | false | false | false | false | false | 0 |
acllas__verify_ldapurl(Slapi_Entry* e, void *callback_data)
{
Slapi_Attr *attr;
struct userdnattr_info *info;
Slapi_Value *sval;
const struct berval *attrVal;
int rc;
info = (struct userdnattr_info *) callback_data;
info->result = ACL_FALSE;
rc = slapi_entry_attr_find( e, info->attr, &attr);
i... | false | false | false | false | false | 0 |
get_union_pw_aff(__isl_take isl_pw_multi_aff *pma, void *user)
{
struct isl_union_pw_multi_aff_get_union_pw_aff_data *data = user;
int n_out;
isl_pw_aff *pa;
if (!pma)
return -1;
n_out = isl_pw_multi_aff_dim(pma, isl_dim_out);
if (data->pos >= n_out) {
isl_pw_multi_aff_free(pma);
return 0;
}
pa = isl_p... | false | false | false | false | false | 0 |
present_units_fortify_callback(Widget w, XtPointer client_data,
XtPointer call_data)
{
struct unit *punit =
player_unit_by_number(client_player(), (size_t) client_data);
if (NULL != punit) {
request_unit_fortify(punit);
}
destroy_message_dialog(w);
} | false | false | false | false | false | 0 |
checkAccess(const Job& job, Token t, u_int op)
{
fxAssert(t != T_JOB, "checkAccess token should *not* be T_JOB");
u_int n = N(params)-1;
u_int i = 0;
while (i < n && params[i].t != t)
i++;
u_int m = params[i].protect;
if (m&op) // other/public access
return (true);
if (IS(PRIVILEGED) ... | false | false | false | false | false | 0 |
uri_normalized_copy (const char *part, int length,
const char *unescape_extra)
{
unsigned char *s, *d, c;
char *normalized = g_strndup (part, length);
gboolean need_fixup = FALSE;
if (!unescape_extra)
unescape_extra = "";
s = d = (unsigned char *)normalized;
while (*s) {
if (*s == '%') {
if (!g_as... | false | false | false | false | false | 0 |
GedAllocSpace(
F_Pool * pPool,
NODE * pNode,
FLMUINT valType,
FLMUINT size,
FLMUINT uiEncId,
FLMUINT uiEncSize)
{
FLMBYTE * rPtr;
FLMUINT uiAllocSize = size;
if (valType == FLM_TEXT_TYPE)
{
uiAllocSize++;
}
if (uiAllocSize <= sizeof(void *))
{
// If the size is less than sizeof (void ... | false | false | false | false | true | 1 |
end_parse (cfile)
struct parse **cfile;
{
/* "Memory" config files have no file. */
if ((*cfile)->file != -1) {
munmap((*cfile)->inbuf, (*cfile)->bufsiz);
close((*cfile)->file);
}
if ((*cfile)->saved_state != NULL) {
dfree((*cfile)->saved_state, MDL);
}
dfree(*cfile, MDL);
*cfile = NULL;
return ISC_R... | false | false | false | false | false | 0 |
LFree(LObject *obj)
{
if (obj == NULL || obj == Lnil || obj == Lt) return;
LRefDecr(obj);
if ( obj->ref == 0 ) {
(*obj->type->free)(&(obj->cell));
FREELIST_FREE(LObject, obj);
}
} | false | false | false | false | false | 0 |
__ecereMethod___ecereNameSpace__ecere__JSONGlobalSettings_Load(struct __ecereNameSpace__ecere__com__Instance * f, struct __ecereNameSpace__ecere__com__Instance * globalSettings)
{
int result = 0;
{
struct __ecereNameSpace__ecere__com__Instance * parser = (parser = __ecereNameSpace__ecere__com__eInstance_New(__ecereCla... | false | false | false | false | false | 0 |
rb_const_set(VALUE klass, ID id, VALUE val)
{
rb_const_entry_t *ce;
VALUE visibility = CONST_PUBLIC;
if (NIL_P(klass)) {
rb_raise(rb_eTypeError, "no class/module to define constant %s",
rb_id2name(id));
}
check_before_mod_set(klass, id, val, "constant");
if (!RCLASS_CONST_TBL(klass)) {
RC... | false | false | false | false | false | 0 |
main(int argc, char *argv[])
{
string s;
int c;
/* Bind the parser callback routines to our handlers */
set_error_handler(handle_error);
set_start_handler(start);
set_end_handler(end);
set_comment_handler(handle_comment);
set_text_handler(handle_text);
set_decl_handler(handle_decl);
set_pi_handler(... | false | true | false | false | true | 1 |
mt_touch_input_mapped(struct hid_device *hdev, struct hid_input *hi,
struct hid_field *field, struct hid_usage *usage,
unsigned long **bit, int *max)
{
if (usage->type == EV_KEY || usage->type == EV_ABS)
set_bit(usage->type, hi->input->evbit);
return -1;
} | false | false | false | false | false | 0 |
drm_intel_gem_bo_set_tiling(drm_intel_bo *bo, uint32_t * tiling_mode,
uint32_t stride)
{
drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bo->bufmgr;
drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo;
int ret;
/* Tiling with userptr surfaces is not supported
* on all hardware so refuse it for ... | false | false | false | false | false | 0 |
amd_get_subcaches(int cpu)
{
struct pci_dev *link = node_to_amd_nb(amd_get_nb_id(cpu))->link;
unsigned int mask;
int cuid;
if (!amd_nb_has_feature(AMD_NB_L3_PARTITIONING))
return 0;
pci_read_config_dword(link, 0x1d4, &mask);
cuid = cpu_data(cpu).compute_unit_id;
return (mask >> (4 * cuid)) & 0xf;
} | false | false | false | false | false | 0 |
getRow(uchar *dest)
{
int n, i;
if (!_rle) {
for (i = 0; i < _xsize; i++) {
if (_pos >= _data.end())
return false;
dest[i] = uchar(*_pos);
_pos += _bpc;
}
return true;
}
for (i = 0; i < _xsize;) {
if (_bpc == 2)
... | false | false | false | false | false | 0 |
vx_clock_mode_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct vx_core *chip = snd_kcontrol_chip(kcontrol);
if (ucontrol->value.enumerated.item[0] > 2)
return -EINVAL;
mutex_lock(&chip->mixer_mutex);
if (chip->clock_mode != ucontrol->value.enumerated.item[0]) {
chip->clock_mode ... | false | false | false | false | false | 0 |
process_homing_weapon_info( ubyte *data, header *hinfo )
{
int offset;
ushort weapon_signature, homing_signature;
char h_subsys;
object *homing_object, *weapon_objp;
weapon *wp;
offset = HEADER_LENGTH;
// get the data for the packet
GET_USHORT( weapon_signature );
GET_USHORT( homing_signature );
GET_DATA( h... | false | false | false | false | false | 0 |
shutdown_performance_schema(void)
{
pfs_initialized= false;
cleanup_performance_schema();
/*
Be careful to not delete un-initialized keys,
this would affect key 0, which is THR_KEY_mysys,
*/
if (THR_PFS_initialized)
{
my_pthread_setspecific_ptr(THR_PFS, NULL);
pthread_key_delete(THR_PFS);
... | false | false | false | false | false | 0 |
populate_from_stdin(struct diff_filespec *s)
{
struct strbuf buf;
size_t size = 0;
strbuf_init(&buf, 0);
if (strbuf_read(&buf, 0, 0) < 0)
return error("error while reading from stdin %s",
strerror(errno));
s->should_munmap = 0;
s->data = strbuf_detach(&buf, &size);
s->size = size;
s->should_free = ... | false | false | false | false | false | 0 |
dcopy_(int n, double *dx, double *dy)
{
int i, m;
if (n <= 0) {
return;
}
m = n % 7;
if (m != 0) {
for (i = 0; i < m; ++i) {
dy[i] = dx[i];
}
if (n < 7) {
return;
}
}
for (i = m; i < n; i += 7) {
dy[i] = dx[i];
dy[i + 1] = dx[i + 1];
dy[i + 2] = dx[i + 2];
dy[i + 3] = ... | false | false | false | false | false | 0 |
mips64_trigger_timer_irq(cpu_mips_t *cpu)
{
mips_cp0_t *cp0 = &cpu->cp0;
cpu->timer_irq_count++;
cp0->reg[MIPS_CP0_COUNT] = (m_uint32_t)cp0->reg[MIPS_CP0_COMPARE];
mips64_set_irq(cpu,7);
mips64_update_irq_flag_fast(cpu);
} | false | false | false | false | false | 0 |
generateMovesForPiece(QVarLengthArray<Move>& moves,
int pieceType,
int square) const
{
// Generate drops
if (square == 0)
{
const int size = arraySize();
const int maxRank = height() - 2;
for (int i = 0; i < size; i++)
{
Piece tmp = pieceAt(i);
if (!tmp.isEmpty())
continue;
if ... | false | false | false | false | false | 0 |
MapScalarsToTexture(
vtkDataSet* output, vtkDataArray* scalars, vtkDataSet* input)
{
// Create new coordinates if necessary.
// Need to compare lookup table incase the range has changed.
vtkDataArray* tcoords = output->GetPointData()->GetTCoords();
if (tcoords == 0 ||
this->GetMTime() > tcoords->GetMTime... | false | false | false | false | false | 0 |
on_color_remove_button_clicked (GtkButton * button, gpointer user_data)
{
GtkTreePath *gpath = NULL;
GtkTreeViewColumn *gcol = NULL;
GtkTreeIter it;
EATreePos ep;
if (!get_color_store (&ep))
return;
/* gets the row (path) at cursor */
gtk_tree_view_get_cursor (ep.gv, &gpath, &gcol);
if (!gpath)
... | false | false | false | false | false | 0 |
calendar_event_notify(const void *data)
{
struct ast_calendar_event *event = (void *)data;
int res = -1;
pthread_t notify_thread = AST_PTHREADT_NULL;
if (!(event && event->owner)) {
ast_log(LOG_ERROR, "Extremely low-cal...in fact cal is NULL!\n");
return res;
}
ao2_ref(event, +1);
event->notify_sched = -1;... | false | false | false | false | false | 0 |
do_put_one_link(const char *hostport, const char *source_file, const char *target_file, time_t stoptime)
{
char linkdata[CHIRP_PATH_MAX];
INT64_T result;
result = readlink(source_file, linkdata, sizeof(linkdata));
if(result > 0) {
linkdata[result] = 0;
chirp_reli_unlink(hostport, target_file, stoptime);
resu... | true | true | false | false | true | 1 |
__cpufreq_stats_free_table(struct cpufreq_policy *policy)
{
struct cpufreq_stats *stats = policy->stats;
/* Already freed */
if (!stats)
return;
pr_debug("%s: Free stats table\n", __func__);
sysfs_remove_group(&policy->kobj, &stats_attr_group);
kfree(stats->time_in_state);
kfree(stats);
policy->stats = NUL... | false | false | false | false | false | 0 |
gmlHugeFileRewiterReset( struct huge_helper *helper )
{
/* resetting an empty helper struct */
struct huge_parent *pNext;
struct huge_parent *p = helper->pFirstParent;
/* cleaning any previous item */
while( p != NULL )
{
pNext = p->pNext;
struct huge_child *pChildNext;
stru... | false | false | false | false | false | 0 |
device_property_hash(
gconstpointer key)
{
/* modified version of glib's hash function, copyright
* GLib Team and others 1997-2000. */
const char *p = key;
guint h = toupper_and_underscore(*p);
if (h)
for (p += 1; *p != '\0'; p++)
h = (h << 5) - h + toupper_and_underscore(*p);
return h... | false | false | false | false | false | 0 |
inverseComposition(
const CPosePDFGaussian &x1,
const CPosePDFGaussian &x0,
const CMatrixDouble33 &COV_01 )
{
double cp0 = cos(x0.mean.phi());
double sp0 = sin(x0.mean.phi());
// jacob: dh_x1
CMatrixDouble33 dh_x1;
dh_x1(0,0) = cp0; dh_x1(0,1) = sp0;
dh_x1(1,0) = -sp0; dh_x1(1,1) = cp0;
dh_x1(2,2) = 1;
... | false | false | false | false | false | 0 |
hdspm_get_aes_sample_rate(struct hdspm *hdspm, int index)
{
int timecode;
switch (hdspm->io_type) {
case AES32:
timecode = hdspm_read(hdspm, HDSPM_timecodeRegister);
return (timecode >> (4*index)) & 0xF;
break;
default:
break;
}
return 0;
} | false | false | false | false | false | 0 |
printit(int pflag, int tflag)
{
LVAL fptr,val;
/* get expression to print and file pointer */
val = xlgetarg();
fptr = (moreargs() ? xlgetfile() : getvalue(s_stdout));
xllastarg();
/* print the value */
xlprint(fptr,val,pflag);
/* terminate the print line if necessary */
if (tflag... | false | false | false | false | false | 0 |
scvt_s(const char *fmt, const char **pos, VALIST ap, ajint width,
AjBool convert, AjBool *ok)
{
const char *p;
const char *q;
char *val = NULL;
static const char *wspace = " \n\t";
ajint c = 0;
AjPStr t = NULL;
(void) fmt; /* make it used */
p... | false | false | false | false | false | 0 |
state_supplement (GSimpleAsyncResult *res,
gboolean async)
{
GcrImporterData *data = g_simple_async_result_get_op_res_gpointer (res);
GcrPkcs11Importer *self = data->importer;
GError *error = NULL;
if (self->interaction == NULL || !GCR_IS_IMPORT_INTERACTION (self->interaction)) {
complete_suppl... | false | false | false | false | false | 0 |
SetNumberOfRows(vtkIdType numberOfRows)
{
//deallocate previous rows, allocate new ones
if (this->Array)
{
for (int i=0; i<this->NumberOfRows; i++)
{
this->Array[i]->Delete();
}
delete[] this->Array;
this->Array = NULL;
}
this->NumberOfRows = numberOfRows;
this->Array = ne... | false | false | false | false | false | 0 |
write_client_routines(const statement_list_t *stmts)
{
unsigned int proc_offset = 0;
int expr_eval_routines;
if (need_inline_stubs_file( stmts ))
{
write_exceptions( client );
print_client( "\n");
}
write_formatstringsdecl(client, indent, stmts, need_stub);
expr_eval_routin... | false | false | false | false | false | 0 |
__qede_probe(struct pci_dev *pdev, u32 dp_module, u8 dp_level,
enum qede_probe_mode mode)
{
struct qed_slowpath_params params;
struct qed_dev_eth_info dev_info;
struct qede_dev *edev;
struct qed_dev *cdev;
int rc;
if (unlikely(dp_level & QED_LEVEL_INFO))
pr_notice("Starting qede probe\n");
cdev = qed_ops-... | false | false | false | false | false | 0 |
operator<<(QDebug dbg, const QGeoPositionInfo &info)
{
dbg.nospace() << "QGeoPositionInfo(" << info.d->timestamp;
dbg.nospace() << ", ";
dbg.nospace() << info.d->coord;
QList<int> attribs = info.d->doubleAttribs.keys();
for (int i = 0; i < attribs.count(); i++) {
dbg.nospace() << ", ";
... | false | false | false | false | false | 0 |
ucstrTextClone(UText *dest, const UText * src, UBool deep, UErrorCode * status) {
// First do a generic shallow clone.
dest = shallowTextClone(dest, src, status);
// For deep clones, make a copy of the string.
// The copied storage is owned by the newly created clone.
// A non-NULL pointer in UTe... | false | false | false | false | false | 0 |
Unpack_Track_2(UCHAR *b1, UCHAR *b2, USHORT pklen2, USHORT unpklen, UCHAR cmode, UCHAR flags){
switch (cmode){
case 0:
/* No Compression */
memcpy(b2,b1,(size_t)unpklen);
break;
case 1:
/* Simple Compression */
if (Unpack_RLE(b1,b2,unpklen)) return ERR_BADDECR;
break;
case 2:
/* Qu... | false | false | false | false | false | 0 |
wrap_mode_toggled (GtkWidget *widget,
GladeLabelEditor *label_editor)
{
GladeProperty *property;
if (label_editor->loading || !label_editor->loaded_widget)
return;
if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (label_editor->wrap_mode_radio)))
return;
label_editor->modifying = TRUE;
... | false | false | false | false | false | 0 |
execute_jump (void)
{
delete_trivially_dead_insns (get_insns (), max_reg_num ());
if (dump_file)
dump_flow_info (dump_file, dump_flags);
cleanup_cfg ((optimize ? CLEANUP_EXPENSIVE : 0)
| (flag_thread_jumps ? CLEANUP_THREADING : 0));
return 0;
} | false | false | false | false | false | 0 |
cl_miller_rabin_test (const cl_I& n, int count, cl_I* factor)
{
// [Cohen], section 8.2, algorithm 8.2.2.
var cl_modint_ring R = find_modint_ring(n); // Z/nZ
var cl_I m = n-1;
var uintC e = ord2(m);
m = m>>e;
// n-1 = 2^e*m
var cl_MI one = R->one();
var cl_MI minusone = R->uminus(one);
for (int i = 0; i < coun... | false | false | false | false | false | 0 |
hp_dam(int spell, int hp)
{
const struct mon_spell *rs_ptr = &mon_spell_table[spell];
int dam;
/* Damage is based on monster's current hp */
dam = hp / rs_ptr->div;
/* Check for maximum damage */
if (dam > rs_ptr->cap)
dam = rs_ptr->cap;
return dam;
} | false | false | false | false | false | 0 |
World_getTile( World *w, u32 x, u32 y ) {
if( w && x < wmap_width && y < wmap_height )
return &w->tiles[y*wmap_width + x];
return NULL;
} | false | false | false | false | false | 0 |
prune(Space& home) {
return me_failed(x.include(home,n)) ? ES_FAILED : ES_OK;
} | false | false | false | false | false | 0 |
numCharRef(Char c)
{
const SP_NAMESPACE_SCOPE StringC *name = charEntityName(c);
if (name && name->size())
os() << '&' << *name << ';';
else
numCharRefNum(c);
} | false | false | false | false | false | 0 |
symbolOperation(symbol* s1, symbol* s2, char operation, int line) {
/* INTEGER operations */
if(s1->type == INTEGER && s2->type == INTEGER) {
int result = 0;
switch(operation) {
case '+':
result = s1->value.intval + s2->value.intval;
break;
... | true | true | false | false | false | 1 |
sis190_hw_start(struct net_device *dev)
{
struct sis190_private *tp = netdev_priv(dev);
void *ioaddr = tp->mmio_addr;
sis190_soft_reset(ioaddr);
SIS_W32(TxDescStartAddr, tp->tx_dma);
SIS_W32(RxDescStartAddr, tp->rx_dma);
SIS_W32(IntrStatus, 0xffffffff);
SIS_W32(IntrMask, 0x0);
SIS_W32(GMIIControl, 0x0);
SIS... | false | false | false | false | false | 0 |
mode2flags(mode, flagsp)
CONST char *mode;
int *flagsp;
{
int flags;
if (!mode) {
errno = EINVAL;
return(-1);
}
flags = 0;
if (flagsp) flags |= (*flagsp & ~O_ACCMODE);
switch (*(mode++)) {
case 'r':
flags |= O_RDONLY;
break;
case 'w':
flags |= (O_WRONLY | O_CREAT | O_TRUNC);
break;
case 'a... | false | false | false | false | false | 0 |
NC3_inq_var(int ncid,
int varid,
char *name,
nc_type *typep,
int *ndimsp,
int *dimids,
int *nattsp)
{
int status;
NC *ncp;
NC_var *varp;
size_t ii;
status = NC_check_id(ncid, &ncp);
if(status != NC_NOERR)
return status;
varp = elem_NC_vararray(&ncp->vars, (size_t)varid);
if(varp == NULL)
return NC_... | false | true | false | false | false | 1 |
split(char bych) const {
GLEArrayImpl* res = new GLEArrayImpl();
unsigned int pos = 0;
unsigned int prevpos = 0;
while (true) {
while (pos < m_Length && m_Data[pos] != (unsigned int)bych) pos++;
if (pos >= m_Length) {
/* not found */
res->addObject(substring(prevpos, pos));
break;
} else {
/* foun... | false | false | false | false | false | 0 |
rfb_decoder_state_reason (RfbDecoder * decoder)
{
gint reason_length;
rfb_decoder_read (decoder, 4);
reason_length = RFB_GET_UINT32 (decoder->data);
rfb_decoder_read (decoder, reason_length);
GST_WARNING ("Reason by server: %s", decoder->data);
return FALSE;
} | false | false | false | false | false | 0 |
load_message_content_cb(struct ntb_blob *content_blob,
void *user_data)
{
struct ntb_keyring_message *message = user_data;
struct ntb_keyring *keyring = message->keyring;
struct ntb_key *from_key = message->from_key;
struct ntb_buffer buffer;
size_t messag... | false | false | false | false | false | 0 |
get_ip(unsigned char *ptr)
{
if (!ptr) return 0;
/* awkward, but this way we avoid bus errors on architectures that
don't support mis-aligned accesses */
return htonl((ptr[0] << 24) | (ptr[1] << 16) | (ptr[2] << 8) | ptr[3]);
} | false | false | false | false | false | 0 |
_compute_taps_center(Long_Tap_Type *st,
Evas_Coord *x_out,
Evas_Coord *y_out,
Pointer_Event *pe)
{
Eina_List *l;
Pointer_Event *p;
Evas_Coord x = 0, y = 0;
if (!eina_list_count(st->touched))
return;
EINA_LIST_FOREACH (st->touched, l, p... | false | false | false | false | false | 0 |
SetControlIntValue( wxPGProperty* WXUNUSED(property), wxWindow* ctrl, int value ) const
{
if ( value != 0 ) value = 1;
((wxSimpleCheckBox*)ctrl)->m_state = value;
ctrl->Refresh();
} | false | false | false | false | false | 0 |
GDALCreateWarpedVRT( GDALDatasetH hSrcDS,
int nPixels, int nLines, double *padfGeoTransform,
GDALWarpOptions *psOptions )
{
VALIDATE_POINTER1( hSrcDS, "GDALCreateWarpedVRT", NULL );
/* -------------------------------------------------------------------- */
/* Cr... | false | false | false | false | false | 0 |
lfdaws(x)
double x;
{ static double val[] = {
0, 0.24485619356002, 0.46034428261948, 0.62399959848185, 0.72477845900708,
0.76388186132749, 0.75213621001998, 0.70541701910853, 0.63998807456541,
0.56917098836654, 0.50187821196415, 0.44274283060424, 0.39316687916687,
0.35260646480842, 0.31964847250685... | false | false | false | false | false | 0 |
arc_measure(const P& loc, P leg1, P leg2, const P& offset,
const std::string& text, epix_label_posn align,
double scale)
{
const double norm1(norm(leg1));
const double norm2(norm(leg2));
if (norm1 < EPIX_EPSILON || norm2 < EPIX_EPSILON)
return;
//else normalize
leg1 *= 1.0/norm1;... | false | false | false | false | false | 0 |
PyBool_FromLong(long ok)
{
PyObject *result;
if (ok)
result = Py_True;
else
result = Py_False;
Py_INCREF(result);
return result;
} | false | false | false | false | false | 0 |
print_shader_log(GLuint shader)
{
GLsizei len = 0;
SYM(glGetShaderiv)(shader, GL_INFO_LOG_LENGTH, &len);
if (!len)
return;
char *buffer = new char[len];
SYM(glGetShaderInfoLog)(shader, len, &len, buffer);
if (log_cb)
log_cb(RETRO_LOG_INFO, "%s\n", buffer);
delete[] buffer;
} | false | false | false | false | false | 0 |
bnxt_unregister_dev(struct bnxt_en_dev *edev, int ulp_id)
{
struct net_device *dev = edev->net;
struct bnxt *bp = netdev_priv(dev);
struct bnxt_ulp *ulp;
int i = 0;
ASSERT_RTNL();
if (ulp_id >= BNXT_MAX_ULP)
return -EINVAL;
ulp = &edev->ulp_tbl[ulp_id];
if (!rcu_access_pointer(ulp->ulp_ops)) {
netdev_err(... | false | false | false | false | false | 0 |
iwl_mvm_tt_initialize(struct iwl_mvm *mvm, u32 min_backoff)
{
struct iwl_mvm_tt_mgmt *tt = &mvm->thermal_throttle;
IWL_DEBUG_TEMP(mvm, "Initialize Thermal Throttling\n");
if (mvm->cfg->thermal_params)
tt->params = *mvm->cfg->thermal_params;
else
tt->params = iwl_mvm_default_tt_params;
tt->throttle = false;
... | false | false | false | false | false | 0 |
Initialize (request, new, args, num_args)
Widget request, new;
ArgList args;
Cardinal *num_args;
{
NetstatWidget w = (NetstatWidget) new;
int shape_event_base, shape_error_base;
if (w->core.width <= 0) w->core.width = 1;
if (w->core.height <= 0) w->core.height = 1;
if (w->netstat.shape... | false | false | false | false | false | 0 |
spl_filesystem_file_read(spl_filesystem_object *intern, int silent TSRMLS_DC) /* {{{ */
{
char *buf;
size_t line_len = 0;
long line_add = (intern->u.file.current_line || intern->u.file.current_zval) ? 1 : 0;
spl_filesystem_file_free_line(intern TSRMLS_CC);
if (php_stream_eof(intern->u.file.stream)) {
if (!sil... | false | false | false | false | false | 0 |
dosallclose(VOID_A)
{
int i, n;
n = 0;
for (i = maxdosf - 1; i >= 0; i--)
if (dosflist[i]._base && dosclose(i + DOSFDOFFSET) < 0)
n = -1;
for (i = maxdev - 1; i >= 0; i--) {
if (!(devlist[i].drive)) continue;
devlist[i].nlink = 0;
if (_dosclosedev(i) < 0) n = seterrno(doserrno);
}
return(n);
} | false | false | false | false | false | 0 |
goo_canvas_widget_accessible_new (GObject *object)
{
AtkObject *accessible;
g_return_val_if_fail (GOO_IS_CANVAS_WIDGET (object), NULL);
accessible = g_object_new (goo_canvas_widget_accessible_get_type (), NULL);
atk_object_initialize (accessible, object);
return accessible;
} | false | false | false | false | false | 0 |
EC_EX_DATA_get_data(const EC_EXTRA_DATA *ex_data,
void *(*dup_func)(void *), void (*free_func)(void *), void (*clear_free_func)(void *))
{
const EC_EXTRA_DATA *d;
for (d = ex_data; d != NULL; d = d->next)
{
if (d->dup_func == dup_func && d->free_func == free_func && d->clear_free_func == clear_free_func)
re... | false | false | false | false | false | 0 |
hex2str (const char *hexstring, char *buffer, size_t bufsize, size_t *buflen)
{
const char *s = hexstring;
int idx, count;
int need_nul = 0;
if (buflen)
*buflen = 0;
for (s=hexstring, count=0; hexdigitp (s) && hexdigitp (s+1); s += 2, count++)
;
if (*s && (!isascii (*s) || !isspace (*s)) )
ret... | false | false | false | false | false | 0 |
timeconvert(char *p, int plen, int year, int month, int day, int *fdate)
{
int c;
unsigned long nanosecs;
unsigned long u;
time_t secs = 0;
struct tm *t;
p++;
while (((c = *p++) != ' ') && (c != '.') && (--plen > 0)) {
u = c - '0';
if (u >= 10) {
u = c - 'a';
if (u >= 6)
break;
u += 10;
}
... | false | false | false | false | false | 0 |
strappend (char *fst, const char *snd)
{
char *res = xrealloc (fst, strlen (fst) + strlen (snd) + 1);
return res ? strcat (res, snd) : NULL;
} | false | true | false | false | false | 1 |
cros_ec_spi_probe(struct spi_device *spi)
{
struct device *dev = &spi->dev;
struct cros_ec_device *ec_dev;
struct cros_ec_spi *ec_spi;
int err;
spi->bits_per_word = 8;
spi->mode = SPI_MODE_0;
err = spi_setup(spi);
if (err < 0)
return err;
ec_spi = devm_kzalloc(dev, sizeof(*ec_spi), GFP_KERNEL);
if (ec_spi... | false | false | false | false | false | 0 |
G_SerPortSetLineState
(const INT16 dum_Handle,
const BYTE Line, const INT32 Enable, const WORD32 Time)
{
int iRetour;
int sStatLine;
WORD32 time = Time;
struct pollfd filedes[1];
INT32 enable = Enable;
BYTE line = Line;
if (port_fd < 0)
{
return GE_HOST_PORT_CLOSE;
}
#ifdef _HPUX_SOURCE
iRetour = ioctl(... | false | false | false | false | false | 0 |
SolveP4Bi(double *x, double b, double d) // solve equation x^4 + b*x^2 + d = 0
{
double D = b*b-4*d;
if( D>=0 )
{
double sD = sqrt(D);
double x1 = (-b+sD)/2;
double x2 = (-b-sD)/2; // x2 <= x1
if( x2>=0 ) // 0 <= x2 <= x1, 4 real roots
{
double sx1 = sqrt(x1);
double sx2 = sqrt(x2);
x[0] = -sx... | false | false | false | false | false | 0 |
f_char(VALUE *vp)
{
char ch;
VALUE result;
/* initialize VALUE */
result.v_subtype = V_NOSUBTYPE;
switch(vp->v_type) {
case V_NUM:
if (qisfrac(vp->v_num))
return error_value(E_CHAR);
ch = (char) vp->v_num->num.v[0];
if (qisneg(vp->v_num))
ch = -ch;
break;
case V_OCTET:
ch = *vp->v_octe... | false | false | false | false | false | 0 |
amdgpu_uvd_note_usage(struct amdgpu_device *adev)
{
bool set_clocks = !cancel_delayed_work_sync(&adev->uvd.idle_work);
set_clocks &= schedule_delayed_work(&adev->uvd.idle_work,
msecs_to_jiffies(UVD_IDLE_TIMEOUT_MS));
if (set_clocks) {
if (adev->pm.dpm_enabled) {
amdgpu_dpm_enable_uvd(adev, true);
} ... | false | false | false | false | false | 0 |
fbh_delfbfig (listfbfig, ptfbfig, mode)
struct fbfig *listfbfig; /* list of fbfig containing the object */
struct fbfig *ptfbfig; /* pointer of the BEFIG to be deleted */
char mode; /* recursive delete or not (Y or N) */
{
struct fbfig headfig;
struct fbfig *ptlastfig;
struct ptype... | false | false | false | false | false | 0 |
find_neighbors (GfsBox * box, GArray * pe)
{
FttDirection d;
for (d = 0; d < FTT_NEIGHBORS; d++)
if (GFS_IS_BOUNDARY_MPI (box->neighbor[d])) {
guint process = GFS_BOUNDARY_MPI (box->neighbor[d])->process;
gboolean found = FALSE;
gint i;
for (i = 0; i < pe->len && !found; i++)
if (g_arra... | false | false | false | false | false | 0 |
pump_setxattr (call_frame_t *frame, xlator_t *this,
loc_t *loc, dict_t *dict, int32_t flags)
{
afr_private_t * priv = NULL;
afr_local_t * local = NULL;
call_frame_t *transaction_frame = NULL;
int ret = -1;
int op_errno = 0;
VALIDATE_OR_GOTO (frame, out);
VALIDATE_OR_GOTO (this, out);
VALI... | false | false | false | false | false | 0 |
idbm_open_rec_w(char *portal, char *config)
{
struct stat statb;
FILE *f;
int err;
log_debug(5, "Looking for config file %s\n", portal);
err = stat(portal, &statb);
if (err)
goto mkdir_portal;
if (!S_ISDIR(statb.st_mode)) {
/*
* Old style portal as a file. Let's update it.
*/
if (unlink(portal)) {... | false | false | false | false | false | 0 |
noncjk_letters(const UT_UCSChar* str,int len) const
{
if (!cjk_locale())
return 1;
for(int i=0;i<len;++i) {
if (is_cjk_letter(str[i]))
return 0;
};
return 1;
} | false | false | false | false | false | 0 |
reg_w_val(struct gspca_dev *gspca_dev, __u16 index, __u8 value)
{
int ret;
struct usb_device *dev = gspca_dev->dev;
ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
0, /* request */
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
value, index, NULL, 0, 500);
PDEBUG(D_USBO, "reg wri... | false | false | false | false | false | 0 |
ibuf_delete_for_discarded_space(
/*============================*/
ulint space) /*!< in: space id */
{
mem_heap_t* heap;
btr_pcur_t pcur;
dtuple_t* search_tuple;
const rec_t* ibuf_rec;
ulint page_no;
mtr_t mtr;
/* Counts for discarded operations. */
ulint dops[IBUF_OP_COUNT];
heap = mem_heap_create(512);
... | 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.