]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/debug.cpp
Make dungeon masters though and make oerkkis disappear when they get to you (because...
[dragonfireclient.git] / src / debug.cpp
index ec23235cbd817d88bbd340b00bba661a47dceb29..befd73a382a1d7ab27a16879cfb436369e5e6ab4 100644 (file)
@@ -68,9 +68,9 @@ Nullstream dummyout;
 void assert_fail(const char *assertion, const char *file,
                unsigned int line, const char *function)
 {
-       DEBUGPRINT("\nIn thread %x:\n"
+       DEBUGPRINT("\nIn thread %lx:\n"
                        "%s:%d: %s: Assertion '%s' failed.\n",
-                       (unsigned int)get_current_thread_id(),
+                       (unsigned long)get_current_thread_id(),
                        file, line, function, assertion);
        
        debug_stacks_print();
@@ -90,12 +90,13 @@ DebugStack::DebugStack(threadid_t id)
        threadid = id;
        stack_i = 0;
        stack_max_i = 0;
+       memset(stack, 0, DEBUG_STACK_SIZE*DEBUG_STACK_TEXT_SIZE);
 }
 
 void DebugStack::print(FILE *file, bool everything)
 {
-       fprintf(file, "DEBUG STACK FOR THREAD %x:\n",
-                       (unsigned int)threadid);
+       fprintf(file, "DEBUG STACK FOR THREAD %lx:\n",
+                       (unsigned long)threadid);
 
        for(int i=0; i<stack_max_i; i++)
        {
@@ -197,7 +198,7 @@ DebugStacker::~DebugStacker()
 }
 
 
-#ifdef _WIN32
+#ifdef _MSC_VER
 #if CATCH_UNHANDLED_EXCEPTIONS == 1
 void se_trans_func(unsigned int u, EXCEPTION_POINTERS* pExp)
 {