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 |
|---|---|---|---|---|---|---|
ReadAbaqusField(FILE *in,char *buffer,int *argtype,int *argno)
/* This subroutine reads the Abaqus file format and tries to make
sence out of it.
*/
{
int i,val,digits;
static int maxargno=0,mode=0;
val = fgetc(in);
if(val==EOF) return(-1);
if(val=='\n') val = fgetc(in);
if(val=='*') {
if(0) p... | false | false | false | false | false | 0 |
ajTablestrHashCase(const void* key, ajulong hashsize)
{
ajulong hash = 0UL;
const char* s = NULL;
const AjPStr str = NULL;
str = (const AjPStr) key;
s = ajStrGetPtr(str);
for(hash = 0; *s; s++)
hash = (hash * 127 + toupper((ajint)*s)) % hashsize;
return hash;
} | false | false | false | false | false | 0 |
keydb_check_key (cdk_packet_t pkt)
{
cdk_pkt_pubkey_t pk;
int is_sk, valid;
if (pkt->pkttype == CDK_PKT_PUBLIC_KEY ||
pkt->pkttype == CDK_PKT_PUBLIC_SUBKEY)
{
pk = pkt->pkt.public_key;
is_sk = 0;
}
else if (pkt->pkttype == CDK_PKT_SECRET_KEY ||
pkt->pkttype == CDK_PKT_SECRE... | false | false | false | false | false | 0 |
dce6_latency_watermark(struct dce6_wm_params *wm)
{
/* First calcualte the latency in ns */
u32 mc_latency = 2000; /* 2000 ns. */
u32 available_bandwidth = dce6_available_bandwidth(wm);
u32 worst_chunk_return_time = (512 * 8 * 1000) / available_bandwidth;
u32 cursor_line_pair_return_time = (128 * 4 * 1000) / avail... | false | false | false | false | false | 0 |
pawn_continued(chunk_t *pc, int br_level)
{
if (pc == NULL)
{
return(false);
}
if ((pc->level > br_level) ||
(pc->type == CT_ARITH) ||
(pc->type == CT_QUESTION) ||
(pc->type == CT_BOOL) ||
(pc->type == CT_ASSIGN) ||
(pc->type == CT_COMMA) ||
(pc->type == CT_CO... | false | false | false | false | false | 0 |
f2fs_update_dentry(nid_t ino, umode_t mode, struct f2fs_dentry_ptr *d,
const struct qstr *name, f2fs_hash_t name_hash,
unsigned int bit_pos)
{
struct f2fs_dir_entry *de;
int slots = GET_DENTRY_SLOTS(name->len);
int i;
de = &d->dentry[bit_pos];
de->hash_code = name_hash;
de->name_len = cpu_to_le16(name->l... | false | false | false | false | false | 0 |
ocfs2_super_unlock(struct ocfs2_super *osb,
int ex)
{
int level = ex ? DLM_LOCK_EX : DLM_LOCK_PR;
struct ocfs2_lock_res *lockres = &osb->osb_super_lockres;
if (!ocfs2_mount_local(osb))
ocfs2_cluster_unlock(osb, lockres, level);
} | false | false | false | false | false | 0 |
dump_ov_princ(krb5_context context, krb5_db_entry *entry, const char *name,
FILE *fp, krb5_boolean verbose, krb5_boolean omit_nra)
{
char *princstr;
unsigned int x;
int y, foundcrc;
krb5_tl_data tl_data;
osa_princ_ent_rec adb;
XDR xdrs;
krb5_key_data *key_data;
tl_data.tl_... | false | false | false | false | false | 0 |
get_boundary(struct mimestack *m,
const char *errmsg,
FILE *fp)
{
const char *p;
do
{
p=newboundary();
} while (!good_boundary(p, m, errmsg, fp));
return (p);
} | false | false | false | false | false | 0 |
zeta(Param *parami, Param *paramj, double rsqij,
double rsqik, double *delrij, double *delrik, int i, double xcn)
{
double rij,rik,costheta,arg,ex_delr,rlm3;
rij = sqrt(rsqij);
if (rij > parami->bigr+parami->bigd) return 0.0;
rik = sqrt(rsqik);
costheta = vec3_dot(delrij,delrik) / (rij*rik);
rlm3 = para... | false | false | false | false | false | 0 |
read_tree_internal(git_index_tree **out,
const char **buffer_in, const char *buffer_end, git_index_tree *parent)
{
git_index_tree *tree;
const char *name_start, *buffer;
long count;
int error = GIT_SUCCESS;
if ((tree = git__malloc(sizeof(git_index_tree))) == NULL)
return GIT_ENOMEM;
memset(tree, 0x0, sizeof... | false | false | false | false | false | 0 |
matchKeyword (const char *keyword, const char *cp, const char **cp_n)
{
size_t kw_len = strlen (keyword);
if (strncmp (cp, keyword, kw_len) == 0 && isspace (cp[kw_len]))
{
*cp_n = skipSpace (&cp[kw_len + 1]);
return TRUE;
}
return FALSE;
} | false | false | false | false | false | 0 |
detecting(uint16_t contr, uint16_t unit)
{
bprintf(" Detecting IDE ");
if (contr == 0) {
if (unit == 0) {
bprintf("Primary Master ");
} else {
bprintf("Primary Slave ");
}
} else if (contr == 1) {
if (unit == 0) {
bprintf("Secondary Master");
} else {
bprintf("Secondary Slave ");
}
} els... | false | false | false | false | false | 0 |
expand_path(krb5_context context, PTYPE param, const char *postfix, char **ret)
{
*ret = strdup(postfix);
if (*ret == NULL)
return ENOMEM;
return 0;
} | false | false | false | false | false | 0 |
exportedObjects()
{
if (!s_exportedObjects) {
s_exportedObjects = new QHash<JSObject*, int>;
gcProtect(new ScriptableOperationsMarker());
}
return s_exportedObjects;
} | false | false | false | false | false | 0 |
ppc32_exec_XOR_dot(cpu_ppc_t *cpu,ppc_insn_t insn)
{
int rs = bits(insn,21,25);
int ra = bits(insn,16,20);
int rb = bits(insn,11,15);
m_uint32_t tmp;
tmp = cpu->gpr[rs] ^ cpu->gpr[rb];
ppc32_exec_update_cr0(cpu,tmp);
cpu->gpr[ra] = tmp;
return(0);
} | false | false | false | false | false | 0 |
cmp_iso_atw_diff_component_no( const void *a1, const void *a2 )
{
int ret = (int)((const inp_ATOM*)a1)->iso_atw_diff - (int)((const inp_ATOM*)a2)->iso_atw_diff;
if ( !ret ) /* make the sort stable */
ret = (int)((const inp_ATOM*)a1)->component - (int)((const inp_ATOM*)a2)->component;
return ret;
} | false | false | false | false | false | 0 |
sysfs_add_file_to_group(struct kobject *kobj,
const struct attribute *attr, const char *group)
{
struct kernfs_node *parent;
int error;
if (group) {
parent = kernfs_find_and_get(kobj->sd, group);
} else {
parent = kobj->sd;
kernfs_get(parent);
}
if (!parent)
return -ENOENT;
error = sysfs_add_file(pa... | false | false | false | false | false | 0 |
dvb_event_get_start_timestamp (DVBEvent* self) {
time_t result = 0;
struct tm utc_time = {0};
struct tm _tmp0_ = {0};
time_t _tmp1_ = 0;
g_return_val_if_fail (self != NULL, 0);
dvb_event_get_utc_start_time (self, &_tmp0_);
utc_time = _tmp0_;
_tmp1_ = mktime (&utc_time);
result = _tmp1_;
return result;
} | false | false | false | false | false | 0 |
get_pwm(struct device *dev,
struct device_attribute *devattr, char *buf)
{
struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
struct max31790_data *data = max31790_update_device(dev);
int pwm;
if (IS_ERR(data))
return PTR_ERR(data);
pwm = data->pwm[attr->index] >> 8;
return sprintf(... | false | true | false | false | false | 1 |
get_bg_tile_info(int tile_index)
{
int attr = videoram[tile_index];
int code = ((attr & 0x0f) << 2) | ((attr & 0x30) >> 4);
int color = (attr & 0x40) >> 6;
int flags = (attr & 0x80) ? TILE_FLIPX : 0;
SET_TILE_INFO(0, code, color, flags)
} | false | false | false | false | false | 0 |
hwloc__nolibxml_import_ignore_spaces(char *buffer)
{
return buffer + strspn(buffer, " \t\n");
} | false | false | false | false | false | 0 |
handle_ruleset_choices(const struct packet_ruleset_choices *packet)
{
char *rulesets[packet->ruleset_count];
int i;
size_t suf_len = strlen(RULESET_SUFFIX);
for (i = 0; i < packet->ruleset_count; i++) {
size_t len = strlen(packet->rulesets[i]);
rulesets[i] = fc_strdup(packet->rulesets[i]);
if (le... | true | true | true | false | false | 1 |
qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
Q_ASSERT(staticMetaObject.cast(_o));
AccountRegDlg *_t = static_cast<AccountRegDlg *>(_o);
switch (_id) {
case 0: _t->done((*reinterpret_cast< int(*)>(_a[1]))); brea... | false | false | false | false | false | 0 |
snd_pcm_trigger_tstamp(struct snd_pcm_substream *substream)
{
struct snd_pcm_runtime *runtime = substream->runtime;
if (runtime->trigger_master == NULL)
return;
if (runtime->trigger_master == substream) {
if (!runtime->trigger_tstamp_latched)
snd_pcm_gettime(runtime, &runtime->trigger_tstamp);
} else {
snd... | false | false | false | false | false | 0 |
evaluate(node *r)
{
/* fill in times and evaluate sum of squares for tree */
double sum;
long i;
sum = 0.0;
for (i = 0; i < (nonodes); i++)
curtree.nodep[i]->processed = curtree.nodep[i]->tip;
firstraverse(r, r,&sum);
sumtraverse(r, &sum);
examined++;
if (replicates && (lower || upper))
sum /=... | false | false | false | false | false | 0 |
detach()
{
_signal->_sending = false;
if( _signal->_dirty == false )
{
_signal->_sentry = 0;
_signal = 0;
return;
}
Signal::RouteMap::iterator it = _signal->_routes.begin();
while( it != _signal->_routes.end() )
{
if( it->second->valid() )
{
... | false | false | false | false | false | 0 |
allot_word(CELL vocab, CELL name)
{
REGISTER_ROOT(vocab);
REGISTER_ROOT(name);
F_WORD *word = allot_object(WORD_TYPE,sizeof(F_WORD));
UNREGISTER_ROOT(name);
UNREGISTER_ROOT(vocab);
word->hashcode = tag_fixnum((rand() << 16) ^ rand());
word->vocabulary = vocab;
word->name = name;
word->def = userenv[UNDEFINED_... | false | false | false | false | false | 0 |
bfad_cfg_pport(struct bfad_s *bfad, enum bfa_lport_role role)
{
int rc = BFA_STATUS_OK;
/* Allocate scsi_host for the physical port */
if ((supported_fc4s & BFA_LPORT_ROLE_FCP_IM) &&
(role & BFA_LPORT_ROLE_FCP_IM)) {
if (bfad->pport.im_port == NULL) {
rc = BFA_STATUS_FAILED;
goto out;
}
rc = bfad... | false | false | false | false | false | 0 |
theora_info_clear(theora_info *_ci){
th_api_wrapper *api;
api=(th_api_wrapper *)_ci->codec_setup;
memset(_ci,0,sizeof(*_ci));
if(api!=NULL){
if(api->clear!=NULL)(*api->clear)(api);
_ogg_free(api);
}
} | false | false | false | false | false | 0 |
parseSubProgram (tokenInfo * const token)
{
tokenInfo *const name = newToken ();
boolean endSubProgram = FALSE;
const vhdlKind kind = isKeyword (token, KEYWORD_FUNCTION) ?
VHDLTAG_FUNCTION : VHDLTAG_PROCEDURE;
Assert (isKeyword (token, KEYWORD_FUNCTION) ||
isKeyword (token, KEYWORD_PROCEDURE));
readToken (name... | false | false | false | false | false | 0 |
jsm_tty_get_mctrl(struct uart_port *port)
{
int result;
struct jsm_channel *channel =
container_of(port, struct jsm_channel, uart_port);
jsm_dbg(IOCTL, &channel->ch_bd->pci_dev, "start\n");
result = jsm_get_mstat(channel);
if (result < 0)
return -ENXIO;
jsm_dbg(IOCTL, &channel->ch_bd->pci_dev, "finish\n")... | false | false | false | false | false | 0 |
user_idle(time_t t, struct utmp* u) {
char tty[5 + sizeof u->ut_line + 1] = "/dev/";
unsigned int i;
for (i=0; i < sizeof(u->ut_line); i++) {
// clean up tty if garbled
if (isalnum((int) u->ut_line[i]) || (u->ut_line[i]=='/')) {
tty[i+5] = u->ut_line[i];
} else {
... | false | false | false | false | false | 0 |
gamgi_mesa_render_lines (int *lines, double *points)
{
int i, n_lines;
glBegin (GL_LINES);
i = 0;
n_lines = lines[i++];
while (n_lines-- > 0)
{
glVertex3dv (&points [3 * lines[i++]]);
glVertex3dv (&points [3 * lines[i++]]);
}
glEnd ();
} | false | false | false | false | false | 0 |
setStyled(FXbool styled){
if(styled && !sbuffer){
if(!FXCALLOC(&sbuffer,FXchar,length+gapend-gapstart)){fxerror("%s::setStyled: out of memory.\n",getClassName());}
update();
}
if(!styled && sbuffer){
FXFREE(&sbuffer);
update();
}
} | false | false | false | false | false | 0 |
clear() {
unsigned int i;
for(i=0;i<buttons.size();i++)
gtk_container_remove(GTK_CONTAINER(widget), buttons[i]);
// I tried a gtk_widget_destroy here but it seems gtk_container_remove
// already destroys it
buttons.clear();
} | false | false | false | false | false | 0 |
vmx_free_vcpu_nested(struct kvm_vcpu *vcpu)
{
struct vcpu_vmx *vmx = to_vmx(vcpu);
int r;
r = vcpu_load(vcpu);
BUG_ON(r);
vmx_load_vmcs01(vcpu);
free_nested(vmx);
vcpu_put(vcpu);
} | false | false | false | false | false | 0 |
initMasks(fd_set *rmask)
{
int maxsock = -1;
int i;
FD_ZERO(rmask);
for (i = 0; i < MAXLISTEN; i++)
{
int fd = ListenSocket[i];
if (fd == PGINVALID_SOCKET)
break;
FD_SET(fd, rmask);
if (fd > maxsock)
maxsock = fd;
}
return maxsock + 1;
} | false | false | false | false | false | 0 |
squelch_items(void)
{
int floor_list[MAX_FLOOR_STACK];
int floor_num, n;
int count = 0;
object_type *o_ptr;
/* Set the hook and scan the floor */
item_tester_hook = squelch_item_ok;
floor_num = scan_floor(floor_list, N_ELEMENTS(floor_list), p_ptr->py, p_ptr->px, 0x01);
if (floor_num)
{
for (n = 0; n < flo... | false | false | false | false | false | 0 |
camel_vee_data_cache_get_subfolder_data (CamelVeeDataCache *data_cache,
CamelFolder *folder)
{
CamelVeeSubfolderData *res;
g_return_val_if_fail (CAMEL_IS_VEE_DATA_CACHE (data_cache), NULL);
g_return_val_if_fail (CAMEL_IS_FOLDER (folder), NULL);
g_mutex_lock (&data_cache->p... | false | false | false | false | false | 0 |
receive_udp_packet( void *buf, int maxlen )
{
struct sockaddr from;
socklen_t fromlen;
int result;
fromlen = sizeof( from );
result = recvfrom( listening_socket, buf, maxlen, 0, &from, &fromlen );
if ( result == -1 ) {
if ( errno != EINTR ) {
printf( "recvfrom() returned an error which was not EINTR but %... | false | false | false | false | false | 0 |
DDstart(FromServer, ToServer)
FILE *FromServer;
FILE *ToServer;
{
DDHANDLE *h;
DDENTRY *ep;
FILE *F;
char buff[BUFSIZ];
char *p;
char *q;
int i;
char name[sizeof _PATH_TEMPACTIVE + 10];
/* Open the file. */
if ((F = fopen(_PATH_DISTPATS, "r")) != NULL)
name[0] = '\0';
... | false | false | false | false | true | 1 |
rbtree_iter_new(const rbtree_t *rbt)
{
rbtree_iter_t *ri;
rbtree_check(rbt);
WALLOC0(ri);
ri->magic = RBTREE_ITER_MAGIC;
ri->tree = rbt;
ri->next = erbtree_first(ERBTREE(rbt));
ri->stamp = rbt->stamp;
{
rbtree_t *wrbt = deconstify_pointer(rbt);
wrbt->refcnt++; /* Internal state, OK to change */
}
ret... | false | false | false | false | false | 0 |
parse_pixmap(
Window win, GC gc, colorset_t *cs, Bool *pixmap_is_a_bitmap)
{
static char *name = "parse_colorset(pixmap)";
FvwmPictureAttributes fpa;
/* dither */
fpa.mask = 0;
if (cs->dither)
{
fpa.mask = FPAM_DITHER;
}
/* read filename */
if (!cs->pixmap_args)
{
return;
}
/* load the file */
cs->p... | false | false | false | false | true | 1 |
_exif_private_ifd_get(int fd, int ifd_offset, int tiff_base, int little_endian, struct lms_image_info *info)
{
char buf[2];
unsigned int count;
if (lseek(fd, tiff_base + ifd_offset, SEEK_SET) == -1) {
perror("lseek");
return -1;
}
if (read(fd, buf, 2) != 2) {
perror("read")... | false | false | false | false | false | 0 |
elm_genlist_item_decorate_mode_get(const Elm_Object_Item *item)
{
Elm_Gen_Item *i = (Elm_Gen_Item *)item;
ELM_GENLIST_ITEM_CHECK_OR_RETURN(item, NULL);
return GL_IT(i)->wsd->decorate_it_type;
} | false | false | false | false | false | 0 |
drawIntersections(Display *dpy, Window window, GC fgc, struct field *f)
{
int i,j;
/* One might be tempted to think 'hey, this is a crude algorithm
* that is going to check each of the n (n-1) / 2 possible
* intersections! Why not try bsp trees, quad trees, etc, etc,
* etc'
*
* In pra... | false | false | false | false | false | 0 |
onAvatarImageReady()
{
if (sender()) {
QNetworkReply *reply = qobject_cast<QNetworkReply*> (sender());
if (reply) {
if (reply->error() != QNetworkReply::NoError) {
qDebug() << "Error in" << reply->url() << ":" << reply->errorString();
return;
... | false | false | false | false | false | 0 |
Interpret (Command* cmd) {
if (cmd->IsA(ALIGNTOGRID_CMD)) {
float cx, cy;
GetGraphic()->GetCenter(cx, cy);
((AlignToGridCmd*) cmd)->Align(this, cx, cy);
} else {
GraphicView::Interpret(cmd);
}
} | false | false | false | false | false | 0 |
is_ok_location(schar x, schar y, int humidity)
{
int typ;
if (Is_waterlevel(&u.uz)) return true; /* accept any spot */
if (humidity & DRY)
{
typ = levl[x][y].typ;
if (typ == ROOM || typ == AIR ||
typ == CLOUD || typ == ICE || typ == CORR)
return true;
}
... | false | false | false | false | false | 0 |
sal_udelay(uint32 usec)
{
static volatile int _sal_udelay_counter;
static int loops = 0;
int ix, iy;
if (loops == 0 || usec == 0) { /* Need calibration? */
int max_loops;
int start = 0, stop = 0;
int mpt = USECS_PER_JIFFY; /* usec/tick */
for (loops = 1; loops... | false | false | false | false | false | 0 |
ikrt_bnnegate(ikptr x, ikpcb* pcb){
ikptr fst = ref(x, -vector_tag);
long int limb_count = bnfst_limb_count(fst);
if(limb_count == 1){
if(! bnfst_negative(fst)){
/* positive bignum */
mp_limb_t limb =
(mp_limb_t) ref(x, disp_bignum_data - vector_tag);
if(limb == (most_positive_fixnum... | false | false | false | false | false | 0 |
action_show(struct mddev *mddev, char *page)
{
char *type = "idle";
unsigned long recovery = mddev->recovery;
if (test_bit(MD_RECOVERY_FROZEN, &recovery))
type = "frozen";
else if (test_bit(MD_RECOVERY_RUNNING, &recovery) ||
(!mddev->ro && test_bit(MD_RECOVERY_NEEDED, &recovery))) {
if (test_bit(MD_RECOVER... | false | false | false | false | false | 0 |
searchPath(
const char *pathlist, const char *filename, const char *suffix,
int type)
{
char *path;
int filename_len;
int maxpath_len;
if (filename == NULL || *filename == 0)
{
return NULL;
}
if (pathlist == NULL || *pathlist == 0)
{
/* use pwd if no path list is given */
pathlist = ".";
}
filename... | false | false | false | false | false | 0 |
xsh_arclist_load(cpl_frame* frame){
cpl_table* table = NULL;
const char* tablename = NULL;
xsh_arclist* result = NULL;
int i = 0;
/* verify input */
XSH_ASSURE_NOT_NULL( frame);
/* get table filename */
check(tablename = cpl_frame_get_filename(frame));
XSH_TABLE_LOAD( table, tablename);
/* allo... | false | false | false | false | false | 0 |
translate_contig (unsigned int *genomicstart, unsigned int *genomiclength,
char *contig, unsigned int left, unsigned int length, IIT_T contig_iit) {
int rc = 1, index;
Interval_T interval;
if ((index = IIT_find_one(contig_iit,contig)) >= 0) {
interval = IIT_interval(contig_iit,index);
*genomicstart... | false | false | false | false | false | 0 |
crcSlow(void * datas, int nBytes)
{
crc remainder = INITIAL_REMAINDER;
unsigned char * message = datas;
int byte;
unsigned char bit;
/*
* Perform modulo-2 division, a byte at a time.
*/
for (byte = 0; byte < nBytes; ++byte)
{
/*
* Bring the next byte into the remainder.
... | false | false | false | false | false | 0 |
_dbus_logger_iface_favourite_contacts_changed (GObject* _sender, const char* account_path, gchar** added, int added_length1, gchar** removed, int removed_length1, gpointer* _data) {
GDBusConnection * _connection;
const gchar * _path;
GVariant *_arguments;
GVariantBuilder _arguments_builder;
gchar** _tmp31_;
GVari... | false | false | false | false | false | 0 |
DOQGetField( unsigned char *pabyData, int nBytes )
{
char szWork[128];
int i;
strncpy( szWork, (const char *) pabyData, nBytes );
szWork[nBytes] = '\0';
for( i = 0; i < nBytes; i++ )
{
if( szWork[i] == 'D' || szWork[i] == 'd' )
szWork[i] = 'E';
}
return atof(szWo... | false | false | false | false | false | 0 |
_ldminfo_parse_string(const char *s, ldminfo * ldm_host_info) {
char **lines = NULL;
int i;
lines = g_strsplit(s, "\n", -1);
for (i = 0; lines != NULL && lines[i] != NULL; i++) {
if (!g_ascii_strncasecmp(lines[i], "language:", 9)) {
gchar **val;
val = g_strsplit(lines[i... | false | false | false | false | true | 1 |
GetBufferAsRGBA(unsigned char *rgba) const
{
bool ret = false;
if ( BitSample == 8 )
{
std::vector<unsigned char>::const_iterator it = Internal->RGB.begin();
for(; it != Internal->RGB.end() ;)
{
// RED
*rgba++ = *it++;
// GREEN
*rgba++ = *it++;
// BLUE
*rgba++ =... | false | false | false | false | false | 0 |
bcr_init_radius(void)
{
if (radius_opt != NULL) { /* preinitialize the earth radius */
radius = atof(radius_opt);
if (radius <= 0) {
fatal(MYNAME ": Sorry, the radius should be greater than zero!\n");
}
} else {
radius = (double)R_EARTH;
}
if (global_opts.verbose_status > 0) {
print... | false | false | false | false | true | 1 |
agent_card_learn (ctrl_t ctrl,
void (*kpinfo_cb)(void*, const char *),
void *kpinfo_cb_arg,
void (*certinfo_cb)(void*, const char *),
void *certinfo_cb_arg,
void (*sinfo_cb)(void*, const char *, size_t, const char *),
... | false | false | false | false | false | 0 |
right(void)
{
if (myExercising == true)
myExercising = false;
myCam->panRel(myPanAmount);
} | false | false | false | false | false | 0 |
doclistener_insertFirstBlock(const PX_ChangeRecord_Strux * pcrx,
pf_Frag_Strux* sdh,
PL_ListenerId lid,
void (* pfnBindHandles)(pf_Frag_Strux* sdhNew,
PL_ListenerId lid,
fl_ContainerLayout* sfhNew))
{
// Exchange handles with the piece t... | false | false | false | false | false | 0 |
encode(
Blob& blob,
const byte* pData,
uint32_t size,
const CrwImage* pCrwImage
)
{
// Parse image, starting with a CIFF header component
CiffHeader::AutoPtr head(new CiffHeader);
if (size != 0) {
head->read(pData, size);
... | false | false | false | false | false | 0 |
list(ostream& os) const {
// Header.
os << "\n -------- PYTHIA Sphericity Listing -------- \n";
if (powerInt !=2) os << " Nonstandard momentum power = "
<< fixed << setprecision(3) << setw(6) << power << "\n";
os << "\n no lambda e_x e_y e_z \n";
// The three eigenvalues ... | false | false | false | false | false | 0 |
Deserialize(const byte* content, int len) {
SnapshotByteSource source(content, len);
Deserializer deserializer(&source);
return V8::Initialize(&deserializer);
} | false | false | false | false | false | 0 |
driver_close_device( CoreGraphicsDevice *device,
void *driver_data,
void *device_data )
{
MatroxDriverData *mdrv = (MatroxDriverData*) driver_data;
MatroxDeviceData *mdev = (MatroxDeviceData*) device_data;
if (mdev->rgb332_palette)
... | false | false | false | false | false | 0 |
fm10k_iov_configure(struct pci_dev *pdev, int num_vfs)
{
int current_vfs = pci_num_vf(pdev);
int err = 0;
if (current_vfs && pci_vfs_assigned(pdev)) {
dev_err(&pdev->dev,
"Cannot modify SR-IOV while VFs are assigned\n");
num_vfs = current_vfs;
} else {
pci_disable_sriov(pdev);
fm10k_iov_free_data(pdev);... | false | false | false | false | false | 0 |
getExtent (
float& x0, float& y0, float& cx, float& cy, float& tol, Graphic* gs
) {
if (gs->GetTransformer() == nil) {
x0 = y0 = 0;
cx = _raster->Width() / 2;
cy = _raster->Height() / 2;
} else {
transformRect(0,0,_raster->Width(),_raster->Height(),x0,y0,cx,cy,gs);
cx = (cx + x0)/2;
cy = (cy + y0)/2;
... | false | false | false | false | false | 0 |
_eina_value_type_blob_copy(const Eina_Value_Type *type __UNUSED__, const void *src, void *dst)
{
const Eina_Value_Blob_Operations *ops = _eina_value_type_blob_ops_get(src);
const Eina_Value_Blob *s = src;
Eina_Value_Blob *d = dst;
*d = *s;
if ((ops) && (ops->copy))
{
d->memory = ops->copy(... | false | false | false | false | false | 0 |
decodeFrame16(unsigned char *pFrame, unsigned char *pMap, int mapRemain, unsigned char *pData, int dataRemain)
{
unsigned char *pOrig;
unsigned char *pOffData;
unsigned short offset;
unsigned short *FramePtr = (unsigned short *)pFrame;
int length;
int op;
int i, j;
int xb, yb;
if (!loo... | false | false | false | false | false | 0 |
e_path_default_path_append(E_Path *ep, const char *path)
{
E_OBJECT_CHECK(ep);
E_OBJECT_TYPE_CHECK(ep, E_PATH_TYPE);
if (!path) return;
if (path[0] == '~')
{
E_Path_Dir *epd;
char *new_path;
const char *home_dir;
int len1, len2;
home_dir = e_user_homedir_get();
... | false | true | false | false | true | 1 |
flegita_action_selector_build (GnomeScanParamWidget *gspw)
{
FlegitaActionSelectorPrivate *priv = GET_PRIVATE (gspw);
GtkCellRenderer *renderer;
GEnumClass *klass = g_type_class_ref (FLEGITA_TYPE_ACTION);
GtkTreeIter iter;
GtkStockItem item;
guint i;
gchar *stock_id;
gchar *label, *end;
gspw->shows_unit = TRU... | false | false | false | false | false | 0 |
gst_file_sink_open_file (GstFileSink * sink)
{
gint mode;
/* open the file */
if (sink->filename == NULL || sink->filename[0] == '\0')
goto no_filename;
if (sink->append)
sink->file = gst_fopen (sink->filename, "ab");
else
sink->file = gst_fopen (sink->filename, "wb");
if (sink->file == NULL)
... | false | false | false | false | false | 0 |
crush_calc_straw(struct crush_bucket_straw *bucket)
{
int *reverse;
int i, j, k;
double straw, wbelow, lastw, wnext, pbelow;
int numleft;
int size = bucket->h.size;
__u32 *weights = bucket->item_weights;
/* reverse sort by weight (simple insertion sort) */
reverse = malloc(sizeof(int) * size);
if (!rev... | false | false | false | false | false | 0 |
start_page (CRDocHandler *a_this,
CRString *a_name,
CRString *a_pseudo_page,
CRParsingLocation *a_location)
{
gchar *str = NULL ;
g_print ("@page ") ;
if (a_name)
str = (gchar*)cr_string_peek_raw_str (a_name) ;
if (str) {
... | false | false | false | false | false | 0 |
account_char_load(const char *account_name)
{
char fname[MAX_BUF], buf[VERY_BIG_BUF];
FILE *fp;
Account_Char *first=NULL, *ac, *last=NULL;
snprintf(fname, MAX_BUF,"%s/%s/%s", settings.localdir, ACCOUNT_DIR, account_name);
fp=fopen(fname,"r");
if (!fp) {
/* This may not in fact be a crit... | false | false | false | false | false | 0 |
loc_descriptor (rtl)
rtx rtl;
{
dw_loc_descr_ref loc_result = NULL;
switch (GET_CODE (rtl))
{
case SUBREG:
/* The case of a subreg may arise when we have a local (register)
variable or a formal (register) parameter which doesn't quite fill
up an entire register. For now, just ... | false | false | false | false | false | 0 |
set_config_by_name(PG_FUNCTION_ARGS)
{
char *name;
char *value;
char *new_value;
bool is_local;
text *result_text;
if (PG_ARGISNULL(0))
ereport(ERROR,
(errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
errmsg("SET requires parameter name")));
/* Get the GUC variable name */
name = DatumGetCStri... | false | false | false | false | false | 0 |
DeleteAllTracksText( MIDIMultiTrack &tracks )
{
bool text_deleted = false;
int num_tracks = tracks.GetNumTracksWithEvents();
for ( int nt = 0; nt < num_tracks; ++nt )
{
MIDITrack &trk = *tracks.GetTrack( nt );
int num_events = trk.GetNumEvents();
for ( int ne = 0; ne < num_even... | false | false | false | false | false | 0 |
aclDumpIpListWalkee(void *node, void *state)
{
acl_ip_data *ip = node;
MemBuf mb;
wordlist **W = state;
memBufDefInit(&mb);
memBufPrintf(&mb, "%s", inet_ntoa(ip->addr1));
if (ip->addr2.s_addr != any_addr.s_addr)
memBufPrintf(&mb, "-%s", inet_ntoa(ip->addr2));
if (ip->mask.s_addr != no_addr.... | false | false | false | false | false | 0 |
GMT_sort_options (int argc, char **argv, char *order) {
/* GMT_sort_options reorganizes the arguments on the command line
* according to the order specified in the character string "order"
* All options starting with "-" can be reorganised.
* For example, when "order" is "Vf:", the all options -V, -f, and
* -:... | false | false | false | false | false | 0 |
dbpriv_count_properties(Objid oid)
{
Var ancestor, ancestors;
int i, c, nprops = 0;
Object *o;
if (NOTHING == oid)
return 0;
ancestors = db_ancestors(oid, true);
FOR_EACH(ancestor, ancestors, i, c) {
o = dbpriv_find_object(ancestor.v.obj);
nprops += o->propdefs.cur_length;
}
free_... | false | false | false | false | false | 0 |
au_test_h_perm(struct inode *h_inode, int mask)
{
if (uid_eq(current_fsuid(), GLOBAL_ROOT_UID))
return 0;
return inode_permission(h_inode, mask);
} | false | false | false | false | false | 0 |
rehash()
{ struct entry *oldhashtable = simhashtable;
int i,j;
struct entry *h;
unsigned int hash1,hash2,hash;
int recount=0;
simhashtable = (struct entry *)mycalloc(2*tablesize,sizeof(struct entry));
/* rehash all entries */
hashmask += tablesize;
for ( i = 0, h = oldhashtable ; i < tablesize ; i++,h... | false | false | false | false | false | 0 |
next_keyevent(dst_key_t *key, isc_stdtime_t *timep) {
isc_result_t result;
isc_stdtime_t now, then = 0, event;
int i;
now = *timep;
for (i = 0; i <= DST_MAX_TIMES; i++) {
result = dst_key_gettime(key, i, &event);
if (result == ISC_R_SUCCESS && event > now &&
(then == 0 || event < then))
then = event... | false | false | false | false | false | 0 |
mode_rt_response_reread_conf()
{
free_exclude_data();
if (read_rcfile(opt.rcfile, MAY_NOT_EXIST) == EXIT_SUCCESS) {
syslog(LOG_NOTICE, _("SIGHUP caught, reread configuration file %s"), opt.rcfile);
} else {
syslog(LOG_NOTICE, _("SIGHUP caught, unable to reread configuration file %s"), opt.rcfile);
}
s... | false | false | false | false | false | 0 |
zmul(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
switch (r_type(op)) {
default:
return_op_typecheck(op);
case t_real:
switch (r_type(op - 1)) {
default:
return_op_typecheck(op - 1);
case t_real:
op[-1].value.realval *= op->value.realval;
brea... | false | false | false | false | false | 0 |
Un_Number_Check(double value, WamWord start_word)
{
long n;
CHECK_FOR_UN_NUMBER;
n = (long) value;
return (n == value) ? Get_Integer(n, word) : Get_Float(value, word);
} | false | false | false | false | false | 0 |
mca_btl_tcp_proc_destruct(mca_btl_tcp_proc_t* tcp_proc)
{
/* remove from list of all proc instances */
OPAL_THREAD_LOCK(&mca_btl_tcp_component.tcp_lock);
opal_hash_table_remove_value_uint64(&mca_btl_tcp_component.tcp_procs,
ompi_rte_hash_name(&tcp_proc->proc_ompi->pr... | false | false | false | false | false | 0 |
select_single_node(const xpath_query& query) const
{
xpath_node_set s = query.evaluate_node_set(*this);
return s.empty() ? xpath_node() : s.first();
} | false | false | false | false | false | 0 |
parse_htpl_define___fwd(stack, untag)
int untag;
STR stack; {
TOKEN token;
static done = 0;
STR buff;
int code;
static int nesting = 0;
static int refcount = 0;
refcount++;
makepersist(stack);
if (numtokens < 1) RETURN(croak("%sDEFINE called with %d arguments, minimum neede... | false | false | false | false | false | 0 |
torch_DiskFile_bigEndianEncoding(lua_State *L)
{
DiskFile *file = luaT_checkudata(L, 1, torch_DiskFile_id);
luaL_argcheck(L, file->handle, 1, "attempt to use a closed file");
file->isNativeEncoding = !torch_DiskFile_c_isLittleEndianCPU();
lua_settop(L, 1);
return 1;
} | false | false | false | false | false | 0 |
compose(struct Reclass *new, const struct Reclass *mid,
const struct Reclass *old)
{
int first;
CELL i, j, k;
long num;
first = 1;
for (i = old->min; i <= old->max; i++) {
j = old->table[i - old->min];
if (G_is_c_null_value(&j) || j < mid->min || j > mid->max)
continue;
k = mid->ta... | false | false | false | false | false | 0 |
fs_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
TrackerMinerFS *fs = TRACKER_MINER_FS (object);
switch (prop_id) {
case PROP_THROTTLE:
tracker_miner_fs_set_throttle (TRACKER_MINER_FS (object),
... | false | false | false | false | false | 0 |
renumber_vars_attributes(Attribute attrs, int vmap[], int max_vars)
{
Attribute a;
for (a = attrs; a; a = a->next) {
if (inheritable(a)) {
a->u.t = renum_vars_recurse(a->u.t, vmap, max_vars);
}
}
} | false | false | false | false | false | 0 |
namedArgs( const QMap<QString, QString> &args, bool opt ) const
{
// Screen all kindes of brackets and format string with namedOptArgs.
QString formatString = *this;
formatString.replace( QRegExp( "([\\[\\]{}])" ),"\\\\1" );
// Legacy code returned empty string if any token was empty, so do the same
... | false | false | false | false | false | 0 |
DrawLLArc(GWindow gw, GRect *rect,int inset,int radius, Color col) {
GRect r;
if ( inset>=radius )
return;
GetLLRect(&r,rect,inset,radius);
GDrawDrawArc(gw,&r,-180*64,90*64,col);
} | 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.