本文整理汇总了C++中MDEBUG函数的典型用法代码示例。如果您正苦于以下问题:C++ MDEBUG函数的具体用法?C++ MDEBUG怎么用?C++ MDEBUG使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MDEBUG函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mtfs_branch_valid_flag
int mtfs_branch_valid_flag(struct inode *inode, mtfs_bindex_t bindex, __u32 valid_flags)
{
int is_valid = 1;
__u32 mtfs_flag = 0;
int ret = 0;
MENTRY();
if (mtfs_i2branch(inode, bindex) == NULL) {
is_valid = 0;
MDEBUG("branch[%d] is null, return invalid\n", bindex);
goto out;
}
if (valid_flags == MTFS_BRANCH_VALID) {
is_valid = 1;
MDEBUG("branch[%d] is not null, return valid\n", bindex);
goto out;
}
ret = mtfs_branch_getflag(inode, bindex, &mtfs_flag);
if (ret) {
MERROR("failed to get branch flag, ret = %d\n", ret);
is_valid = 0;
goto out;
}
if ((valid_flags & MTFS_DATA_VALID) != 0 &&
(mtfs_flag & MTFS_FLAG_DATABAD) != 0) {
MDEBUG("data of branch[%d] is not valid\n", bindex);
is_valid = 0;
}
out:
MRETURN(is_valid);
}
示例2: lock
void block_queue::print() const
{
boost::unique_lock<boost::recursive_mutex> lock(mutex);
MDEBUG("Block queue has " << blocks.size() << " spans");
for (const auto &span: blocks)
MDEBUG(" " << span.start_block_height << " - " << (span.start_block_height+span.nblocks-1) << " (" << span.nblocks << ") - " << (is_blockchain_placeholder(span) ? "blockchain" : span.blocks.empty() ? "scheduled" : "filled ") << " " << span.connection_id << " (" << ((unsigned)(span.rate*10/1024.f))/10.f << " kB/s)");
}
示例3: caltdissect
/*
- caltdissect - dissect match for alternation node
^ static int caltdissect(struct vars *, struct subre *, chr *, chr *);
*/
static int /* regexec return code */
caltdissect(
struct vars *v,
struct subre *t,
chr *begin, /* beginning of relevant substring */
chr *end) /* end of same */
{
struct dfa *d;
int er;
/* We loop, rather than tail-recurse, to handle a chain of alternatives */
while (t != NULL) {
assert(t->op == '|');
assert(t->left != NULL && t->left->cnfa.nstates > 0);
MDEBUG(("calt n%d\n", t->id));
d = getsubdfa(v, t->left);
NOERR();
if (longest(v, d, begin, end, (int *) NULL) == end) {
MDEBUG(("calt matched\n"));
er = cdissect(v, t->left, begin, end);
if (er != REG_NOMATCH) {
return er;
}
}
t = t->right;
}
return REG_NOMATCH;
}
示例4: altdissect
/*
* altdissect - determine alternative subexpression matches (uncomplicated)
*/
static int /* regexec return code */
altdissect(struct vars * v,
struct subre * t,
chr *begin, /* beginning of relevant substring */
chr *end) /* end of same */
{
struct dfa *d;
int i;
assert(t != NULL);
assert(t->op == '|');
for (i = 0; t != NULL; t = t->right, i++)
{
MDEBUG(("trying %dth\n", i));
assert(t->left != NULL && t->left->cnfa.nstates > 0);
d = newdfa(v, &t->left->cnfa, &v->g->cmap, &v->dfa1);
if (ISERR())
return v->err;
if (longest(v, d, begin, end, (int *) NULL) == end)
{
MDEBUG(("success\n"));
freedfa(d);
return dissect(v, t->left, begin, end);
}
freedfa(d);
}
return REG_ASSERT; /* none of them matched?!? */
}
示例5: matches
/*
- complicatedAlternationDissect - determine alternative subexpression matches (w.
- complications)
^ static int complicatedAlternationDissect(struct vars *, struct subre *, chr *, chr *);
*/
static int /* regexec return code */
complicatedAlternationDissect(
struct vars *const v,
struct subre *t,
chr *const begin, /* beginning of relevant substring */
chr *const end) /* end of same */
{
int er;
#define UNTRIED 0 /* not yet tried at all */
#define TRYING 1 /* top matched, trying submatches */
#define TRIED 2 /* top didn't match or submatches exhausted */
#ifndef COMPILER_DOES_TAILCALL_OPTIMIZATION
if (0) {
doRight:
t = t->right;
}
#endif
if (t == NULL) {
return REG_NOMATCH;
}
assert(t->op == '|');
if (v->mem[t->retry] == TRIED) {
goto doRight;
}
MDEBUG(("cAlt n%d\n", t->retry));
assert(t->left != NULL);
if (v->mem[t->retry] == UNTRIED) {
struct dfa *d = newDFA(v, &t->left->cnfa, &v->g->cmap, DOMALLOC);
if (ISERR()) {
return v->err;
}
if (longest(v, d, begin, end, NULL) != end) {
freeDFA(d);
v->mem[t->retry] = TRIED;
goto doRight;
}
freeDFA(d);
MDEBUG(("cAlt matched\n"));
v->mem[t->retry] = TRYING;
}
er = complicatedDissect(v, t->left, begin, end);
if (er != REG_NOMATCH) {
return er;
}
v->mem[t->retry] = TRIED;
#ifndef COMPILER_DOES_TAILCALL_OPTIMIZATION
goto doRight;
#else
doRight:
return complicatedAlternationDissect(v, t->right, begin, end);
#endif
}
示例6: MDEBUG
void Loading::cancel_btn_clicked()
{
#ifdef MDEBUG_ENABLE
MDEBUG(DModule_UIBase,DLevel6) << "Loading::cancel_btn_clicked";
MDEBUG(DModule_UIBase,DLevel3) << "<Disconnect Server># Cancel Button Clicked To Quit Connect Server #";
#endif
cancel_btn_->setEnabled(false);
emit QuitConnectServer();
}
示例7: query
/*Method to execute sql statements like SELECT and return Cursor
Inputs:
query- string containing sql query
qlength - length of query (for binary data). if 0 then assume null terminated.
Output: NULL cursor on error
*/
DBCursor *DBConnection_SQLITE::sqlQuery(char *query, DBString *args, int numargs, int p_rows)
{
DBCursor_SQLITE *ret = 0;
unsigned int qlength;
char *newquery = (char *)query;
#ifndef NDEBUG
MDEBUG0("SQLite::sqlQuery\n");
MDEBUG("Numargs=[%d]\n", numargs);
MDEBUG("Query=[%s]\n", query);
for(int i = 0; i < numargs; i++) {
MDEBUG("Args[%d]=[%s]\n", i);
}
#endif
if (!isConnected)
return NULL;
//if null terminated (qlength = 0) then calculate length of query
qlength = strlen(query);
//execute query and check for error
if(numargs) {
int newsize;
newquery = BindVariables(query, qlength, args, numargs, newsize);
qlength = newsize;
}
try {
ret = new DBCursor_SQLITE(mDB);
Dataset *ds = ret->getDataset();
ds->query(newquery);
//try to open cursor..on error delete invalid cursor object and exit with error
if(!ret->open((DBConnection *)this)) {
delete ret;
ret = 0;
mIsError = true;
setErrorStr("Unable to open query");
} else
addCursor(ret); //add to cursor list
} catch(DbErrors &e) {
MDEBUG0("\n\n --- CAUGHT ERROR --- \n");
mIsError = true;
setErrorStr(e.getMsg());
delete ret;
ret = 0;
}
if (numargs)
delete newquery;
return ret;
}
示例8: analyse
uint32_t analyse (FILE *fmatched, const char *file)
{
int rule_id = -1, test_id = -1;
if (!rule)
{ // Initial rule
MDEBUG(("%s\n", file));
if (!rule.load (file, RULE_MAX_REPEAT, true))
{
MDEBUG (("\tFailed to reference tune %s\n", file));
return 0;
}
MDEBUG (("\tInitial rule base $%04x, length %d, matches %d\n", rule.base(), rule.length(), rule.ids()));
//rule.md5_add ();
return 1;
}
// Now try for a match with tune two.
if (!test.load (file, -1, true))
{
MDEBUG (("%s\n\tFailed to load, skipping\n", file));
return 0;
}
fprintf (stderr, "%s\n", file);
int end = test.ids() - RULE_MATCH;
if (end < 0)
{
MDEBUG (("\tInput file not long enough to match against\n", file));
return 0;
}
for (int id = 0; id < end; id++)
{
rule_id = rule.find (test, id, RULE_MATCH);
if (rule_id < 0)
continue;
test_id = id;
break;
}
if (rule_id < 0)
{
MDEBUG (("\tNo match found\n"));
return 0;
}
else
{
MDEBUG (("\tMatch rule id %d ($%04x) with test id %d ($%04x)\n", rule_id, rule.addr(rule_id), test_id, test.addr(test_id)));
}
if (!rule.combine (test, test_id, rule_id, RULE_MIN_MATCH))
MDEBUG (("\tMatches less that minimum threshold, tune ignored\n"));
else
MDEBUG (("\tRule base $%04x, length %d, matches %d\n", rule.base(), rule.length(), rule.ids()));
test.md5_add ();
fprintf (fmatched, "%s %d %s @ %04x\n", test.md5_get(), rule.player_id(), file, test.addr(test_id));
return 1;
}
示例9: init_page_allocator
/**
* Initialize the physical page allocator.
*
* This takes RAM information from the multiboot header
* and then sets up some data structures to manage this RAM.
*/
void init_page_allocator()
{
/* set all bits to busy .. we will clear bits which actually
point to usable RAM */
for (unsigned x = 0; x < UINT_CNT; x++)
free_bm[x] = (unsigned)~0;
unsigned node_cnt;
const ram_map_t *s = get_rammap_ptr(&node_cnt);
printk("RAM address map received from multiboot:\n");
for (unsigned i = 0; i < node_cnt; i++) {
printk("%d: Start: 0x%8x End:0x%8x :: Size = ",
i, s[i].saddr, s[i].saddr + s[i].len - 1);
print_human_readable_size(s[i].len);
}
printk("Area occupied by Ganoid:\n");
printk("Start: 0x%8x\n", GANOID_AREA_START);
printk("End : 0x%8x\n", GANOID_AREA_END);
/* set the bits which are already occupied. */
for (unsigned i = 0; i < node_cnt; i++) {
unsigned next_block_addr = s[i].saddr + s[i].len;
if (s[i].saddr <= GANOID_AREA_START &&
GANOID_AREA_END < next_block_addr) {
/* kernel is inside current RAM area */
MDEBUG("This area has ganoid\n");
/* free pages upto kernel start */
if (s[i].saddr != GANOID_AREA_START)
fp_clearbit_range(GET_PAGENO(s[i].saddr),
GET_PAGENO(GANOID_AREA_START -
1));
if (next_block_addr != GANOID_AREA_END) {
MDEBUG("SEQ 0: %x %x\n", GANOID_AREA_END +
PAGE_SIZE, next_block_addr - 1);
fp_clearbit_range(GET_PAGENO(GANOID_AREA_END +
PAGE_SIZE),
GET_PAGENO(next_block_addr -
1));
}
} else {
MDEBUG("\nFull free range: %x to %x\n",
s[i].saddr, next_block_addr - 1);
fp_clearbit_range(GET_PAGENO(s[i].saddr),
GET_PAGENO(next_block_addr - 1));
}
}
#ifdef CONFIG_PAGE_ALLOC_DEBUG
dump_free_info();
#endif /* CONFIG_PAGE_ALLOC_DEBUG */
}
示例10: curl_easy_init
int MCommandSenderThread::ChatWithServer(const std::string &data)
{
CURLcode res;
int ret = 0;
CURL *curl = curl_easy_init();
if (curl == NULL)
{
#ifdef MDEBUG_ENABLE
MDEBUG(DModule_Communication,DLevel3) <<"<Curl Error> curl_easy_init failed***** ";
#endif
return MISEIS_CURLE_INIT_FAILED;
}
// curl_easy_setopt(curl, CURLOPT_FRESH_CONNECT, 1);
curl_easy_setopt(curl, CURLOPT_URL, str_ip_.toLatin1().data());
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, this);
// curl_easy_setopt(curl, CURLOPT_TIMEOUT, CURL_TIMEOUT);
curl_easy_setopt(curl, CURLOPT_POST, 1L);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data.c_str());
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, CURL_CONNECT_TIMEOUT);
// curl_easy_setopt(curl, CURLOPT_FORBID_REUSE, 1);
struct curl_slist *chunk = NULL;
chunk = curl_slist_append(chunk, "Expect:");
res = curl_easy_setopt(curl, CURLOPT_HTTPHEADER, chunk);
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, false);
curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, Progress);
curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, this);
res = curl_easy_perform(curl);
if (res != CURLE_OK)
{
#ifdef MDEBUG_ENABLE
MDEBUG(DModule_Communication,DLevel3) <<"<Curl Error>***** "<<curl_easy_strerror(res)<<" *****";
#endif
MISEISERROR("<Curl Error>***** %s *****", curl_easy_strerror(res));
if (cancel_cmd_ != COMMAND_CANCEL_READY)
{
ret = MISIES_CURLE_COULDNT_CONNECT;
}
else
{
ret = MISEIS_CURLE_USER_CANCEL;
}
}
curl_easy_cleanup(curl);
return ret;
}
示例11: ext_support_init
static int ext_support_init(void)
{
int ret = 0;
MDEBUG("registering mtfs async juntion for ext2\n");
ret = junction_register(&mtfs_ext2_junction);
if (ret) {
MERROR("failed to register junction for ext2, ret = %d\n", ret);
goto out;
}
ret = junction_register(&mtfs_ext3_junction);
if (ret) {
MERROR("failed to register junction for ext3, ret = %d\n", ret);
goto out_unregister_ext2;
}
ret = junction_register(&mtfs_ext4_junction);
if (ret) {
MERROR("failed to register junction for ext4, ret = %d\n", ret);
goto out_unregister_ext3;
}
goto out;
out_unregister_ext3:
junction_unregister(&mtfs_ext3_junction);
out_unregister_ext2:
junction_unregister(&mtfs_ext2_junction);
out:
return ret;
}
示例12: masync_replica_ext_init
static int masync_replica_ext_init(void)
{
int ret = 0;
MDEBUG("registering async_replica junction for ext2/ext3/ext4\n");
ret = junction_register(&mtfs_ext2_junction);
if (ret) {
MERROR("failed to register async_replica junction for ext2: error %d\n",
ret);
goto out;
}
ret = junction_register(&mtfs_ext3_junction);
if (ret) {
MERROR("failed to register async_replica junction for ext3: error %d\n",
ret);
goto out_unregister_ext2;
}
goto out;
out_unregister_ext2:
junction_unregister(&mtfs_ext2_junction);
out:
return ret;
}
示例13: matches
/*
- caltdissect - determine alternative subexpression matches (w. complications)
^ static int caltdissect(struct vars *, struct subre *, chr *, chr *);
*/
static int /* regexec return code */
caltdissect(
struct vars *v,
struct subre *t,
chr *begin, /* beginning of relevant substring */
chr *end) /* end of same */
{
struct dfa *d;
int er;
#define UNTRIED 0 /* not yet tried at all */
#define TRYING 1 /* top matched, trying submatches */
#define TRIED 2 /* top didn't match or submatches exhausted */
if (t == NULL) {
return REG_NOMATCH;
}
assert(t->op == '|');
if (v->mem[t->retry] == TRIED) {
return caltdissect(v, t->right, begin, end);
}
MDEBUG(("calt n%d\n", t->retry));
assert(t->left != NULL);
if (v->mem[t->retry] == UNTRIED) {
d = newdfa(v, &t->left->cnfa, &v->g->cmap, DOMALLOC);
if (ISERR()) {
return v->err;
}
if (longest(v, d, begin, end, NULL) != end) {
freedfa(d);
v->mem[t->retry] = TRIED;
return caltdissect(v, t->right, begin, end);
}
freedfa(d);
MDEBUG(("calt matched\n"));
v->mem[t->retry] = TRYING;
}
er = cdissect(v, t->left, begin, end);
if (er != REG_NOMATCH) {
return er;
}
v->mem[t->retry] = TRIED;
return caltdissect(v, t->right, begin, end);
}
示例14: mlog_cancel_rec
/* returns negative on error; 0 if success; 1 if success & log destroyed */
int mlog_cancel_rec(struct mlog_handle *loghandle, int index)
{
struct mlog_log_hdr *mlh = loghandle->mgh_hdr;
int ret = 0;
MENTRY();
MDEBUG("Canceling %d in log %llx\n",
index, loghandle->mgh_id.mgl_oid);
if (index == 0) {
MERROR("Can't cancel index 0 which is header\n");
ret = -EINVAL;
goto out;
}
if (!ext2_clear_bit(index, mlh->mlh_bitmap)) {
MDEBUG("Catalog index %u already clear?\n", index);
ret = -ENOENT;
goto out;
}
mlh->mlh_count--;
if ((mlh->mlh_flags & MLOG_F_ZAP_WHEN_EMPTY) &&
(mlh->mlh_count == 1) &&
(loghandle->mgh_last_idx == (MLOG_BITMAP_BYTES * 8) - 1)) {
ret = mlog_destroy(loghandle);
if (ret) {
MERROR("Failure destroying log after last cancel: %d\n",
ret);
ext2_set_bit(index, mlh->mlh_bitmap);
mlh->mlh_count++;
} else {
ret = 1;
}
goto out;
}
ret = mlog_write_rec(loghandle, &mlh->mlh_hdr, NULL, 0, NULL, 0);
if (ret) {
MERROR("Failure re-writing header %d\n", ret);
ext2_set_bit(index, mlh->mlh_bitmap);
mlh->mlh_count++;
}
out:
MRETURN(ret);
}
示例15: ext_support_exit
static void ext_support_exit(void)
{
MDEBUG("unregistering mtfs sync juntion for ext2/ext3/ext4\n");
junction_unregister(&mtfs_ext4_junction);
junction_unregister(&mtfs_ext3_junction);
junction_unregister(&mtfs_ext2_junction);
}