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 |
|---|---|---|---|---|---|---|
vxge_hw_vpath_doorbell_rx(struct __vxge_hw_ring *ring)
{
u32 rxds_qw_per_block = VXGE_HW_MAX_RXDS_PER_BLOCK_1 *
VXGE_HW_RING_RXD_QWORDS_MODE_1;
ring->doorbell_cnt += VXGE_HW_RING_RXD_QWORDS_MODE_1;
ring->total_db_cnt += VXGE_HW_RING_RXD_QWORDS_MODE_1;
if (ring->total_db_cnt >= rxds_qw_per_block) {
/* For eac... | false | false | false | false | false | 0 |
namelistAdd(namelist_t *nml, const char *name, int type, int dis, void *ptr, size_t size)
{
nml_entry_t *nml_entry;
int entry = 0;
if ( nml->size >= MAX_NML_ENTRY )
{
fprintf(stderr, "Too many namelist entries in %s! (Max = %d)\n", nml->name, MAX_NML_ENTRY);
return (-1);
}
nml_entry = (nml... | false | false | false | false | false | 0 |
SearchForAddressOfSymbol(const char *symbolName) {
SmartScopedLock<true> Lock(*SymbolsMutex);
// First check symbols added via AddSymbol().
if (ExplicitSymbols.isConstructed()) {
StringMap<void *>::iterator i = ExplicitSymbols->find(symbolName);
if (i != ExplicitSymbols->end())
return i->second;
... | false | false | false | false | false | 0 |
search_stat (__u32 dir_id, __u32 objectid)
{
char *cache;
int depth;
int nr_item;
int i;
struct item_head *ih;
#ifdef REISERDEBUG
printf ("search_stat:\n key %d:%d:0:0\n", dir_id, objectid);
#endif /* REISERDEBUG */
depth = INFO->tree_depth;
cache = ROOT;
while (depth > DISK_LEAF_NODE_LEVEL)
... | false | false | false | false | false | 0 |
ndmca_test_open (struct ndm_session *sess, char *test_name, char *sub_test_name)
{
static char test_name_buf[512];
if (sess->control_acb.active_test == 0) {
/* record name */
if (sub_test_name)
sprintf(test_name_buf, "%s/%s", test_name, sub_test_name);
else
strcpy(test_name_buf, test_name);
sess-... | true | true | false | false | false | 1 |
preferences_window_load_pixbuf (const gchar *icon_name)
{
GtkIconTheme *icon_theme;
GtkIconInfo *icon_info;
GdkPixbuf *pixbuf;
const gchar *filename;
gint size;
GError *error = NULL;
icon_theme = gtk_icon_theme_get_default ();
if (!gtk_icon_size_lookup (GTK_ICON_SIZE_DIALOG, &size, 0))
return NULL;
icon_i... | false | false | false | false | false | 0 |
handle_edit_tile_terrain(struct connection *pc, int tile,
Terrain_type_id terrain, int size)
{
struct terrain *pterrain;
struct tile *ptile_center;
ptile_center = index_to_tile(tile);
if (!ptile_center) {
notify_conn(pc->self, NULL, E_BAD_COMMAND, ftc_editor,
_... | false | false | false | false | false | 0 |
inode_write_blk64(io_channel channel,
unsigned long long block, int count, const void *buf)
{
struct inode_private_data *data;
errcode_t retval;
EXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL);
data = (struct inode_private_data *) channel->private_data;
EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_INODE_IO_CHANNE... | false | false | false | false | false | 0 |
out( MifOutputByteStream &os ) {
os << '\n' << MifOutputByteStream::INDENT << "<PgfCatalog ";
os.indent();
for( size_t i = 0; i < ParaFormats.size(); i++ ) ParaFormats[i].out( os, false );
os.undent();
os << '\n' << MifOutputByteStream::INDENT << ">";
} | false | false | false | false | false | 0 |
_is_contiguous(struct pv_match *pvmatch __attribute((unused)), struct pv_segment *pvseg, struct pv_area *pva)
{
if (pvseg->pv != pva->map->pv)
return 0;
if (pvseg->pe + pvseg->len != pva->start)
return 0;
return 1;
} | false | false | false | false | false | 0 |
wire_text_to_str(rrset_dump_params_t *p)
{
p->ret = -1;
// First byte is string length.
if (p->in_max < 1) {
return;
}
size_t in_len = *(p->in);
p->in++;
p->in_max--;
// Check if the given length makes sense.
if (in_len > p->in_max) {
return;
}
// Opening quoatition.
dump_string(p, "\"");
if (p->ret... | false | false | false | false | false | 0 |
lexpname(type, s)
char *s;
{
switch(type) {
case LABEL: return "<label>";
case FIELD: return "<label>";
}
s[0]=type;
s[1]='\0';
if(isalnum(type)) return s;
if(ispunct(type)) return s;
if(EOF==type) return "<eof>";
if('\0'==type) return "<eof>";
return "<char>";
} | false | false | false | false | false | 0 |
client_search_focus_parent_full(ObClient *self)
{
GSList *it;
ObClient *ret = NULL;
for (it = self->parents; it; it = g_slist_next(it)) {
if (client_focused(it->data))
ret = it->data;
else
ret = client_search_focus_parent_full(it->data);
if (ret) break;
}... | false | false | false | false | false | 0 |
recalculate_next_auto_increment_value(const Glib::ustring& table_name, const Glib::ustring& field_name)
{
if(table_name.empty())
{
std::cerr << G_STRFUNC << ": table_name is empty" << std::endl;
return;
}
if(field_name.empty())
{
std::cerr << G_STRFUNC << ": field_name is empty" << std::endl;
... | false | false | false | false | false | 0 |
navi_findframe_in_sel_range(gint32 framenr)
{
SelectedRange *range_item;
range_item = naviD->sel_range_list;
while(range_item)
{
if((framenr >= range_item->from) && (framenr <= range_item->to))
{
return (range_item);
}
range_item = range_item->next;
}
return (NULL);
} | false | false | false | false | false | 0 |
saa7110_s_std(struct v4l2_subdev *sd, v4l2_std_id std)
{
struct saa7110 *decoder = to_saa7110(sd);
if (decoder->norm != std) {
decoder->norm = std;
/*saa7110_write(sd, 0x06, 0x03);*/
if (std & V4L2_STD_NTSC) {
saa7110_write(sd, 0x0D, 0x86);
saa7110_write(sd, 0x0F, 0x50);
saa7110_write(sd, 0x11, 0x2C);... | false | false | false | false | false | 0 |
get_lifetimes(private_quick_mode_t *this)
{
lifetime_cfg_t *lft;
lft = this->config->get_lifetime(this->config);
if (lft->time.life)
{
this->lifetime = lft->time.life;
}
else if (lft->bytes.life)
{
this->lifebytes = lft->bytes.life;
}
free(lft);
} | false | false | false | false | false | 0 |
gplp_func_desc_load (GOPluginService *service,
char const *name,
GnmFuncDescriptor *res)
{
ServiceLoaderDataFunctionGroup *loader_data;
PyObject *fn_info_obj;
g_return_val_if_fail (IS_GNM_PLUGIN_SERVICE_FUNCTION_GROUP (service), FALSE);
g_return_val_if_fail (name != NULL, FALSE);
loader_data = g_ob... | false | false | false | false | false | 0 |
operator=(const Cldesc &rhs)
{
// guard against self-assignment
if (this != &rhs)
_description = rhs._description;
_start_1st_col = rhs._start_1st_col;
return *this;
} | false | false | false | false | false | 0 |
output_color_key(const char *zClrKey, int horiz, char *zTabArgs){
int i, j, k;
char *zSafeKey, *zToFree;
while( fossil_isspace(*zClrKey) ) zClrKey++;
if( zClrKey[0]==0 ) return;
cgi_printf("<table %s>\n",(zTabArgs));
if( horiz ){
cgi_printf("<tr>\n");
}
zToFree = zSafeKey = mprintf("%h", zClrKey);
... | false | false | false | false | false | 0 |
__cnvt_signed64_to_real(word32 *ap, int32 blen)
{
word64 t1;
sword64 st1;
double d1;
/* DBG remove -- */
if (blen <= WBITS) __misc_terr(__FILE__, __LINE__);
/* -- */
/* t1 is just the word32 bit pattern */
t1 = ((word64) ap[0]) | (((word64) ap[1]) << 32);
if (__is_lnegative(ap, blen))
{
t1 &= (((word6... | false | false | false | false | false | 0 |
process_extent(struct send_ctx *sctx,
struct btrfs_path *path,
struct btrfs_key *key)
{
struct clone_root *found_clone = NULL;
int ret = 0;
if (S_ISLNK(sctx->cur_inode_mode))
return 0;
if (sctx->parent_root && !sctx->cur_inode_new) {
ret = is_extent_unchanged(sctx, path, key);
if (ret < 0)
goto... | false | false | false | false | false | 0 |
_bufferevent_run_readcb(struct bufferevent *bufev)
{
/* Requires that we hold the lock and a reference */
struct bufferevent_private *p =
EVUTIL_UPCAST(bufev, struct bufferevent_private, bev);
if (bufev->readcb == NULL)
return;
if (p->options & BEV_OPT_DEFER_CALLBACKS) {
p->readcb_pending = 1;
if (!p->de... | false | false | false | false | false | 0 |
glusterd_store_delete_peerinfo (glusterd_peerinfo_t *peerinfo)
{
int32_t ret = -1;
glusterd_conf_t *priv = NULL;
char peerdir[PATH_MAX] = {0,};
char filepath[PATH_MAX] = {0,};
char ... | false | false | false | true | false | 1 |
spinner_cb(GtkSpinButton * spin_button, gpointer data) {
tb_crop_t * tb_crop = data;
AmitkView view;
AmitkDim dim;
range_t which_range;
gint int_value;
view = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(spin_button), "which_view"));
dim = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(spin_button), "which_di... | false | false | false | false | false | 0 |
handle_child_signal()
{
union wait status;
while (wait3(&status, WNOHANG, 0) > 0) {}
} | false | false | false | false | false | 0 |
CreateStretchYPixmap(
Display *dpy, Pixmap src, int src_width, int src_height, int src_depth,
int dest_height, GC gc)
{
int i;
Pixmap pixmap;
GC my_gc = None;
if (src_height < 0 || src_depth < 0 || dest_height < 0)
{
return None;
}
pixmap = XCreatePixmap(dpy, src, src_width, dest_height, src_depth);
if (pi... | false | false | false | false | false | 0 |
kui_tree_get_data(struct kui_tree *ktree, void *data)
{
if (!ktree)
return -1;
if (!ktree->found)
return -1;
memcpy(data, &ktree->found_node->macro_value, sizeof (void *));
return 0;
} | false | false | false | false | false | 0 |
ScrListSetSelected(Widget gw, long i, int select)
{
ScrListWidget w = (ScrListWidget)gw;
if (i < 0 || i >= LINES(w))
return;
select = !!select;
if (w->scrlist.selected[i] == select)
return;
if (select) {
if (w->scrlist.at_most_one && w->scrlist.n_sel > 0) {
long j;
Boolean *sel = w->... | false | false | false | false | false | 0 |
gupnp_dlna_metadata_backend_get_extractor (void)
{
gboolean metadata_backend_loaded = load_metadata_backend ();
g_return_val_if_fail (metadata_backend_loaded == TRUE, NULL);
return metadata_backend.get_default_extractor ();
} | false | false | false | false | false | 0 |
create(int left, int right, const char *ctitle)
{
//
// sanity checks on arguments
//
trace(("col_pretty::create(this = %08lX, left = %d, right = %d, "
"ctitle = \"%s\")\n{\n", (long)this, left, right,
(ctitle ? ctitle : "")));
if (left < 0)
{
if (ncolumns > 0)
left = column[ncolumns... | false | false | false | false | false | 0 |
check_arg_attrs(const var_t *arg)
{
const attr_t *attr;
if (arg->attrs)
{
LIST_FOR_EACH_ENTRY(attr, arg->attrs, const attr_t, entry)
{
if (!allowed_attr[attr->type].on_arg)
error_loc("inapplicable attribute %s for argument %s\n",
allowed_attr[attr->type].display_name, arg-... | false | false | false | false | false | 0 |
__erst_get_next_record_id(u64 *record_id)
{
struct apei_exec_context ctx;
int rc;
erst_exec_ctx_init(&ctx);
rc = apei_exec_run(&ctx, ACPI_ERST_GET_RECORD_ID);
if (rc)
return rc;
*record_id = apei_exec_ctx_get_output(&ctx);
return 0;
} | false | false | false | false | false | 0 |
on_addParameter_clicked()
{
addParameter(QString(), QString(), false, ActionTools::ScriptParameter::Text);
} | false | false | false | false | false | 0 |
_tex_2d(int intfmt, int w, int h, int fmt, int type)
{
#ifdef GL_TEXTURE_INTERNAL_FORMAT
int intfmtret = -1;
#endif
glTexImage2D(GL_TEXTURE_2D, 0, intfmt, w, h, 0, fmt, type, NULL);
GLERR(__FUNCTION__, __FILE__, __LINE__, "");
#ifdef GL_TEXTURE_INTERNAL_FORMAT
// this is not in opengles!!! hrrrm
if (g... | false | false | false | false | false | 0 |
place_item(frame * my_frame, int type)
{
GooCanvasItem *item = NULL;
int i, j;
int k, nb_item;
RsvgHandle *image;
double item_x, item_y;
double x, y;
RsvgHandle *image_name[MAX_LIST];
RsvgHandle *image_star_clear = gc_rsvg_load("magic_hat/star-clear.svgz");
image_name[0] = gc_rsvg_load("magic_hat/s... | false | false | false | false | false | 0 |
InitMCObjectFileInfo(const Triple &TheTriple,
Reloc::Model relocm,
CodeModel::Model cm,
MCContext &ctx) {
RelocM = relocm;
CMModel = cm;
Ctx = &ctx;
// Common.
CommDirectiveSupp... | false | false | false | false | false | 0 |
GetFeature( long nFeatureId )
{
char *pszFCName, *pszFCId;
if( nFeatureId < 0 || nFeatureId >= poDS->GetFCCount() )
return NULL;
poDS->GetFeatureClass( nFeatureId, &pszFCId, &pszFCName );
/* -------------------------------------------------------------------- */
/* Create a c... | false | false | false | false | false | 0 |
decode_b_segment(char *in, char *ot, char *ep)
{
/* Decode in..ep, possibly in-place to ot */
int c, pos = 0, acc = 0;
while ((c = *in++) != 0 && (in <= ep)) {
if (c == '+')
c = 62;
else if (c == '/')
c = 63;
else if ('A' <= c && c <= 'Z')
c -= 'A';
else if ('a' <= c && c <= 'z')
c -= 'a' - 26;
... | false | false | false | false | false | 0 |
AddCom(int Type, int NbLevelArg)
{
int CurrInstr;
PileBloc[TopPileB]->NbInstr++;
CurrInstr=PileBloc[TopPileB]->NbInstr;
if (CurrInstr==0)
PileBloc[TopPileB]->TabInstr=(Instr*)safecalloc(1,sizeof(Instr)*(CurrInstr+1));
else
PileBloc[TopPileB]->TabInstr=(Instr*)realloc(PileBloc[TopPileB]->TabInstr,
sizeof... | false | false | false | false | false | 0 |
__argp_state_help (const struct argp_state *state, FILE *stream, unsigned flags)
{
if ((!state || ! (state->flags & ARGP_NO_ERRS)) && stream)
{
if (state && (state->flags & ARGP_LONG_ONLY))
flags |= ARGP_HELP_LONG_ONLY;
_help (state ? state->root_argp : 0, state, stream, flags,
state ? state->... | false | false | false | false | false | 0 |
Perl_cv_const_sv(pTHX_ const CV *const cv)
{
PERL_UNUSED_CONTEXT;
if (!cv)
return NULL;
if (!(SvTYPE(cv) == SVt_PVCV || SvTYPE(cv) == SVt_PVFM))
return NULL;
return CvCONST(cv) ? MUTABLE_SV(CvXSUBANY(cv).any_ptr) : NULL;
} | false | false | false | false | false | 0 |
dqinit_needed(struct inode *inode, int type)
{
struct dquot * const *dquots;
int cnt;
if (IS_NOQUOTA(inode))
return 0;
dquots = i_dquot(inode);
if (type != -1)
return !dquots[type];
for (cnt = 0; cnt < MAXQUOTAS; cnt++)
if (!dquots[cnt])
return 1;
return 0;
} | false | false | false | false | false | 0 |
init_net(const char *unixpath)
{
int lmtpdsock;
struct sockaddr_un addr;
struct backend *conn;
if ((lmtpdsock = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) {
just_exit("socket failed");
}
addr.sun_family = AF_UNIX;
strlcpy(addr.sun_path, unixpath, sizeof(addr.sun_path));
if (connect(lmtpdsock, (struc... | false | false | false | false | false | 0 |
reflection_methodbuilder_from_method_builder (ReflectionMethodBuilder *rmb, MonoReflectionMethodBuilder *mb)
{
MONO_REQ_GC_UNSAFE_MODE;
memset (rmb, 0, sizeof (ReflectionMethodBuilder));
rmb->ilgen = mb->ilgen;
rmb->rtype = mono_reflection_type_resolve_user_types ((MonoReflectionType*)mb->rtype);
rmb->parameters... | false | false | false | false | false | 0 |
endttyent (void)
{
int rval;
if (tf) {
rval = !(fclose(tf) == EOF);
tf = NULL;
return (rval);
}
return (1);
} | false | false | false | false | false | 0 |
gl_file_save (glLabel *label,
glWindow *window)
{
glXMLLabelStatus status;
gchar *filename = NULL;
gl_debug (DEBUG_FILE, "");
g_return_val_if_fail (label != NULL, FALSE);
if (gl_label_is_untitled (label))
{
gl_debug (DEBUG_FILE, "Untitled");
return gl_file_save_as (label, window);
... | false | false | false | false | false | 0 |
findLightsAffectingFrustum(const Camera* camera)
{
// Similar to the basic SceneManager, we iterate through
// lights to see which ones affect the frustum. However,
// since we have camera & lights partitioned by zones,
// we can check only those lights which either affect the
... | false | false | false | false | false | 0 |
canvas_event (GooCanvasItem *item,
GooCanvasItem *target,
GdkEventButton *event,
gpointer data)
{
FishItem *fish;
gdouble mouse_x;
gdouble mouse_y;
int ii;
mouse_x = event->x;
mouse_y = event->y;
if (gcomprisBoard->level >= 3 &&
!(event->state & GDK_SHIFT_MASK)) {
for (i... | false | false | false | false | false | 0 |
locateCharString( int FontID, char *charname)
{
int namelen;
int dictlen;
int i;
psdict *CharStringsP;
namelen=strlen( charname);
CharStringsP=pFontBase->pFontArray[FontID].pType1Data->CharStringsP;
dictlen=CharStringsP[0].key.len;
for ( i=1; i<=dictlen; i++) {
if (namelen==CharStringsP[i]... | false | false | false | false | false | 0 |
snd_cobalt_pcm_pb_trigger(struct snd_pcm_substream *substream,
int cmd)
{
struct snd_cobalt_card *cobsc = snd_pcm_substream_chip(substream);
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
if (cobsc->alsa_pb_channel)
return -EBUSY;
cobsc->alsa_pb_channel = true;
return 0;
case SNDRV_PCM_TRIGGER_STOP... | false | false | false | false | false | 0 |
txd_read_header(AVFormatContext *s, AVFormatParameters *ap) {
AVStream *st;
st = av_new_stream(s, 0);
if (!st)
return AVERROR(ENOMEM);
st->codec->codec_type = CODEC_TYPE_VIDEO;
st->codec->codec_id = CODEC_ID_TXD;
st->codec->time_base.den = 5;
st->codec->time_base.num = 1;
/* the... | false | false | false | false | false | 0 |
trace_recovery(int trace_level)
{
if (trace_level < LOG &&
trace_level >= trace_recovery_messages)
return LOG;
return trace_level;
} | false | false | false | false | false | 0 |
svm_get_labels(const svm_model *model, int* label)
{
if (model->label != NULL)
for(int i=0;i<model->nr_class;i++)
label[i] = model->label[i];
} | false | false | false | false | false | 0 |
elementtobool(Arc::XMLNode pnode,const char* ename,bool& val,Arc::Logger* logger) {
std::string v = ename?pnode[ename]:pnode;
if(v.empty()) return true; // default
if((v == "true") || (v == "1")) {
val=true;
return true;
};
if((v == "false") || (v == "0")) {
val=false;
return... | false | false | false | false | false | 0 |
cbf_get_pixel_coordinates (cbf_detector detector, double index1,
double index2,
double *coordinate1,
double *coordinate2,
... | false | false | false | false | false | 0 |
gps_dbus_open(struct gps_data_t *gpsdata)
{
DBusError error;
gpsdata->privdata = (void *)malloc(sizeof(struct privdata_t));
if (gpsdata->privdata == NULL)
return -1;
dbus_error_init(&error);
connection = dbus_bus_get(DBUS_BUS_SYSTEM, &error);
if (dbus_error_is_set(&error)) {
syslog(LOG_CRIT,... | false | false | false | false | false | 0 |
mesh_variance(MeshT *mesh, const int anylabel)
{
struct mesh_variance_s v;
double x,y;
int c=0,xi,yi;
v.vx=0; v.vy=0; v.vxy=0; v.mx=0; v.my=0;
for(xi=0; xi < mesh->nx ; xi++) {
for(yi=0; yi<mesh->ny ; yi++) {
if( anylabel || 0 == meshGetLabel(mesh,xi,yi)) {
v.mx += (x=meshGetx(mesh, xi,yi));
... | false | false | false | false | false | 0 |
getLabel(const int masterLid, const QString &lang)
{
Utils::Join join(Constants::Table_LABELS, Constants::LABELS_LID, Constants::Table_LABELSLINK, Constants::LABELSLINK_LID);
Utils::FieldList where;
where << Utils::Field(Constants::Table_LABELSLINK, Constants::LABELSLINK_MASTERLID, QString("... | false | false | false | false | false | 0 |
MoveOneProperty ( XMPMeta & stdXMP, XMPMeta * extXMP,
XMP_StringPtr schemaURI, XMP_StringPtr propName )
{
XMP_Node * propNode = 0;
XMP_NodePtrPos stdPropPos;
XMP_Node * stdSchema = FindSchemaNode ( &stdXMP.tree, schemaURI, kXMP_ExistingOnly, 0 );
if ( stdSchema != 0 ) {
propNode = FindChildNode ( std... | false | false | false | false | false | 0 |
setMenuBarVisible(bool v)
{
_showMenuBar = v;
if (!menuBar)
return;
configure();
performArrange();
} | false | false | false | false | false | 0 |
bigint_copy(bigint_t *res, const bigint_t *other)
{
struct bigint *bres = BIGINT(res);
struct bigint *bother = BIGINT(other);
size_t offset;
bigint_check(bres);
bigint_check(bother);
g_assert(bres->len >= bother->len);
offset = bres->len - bother->len;
memcpy(&bres->v[offset], bother->v, bother->len);
if (o... | false | true | false | false | false | 1 |
tree_move_next_or_upnext(struct btrfs_root *root,
struct btrfs_path *path,
int *level, int root_level)
{
int ret = 0;
int nritems;
nritems = btrfs_header_nritems(path->nodes[*level]);
path->slots[*level]++;
while (path->slots[*level] >= nritems) {
if (*level == root_level)
return -1;
/* m... | false | false | false | false | false | 0 |
_gda_sqlite_meta_schemata (G_GNUC_UNUSED GdaServerProvider *prov, GdaConnection *cnc,
GdaMetaStore *store, GdaMetaContext *context, GError **error,
G_GNUC_UNUSED const GValue *catalog_name, const GValue *schema_name_n)
{
GdaDataModel *model, *tmpmodel;
gboolean retval = TRUE;
gint nrows, i;
tmpmodel = (... | false | false | false | false | false | 0 |
bind_to_seg(md_addr_t addr) /* address to bind to a segment */
{
if (ld_data_base <= addr && addr < (ld_data_base + ld_data_size))
return seg_data;
else if ((ld_data_base + ld_data_size) <= addr && addr < ld_brk_point)
return seg_heap;
/* FIXME: ouch! */
else if ((ld_stack_base - (16*1024*1024)) <= add... | false | false | false | false | false | 0 |
calc_abstimeout(int msec, struct timespec *abstime)
{
// It would be best to use clock_gettime here, but it is not
// widely available, so use gettimeofday() which we can count on
// being available, if not quite as accurate.
struct timeval now;
gettimeofday(&now, NULL);
abstime->tv_... | false | false | false | false | false | 0 |
iegInqData(iegrec_t *iegp, int prec, void *data)
{
size_t datasize;
size_t i;
int ierr = 0;
int dprec;
void *buffer;
int byteswap = iegp->byteswap;
datasize = iegp->datasize;
buffer = iegp->buffer;
dprec = iegp->dprec;
switch ( dprec )
{
case SINGLE_PRECISION:
{
if ( sizeof(FLT32... | false | true | false | false | false | 1 |
evaluate(Modification& m, int* p, double* width,
bool justCheck, int& seedIndex, bool shapeDest,
Renderer* rti) const
{
if (mType != ModType) {
CfdgError::Error(where, "Expression does not evaluate to an adjustment");
return;
}
... | false | false | false | false | false | 0 |
search_uint_p(ulong *bufptr, ulonglong addr, int longcnt, struct searchinfo *si)
{
int i;
int cnt = longcnt * (sizeof(long)/sizeof(int));
uint *ptr = (uint *)bufptr;
uint mask = si->s_parms.s_uint.mask;
for (i = 0; i < cnt; i++, ptr++, addr += sizeof(int)) {
for (si->val = 0; si->val < si->vcnt; si->val++) {
... | false | false | false | false | false | 0 |
check_for_range(word32 *addr, int num_samps, int offset)
{
short *shortptr;
int i;
int left;
int right;
int max;
max = -32768;
if(num_samps > SOUND_SHM_SAMP_SIZE) {
halt_printf("num_samps: %d > %d!\n", num_samps,
SOUND_SHM_SAMP_SIZE);
}
for(i = 0; i < num_samps; i++) {
shortptr = (short *)&(addr[... | false | false | false | false | false | 0 |
gst_mixer_volume_changed (GstMixer * mixer,
GstMixerTrack * track, gint * volumes)
{
GstStructure *s;
GstMessage *m;
GValue l = { 0, };
GValue v = { 0, };
gint i;
g_return_if_fail (mixer != NULL);
g_return_if_fail (GST_IS_ELEMENT (mixer));
g_return_if_fail (track != NULL);
s = gst_structure_new ... | false | false | false | false | false | 0 |
EncodeFrame(const CImage* src, void* dest, int* is_keyframe, size_t* size, int* lpckid=0)
{
if ((dest == 0) || (src == 0))
{
if (size)
*size = 0;
return 0;
}
const CImage* tmp;
if (header.biBitCount != 24 || header.biCompression)
{
BitmapInfo supp(header);
supp.SetBits(24);
supp.biB... | false | false | false | false | false | 0 |
netxen_pcie_strap_init(struct netxen_adapter *adapter)
{
u32 pdevfuncsave;
u32 c8c9value = 0;
u32 chicken = 0;
u32 control = 0;
int i, pos;
struct pci_dev *pdev;
pdev = adapter->pdev;
chicken = NXRD32(adapter, NETXEN_PCIE_REG(PCIE_CHICKEN3));
/* clear chicken3.25:24 */
chicken &= 0xFCFFFFFF;
/*
* if gen1... | false | false | false | false | false | 0 |
caml_thread_initialize(value unit) /* ML */
{
/* Protect against repeated initialization (PR#1325) */
if (curr_thread != NULL) return Val_unit;
/* OS-specific initialization */
st_initialize();
/* Initialize and acquire the master lock */
st_masterlock_init(&caml_master_lock);
/* Initialize the keys */
... | false | false | false | false | false | 0 |
gst_query_set_nth_allocation_pool (GstQuery * query, guint index,
GstBufferPool * pool, guint size, guint min_buffers, guint max_buffers)
{
GArray *array;
GstStructure *structure;
AllocationPool *oldap, ap;
g_return_if_fail (GST_QUERY_TYPE (query) == GST_QUERY_ALLOCATION);
structure = GST_QUERY_STRUCTUR... | false | false | false | false | false | 0 |
qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
Q_ASSERT(staticMetaObject.cast(_o));
ClientCentralWindow *_t = static_cast<ClientCentralWindow *>(_o);
switch (_id) {
case 0: _t->showMessage((*reinterpret_cast< QSt... | false | false | false | false | false | 0 |
NCONF_new(CONF_METHOD *meth)
{
CONF *ret;
if (meth == NULL)
meth = NCONF_default();
ret = meth->create(meth);
if (ret == NULL)
{
CONFerr(CONF_F_NCONF_NEW,ERR_R_MALLOC_FAILURE);
return(NULL);
}
return ret;
} | false | false | false | false | false | 0 |
ast_calendar_register(struct ast_calendar_tech *tech)
{
struct ast_calendar_tech *iter;
AST_LIST_LOCK(&techs);
AST_LIST_TRAVERSE(&techs, iter, list) {
if(!strcasecmp(tech->type, iter->type)) {
ast_log(LOG_WARNING, "Already have a handler for calendar type '%s'\n", tech->type);
AST_LIST_UNLOCK(&techs);
re... | false | false | false | false | false | 0 |
calcTerminalPoint(const QString & terminalId, const QRectF & connectorRect, bool ignoreTerminalPoint, const QRectF & viewBox, QMatrix & terminalMatrix)
{
Q_UNUSED(terminalMatrix);
QPointF terminalPoint = connectorRect.center() - connectorRect.topLeft(); // default spot is centered
if (ignoreTerminalPoint) {
ret... | false | false | false | false | false | 0 |
show_send_rec_set(Block* bptr, int vpe_cnt,
IntSet** send_set, IntSet* recv_set, IntSet* broad_set)
{
int i, j;
if (bptr->usage == USE_MT) {
fprintf(stderr, "MT %d", bptr->hmt_no);
} else if (bptr->usage == USE_EMT) {
fprintf(stderr, "EMT %d", bptr->hmt_no);
} else {
fprintf(stderr, "Block %d",... | false | false | false | false | false | 0 |
em_aam(struct x86_emulate_ctxt *ctxt)
{
u8 al, ah;
if (ctxt->src.val == 0)
return emulate_de(ctxt);
al = ctxt->dst.val & 0xff;
ah = al / ctxt->src.val;
al %= ctxt->src.val;
ctxt->dst.val = (ctxt->dst.val & 0xffff0000) | al | (ah << 8);
/* Set PF, ZF, SF */
ctxt->src.type = OP_IMM;
ctxt->src.val = 0;
ctx... | false | false | false | false | false | 0 |
save_route(const struct sockaddr_nl *who, struct nlmsghdr *n,
void *arg)
{
int ret;
int len = n->nlmsg_len;
struct rtmsg *r = NLMSG_DATA(n);
struct rtattr *tb[RTA_MAX+1];
int host_len = -1;
host_len = calc_host_len(r);
len -= NLMSG_LENGTH(sizeof(*r));
parse_rtattr(tb, RTA_MAX, RTM_RTA(r), len);
if (!... | false | false | false | false | false | 0 |
sil_pata_udma_filter(ide_drive_t *drive)
{
ide_hwif_t *hwif = drive->hwif;
struct pci_dev *dev = to_pci_dev(hwif->dev);
unsigned long base = (unsigned long)hwif->hwif_data;
u8 scsc, mask = 0;
base += (hwif->host_flags & IDE_HFLAG_MMIO) ? 0x4A : 0x8A;
scsc = sil_ioread8(dev, base);
switch (scsc & 0x30) {
cas... | false | false | false | false | false | 0 |
check_fstab(const char *progname, const char *mountpoint, const char *devname,
char **options)
{
FILE *fstab;
struct mntent *mnt;
/* make sure this mount is listed in /etc/fstab */
fstab = setmntent(_PATH_MNTTAB, "r");
if (!fstab) {
fprintf(stderr, "Couldn't open %s for reading!\n", _PATH_MNTTAB);
return... | false | false | false | false | false | 0 |
run( GameStates &gameState ) {
if ( playMusicOn && mixer.whichMusicPlaying() != MUSIC_INTRO ) {
mixer.playMusic( MUSIC_INTRO, -1, 1000 );
}
draw();
while ( gameState == GS_INTRO ) {
handleEvents( gameState );
draw();
SDL_Delay( 50 );
}
} | false | false | false | false | false | 0 |
_cx18_enqueue(struct cx18_stream *s, struct cx18_mdl *mdl,
struct cx18_queue *q, int to_front)
{
/* clear the mdl if it is not to be enqueued to the full queue */
if (q != &s->q_full) {
mdl->bytesused = 0;
mdl->readpos = 0;
mdl->m_flags = 0;
mdl->skipped = 0;
mdl->curr_buf = NULL;
}
/* q_busy is res... | false | false | false | false | false | 0 |
git_diff_ui_config(const char *var, const char *value)
{
if (!strcmp(var, "diff.renamelimit")) {
diff_rename_limit_default = git_config_int(var, value);
return 0;
}
if (!strcmp(var, "diff.color") || !strcmp(var, "color.diff")) {
diff_use_color_default = git_config_colorbool(var, value);
return 0;
}
if (!st... | true | true | true | false | true | 1 |
show_modes(struct device *device, struct device_attribute *attr,
char *buf)
{
struct fb_info *fb_info = dev_get_drvdata(device);
unsigned int i;
struct list_head *pos;
struct fb_modelist *modelist;
const struct fb_videomode *mode;
i = 0;
list_for_each(pos, &fb_info->modelist) {
modelist = list_entry(pos,... | false | false | false | false | false | 0 |
wilc_get_chipid(u8 update)
{
static u32 chipid;
/* SDIO can't read into global variables */
/* Use this variable as a temp, then copy to the global */
u32 tempchipid = 0;
u32 rfrevid;
if (chipid == 0 || update != 0) {
g_wlan.hif_func.hif_read_reg(0x1000, &tempchipid);
g_wlan.hif_func.hif_read_reg(0x13f4, &rf... | false | false | false | false | false | 0 |
fi_calc_interest (fi_ptr fi)
{
if (fi->npp)
fi->ir = _fi_calc_interest (fi->npp, fi->pv, fi->pmt, fi->fv,
fi->CF, fi->PF, fi->disc, fi->bep);
return fi->ir;
} | false | false | false | false | false | 0 |
unit_error_variances (double *uvar, const MODEL *pmod,
panelmod_t *pan, int *df)
{
int i, t;
double uit;
*df = 0;
for (i=0; i<pan->nunits; i++) {
if (pan->unit_obs[i] < S2MINOBS) {
uvar[i] = NADBL;
} else {
uvar[i] = 0.0;
for (t=0; t<pan->T; t++) {
uit = pmod->uhat[panel_inde... | false | false | false | false | false | 0 |
setup_ssh_environment (void)
{
GDBusConnection *conn;
GError *error;
GVariant *iter;
gchar *env;
error = NULL;
conn = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error);
if (! conn)
{
g_warning ("Failed to setup SSH evironment: %s (%s, %d)",
error->message, g_quark_to_string (... | false | false | false | false | false | 0 |
print_kmg(const char *const pre
, const char *const format, const double num
, const char *const post, FILE *const f)
{
if (pre != NULL)
fprintf(f, "%s", pre);
if (num >= 1000000000.0) {
fprintf(f, format, num / 1024.0 / 1024.0 / 1024.0);
fprintf(f, " G");
} else if (num >= 1000000.0) {
fpri... | false | false | false | false | false | 0 |
functrc(A f,I x){
CX cx=(CX)f->p[f->n+2];
if(dbg_hold||nix(cx->s)||(dbg_levels&&dbg_levels<dbg_depth))R 0;
DH("\343%s%s.%s %sed\n",dbg_pfx(),cx->s->n,(XS(*f->d))->n,blurb[x]);
FFL;
if(dbg_cbfunc)
{
dbg_callcb("func",2,
ge(MS(symjoin(cx->s,XS(*f->d)))),
ge(MS(si(blurb[x]))),
(A)0);
R -... | false | false | false | false | false | 0 |
_snd_pcm_ladspa_open(snd_pcm_t **pcmp, const char *name,
snd_config_t *root, snd_config_t *conf,
snd_pcm_stream_t stream, int mode)
{
snd_config_iterator_t i, next;
int err;
snd_pcm_t *spcm;
snd_config_t *slave = NULL, *sconf;
const char *path = NULL;
long channels = 0;
snd_config_t *plugins = NULL, *pp... | false | false | false | false | false | 0 |
generateEdges(PathReference* reference)
{
// Generate fill edges
if(reference->fillEdges_)
{
SubPath* subPath = reference->generator_->beginSubPathIteration();
reference->fillEdges_->init(static_cast<vplUint>(height_),
referenc... | false | false | false | false | false | 0 |
simplecmd(void) {
union node *args, **app;
union node *n = NULL;
union node *vars, **vpp;
union node **rpp, *redir;
int savecheckkwd;
int savelinno;
args = NULL;
app = &args;
vars = NULL;
vpp = &vars;
redir = NULL;
rpp = &redir;
savecheckkwd = CHKALIAS;
savelinno = plinno;
for (;;) {
checkkwd = savec... | false | false | false | false | false | 0 |
brcmf_flowring_lookup(struct brcmf_flowring *flow, u8 da[ETH_ALEN],
u8 prio, u8 ifidx)
{
struct brcmf_flowring_hash *hash;
u8 hash_idx;
u32 i;
bool found;
bool sta;
u8 fifo;
u8 *mac;
fifo = brcmf_flowring_prio2fifo[prio];
sta = (flow->addr_mode[ifidx] == ADDR_INDIRECT);
mac = da;
if ((!sta) && (is_mult... | false | false | false | false | false | 0 |
nyx_LoadString(char *content)
{
node *rn = NULL;
if(content==NULL || !strlen(content))
return(NULL);
long nyx_len = strlen(content)+1;
rn = nyx_Load(content,nyx_len);
return(rn);
} | false | false | false | false | false | 0 |
move_away(view_map_t *vmap, loc_t loc, char *terrain)
{
loc_t new_loc;
int i;
for (i = 0; i < 8; i++) {
new_loc = loc + dir_offset[i];
if (map[new_loc].on_board
&& strchr (terrain, vmap[new_loc].contents))
return (new_loc);
}
return (loc);
} | 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.