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 |
|---|---|---|---|---|---|---|
acpi_ec_complete_request(struct acpi_ec *ec)
{
bool flushed = false;
ec->reference_count--;
if (ec->reference_count == 0)
acpi_ec_disable_gpe(ec, true);
flushed = acpi_ec_flushed(ec);
if (flushed)
wake_up(&ec->wait);
} | false | false | false | false | false | 0 |
read_pvd ()
{
iso9660_pvd_t pvd;
bool b_okay = iso9660_fs_read_pvd (p_cdio, &pvd);
if (b_okay) {
return new PVD(&pvd);
}
return (PVD *) NULL;
} | false | false | false | false | false | 0 |
get_tile_info_A(int tile_index)
{
int attr = k007121_ram[tile_index];
int code = k007121_ram[tile_index+0x400];
int bit0 = (K007121_ctrlram[0][0x05] >> 0) & 0x03;
int bit1 = (K007121_ctrlram[0][0x05] >> 2) & 0x03;
int bit2 = (K007121_ctrlram[0][0x05] >> 4) & 0x03;
int bit3 = (K007121_ctrlram[0][0x05] >> 6)... | false | false | false | false | false | 0 |
hdrl_image_get_pixel(const hdrl_image * self,
cpl_size xpos, cpl_size ypos,
double * error, int * pis_rejected)
{
int d;
double v = cpl_image_get(self->image, xpos, ypos, &d);
/* NULL allowed, different than CPL */
if (pis_rejected) {
*pis... | false | false | false | false | false | 0 |
move(int l, int m)
{
register wchar_t *cp, *dp;
for (cp = page[l], dp = page[m]; *cp; cp++, dp++) {
switch (*cp) {
case '|':
if (*dp != ' ' && *dp != '|' && *dp != 0)
return;
break;
case ' ':
break;
default:
return;
}
}
if (*cp == 0) {
for (cp = page[l], dp = page[m]; *cp; cp++,... | false | false | false | false | false | 0 |
fgetword(wp, fd)
u_short *wp;
int fd;
{
CONST u_char *cp;
u_char buf[2];
if (fd >= 0) {
if (sureread(fd, buf, sizeof(buf)) != sizeof(buf)) return(-1);
cp = buf;
}
else {
cp = &(dicttblbuf[dictofs]);
dictofs += 2;
}
*wp = getword(cp, 0);
return(0);
} | false | false | false | false | false | 0 |
text(char *txt,int len,int x,int y,int w,int h,int align)
{
PangoLayout *ly;
if (!txt || !len) return;
ly = pango_layout_new(ft->ct);
pango_layout_set_text(ly, txt, len);
drawLayout(ly, false, x, y, w, h, align);
} | false | false | false | false | false | 0 |
litter(void)
{
struct obj *otmp = invent, *nextobj;
int capacity = weight_cap();
while (otmp)
{
nextobj = otmp->nobj;
if ((otmp != uball) && (rnd(capacity) <= (int)otmp->owt))
{
if (canletgo(otmp, ""))
{
Your("%s you down the stairs.",
... | false | false | false | false | false | 0 |
wi_fs_directory_contents_at_path(wi_string_t *path) {
wi_mutable_array_t *contents;
wi_string_t *name;
DIR *dir;
struct dirent *de, *dep;
dir = opendir(wi_string_cstring(path));
if(!dir) {
wi_error_set_errno(errno);
return NULL;
}
contents = wi_array_init_with_capacity(wi_mutable_array_a... | false | false | false | false | false | 0 |
v27ter_tx_init(v27ter_tx_state_t *s, int bit_rate, int tep, get_bit_func_t get_bit, void *user_data)
{
if (s == NULL)
{
if ((s = (v27ter_tx_state_t *) malloc(sizeof(*s))) == NULL)
return NULL;
}
memset(s, 0, sizeof(*s));
span_log_init(&s->logging, SPAN_LOG_NONE, NULL);
span_l... | false | false | false | false | false | 0 |
wireless_dialog_prepare (GstConnectionDialog *dialog)
{
gchar *essid, *key, *dev, *key_type;
g_object_get (G_OBJECT (dialog->iface),
"device", &dev,
"essid", &essid,
"key", &key,
"key-type", &key_type,
NULL);
connection_combo_set_value (GTK_COMBO_BOX (dialog->key_type_combo), key_type);
gtk_entry_se... | false | false | false | false | false | 0 |
cdv_hdmi_set_property(struct drm_connector *connector,
struct drm_property *property,
uint64_t value)
{
struct drm_encoder *encoder = connector->encoder;
if (!strcmp(property->name, "scaling mode") && encoder) {
struct gma_crtc *crtc = to_gma_crtc(encoder->crtc);
bool centre;
uint64_t cur... | false | false | false | false | false | 0 |
adam(jugglestruct *sp)
{
Trajectory *t, *p;
for(t = sp->head->next; t != sp->head; t = t->next) {
if (t->status == ATCH) {
int a = t->adam;
t->height = 0;
for(p = t->next; a > 0; p = p->next) {
if(p == sp->head) {
t->height = -9; /* Indicate end of processing for name() */
return;
}
if (p->s... | false | false | false | false | false | 0 |
add(CharCodeToUnicode *ctu) {
int i;
if (cache[size - 1]) {
cache[size - 1]->decRefCnt();
}
for (i = size - 1; i >= 1; --i) {
cache[i] = cache[i - 1];
}
cache[0] = ctu;
ctu->incRefCnt();
} | false | false | false | false | false | 0 |
generic_crc(int algo, int position, const uint8_t *data_src)
{
switch(algo)
{
case ALGO_AWARD:
brute_award(get32(position,data_src));
break;
case ALGO_TOSHIBA:
brute_toshiba(get32(position,data_src));
break;
}
} | false | false | false | false | false | 0 |
Struct_init(PyObject *self, PyObject *args, PyObject *kwds)
{
/* Optimization possible: Store the attribute names _fields_[x][0]
* in C accessible fields somewhere ?
*/
if (!PyTuple_Check(args)) {
PyErr_SetString(PyExc_TypeError,
"args not a tuple?");
return -1;
}
i... | false | false | false | false | false | 0 |
HandleDebugSetAuraStateCommand(char* args)
{
int32 state;
if (!ExtractInt32(&args, state))
{ return false; }
Unit* unit = getSelectedUnit();
if (!unit)
{
SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
SetSentErrorMessage(true);
return false;
}
if (!state)
... | false | false | false | false | false | 0 |
gflog_syslog_name_to_priority(const char *name)
{
int i;
struct {
char *name;
int priority;
} syslog_priorities[] = {
{ "emerg", LOG_EMERG },
{ "alert", LOG_ALERT },
{ "crit", LOG_CRIT },
{ "err", LOG_ERR },
{ "warning", LOG_WARNING },
{ "notice", LOG_NOTICE },
{ "info", LOG_INFO },
{ "debug", LO... | false | false | false | false | false | 0 |
perform_update(char ** args)
{
char **ap = args, *arg = *ap;
if (!arg)
return;
if (!strchr(arg, '=')) {
int cnt;
for (cnt = 0; cnt < sizeof(actlist)/sizeof(struct actop); cnt++) {
if (ncstrcmp(actlist[cnt].name, arg) == 0) {
for (ap++; (arg = *ap); ap++)
apply_action(&actlist[cnt], a... | false | false | false | false | false | 0 |
HandleGuildQueryOpcode(WorldPacket& recvPacket)
{
DEBUG_LOG("WORLD: Received opcode CMSG_GUILD_QUERY");
uint32 guildId;
recvPacket >> guildId;
if (Guild* guild = sGuildMgr.GetGuildById(guildId))
{
guild->Query(this);
return;
}
SendGuildCommandResult(GUILD_CREATE_S, "", ERR... | false | false | false | false | false | 0 |
SetForegroundColour(const wxColour& foreColour)
{
wxCHECK_RET(m_refData, wxT("wxSheetCellAttr not initializied"));
M_CELLATTRDATA->m_foreColour = foreColour;
} | false | false | false | false | false | 0 |
PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
os << indent << "Number of Points Per Bucket: " << this->NumberOfPointsPerBucket << "\n";
os << indent << "Divisions: (" << this->Divisions[0] << ", "
<< this->Divisions[1] << ", " << this->Divisions[2] << ")\n";
if ( this... | false | false | false | false | false | 0 |
short_to_float(short *short_buf, SAMPLE *float_buf, int n)
/* effects; Converts short_buf to floats and stores them in float_buf.
*/
{
while (n--) {
*float_buf++ = (SAMPLE)*short_buf++;
}
} | false | false | false | false | false | 0 |
butRadio_set(But *but, int val, bool propagate) {
Radio *radio = but->iPacket;
assert(but->action == &action);
assert(MAGIC(but));
if (radio->val != val) {
redrawOpt(but, radio, val);
redrawOpt(but, radio, radio->val);
radio->val = val;
but_draw(but);
if (propagate && (radio->press != NU... | false | false | false | false | false | 0 |
dump(ostream&o) const
{
if (has_sign())
o << "+";
o << name();
if (word_) o << "[word=" << *word_ << "]";
o << "[" << msi()<<":"<<lsi() << "]";
} | false | false | false | false | false | 0 |
cmsLinkTag(cmsHPROFILE hProfile, cmsTagSignature sig, cmsTagSignature dest)
{
_cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile;
int i;
if (!_cmsLockMutex(Icc->ContextID, Icc ->UsrMutex)) return FALSE;
if (!_cmsNewTag(Icc, sig, &i)) {
_cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex);
re... | false | false | false | false | false | 0 |
countDigits( quint64 n )
{
if (n == 0)
return 1;
// We must force the compiler to not store intermediate results
// in registers because this causes incorrect result on some
// systems under optimizations level >0. For the skeptical:
//
// #include <math.h>
// #include <stdlib.h>
... | false | false | false | false | false | 0 |
build_ivar_reference (tree id)
{
tree base;
if (TREE_CODE (objc_method_context) == CLASS_METHOD_DECL)
{
/* Historically, a class method that produced objects (factory
method) would assign `self' to the instance that it
allocated. This would effectively turn the class method into
an instance method.... | false | false | false | false | false | 0 |
notebook_get_parent_window() {
if (!notebook) {
return NULL;
}
return GTK_WINDOW(gtk_widget_get_toplevel(notebook));
} | false | false | false | false | false | 0 |
read_tiles()
{
int ntiles, score, i;
float tile;
FILE *fstn;
char fname[FNAMELEN], line[MAXLINE];
ntiles = 0;
/* Look in current directory first */
fstn=fopen("blksort.stn", "r");
if (fstn == NULL)
{
sprintf(fname, "%sblksort.stn", DatDir);
fstn=fopen(fname, "r");
}
if ... | false | false | false | false | false | 0 |
rtw_hal_inirp_init(struct adapter *adapt)
{
u32 rst = _FAIL;
if (adapt->HalFunc.inirp_init)
rst = adapt->HalFunc.inirp_init(adapt);
else
DBG_88E(" %s HalFunc.inirp_init is NULL!!!\n", __func__);
return rst;
} | false | false | false | false | false | 0 |
post_set_busy(PostContext *context)
{
PostWidgets *w = context->widgets;
if (context->busy) {
fputs("knews: internal error: post context already busy.\n", stderr);
return;
}
context->busy = True;
if (!w)
return;
XDefineCursor(display, XtWindow(w->shell), global.busy_cursor);
KnappSetAc... | false | false | false | false | false | 0 |
_create_album_cb (RestProxyCall *call,
const GError *error,
GObject *weak_object,
gpointer user_data)
{
DBusGMethodInvocation *context = (DBusGMethodInvocation *) user_data;
GError *err = NULL;
JsonNode *node;
JsonObject *obj;
gchar *id;
no... | false | false | false | false | false | 0 |
DebugFsm(GrcManager * pcman, std::ostream & strmOut)
{
GdlRuleTable * prultbl;
if ((prultbl = FindRuleTable("linebreak")) != NULL)
prultbl->DebugFsm(pcman, strmOut);
if ((prultbl = FindRuleTable("substitution")) != NULL)
prultbl->DebugFsm(pcman, strmOut);
if (m_iPassBidi > -1)
strmOut << "\nPASS " << m_iPa... | false | false | false | false | false | 0 |
__ecereDestructor_CompilerToolchainTab(struct __ecereNameSpace__ecere__com__Instance * this)
{
struct CompilerToolchainTab * __ecerePointer_CompilerToolchainTab = (struct CompilerToolchainTab *)(this ? (((char *)this) + __ecereClass_CompilerToolchainTab->offset) : 0);
(__ecereNameSpace__ecere__com__eInstance_DecRef(__... | false | false | false | true | false | 1 |
function_test_events_call(unsigned long ip, unsigned long parent_ip,
struct ftrace_ops *op, struct pt_regs *pt_regs)
{
struct ring_buffer_event *event;
struct ring_buffer *buffer;
struct ftrace_entry *entry;
unsigned long flags;
long disabled;
int cpu;
int pc;
pc = preempt_count();
preempt_disable_notrac... | false | false | false | false | false | 0 |
failureMessage( const std::string & solverName,
const std::string & message )
{
std::string messageText;
messageText = "*** ";
messageText += solverName + "SolverInterface testing issue: ";
messageText += message;
// flush stdout so that error messages are properly interleaved.
... | false | false | false | false | false | 0 |
imProcessEqualizeHistogram(const imImage* src_image, imImage* dst_image)
{
int hcount;
unsigned long* histo = imHistogramNew(src_image->data_type, &hcount);
imCalcHistogram(src_image, histo, 0, 1); // cumulative
if (src_image->data_type == IM_USHORT)
DoEqualizeHistogram((imushort*)src_image->data[0], (imu... | false | false | false | false | false | 0 |
gt_gth(int argc, const char **argv, const GthPlugins *plugins, GtError *err)
{
GthCallInfo *call_info;
GthInput *input;
GthStat *stat;
int parsed_args, had_err = 0;
gt_error_check(err);
gt_assert(plugins && plugins->file_preprocessor && plugins->seq_con_new);
gt_assert(plugins->gth_version_func);
/* i... | false | false | false | false | false | 0 |
count3_4_5_6_7_8_9_10_11(const Word16 *values,
const Word16 width,
Word16 *bitCount)
{
Word32 t0,t1,t2,t3, i;
Word32 bc3_4,bc5_6,bc7_8,bc9_10;
Word16 bc11,sc;
bc3_4=0;
bc5_6=0;
bc7_8=0;
bc9_10=0;
bc11=0;
sc=0;
for(i=0... | false | false | false | false | false | 0 |
condvar_create(condvar_type_t type)
{
switch (type)
{
case CONDVAR_TYPE_DEFAULT:
default:
{
private_condvar_t *this;
INIT(this,
.public = {
.wait = (void*)_wait_,
.timed_wait = (void*)_timed_wait,
.timed_wait_abs = (void*)_timed_wait_abs,
.signal = _signal_,
.broadcast = _bro... | false | false | false | false | false | 0 |
chipreset(hfc4s8s_hw *hw)
{
u_long flags;
spin_lock_irqsave(&hw->lock, flags);
Write_hfc8(hw, R_CTRL, 0); /* use internal RAM */
Write_hfc8(hw, R_RAM_MISC, 0); /* 32k*8 RAM */
Write_hfc8(hw, R_FIFO_MD, 0); /* fifo mode 386 byte/fifo simple mode */
Write_hfc8(hw, R_CIRM, M_SRES); /* reset chip */
hw->mr.r_irq_ct... | false | false | false | false | false | 0 |
sched(void)
{
char *flags;
Job *j;
Bufblock *buf;
int slot;
Node *n;
Envy *e;
if(jobs == 0){
usage();
return;
}
j = jobs;
jobs = j->next;
if(DEBUG(D_EXEC))
fprint(1, "firing up job for target %s\n", wtos(j->t, ' '));
slot = nextslot();
events[slot].job = j;
buf = newbuf();
e = buildenv(j, slot);
... | false | false | false | false | false | 0 |
sendScoreGetScores(uint32_t owner, const plString& gameName)
{
const pnNetMsg* desc = GET_Cli2Auth(kCli2Auth_ScoreGetScores);
msgparm_t* msg = NCAllocMessage(desc);
uint32_t transId = nextTransId();
msg[0].fUint = transId;
msg[1].fUint = owner;
msg[2].fString = plwcsdup(gameName.wstr());
fSo... | false | false | false | false | false | 0 |
on_menu_about()
{
static Gtk::AboutDialog* about(0);
if(about == 0){
std::vector<Glib::ustring> authors;
authors.push_back("lerosua@gmail.com ");
authors.push_back("wind(xihels@gmail.com)");
about = new Gtk::AboutDialog ;
about->set_logo(ui_logo);
if(GTKMM_MAJOR_VERSION==2 && GTKMM_MINOR_VERSION>=12)
... | false | false | false | false | false | 0 |
build_launch_job_msg(struct job_record *job_ptr)
{
batch_job_launch_msg_t *launch_msg_ptr;
/* Initialization of data structures */
launch_msg_ptr = (batch_job_launch_msg_t *)
xmalloc(sizeof(batch_job_launch_msg_t));
launch_msg_ptr->job_id = job_ptr->job_id;
launch_msg_ptr->step_id = NO_VAL;
launch_msg_ptr->u... | false | false | false | false | false | 0 |
route_starving_check(const guid_t *guid)
{
route_starving_cb_t cb;
cb = cast_pointer_to_func(htable_lookup(ht_starving_guid, guid));
if (cb != NULL)
(*cb)(guid);
} | false | false | false | false | false | 0 |
skein_256_final_pad(struct skein_256_ctx *ctx, u8 *hash_val)
{
/* catch uninitialized context */
skein_assert_ret(ctx->h.b_cnt <= SKEIN_256_BLOCK_BYTES, SKEIN_FAIL);
/* tag as the final block */
ctx->h.tweak[1] |= SKEIN_T1_FLAG_FINAL;
/* zero pad b[] if necessary */
if (ctx->h.b_cnt < SKEIN_256_BLOCK_BYTES)
me... | false | false | false | false | false | 0 |
hitori_draw_cb (GtkWidget *drawing_area, cairo_t *cr, Hitori *hitori)
{
gint area_width, area_height;
HitoriVector iter;
guint board_width, board_height;
gfloat cell_size;
gdouble x_pos, y_pos;
GtkStyleContext *style_context;
area_width = gdk_window_get_width (gtk_widget_get_window (hitori->drawing_area));
are... | false | false | false | false | false | 0 |
is_rename_source(
git_diff_list *diff,
const git_diff_find_options *opts,
size_t delta_idx,
void **cache)
{
git_diff_delta *delta = GIT_VECTOR_GET(&diff->deltas, delta_idx);
/* skip things that aren't blobs */
if (!GIT_MODE_ISBLOB(delta->old_file.mode))
return false;
switch (delta->status) {
case GIT_DELTA... | false | false | false | false | false | 0 |
result_item_get_current_sort(result_item_t * item, poldiff_form_e form, results_sort_e * sort, results_sort_dir_e * dir)
{
if (item->set_current_sort == NULL || form == POLDIFF_FORM_NONE) {
return 0;
}
*sort = item->sorts[form_reverse_map[form]];
*dir = item->sort_dirs[form_reverse_map[form]];
return 1;
} | false | false | false | false | false | 0 |
print_stack_frame_to_string (StackFrameInfo *frame, MonoContext *ctx, gpointer data)
{
GString *p = (GString*)data;
MonoMethod *method = NULL;
if (frame->ji)
method = jinfo_get_method (frame->ji);
if (method) {
gchar *location = mono_debug_print_stack_frame (method, frame->native_offset, mono_domain_get ());
... | false | false | false | false | false | 0 |
divided_block_depend_seq_loop(Block *block_head)
{
Block *bpt, *bp, *b;
int loopno = -1;
for (bpt = block_head; bpt != NULL; bpt = bpt->next) {
if (block_has_tlg_tag(bpt) && !empty_IntSet(bpt->pred)) {
for (bp = bpt->prev; bp != NULL; bp = bp->prev) {
if (block_has_tlg_t... | false | false | false | false | false | 0 |
str_tr_compile_table(StringTR *table, const String *from, const String *to, int option)
{
StringTR *ret;
int err;
if ((err = str_rdlock(from)))
return set_errnull(err);
if ((err = str_rdlock(to)))
{
str_unlock(from);
return set_errnull(err);
}
ret = str_tr_compile_table_unlocked(table, from, to, option)... | false | false | false | false | false | 0 |
getCatalog(QList<CatItem>* items)
{
foreach(runnerCmd cmd, cmds)
{
items->push_back(CatItem(cmd.file + "%%%" + cmd.args, cmd.name, HASH_runner, getIcon(cmd.file)));
}
} | false | false | false | false | false | 0 |
on_bus_connected (GObject *source,
GAsyncResult *result,
gpointer user_data)
{
GSimpleAsyncResult *res = G_SIMPLE_ASYNC_RESULT (user_data);
GcrSystemPrompt *self = GCR_SYSTEM_PROMPT (g_async_result_get_source_object (user_data));
CallClosure *closure = g_simple_async_result_get_op... | false | false | false | false | false | 0 |
cmsNamedColorInfo(const cmsNAMEDCOLORLIST* NamedColorList, cmsUInt32Number nColor,
char* Name,
char* Prefix,
char* Suffix,
cmsUInt16Number* PCS,
... | false | false | false | false | false | 0 |
untrack_pfn(struct vm_area_struct *vma, unsigned long pfn,
unsigned long size)
{
resource_size_t paddr;
unsigned long prot;
if (!(vma->vm_flags & VM_PAT))
return;
/* free the chunk starting from pfn or the whole chunk */
paddr = (resource_size_t)pfn << PAGE_SHIFT;
if (!paddr && !size) {
if (follow_phys(v... | false | false | false | false | false | 0 |
storableData() const
{
QSpinBox *spin = qobject_cast<QSpinBox*>(m_Spin->m_Spin);
if (spin) {
return spin->value();
}
QDoubleSpinBox *dspin = qobject_cast<QDoubleSpinBox*>(m_Spin->m_Spin);
if (dspin) {
return dspin->value();
}
return QVariant();
} | false | false | false | false | false | 0 |
fill_words (struct state *st)
{
char *p = st->words + strlen(st->words);
while (p < st->words + sizeof(st->words) - 1 &&
st->lines < MAXLINES)
{
int c = textclient_getc (st->tc);
if (c == '\n')
st->lines++;
if (c > 0)
*p++ = (char) c;
else
break;
}
... | false | false | false | false | false | 0 |
setPixelLow(l_uint32 *line,
l_int32 x,
l_int32 depth,
l_uint32 val)
{
switch (depth)
{
case 1:
if (val)
SET_DATA_BIT(line, x);
else
CLEAR_DATA_BIT(line, x);
break;
case 2:
SET_DATA_DIBIT(line, x, val);
... | false | false | false | false | false | 0 |
load_old_file (char *fname)
{
FILE *f;
GtkTreeIter parent;
GtkTreeIter iter;
gtk_tree_model_get_iter_first (mm_model, &parent);
f = fopen (fname, "r");
if (f)
{
int depth = 0;
for (;;)
{
char *id = read_line (f);
if (!id)
break;
if (!strncmp (id, "<sub>", 5))
... | false | false | false | false | true | 1 |
operator=(const If& anOther)
{
if (this != &anOther)
{
Element::operator=(*this);
Expr.erase(Expr.begin(), Expr.end());
for (unsigned int i=0; i<anOther.Expr.size(); ++i)
Expr.push_back(anOther.Expr[i]->copy());
for (unsigned int j=0; j<anOther.Seq.size(); ++j)
Seq.push_back(dynamic_cast<Sequence*>(anOt... | false | false | false | false | false | 0 |
out_activity(struct stream *stream, char *x, ssize_t bytes)
{
ssize_t chunk = stream->bytes - stream->writ;
if (chunk <= 0)
return 0;
do {
errno = 0;
bytes = write(stream->fd, stream->data + stream->writ,
chunk);
} while (bytes < 0 && (errno == EAGAIN || errno == EINTR));
if (bytes < 0 && (errno =... | false | false | false | false | false | 0 |
CreateTemplateSubdict(
const TemplateString& name,
UnsafeArena* arena,
TemplateDictionary* parent_dict,
TemplateDictionary* template_global_dict_owner) {
void* buffer = arena->AllocAligned(sizeof(TemplateDictionary),
BaseArena::kDefaultAlignment);
// Placement ne... | false | false | false | false | false | 0 |
NormaliseComplexity( EncQueue& my_buffer, int pnum )
{
EncPicture& my_picture = my_buffer.GetPicture( pnum );
if ( (my_picture.GetStatus()&DONE_PIC_COMPLEXITY) != 0 ){
std::vector<int> queue_members = my_buffer.Members();
double mean_complexity = 0.0;
int count = 0;
for (size_t i... | false | false | false | false | false | 0 |
_memory_add (GstBuffer * buffer, gint idx, GstMemory * mem, gboolean lock)
{
guint i, len = GST_BUFFER_MEM_LEN (buffer);
GST_CAT_LOG (GST_CAT_BUFFER, "buffer %p, idx %d, mem %p, lock %d", buffer,
idx, mem, lock);
if (G_UNLIKELY (len >= GST_BUFFER_MEM_MAX)) {
/* too many buffer, span them. */
/* FI... | false | false | false | false | false | 0 |
issue_calls (Sess *sess, Sess_Private_Data *priv)
{
int i, to_create, retval, embedded = 0;
Call_Private_Data *cpriv;
struct uri_list *el;
Call *call;
/* Mimic browser behavior of fetching html object, then a couple of
embedded objects: */
to_create = 1;
if (priv->num_created > 0)
{
to_cr... | false | false | false | false | false | 0 |
finish_agent_init (gboolean on_startup)
{
int res;
if (InterlockedCompareExchange (&inited, 1, 0) == 1)
return;
if (agent_config.launch) {
char *argv [16];
// FIXME: Generated address
// FIXME: Races with transport_connect ()
argv [0] = agent_config.launch;
argv [1] = agent_config.transport;
argv [... | false | false | false | false | false | 0 |
send_turn_done(void)
{
log_debug("send_turn_done() turn_done_button_state=%d",
get_turn_done_button_state());
if (!get_turn_done_button_state()) {
/*
* The turn done button is disabled but the user may have press
* the return key.
*/
if (agents_busy()) {
waiting_for_end_tu... | false | false | false | false | false | 0 |
FreeImage_ZLibCompress(BYTE *target, DWORD target_size, BYTE *source, DWORD source_size) {
uLongf dest_len = (uLongf)target_size;
int zerr = compress(target, &dest_len, source, source_size);
switch(zerr) {
case Z_MEM_ERROR: // not enough memory
case Z_BUF_ERROR: // not enough room in the output buffer
FreeIm... | false | false | false | false | false | 0 |
nfs3_call_state_init (struct nfs3_state *s, rpcsvc_request_t *req, xlator_t *v)
{
nfs3_call_state_t *cs = NULL;
GF_VALIDATE_OR_GOTO (GF_NFS3, s, err);
GF_VALIDATE_OR_GOTO (GF_NFS3, req, err);
GF_VALIDATE_OR_GOTO (GF_NFS3, v, err);
cs = (nfs3_call_state_t *) mem_get (s->lo... | false | false | false | false | false | 0 |
OnUp(cb_unused wxCommandEvent& event)
{
wxListBox* list = XRCCTRL(*this, "lstTools", wxListBox);
int sel = list->GetSelection();
cbTool tool(*(Manager::Get()->GetToolsManager()->GetToolByIndex(sel)));
Manager::Get()->GetToolsManager()->RemoveToolByIndex(sel);
Manager::Get()->GetToolsManager()->Inse... | false | false | false | false | false | 0 |
addLayer(DL_CreationInterface* creationInterface) {
// correct some impossible attributes for layers:
attrib = creationInterface->getAttributes();
if (attrib.getColor()==256 || attrib.getColor()==0) {
attrib.setColor(7);
}
if (attrib.getWidth()<0) {
attrib.setWidth(1);
}
if (... | false | false | false | false | false | 0 |
hitItem(FXint index,FXint x,FXint y) const {
FXint ix,iy,hit=0;
if(0<=index && index<items.no()){
x-=pos_x;
y-=pos_y;
ix=items[index]->x;
iy=items[index]->y;
hit=items[index]->hitItem(this,x-ix,y-iy);
}
return hit;
} | false | false | false | false | false | 0 |
get_double_from_editable(GtkWidget *widget, double *v)
{
char *endp;
double val;
char *text;
text = gtk_editable_get_chars(GTK_EDITABLE(widget), 0, -1);
val = strtod(text, &endp);
if (endp == text) {
g_free(text);
return -1;
} else {
g_free(text);
*v = val;
return 0;
}
} | false | false | false | false | false | 0 |
searchEnded()
{
if( m_runningSearches > 0 ) // just to be sure...
m_runningSearches--;
// stop the animation
if( m_runningSearches == 0 )
{
m_animationTimer.stop();
saveLineEditStatus();
m_sw->setItemIcon( m_sw->currentIndex(), KStandardGuiItem::find().icon() );
... | false | false | false | false | false | 0 |
set_button_pixmap(GtkToggleButton *button, const char **pixmap)
{
GdkPixmap *gdkpixmap = 0;
GdkBitmap *mask = 0;
GtkWidget *gtkpixmap = 0;
static GtkWidget *widget = 0;
if (!widget)
{
widget = widget_get_toplevel_parent(GTK_WIDGET(button));
}
if (widget)
{
gdkpixm... | false | false | false | false | false | 0 |
uncacheParents () {
Graphic* p = Parent();
if (p != nil) {
p->uncacheExtent();
p->uncacheParents();
}
} | false | false | false | false | false | 0 |
ecryptfs_lookup_interpose(struct dentry *dentry,
struct dentry *lower_dentry,
struct inode *dir_inode)
{
struct inode *inode, *lower_inode = d_inode(lower_dentry);
struct ecryptfs_dentry_info *dentry_info;
struct vfsmount *lower_mnt;
int rc = 0;
dentry_info = kmem_cache_alloc(ecryptfs_dentry_inf... | false | false | false | false | false | 0 |
pgarch_ArchiverCopyLoop(void)
{
char xlog[MAX_XFN_CHARS + 1];
/*
* loop through all xlogs with archive_status of .ready and archive
* them...mostly we expect this to be a single file, though it is possible
* some backend will add files onto the list of those that need archiving
* while we are still copying ... | false | false | false | false | false | 0 |
make_request(krb5_context ctx, krb5_otp_tokeninfo *ti, const krb5_data *value,
const krb5_data *pin, krb5_pa_otp_req **out_req)
{
krb5_pa_otp_req *req = NULL;
krb5_error_code retval = 0;
if (ti == NULL)
return 0;
if (ti->format == KRB5_OTP_FORMAT_BASE64)
return ENOTSUP;
... | false | false | false | false | false | 0 |
set_max_undo_steps(int new_max_steps)
{
int ix;
struct undo_frame** realloced_undo_frames;
/* Free any existing frames beyond the new limit */
if (undo_index > new_max_steps)
{
for (ix=new_max_steps; ix<undo_index; ix++)
delete_undo_frame(undo_frames[ix]);
undo_index = new_max_steps;
}
i... | false | false | false | true | false | 1 |
esl_abc_CreateDsq(const ESL_ALPHABET *a, const char *seq, ESL_DSQ **ret_dsq)
{
ESL_DSQ *dsq = NULL;
int status;
int64_t L;
L = strlen(seq);
ESL_ALLOC(dsq, sizeof(ESL_DSQ) * (L+2));
status = esl_abc_Digitize(a, seq, dsq);
if (ret_dsq != NULL) *ret_dsq = dsq; else free(dsq);
return status;
ERROR... | false | true | false | false | false | 1 |
macro_removevar(struct substvar *table, const char *str, int len)
{
struct substvar *list, *lv;
struct substvar *last = NULL;
lv = list = table;
while (lv) {
if (!strncmp(str, lv->def, len) && lv->def[len] == '\0')
break;
last = lv;
lv = lv->next;
}
if (lv) {
if (last)
last->next = lv->next;
el... | false | false | false | false | false | 0 |
nfs40_discover_server_trunking(struct nfs_client *clp,
struct nfs_client **result,
struct rpc_cred *cred)
{
struct nfs4_setclientid_res clid = {
.clientid = clp->cl_clientid,
.confirm = clp->cl_confirm,
};
struct nfs_net *nn = net_generic(clp->cl_net, nfs_net_id);
unsigned short port;
int status;... | false | false | false | false | false | 0 |
write_ifiction_pcdata(synthctx *ctx, const char *p, size_t len)
{
/* first, skip any leading whitespace */
for ( ; len != 0 && u_ishspace(*p) ; ++p, --len) ;
/* keep going until we run out of string */
for (;;)
{
const char *start;
/* scan to the next whitespace o... | false | false | false | false | false | 0 |
globus_i_gram_symbol_table_populate(
globus_gram_job_manager_config_t * config,
globus_symboltable_t * symbol_table)
{
int rc = GLOBUS_SUCCESS;
int i;
struct { char * symbol; char *value; } symbols[] =
{
{ "HOM... | false | false | false | false | false | 0 |
gnome_scan_plugin_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
g_return_if_fail (GNOME_IS_SCAN_PLUGIN (object));
switch (prop_id)
{
case PROP_NAME:
GET_PRIVATE (object)->name = g_value_dup_string (value);
break;
case PROP_BLURB:
GET_PRIVATE (object)->blurb = ... | false | false | false | false | false | 0 |
Read(const char *filename) {
char buf[4];
unsigned char *ubuf = (unsigned char *) buf;
int success = 0;
FILE *file;
file = fopen(filename, "rb");
if (file == NULL)
return(false);
/* see what kind of file we have */
fread(buf, 1, 4, file);
fclose(file);
if ((ubuf[0] ==... | false | false | false | false | false | 0 |
Scale_db_to_scale(ScaleObject *self, PyObject *args)
{
double db;
if (! PyArg_ParseTuple(args, "d", &db)) return NULL;
return PyFloat_FromDouble(scale_db_to_scale(self->scale, db));
} | false | false | false | false | false | 0 |
bfa_fcpim_lunmask_query(struct bfa_s *bfa, void *buf)
{
struct bfa_lunmask_cfg_s *lun_mask;
bfa_trc(bfa, bfa_get_lun_mask_status(bfa));
if (bfa_get_lun_mask_status(bfa) == BFA_LUNMASK_MINCFG)
return BFA_STATUS_FAILED;
lun_mask = bfa_get_lun_mask(bfa);
memcpy(buf, lun_mask, sizeof(struct bfa_lunmask_cfg_s));
r... | false | false | false | false | false | 0 |
remove_free_dqentry(struct qtree_mem_dqinfo *info, char *buf,
uint blk)
{
char *tmpbuf = getdqbuf(info->dqi_usable_bs);
struct qt_disk_dqdbheader *dh = (struct qt_disk_dqdbheader *)buf;
uint nextblk = le32_to_cpu(dh->dqdh_next_free);
uint prevblk = le32_to_cpu(dh->dqdh_prev_free);
int err;
if (!tmpbuf)... | false | false | false | false | false | 0 |
output_wkb_polygon_ring_collection(uchar* geom,outwkbfunc func)
{
uchar *temp;
int dimcount;
double first_point[dims];
double last_point[dims];
int cnt = read_int(&geom);
int orig_cnt = cnt;
LWDEBUGF(2, "output_wkb_polygon_ring_collection: %d iterations loop", cnt);
write_wkb_int(cnt);
/* Store the first p... | false | false | false | false | false | 0 |
bfs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
bool excl)
{
int err;
struct inode *inode;
struct super_block *s = dir->i_sb;
struct bfs_sb_info *info = BFS_SB(s);
unsigned long ino;
inode = new_inode(s);
if (!inode)
return -ENOMEM;
mutex_lock(&info->bfs_lock);
ino = find_first_zero... | false | false | false | false | false | 0 |
php_stream_apply_filter_list(php_stream *stream, char *filterlist, int read_chain, int write_chain TSRMLS_DC) /* {{{ */
{
char *p, *token;
php_stream_filter *temp_filter;
p = php_strtok_r(filterlist, "|", &token);
while (p) {
php_url_decode(p, strlen(p));
if (read_chain) {
if ((temp_filter = php_stream_filt... | false | false | false | false | false | 0 |
agclean(Agraph_t * g, int kind, char *rec_name)
{
Agnode_t *n;
Agedge_t *e;
switch (kind) {
case AGRAPH:
agapply(g, (Agobj_t *) g, simple_delrec, rec_name, TRUE);
break;
case AGNODE:
case AGOUTEDGE:
case AGINEDGE:
for (n = agfstnode(g); n; n = agnxtnode(g, n))
if (kind == AGNODE)
... | false | false | false | false | false | 0 |
s5bServer ()
{
if ( !d->s5bServer )
{
d->s5bServer = new XMPP::S5BServer ();
QObject::connect ( d->s5bServer, SIGNAL (destroyed()), this, SLOT (slotS5BServerGone()) );
/*
* Try to start the server at the default port here.
* We have no way of notifying the caller of an error.
* However,... | false | false | false | false | false | 0 |
checkInputOverrun(CORBA::ULong itemSize,
CORBA::ULong nItems,
omni::alignment_t align)
{
if (!pd_readonly_and_external_buffer) pd_inb_end = pd_outb_mkr;
omni::ptr_arith_t p1 = omni::align_to((omni::ptr_arith_t)pd_inb_mkr,align);
p1 += itemSize*nItems;
return ((void*)p1 > pd_inb_end) ? 0 : 1;
} | false | false | false | false | false | 0 |
__Pyx_ReleaseBuffer(Py_buffer *view) {
PyObject *obj = view->obj;
CYTHON_UNUSED PyObject *releasebuffer_cobj;
if (!obj) return;
#if PY_VERSION_HEX >= 0x02060000
if (PyObject_CheckBuffer(obj)) {
PyBuffer_Release(view);
return;
}
#endif
if (PyObject_TypeCheck(obj, __pyx_pty... | 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.