本文整理汇总了C++中E_DEBUG函数的典型用法代码示例。如果您正苦于以下问题:C++ E_DEBUG函数的具体用法?C++ E_DEBUG怎么用?C++ E_DEBUG使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了E_DEBUG函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: assert
// call with *e locked
static store_page *_allocate_page(store_engine *e, unsigned int bucket,
unsigned int free_bucket) {
assert(!e->page_buckets[bucket] || e->page_buckets[bucket]->allocated == e->page_size);
store_page *tmp = NULL;
// if a specific free bucket was requested, check there first
if (free_bucket != 0 && e->free_page_buckets[free_bucket] != NULL) {
assert(e->page_free > 0);
tmp = e->free_page_buckets[free_bucket];
e->free_page_buckets[free_bucket] = tmp->next;
}
// failing that, try the global list.
if (tmp == NULL && e->page_freelist != NULL) {
tmp = e->page_freelist;
e->page_freelist = tmp->next;
}
E_DEBUG("EXTSTORE: allocating new page\n");
// page_freelist can be empty if the only free pages are specialized and
// we didn't just request one.
if (e->page_free > 0 && tmp != NULL) {
tmp->next = e->page_buckets[bucket];
e->page_buckets[bucket] = tmp;
tmp->active = true;
tmp->free = false;
tmp->closed = false;
tmp->version = _next_version(e);
tmp->bucket = bucket;
e->page_free--;
STAT_INCR(e, page_allocs, 1);
} else {
extstore_run_maint(e);
}
if (tmp)
E_DEBUG("EXTSTORE: got page %u\n", tmp->id);
return tmp;
}
示例2: main
int
main(int argc, char *argv[])
{
logmath_t *lmath;
cmd_ln_t *config;
acmod_t *acmod;
ps_mgau_t *ps;
ptm_mgau_t *s;
int i, lastcb;
lmath = logmath_init(1.0001, 0, 0);
config = cmd_ln_init(NULL, ps_args(), TRUE,
"-compallsen", "yes",
"-input_endian", "little",
NULL);
cmd_ln_parse_file_r(config, ps_args(), MODELDIR "/en-us/en-us/feat.params", FALSE);
cmd_ln_set_str_extra_r(config, "_mdef", MODELDIR "/en-us/en-us/mdef");
cmd_ln_set_str_extra_r(config, "_mean", MODELDIR "/en-us/en-us/means");
cmd_ln_set_str_extra_r(config, "_var", MODELDIR "/en-us/en-us/variances");
cmd_ln_set_str_extra_r(config, "_tmat", MODELDIR "/en-us/en-us/transition_matrices");
cmd_ln_set_str_extra_r(config, "_sendump", MODELDIR "/en-us/en-us/sendump");
cmd_ln_set_str_extra_r(config, "_mixw", NULL);
cmd_ln_set_str_extra_r(config, "_lda", NULL);
cmd_ln_set_str_extra_r(config, "_senmgau", NULL);
err_set_debug_level(3);
TEST_ASSERT(config);
TEST_ASSERT((acmod = acmod_init(config, lmath, NULL, NULL)));
TEST_ASSERT((ps = acmod->mgau));
TEST_EQUAL(0, strcmp(ps->vt->name, "ptm"));
s = (ptm_mgau_t *)ps;
E_DEBUG(2,("PTM model loaded: %d codebooks, %d senones, %d frames of history\n",
s->g->n_mgau, s->n_sen, s->n_fast_hist));
E_DEBUG(2,("Senone to codebook mappings:\n"));
lastcb = s->sen2cb[0];
E_DEBUG(2,("\t%d: 0", lastcb));
for (i = 0; i < s->n_sen; ++i) {
if (s->sen2cb[i] != lastcb) {
lastcb = s->sen2cb[i];
E_DEBUGCONT(2,("-%d\n", i-1));
E_DEBUGCONT(2,("\t%d: %d", lastcb, i));
}
}
E_INFOCONT("-%d\n", i-1);
run_acmod_test(acmod);
#if 0
/* Replace it with ms_mgau. */
ptm_mgau_free(ps);
cmd_ln_set_str_r(config,
"-mixw",
MODELDIR "/en-us/en-us/mixture_weights");
TEST_ASSERT((acmod->mgau = ms_mgau_init(acmod, lmath, acmod->mdef)));
run_acmod_test(acmod);
cmd_ln_free_r(config);
#endif
return 0;
}
示例3: fsg_model_add_alt
int
fsg_model_add_alt(fsg_model_t * fsg, char const *baseword,
char const *altword)
{
int i, basewid, altwid;
int ntrans;
/* FIXME: This will get slow, eventually... */
for (basewid = 0; basewid < fsg->n_word; ++basewid)
if (0 == strcmp(fsg->vocab[basewid], baseword))
break;
if (basewid == fsg->n_word) {
E_ERROR("Base word %s not present in FSG vocabulary!\n", baseword);
return -1;
}
altwid = fsg_model_word_add(fsg, altword);
if (fsg->altwords == NULL)
fsg->altwords = bitvec_alloc(fsg->n_word_alloc);
bitvec_set(fsg->altwords, altwid);
E_DEBUG(2,("Adding alternate word transitions (%s,%s) to FSG\n",
baseword, altword));
/* Look for all transitions involving baseword and duplicate them. */
/* FIXME: This will also get slow, eventually... */
ntrans = 0;
for (i = 0; i < fsg->n_state; ++i) {
hash_iter_t *itor;
if (fsg->trans[i].trans == NULL)
continue;
for (itor = hash_table_iter(fsg->trans[i].trans); itor;
itor = hash_table_iter_next(itor)) {
glist_t trans;
gnode_t *gn;
trans = hash_entry_val(itor->ent);
for (gn = trans; gn; gn = gnode_next(gn)) {
fsg_link_t *fl = gnode_ptr(gn);
if (fl->wid == basewid) {
fsg_link_t *link;
/* Create transition object */
link = listelem_malloc(fsg->link_alloc);
link->from_state = fl->from_state;
link->to_state = fl->to_state;
link->logs2prob = fl->logs2prob; /* FIXME!!!??? */
link->wid = altwid;
trans =
glist_add_ptr(trans, (void *) link);
++ntrans;
}
}
hash_entry_val(itor->ent) = trans;
}
}
E_DEBUG(2,("Added %d alternate word transitions\n", ntrans));
return ntrans;
}
示例4: ee_do_command
int ee_do_command( u8 *Tx, int Tx_len, u8 *Rx, int Rx_len, int Send_skip ){
/* Execute this command string, including
giving reset and setting to idle after command
if Rx_len is set, we read out data from EEPROM */
int i;
E_DEBUG("Command, Tx_len %d, Rx_len %d\n", Tx_len, Rx_len );
if(do_reset()){
/* Failed! */
return(-EIO);
}
if(Send_skip)
/* Always send SKIP_ROM first to tell chip we are sending a command,
except when we read out rom data for chip */
write_byte(SKIP_ROM);
/* Always have Tx data */
for(i=0;i<Tx_len;i++){
write_byte(Tx[i]);
}
if(Rx_len){
for(i=0;i<Rx_len;i++){
Rx[i]=read_byte();
}
}
set_idle();
E_DEBUG("Command done\n");
return(0);
}
示例5: name
void Algorithm::shouldStop(bool stop) {
#if DEBUGGING_ENABLED
std::ostringstream msg;
msg << "Streaming: " << name() << "::shouldStop[" << nProcess << "] = "
<< (stop ? "true" : "false");
E_DEBUG(EAlgorithm, msg.str());
#else
E_DEBUG(EAlgorithm, "Streaming: " << name() << "::shouldStop = " << (stop?"true":"false"));
#endif
_shouldStop = stop;
}
示例6: read_byte
static u8
read_byte(void){
/* Read a single byte from EEPROM
Read LSb first */
int i;
int Value;
u8 Result=0;
#ifndef CONFIG_SYS_IMMR
u32 Flags;
#endif
E_DEBUG("Reading byte\n");
for(i=0;i<8;i++){
/* Small delay between pulses */
udelay(1);
#ifndef CONFIG_SYS_IMMR
/* Disable irq */
save_flags(Flags);
cli();
#endif
/* Pull down pin short time to start read
See page 26 in data sheet */
WRITE_PORT(0);
udelay(READ_LOW);
WRITE_PORT(1);
/* Wait for chip to drive pin */
udelay(READ_TIMEOUT);
Value = READ_PORT;
if(Value)
Value=1;
#ifndef CONFIG_SYS_IMMR
/* Enable irq */
restore_flags(Flags);
#endif
/* Wait for chip to release pin */
udelay(TOTAL_READ_LOW-READ_TIMEOUT);
/* LSb first */
Result|=Value<<i;
}
E_DEBUG("Read byte 0x%x\n",Result);
return(Result);
}
示例7: E_WARNING
void SinkBase::detachProxy(SinkProxyBase* sproxy) {
// TODO: verify me
if (sproxy != _sproxy) {
E_WARNING("Cannot detach " << fullName() << " from SinkProxy " << sproxy->fullName() << " as they are not attached");
return;
}
E_DEBUG(EConnectors, " SinkBase::detachProxy: " << fullName() << "::_sproxy = 0");
_sproxy = 0;
E_DEBUG(EConnectors, " SinkBase::detachProxy: " << fullName() << "::_source = 0");
setSource(0); // also set source to 0 because the proxy set it for us when we attached, but now we're all alone
}
示例8: init
/**
* Initialize Essentia and fill the AlgorithmFactories with the Algorithms.
*/
void init() {
setDebugLevel(EUser1 | EUser2);
E_DEBUG(EFactory, "essentia::init()");
standard::AlgorithmFactory::init();
standard::registerAlgorithm();
streaming::AlgorithmFactory::init();
streaming::registerAlgorithm();
TypeMap::init();
_initialized = true;
E_DEBUG(EFactory, "essentia::init() ok!");
}
示例9: state_align_search_finish
static int
state_align_search_finish(ps_search_t *search)
{
state_align_search_t *sas = (state_align_search_t *)search;
hmm_t *final_phone = sas->hmms + sas->n_phones - 1;
ps_alignment_iter_t *itor;
ps_alignment_entry_t *ent;
int last_frame, cur_frame;
state_align_hist_t last, cur;
/* Best state exiting the last cur_frame. */
last.id = cur.id = hmm_out_history(final_phone);
last.score = hmm_out_score(final_phone);
if (last.score == 0xffff) {
E_ERROR("Failed to reach final state in alignment\n");
return -1;
}
itor = ps_alignment_states(sas->al);
last_frame = sas->frame + 1;
for (cur_frame = sas->frame - 1; cur_frame >= 0; --cur_frame) {
cur = sas->tokens[cur_frame * sas->n_emit_state + cur.id];
/* State boundary, update alignment entry for next state. */
if (cur.id != last.id) {
itor = ps_alignment_iter_goto(itor, last.id);
assert(itor != NULL);
ent = ps_alignment_iter_get(itor);
ent->start = cur_frame + 1;
ent->duration = last_frame - ent->start;
ent->score = last.score - cur.score;
E_DEBUG(1,("state %d start %d end %d\n", last.id,
ent->start, last_frame));
last = cur;
last_frame = cur_frame + 1;
}
}
/* Update alignment entry for initial state. */
itor = ps_alignment_iter_goto(itor, 0);
assert(itor != NULL);
ent = ps_alignment_iter_get(itor);
ent->start = 0;
ent->duration = last_frame;
E_DEBUG(1,("state %d start %d end %d\n", 0,
ent->start, last_frame));
ps_alignment_iter_free(itor);
ps_alignment_propagate(sas->al);
return 0;
}
示例10: acmod_read_scores
int
acmod_read_scores(acmod_t *acmod)
{
int inptr, rv;
if (acmod->grow_feat) {
/* Grow to avoid wraparound if grow_feat == TRUE. */
inptr = acmod->feat_outidx + acmod->n_feat_frame;
/* Has to be +1, otherwise, next time acmod_advance() is
* called, this will wrap around. */
while (inptr + 1 >= acmod->n_feat_alloc)
acmod_grow_feat_buf(acmod, acmod->n_feat_alloc * 2);
}
else {
inptr = (acmod->feat_outidx + acmod->n_feat_frame) % acmod->n_feat_alloc;
}
if ((rv = acmod_read_scores_internal(acmod)) != 1)
return rv;
/* Set acmod->senscr_frame appropriately so that these scores
get reused below in acmod_score(). */
acmod->senscr_frame = acmod->output_frame + acmod->n_feat_frame;
E_DEBUG(1,("Frame %d has %d active states\n",
acmod->senscr_frame, acmod->n_senone_active));
/* Increment the "feature frame counter" and record the file
* position for the relevant frame in the (possibly circular)
* buffer. */
++acmod->n_feat_frame;
acmod->framepos[inptr] = ftell(acmod->insenfh);
return 1;
}
示例11: checkSameTypeAs
void SinkBase::attachProxy(SinkProxyBase* sproxy) {
checkSameTypeAs(*sproxy);
if (_source)
throw EssentiaException("You cannot attach a SinkProxy to a Sink which is already connected: ",
fullName(), " is already connected to ", _source->fullName());
if (_sproxy)
throw EssentiaException("You cannot attach a SinkProxy to a Sink which is already attached to a SinkProxy: ",
fullName(), " is attached to proxy ", _sproxy->fullName());
E_DEBUG(EConnectors, " SinkBase::attachProxy: " << fullName() << "::_sproxy = " << sproxy->fullName());
_sproxy = sproxy;
E_DEBUG(EConnectors, " SinkBase::attachProxy: " << sproxy->fullName() << "::updateProxiedSink()");
_sproxy->updateProxiedSink();
}
示例12: E_DEBUG
void Algorithm::reset() {
E_DEBUG(EAlgorithm, "Streaming: " << name() << "::reset()");
shouldStop(false);
// reset the buffers of the sources of this algorithm
for (OutputMap::iterator it = _outputs.begin();
it != _outputs.end();
++it) {
E_DEBUG(EAlgorithm, "resetting buffer for " << it->second->fullName());
it->second->reset();
}
// Note: we don't need to reset the inputs because they share a Multi-rate
// buffer with the outputs
E_DEBUG(EAlgorithm, "Streaming: " << name() << "::reset() ok!");
}
示例13: E_DEBUG
void DesktopIcon::load_icon(int face) {
const char* ic = NULL;
if(face != ICON_FACE_TWO) {
if(!settings->icon.empty())
ic = settings->icon.c_str();
} else {
if(!settings->icon2.empty())
ic = settings->icon2.c_str();
}
if(!ic)
return;
if(!IconLoader::set(this, ic, ICON_SIZE_HUGE)) {
E_DEBUG(E_STRLOC ": Unable to load %s icon\n", ic);
return;
}
/* fetch image object for sizes */
Fl_Image* img = image();
int img_w = img->w();
int img_h = img->h();
/* resize box if icon is larger */
if(img_w > ICON_SIZE_MIN_W || img_h > ICON_SIZE_MIN_H)
size(img_w + OFFSET_W, img_h + OFFSET_H);
/* darker icon version for selection */
delete darker_img;
darker_img = img->copy(img->w(), img->h());
darker_img->color_average(FL_BLUE, 0.6);
}
示例14: load_theme_cb
static void load_theme_cb(Fl_Widget*, void*) {
E_RETURN_IF_FAIL(ThemeLoader::global()->load_with_path("theme-sample"));
char buf[128];
if(ThemeLoader::global()->theme()->get_item("ede", "sample", buf, sizeof(buf)))
E_DEBUG(E_STRLOC ": evaluated => %s\n", buf);
}
示例15: populate_lrdiph
static void
populate_lrdiph(dict2pid_t *d2p, s3ssid_t ***rdiph_rc, s3cipid_t b)
{
bin_mdef_t *mdef = d2p->mdef;
s3cipid_t l, r;
for (l = 0; l < bin_mdef_n_ciphone(mdef); l++) {
for (r = 0; r < bin_mdef_n_ciphone(mdef); r++) {
s3pid_t p;
p = bin_mdef_phone_id_nearest(mdef, (s3cipid_t) b,
(s3cipid_t) l,
(s3cipid_t) r,
WORD_POSN_SINGLE);
d2p->lrdiph_rc[b][l][r]
= bin_mdef_pid2ssid(mdef, p);
if (r == bin_mdef_silphone(mdef))
d2p->ldiph_lc[b][r][l]
= bin_mdef_pid2ssid(mdef, p);
if (rdiph_rc && l == bin_mdef_silphone(mdef))
rdiph_rc[b][l][r]
= bin_mdef_pid2ssid(mdef, p);
assert(IS_S3SSID(bin_mdef_pid2ssid(mdef, p)));
E_DEBUG(2,("%s(%s,%s) => %d / %d\n",
bin_mdef_ciphone_str(mdef, b),
bin_mdef_ciphone_str(mdef, l),
bin_mdef_ciphone_str(mdef, r),
p, bin_mdef_pid2ssid(mdef, p)));
}
}
}