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 |
|---|---|---|---|---|---|---|
tree_iterator__current(
const git_index_entry **entry, git_iterator *self)
{
int error;
tree_iterator *ti = (tree_iterator *)self;
tree_iterator_frame *tf = ti->head;
iterator__clear_entry(entry);
if (tf->current >= tf->n_entries)
return GIT_ITEROVER;
if ((error = tree_iterator__update_entry(ti)) < 0)
ret... | false | false | false | false | false | 0 |
CopyTo(int pos, FixedArray* dest, int dest_pos, int len) {
AssertNoAllocation no_gc;
WriteBarrierMode mode = dest->GetWriteBarrierMode(no_gc);
for (int index = 0; index < len; index++) {
dest->set(dest_pos+index, get(pos+index), mode);
}
} | false | false | false | false | false | 0 |
p_unescape (PyObject *self, PyObject *args)
{
PyObject *rv;
char *s;
char *copy;
char *esc_char;
int buflen;
if (!PyArg_ParseTuple(args, "s#s:unescape(str, char)", &s, &buflen, &esc_char))
return NULL;
copy = strdup(s);
if (copy == NULL) return PyErr_NoMemory();
neos_unescape(copy, buflen, esc_c... | false | false | false | false | false | 0 |
reportModel(const Solver& s, const Enumerator& en) {
// remember current (tentative) model
if (modelQ() < print_no) {
Model m = storeModel(s.assignment());
if (modelQ() == print_all) {
// fire & forget: just output the model
curr_ = 0;
printModel(m, s.sharedContext()->symTab(), en);
}
}
reportOptimiz... | false | false | false | false | false | 0 |
csv_fwrite (FILE *fp, const char *src, size_t src_size)
{
if (fp == NULL || src == NULL)
return 0;
if (fputc('"', fp) == EOF)
return EOF;
while (src_size) {
if (*src == '"') {
if (fputc('"', fp) == EOF)
return EOF;
}
if (fputc(*src, fp) == EOF)
return EOF;
src_size--;... | false | false | false | false | false | 0 |
cell_renderer_edited (GtkCellRendererText *cell,
const char *path_str,
const char *new_text,
NautilusListView *view)
{
GtkTreePath *path;
NautilusFile *file;
GtkTreeIter iter;
view->details->editable_widget = NULL;
nautilus_view_set_is_renaming (NAUTILUS_VIEW (view), F... | false | false | false | false | false | 0 |
ath_scan_complete(struct ath_softc *sc, bool abort)
{
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
if (abort)
ath_dbg(common, CHAN_CTX, "HW scan aborted\n");
else
ath_dbg(common, CHAN_CTX, "HW scan complete\n");
sc->offchannel.scan_req = NULL;
sc->offchannel.scan_vif = NULL;
sc->offchannel.state ... | false | false | false | false | false | 0 |
um_realm_manager_new_finish (GAsyncResult *result,
GError **error)
{
GSimpleAsyncResult *async;
NewClosure *closure;
g_return_val_if_fail (g_simple_async_result_is_valid (result, NULL,
um_realm_manager_ne... | false | false | false | false | false | 0 |
listNew( const QString& dir ) const
{
QDir d( dir + QString::fromLatin1( "/new" ) );
return d.entryList( QDir::Files ).toSet();
} | false | false | false | false | false | 0 |
RequestInformation(
vtkInformation *vtkNotUsed(request),
vtkInformationVector **vtkNotUsed(inputVector),
vtkInformationVector *outputVector)
{
// get the info objects
vtkInformation* outInfo = outputVector->GetInforma... | false | false | false | false | false | 0 |
cpl_recipeconfig_is_required(const cpl_recipeconfig* self,
const char* tag, const char* input)
{
static const cxchar* const _id = "cpl_recipeconfig_is_required";
const cpl_frameinfo* info = NULL;
const cpl_framedata* data = NULL;
if (self == NULL) {
cpl_error_se... | false | false | false | false | false | 0 |
cbf_mpint_negate_acc(unsigned int * acc, size_t acsize) {
int iint;
for (iint=0; iint< acsize; iint++) {
acc[iint] = ~acc[iint];
}
return cbf_mpint_increment_acc(acc,acsize);
} | false | false | false | false | false | 0 |
AddTargetItem(std::string const& item,
cmTarget* target)
{
// This is called to handle a link item that is a full path to a target.
// If the target is not a static library make sure the link type is
// shared. This is because dynamic-mode linking can handle both
//... | false | false | false | false | false | 0 |
glade_xml_context_destroy (GladeXmlContext *context)
{
g_return_if_fail (context != NULL);
if (context->freedoc)
xmlFreeDoc ((xmlDoc*)context->doc);
g_free (context);
} | false | false | false | false | false | 0 |
mips64_get_idling_pc(cpu_gen_t *cpu)
{
cpu_mips_t *mcpu = CPU_MIPS64(cpu);
struct mips64_idle_pc_hash **pc_hash,*p;
struct cpu_idle_pc *res;
u_int h_index;
m_uint64_t cur_pc;
int i;
cpu->idle_pc_prop_count = 0;
if (mcpu->idle_pc != 0) {
printf("\nYou already use an idle PC, using the cal... | false | false | false | false | false | 0 |
extWriteVarSliceDP(stream_t *streamptr, int varID, int levID, const double *data)
{
int fileID;
int gridID;
int zaxisID;
double level;
int header[4];
int tsID;
int vlistID;
int pdis, pcat, pnum;
extrec_t *extp;
extp = streamptr->record->extp;
vlistID = streamptr->vlistID;
fileID = stream... | false | false | false | false | false | 0 |
check_for_scripts_dir (char *dir)
{
char *buf;
struct stat s;
bfd_boolean res;
buf = concat (dir, "/ldscripts", (const char *) NULL);
res = stat (buf, &s) == 0 && S_ISDIR (s.st_mode);
free (buf);
return res;
} | false | false | false | false | false | 0 |
Init(const DiDocument *docu,
DiInputPixel *pixel)
{
if ((docu != NULL) && (pixel != NULL))
{
pixel->determineMinMax();
MinValue = pixel->getMinValue(1 /* selected range of pixels only */);
MaxValue = pixel->getMaxValue(1 /* selected range of pixels only */);
... | false | false | false | false | false | 0 |
on_listitem3_button_release (GtkWidget * widget, GdkEvent * event,
tListItem3 * parent)
{
if ((!parent->selected)&&(parent->can_select))
{
playsound (SND_BUTTONUP);
}
if (parent->mousein)
{
if (!parent->selected)
{
if (!parent->can_select)
return TRUE;
(*(parent->runfunc)) (parent->func_dat... | false | false | false | false | false | 0 |
pull(int)
{
if (!_active) {
_notifier.sleep();
return 0;
}
bool more = true;
if (!_packet)
more = read_packet(0);
if (_packet && _timing) {
Timestamp now = Timestamp::now();
Timestamp t = _packet->timestamp_anno() + _time_offset;
if (t > now) {
t -= Timestamp::make_msec(50);
if (t >... | false | false | false | false | false | 0 |
r200IsProgramNative(struct gl_context *ctx, GLenum target, struct gl_program *prog)
{
struct r200_vertex_program *vp = (void *)prog;
switch(target){
case GL_VERTEX_PROGRAM_ARB:
if (!vp->translated) {
r200_translate_vertex_program(ctx, vp);
}
/* does not take parameters etc. into account */
... | false | false | false | false | false | 0 |
mech_update(mech_sprite_t *s)
{
float v[2];
if (!(s->mech_flags & MECH_IMMOBILE))
{
mech_boundary(s);
mech_air(s);
vmadd(((sprite_t *)s)->vel,s->rmass,s->lin_impulse);
s->lin_impulse[0] = 0;
s->lin_impulse[1] = 0;
//s->lin_impulse[1] = level.gravity*s->gravity; /* gravity */
... | false | false | false | false | false | 0 |
act_var_rescale(solver* s) {
double* activity = s->activity;
int i;
for (i = 0; i < s->size; i++)
activity[i] *= 1e-100;
s->var_inc *= 1e-100;
} | false | false | false | false | false | 0 |
compareChar(char c1, char c2) const
{
if (c1 < c2) return -1;
if (c1 > c2) return 1;
return 0;
} | false | false | false | false | false | 0 |
StateMap(const std::string& state) {
/// \mapname CREAM CREAM extended BES
/// \mapattr REGISTERED -> ACCEPTED
if (state == "REGISTERED")
return JobState::ACCEPTED;
/// \mapattr PENDING -> ACCEPTED
else if (state == "PENDING")
return JobState::ACCEPTED;
/// \mapattr RUNNING -> RUNNI... | false | false | false | false | false | 0 |
init_nfs(void)
{
struct stat st;
struct mntent * ent;
FILE * mnt;
nlist = (NFS*)0;
if (stat("/proc/version", &st) < 0)
return;
if ((mnt = setmntent("/proc/mounts", "r")) == (FILE*)0)
return;
while ((ent = getmntent(mnt))) {
if (isnetfs(ent->mnt_type)) {
size_t nlen = strlen(ent->mnt_dir... | false | true | false | false | false | 1 |
_dispatch(omniCallHandle& _handle)
{
const char* op = _handle.operation_name();
if( omni::strMatch(op, "query") ) {
_0RL_cd_6b2f9da8b63bbcbb_e1000000 _call_desc(_0RL_lcfn_6b2f9da8b63bbcbb_f1000000, "query", 6, 1);
_handle.upcall(this,_call_desc);
return 1;
}
#ifndef _MSC_VER
if( _impl_Tra... | false | false | false | false | false | 0 |
_do_diag_stats(struct timeval *tv1, struct timeval *tv2,
int yield_sleep)
{
uint32_t yield_sleep_usecs = yield_sleep * 1000000;
uint32_t delta_t, real_time;
delta_t = (tv2->tv_sec - tv1->tv_sec) * 1000000;
delta_t += tv2->tv_usec - tv1->tv_usec;
real_time = (delta_t - (bf_last_yields * yield_sleep_usecs... | false | false | false | false | false | 0 |
M_UnbindCommand (char *command)
{
int j;
int l;
char *b;
l = strlen(command);
for (j=0 ; j<MAX_KEYS ; j++)
{
b = keys[j].binding;
if (!b)
continue;
if (!strncmp (b, command, l) )
Key_SetBinding (j, "");
}
} | false | false | false | false | false | 0 |
ev_token_bucket_cfg_new(ev_uint32_t read_rate, ev_uint32_t read_burst,
ev_uint32_t write_rate, ev_uint32_t write_burst,
const struct timeval *tick_len)
{
struct ev_token_bucket_cfg *r;
struct timeval g;
if (! tick_len) {
g.tv_sec = 1;
g.tv_usec = 0;
tick_len = &g;
}
if (read_rate > read_burst || writ... | false | false | false | false | false | 0 |
list_attributes()
{ int n,k,j;
struct extra *ex;
outstring(
"Extra attributes (and dynamically allocated internal attributes)\n");
for ( n = 0 ; n < NUMELEMENTS ; n++ )
{
sprintf(msg,"%s attributes:\n",typenames[n]); outstring(msg);
for ( k = 0 ; k < web.skel[n].extra_count ; k++ )
{ e... | false | true | false | false | false | 1 |
f_parser(lua_State*L,void*ud){
int i;
Proto*tf;
Closure*cl;
struct SParser*p=cast(struct SParser*,ud);
luaC_checkGC(L);
tf=luaY_parser(L,p->z,
&p->buff,p->name);
cl=luaF_newLclosure(L,tf->nups,hvalue(gt(L)));
cl->l.p=tf;
for(i=0;i<tf->nups;i++)
cl->l.upvals[i]=luaF_newupval(L);
setclvalue(L,L->top,cl);
incr_top(L);
} | false | false | false | false | false | 0 |
ChangeRank(uint32 newRank)
{
RankId = newRank;
Player* player = sObjectMgr.GetPlayer(guid);
// If player not online data in data field will be loaded from guild tabs no need to update it !!
if (player)
player->SetRank(newRank);
CharacterDatabase.PExecute("UPDATE guild_member SET rank='%u' ... | false | false | false | false | false | 0 |
json_cfg_encode_max_depth(lua_State *l)
{
json_config_t *cfg;
int depth;
json_verify_arg_count(l, 1);
cfg = json_fetch_config(l);
if (lua_gettop(l)) {
depth = luaL_checkinteger(l, 1);
luaL_argcheck(l, depth > 0, 1, "expected positive integer");
cfg->encode_max_depth = depth... | false | false | false | false | false | 0 |
remove_include(string filename, string include, string searchpattern)
{
if(!Utils::check_include(filename, include, searchpattern))
return 1;
string filename_tmp = filename + ".tmp";
fstream fi(filename.c_str(), ios_base::in);
fstream fo(filename_tmp.c_str(), ios_base::out | ios_base::trunc);
if(!fi || ... | false | false | false | false | false | 0 |
add_certs_in_dir(X509_LOOKUP *lookup, char *path)
{
char buf[MAXPATH];
struct direct *d;
DIR *dirp;
int ret = 0;
dirp = opendir(path);
if(dirp){
while(!ret && (d=readdir(dirp)) != NULL){
if(srchrstr(d->d_name, ".crt")){
build_path(buf, path, d->d_name, sizeof(buf... | true | true | false | false | false | 1 |
techroom_load_ani(anim **animpp, char *name)
{
int load_attempts = 0;
char anim_filename[64] = "2_";
// hi-res support
// (i don't think there are any hi-res anims for these tho)
if (gr_screen.res == GR_1024) {
strcat_s(anim_filename, name);
} else {
strcpy_s(anim_filename, name);
}
while(1) {
if ( load... | false | false | false | false | false | 0 |
curl_writer(char *data, size_t size, size_t nmemb, Curl_buffer *result){
if(result == 0)
return 0;
size=size*nmemb;
if(size>0){
if(result->length + size >= result->buf_size){
result->buf_size = result->buf_size*2 + size;
result->buf = (char *)pa_realloc(result->buf, result->buf_size+1);
}
memcpy(resul... | false | false | false | false | false | 0 |
_g_daemon_vfs_mountspec_get_uri_scheme (GMountSpec *spec)
{
const char *type, *scheme;
GVfsUriMapper *mapper;
MountableInfo *mountable;
type = g_mount_spec_get_type (spec);
mapper = g_hash_table_lookup (the_vfs->to_uri_hash, type);
scheme = NULL;
if (mapper)
scheme = g_vfs_uri_mapper_to_uri_scheme (... | false | false | false | false | false | 0 |
Buffered()
{
if(file_buf==0)
return 0;
off_t b=file_buf->Size()+send_buf->Size()*size_write/(size_write+20);
if(b<0)
b=0;
else if(b>real_pos)
b=real_pos;
return b;
} | false | false | false | false | false | 0 |
impl_GetDefaultAttributes (DBusConnection * bus, DBusMessage * message,
void *user_data)
{
AtkText *text = (AtkText *) user_data;
DBusMessage *reply;
AtkAttributeSet *set;
DBusMessageIter iter;
g_return_val_if_fail (ATK_IS_TEXT (user_data),
droute_not_yet_ha... | false | false | false | false | false | 0 |
gegl_operation_point_filter_cl_process (GeglOperation *operation,
GeglBuffer *input,
GeglBuffer *output,
const GeglRectangle *result,
gi... | false | true | false | false | true | 1 |
mark_boundery_cells(cell_array& cells)
{
unsigned int current_count = 0;
for(int i = 0; i < cells.size; i++)
{
if(cells[i] != 0)
{
if(
(cells.n(i) == 0) ||
(cells.e(i) == 0) ||
(cells.s(i) == 0) ||
(cells.w(i) == 0)
){
cells[i] = 2;
current_count++;
}
}
}
return current_cou... | false | false | false | false | false | 0 |
write(hsStream* S, plResManager* mgr) {
plSynchedObject::write(S, mgr);
mgr->writeKey(S, fDrawIntf);
mgr->writeKey(S, fSimIntf);
mgr->writeKey(S, fCoordIntf);
mgr->writeKey(S, fAudioIntf);
S->writeInt(fInterfaces.getSize());
for (size_t i=0; i<fInterfaces.getSize(); i++)
mgr->write... | false | false | false | false | false | 0 |
cleanup_open(struct open_call *call, bool restore)
{
if (restore && call->saved)
restore_contents(container_of(call, struct failtest_call,
u.open),
call->saved, false, "open with O_TRUNC");
if (!call->closed) {
trace("Cleaning up open %s by closing fd %i\n",
call->pathname, call->ret);
c... | false | false | false | false | true | 1 |
read_file(const char *name, struct membuf *buf)
{
char block[1024];
FILE *in;
int len;
in = fopen(name, "rb");
if(in == NULL)
{
LOG(LOG_ERROR, ("Can't open file \"%s\" for input.\n", name));
exit(-1);
}
do
{
len = fread(block, 1, 1024, in);
... | true | true | false | false | true | 1 |
migrate_rename (const gchar *old_filename,
const gchar *new_filename)
{
gboolean old_filename_is_dir;
gboolean old_filename_exists;
gboolean new_filename_exists;
gboolean success = TRUE;
old_filename_is_dir = g_file_test (old_filename, G_FILE_TEST_IS_DIR);
old_filename_exists = g_file_test (old_f... | false | false | false | false | false | 0 |
avatar_image_update_gravatar_uri (GiggleAvatarImage *image)
{
GiggleAvatarImagePriv *priv = GET_PRIV (image);
char *uri = NULL;
if (!priv->cache) {
priv->cache = giggle_avatar_cache_new ();
g_object_notify (G_OBJECT (image), "cache");
}
if (priv->gravatar_id) {
uri = giggle_avatar_cache_ge... | false | false | false | false | false | 0 |
e_client_open (EClient *client,
gboolean only_if_exists,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
EClientClass *class;
g_return_if_fail (callback != NULL);
g_return_if_fail (E_IS_CLIENT (client));
class = E_CLIENT_GE... | false | false | false | false | true | 1 |
SetupPieces(int numPieces)
{
this->Superclass::SetupPieces(numPieces);
this->NumberOfVerts = new vtkIdType[numPieces];
this->NumberOfLines = new vtkIdType[numPieces];
this->NumberOfStrips = new vtkIdType[numPieces];
this->NumberOfPolys = new vtkIdType[numPieces];
this->VertElements = new vtkXMLDataElement*[... | false | false | false | false | false | 0 |
uae_get_memory_checksum() {
uint32_t checksum = 0;
int size;
uint32_t *mem;
mem = (uint32_t *) chipmemory;
size = allocated_chipmem / 4;
for (int i = 0; i < size; i++) {
//checksum = (checksum + *mem) & 0x00ffffff;
checksum += *mem;
mem++;
}
mem = (uint32_t *) bogomem... | false | false | false | false | false | 0 |
find_node_by_guid(uint64_t guid)
{
Node *nd, *e;
if (ignoreduplicate)
return 0;
for (nd = nodes, e = nodes + netnodes; nd < e; nd++)
if (nd->nodeguid == guid)
return nd;
return 0;
} | false | false | false | false | false | 0 |
Plot( double x, double y, int pen, wxDC &dc )
{
// (x,y) are the world coordinates to which the pen is to be moved either up
// (pen=3) or down (pen=2). The plot coordinates (x,y) can have any value
// positive or negative, but are clipped outside the plot windows.
//
switch (pen)
{
case 3: // move wi... | false | false | false | false | false | 0 |
subset_model(Agraph_t * G, int nG)
{
int i, j, ne;
DistType **Dij;
vtx_data *gp;
gp = makeGraphData(G, nG, &ne, MODE_KK, MODEL_SUBSET, NULL);
Dij = compute_apsp_artifical_weights(gp, nG);
for (i = 0; i < nG; i++) {
for (j = 0; j < nG; j++) {
GD_dist(G)[i][j] = Dij[i][j];
}
}
free... | false | false | false | false | false | 0 |
imcomp_nullfloats(
float *fdata,
long tilelen,
int *idata,
int nullcheck,
float nullflagval,
int nullval,
int *status)
/*
do null value substitution of the float array.
If array value = nullflagval, then set the output value to FLOATNULLVALUE.
*/
{
long ii;
double dval... | false | false | false | false | false | 0 |
dxf_style_write
(
DxfFile *fp,
/*!< DXF file pointer to an output file (or device). */
DxfStyle *dxf_style
/*!< DXF \c STYLE entity. */
)
{
#if DEBUG
DXF_DEBUG_BEGIN
#endif
char *dxf_entity_name = strdup ("STYLE");
/* Do some basic checks. */
... | false | false | false | false | false | 0 |
gst_shm_sink_allocator_mem_is_span (GstMemory * mem1, GstMemory * mem2,
gsize * offset)
{
GstShmSinkMemory *mymem1 = (GstShmSinkMemory *) mem1;
GstShmSinkMemory *mymem2 = (GstShmSinkMemory *) mem2;
if (offset) {
GstMemory *parent;
parent = mem1->parent;
*offset = mem1->offset - parent->offset;
... | false | false | false | false | false | 0 |
fl_init ( gint width,
gint height )
{
gint x, y;
gint dx[] = { 1, 0, -1, 0 };
gint dy[] = { 0, -1, 0, 1 };
gint d, i;
fl_x = (gint*)g_malloc( sizeof(gint) * width * height );
fl_y = (gint*)g_malloc( sizeof(gint) * width * height );
fl_table = (fl_cell_t**)g_malloc( sizeof(fl_cell_t*) * height );
fo... | false | false | false | false | false | 0 |
wclen(const FXnchar *ptr){
return (0xD800<=ptr[0] && ptr[0]<0xDC00) ? 2 : 1;
} | false | false | false | false | false | 0 |
webauth_token_encode(struct webauth_context *ctx,
const struct webauth_token *data,
const struct webauth_keyring *ring, const char **token)
{
int s;
const void *raw;
char *btoken;
size_t length;
/*
* First, we encode the binary form into newly allocate... | false | false | false | false | false | 0 |
md2_process(MD2_CTX *ctx)
{
int i, j;
uint8_t t = 0;
for (i = 0; i < 16; i++)
{
ctx->state[i + 16] = ctx->buffer[i];
ctx->state[i + 32] = ctx->buffer[i] ^ ctx->state[i];
}
for (i = 0; i < 18; i++)
{
for (j = 0; j < 48; j++)
t = (ctx->state[j] ^= PI_SUBST... | false | true | false | false | false | 1 |
OnSearchGotoLine(cb_unused wxCommandEvent& event)
{
cbEditor* ed = Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor();
if (!ed)
return;
int max = ed->GetControl()->LineFromPosition(ed->GetControl()->GetLength()) + 1;
/**
@remarks We use wxGetText instead of wxGetNumber because wx... | false | false | false | false | false | 0 |
ProcessEvent(const SDL_Event * event, bool bModal) {
bool processed = false;
// do i have a capturehook set ? (modal)
if(bModal) {
// i will send that event to my children
if(_mid->childList != NULL) {
PG_Widget* list = _mid->childList->first();
while (!processed && (list != NULL)) {
processed = lis... | false | false | false | false | false | 0 |
push_decl_namespace (tree decl)
{
if (TREE_CODE (decl) != NAMESPACE_DECL)
decl = decl_namespace_context (decl);
vec_safe_push (decl_namespace_list, ORIGINAL_NAMESPACE (decl));
} | false | false | false | false | false | 0 |
ci_set_power_limit(struct amdgpu_device *adev, u32 n)
{
struct ci_power_info *pi = ci_get_pi(adev);
if (pi->power_containment_features & POWERCONTAINMENT_FEATURE_PkgPwrLimit) {
PPSMC_Result smc_result =
amdgpu_ci_send_msg_to_smc_with_parameter(adev, PPSMC_MSG_PkgPwrSetLimit, n);
if (smc_result != PPSMC_Result... | false | false | false | false | false | 0 |
hashinet(PG_FUNCTION_ARGS)
{
inet *addr = PG_GETARG_INET_P(0);
int addrsize = ip_addrsize(addr);
/* XXX this assumes there are no pad bytes in the data structure */
return hash_any((unsigned char *) VARDATA_ANY(addr), addrsize + 2);
} | false | false | false | false | false | 0 |
find_multixact_start(MultiXactId multi, MultiXactOffset *result)
{
MultiXactOffset offset;
int pageno;
int entryno;
int slotno;
MultiXactOffset *offptr;
Assert(MultiXactState->finishedStartup);
pageno = MultiXactIdToOffsetPage(multi);
entryno = MultiXactIdToOffsetEntry(multi);
/*
* Flush out dirty d... | false | false | false | false | false | 0 |
findlocalvar(const char *name)
{
ListEntry *node;
Var *var = NULL;
for (node = localvar->head; node && !var; node = node->next) {
var = findlevelvar(name, (List *)node->datum);
}
return var;
} | false | false | false | false | false | 0 |
_emit_segment(struct dm_task *dmt, uint32_t major, uint32_t minor,
struct load_segment *seg, uint64_t *seg_start)
{
char *params;
size_t paramsize = 4096;
int ret;
do {
if (!(params = dm_malloc(paramsize))) {
log_error("Insufficient space for target parameters.");
return 0;
}
params[0] = '\0';
r... | false | false | false | false | false | 0 |
readtup_index(Tuplesortstate *state, SortTuple *stup,
int tapenum, unsigned int len)
{
unsigned int tuplen = len - sizeof(unsigned int);
IndexTuple tuple = (IndexTuple) palloc(tuplen);
USEMEM(state, GetMemoryChunkSpace(tuple));
LogicalTapeReadExact(state->tapeset, tapenum,
tuple, tuplen);
if (state->r... | false | false | false | false | false | 0 |
operator*(vnl_decnum const& r) const
{
#ifdef DEBUG
std::cerr << "Entering vnl_decnum::operator* with "
<< sign_ << data_ << 'e' << exp_ << " and "
<< r.sign() << r.data() << 'e' << r.exp() << '\n';
#endif
if (data_ == "NaN") return *this;
else if (r.data() == "NaN") return r;
else if (dat... | false | false | false | false | false | 0 |
_cb_confirm_dialog_yes(void *data)
{
E_Config_Dialog_Data *cfdata;
char buf[4096];
cfdata = data;
if (e_user_dir_snprintf(buf, sizeof(buf), "applications/bar/%s", cfdata->dir) >= sizeof(buf))
return;
if (ecore_file_is_dir(buf))
ecore_file_recursive_rm(buf);
_load_tlist(cfdata);
} | true | true | false | false | false | 1 |
_popup_show(void *data,
Evas_Object *obj __UNUSED__,
const char *emission __UNUSED__,
const char *source __UNUSED__)
{
ELM_SLIDER_DATA_GET(data, sd);
if (sd->popup)
{
evas_object_layer_set(sd->popup, evas_object_layer_get(data));
evas_object_raise(sd->popup... | false | false | false | false | false | 0 |
actionPerformed(YAction *action, unsigned int modifiers) {
if (action == actionRestore) {
wmRestore();
} else if (action == actionMinimize) {
if (canMinimize())
wmMinimize();
} else if (action == actionMaximize) {
if (canMaximize())
wmMaximize();
} else if... | false | false | false | false | false | 0 |
stop()
{
Q_ASSERT(state == Starting || state == Started);
state = Stopping;
if(!components.isEmpty())
{
for(int n = 0; n < components.count(); ++n)
components[n].ic->stop();
}
else
{
// TODO: hmm, is it possible to have no components?
QMetaObject::invokeMethod(this, "postStop", Qt::QueuedC... | false | false | false | false | false | 0 |
setNotation(bool s, bool above)
{
for(int i=0; i<32; i++)
m_fields[i]->showLabel(s, above);
} | false | false | false | false | false | 0 |
cbf_set_realarray (cbf_handle handle,
unsigned int compression,
int id,
void *value,
size_t elsize,
size_t nelem)
{
if (!handle)
return CBF_ARGUMEN... | false | false | false | false | false | 0 |
mono_field_get_addr (MonoObject *obj, MonoVTable *vt, MonoClassField *field)
{
MONO_REQ_GC_UNSAFE_MODE;
guint8 *src;
if (field->type->attrs & FIELD_ATTRIBUTE_STATIC) {
if (field->offset == -1) {
/* Special static */
gpointer addr;
mono_domain_lock (vt->domain);
addr = g_hash_table_lookup (vt->domain... | false | false | false | true | false | 1 |
loadCountOfCounts( char* fileNameCountOfCounts )
{
Moses::InputFileStream fileCountOfCounts(fileNameCountOfCounts);
if (fileCountOfCounts.fail()) {
cerr << "ERROR: could not open count of counts file " << fileNameCountOfCounts << endl;
exit(1);
}
istream &fileP = fileCountOfCounts;
countOfCounts.push... | false | false | false | false | false | 0 |
fits_get_section_range(char **ptr,
long *secmin,
long *secmax,
long *incre,
int *status)
/*
Parse the input image section specification string, returning
the min, max and increment values.
Typical string = "1:512:2" or "1:512"
*... | false | false | false | false | false | 0 |
menu_suggestion_item_activate_cb(GtkMenuItem *menuitem, gpointer gdata)
{
const gchar *sugg;
gint startword, endword;
ScintillaObject *sci = clickinfo.doc->editor->sci;
g_return_if_fail(clickinfo.doc != NULL && clickinfo.pos != -1);
startword = scintilla_send_message(sci, SCI_WORDSTARTPOSITION, clickinfo.pos, 0)... | false | false | false | false | false | 0 |
parse_device(tuple_t *tuple, cistpl_device_t *device)
{
int i;
u_char scale;
u_char *p, *q;
p = (u_char *)tuple->TupleData;
q = p + tuple->TupleDataLen;
device->ndev = 0;
for (i = 0; i < CISTPL_MAX_DEVICES; i++) {
if (*p == 0xff)
break;
device->dev[i].type = (*p >> 4);
device->dev[i].wp = (*p & 0x08)... | false | false | false | false | false | 0 |
wire_expmem()
{
wire_list *w = wirelist;
int size = 0;
while (w) {
size += sizeof(wire_list);
size += strlen(w->crypt) + 1;
size += strlen(w->key) + 1;
w = w->next;
}
return size;
} | false | false | false | false | true | 1 |
csInsert(giopConnection* conn)
{
ASSERT_OMNI_TRACEDMUTEX_HELD(pd_lock,1);
giopStrand* s = new giopStrand(conn,this);
s->version.major = 1; s->version.minor = 0;
{
ASSERT_OMNI_TRACEDMUTEX_HELD(*omniTransportLock,0);
omni_tracedmutex_lock sync(*omniTransportLock);
s->StrandList::insert(giopStrand::p... | false | false | false | false | false | 0 |
aac_rx_intr_message(int irq, void *dev_id)
{
int isAif, isFastResponse, isSpecial;
struct aac_dev *dev = dev_id;
u32 Index = rx_readl(dev, MUnit.OutboundQueue);
if (unlikely(Index == 0xFFFFFFFFL))
Index = rx_readl(dev, MUnit.OutboundQueue);
if (likely(Index != 0xFFFFFFFFL)) {
do {
isAif = isFastResponse = i... | false | false | false | false | false | 0 |
mime_server_write_open(struct soap *soap, void *unused_handle, const char *id, const char *type, const char *description, enum soap_mime_encoding encoding)
{ /* Note: the 'unused_handle' is always NULL */
/* Return NULL without setting soap->error if we don't want to use the streaming callback for this DIME attachmen... | false | false | false | false | false | 0 |
fix_offsets_insert_ (Segment *segment,
gint start,
gint delta)
{
Segment *child;
SubPattern *sp;
g_assert (segment->start_at >= start);
if (delta == 0)
return;
segment->start_at += delta;
segment->end_at += delta;
for (child = segment->children; child != NULL; child = child->next)
f... | false | false | false | false | false | 0 |
vc1_decode_b_blocks(VC1Context *v)
{
MpegEncContext *s = &v->s;
/* select codingmode used for VLC tables selection */
switch(v->c_ac_table_index){
case 0:
v->codingset = (v->pqindex <= 8) ? CS_HIGH_RATE_INTRA : CS_LOW_MOT_INTRA;
break;
case 1:
v->codingset = CS_HIGH_MOT_INTR... | false | false | false | false | false | 0 |
base32_decodestring(const char *cstr, const char base[], isc_buffer_t *target) {
base32_decode_ctx_t ctx;
base32_decode_init(&ctx, -1, base, target);
for (;;) {
int c = *cstr++;
if (c == '\0')
break;
if (c == ' ' || c == '\t' || c == '\n' || c== '\r')
continue;
RETERR(base32_decode_char(&ctx, c));
}
... | false | false | false | false | false | 0 |
transaction_sync(struct tdb_context *tdb, tdb_off_t offset, tdb_len_t length)
{
if (tdb->flags & TDB_NOSYNC) {
return 0;
}
if (fsync(tdb->fd) != 0) {
tdb->ecode = TDB_ERR_IO;
TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_transaction: fsync failed\n"));
return -1;
}
#ifdef MS_SYNC
if (tdb->map_ptr) {
tdb_off_t mo... | false | false | false | false | false | 0 |
dispatcher_suite_test_send_message_with_account (DispatcherSuite* self) {
FriendsDispatcher* _tmp0_;
guint _tmp1_;
gchar* _tmp2_ = NULL;
gchar* _result_;
GError * _inner_error_ = NULL;
#line 185 "/tmp/buildd/libfriends-0.1.2+14.04.20131108.1/tests/vala/test-dispatcher.vala"
g_return_if_fail (self != NULL);
#line ... | false | false | false | false | false | 0 |
close_bin_files(NetParameters params) {
int i;
for (i = 0; i < params.num_files; i++) {
fclose(params.files[i]);
}
} | false | false | false | false | false | 0 |
go(string msg)
{
while (nextMsg != messages.end() && !account.isDestroyed())
{
if (!fixMessageNumber(account, nextMsg->first,
nextMsg->second)) // Msg disappeared?
{
attributesToDo=attributes;
nextMsg++;
continue;
}
// Pick next attributes to synthesize
if (attributesToDo & mail::accoun... | false | false | false | false | false | 0 |
mxl5005s_init(struct dvb_frontend *fe)
{
struct mxl5005s_state *state = fe->tuner_priv;
dprintk(1, "%s()\n", __func__);
state->current_mode = MXL_QAM;
return mxl5005s_reconfigure(fe, MXL_QAM, MXL5005S_BANDWIDTH_6MHZ);
} | false | false | false | false | false | 0 |
mt2060_sleep(struct dvb_frontend *fe)
{
struct mt2060_priv *priv = fe->tuner_priv;
int ret;
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1); /* open i2c_gate */
ret = mt2060_writereg(priv, REG_VGAG,
(priv->cfg->clock_out << 6) | 0x30);
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0)... | false | false | false | false | false | 0 |
__ecereMethod_CodeEditor_ReAttachMethod(struct __ecereNameSpace__ecere__com__Instance * this, struct __ecereNameSpace__ecere__com__Method * method, struct ClassFunction * function)
{
struct CodeEditor * __ecerePointer_CodeEditor = (struct CodeEditor *)(this ? (((char *)this) + __ecereClass_CodeEditor->offset) : 0);
if... | true | true | false | true | true | 1 |
dragon_level_gain(object *who) {
object *abil = NULL; /* pointer to dragon ability force*/
object *skin = NULL; /* pointer to dragon skin force*/
/* now grab the 'dragon_ability'-forces from the player's inventory */
abil = object_find_by_type_and_arch_name(who, FORCE, "dragon_ability_force");
... | false | false | false | false | false | 0 |
authority_cert_dl_looks_uncertain(const char *id_digest)
{
#define N_AUTH_CERT_DL_FAILURES_TO_BUG_USER 2
cert_list_t *cl;
int n_failures;
if (!trusted_dir_certs ||
!(cl = digestmap_get(trusted_dir_certs, id_digest)))
return 0;
n_failures = download_status_get_n_failures(&cl->dl_status);
return n_fa... | false | false | false | false | false | 0 |
pdf_dict_finds(pdf_obj *obj, const char *key, int *location)
{
if (obj->u.d.sorted && obj->u.d.len > 0)
{
int l = 0;
int r = obj->u.d.len - 1;
if (strcmp(pdf_to_name(obj->u.d.items[r].k), key) < 0)
{
if (location)
*location = r + 1;
return -1;
}
while (l <= r)
{
int m = (l + r) >> 1;
i... | false | false | false | false | false | 0 |
get ( std::istream & is ) {
std::string inName;
is >> inName;
if (inName != name()) {
is.clear(std::ios::badbit | is.rdstate());
std::cerr << "Mismatch when expecting to read state of a "
<< name() << " distribution\n"
<< "Name found was " << inName
<< "\nistream is left in the ba... | 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.