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 |
|---|---|---|---|---|---|---|
boundary_chk(const char *p, size_t l, void *ptr)
{
static size_t i, j;
for (j=i=0; i<l; i++)
{
if (p[i] == '\n')
{
boundary_chk_add(p+j, i-j);
if (boundary_chk_buflen >= boundary_chk_val_len+2 &&
boundary_chk_buf[0] == '-' &&
boundary_chk_buf[1] == '-' &&
strncasecmp(boundary_chk_val,
bou... | false | false | false | false | false | 0 |
changeCoordinatesReference( const CPose3D &newReferenceBase )
{
MRPT_START
switch (m_typePDF)
{
case pdfMonteCarlo: m_locationMC.changeCoordinatesReference(newReferenceBase); break;
case pdfGauss: m_locationGauss.changeCoordinatesReference(newReferenceBase); break;
case pdfSOG: m_locationSOG.changeCoordinatesR... | false | false | false | false | false | 0 |
__ecereNameSpace__ecere__com___malloc(unsigned int size)
{
void * pointer;
__ecereMethod___ecereNameSpace__ecere__sys__Mutex_Wait(__ecereNameSpace__ecere__com__memMutex);
pointer = size ? __ecereNameSpace__ecere__com___mymalloc(size + 2 * 0) : (((void *)0));
__ecereMethod___ecereNameSpace__ecere__sys__Mutex_Release(__... | false | false | false | false | false | 0 |
scm_i_mask32 (scm_t_uint32 m)
{
return (m < 0x100
? scm_masktab[m]
: (m < 0x10000
? scm_masktab[m >> 8] << 8 | 0xff
: (m < 0x1000000
? scm_masktab[m >> 16] << 16 | 0xffff
: scm_masktab[m >> 24] << 24 | 0xffffff)));
} | false | false | false | false | false | 0 |
clutter_script_unmerge_objects (ClutterScript *script,
guint merge_id)
{
ClutterScriptPrivate *priv;
UnmergeData data;
GSList *l;
g_return_if_fail (CLUTTER_IS_SCRIPT (script));
g_return_if_fail (merge_id > 0);
priv = script->priv;
data.script = script;
data.me... | false | false | false | false | false | 0 |
efx_mcdi_get_phy_cfg(struct efx_nic *efx, struct efx_mcdi_phy_data *cfg)
{
MCDI_DECLARE_BUF(outbuf, MC_CMD_GET_PHY_CFG_OUT_LEN);
size_t outlen;
int rc;
BUILD_BUG_ON(MC_CMD_GET_PHY_CFG_IN_LEN != 0);
BUILD_BUG_ON(MC_CMD_GET_PHY_CFG_OUT_NAME_LEN != sizeof(cfg->name));
rc = efx_mcdi_rpc(efx, MC_CMD_GET_PHY_CFG, NUL... | false | false | false | false | false | 0 |
is_double_delim_escaped(const char* cur, const char* end)
{
return ((cur + 1) < end) && *(cur+1) == *cur;
} | false | false | false | false | false | 0 |
describe_origin(textblock *tb, const object_type *o_ptr)
{
char origin_text[80];
if (o_ptr->origin_depth)
strnfmt(origin_text, sizeof(origin_text), "%d feet (level %d)",
o_ptr->origin_depth * 50, o_ptr->origin_depth);
else
my_strcpy(origin_text, "town", sizeof(origin_text));
switch (o_ptr->origin)
... | true | true | false | false | false | 1 |
append_mapping(const char *name, const char *driver, const char *database, const char *table, int priority)
{
struct ast_config_map *map;
char *dst;
int length;
length = sizeof(*map);
length += strlen(name) + 1;
length += strlen(driver) + 1;
length += strlen(database) + 1;
if (table)
length += strlen(table) ... | false | false | false | false | false | 0 |
gearman_job_reducer_string(const gearman_job_st *job)
{
if (job)
{
if (job->assigned.command == GEARMAN_COMMAND_JOB_ASSIGN_ALL and job->assigned.arg_size[3] > 1)
{
gearman_string_t temp= { job->assigned.arg[3], job->assigned.arg_size[3] -1 };
return temp;
}
static gearman_string_t null_... | false | false | false | false | false | 0 |
i5000_process_fatal_error_info(struct mem_ctl_info *mci,
struct i5000_error_info *info,
int handle_errors)
{
char msg[EDAC_MC_LABEL_LEN + 1 + 160];
char *specific = NULL;
u32 allErrors;
int channel;
int bank;
int rank;
int rdwr;
int ras, cas;
/* mask off the Error bits that are possible */
allError... | false | false | false | false | false | 0 |
read_sor_desc(FILE *f)
#else
read_sor_desc(f)
FILE *f;
#endif
{
AST *root = NULL;
zzline = 1;
ANTLR(sordesc(&root), f);
if ( found_error ) return NULL;
if ( print_guts ) {
fprintf(stderr, "Internal Represenation of Tree Grammar:\n");
lisp(root, stderr);
fprintf(stderr, "\n");
}
last_va... | false | false | false | false | false | 0 |
resource_tree_create (MonoArray *win32_resources)
{
ResTreeNode *tree, *res_node, *type_node, *lang_node;
GSList *l;
int i;
tree = g_new0 (ResTreeNode, 1);
for (i = 0; i < mono_array_length (win32_resources); ++i) {
MonoReflectionWin32Resource *win32_res =
(MonoReflectionWin32Resource*)mono_array_addr (win... | false | false | false | false | false | 0 |
menu_init (win_struct *win)
{
menu = gtk_menu_new();
command_menu_struct command;
gint i;
GtkWidget *title = gtk_menu_item_new_with_label(" AllTray");
gtk_menu_shell_append(GTK_MENU_SHELL(menu), title);
gtk_widget_set_sensitive(title, FALSE);
GtkWidget *separator1 = gtk_menu_item_new();... | false | false | false | false | false | 0 |
fdisk_sun_set_xcyl(struct fdisk_context *cxt)
{
struct sun_disklabel *sunlabel = self_disklabel(cxt);
uintmax_t res;
int rc = fdisk_ask_number(cxt, 0, /* low */
be16_to_cpu(sunlabel->apc), /* default */
cxt->geom.sectors, /* high */
_("Extra sectors per cylinder"), /* query */
&res); /* result *... | false | false | false | false | false | 0 |
choiceType() const
{
FormWidgetChoice* fwc = static_cast<FormWidgetChoice*>(m_formData->fm);
if (fwc->isCombo())
return FormFieldChoice::ComboBox;
return FormFieldChoice::ListBox;
} | false | false | false | false | false | 0 |
vcc_NumVal(struct vcc *tl, double *d, int *frac)
{
double e = 0.1;
const char *p;
*frac = 0;
*d = 0.0;
Expect(tl, CNUM);
if (tl->err) {
*d = NAN;
return;
}
for (p = tl->t->b; p < tl->t->e; p++) {
*d *= 10;
*d += *p - '0';
}
vcc_NextToken(tl);
if (tl->t->tok != '.')
return;
*frac = 1;
vcc_NextTok... | false | false | false | false | false | 0 |
makeRandomFilename(const char* sourceName)
{
int sourceNameLen;
char* newName;
char randomStr[RANDOM_STR_NAME_LEN];
int numRandomCharsFilled;
if(strlen(sourceName) > MAX_RANDOM_BASE_NAME_LEN)
sourceNameLen = MAX_RANDOM_BASE_NAME_LEN;
else
sourceNameLen = strlen(sourceName);
... | false | false | false | false | false | 0 |
close_file(fdtype fd, const char* logkey)
{
int res = closefile(fd);
if (res) {
perror("close file");
ERR("%s: Errors on closing file, after write, could indicate write back cache problems, especially under NFS. Ignoring the error. euid=%d egid=%d", logkey, geteuid(), getegid());
}
return res;
} | false | false | false | false | false | 0 |
encodeUndefined()
{
// GNASH_REPORT_FUNCTION;
boost::shared_ptr<Buffer> buf(new Buffer(1));
*buf = Element::UNDEFINED_AMF0;
return buf;
} | false | false | false | false | false | 0 |
convert_double_u32_scaled (double min_val,
double max_val,
uint32_t min,
uint32_t max,
char *src,
char *dst,
int src_pitch,
... | false | false | false | false | false | 0 |
mb862xx_pci_remove(struct pci_dev *pdev)
{
struct fb_info *fbi = pci_get_drvdata(pdev);
struct mb862xxfb_par *par = fbi->par;
unsigned long reg;
dev_dbg(fbi->dev, "%s release\n", fbi->fix.id);
/* display off */
reg = inreg(disp, GC_DCM1);
reg &= ~(GC_DCM01_DEN | GC_DCM01_L0E);
outreg(disp, GC_DCM1, reg);
if... | false | false | false | false | false | 0 |
put_composewindow_into_module(Compose *compose)
{
PyObject *pycompose;
pycompose = clawsmail_compose_new(cm_module, compose);
PyObject_SetAttrString(cm_module, "compose_window", pycompose);
Py_DECREF(pycompose);
} | false | false | false | false | false | 0 |
my_wc_mb_utf8mb4(CHARSET_INFO *cs __attribute__((unused)),
my_wc_t wc, uchar *r, uchar *e)
{
int count;
if (r >= e)
return MY_CS_TOOSMALL;
if (wc < 0x80)
count= 1;
else if (wc < 0x800)
count= 2;
else if (wc < 0x10000)
count= 3;
else if (wc < 0x200000)
count= 4;
else ... | false | false | false | false | false | 0 |
internal_buildAuxPointsMap( const void *options ) const
{
if (!ptr_internal_build_points_map_from_scan2D)
throw std::runtime_error("[CSensoryFrame::buildAuxPointsMap] ERROR: This function needs linking against mrpt-maps.\n");
for (const_iterator it = begin();it!=end();++it)
if (IS_CLASS(*it,CObservation2DRangeSc... | false | false | false | false | false | 0 |
gtk_link_init (GtkLink *link)
{
GTK_WIDGET_SET_FLAGS(link, GTK_NO_WINDOW);
link->x1 = -1;
link->x2 = -1;
link->y1 = -1;
link->y2 = -1;
link->xos=0;
link->yos=0;
} | false | false | false | false | false | 0 |
mix3to1 (sample_t * samples, sample_t bias)
{
int i;
for (i = 0; i < 256; i++)
samples[i] += BIAS (samples[i + 256] + samples[i + 512]);
} | false | false | false | false | false | 0 |
OnViewMenuUpdateUI(wxUpdateUIEvent& event)
{
if (Manager::IsAppShuttingDown())
{
event.Skip();
return;
}
wxMenuBar* mbar = GetMenuBar();
cbEditor* ed = Manager::Get()->GetEditorManager() ? Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor() : nullptr;
bool ... | false | false | false | false | false | 0 |
acpi_add_pm_notifier(struct acpi_device *adev, struct device *dev,
void (*work_func)(struct work_struct *work))
{
acpi_status status = AE_ALREADY_EXISTS;
if (!dev && !work_func)
return AE_BAD_PARAMETER;
mutex_lock(&acpi_pm_notifier_lock);
if (adev->wakeup.flags.notifier_present)
goto out;
adev->wakeup... | false | false | false | false | false | 0 |
_elm_access_object_hilight(Evas_Object *obj)
{
Evas_Object *o;
Evas_Coord x, y, w, h;
o = evas_object_name_find(evas_object_evas_get(obj), "_elm_access_disp");
if (!o)
{
o = edje_object_add(evas_object_evas_get(obj));
evas_object_name_set(o, "_elm_access_disp");
evas_object_lay... | false | false | false | false | false | 0 |
filePrint()
{
QPrinter printer;
bool ok;
QPrintDialog *printDialog = KdePrint::createPrintDialog(&printer, this);
printDialog->setWindowTitle(i18n("Print %1", actionCollection()->action(playGround->currentGameboard())->iconText()));
ok = printDialog->exec();
delete printDialog;
if (!ok) return;
playGro... | false | false | false | false | false | 0 |
getString(unsigned int i) {
GLERC<GLEString> result;
GLEMemoryCell* cell = &m_Data[i];
if (cell->Type == GLE_MC_OBJECT && cell->Entry.ObjectVal->getType() == GLEObjectTypeString) {
result = static_cast<GLEString*>(cell->Entry.ObjectVal);
} else {
ostringstream out;
gle_memory_cell_print(cell, out);
result =... | false | false | false | false | false | 0 |
_isStyleInTOC(UT_UTF8String & sStyle, UT_UTF8String & sTOCStyle)
{
UT_UTF8String sTmpStyle = sStyle;
const char * sLStyle = sTOCStyle.utf8_str();
xxx_UT_DEBUGMSG(("Looking at TOC Style %s \n",sLStyle));
xxx_UT_DEBUGMSG(("Base input style is %s \n",sTmpStyle.utf8_str()));
if(g_ascii_strcasecmp(sLStyle,sTmpStyle.utf... | false | false | false | false | false | 0 |
ShowManhattanLine(Layer,X1,Y1,X2,Y2)
int Layer;
int X1,Y1,X2,Y2;
{
int X1P,Y1P,X2P,Y2P;
FBForeground(DISPLAY,Layer);
if (Parameters.kpRedisplayControl != FINEVIEWPORTONLY And
CurrentAOI.aInCoarse) {
CoarseLToP(X1,Y1,X1P,Y1P);
CoarseLToP(X2,Y2,X2P,Y2P);
if (X1P == X2P) {... | false | false | false | false | false | 0 |
i915_gem_object_set_cache_level(struct drm_i915_gem_object *obj,
enum i915_cache_level cache_level)
{
struct drm_device *dev = obj->base.dev;
struct i915_vma *vma, *next;
bool bound = false;
int ret = 0;
if (obj->cache_level == cache_level)
goto out;
/* Inspect the list of currently bound VMA and unbi... | false | false | false | false | false | 0 |
shutdown(){
if (started) {
mutex_data.lock();
flags|=FLAG_SHUTDOWN;
mutex_data.unlock();
wakeup();
join();
started=false;
}
/// Save Session
FXApp::instance()->reg().writeStringEntry("LastFM","session",session.text());
FXApp::instance()->reg().writeBoolEntry("LastFM","client-banned"... | false | false | false | false | false | 0 |
do_recursive_list(GConfEngine* conf, const gchar** args)
{
if (args == NULL)
{
g_printerr (_("Must specify one or more directories to recursively list.\n"));
return 1;
}
while (*args)
{
GSList* subdirs;
subdirs = gconf_engine_all_dirs(conf, *args, NULL);
list_pairs_in_di... | false | false | false | false | false | 0 |
cache_read_including_broken(httrackp * opt, cache_back * cache,
const char *adr, const char *fil) {
htsblk r = cache_read(opt, cache, adr, fil, NULL, NULL);
if (r.statuscode == -1) {
lien_back *itemback = NULL;
if (back_unserialize_ref(opt, adr, fil, &itemback) == 0) {
... | false | false | false | false | false | 0 |
SortIntArray ( int *array,
int *anz )
// -----------------------------------------------------------------------------
{
qsort(array,*anz,sizeof(int),int_compare);
int source;
int dest = 1;
int lastelem = array[0];
for (source = 1; source < *anz; source++) {
... | false | false | false | false | false | 0 |
amdgpu_uvd_resume(struct amdgpu_device *adev)
{
unsigned size;
void *ptr;
const struct common_firmware_header *hdr;
unsigned offset;
if (adev->uvd.vcpu_bo == NULL)
return -EINVAL;
hdr = (const struct common_firmware_header *)adev->uvd.fw->data;
offset = le32_to_cpu(hdr->ucode_array_offset_bytes);
memcpy(ade... | false | true | false | false | false | 1 |
isprimepower (Rep& q, const Rep& u) const
{
unsigned long int prime;
unsigned long int n, n2;
int i;
unsigned long int rem;
Integer t(u);
int exact;
int usize = int(u.size());
if (usize == 0)
return 1; /* consider 0 a perfect power */
n2 = (unsigned int)u;
if ( ( n2 & 3UL) == 2UL)
return ... | false | false | false | false | false | 0 |
set_local_array_for_static_assign(Module_table *mhead)
{
int level = 1;
if (cmp_static_slot_assign) {
set_sm_block_only_flg();
no_lm_flg = TRUE;
construct_IntSet(localized_func_set,
get_max_module_entry(MODULE_FUNC) + 1);
construct_IntSet(localized_sub_s... | false | false | false | false | false | 0 |
stsz_Size(GF_Box *s)
{
GF_Err e;
u32 i, fieldSize, size;
GF_SampleSizeBox *ptr = (GF_SampleSizeBox *)s;
e = gf_isom_full_box_get_size(s);
if (e) return e;
ptr->size += 8;
if (!ptr->sampleCount) return GF_OK;
//regular table
if (ptr->type == GF_ISOM_BOX_TYPE_STSZ) {
if (ptr->sampleSize) return GF_OK;
ptr-... | false | false | false | false | false | 0 |
FindWindowRecursively(const wxWindow* parent, const wxString& partialLabel)
// ----------------------------------------------------------------------------
{
if ( parent )
{
#if defined(LOGGING)
//LOGIT( _T("Parent[%p]Label[%s]Name[%s]"), parent, parent->GetLabel().c_str(), parent->GetName()... | false | false | false | false | false | 0 |
button1Release(const XEvent *event_)
{
if (isProtected()==MSFalse)
{
if (event_->xbutton.button==Button2) activateCallback("button2up");
else if (event_->xbutton.button==Button3) activateCallback("button3up");
}
} | false | false | false | false | false | 0 |
guilddb_txt_delete_sub(void *key, void *data, va_list ap)
{
struct guild *g = (struct guild *)data;
int guild_id = va_arg(ap, int);
int i;
for(i = 0; i < MAX_GUILDALLIANCE; i++) {
if(g->alliance[i].guild_id == guild_id)
{
g->alliance[i].guild_id = 0;
#ifdef TXT_JOURNAL
if( guild_journal_enable )
jour... | false | false | false | false | false | 0 |
ceph_zero_partial_page(
struct inode *inode, loff_t offset, unsigned size)
{
struct page *page;
pgoff_t index = offset >> PAGE_CACHE_SHIFT;
page = find_lock_page(inode->i_mapping, index);
if (page) {
wait_on_page_writeback(page);
zero_user(page, offset & (PAGE_CACHE_SIZE - 1), size);
unlock_page(page);
pa... | false | false | false | false | false | 0 |
lib3ds_light_new(const char *name)
{
Lib3dsLight *light;
ASSERT(name);
ASSERT(strlen(name)<64);
light=(Lib3dsLight*)calloc(sizeof(Lib3dsLight), 1);
if (!light) {
return(0);
}
strcpy(light->name, name);
return(light);
} | false | false | false | false | false | 0 |
exynos4_jpeg_parse_decode_h_tbl(struct s5p_jpeg_ctx *ctx)
{
struct s5p_jpeg *jpeg = ctx->jpeg;
struct vb2_buffer *vb = v4l2_m2m_next_src_buf(ctx->fh.m2m_ctx);
struct s5p_jpeg_buffer jpeg_buffer;
unsigned int word;
int c, x, components;
jpeg_buffer.size = 2; /* Ls */
jpeg_buffer.data =
(unsigned long)vb2_plane... | false | false | false | false | false | 0 |
top10_write_stats (gboolean locally, gint lang)
{
gint i;
gchar *filename;
gchar *lsfile;
FILE *fh;
Statistics *top10;
top10 = locally ? top10_local : top10_global;
if (!g_file_test (main_path_score (), G_FILE_TEST_IS_DIR))
g_mkdir_with_parents (main_path_score (), DIR_PERM);
filename = top10_get_score_fil... | false | false | false | false | false | 0 |
MutableMessage(int number, FieldType type,
const MessageLite& prototype) {
Extension* extension;
if (MaybeNewExtension(number, &extension)) {
extension->type = type;
GOOGLE_DCHECK_EQ(cpp_type(extension->type), WireFormatLite::CPPTYPE_MESSAGE);
extension->is_repe... | false | false | false | false | false | 0 |
resolve_addr4(const char *name, struct in_addr *inp)
{
if (inp->s_addr == INADDR_ANY)
{
puts("any");
return;
}
if (inp->s_addr == INADDR_LOOPBACK)
{
puts("loopback");
return;
}
if (inp->s_addr == INADDR_BROADCAST)
{
puts("broadcast");
return;
}
print_hostbyaddr(name, (const char *) inp, sizeof(... | false | false | false | false | false | 0 |
is_dhcp_discover(void *wh, int len)
{
if( (memcmp(wh+4, BROADCAST, 6) == 0 || memcmp(wh+16, BROADCAST, 6) == 0) && (len >= 360 - 24 - 4 - 4 && len <= 380 - 24 - 4 - 4 ) )
return 1;
return 0;
} | false | false | false | false | false | 0 |
MakeUidList(char *uidnames)
{ struct UidList *uidlist;
struct Item *ip, *tmplist;
char uidbuff[CF_BUFSIZE];
char *sp;
int offset;
struct passwd *pw;
char *machine, *user, *domain, buffer[CF_EXPANDSIZE], *usercopy=NULL;
int uid;
int tmp = -1;
uidlist = NULL;
buffer[0] = '\0';
ExpandVarstring(uidnames,... | false | false | false | false | false | 0 |
run_selfcheck(struct cli_all_bc *bcs)
{
struct cli_bc_ctx *ctx;
struct cli_bc *bc = &bcs->all_bcs[bcs->count-1];
int rc;
if (bc->state != bc_jit && bc->state != bc_interp) {
cli_errmsg("Failed to prepare selfcheck bytecode\n");
return CL_EBYTECODE;
}
ctx = cli_bytecode_context_alloc();
if ... | false | false | false | false | false | 0 |
pixWriteMixedToPS(PIX *pixb,
PIX *pixc,
l_float32 scale,
l_int32 pageno,
const char *fileout)
{
char *tnameb, *tnamec;
const char *op;
l_int32 resb, resc, endpage, maskop, ret;
PROCNAME("pixWriteMixedToPS"... | false | false | false | false | false | 0 |
registerTimer(YTimer *t) {
t->fPrev = 0;
t->fNext = fFirstTimer;
if (fFirstTimer)
fFirstTimer->fPrev = t;
else
fLastTimer = t;
fFirstTimer = t;
} | false | false | false | false | false | 0 |
initialiseParams(std::string const & data)
{
InsetCommandParams p(insetCode());
if (!InsetCommand::string2params(data, p))
return false;
keywordED->setText(toqstr(p["name"]));
return true;
} | false | false | false | false | false | 0 |
prof_handler(int sig, siginfo_t*, void* signal_ucontext,
void* cpu_profiler) {
CpuProfiler* instance = static_cast<CpuProfiler*>(cpu_profiler);
if (instance->filter_ == NULL ||
(*instance->filter_)(instance->filter_arg_)) {
void* stack[ProfileData::kMaxStackDepth];
// ... | false | false | false | false | false | 0 |
Pop(vtkIdType location, double &priority)
{
vtkIdType id, i, j, idx;
vtkPriorityQueue::Item temp;
if ( this->MaxId < 0 )
{
return -1;
}
id = this->Array[location].id;
priority = this->Array[location].priority;
// move the last item to the location specified and push into the tree
this->Arr... | false | false | false | false | false | 0 |
check_capacity(gpointer key, gpointer value, gpointer user_data)
{
int required = 0;
int remaining = 0;
struct capacity_data *data = user_data;
required = crm_parse_int(value, "0");
remaining = crm_parse_int(g_hash_table_lookup(data->node->details->utilization, key), "0");
if (required > remai... | false | false | false | false | false | 0 |
usb_unanchor_urb(struct urb *urb)
{
unsigned long flags;
struct usb_anchor *anchor;
if (!urb)
return;
anchor = urb->anchor;
if (!anchor)
return;
spin_lock_irqsave(&anchor->lock, flags);
/*
* At this point, we could be competing with another thread which
* has the same intention. To protect the urb fro... | false | false | false | false | false | 0 |
dc_hurt(int script, int* yield, int* preturnint,
int sprite, int damage)
{
STOP_IF_BAD_SPRITE(sprite);
if (dversion >= 108)
{
// With v1.07 hurt(&sthing, -1) would run hit(), with v1.08 it
// doesn't (after redink1 tried to fix a game freeze bug that I
// can't reproduce)
if (dama... | false | false | false | false | false | 0 |
cocktail_sort_debug(data array[], int len, STAT *stat) {
int begin = 0; // array is to be sorted from position begin to end+1
int end = len-1;
int i; // currently scanning position: comparing array[i] and array[i+1]
int new_end = begin;
int new_begin = end;
data tmp; // temporary variable used to swap elements
s... | false | false | false | false | false | 0 |
operator<< (ostream &o, const map <string, string> &m)
{
for (map <string, string>::const_iterator i = m.begin(); i != m.end(); i ++)
o << (*i).first << " -> " << (*i).second << "\n";
return o;
} | false | false | false | false | false | 0 |
GetOperatorType (const int ch1, const int ch2)
{
int OpType = NO_OPERATOR;
if ((ch1 == '+') || (ch1 == '-') || (ch1 == '*') || (ch1 == '/') || (ch1 == '#') ||
(ch1 == '(') || (ch1 == ')') || (ch1 == '~') || (ch1 == '&') || (ch1 == '|') || (ch1 == ','))
OpType = OPERATOR_1CHAR;
else if ((ch... | false | false | false | false | false | 0 |
width(bool constrained)
{
unsigned int sz = 0;
if (constrained) {
if (d_array_var->send_p())
sz = d_array_var->width(constrained);
}
else {
sz = d_array_var->width(constrained);
}
for (Map_iter i = d_map_vars.begin(); i != d_map_vars.end(); i++) {
if (constrained) {
... | false | false | false | false | false | 0 |
AnalyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB,
MachineBasicBlock *&FBB,
SmallVectorImpl<MachineOperand> &Cond,
bool AllowModify) const {
// If the block has no terminators, it just falls into the block after it.
... | false | false | false | true | false | 1 |
rsi_sdio_device_init(struct rsi_common *common)
{
if (rsi_load_ta_instructions(common))
return -1;
if (rsi_sdio_master_access_msword(common->priv, MISC_CFG_BASE_ADDR)) {
rsi_dbg(ERR_ZONE, "%s: Unable to set ms word reg\n",
__func__);
return -1;
}
rsi_dbg(INIT_ZONE,
"%s: Setting ms word to 0x41050000\n",... | false | false | false | false | false | 0 |
kone_sysfs_show_weight(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct kone_device *kone;
struct usb_device *usb_dev;
int weight = 0;
int retval;
dev = dev->parent->parent;
kone = hid_get_drvdata(dev_get_drvdata(dev));
usb_dev = interface_to_usbdev(to_usb_interface(dev));
mutex_lock(&... | false | false | false | false | false | 0 |
media_from_uri_cb (GrlSource *source,
guint operation_id,
GrlMedia *media,
gpointer user_data,
const GError *error)
{
struct MediaFromUriCallbackData *mfucd =
(struct MediaFromUriCallbackData *) user_data;
if (error) {
mfucd->user_callback (NULL, 0, NULL, mfucd->user... | false | false | false | false | false | 0 |
r6_surface_init_linear(struct radeon_surface_manager *surf_man,
struct radeon_surface *surf,
uint64_t offset, unsigned start_level)
{
uint32_t xalign, yalign, zalign;
unsigned i;
/* compute alignment */
if (!start_level) {
surf... | false | false | false | false | false | 0 |
attachment_dialog_dispose (GObject *object)
{
EAttachmentDialogPrivate *priv;
priv = E_ATTACHMENT_DIALOG_GET_PRIVATE (object);
if (priv->attachment != NULL) {
g_object_unref (priv->attachment);
priv->attachment = NULL;
}
if (priv->display_name_entry != NULL) {
g_object_unref (priv->display_name_entry);
... | false | false | false | false | false | 0 |
MG_s_free_mem(MG_S_INFO *mg_s_info)
{
FUNCNAME("MG_s_free_mem");
MULTI_GRID_INFO *mg_info = NULL;
int levels, i, *dofs_per_level;
TEST_EXIT(mg_s_info && (mg_info = mg_s_info->mg_info),
"no mg_s_info or mg_info\n");
TEST_EXIT(dofs_per_level = mg_s_info->dofs_per_level,
"no dofs_per_level\n");
level... | false | false | false | true | false | 1 |
ocfs2_create_reflink_node(struct inode *s_inode,
struct buffer_head *s_bh,
struct inode *t_inode,
struct buffer_head *t_bh,
bool preserve)
{
int ret;
struct buffer_head *ref_root_bh = NULL;
struct ocfs2_cached_dealloc_ctxt dealloc;
struct ocfs2_super *osb = OCFS2_SB(s_inode->i_sb... | false | false | false | false | false | 0 |
dump_cursor_direction(PLpgSQL_stmt_fetch *stmt)
{
dump_indent += 2;
dump_ind();
switch (stmt->direction)
{
case FETCH_FORWARD:
printf(" FORWARD ");
break;
case FETCH_BACKWARD:
printf(" BACKWARD ");
break;
case FETCH_ABSOLUTE:
printf(" ABSOLUTE ");
break;
case FETCH_RELATIVE:
pr... | false | false | false | false | false | 0 |
BackRefMatchesNoCase(int from,
int current,
int len,
Vector<const uc16> subject) {
for (int i = 0; i < len; i++) {
unibrow::uchar old_char = subject[from++];
unibrow::uchar new_char = subject[current++];
if ... | false | false | false | false | false | 0 |
hat_event (GooCanvasItem *item,
GooCanvasItem *target,
GdkEventButton *event,
gpointer data)
{
if (board_paused)
return FALSE;
if ((event->type == GDK_BUTTON_PRESS) && (event->button == 1))
{
// disconnect hat and hat_event, so that hat can not be clicked any more
g_signal_h... | false | false | false | false | false | 0 |
DoPlanarConfiguration(std::istream &is, std::ostream &os)
{
// FIXME: Do some stupid work:
std::streampos start = is.tellg();
assert( 0 - start == 0 );
is.seekg( 0, std::ios::end);
size_t buf_size = (size_t)is.tellg();
//assert(buf_size < INT_MAX);
char *dummy_buffer = new char[(unsigned int)buf_size];
... | false | false | false | false | false | 0 |
on_treeselection_changed(void)
{
const int rows = gtk_tree_selection_count_selected_rows(gui.treeselection);
gtk_widget_set_sensitive(GTK_WIDGET(gui.toolbutton_remove), (rows > 0));
gtk_widget_set_sensitive(GTK_WIDGET(gui.menuitem_treeview_remove),
(rows > 0));
gtk_widget_set_sensitive(GTK_WIDGET(gui.menuitem_t... | false | false | false | false | false | 0 |
est_border_str(void){
static int first = TRUE;
static char border[ESTPATHBUFSIZ];
int t, p;
if(first){
t = (int)(time(NULL) + est_random() * INT_MAX);
p = (int)(getpid() + est_random() * INT_MAX);
sprintf(border, "--------[%08X%08X]--------",
dpouterhash((char *)&t, sizeof(int)), dpouter... | false | false | false | false | false | 0 |
MakeUnixPath(string& path)
{
if (path.empty())
return;
for (string::iterator c = path.begin(); c != path.end(); c++)
{
if (*c == '\\')
*c = '/';
}
} | false | false | false | false | false | 0 |
uv__platform_loop_init(uv_loop_t* loop, int default_loop) {
int fd;
fd = uv__epoll_create1(UV__EPOLL_CLOEXEC);
/* epoll_create1() can fail either because it's not implemented (old kernel)
* or because it doesn't understand the EPOLL_CLOEXEC flag.
*/
if (fd == -1 && (errno == ENOSYS || errno == EINVAL)) ... | false | false | false | false | false | 0 |
LoadImage(int i) {
Array3Df *image = new Array3Df;
if (!ReadImage(filenames_[i].c_str(), image)) {
delete image;
// TODO(keir): Better error reporting?
fprintf(stderr, "Failed loading image %d: %s\n",
i, filenames_[i].c_str());
return 0;
}
return new Image(image);
... | false | false | false | false | false | 0 |
setup_header(hhdr, sz, kind, flags)
register hdr * hhdr;
word sz; /* object size in words */
int kind;
unsigned char flags;
{
register word descr;
/* Add description of valid object pointers */
if (!GC_add_map_entry(sz)) return(FALSE);
hhdr -> hb_map = GC_obj_map[sz > MAXOBJSZ? 0 : sz];
... | false | false | false | false | false | 0 |
gss_decapsulate_token (gss_const_buffer_t input_token,
gss_const_OID token_oid,
gss_buffer_t output_token)
{
gss_OID_desc tmpoid;
char *oid = NULL, *out = NULL;
size_t oidlen = 0, outlen = 0;
if (!input_token)
return GSS_S_CALL_INACCESSIBLE_READ;
if (!token_oid)
return GSS_S_CALL_IN... | false | false | false | false | true | 1 |
_e2_pane_current_focus_top (gpointer from, E2_ActionRuntime *art)
{
if (gtk_tree_model_iter_n_children (curr_view->model, NULL) > 0)
{
e2_fileview_focus_row (curr_view, 0, TRUE, TRUE, FALSE, TRUE);
return TRUE;
}
return FALSE;
} | false | false | false | false | false | 0 |
repo_init_structure(const char *git_dir, int is_bare)
{
const int mode = 0755; /* or 0777 ? */
int error;
char temp_path[GIT_PATH_MAX];
if (git_futils_mkdir_r(git_dir, mode))
return git__throw(GIT_ERROR, "Failed to initialize repository structure. Could not mkdir");
/* Hides the ".git" directory */
if (!is_b... | false | false | false | false | false | 0 |
gt_bittab_show(const GtBittab *b, FILE *outfp)
{
unsigned long i;
gt_assert(b && outfp);
/* header line */
for (i = 0; i < b->num_of_bits; i++)
fprintf(outfp, "%lu", i % 10);
gt_xfputc('\n', outfp);
/* actual bits */
for (i = 0; i < b->num_of_bits; i++) {
if (gt_bittab_bit_is_set(b, i))
gt_x... | false | false | false | false | false | 0 |
file_list_status_changed (GiggleFileList *list)
{
GiggleFileListPriv *priv;
GtkTreePath *path;
if (gtk_tree_view_get_model (GTK_TREE_VIEW (list))) {
return;
}
priv = GET_PRIV (list);
gtk_tree_view_set_model (GTK_TREE_VIEW (list), priv->filter_model);
/* expand the project folder */
path = gtk_tree_p... | false | false | false | false | false | 0 |
isTagInDictionary(const DcmTagKey &search_key)
{
const DcmDataDictionary& globalDataDict = dcmDataDict.rdlock();
const DcmDictEntry *dicent = globalDataDict.findEntry(search_key,NULL);
// successfull lookup in dictionary -> translate to tag and return
dcmDataDict.unlock();
if (dicent)
return... | false | false | false | false | false | 0 |
orthogonalize (unsigned index, unsigned n, unsigned level, real_t min_norm,
const word_t *domain_blocks, const coding_t *c)
/*
* Step 'n' of the Gram-Schmidt orthogonalization procedure:
* vector 'index' is orthogonalized with respect to the set
* {u_[0], ... , u_['n' - 1]}. The size of the image blocks i... | false | false | false | false | false | 0 |
UpScope(void)
{
cur_scope++;
#if DEBUG
printf("#Var.c# Scope ++ (%2d)\n",cur_scope);
#endif
if(cur_scope>=max_scope)
{
if(max_scope==0)
variable=Malloc(16*sizeof(StringList2));
else
variable=Realloc(variable,(max_scope+16)*sizeof(StringList2));
max_scope+=16;
}
variable[cur_scope]... | false | false | false | false | false | 0 |
next_packet_frame_wrapped(bgav_demuxer_context_t * ctx, bgav_stream_t * dummy)
{
if(ctx->next_packet_pos)
{
int ret = 0;
while(1)
{
if(!process_packet_frame_wrapped(ctx))
return ret;
else
ret = 1;
if(ctx->input->position >= ctx->next_packet_pos)
return ret... | false | false | false | false | false | 0 |
isUpper(const std::string &str)
{
for (unsigned int i = 0; i < str.length(); ++i)
{
if (str[i] >= 'a' && str[i] <= 'z')
return false;
}
return true;
} | false | false | false | false | false | 0 |
GetKeyShuffleData(int)
{
QByteArray msg;
QDataStream stream(&msg, QIODevice::WriteOnly);
QSharedPointer<AsymmetricKey> pub_key(_anon_signing_key->GetPublicKey());
stream << pub_key;
_key_shuffle_data = msg;
return QPair<QByteArray, bool>(msg, false);
} | false | false | false | false | false | 0 |
sort_threads_and_collapse(THREADNODE *tree)
{
THREADNODE *newtree = NULL, *newbranchtree = NULL, *newtreefree = NULL;
if(tree){
newtree = mail_newthreadnode(NULL);
newtree->num = tree->num;
/*
* Only sort at the top level. Individual threads can
* rely on collapse_threadnode_tree
*/
if(tree->nex... | false | false | false | false | false | 0 |
glmWeld(GLMmodel* model, float epsilon)
{
float* vectors;
float* copies;
unsigned int numvectors;
unsigned int i, welded;
/* vertices */
numvectors = model->numvertices;
vectors = model->vertices;
copies = glmWeldVectors(vectors, &numvectors, epsilon);
welded = model->numvertices - numvectors ... | false | true | false | false | false | 1 |
Initialize()
{
SizeValueType i, low, high;
// build table
// when using valley-func then the table values run from
// lowest_my - 10 * sigma to highest_my + 10 * sigma
low = 0; high = 0;
SizeValueType noOfClasses = static_cast< SizeValueType >( m_Targets.size() );
for ( i = 0; i < noOfClasses; i++ )
... | false | false | false | false | false | 0 |
ipa_tm_propagate_irr (basic_block entry_block, bitmap new_irr,
bitmap old_irr, bitmap exit_blocks)
{
VEC (basic_block, heap) *bbs;
bitmap all_region_blocks;
/* If this block is in the old set, no need to rescan. */
if (old_irr && bitmap_bit_p (old_irr, entry_block->index))
return;
all_region_bl... | 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.