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 |
|---|---|---|---|---|---|---|
fileListRecurs(const AjPStr srcfile, AjPList list, ajint *recurs)
{
char c;
AjPStr ptr = NULL;
AjPStr dir = NULL;
char *p;
AjPList dlist;
AjPFile inf;
AjPStr line = NULL;
AjPStr file = NULL;
++(*recurs);
if(*recurs > FILERECURSLV)
ajFatal("Filelist maximum recursion... | false | false | false | false | false | 0 |
thumb_loader_ready_cb (GObject *source_object,
GAsyncResult *result,
gpointer user_data)
{
GtkBuilder *builder = user_data;
GdkPixbuf *pixbuf;
if (! gth_thumb_loader_load_finish (GTH_THUMB_LOADER (source_object),
result,
&pixbuf,
NULL))
{
return... | false | false | false | false | false | 0 |
get_executable_path(const char *argv0)
{
char buff[PATH_MAX];
#if __APPLE__
{
/* Returns 0 on success, -1 if the buffer is too small */
uint32_t buffSize = sizeof buff;
if (0 == _NSGetExecutablePath(buff, &buffSize))
return std::string(buff);
/* Loop until we're big ... | false | false | false | false | false | 0 |
notreg_cost (rtx x, enum rtx_code outer)
{
return ((GET_CODE (x) == SUBREG
&& GET_CODE (SUBREG_REG (x)) == REG
&& GET_MODE_CLASS (GET_MODE (x)) == MODE_INT
&& GET_MODE_CLASS (GET_MODE (SUBREG_REG (x))) == MODE_INT
&& (GET_MODE_SIZE (GET_MODE (x))
< GET_MODE_SIZE (GET_MODE (SUBREG_REG (x))))
... | false | false | false | false | false | 0 |
size_row(png_byte buffer[SIZE_ROWMAX], png_uint_32 bit_width, png_uint_32 y)
{
/* height is in the range 1 to 16, so: */
y = ((y & 1) << 7) + ((y & 2) << 6) + ((y & 4) << 5) + ((y & 8) << 4);
/* the following ensures bits are set in small images: */
y ^= 0xA5;
while (bit_width >= 8)
*buffer++ = (p... | false | false | false | false | false | 0 |
ksAppend(KeySet *ks, const KeySet *toAppend)
{
size_t oldSize = 0;
int i = 0;
int toAlloc = 0;
if (!ks) return -1;
if (!toAppend) return -1;
oldSize = ks->size;
toAlloc = ks->alloc;
if (toAppend->size <= 0) return ks->size;
ks->flags |= KS_FLAG_DIRTY;
ks->size += toAppend->size;
ks->rsize += toAppend->rsi... | false | false | false | false | false | 0 |
free_lump(struct lump* lmp)
{
if (lmp && (lmp->op==LUMP_ADD)){
if (lmp->u.value){
if (lmp->flags &(LUMPFLAG_DUPED|LUMPFLAG_SHMEM)){
LM_CRIT("called on a not free-able lump:"
"%p flags=%x\n", lmp, lmp->flags);
abort();
}else{
pkg_free(lmp->u.value);
lmp->u.value=0;
lmp->len=0;
}
}
... | false | false | false | false | false | 0 |
uprobe_buffer_init(void)
{
int cpu, err_cpu;
uprobe_cpu_buffer = alloc_percpu(struct uprobe_cpu_buffer);
if (uprobe_cpu_buffer == NULL)
return -ENOMEM;
for_each_possible_cpu(cpu) {
struct page *p = alloc_pages_node(cpu_to_node(cpu),
GFP_KERNEL, 0);
if (p == NULL) {
err_cpu = cpu;
goto err;
}... | false | false | false | false | false | 0 |
int_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
PyObject *tmp, *newobj;
long ival;
assert(PyType_IsSubtype(type, &PyInt_Type));
tmp = int_new(&PyInt_Type, args, kwds);
if (tmp == NULL)
return NULL;
if (!PyInt_Check(tmp)) {
ival = PyLong_AsLong(tmp);
... | false | false | false | false | false | 0 |
RegisterSizeClass(Span* span, size_t sc) {
// Associate span object with all interior pages as well
ASSERT(span->location == Span::IN_USE);
ASSERT(GetDescriptor(span->start) == span);
ASSERT(GetDescriptor(span->start+span->length-1) == span);
Event(span, 'C', sc);
span->sizeclass = sc;
for (Length i = 1; ... | false | false | false | false | false | 0 |
usm_set_aes_iv(u_char * iv,
size_t * iv_length,
u_int net_boots,
u_int net_time,
u_char * salt)
{
/*
* net_* should be encoded in network byte order.
*/
int net_salt_int1, net_salt_int2;
#define PROPER_AES_IV_SIZE 64
/*
... | false | false | false | false | false | 0 |
visu_ui_value_io_setSensitiveSave(VisuUiValueIo *valueio, gboolean status)
{
gchar *filename;
g_return_if_fail(VISU_UI_IS_VALUE_IO(valueio));
#if GTK_MAJOR_VERSION > 2 || GTK_MINOR_VERSION > 5
filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(valueio->btExportOpen));
gtk_widget_set_sensitive(valueio->... | false | false | false | false | false | 0 |
encrypt3(char *key, char *tablefile, FILE *fp){
if(strlen(key) != 48){
fprintf(stderr, "Invalid length of key\n") ;
exit(0) ;
}
char key1[16], key2[16], key3[16] ;
for(int i = 0 ; i < 16 ; ++i){
key1[i] = key[i] ;
key2[i] = key[i+16] ;
key3[i] = key[i+32] ;
}
keySchedule(key1, SKey, SKeyDec) ;
keySch... | false | false | false | false | false | 0 |
setup_context_menu()
{
m_context_menu_action_group = Gtk::ActionGroup::create();
m_context_menu_action_group->add(Gtk::Action::create("ContextMenu", "Context Menu") );
/*
Glib::RefPtr<Gtk::Action> action = Gtk::Action::create("ContextInsertField", _("Field"));
m_context_menu_action_group->add(action,
sig... | false | false | false | false | false | 0 |
make_uniform (double range[], size_t n, double xmin, double xmax)
{
size_t i;
for (i = 0; i <= n; i++)
{
double f1 = ((double) (n-i) / (double) n);
double f2 = ((double) i / (double) n);
range[i] = f1 * xmin + f2 * xmax;
}
} | false | false | false | false | false | 0 |
configure(Vector<String> &conf, ErrorHandler *errh)
{
CpVaParseCmd parsecmd = cpUnsignedShort;
if (conf.size() && conf[0].upper() == "TCP")
parsecmd = cpTCPPort;
else if (conf.size() && conf[0].upper() == "UDP")
parsecmd = cpUDPPort;
String socktype;
if (cp_va_kparse(conf, this, errh,
"TYPE", ... | false | false | false | false | false | 0 |
hotkey_filter (char * keystring, gpointer data)
{
g_return_if_fail(GTK_IS_MENU_SHELL(data));
g_debug ("Hotkey: %s", keystring);
/* Oh, wow, it's us! */
GList * children = gtk_container_get_children(GTK_CONTAINER(data));
if (children == NULL) {
g_debug("Menubar has no children");
return;
}
gtk_m... | false | false | false | false | false | 0 |
DISK_reset (void)
{
int i;
if (savestate_state)
return;
//floppy[0].catweasel = &cwc.drives[0];
disk_hpos = 0;
dskdmaen = 0;
disabled = 0;
for (i = 0; i < MAX_FLOPPY_DRIVES; i++)
reset_drive (i);
setamax ();
} | false | false | false | false | false | 0 |
attach_model_params_from_xml (xmlNodePtr node, xmlDocPtr doc,
MODEL *pmod)
{
char **S;
int slop = (pmod->ci == GARCH);
int np = 0;
int err = 0;
S = gretl_xml_get_strings_array(node, doc, &np, slop, &err);
if (!err) {
pmod->params = S;
pmod->nparams = np;
}
return err;
} | false | false | false | false | false | 0 |
round_robin_cpu(unsigned int tsk_index)
{
struct cpumask *pad_busy_cpus = to_cpumask(pad_busy_cpus_bits);
cpumask_var_t tmp;
int cpu;
unsigned long min_weight = -1;
unsigned long uninitialized_var(preferred_cpu);
if (!alloc_cpumask_var(&tmp, GFP_KERNEL))
return;
mutex_lock(&round_robin_lock);
cpumask_clear(... | false | false | false | false | false | 0 |
de_cauchy_stress( FMField *out, FMField *strain,
FMField *mtxD, VolumeGeometry *vg,
int32 *elList, int32 elList_nRow )
{
int32 ii, iel, dim, sym, nQP, ret = RET_OK;
FMField *stress = 0;
nQP = vg->bfGM->nLev;
dim = vg->bfGM->nRow;
sym = (dim + 1) * dim / 2;
fmf_createAlloc( &stress, 1, nQP, sym, 1 )... | false | false | false | false | false | 0 |
Perl_do_ipcget(pTHX_ I32 optype, SV **mark, SV **sp)
{
dVAR;
const key_t key = (key_t)SvNVx(*++mark);
SV *nsv = optype == OP_MSGGET ? NULL : *++mark;
const I32 flags = SvIVx(*++mark);
PERL_ARGS_ASSERT_DO_IPCGET;
PERL_UNUSED_ARG(sp);
SETERRNO(0,0);
switch (optype)
{
#ifdef HAS_MSG
... | false | false | false | false | false | 0 |
drop_node_buffer(struct backref_node *node)
{
if (node->eb) {
unlock_node_buffer(node);
free_extent_buffer(node->eb);
node->eb = NULL;
}
} | false | false | false | false | false | 0 |
cut()
{
if (m_CurrentEditor) {
m_CurrentEditor->textEdit()->cut();
m_CurrentEditor->textEdit()->setFocus();
}
} | false | false | false | false | false | 0 |
checkDoStm(
Absyn *node,
Table **fileTable,
Table *localTable,
Class *actClass,
Table *classTable,
Table *globalTable,
boolean breakAllowed,
Type *returnType,
int pass) {
Absyn *test = node->u.doStm.test;
Absyn *body = node->u.doStm.body;
... | false | false | false | false | false | 0 |
DrawMatches(ByteImage &imageArrayBytes,
const Matches::ImageID id_image,
tracker::FeaturesGraph all_features_graph) {
Matches::Features<KeypointFeature> features =
all_features_graph.matches_.InImage<KeypointFeature>(id_image);
Byte color = 255;
size_t NumImages = all_features... | false | false | false | false | false | 0 |
iterate()
{
#if !defined(DOS)
/* Shriram: begin */
int ckptFunCallPath = ckptTuple . ckptAttribute ;
if ( normalRun == checkpointStatus )
funCallPath = fCP_gem_iter_ ;
/* Shriram: end */
#endif
while (continue_ == go) {
active = false;
#if !defined(DOS)
/* Shriram: begin */
if ( checkpointed... | false | false | false | false | false | 0 |
readMultiplexerList(int * count) {
size_t buffer_size = 8;
char * token;
Multiplexer ** multis = (Multiplexer **) calloc(buffer_size, sizeof(Multiplexer*));
*count = 0;
for (token = nextToken(0,0); token != NULL && strcmp(token, ":"); token = nextToken(0,0)) {
if (*count == buffer_size) {
buffer_size *= 2;
... | false | false | false | false | false | 0 |
bothUsedInPHI(const MachineBasicBlock &A,
SmallPtrSet<MachineBasicBlock*, 8> SuccsB) {
for (MachineBasicBlock *BB : A.successors())
if (SuccsB.count(BB) && !BB->empty() && BB->begin()->isPHI())
return true;
return false;
} | false | false | false | false | false | 0 |
read_restart(FILE *fp)
{
int me = comm->me;
if (me == 0) fread(&nstyles,sizeof(int),1,fp);
MPI_Bcast(&nstyles,1,MPI_INT,0,world);
styles = new Angle*[nstyles];
keywords = new char*[nstyles];
allocate();
int n,dummy;
for (int m = 0; m < nstyles; m++) {
if (me == 0) fread(&n,sizeof(int),1,fp);
M... | false | false | false | false | false | 0 |
TranslateCIDToName(GenericColumnEnum cid)
{
wxString name;
switch (cid) {
case ColumnUserName:
name = wxT("N");
break;
case ColumnUserDownloaded:
name = wxT("D");
break;
case ColumnUserUploaded:
name = wxT("U");
break;
case ColumnUserSpeedDown:
name = wxT("S");
break;
case ColumnUse... | false | false | false | false | false | 0 |
_cl5CheckMissingCSN (const CSN *csn, const RUV *supplierRuv, CL5DBFile *file)
{
ReplicaId rid;
CSN *supplierCsn = NULL;
CSN *purgeCsn = NULL;
int rc = CL5_SUCCESS;
char csnStr [CSN_STRSIZE];
PR_ASSERT (csn && supplierRuv && file);
rid = csn_get_replicaid (csn);
ruv_get_largest_csn_for_... | true | true | false | false | false | 1 |
_hash_with_username (NMConnection *connection, const char *username)
{
NMConnection *dup;
NMSettingVPN *s_vpn;
GHashTable *hash;
const char *existing;
/* Shortcut if we weren't given a username or if there already was one in
* the VPN setting; don't bother duplicating the connection and everything.
*/
s_vpn ... | false | false | false | false | false | 0 |
ecore_imf_context_client_window_set(Ecore_IMF_Context *ctx, void *window)
{
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
"ecore_imf_context_client_window_set");
return;
}
if (ctx->klass->client_window_set) ctx->kl... | false | false | false | false | false | 0 |
dag_to_file_exports(const struct dag *d, FILE * dag_stream)
{
char *var;
struct list *vars = d->export_list;
list_first_item(vars);
for(var = list_next_item(vars); var; var = list_next_item(vars))
fprintf(dag_stream, "export %s\n", var);
return 0;
} | false | false | false | false | false | 0 |
sis_scr_cfg_read(struct ata_link *link,
unsigned int sc_reg, u32 *val)
{
struct pci_dev *pdev = to_pci_dev(link->ap->host->dev);
unsigned int cfg_addr = get_scr_cfg_addr(link, sc_reg);
if (sc_reg == SCR_ERROR) /* doesn't exist in PCI cfg space */
return -EINVAL;
pci_read_config_dword(pdev, cfg_addr, val)... | false | false | false | false | false | 0 |
dump_pref_file(void (*dump)(ang_file *), const char *title, int row)
{
char ftmp[80];
char buf[1024];
screen_save();
/* Prompt */
prt(format("%s to a pref file", title), row, 0);
/* Prompt */
prt("File: ", row + 2, 0);
/* Default filename */
strnfmt(ftmp, sizeof ftmp, "%s.prf", op_ptr->base_name);
/* ... | true | true | false | false | false | 1 |
data_cal_convert_to_client_error (GError *error)
{
g_return_if_fail (error != NULL);
if (error->domain != E_DATA_CAL_ERROR)
return;
switch (error->code) {
case RepositoryOffline:
error->domain = E_CLIENT_ERROR;
error->code = E_CLIENT_ERROR_REPOSITORY_OFFLINE;
break;
case PermissionDenied:
error-... | false | false | false | false | false | 0 |
add_properties_from_intset (
GPtrArray *property_names,
TpIntset *properties)
{
TpIntsetFastIter iter;
guint i;
tp_intset_fast_iter_init (&iter, properties);
while (tp_intset_fast_iter_next (&iter, &i))
{
const gchar *property_name = _tp_enum_to_nick (
TP_TYPE_BASE_ROOM_CONFIG_PROPE... | false | false | false | false | false | 0 |
Compile(vector<string>* atoms) {
if (compiled_ || re2_vec_.size() == 0) {
LOG(INFO) << "C: " << compiled_ << " S:" << re2_vec_.size();
return;
}
for (int i = 0; i < re2_vec_.size(); i++) {
Prefilter* prefilter = Prefilter::FromRE2(re2_vec_[i]);
prefilter_tree_->Add(prefilter);
}
atoms->clear(... | false | false | false | false | false | 0 |
contrastF(const KSharedConfigPtr &config)
{
if (config) {
KConfigGroup g( config, "KDE" );
return 0.1 * g.readEntry( "contrast", 7 );
}
return 0.1 * (qreal)contrast();
} | false | false | false | false | false | 0 |
scanNameSpaceForCTE(ParseState *pstate, const char *refname,
Index *ctelevelsup)
{
Index levelsup;
for (levelsup = 0;
pstate != NULL;
pstate = pstate->parentParseState, levelsup++)
{
ListCell *lc;
foreach(lc, pstate->p_ctenamespace)
{
CommonTableExpr *cte = (CommonTableExpr *) lfirst(lc);
... | false | false | false | false | false | 0 |
print_scope_members(externs* gscope, int indent,int depth)
{
if (depth--)
for (extiter i=gscope->members.begin();i!=gscope->members.end();i++)
print_ext_data(i->second,indent,depth);
} | false | false | false | false | false | 0 |
glade_property_class_make_gvalue (GladePropertyClass *klass,
...)
{
GValue *value;
va_list vl;
g_return_val_if_fail (klass != NULL, NULL);
va_start (vl, klass);
value = glade_property_class_make_gvalue_from_vl (klass, vl);
va_end (vl);
return value;
} | false | false | false | false | false | 0 |
GdipGetPathGradientPresetBlend (GpPathGradient *brush, ARGB *blend, float *positions, int count)
{
if (!brush || !blend || !positions || (brush->presetColors->count != count) || (count < 2))
return InvalidParameter;
memcpy (blend, brush->presetColors->colors, count * sizeof (ARGB));
memcpy (positions, brush->pres... | false | true | false | false | false | 1 |
clipboard_data_convert_to_text (ClipboardData *clipboard_data,
gboolean formatted,
gsize *len)
{
GString *uris;
int i;
if (formatted)
uris = g_string_new (clipboard_data->cut ? "cut" : "copy");
else
uris = g_string_new (NULL);
for (i = 0; i < clipboard_data->n_uris; i++) {
if (fo... | false | false | false | false | false | 0 |
brasero_disc_is_empty (BraseroDisc *disc)
{
BraseroDiscIface *iface;
if (!disc)
return 0;
g_return_val_if_fail (BRASERO_IS_DISC (disc), 0);
iface = BRASERO_DISC_GET_IFACE (disc);
if (iface->is_empty)
return (* iface->is_empty) (disc);
return FALSE;
} | false | false | false | false | false | 0 |
wb_min_max_ratio(struct bdi_writeback *wb,
unsigned long *minp, unsigned long *maxp)
{
unsigned long this_bw = wb->avg_write_bandwidth;
unsigned long tot_bw = atomic_long_read(&wb->bdi->tot_write_bandwidth);
unsigned long long min = wb->bdi->min_ratio;
unsigned long long max = wb->bdi->max_ratio;
/*
* @... | false | false | false | false | false | 0 |
processFiles()
{
if (isVerbose)
printVerboseHeader();
clock_t startTime = clock(); // start time of file formatting
// loop thru input fileNameVector and process the files
for (size_t i = 0; i < fileNameVector.size(); i++)
{
getFilePaths(fileNameVector[i]);
// loop thru fileName vector formatting the ... | false | false | false | false | false | 0 |
exec_eval_expr(PLpgSQL_execstate *estate,
PLpgSQL_expr *expr,
bool *isNull,
Oid *rettype)
{
int rc;
/*
* If not already done create a plan for this expression
*/
if (expr->plan == NULL)
exec_prepare_plan(estate, expr);
/*
* If this is a simple expression, bypass SPI and use the executo... | false | false | false | false | false | 0 |
gf100_gr_chan_bind(struct nvkm_object *object, struct nvkm_gpuobj *parent,
int align, struct nvkm_gpuobj **pgpuobj)
{
struct gf100_gr_chan *chan = gf100_gr_chan(object);
struct gf100_gr *gr = chan->gr;
int ret, i;
ret = nvkm_gpuobj_new(gr->base.engine.subdev.device, gr->size,
align, false, parent, pg... | false | false | false | false | false | 0 |
rtw_hal_set_odm_var(struct adapter *adapt,
enum hal_odm_variable var, void *val1,
bool set)
{
if (adapt->HalFunc.SetHalODMVarHandler)
adapt->HalFunc.SetHalODMVarHandler(adapt, var,
val1, set);
} | false | false | false | false | false | 0 |
_symbol_at_cb (gpointer key, gpointer value, gpointer user_data)
{
AsmSymEntry *entry = (AsmSymEntry *)value;
if ( entry->data == GUINT_TO_POINTER(_at_cb_mem) && entry->type == _at_cb_type )
_at_cb_name = entry->name; //FIXME: how to inform caller to stop calling
} | false | false | false | false | false | 0 |
localtime_with_gmtoff_zone(const time_t *t, struct tm *result, long *gmtoff, const char **zone)
{
struct tm tm;
if (LOCALTIME(t, tm)) {
#if defined(HAVE_STRUCT_TM_TM_GMTOFF)
*gmtoff = tm.tm_gmtoff;
#else
struct tm *u, *l;
long off;
struct tm tmbuf;
l = &tm;
u = GMTIME(t, tmbuf);
if (!u)
return NULL... | false | false | false | false | false | 0 |
wasp_report_net_error( ){
#ifdef WASP_IN_WIN32
wasp_errf( wasp_es_vm, "s", strerror( WSAGetLastError() ) );
#else
if( errno == EINPROGRESS )return;
wasp_errf( wasp_es_vm, "s", strerror( errno ) );
#endif
} | false | false | false | false | false | 0 |
yield_op (GTlsConnectionGnutls *gnutls,
GTlsConnectionGnutlsOp op)
{
g_mutex_lock (&gnutls->priv->op_mutex);
if (op == G_TLS_CONNECTION_GNUTLS_OP_HANDSHAKE)
gnutls->priv->handshaking = FALSE;
if (op == G_TLS_CONNECTION_GNUTLS_OP_CLOSE)
gnutls->priv->closing = FALSE;
if (op != G_TLS_CONNECTION_GN... | false | false | false | false | false | 0 |
cpunum_resume(int cpunum, int reason)
{
VERIFY_CPUNUM_VOID(cpunum_resume);
LOG(("cpunum_resume (CPU=%d, r=%X)\n", cpunum, reason));
/* clear the pending suspend bits, and force a resync */
cpu[cpunum].nextsuspend &= ~reason;
if (cpu_getexecutingcpu() >= 0)
activecpu_abort_timeslice();
} | false | false | false | false | false | 0 |
tracker_sparql_solution_lookup (TrackerSparqlSolution* self, const gchar* variable_name) {
gchar* result = NULL;
gint variable_index = 0;
GHashTable* _tmp0_ = NULL;
const gchar* _tmp1_ = NULL;
gconstpointer _tmp2_ = NULL;
gboolean _tmp3_ = FALSE;
GPtrArray* _tmp4_ = NULL;
gint _tmp5_ = 0;
GHashTable* _tmp6_ = ... | false | false | false | false | false | 0 |
_compare(const sauchar_t *T, saidx_t Tsize,
const sauchar_t *P, saidx_t Psize,
saidx_t suf, saidx_t *match) {
saidx_t i, j;
saint_t r;
for(i = suf + *match, j = *match, r = 0;
(i < Tsize) && (j < Psize) && ((r = T[i] - P[j]) == 0); ++i, ++j) { }
*match = j;
return (r == 0) ? -(j != Psi... | false | false | false | false | false | 0 |
camIntersectionSegments(CamPoint p[4], CamPoint *res)
{
CamPoint A=p[0],B=p[3],C=p[1],D=p[2];
CAM_INT64 c1,c2;
if ((B.y==A.y)||(D.y==C.y)) {
if ((B.x==A.x)||(D.x==C.x)) {
return 0;
}
c1=(((CAM_INT64)(B.y-A.y))<<16)/(B.x-A.x); // 16 bits fixed point
c2=(((CAM_INT64)(D.y-C.y))<<16)/(D.x-C.x)... | false | false | false | false | false | 0 |
classifier_check (int *list, const DATASET *dset,
PRN *prn, int *err)
{
char *mask = NULL;
const double *y = dset->Z[list[1]];
int i, v, ni, t;
for (i=2; i<=list[0]; i++) {
v = list[i];
if (v == 0) {
continue;
}
ni = gretl_isdummy(dset->t1, dset->t2, dset->Z[v]);
if (ni > 0) {
... | false | false | false | false | false | 0 |
new_hentry(CTX ctx, knh_hmap_t *hmap, khashcode_t hcode)
{
knh_hentry_t *e;
if(hmap->unused == NULL) {
size_t oarenasize = hmap->arenasize;
char *oarena = (char*)hmap->arena;
hmap->arenasize *= 2;
hmap->arena = (knh_hentry_t*)KNH_REALLOC(ctx, path, hmap->arena, oarenasize, hmap->arenasize, sizeof(knh_hentry_t... | false | false | false | false | false | 0 |
XextAddDisplay (
XExtensionInfo *extinfo,
Display *dpy,
_Xconst char *ext_name,
XExtensionHooks *hooks,
int nevents,
XPointer data)
{
XExtDisplayInfo *dpyinfo;
dpyinfo = (XExtDisplayInfo *) Xmalloc (sizeof (XExtDisplayInfo));
if (!dpyinfo) return NULL;
dpyinfo->display = dpy;
... | false | false | false | false | false | 0 |
setFocus(bool received)
{
HTMLElementImpl::setFocus(received);
khtml::RenderFrame *renderFrame = static_cast<khtml::RenderFrame *>(m_render);
if (!renderFrame || !renderFrame->widget())
return;
if (received)
renderFrame->widget()->setFocus();
else
renderFrame->widget()->clearFocus();
} | false | false | false | false | false | 0 |
show_dir_entry(const char *tag, struct dir_entry *ent)
{
int len = prefix_len;
int offset = prefix_offset;
if (len >= ent->len)
die("git-ls-files: internal error - directory entry not superset of prefix");
if (pathspec && !match(pathspec, ps_matched, ent->name, len))
return;
fputs(tag, stdout);
write_name_... | false | false | false | false | false | 0 |
clipped(int idx) {
int ic;
sraRegionPtr r0, r1, r2;
int x1, y1, w1, h1;
Window win;
int clip = 0;
if (idx < 0) {
return 0;
}
r0 = sraRgnCreateRect(0, 0, dpy_x, dpy_y);
x1 = cache_list[idx].x;
y1 = cache_list[idx].y;
w1 = cache_list[idx].width;
h1 = cache_list[idx].height;
win = cache_list[idx].win;
... | false | false | false | false | false | 0 |
repeatstat (LexState *ls, int line) {
/* repeatstat -> REPEAT block UNTIL cond */
int condexit;
FuncState *fs = ls->fs;
int repeat_init = luaK_getlabel(fs);
BlockCnt bl1, bl2;
enterblock(fs, &bl1, 1); /* loop block */
enterblock(fs, &bl2, 0); /* scope block */
luaX_next(ls); /* skip REPEAT */
statl... | false | false | false | false | false | 0 |
btrfs_clear_path_blocking(struct btrfs_path *p,
struct extent_buffer *held, int held_rw)
{
int i;
if (held) {
btrfs_set_lock_blocking_rw(held, held_rw);
if (held_rw == BTRFS_WRITE_LOCK)
held_rw = BTRFS_WRITE_LOCK_BLOCKING;
else if (held_rw == BTRFS_READ_LOCK)
held_rw = BTRFS_READ_LOCK_BLOCKING;
}
... | false | false | false | false | false | 0 |
gcide_check_files(struct gcide_db *db)
{
int i;
time_t t = 0;
struct stat st;
for (i = 0; letters[i]; i++) {
char *p = gcide_template_name(db, letters[i]);
if (access(p, R_OK)) {
dico_log(L_ERR, 0, _("gcide: `%s' is not readable"), p);
return 1;
}
if (stat(p, &st)) {
dico_log(L_E... | false | false | false | false | true | 1 |
MinimizeFreeSpace(wxAuiTabCtrl* tabCtrl)
{
if (!tabCtrl || tabCtrl->GetPageCount() < 2 || !IsWindowReallyShown(this))
return;
int ctrl_idx = tabCtrl->GetActivePage();
wxWindow* win = GetPage(ctrl_idx);
if (win)
{
int tabOffset = tabCtrl->GetTabOffset();
wxClientDC dc(win);
... | false | false | false | false | false | 0 |
ValidateMapInfoType(TABMAPFile *poMapFile /*=NULL*/)
{
OGRGeometry *poGeom;
/*-----------------------------------------------------------------
* Fetch and validate geometry
*----------------------------------------------------------------*/
poGeom = GetGeometryRef();
if (poGeom && wkbFlatte... | false | false | false | false | false | 0 |
main(int argc, char* argv[])
{
int c;
appName = argv[0];
while ((c = Sys::getopt(argc, argv, "r:l:w:U123")) != -1)
switch (c) {
case '1':
dataFormat &= ~GROUP3OPT_2DENCODING;
break;
case '2':
dataFormat |= GROUP3OPT_2DENCODING;
break;
case '3':
useMMR = 1;
break;
case 'U'... | false | false | false | false | false | 0 |
ebsdb_regexp (sqlite3_context *context,
gint argc,
sqlite3_value **argv)
{
GRegex *regex;
const gchar *expression;
const gchar *text;
/* Reuse the same GRegex for all REGEXP queries with the same expression */
regex = sqlite3_get_auxdata (context, 0);
if (!regex) {
GError *error = N... | false | false | false | false | false | 0 |
hal_EfusePgPacketWrite1ByteHeader(struct adapter *pAdapter, u8 efuseType, u16 *pAddr, struct pgpkt *pTargetPkt)
{
bool bRet = false;
u8 pg_header = 0, tmp_header = 0;
u16 efuse_addr = *pAddr;
u8 repeatcnt = 0;
pg_header = ((pTargetPkt->offset << 4) & 0xf0) | pTargetPkt->word_en;
efuse_OneByteWrite(pAdapter, efu... | false | false | false | false | false | 0 |
read_config_from_file(config_t *c, w_data *d)
{
et_string_t cfpath;
char buf[1024];
FILE *f = NULL;
et_str_new(&cfpath, 1024);
if (get_config_filename(&cfpath) != 0) {
fprintf(stderr, "Could not locate config file\n");
et_str_end(&cfpath);
return -1;
}
f = fopen(cfpath.buf, "r");
if ... | true | true | false | false | true | 1 |
krb5_verify_authenticator_checksum(krb5_context context,
krb5_auth_context ac,
void *data,
size_t len)
{
krb5_error_code ret;
krb5_keyblock *key;
krb5_authenticator authenticator;
krb5_crypto crypto;
ret = krb5_auth_con_getauthenticator (context,
ac,
&authen... | false | false | false | false | false | 0 |
Create( wxWindow* parent, wxWindowID id, const wxString& /* title */, const wxPoint& pos, long style )
{
////@begin CWizardAttach member initialisation
m_WelcomePage = NULL;
m_ProjectInfoPage = NULL;
m_ProjectPropertiesPage = NULL;
m_ProjectProcessingPage = NULL;
m_AccountManagerInfoPage = NULL;
... | false | false | false | false | false | 0 |
check_crl_path(X509_STORE_CTX *ctx, X509 *x)
{
X509_STORE_CTX crl_ctx;
int ret;
/* Don't allow recursive CRL path validation */
if (ctx->parent)
return 0;
if (!X509_STORE_CTX_init(&crl_ctx, ctx->ctx, x, ctx->untrusted))
return -1;
crl_ctx.crls = ctx->crls;
/* Copy verify params across */
X509_STORE_CTX_se... | false | false | false | false | false | 0 |
gethostbyaddr_p(const char *addr, int len, int af, struct net_data *net_data) {
struct irs_ho *ho;
char **hap;
if (!net_data || !(ho = net_data->ho))
return (NULL);
if (net_data->ho_stayopen && net_data->ho_last &&
net_data->ho_last->h_length == len)
for (hap = net_data->ho_last->h_addr_list;
hap &... | false | false | false | false | false | 0 |
do_rm_rf (const char *path)
{
int r;
CLEANUP_FREE char *buf = NULL, *err = NULL;
if (STREQ (path, "/")) {
reply_with_error ("cannot remove root directory");
return -1;
}
buf = sysroot_path (path);
if (buf == NULL) {
reply_with_perror ("malloc");
return -1;
}
r = command (NULL, &err, s... | false | false | false | false | false | 0 |
GetNumInstances()
{
uint32 ret = 0;
for (MapMapType::iterator itr = i_maps.begin(); itr != i_maps.end(); ++itr)
{
Map* map = itr->second;
if (!map->IsDungeon()) continue;
ret += 1;
}
return ret;
} | false | false | false | false | false | 0 |
targa_encode_frame(AVCodecContext *avctx,
unsigned char *outbuf,
int buf_size, void *data){
AVFrame *p = data;
int bpp, picsize, datasize;
uint8_t *out;
if(avctx->width > 0xffff || avctx->height > 0xffff) {
av_log(avctx, AV_LOG_ERROR, ... | false | true | false | false | false | 1 |
jpu_queue_init(void *priv, struct vb2_queue *src_vq,
struct vb2_queue *dst_vq)
{
struct jpu_ctx *ctx = priv;
int ret;
memset(src_vq, 0, sizeof(*src_vq));
src_vq->type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
src_vq->io_modes = VB2_MMAP | VB2_DMABUF;
src_vq->drv_priv = ctx;
src_vq->buf_struct_size = sizeof(stru... | false | false | false | false | false | 0 |
setWindow(NCursesWindow& view,
int v_grid NCURSES_PARAM_INIT(1),
int h_grid NCURSES_PARAM_INIT(1))
{
viewWin = &view;
min_row = min_col = 0;
if (h_grid <=0 || v_grid <= 0)
err_handler("Illegal Gridsize");
else {
h_gridsize = h_grid;
v_gridsize = v_grid;
}
} | false | false | false | false | false | 0 |
WriteMolecule(OBBase* pOb, OBConversion* pConv)
{
OBMol* pmol = dynamic_cast<OBMol*>(pOb);
if(pmol==NULL)
return false;
//Define some references so we can use the old parameter names
ostream &ofs = *pConv->GetOutStream();
OBMol &mol = *pmol;
return(WriteChem3d(ofs,mol,"MM2"));
} | false | false | false | false | false | 0 |
parser_getval(struct parser *p, const char *name) {
struct parser_value *v;
for (v = p->fhead; v; v = (struct parser_value *)v->spec.next)
{
if (!strcmp(v->spec.name, name))
{
return v;
}
}
quit_fmt("parser_getval error: name is %s\n", name);
return 0; /* Needed to avoid Windows compiler warning */
} | false | false | false | false | false | 0 |
find_center (const int x,
const double slop,
const double inter,
const double low_th,
const double high_th,
const int direct,
double * ycent)
{
float ymid=0;
int pos=0;
int row=0;
int col=0;
int ylow=0;
int yupp=0;
int pass=0;
... | false | false | false | false | false | 0 |
convert_var_csm2lm( Block *loop )
{
int entry;
for( entry = 1;
entry <= range_IntSet( loop->omp_pri_var ); entry++){
if( in_IntSet( loop->omp_pri_var, entry ) ){
make_new_local_var( loop, entry );
localize_priv( loop, entry );
}
}
#ifdef OMPDBG_LOCAL_VARS
confirm_localized_vars(... | false | false | false | false | false | 0 |
is_text_target (gchar *target_type)
{
const gchar *charset;
gchar *text_plain_locale;
gboolean ret;
g_get_charset (&charset);
text_plain_locale = g_strdup_printf ("text/plain;charset=%s", charset);
ret = !strcmp (target_type, "UTF8_STRING") ||
!strcmp (target_type, "COMPOUND_TEXT") ||
!strcmp... | false | false | false | false | false | 0 |
GC_extend_size_map(size_t i)
{
size_t orig_granule_sz = ROUNDED_UP_GRANULES(i);
size_t granule_sz = orig_granule_sz;
size_t byte_sz = GRANULES_TO_BYTES(granule_sz);
/* The size we try to preserve. */
/* Close to i, unless this would */
... | false | false | false | false | false | 0 |
g_mime_utils_best_encoding (const unsigned char *text, size_t len)
{
const unsigned char *ch, *inend;
size_t count = 0;
inend = text + len;
for (ch = text; ch < inend; ch++)
if (*ch > (unsigned char) 127)
count++;
if ((float) count <= len * 0.17)
return GMIME_CONTENT_ENCODING_QUOTEDPRINTABLE;
else
re... | false | false | false | false | false | 0 |
g_vfs_afp_volume_close_fork (GVfsAfpVolume *volume,
gint16 fork_refnum,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
GVfsAfpVolu... | false | false | false | false | false | 0 |
map_joystick(int joystick, input_config_item *config,
fs_emu_input_mapping *mapping, int *action_table, int *out_action,
int *out_index) {
const char* action_name = config->config_value;
int action = 0;
// mapping must be terminated with an entry with name set to NULL
for (int i = 0;; i+... | false | false | false | false | false | 0 |
TIFFWriteDirectoryTagAscii(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, char* value)
{
if (dir==NULL)
{
(*ndir)++;
return(1);
}
return(TIFFWriteDirectoryTagCheckedAscii(tif,ndir,dir,tag,count,value));
} | false | false | false | false | false | 0 |
deal_community(game_tp g)
{
/* Gives 5 cards to COMMUNITY */
int i;
int c = 0;
for (i = 0; i < 52; i++)
{
if (!g->deck[i].dealt) {
g->deck[i].dealt = 1;
g->deck[i].cardholder = COMMUNITY;
g->community[c] = g->deck[i];
c++;
}
if ... | false | false | false | false | false | 0 |
Read_Term(StmInf *pstm, int parse_end_of_term)
{
int jmp_val;
WamWord term;
int save_use_le_prompt = use_le_prompt;
use_le_prompt = 1;
parse_nb_var = 0;
last_read_line = -1;
pstm_i = pstm;
tok_present = FALSE;
Save_Machine_Regs(buff_save_machine_regs);
jmp_val = setjmp(jumper);
Restore_Machi... | false | false | false | false | false | 0 |
setIdColAcol() {
// Charge of Higgs. Fill flavours.
int idUpChg = (abs(id1)%2 == 0) ? id1 : id2;
int idHchg = (idUpChg > 0) ? 37 : -37;
setId( id1, id2, idHchg);
// Colour flow topologies. Swap when antiquarks.
if (abs(id1) < 9) setColAcol( 1, 0, 0, 1, 0, 0);
else setColAcol( 0, 0, 0, 0, 0... | false | false | false | false | false | 0 |
addpath(char c)
{
if (gpathp >= lastgpathp)
globerr = "Pathname too long";
else {
*gpathp++ = c;
*gpathp = 0;
}
} | false | false | false | false | false | 0 |
getContextFor(PixelComponentType ctype, uint32 width, uint32 height)
{
// Faster to return main context if the RTT is smaller than the window size
// and ctype is PCT_BYTE. This must be checked every time because the window might have been resized
if(ctype == PCT_BYTE)
{
... | false | false | false | false | false | 0 |
scrollRuler(UT_sint32 yoff, UT_sint32 ylimit)
{
UT_Rect rClip;
UT_Rect * prClip;
FV_View * pView = static_cast<FV_View *>(m_pView);
if(pView->getDocument() == NULL)
{
return;
}
if (ylimit > 0)
m_yScrollLimit = ylimit;
if (yoff > m_yScrollLimit)
yoff = m_yScrollLimit;
UT_sint32 dy = yoff - m_yScrollOff... | 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.