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 |
|---|---|---|---|---|---|---|
cleanup3_doall(ADDED_OBJ *a)
{
if (--a->obj->nid == 0)
ASN1_OBJECT_free(a->obj);
OPENSSL_free(a);
} | false | false | false | false | false | 0 |
runPush()
{
AFframecount framesToWrite = m_inChunk->frameCount;
int channelCount = m_inChunk->f.channelCount;
int blockCount = (framesToWrite + m_framesPerPacket - 1) / m_framesPerPacket;
for (int i=0; i<blockCount; i++)
{
encodeBlock(static_cast<const int16_t *>(m_inChunk->buffer) + i * m_framesPerPacket * cha... | false | false | false | false | false | 0 |
GetFeatureCount(int bForce)
{
int nfeatures;
if(!bForce)
return -1;
if (m_poFilterGeom || m_poAttrQuery)
nfeatures = OGRLayer::GetFeatureCount(bForce);
else
nfeatures = poDataBlock->GetFeatureCount();
CPLDebug("OGR_VFK", "OGRVFKLayer::GetFeatureCount(): n=%d", nfea... | false | false | false | false | false | 0 |
compute_force (struct state *st, int i, double *dx_ret, double *dy_ret)
{
int j;
double x_dist, y_dist, dist, dist2;
*dx_ret = 0;
*dy_ret = 0;
for (j = 0; j < st->npoints; j++)
{
if (i == j) continue;
x_dist = st->balls [j].x - st->balls [i].x;
y_dist = st->balls [j].y - st->balls [i].y;... | false | false | false | false | false | 0 |
gfs2_internal_read(struct gfs2_inode *ip, char *buf, loff_t *pos,
unsigned size)
{
struct address_space *mapping = ip->i_inode.i_mapping;
unsigned long index = *pos / PAGE_CACHE_SIZE;
unsigned offset = *pos & (PAGE_CACHE_SIZE - 1);
unsigned copied = 0;
unsigned amt;
struct page *page;
void... | false | false | false | false | false | 0 |
IoLexer_readIdentifier(IoLexer *self)
{
IoLexer_pushPos(self);
while ( IoLexer_readLetter(self) ||
IoLexer_readDigit(self) ||
IoLexer_readSpecialChar(self))
{}
if (IoLexer_grabLength(self))
{
// avoid grabing : on last character if followed by =
/*
char *current = IoLexer_current(self);
if (*(curre... | false | false | false | false | false | 0 |
getsubsongs()
{
if(flag_mkf)
{
unsigned int *buf_index=(unsigned int *)file_buffer;
int songs=buf_index[0]/4,i=0;
for(i=0;i<songs;i++)
if(buf_index[i+1]==buf_index[i])
songs--;
return songs;
}
else
return 1;
} | false | false | false | false | false | 0 |
ObjectPatternsToCode(
void *theEnv,
char *fileName,
int fileID,
FILE *headerFP,
int imageID,
int maxIndices)
{
int version;
version = IntermediatePatternNodesToCode(theEnv,fileName,fileID,
headerFP,imageID,maxIndices,1);
if (version == 0)
return(0);
if (! AlphaPatternNod... | false | false | false | false | false | 0 |
lt_ext_module_new(const char *name)
{
lt_ext_module_t *retval = NULL;
lt_return_val_if_fail (name != NULL, NULL);
#if ENABLE_MODULE
retval = lt_mem_alloc_object(sizeof (lt_ext_module_t));
if (retval) {
char *n = strdup(name);
char *filename = basename(n), *module = NULL;
static const char *prefix = "liblan... | false | false | false | false | false | 0 |
_regex2dfa(const uint8_t * input_regex, uint32_t input_regex_len,
uint8_t * output_dfa, uint32_t * output_dfa_len) {
uint8_t retval = 0;
const char * s = reinterpret_cast<const char*>(input_regex);
std::string input_regex_str(s, input_regex_len);
std::string dfa;
bool success = re... | false | false | false | false | false | 0 |
wire_eui_to_str(rrset_dump_params_t *p)
{
p->ret = -1;
// Data can't have zero length.
if (p->in_max < 2) {
return;
}
// Write EUI hexadecimal pairs.
while (p->in_max > 0) {
int ret = hex_encode(p->in, 1, (uint8_t *)(p->out), p->out_max);
if (ret <= 0) {
return;
}
p->in++;
p->in_max--;
p->out +... | false | false | false | false | false | 0 |
paintEvent(QPaintEvent *event)
{
Q_UNUSED(event)
QPainter painter(this);
m_qPainter = &painter;
m_qPainter->setRenderHint(QPainter::Antialiasing);
emit needsPaint(this, m_state);
m_qPainter = NULL;
} | false | false | false | false | false | 0 |
crc32 (uLong crc, const char *buf, size_t len)
{
crc_init ();
GNUNET_assert (crc_table[255] != 0);
crc ^= 0xffffffff;
while (len--)
crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
return crc ^ 0xffffffff;
} | false | false | false | false | false | 0 |
graph_print(graph_t *g)
{
cmph_uint32 i, e;
for (i = 0; i < g->nnodes; ++i)
{
DEBUGP("Printing edges connected to %u\n", i);
e = g->first[i];
if (e != EMPTY)
{
printf("%u -> %u\n", g->edges[abs_edge(e, 0)], g->edges[abs_edge(e, 1)]);
while ((e = g->next[e]) != EMPTY)
{
printf("%u -> %u\n", g->ed... | false | false | false | false | false | 0 |
img_i2c_reset_bus(struct img_i2c *i2c)
{
unsigned long flags;
unsigned long time_left;
spin_lock_irqsave(&i2c->lock, flags);
reinit_completion(&i2c->msg_complete);
img_i2c_reset_start(i2c);
spin_unlock_irqrestore(&i2c->lock, flags);
time_left = wait_for_completion_timeout(&i2c->msg_complete,
IMG_I2C... | false | false | false | false | false | 0 |
_matewnck_screen_process_property_notify (MatewnckScreen *screen,
XEvent *xevent)
{
/* most frequently-changed properties first */
if (xevent->xproperty.atom ==
_matewnck_atom_get ("_NET_ACTIVE_WINDOW"))
{
screen->priv->need_update_active_window = TRUE;
... | false | false | false | false | false | 0 |
compressedFunction(const QString& name,
TraceFile* file,
TraceObject* object)
{
if ((name[0] != '(') || !name[1].isDigit())
return _data->function(checkUnknown(name), file, object);
// compressed format using _functionVector
int p = name.indexOf(')');
if (p<2) {
error(QString("Invali... | false | false | false | false | false | 0 |
ParseDisk(packet)
char *packet;
{
FILE *uu;
char tmp[255], buf[255], *st;
int volume=0, used=0, avail=0, capacity=0;
int sum=0, total_used=0;
if ( (uu=popen("df","r")) == NULL )
perror("popen df error");
st=fgets(buf, 255, uu);
while (st=fgets(buf, 255, uu))
{
sscanf(buf, "%s%d%d%d%d", tmp, &volume, &used, &... | false | false | false | false | false | 0 |
custom_menu_item_activate_cb (glColorComboMenu *this)
{
GtkWidget *custom_dialog;
GtkWidget *colorsel;
gint response;
GdkColor color;
gtk_widget_hide (GTK_WIDGET (this));
custom_dialog = gtk_color_selection_dialog_new (_("Custom Color"));
colorsel = gtk... | false | false | false | false | false | 0 |
ecore_evas_activate(Ecore_Evas *ee)
{
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
{
ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
"ecore_evas_activate");
return;
}
IFC(ee, fn_activate) (ee);
IFE;
} | false | false | false | false | false | 0 |
vgchange (const char *vgchange_flag)
{
CLEANUP_FREE char *err = NULL;
int r = command (NULL, &err, str_lvm, "vgchange", vgchange_flag, NULL);
if (r == -1) {
reply_with_error ("vgchange: %s", err);
return -1;
}
return 0;
} | false | false | false | false | false | 0 |
overflow(std::streambuf::int_type ch)
{
log_debug("overflow(" << ch << ')');
if (pptr() != pbase())
{
log_debug("write " << (pptr() - pbase()) << " bytes to fd " << getWriteFd());
ssize_t ret = ::write(getWriteFd(), pbase(), pptr() - pbase());
if(ret < 0)
throw SystemError(errn... | false | false | false | false | false | 0 |
_get_send_fn(struct cntrl_device *cntrl, const char *path)
{
send_message_t result = NULL;
if (cntrl->cntrl_type == CNTRL_TYPE_AHCI) {
result = ahci_sgpio_write;
} else if (cntrl->cntrl_type == CNTRL_TYPE_SCSI
&& !dev_directly_attached(path)) {
result = scsi_ses_write;
} else if (cntrl->cntrl_type == CNTR... | false | false | false | false | false | 0 |
depth_test_span16( struct gl_context *ctx, GLuint n,
GLushort zbuffer[], const GLuint zfrag[], GLubyte mask[] )
{
const GLboolean write = ctx->Depth.Mask;
GLuint passed = 0;
/* switch cases ordered from most frequent to less frequent */
switch (ctx->Depth.Func) {
case GL_LESS:
Z... | false | false | false | false | false | 0 |
moving_cell_fine_init (FttCell * cell, SolidInfo * solid_info)
{
GfsDomain * domain = GFS_DOMAIN(solid_info->sim);
GfsVariable * old_solid_v = GFS_SIMULATION_MOVING (domain)->old_solid;
GfsVariable ** sold2 = solid_info->sold2;
FttCellChildren child;
guint n;
gfs_cell_fine_init (cell, domain);
/* need ... | false | false | false | false | false | 0 |
vlv_AddIndexEntry(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* entryAfter, int *returncode, char *returntext, void *arg)
{
struct vlvSearch *parent;
backend *be= ((ldbm_instance*)arg)->inst_be;
Slapi_DN parentdn;
slapi_sdn_init(&parentdn);
slapi_sdn_get_parent(slapi_entry_get_sdn(entry... | false | false | false | false | false | 0 |
RemovePgTempRelationFiles(const char *tsdirname)
{
DIR *ts_dir;
struct dirent *de;
char dbspace_path[MAXPGPATH];
ts_dir = AllocateDir(tsdirname);
if (ts_dir == NULL)
{
/* anything except ENOENT is fishy */
if (errno != ENOENT)
elog(LOG,
"could not open tablespace directory \"%s\": %m",
tsdi... | true | true | true | false | false | 1 |
v5dCreateSimple(const char *name, int numtimes, int numvars,
int nr, int nc, int nl,
const char varname[MAXVARS][10],
const int timestamp[], const int datestamp[],
float northlat, float latinc,
float westlon, float loninc,
float bottomhgt, float hgtinc)
{
int nlvar[MAXVARS];
... | false | false | false | false | true | 1 |
of_display_timings_exist(struct device_node *np)
{
struct device_node *timings_np;
if (!np)
return -EINVAL;
timings_np = of_parse_phandle(np, "display-timings", 0);
if (!timings_np)
return -EINVAL;
of_node_put(timings_np);
return 1;
} | false | false | false | false | false | 0 |
toggle_loadbang(t_toggle *x)
{
if(!sys_noloadbang && x->x_gui.x_isa.x_loadinit)
toggle_fout(x, (t_float)x->x_on);
} | false | false | false | false | false | 0 |
xsh_pre_new (int nx, int ny)
{
xsh_pre *result = NULL;
assure (nx > 0 && ny > 0, CPL_ERROR_ILLEGAL_INPUT,
"Illegal image size: %dx%d", nx, ny);
XSH_CALLOC( result, xsh_pre, 1);
result->nx = nx;
result->ny = ny;
check( result->data = cpl_image_new (nx, ny, XSH_PRE_DATA_TYPE));
check( result->... | false | false | false | false | false | 0 |
paramLocaleDefaultBcp47(const USystemParams * /* param */, char *target, int32_t targetCapacity, UErrorCode *status) {
if(U_FAILURE(*status))return 0;
const char *def = uloc_getDefault();
return uloc_toLanguageTag(def,target,targetCapacity,FALSE,status);
} | false | false | false | false | false | 0 |
inf_gtk_browser_store_tree_model_iter_parent(GtkTreeModel* model,
GtkTreeIter* iter,
GtkTreeIter* child)
{
InfGtkBrowserStorePrivate* priv;
InfGtkBrowserStoreItem* item;
InfcBrowserIter browser_iter;
gboolean result;
pr... | false | false | false | false | false | 0 |
cmdline_paste_str(s, literally)
char_u *s;
int literally;
{
int c, cv;
if (literally)
put_on_cmdline(s, -1, TRUE);
else
while (*s != NUL)
{
cv = *s;
if (cv == Ctrl_V && s[1])
++s;
#ifdef FEAT_MBYTE
if (has_mbyte)
c = mb_cptr2char_adv(&s);
else
#endif
c = *s++;
if... | false | false | false | false | false | 0 |
all_sky_initial_weights(GList *ofrs)
{
GList *osl;
struct o_frame *ofr;
for (osl = ofrs; osl != NULL; osl = g_list_next(osl)) {
ofr = O_FRAME(osl->data);
ofr->weight = ofr->nweight = 0.0;
if (ofr->zpstate < ZP_FIT_NOCOLOR)
continue;
if (ofr->zpointerr <= 0)
continue;
ofr->weight = ofr->nweight = 1 ... | false | false | false | false | false | 0 |
add_symbol_file(struct load_module *lm)
{
struct gnu_request request, *req;
char buf[BUFSIZE];
int i, len;
char *secname;
req = &request;
BZERO(req, sizeof(struct gnu_request));
if ((lm->mod_flags & MOD_KALLSYMS) &&
add_symbol_file_kallsyms(lm, req))
return TRUE;
for (i = l... | false | false | false | false | false | 0 |
tenm_collided_mass(tenm_mass *p, tenm_mass *q)
{
int i;
int j;
/* sanity check */
if (p == NULL)
{
fprintf(stderr, "tenm_collided_mass: p is NULL\n");
return 0;
}
if (p->n <= 0)
{
fprintf(stderr, "tenm_collided_mass: p->n is non-positive\n");
return 0;
}
if (p->p == NULL)
{
fp... | false | false | false | false | false | 0 |
pvalGlobalsAddStatement( pval *p, pval *statement )
{
if (p->type != PV_GLOBALS) {
ast_log(LOG_ERROR, "pvalGlobalsAddStatement called where first arg is not a Globals!\n");
} else {
if (!p->u1.statements) {
p->u1.statements = statement;
} else {
p->u1.statements = linku1(p->u1.statements,statement);
}
... | false | false | false | false | false | 0 |
write(BinaryWriter& writer)
{
writer << true;
writer << false;
writer << 'a';
writer << (short) -100;
writer << (unsigned short) 50000;
writer << -123456;
writer << (unsigned) 123456;
writer << (long) -1234567890;
writer << (unsigned long) 1234567890;
#if defined(POCO_HAVE_INT64)
writer << (Int64) -12345678... | false | false | false | false | false | 0 |
L5()
{register object *base=vs_base;
register object *sup=base+VM5; VC5
vs_check;
{object V27;
object V28;
object V29;
object V30;
V27=(base[0]);
V28=(base[1]);
V29=(base[2]);
V30=(base[3]);
vs_top=sup;
goto TTL;
TTL:;
{object V31;
V31= ((V30))->v.v_self[(long)20];
base[4]= CMPcar((V31));
{object V32;
... | false | false | false | false | false | 0 |
cmp_dt_info_entry_kind(const void *data, const void *arg)
{
return ((((Dt_info*)data)->src_sem->entry == ((Entry_kind*)arg)->entry)
&& (((Dt_info*)data)->kind == ((Entry_kind*)arg)->kind))
? 0 : 1;
} | false | false | false | false | false | 0 |
read_string (const uint8_t *ptr, const uint8_t **endp)
{
gchar *s;
int len = read_leb128 (ptr, &ptr);
s = g_filename_from_utf8 ((const char *) ptr, len, NULL, NULL, NULL);
ptr += len;
if (endp)
*endp = ptr;
return s;
} | false | false | false | false | false | 0 |
mime_type_from_filename(const char *filename)
{
const char *extension;
g_return_val_if_fail(filename, MIME_TYPE_APPLICATION_OCTET_STREAM);
extension = strrchr(filename, '.');
return mime_type_from_extension(extension ? &extension[1] : NULL);
} | false | false | false | false | false | 0 |
j2k_convert_progression_order(OPJ_PROG_ORDER p_prg_order)
{
const j2k_prog_order_t *po;
for
(po = j2k_prog_order_list; po->enum_prog != -1; ++po )
{
if
(po->enum_prog == p_prg_order)
{
return po->str_prog;
}
}
return po->str_prog;
} | false | false | false | false | false | 0 |
click(int button, int time) {
if (m_command.get() != 0)
m_command->execute();
} | false | false | false | false | false | 0 |
HashedExpressionIndex(
void *theEnv,
EXPRESSION *theExp)
{
EXPRESSION_HN *exphash,*prv;
unsigned hashval;
if (theExp == NULL)
return(-1L);
exphash = FindHashedExpression(theEnv,theExp,&hashval,&prv);
return((exphash != NULL) ? exphash->bsaveID : -1L);
} | false | false | false | false | false | 0 |
isc__gettimeofday(struct timeval *tp, struct timezone *tzp) {
int res;
res = gettimeofday(tp, tzp);
if (res < 0)
return (res);
if (tp == NULL)
return (res);
if (tp->tv_usec < 0) {
do {
tp->tv_usec += MILLION;
tp->tv_sec--;
} while (tp->tv_usec < 0);
goto log;
} else if (tp->tv_usec > MILLION) {
... | false | false | false | false | false | 0 |
Lck_CondWait(pthread_cond_t *cond, struct lock *lck, struct timespec *ts)
{
struct ilck *ilck;
int retval = 0;
CAST_OBJ_NOTNULL(ilck, lck->priv, ILCK_MAGIC);
AN(ilck->held);
assert(pthread_equal(ilck->owner, pthread_self()));
ilck->held = 0;
if (ts == NULL) {
AZ(pthread_cond_wait(cond, &ilck->mtx));
} else {... | false | false | false | true | false | 1 |
cm_tr_mx_SizeNeeded(CM_t *cm, char *errbuf, int L, int64_t *ret_Jncells, int64_t *ret_Lncells, int64_t *ret_Rncells, int64_t *ret_Tncells, float *ret_Mb)
{
int v;
int64_t Jncells, Lncells, Rncells, Tncells;
int have_el;
float Mb_needed;
have_el = (cm->flags & CMH_LOCAL_END) ? TRUE : FALSE;
Jncell... | false | false | false | false | false | 0 |
_giraffe_linedata_set(GiLineData* self, cx_map* map, const cxchar* name,
cxint i, cxint j, cxdouble value)
{
cxdouble* data = NULL;
cx_map_const_iterator position = cx_map_find(map, name);
if (position == cx_map_end(map)) {
cpl_image* buffer = cpl_image_new(self->nfibers, ... | false | false | false | false | false | 0 |
Java_com_sun_grid_jgdi_jni_JGDIBaseImpl_nativeShowDetachedSettingsWithAnswer(JNIEnv *env, jobject jgdi, jobjectArray obj_array, jobject answers) {
jstring jdetachedStr = NULL;
DENTER(TOP_LAYER, "Java_com_sun_grid_jgdi_jni_JGDIBaseImpl_nativeShowDetachedSettingsWithAnswer");
jgdi_detached_settings(e... | false | false | false | false | false | 0 |
get_tile_info_glass_screen1(int tile_index)
{
int data = glass_videoram[(0x1000/2) + (tile_index << 1)];
int data2 = glass_videoram[(0x1000/2) + (tile_index << 1) + 1];
int code = ((data & 0x03) << 14) | ((data & 0x0fffc) >> 2);
SET_TILE_INFO(0, code, 0x20 + (data2 & 0x1f), TILE_FLIPYX((data2 & 0xc0) >> 6))
... | false | false | false | false | false | 0 |
hash_state_copy(hash_state_t *src_state)
{
hash_state_t *dest_state = NULL;
switch (src_state->hashfunc)
{
case CMPH_HASH_JENKINS:
dest_state = (hash_state_t *)jenkins_state_copy((jenkins_state_t *)src_state);
break;
default:
assert(0);
}
dest_state->hashfunc = src_state->hashfunc;
return dest_state;... | false | false | false | false | false | 0 |
should_io_be_busy(void)
{
#if defined(CONFIG_X86)
/*
* For Intel, Core 2 (model 15) and later have an efficient idle.
*/
if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
boot_cpu_data.x86 == 6 &&
boot_cpu_data.x86_model >= 15)
return 1;
#endif
return 0;
} | false | false | false | false | false | 0 |
scoring_get_scale_factor()
{
// multiplayer dogfight. don't scale anything
if(MULTI_DOGFIGHT){
return 1.0f;
}
// check for bogus Skill_level values
Assert((Game_skill_level >= 0) && (Game_skill_level < NUM_SKILL_LEVELS));
if((Game_skill_level < 0) || (Game_skill_level > NUM_SKILL_LEVELS-1)){
return Scoring_s... | false | false | false | false | false | 0 |
RleCompress( RAWLINE *raw, int min, int max, byte *rle_data )
{
int i, n;
byte pbyte;
byte *start, *rstrt;
int length;
byte *input;
int len;
if ( ! raw ) {
/* This is an empty line */
for ( n = 0, i = max - min ; i >= 129 ; i -= 129 ) {
*rle_data++ ... | false | false | false | false | true | 1 |
decode_cached_class_info (MonoAotModule *module, MonoCachedClassInfo *info, guint8 *buf, guint8 **endbuf)
{
guint32 flags;
MethodRef ref;
gboolean res;
info->vtable_size = decode_value (buf, &buf);
if (info->vtable_size == -1)
/* Generic type */
return FALSE;
flags = decode_value (buf, &buf);
info->ghcimpl ... | false | false | false | false | false | 0 |
GetDeepestMatchingPosition(BasicSearchTree* tree,
const wxString& s,
unsigned int StringStartDepth)
{
if (StringStartDepth >= GetDepth())
return GetDepth();
if (StringStartDepth... | false | false | false | false | false | 0 |
dfb_core_part_shutdown( CoreDFB *core,
CorePart *core_part,
bool emergency )
{
DFBResult ret;
FusionSHMPoolShared *pool;
pool = dfb_core_shmpool( core );
if (!core_part->initialized)
return DFB_OK;
D_DEBUG_AT( Core_Pa... | false | false | false | false | false | 0 |
CmdUnderbarChar(int code)
{
char *cParam= getBraceParam();
switch (cParam[0]) {
case 'B':
putUnicodeChar(0x1E,0x06,'B');
break;
case 'b':
putUnicodeChar(0x1E,0x07,'b');
break;
case 'D':
putUnicodeChar(0x1E,0x0E,'D');
... | false | false | false | false | false | 0 |
lex_unget_char(LEX *lf)
{
if (lf->ch == L_EOL) {
lf->ch = 0; /* End of line, force read of next one */
} else {
lf->col_no--; /* Backup to re-read char */
}
} | false | false | false | false | false | 0 |
XsbGetStringFloat( String )
char *String;
{
float Value;
autbegin();
if ( ! sscanf( String, "%g", &Value) )
{
XsbError( ILLEGAL_FLOAT, String, XsbCurrentLine );
}
autend();
return ( Value );
} | false | false | false | false | false | 0 |
posix_mknod(PyObject *self, PyObject *args, PyObject *kwargs)
{
path_t path;
int mode = 0666;
int device = 0;
int dir_fd = DEFAULT_DIR_FD;
int result;
PyObject *return_value = NULL;
static char *keywords[] = {"path", "mode", "device", "dir_fd", NULL};
memset(&path, 0, sizeof(path));
... | false | false | false | false | false | 0 |
_addToRenderQueue( Camera* cam,
RenderQueue *queue,
bool onlyShadowCasters,
VisibleObjectsBoundsInfo* visibleBounds )
{
ObjectMap::iterator mit = mObjectsByName.begin();
... | false | false | false | false | false | 0 |
e_qa_config_entry_free(E_Quick_Access_Entry *entry)
{
if (!entry) return;
if (!entry->cfg_entry) return;
_list_item_delete(entry);
_config_entry_free(entry->cfg_entry);
entry->cfg_entry = NULL;
} | false | false | false | false | false | 0 |
formula_ident_share(Formula f, Formula g)
{
if (Fid_call_limit != 0 && ++Fid_calls > Fid_call_limit) {
printf("\n%% Fid_call limit; jumping home.\n");
longjmp(Jump_env, 1);
}
if (f->type != g->type || f->arity != g->arity)
return FALSE;
else if (f->type == AND_FORM || f->type == OR_FORM) {
int ... | false | false | false | false | false | 0 |
rtw_cfg80211_inform_bss(struct rtw_adapter *padapter,
struct wlan_network *pnetwork)
{
int ret = 0;
struct ieee80211_channel *notify_channel;
struct cfg80211_bss *bss;
u16 channel;
u32 freq;
u8 *notify_ie;
size_t notify_ielen;
s32 notify_signal;
struct wireless_dev *wdev = padapter->rtw_wdev;
struct wi... | false | false | false | false | false | 0 |
pptp_cdn_print(const u_char *dat)
{
struct pptp_msg_cdn *ptr = (struct pptp_msg_cdn *)dat;
TCHECK(ptr->call_id);
pptp_call_id_print(&ptr->call_id);
TCHECK(ptr->result_code);
pptp_result_code_print(&ptr->result_code, PPTP_CTRL_MSG_TYPE_CDN);
TCHECK(ptr->err_code);
pptp_err_code_print(&ptr->err_code);
TCHECK(ptr... | false | false | false | false | false | 0 |
DatumGetExpandedArrayX(Datum d, ArrayMetaState *metacache)
{
/* If it's a writable expanded array already, just return it */
if (VARATT_IS_EXTERNAL_EXPANDED_RW(DatumGetPointer(d)))
{
ExpandedArrayHeader *eah = (ExpandedArrayHeader *) DatumGetEOHP(d);
Assert(eah->ea_magic == EA_MAGIC);
/* Update cache if provi... | false | false | false | false | false | 0 |
collection_table_unselect_all(CollectTable *ct)
{
GList *work;
work = ct->selection;
while (work)
{
collection_table_selection_remove(ct, work->data, SELECTION_SELECTED, NULL);
work = work->next;
}
g_list_free(ct->selection);
ct->selection = NULL;
collection_table_update_status(ct);
} | false | false | false | false | false | 0 |
sys_random_compiletf(PLI_BYTE8 *name)
{
vpiHandle callh = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, callh);
/* The seed is optional. */
if (argv == 0) return 0;
/* The seed must be a time/integer variable or a register. */
if (! is_seed_obj(vpi_scan(arg... | false | false | false | false | false | 0 |
ATL_dasum(const int N, const TYPE *X, const int incX)
{
int incx;
if (N > 0)
{
if (incX > 0) incx = incX;
else if (incX < 0)
{
X += ((N-1)SHIFT) * incX;
incx = -incX;
}
else return(ATL_rzero);
if (incx == 1)
return(ATL_dasum_xp1yp0aXbX(N, X, incx)... | false | false | false | false | false | 0 |
Load(const tPath& path, const char *filename)
{
sn_LastLoaded = filename;
// read server info from archive
static char const * section = "SERVERINFO";
static char const * sectionEnd = "SERVERINFOEND";
if ( tRecorder::IsPlayingBack() )
{
nServerInfo *server = CreateServerInfo();
... | false | false | false | false | false | 0 |
rndis_alloc(struct usb_function_instance *fi)
{
struct f_rndis *rndis;
struct f_rndis_opts *opts;
struct rndis_params *params;
/* allocate and initialize one new instance */
rndis = kzalloc(sizeof(*rndis), GFP_KERNEL);
if (!rndis)
return ERR_PTR(-ENOMEM);
opts = container_of(fi, struct f_rndis_opts, func_ins... | false | false | false | false | false | 0 |
get_net_wm_window_type (rp_window *win)
{
Atom type, window_type = None;
int format;
unsigned long nitems;
unsigned long bytes_left;
unsigned char *data;
if (win == NULL)
return None;
if (XGetWindowProperty (dpy, win->w, _net_wm_window_type, 0, 1L,
False, XA_ATOM, &type, &f... | false | false | false | false | false | 0 |
quirk_apple_poweroff_thunderbolt(struct pci_dev *dev)
{
acpi_handle bridge, SXIO, SXFP, SXLV;
if (!dmi_match(DMI_BOARD_VENDOR, "Apple Inc."))
return;
if (pci_pcie_type(dev) != PCI_EXP_TYPE_UPSTREAM)
return;
bridge = ACPI_HANDLE(&dev->dev);
if (!bridge)
return;
/*
* SXIO and SXLV are present only on machi... | false | false | false | false | false | 0 |
setup_path(const spiro_cp *src, int n)
{
int n_seg = src[0].ty == '{' ? n - 1 : n;
spiro_seg *r = (spiro_seg *)malloc((n_seg + 1) * sizeof(spiro_seg));
int i;
int ilast;
for (i = 0; i < n_seg; i++) {
r[i].x = src[i].x;
r[i].y = src[i].y;
r[i].ty = src[i].ty;
r[i].ks[0] = 0.;
r[i].ks[1] = 0.;
... | false | false | false | false | false | 0 |
item_width(void* v) const {
char* str = ((FL_BLINE*)v)->txt;
const int* i = column_widths();
int ww = 0;
while (*i) { // add up all tab-seperated fields
char* e;
e = strchr(str, column_char());
if (!e) break; // last one occupied by text
str = e+1;
ww += *i++;
}
// OK, we gotta parse t... | false | false | false | false | true | 1 |
translateUnitInverse(const scpi_unit_def_t * units, const scpi_unit_t unit) {
int i;
if (units == NULL) {
return NULL;
}
for (i = 0; units[i].name != NULL; i++) {
if ((units[i].unit == unit) && (units[i].mult == 1)) {
return units[i].name;
}
}
retur... | false | false | false | false | false | 0 |
error(int n, const char *msg)
{
const char *e = strerror(errno);
logfile(LOG_ERR, "%s: %s", msg, e);
addreply(n, "%s: %s", msg, e);
CORK_OFF(1);
} | false | false | false | false | false | 0 |
SetControlPoint (int num, double dx, double dy)
{
switch (num) {
case 1:
m_CPx1 = dx;
m_CPy1 = dy;
break;
case 2:
m_CPx2 = dx;
m_CPy2 = dy;
break;
default:
// this should not occur, shouldn't we throw an exception?
return;
}
static_cast <Document *> (GetDocument ())->SetDirty (this);
} | false | false | false | false | false | 0 |
vcc_expr_tostring(struct expr **e, enum var_type fmt)
{
const char *p;
CHECK_OBJ_NOTNULL(*e, EXPR_MAGIC);
AN(fmt == STRING || fmt == STRING_LIST);
p = NULL;
switch((*e)->fmt) {
case BACKEND: p = "VRT_backend_string(sp, \v1)"; break;
case BOOL: p = "VRT_bool_string(sp, \v1)"; break;
case DURATION: p = "VRT_dou... | false | false | false | true | false | 1 |
evrpc_request_timeout(evutil_socket_t fd, short what, void *arg)
{
struct evrpc_request_wrapper *ctx = arg;
struct evhttp_connection *evcon = ctx->evcon;
EVUTIL_ASSERT(evcon != NULL);
evhttp_connection_fail(evcon, EVCON_HTTP_TIMEOUT);
} | false | false | false | false | false | 0 |
processYUVImage(imageStruct &image)
{
int pixelsize = image.csize;
int rowsize = image.xsize * pixelsize;
unsigned char *pixels = image.data;
int col, row;
unsigned char y =((RGB2YUV_11*m_color[chRed]+RGB2YUV_12*m_color[chGreen]+RGB2YUV_13*m_color[chBlue])>>8)+ Y_OFFSET;
unsigned char u =((RGB2YUV_21*m_co... | false | false | false | false | false | 0 |
get_internal(private_hashtable_t *this, const void *key,
hashtable_equals_t equals)
{
void *value = NULL;
pair_t *pair;
if (!this->count)
{ /* no need to calculate the hash */
return NULL;
}
pair = this->table[this->hash(key) & this->mask];
while (pair)
{
if (equals(key, pair->key))
{
value =... | false | false | false | false | false | 0 |
ldst_entry (rtx x)
{
int do_not_record_p = 0;
struct ls_expr * ptr;
unsigned int hash;
hash = hash_expr_1 (x, GET_MODE (x), & do_not_record_p);
for (ptr = pre_ldst_mems; ptr != NULL; ptr = ptr->next)
if (ptr->hash_index == hash && expr_equiv_p (ptr->pattern, x))
return ptr;
ptr = xmalloc (sizeo... | false | false | false | false | false | 0 |
PixelSpacingCallback(DICOMParser *parser,
doublebyte group,
doublebyte element,
DICOMParser::VRTypes,
unsigned char* val,
... | false | false | false | false | false | 0 |
mktemp_main(int argc UNUSED_PARAM, char **argv)
{
const char *path;
char *chp;
unsigned opts;
path = getenv("TMPDIR");
if (!path || path[0] == '\0')
path = "/tmp";
/* -q and -t are ignored */
opt_complementary = "?1"; /* 1 argument max */
opts = getopt32(argv, "dqtp:", &path);
chp = argv[optind] ? argv[op... | false | false | false | false | false | 0 |
TMX_SetFrequency(double *freq, long tick)
{
struct timex txc;
txc.modes = ADJ_TICK | ADJ_FREQUENCY | ADJ_STATUS;
txc.freq = (long)(*freq * (double)(1 << SHIFT_USEC));
*freq = txc.freq / (double)(1 << SHIFT_USEC);
txc.tick = tick;
txc.status = status;
if (!(status & STA_UNSYNC)) {
/* maxerror has... | false | false | false | false | false | 0 |
elf_flagdata(Elf_Data *data, Elf_Cmd cmd, unsigned flags) {
Scn_Data *sd = (Scn_Data*)data;
if (!sd) {
return 0;
}
elf_assert(sd->sd_magic == DATA_MAGIC);
return _elf_flag(&sd->sd_data_flags, cmd, flags);
} | false | false | false | false | false | 0 |
do_fixed_add (FIXED_VALUE_TYPE *f, const FIXED_VALUE_TYPE *a,
const FIXED_VALUE_TYPE *b, bool subtract_p, bool sat_p)
{
bool overflow_p = false;
bool unsigned_p;
double_int temp;
int i_f_bits;
/* This was a conditional expression but it triggered a bug in
Sun C 5.5. */
if (subtract_p)
temp... | false | false | false | false | false | 0 |
hide(){
FXTRACE((160,"%s::hide %p\n",getClassName(),this));
if(flags&FLAG_SHOWN){
killFocus();
flags&=~FLAG_SHOWN;
if(xid){
#ifndef WIN32
if(getApp()->mouseGrabWindow==this){
XUngrabPointer(DISPLAY(getApp()),CurrentTime);
XFlush(DISPLAY(getApp()));
handle(this,FXSEL(SEL_UNG... | false | false | false | false | false | 0 |
__acpi_power_on(struct acpi_power_resource *resource)
{
acpi_status status = AE_OK;
status = acpi_evaluate_object(resource->device.handle, "_ON", NULL, NULL);
if (ACPI_FAILURE(status))
return -ENODEV;
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Power resource [%s] turned on\n",
resource->name));
return 0;
} | false | false | false | false | false | 0 |
rb_dvar_curr(id)
ID id;
{
struct RVarmap *vars = ruby_dyna_vars;
while (vars) {
if (vars->id == 0) break;
if (vars->id == id) return Qtrue;
vars = vars->next;
}
return Qfalse;
} | false | false | false | false | false | 0 |
fdp_nci_prop_set_production_data_rsp_packet(struct nci_dev *ndev,
struct sk_buff *skb)
{
struct fdp_nci_info *info = nci_get_drvdata(ndev);
struct device *dev = &info->phy->i2c_dev->dev;
u8 status = skb->data[0];
dev_dbg(dev, "%s: status 0x%x\n", __func__, status);
nci_req_complete(ndev, status);
return ... | false | false | false | false | false | 0 |
Popup(Event& e) {
if (Enabled()) {
World* w;
IntCoord wx, wy;
e.GetAbsolute(w, wx, wy);
if (w != world_) {
world_ = w;
Setup();
}
InsertBody(wx - rel_x_, wy - rel_y_);
State()->Selection(this);
}
} | false | false | false | false | false | 0 |
on_key_released(GtkWidget *widget, GdkEventKey *event, FmFileMenu *data)
{
GtkAction *act;
GdkModifierType mask = 0;
gdk_window_get_device_position (gtk_widget_get_window(widget),
gtk_get_current_event_device(),
NULL, NULL, &mask);
... | false | false | false | false | false | 0 |
print_statistics(void * ps_tree)
{
/* Statistics data */
unsigned int num_files = 0, max_file_len = 0, total_file_len = 0;
unsigned int total_revisions = 0, max_revisions_for_file = 0;
unsigned int total_branches = 0, max_branches_for_file = 0;
unsigned int total_branches_sym = 0, max_branches_sym_f... | false | false | false | false | false | 0 |
alps_hw_init_v4(struct psmouse *psmouse)
{
struct ps2dev *ps2dev = &psmouse->ps2dev;
unsigned char param[4];
if (alps_enter_command_mode(psmouse))
goto error;
if (alps_absolute_mode_v4(psmouse)) {
psmouse_err(psmouse, "Failed to enter absolute mode\n");
goto error;
}
if (alps_command_mode_write_reg(psmou... | true | true | false | false | false | 1 |
DrawSegment3D(double *a, double *b)
{
void *ptr;
int a0, a1, a2;
// Pre-multiply coords if needed
if (this->Ratio[0] != 1.0)
{
a[0] = static_cast<int>(static_cast<double>(a[0]) * this->Ratio[0]);
b[0] = static_cast<int>(static_cast<double>(b[0]) * this->Ratio[0]);
}
if (this->Ratio[1] != 1.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.