summaryrefslogtreecommitdiff
path: root/utils.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2007-04-27 10:08:10 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 03:38:31 -0400
commitd01629148383261d7944e91fd2ac67b334a6834d (patch)
treeb6dc76692cc13c65e7d69405c0722c5925c7fcdf /utils.cc
parent4716975cb18795e4a953fc705cf0b7c74d6a1c95 (diff)
downloadledger-d01629148383261d7944e91fd2ac67b334a6834d.tar.gz
ledger-d01629148383261d7944e91fd2ac67b334a6834d.tar.bz2
ledger-d01629148383261d7944e91fd2ac67b334a6834d.zip
Further corrections after attempting to compile.
Diffstat (limited to 'utils.cc')
-rw-r--r--utils.cc29
1 files changed, 11 insertions, 18 deletions
diff --git a/utils.cc b/utils.cc
index 2183e96c..5c4cbef7 100644
--- a/utils.cc
+++ b/utils.cc
@@ -5,12 +5,15 @@ namespace ledger
#if defined(ASSERTS_ON)
-void debug_assert(const ledger::string& reason,
- const ledger::string& func,
- const ledger::string& file,
- unsigned long line)
+void debug_assert(const string& reason,
+ const string& func,
+ const string& file,
+ unsigned long line)
{
- throw fatal(reason, context());
+ std::ostringstream buf;
+ buf << "Assertion failed in \"" << file << "\", line " << line
+ << ": " << reason;
+ throw exception(buf.str(), context());
}
#endif
@@ -87,14 +90,9 @@ inline void report_count_map(std::ostream& out, object_count_map& the_map)
<< std::endl;
}
-bool trace_ctor(void * ptr, const char * cls_name, const char * args,
- std::size_t cls_size)
+bool trace_ctor_func(void * ptr, const char * cls_name, const char * args,
+ std::size_t cls_size)
{
- if (trace_class_mode && cls_name[0] == '_')
- return true;
- if (trace_alloc_mode && cls_name[0] != '_')
- return true;
-
static char name[1024];
std::strcpy(name, cls_name);
std::strcat(name, "(");
@@ -114,13 +112,8 @@ bool trace_ctor(void * ptr, const char * cls_name, const char * args,
return true;
}
-bool trace_dtor(void * ptr, const char * cls_name, std::size_t cls_size)
+bool trace_dtor_func(void * ptr, const char * cls_name, std::size_t cls_size)
{
- if (trace_class_mode && cls_name[0] == '_')
- return true;
- if (trace_alloc_mode && cls_name[0] != '_')
- return true;
-
DEBUG_PRINT("ledger.trace.debug", "trace_dtor " << ptr << " " << cls_name);
live_objects_map::iterator i = live_objects.find(ptr);