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 |
|---|---|---|---|---|---|---|
setText(const std::vector<std::string>& content) {
clear();
for(std::vector<std::string>::const_iterator it = content.begin(); it != content.end(); it++) {
addLine(*it);
}
} | false | false | false | false | false | 0 |
prof_psdf(GwyDataField *dfield,
const ProfArgs *args)
{
GwyDataField *fftre, *fftim;
GwySIUnit *xyunit, *zunit;
const gdouble *im;
gdouble *re;
gint xres, yres, i, res;
gdouble r;
fftre = gwy_data_field_new_alike(dfield, FALSE);
fftim = gwy_data_field_new_alike(dfield, FALSE);... | false | false | false | false | false | 0 |
rotate(const LorentzMomentum &p) const {
LorentzRotation R;
static const double ptcut = 1e-20;
Energy2 pt2 = sqr(p.x())+sqr(p.y());
Energy2 pp2 = sqr(p.z())+pt2;
double phi, theta;
if(pt2 <= pp2*ptcut) {
if(p.z() > ZERO) theta = 0.;
else theta = Constants::pi;
phi = 0.;
} else {
Energy... | false | false | false | false | false | 0 |
xattr_hash(const void *key)
{
const struct xattr *xa = key;
unsigned hash;
/* xa->uri can be NULL, xa->local cannot */
hash = (NULL == xa->uri) ? 0 : string_mix_hash(xa->uri);
return hash ^ string_mix_hash(xa->local);
} | false | false | false | false | false | 0 |
pop3_state_auth_digest_resp(struct connectdata *conn,
int pop3code,
pop3state instate)
{
CURLcode result = CURLE_OK;
struct SessionHandle *data = conn->data;
char *chlg64 = NULL;
char *rplyb64 = NULL;
size_t len = 0;
(v... | false | false | false | false | false | 0 |
zcatfd (fd, ofd, fn)
int fd, ofd;
char *fn;
{
ssize_t nr;
int rval;
char lbuf[128];
rval = 0;
while (1)
{
nr = zread (fd, lbuf, sizeof (lbuf));
if (nr == 0)
break;
else if (nr < 0)
{
rval = -1;
break;
}
else if (zwrite (ofd, lbuf, nr) < 0)
{
rval = -1;
br... | false | false | false | false | false | 0 |
decodeb64(const String& line)
{ // decode a block of b64 MIME
long four = 0;
int d;
std::string result;
int len = line.length() - 4;
for (int i = 0; i < len; i += 4) {
four = 0;
d = decode1b64(line[i + 0]);
four = four | d;
d = decode1b64(line[i + 1]);
four = (four << 6) | d;
d = decode1b64(line[i +... | false | false | false | false | false | 0 |
boolean_compare_func (gpointer a, gpointer b, gint options,
QofParam *getter)
{
gboolean va, vb;
g_return_val_if_fail (a && b && getter && getter->param_getfcn, COMPARE_ERROR);
va = ((query_boolean_getter)getter->param_getfcn) (a, getter);
vb = ((query_boolean_getter)getter->param_... | false | false | false | false | false | 0 |
LoadPacketsFromOtherFiles(string filename)
{
// Split the original PAR2 filename into path and name parts
string path;
string name;
DiskFile::SplitFilename(filename, path, name);
string::size_type where;
// Trim ".par2" off of the end original name
// Look for the last "." in the filename
while (stri... | false | false | false | false | false | 0 |
snd_pcm_dmix_state(snd_pcm_t *pcm)
{
snd_pcm_direct_t *dmix = pcm->private_data;
snd_pcm_state_t state;
state = snd_pcm_state(dmix->spcm);
switch (state) {
case SND_PCM_STATE_SUSPENDED:
return state;
case SND_PCM_STATE_DISCONNECTED:
return state;
default:
break;
}
if (dmix->state == STATE_RUN_PENDING)
... | false | false | false | false | false | 0 |
bnx2x_change_mtu(struct net_device *dev, int new_mtu)
{
struct bnx2x *bp = netdev_priv(dev);
if (pci_num_vf(bp->pdev)) {
DP(BNX2X_MSG_IOV, "VFs are enabled, can not change MTU\n");
return -EPERM;
}
if (bp->recovery_state != BNX2X_RECOVERY_DONE) {
BNX2X_ERR("Can't perform change MTU during parity recovery\n"... | false | false | false | false | false | 0 |
f_seek (lua_State *L) {
static const int mode[] = {SEEK_SET, SEEK_CUR, SEEK_END};
static const char *const modenames[] = {"set", "cur", "end", NULL};
FILE *f = tofile(L);
int op = luaL_checkoption(L, 2, "cur", modenames);
lua_Integer p3 = luaL_optinteger(L, 3, 0);
l_seeknum offset = (l_seeknum)p3;
luaL_ar... | false | false | false | false | false | 0 |
G3d_closeCellNew(G3D_Map * map)
{
long ltmp;
if (map->useCache)
if (!G3d_flushAllTiles(map)) {
G3d_error("G3d_closeCellNew: error in G3d_flushAllTiles");
return 0;
}
if (!G3d_flushIndex(map)) {
G3d_error("G3d_closeCellNew: error in G3d_flushIndex");
return 0;
}
/* write the header i... | false | false | false | false | false | 0 |
Configtable_insert(struct config *data)
{
x4node *np;
int h;
int ph;
if( x4a==0 ) return 0;
ph = confighash(data);
h = ph & (x4a->size-1);
np = x4a->ht[h];
while( np ){
if( Configcmp((const char *) np->data,(const char *) data)==0 ){
/* An existing entry with the same key is found. */
/... | false | true | false | false | false | 1 |
load_session(int ignored,
const char *file)
{
FILE *f;
const int lens=PATH_MAX;
char s[lens+1], cwd[lens+1];
if(is_null(file)) return FALSE;
cwd[0]=0;
if((f=fopen(file, "r"))==NULL) {
showerr(file, _("could not open file '%s' for read: %s"));
return FALSE;
}
{ int e;
#if GLIB_MAJOR... | true | true | true | false | true | 1 |
Vector_get(Vector v, int i){
if (i >= v->len) return NULL;
return ((char*)v->v + i*(v->size_of_elem)/sizeof(char));
} | false | false | false | false | false | 0 |
eval_user_symbol( char *symb_nam)
{
str_sub_vocab_t *found = NULL;
found = lookup_str_sub( symb_nam, user_symbol_list );
if ( found == NULL )
{
tokenization_error ( TKERROR,
"Command-line symbol %s is not defined.\n", symb_nam);
}else{
char *symb_valu = found->alias;
if ( symb_val... | false | false | false | false | false | 0 |
process (jack_nframes_t nframes, void *arg)
{
jack_default_audio_sample_t *out = (jack_default_audio_sample_t *) jack_port_get_buffer (output_port, nframes);
jack_default_audio_sample_t *in = (jack_default_audio_sample_t *) jack_port_get_buffer (input_port, nframes);
unsigned int i;
if (grab_finished) {
return ... | false | false | false | false | false | 0 |
e_modapi_init(E_Module *m)
{
conf_item_edd = E_CONFIG_DD_NEW("IBox_Config_Item", Config_Item);
#undef T
#undef D
#define T Config_Item
#define D conf_item_edd
E_CONFIG_VAL(D, T, id, STR);
E_CONFIG_VAL(D, T, expand_on_desktop, INT);
E_CONFIG_VAL(D, T, show_label, INT);
E_CONFIG_VAL(D, T, show_... | false | false | false | false | false | 0 |
OTLListCopy(OTLookup **str) {
OTLookup **ret;
int i;
if ( str == NULL )
return( NULL );
for ( i=0 ; str[i]!=NULL; ++i );
ret = galloc((i+1)*sizeof( OTLookup *));
for ( i=0 ; str[i]!=NULL; ++i )
ret[i] = str[i];
ret[i] = NULL;
return( ret );
} | false | false | false | false | false | 0 |
net2272_write_fifo(struct net2272_ep *ep, struct net2272_request *req)
{
u8 *buf;
unsigned count, max;
int status;
dev_vdbg(ep->dev->dev, "write_fifo %s actual %d len %d\n",
ep->ep.name, req->req.actual, req->req.length);
/*
* Keep loading the endpoint until the final packet is loaded,
* or the endpoint bu... | false | false | false | false | false | 0 |
draw_sprites2(struct mame_bitmap *bitmap, const struct rectangle *cliprect, int j, int z, int pos)
{
int offs,mx,my,color,tile,fx,fy,i;
for (offs = pos; offs < pos+0x800 ; offs += 0x80 )
{
mx=spriteram16[(offs+j)>>1];
my=spriteram16[(offs+j+2)>>1];
mx=mx<<4;
mx=mx|((my>>12)&0xf);
my=my&0x1ff;
... | false | false | false | false | false | 0 |
increment_overflow(int *ip, int j)
{
int const i = *ip;
/*----------
* If i >= 0 there can only be overflow if i + j > INT_MAX
* or if j > INT_MAX - i; given i >= 0, INT_MAX - i cannot overflow.
* If i < 0 there can only be overflow if i + j < INT_MIN
* or if j < INT_MIN - i; given i < 0, INT_MIN - i cannot ... | false | false | false | false | false | 0 |
cleanup_mpu401(void)
{
if (io != -1 && irq != -1) {
/* Check for use by, for example, sscape driver */
unload_mpu401(&cfg);
}
} | false | false | false | false | false | 0 |
libinjection_sqli_blacklist(struct libinjection_sqli_state* sql_state)
{
/*
* use minimum of 8 bytes to make sure gcc -fstack-protector
* works correctly
*/
char fp2[LIBINJECTION_SQLI_MAX_TOKENS + 2 < 8 ? 8 : LIBINJECTION_SQLI_MAX_TOKENS + 2];
char ch;
size_t i;
size_t len = strlen(sq... | false | false | false | false | false | 0 |
DBMathRectangleArea (DBInt projection,DBCoordinate coord0,DBCoordinate coord1)
{
DBFloat lat0,lat1,lon0,lon1;
DBFloat area, dc;
if (projection == DBProjectionSpherical)
{
lon1 = coord1.X * M_PI / 180.0;
lat1 = coord1.Y * M_PI / 180.0;
lon0 = coord0.X * M_PI / 180.0;
lat0 = coord0.Y * M_PI / 180.0;
d... | false | false | false | false | false | 0 |
cos_cache_backwards_stricmp_and_clip(char*s1,char*s2)
{
int ret = 0;
int s1len = 0;
int s2len = 0;
LDAPDebug( LDAP_DEBUG_TRACE, "--> cos_cache_backwards_stricmp_and_clip\n",0,0,0);
s1len = strlen(s1);
s2len = strlen(s2);
if(s1len > s2len && s2len > 0)
{
while(s1len > -1 && s2len > -1)
{
s1len--;
s2... | false | false | false | false | false | 0 |
getRegForInlineAsmConstraint(const std::string &Constraint,
EVT VT) const {
if (Constraint.size() == 1) {
// GCC Constraint Letters
switch (Constraint[0]) {
default: break;
case 'r': // GENERAL_REGS
if (VT == MVT::i32)
return std::make_pair(0U, SystemZ::GR3... | false | false | false | false | false | 0 |
getSpecial (char *number) {
int i,j,l;
l=strlen(number);
for (i=0; i<nService; i++)
for(j=0; j<Service[i].nCode; j++)
if(strmatch(Service[i].Codes[j], number)>=l)
return i+1; /* must be > 0 for 1. Service */
return 0;
} | false | false | false | false | false | 0 |
spanUTF8(const char *s, int32_t length, USetSpanCondition spanCondition) const {
if(length>0 && bmpSet!=NULL) {
const uint8_t *s0=(const uint8_t *)s;
return (int32_t)(bmpSet->spanUTF8(s0, length, spanCondition)-s0);
}
if(length<0) {
length=uprv_strlen(s);
}
if(length==0) {
... | false | false | false | false | false | 0 |
contacts_get_attributes (ContactsContext *context)
{
const gchar **supported_interfaces;
/* tp_connection_get_contact_attributes insists that you have at least one
* handle; skip it if we don't (can only happen if we started from IDs) */
if (context->handles->len == 0)
{
contacts_context_continue (c... | false | false | false | false | false | 0 |
get_insert_comment_uri (GDataCommentable *self, GDataComment *comment_)
{
GDataLink *_link;
_link = gdata_entry_look_up_link (GDATA_ENTRY (self), "http://schemas.google.com/g/2005#feed");
g_assert (_link != NULL);
return g_strdup (gdata_link_get_uri (_link));
} | false | false | false | false | false | 0 |
nfs_init_subvolumes (struct nfs_state *nfs, xlator_list_t *cl)
{
int ret = -1;
unsigned int lrusize = 0;
int svcount = 0;
if ((!nfs) || (!cl))
return -1;
lrusize = nfs->memfactor * GF_NFS_INODE_LRU_MULT;
nfs->subvols = cl;
... | false | false | false | false | false | 0 |
WriteBlorb(FILE *F,FILE *Out)
// WriteBlorb generates a blorb from a BLC file
{
int n=0,i;
// Write the IFF header
write_id(Out,"FORM");
write_id(Out,"latr"); // We'll find this out at the end
write_id(Out,"IFRS");
// Build the index chunk
BuildIndex(F);
for(i=0;i<Chunks;i++)
{
// Write the inde... | false | false | false | false | true | 1 |
science_goal_callback(Widget w, XtPointer client_data,
XtPointer call_data)
{
size_t to = (size_t) client_data;
Boolean b;
XtVaGetValues(science_help_toggle, XtNstate, &b, NULL);
if (b == TRUE) {
popup_help_dialog_typed(advance_name_translation(advance_by_number(to)),
HEL... | false | false | false | false | false | 0 |
ipa_dump_param_adjustments (FILE *file, ipa_parm_adjustment_vec adjustments,
tree fndecl)
{
int i, len = adjustments.length ();
bool first = true;
vec<tree> parms = ipa_get_vector_of_formal_parms (fndecl);
fprintf (file, "IPA param adjustments: ");
for (i = 0; i < len; i++)
{
struct ipa_parm... | false | false | false | false | false | 0 |
gfxw_new_box(gfx_state_t *state, rect_t area, gfx_color_t color1, gfx_color_t color2, gfx_box_shade_t shade_type)
{
gfxw_box_t *widget = (gfxw_box_t *) _gfxw_new_widget(sizeof(gfxw_box_t), GFXW_BOX);
widget->widget_priority = _gfxw_color_get_priority(color1);
widget->bounds = area;
widget->color1 = color1;
widget... | false | false | false | false | false | 0 |
_gda_postgres_meta__btypes (G_GNUC_UNUSED GdaServerProvider *prov, GdaConnection *cnc,
GdaMetaStore *store, GdaMetaContext *context, GError **error)
{
GdaDataModel *model, *proxy;
gboolean retval = TRUE;
gint i, nrows;
GdaPostgresReuseable *rdata;
rdata = GDA_POSTGRES_GET_REUSEABLE_DATA (gda_connection_int... | false | false | false | false | false | 0 |
norm2(double *x, int N)
{
double norm = 0;
for (int i = 0; i < N; i++)
norm += x[i]*x[i];
return sqrt(norm);
} | false | false | false | false | false | 0 |
SetFID(long nFID)
{
if (m_nFID > 0) {
m_nFID = nFID;
}
else {
m_nFID = m_poDataBlock->GetFeatureCount() + 1;
}
} | false | false | false | false | false | 0 |
buildBVH() {
//if(mBVH) freeBVH();
vector<Shape*>::iterator itr;
for(itr = shapes.begin(); itr != shapes.end(); ++itr) {
(*itr)->updateBoundingBox();
}
mBVH = new BVH(shapes);
} | false | false | false | false | false | 0 |
list_do_sort(ListSortFunc func,
List_node *snode, List_node *enode,void *user_data) {
List_node *node;
if (snode != NULL && enode != NULL &&
snode->prev != enode && snode != enode) {
node = list_partition(func,&snode,&enode,user_data);
list_do_sort(func,snode,node->prev,user_dat... | false | false | false | false | false | 0 |
eog_image_link_with_target (EogImage *image, EogImageSaveInfo *target)
{
EogImagePrivate *priv;
g_return_if_fail (EOG_IS_IMAGE (image));
g_return_if_fail (EOG_IS_IMAGE_SAVE_INFO (target));
priv = image->priv;
/* update file location */
if (priv->file != NULL) {
g_object_unref (priv->file);
}
priv->file = g... | false | false | false | false | false | 0 |
map_create_patricia(size_t keybits)
{
map_t *m;
WALLOC(m);
m->magic = MAP_MAGIC;
m->type = MAP_PATRICIA;
m->u.pt = patricia_create(keybits);
return m;
} | false | false | false | false | false | 0 |
set_var(struct fbtft_par *par)
{
switch (par->info->var.rotate) {
/* AM: GRAM update direction */
case 0:
write_reg(par, 0x03, 0x0003 | (par->bgr << 12));
break;
case 180:
write_reg(par, 0x03, 0x0000 | (par->bgr << 12));
break;
case 270:
write_reg(par, 0x03, 0x000A | (par->bgr << 12));
break;
case 90:... | false | false | false | false | false | 0 |
untimeout(func, arg)
void (*func) __P((void *));
void *arg;
{
struct callout **copp, *freep;
/*
* Find first matching timeout and remove it from the list.
*/
for (copp = &callout; (freep = *copp); copp = &freep->c_next)
if (freep->c_func == func && freep->c_arg == arg) {
*copp = fre... | false | false | false | false | false | 0 |
mc_cache_child_init(apr_pool_t * p, server_rec * s,
mgs_srvconf_rec * sc)
{
apr_status_t rv = APR_SUCCESS;
int thread_limit = 0;
int nservers = 0;
char *cache_config;
char *split;
char *tok;
ap_mpm_query(AP_MPMQ_HARD_LIMIT_THREADS, &thread_limit);
/* Find all the servers in the first run to get a to... | false | false | false | false | false | 0 |
read_css_map()
{
/* Most errors are memory errors (but see below) */
set_last_error_code(ERR_NOMEM);
struct llist *css_map = create_llist();
if (NULL == css_map) return NULL;
char *line;
int i = 1;
while ((line = read_line(clade_css_map_file)) != NULL) {
/* Skip comments and lines that are empty or all whites... | false | false | false | false | false | 0 |
semantic(Scope *sc)
{
//printf("CompileDeclaration::semantic()\n");
if (!compiled)
{
compileIt(sc);
AttribDeclaration::addMember(sc, sd, 0);
compiled = 1;
}
AttribDeclaration::semantic(sc);
} | false | false | false | false | false | 0 |
OnIdle(wxIdleEvent &)
{
if (abs(pos - dpos) < 10e-6)
// destination reached, using non-exact comparison because pos
// and dpos are of type double.
return;
// Simple easing
pos += (dpos - pos) / 7;
Refresh(/*eraseBackground=*/false);
wxMilliSleep(1000.0/FPS); // ms
} | false | false | false | false | false | 0 |
adjust_libcall_notes (oldreg, newval, insn, libcall_sp)
rtx oldreg, newval, insn, *libcall_sp;
{
rtx end;
while ((end = *libcall_sp++))
{
rtx note = find_reg_equal_equiv_note (end);
if (! note)
continue;
if (REG_P (newval))
{
if (reg_set_between_p (newval, PREV_INSN (insn), end))
... | false | false | false | false | false | 0 |
get_filter_modes()
{
if (!filter_modes_) {
//FIXME is filter-path proper for filter mode files ???
// if filter-options-path better ???
// do we need a filter-mode-path ???
// should change to use genetic data-path once implemented
// and then search filter-path... | false | false | false | false | false | 0 |
asyncQueueProcessPageEntries(volatile QueuePosition *current,
QueuePosition stop,
char *page_buffer)
{
bool reachedStop = false;
bool reachedEndOfPage;
AsyncQueueEntry *qe;
do
{
QueuePosition thisentry = *current;
if (QUEUE_POS_EQUAL(thisentry, stop))
break;
qe = (AsyncQueueEntry *) (... | false | false | false | false | false | 0 |
selected(int line) const {
if (line < 1 || line > lines) return 0;
return find_line(line)->flags & SELECTED;
} | false | false | false | false | false | 0 |
filterString(View* view, const SmartRange &range, const Cursor &position)
{
return view->document()->text(KTextEditor::Range(range.start(), position));
} | false | false | false | false | false | 0 |
m68k_movec2 (int regno, uae_u32 *regp)
{
switch (regno) {
case 0: *regp = regs.sfc; break;
case 1: *regp = regs.dfc; break;
case 2: *regp = regs.cacr; break;
case 3: *regp = regs.tc; break;
case 4: *regp = regs.itt0; break;
case 5: *regp = regs.itt1; break;
case 6: *regp = regs.dtt0; break;
case 7: *re... | false | false | false | false | false | 0 |
_gtk_source_engine_update_highlight (GtkSourceEngine *engine,
const GtkTextIter *start,
const GtkTextIter *end,
gboolean synchronous)
{
g_return_if_fail (GTK_SOURCE_IS_ENGINE (engine));
g_return_if_fail (start != NULL && end != NULL);
g_return_if_fail (GTK_SOURCE_ENGINE_GET_INT... | false | false | false | false | false | 0 |
acpi_tb_get_root_table_entry(u8 *table_entry, u32 table_entry_size)
{
u64 address64;
/*
* Get the table physical address (32-bit for RSDT, 64-bit for XSDT):
* Note: Addresses are 32-bit aligned (not 64) in both RSDT and XSDT
*/
if (table_entry_size == ACPI_RSDT_ENTRY_SIZE) {
/*
* 32-bit platform, RSDT: R... | false | false | false | false | false | 0 |
clutter_stage_ensure_viewport (ClutterStage *stage)
{
g_return_if_fail (CLUTTER_IS_STAGE (stage));
_clutter_stage_dirty_viewport (stage);
clutter_actor_queue_redraw (CLUTTER_ACTOR (stage));
} | false | false | false | false | false | 0 |
normalizeDirName(OFFilename &result,
const OFFilename &dirName,
const OFBool allowEmptyDirName)
{
/* remove trailing path separators (keep it if appearing at the beginning of the string) */
/* TODO: do we need to check for absolut... | false | false | false | false | false | 0 |
PyFFFont_cidConvertTo(PyFF_Font *self,PyObject *args) {
FontViewBase *fv = ((PyFF_Font *) self)->fv;
SplineFont *sf = fv->sf;
struct cidmap *map;
char *registry, *ordering;
int supplement;
if ( sf->cidmaster!=NULL ) {
PyErr_Format(PyExc_EnvironmentError,"This font is already a CID keyed font."... | false | false | false | false | false | 0 |
brasero_plugin_manager_ui_finalize (GObject *object)
{
BraseroPluginManagerUI *pm = BRASERO_PLUGIN_MANAGER_UI (object);
BraseroPluginManagerUIPrivate *priv;
priv = BRASERO_PLUGIN_MANAGER_UI_GET_PRIVATE (pm);
if (priv->plugins) {
g_slist_foreach (priv->plugins, (GFunc) g_object_unref, NULL);
g_slist_free (priv... | false | false | false | false | false | 0 |
clear_trace_list(void)
{
struct remap_trace *trace;
struct remap_trace *tmp;
/*
* No locking required, because the caller ensures we are in a
* critical section via mutex, and is_enabled() is false,
* i.e. nothing can traverse or modify this list.
* Caller also ensures is_enabled() cannot change.
*/
list... | false | false | false | false | false | 0 |
blk_trace_setup_queue(struct request_queue *q,
struct block_device *bdev)
{
struct blk_trace *bt = NULL;
int ret = -ENOMEM;
bt = kzalloc(sizeof(*bt), GFP_KERNEL);
if (!bt)
return -ENOMEM;
bt->msg_data = __alloc_percpu(BLK_TN_MAX_MSG, __alignof__(char));
if (!bt->msg_data)
goto free_bt;
bt->dev = bdev... | false | false | false | false | false | 0 |
buildMainMenu(VisuUiDockWindow *window)
{
GtkWidget *menu, *item;
GList* tmpLst;
gchar *label;
VisuUiPanel *panel;
VisuUiDockWindow *dock;
gboolean haveHiddenDock;
menu = gtk_menu_new();
tmpLst = local_class->orphanVisuUiPanel;
/* All dock windows. */
while (tmpLst)
{
panel = (VisuUiPa... | false | false | false | false | false | 0 |
HasMaxCharges() const
{
ItemPrototype const* itemProto = GetProto();
for (int i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i)
if (GetSpellCharges(i) != itemProto->Spells[i].SpellCharges)
return false;
return true;
} | false | false | false | false | false | 0 |
makePrecise(double val) const
{
#if GEOS_DEBUG
cerr<<"PrecisionModel["<<this<<"]::makePrecise called"<<endl;
#endif
if (modelType==FLOATING_SINGLE) {
float floatSingleVal = static_cast<float>(val);
return static_cast<double>(floatSingleVal);
}
if (modelType == FIXED) {
// Use wh... | false | false | false | false | false | 0 |
cxgb4_free_stid(struct tid_info *t, unsigned int stid, int family)
{
/* Is it a server filter TID? */
if (t->nsftids && (stid >= t->sftid_base)) {
stid -= t->sftid_base;
stid += t->nstids;
} else {
stid -= t->stid_base;
}
spin_lock_bh(&t->stid_lock);
if (family == PF_INET)
__clear_bit(stid, t->stid_bmap)... | false | false | false | false | false | 0 |
ocfs2_find_local_alias(struct inode *inode,
u64 parent_blkno,
int skip_unhashed)
{
struct dentry *dentry;
spin_lock(&inode->i_lock);
hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) {
spin_lock(&dentry->d_lock);
if (ocfs2_match_dentry(dentry, parent_blkno, skip_unhashed)) {
tra... | false | false | false | false | false | 0 |
cbf_count_elements (cbf_handle handle, unsigned int *elements)
{
const char *diffrn_id, *id;
int errorcode;
unsigned int count;
/* Get the diffrn.id */
cbf_failnez (cbf_get_diffrn_id (handle, &diffrn_id))
cbf_failnez (cbf_find_category (handle, "diffrn_detector"))
cbf_failnez (cbf_find_column (h... | false | false | false | false | false | 0 |
mCalloc(int nb, size_t size)
{
void *allocated;
if((allocated = calloc((size_t)nb,(size_t)size)) != NULL)
{
return allocated;
}
else
Exit("\n. Err: low memory\n");
return NULL;
} | false | false | false | false | false | 0 |
i915_driver_cleanup_hw(struct drm_i915_private *dev_priv)
{
struct drm_device *dev = dev_priv->dev;
struct i915_ggtt *ggtt = &dev_priv->ggtt;
if (dev->pdev->msi_enabled)
pci_disable_msi(dev->pdev);
pm_qos_remove_request(&dev_priv->pm_qos);
arch_phys_wc_del(ggtt->mtrr);
io_mapping_free(ggtt->mappable);
i915_g... | false | false | false | false | false | 0 |
data_in_phase1(struct AdapterCtlBlk *acb, struct ScsiReqBlk *srb,
u16 *pscsi_status)
{
dprintkdbg(DBG_0, "data_in_phase1: (0x%p) <%02i-%i>\n",
srb->cmd, srb->cmd->device->id, (u8)srb->cmd->device->lun);
data_io_transfer(acb, srb, XFERDATAIN);
} | false | false | false | false | false | 0 |
compileTerm(Token *&tok, AST_state& state)
{
if (!tok)
return;
if (Token::Match(tok, "L %str%|%char%"))
tok = tok->next();
if (state.inArrayAssignment && tok->str() == "." && Token::Match(tok->previous(), ",|{")) // Jump over . in C style struct initialization
tok = tok->next();
... | false | false | false | false | false | 0 |
i40e_nvmupd_exec_aq(struct i40e_hw *hw,
struct i40e_nvm_access *cmd,
u8 *bytes, int *perrno)
{
struct i40e_asq_cmd_details cmd_details;
i40e_status status;
struct i40e_aq_desc *aq_desc;
u32 buff_size = 0;
u8 *buff = NULL;
u32 aq_desc_len;
u32 aq_data_len;
i40e_debug(hw, I40E_DEBUG_NVM, "N... | false | true | false | false | false | 1 |
get_free_dqblk(struct quota_handle *h)
{
dqbuf_t buf = getdqbuf();
struct qt_disk_dqdbheader *dh = (struct qt_disk_dqdbheader *)buf;
struct qtree_mem_dqinfo *info = &h->qh_info.u.v2_mdqi.dqi_qtree;
int blk;
if (!buf)
return -ENOMEM;
if (info->dqi_free_blk) {
blk = info->dqi_free_blk;
read_blk(h, blk, buf)... | false | false | false | false | false | 0 |
delete_password_va_start (const GnomeKeyringPasswordSchema* schema, va_list va,
GnomeKeyringOperationDoneCallback callback,
gpointer data, GDestroyNotify destroy_data)
{
GnomeKeyringAttributeList *attributes;
GkrOperation *op;
g_assert (schema);
g_assert (callbac... | false | false | false | false | false | 0 |
mono_marshal_get_delegate_end_invoke (MonoMethod *method)
{
MonoMethodSignature *sig;
MonoMethodBuilder *mb;
MonoMethod *res;
GHashTable *cache;
int params_var;
char *name;
MonoGenericContext *ctx = NULL;
MonoMethod *orig_method = NULL;
g_assert (method && method->klass->parent == mono_defaults.multicastdeleg... | false | false | false | false | false | 0 |
dumpTableConstraintComment(Archive *fout, ConstraintInfo *coninfo)
{
TableInfo *tbinfo = coninfo->contable;
PQExpBuffer q = createPQExpBuffer();
appendPQExpBuffer(q, "CONSTRAINT %s ",
fmtId(coninfo->dobj.name));
appendPQExpBuffer(q, "ON %s",
fmtId(tbinfo->dobj.name));
dumpComment(fout, q->data,
... | false | false | false | false | false | 0 |
distances_to(vertex_t target) const
{
std::size_t n = num_vertices(m_topology);
if (m_distances.size() != n * n)
{
m_distances.clear();
m_distances.resize(n * n, (std::numeric_limits<std::size_t>::max)());
m_known_vertices = n;
}
... | false | false | false | false | false | 0 |
updateRollLabel()
{
m_rolls -> setText(i18n("Roll %1 of 3",m_roll));
if (!m_demoMode) setEnabled(m_roll != 3);
} | false | false | false | false | false | 0 |
s5k4aa_dump_registers(struct sd *sd)
{
int address;
u8 page, old_page;
m5602_read_sensor(sd, S5K4AA_PAGE_MAP, &old_page, 1);
for (page = 0; page < 16; page++) {
m5602_write_sensor(sd, S5K4AA_PAGE_MAP, &page, 1);
pr_info("Dumping the s5k4aa register state for page 0x%x\n",
page);
for (address = 0; address <... | false | false | false | false | false | 0 |
sip_write_to_file(const sip_t* sip, const char* fn) {
FILE* fid;
int res;
if ((sip->a_order == 0) && (sip->b_order == 0) &&
(sip->ap_order == 0) && (sip->bp_order == 0))
return tan_write_to_file(&(sip->wcstan), fn);
fid = fopen(fn, "wb");
if (!fid) {
SYSERROR("Failed to open file \"%s\" to write WCS heade... | false | false | false | false | true | 1 |
sctp_crc32c_sb8_64_bit(uint32_t crc,
unsigned char const *p_buf,
uint32_t length,
uint32_t offset)
{
uint32_t li;
uint32_t term1, term2;
uint32_t running_length;
uint32_t end_bytes;
uint32_t init_bytes;
init_bytes = (4-offset) & 0x3;
if (init_bytes > length)
init_bytes = length;
running_length ... | false | false | false | false | false | 0 |
lsr_read_line_increment_type(GF_LASeRCodec *lsr, SVG_Number *li, const char *name)
{
u32 val;
GF_LSR_READ_INT(lsr, val, 1, "choice");
if (val==1) {
GF_LSR_READ_INT(lsr, val, 1, "type");
if (val==1) li->type=SVG_NUMBER_INHERIT;
else li->type=SVG_NUMBER_AUTO;
} else {
li->value = lsr_read_fixed_16_8(lsr, "lin... | false | false | false | false | false | 0 |
__env_get_verbose(dbenv, which, onoffp)
DB_ENV *dbenv;
u_int32_t which;
int *onoffp;
{
switch (which) {
case DB_VERB_BACKUP:
case DB_VERB_DEADLOCK:
case DB_VERB_FILEOPS:
case DB_VERB_FILEOPS_ALL:
case DB_VERB_MVCC:
case DB_VERB_RECOVERY:
case DB_VERB_REGISTER:
case DB_VERB_REPLICATION:
case DB_VERB_REP_ELE... | false | false | false | false | false | 0 |
VBE_AddBackend(struct cli *cli, const struct vrt_backend *vb)
{
struct backend *b;
char buf[128];
AN(vb->vcl_name);
assert(vb->ipv4_sockaddr != NULL || vb->ipv6_sockaddr != NULL);
(void)cli;
ASSERT_CLI();
/* Run through the list and see if we already have this backend */
VTAILQ_FOREACH(b, &backends, list) {
... | false | false | false | true | false | 1 |
frogr_group_new (const gchar *id,
const gchar *name,
FspGroupPrivacy privacy,
gint n_photos)
{
g_return_val_if_fail (id, NULL);
g_return_val_if_fail (name, NULL);
return FROGR_GROUP (g_object_new(FROGR_TYPE_GROUP,
"id", id,
... | false | false | false | false | false | 0 |
__ecereMethod___ecereNameSpace__ecere__gui__controls__ListBox_GetMultiSelection(struct __ecereNameSpace__ecere__com__Instance * this, struct __ecereNameSpace__ecere__sys__OldList * list)
{
struct __ecereNameSpace__ecere__gui__controls__ListBox * __ecerePointer___ecereNameSpace__ecere__gui__controls__ListBox = (struct _... | false | false | false | false | false | 0 |
DoFindFriendlyMissingBuff(float fRange, uint32 uiSpellId)
{
std::list<Creature*> pList;
MaNGOS::FriendlyMissingBuffInRangeCheck u_check(m_creature, fRange, uiSpellId);
MaNGOS::CreatureListSearcher<MaNGOS::FriendlyMissingBuffInRangeCheck> searcher(pList, u_check);
Cell::VisitGridObjects(m_creature, sea... | false | false | false | false | false | 0 |
snd_make_atone(sound_type s, double hz)
{
register atone_susp_type susp;
double bb;
rate_type sr = s->sr;
time_type t0 = s->t0;
int interp_desc = 0;
sample_type scale_factor = 1.0F;
time_type t0_min = t0;
falloc_generic(susp, atone_susp_node, "snd_make_atone");
bb = 2.0 - cos(hz * PI... | false | false | false | false | false | 0 |
works_get_strval (const record_t *r, guint ofs, int fmt, LotusState *state)
{
GString *str = g_string_new (NULL);
char *strutf8;
GIConv converter;
WksFontEntry *font;
while (ofs < r->len && r->data[ofs] != 0) {
g_string_append_c (str, r->data[ofs]);
ofs++;
}
font = g_hash_table_lookup (state->works_style_f... | false | false | false | false | false | 0 |
host_create_from_chunk(int family, chunk_t address, u_int16_t port)
{
private_host_t *this;
switch (family)
{
case AF_INET:
if (address.len < IPV4_LEN)
{
return NULL;
}
address.len = IPV4_LEN;
break;
case AF_INET6:
if (address.len < IPV6_LEN)
{
return NULL;
}
address.len = IPV... | false | false | false | false | false | 0 |
nvme_setup_prps(struct nvme_dev *dev, struct request *req,
int total_len)
{
struct nvme_iod *iod = blk_mq_rq_to_pdu(req);
struct dma_pool *pool;
int length = total_len;
struct scatterlist *sg = iod->sg;
int dma_len = sg_dma_len(sg);
u64 dma_addr = sg_dma_address(sg);
u32 page_size = dev->ctrl.page_size;
int o... | false | false | false | false | false | 0 |
b43_synth_pu_workaround(struct b43_wldev *dev, u8 channel)
{
struct b43_phy *phy = &dev->phy;
might_sleep();
if (phy->radio_ver != 0x2050 || phy->radio_rev >= 6) {
/* We do not need the workaround. */
return;
}
if (channel <= 10) {
b43_write16(dev, B43_MMIO_CHANNEL,
channel2freq_bg(channel + 4));
... | false | false | false | false | false | 0 |
hasKey(std::string const& key)
{
assertDictionary();
return dynamic_cast<QPDF_Dictionary*>(obj.getPointer())->hasKey(key);
} | false | false | false | false | false | 0 |
gst_a2dp_sink_init_fakesink(GstA2dpSink *self)
{
if (self->fakesink != NULL)
return TRUE;
g_mutex_lock(self->cb_mutex);
self->fakesink = gst_a2dp_sink_init_element(self, "fakesink",
"fakesink", self->capsfilter);
g_mutex_unlock(self->cb_mutex);
if (!self->fakesink)
return FALSE;
return TRUE;
} | false | false | false | false | false | 0 |
download()
{
float* pDst = mData;
// Download data
Image::Box box(0, 0, mBuffer->getWidth(), mBuffer->getHeight());
uint8* pSrc = static_cast<uint8*>(mBuffer->lock(box, HardwareBuffer::HBL_READ_ONLY).data);
pSrc += mChannelOffset;
size_t srcInc = PixelUtil::getNumElem... | false | false | false | false | false | 0 |
gst_mss_demux_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
GstMssDemux *mssdemux = GST_MSS_DEMUX (object);
switch (prop_id) {
case PROP_CONNECTION_SPEED:
GST_OBJECT_LOCK (mssdemux);
mssdemux->connection_speed = g_value_get_uint (value) * 1000;
... | false | false | false | false | false | 0 |
cgw_open_listening_socket(SMSCConn *conn, PrivData *privdata)
{
int s;
if ((s = make_server_socket(privdata->rport, (conn->our_host ? octstr_get_cstr(conn->our_host) : NULL))) == -1) {
error(0, "smsc_cgw: could not create listening socket in port %d", privdata->rport);
return -1;
}
if (... | 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.