From ef24e72b2618806f64345544fa46c84f3f494890 Mon Sep 17 00:00:00 2001 From: archshift Date: Tue, 20 Jan 2015 17:16:47 -0800 Subject: Asserts: break/crash program, fit to style guide; log.h->assert.h Involves making asserts use printf instead of the log functions (log functions are asynchronous and, as such, the log won't be printed in time) As such, the log type argument was removed (printf obviously can't use it, and it's made obsolete by the file and line printing) Also removed some GEKKO cruft. --- src/common/chunk_file.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/common/chunk_file.h') diff --git a/src/common/chunk_file.h b/src/common/chunk_file.h index 39a14dc8..dc27da08 100644 --- a/src/common/chunk_file.h +++ b/src/common/chunk_file.h @@ -180,7 +180,7 @@ public: case MODE_MEASURE: break; // MODE_MEASURE - don't need to do anything case MODE_VERIFY: for (int i = 0; i < size; i++) { - _dbg_assert_msg_(Common, ((u8*)data)[i] == (*ptr)[i], + DEBUG_ASSERT_MSG(((u8*)data)[i] == (*ptr)[i], "Savestate verification failure: %d (0x%X) (at %p) != %d (0x%X) (at %p).\n", ((u8*)data)[i], ((u8*)data)[i], &((u8*)data)[i], (*ptr)[i], (*ptr)[i], &(*ptr)[i]); @@ -200,7 +200,7 @@ public: case MODE_MEASURE: break; // MODE_MEASURE - don't need to do anything case MODE_VERIFY: for (int i = 0; i < size; i++) { - _dbg_assert_msg_(Common, ((u8*)data)[i] == (*ptr)[i], + DEBUG_ASSERT_MSG(((u8*)data)[i] == (*ptr)[i], "Savestate verification failure: %d (0x%X) (at %p) != %d (0x%X) (at %p).\n", ((u8*)data)[i], ((u8*)data)[i], &((u8*)data)[i], (*ptr)[i], (*ptr)[i], &(*ptr)[i]); @@ -505,8 +505,7 @@ public: case MODE_WRITE: memcpy(*ptr, x.c_str(), stringLen); break; case MODE_MEASURE: break; case MODE_VERIFY: - _dbg_assert_msg_(Common, - !strcmp(x.c_str(), (char*)*ptr), + DEBUG_ASSERT_MSG((x == (char*)*ptr), "Savestate verification failure: \"%s\" != \"%s\" (at %p).\n", x.c_str(), (char*)*ptr, ptr); break; @@ -524,7 +523,7 @@ public: case MODE_WRITE: memcpy(*ptr, x.c_str(), stringLen); break; case MODE_MEASURE: break; case MODE_VERIFY: - _dbg_assert_msg_(Common, x == (wchar_t*)*ptr, + DEBUG_ASSERT_MSG((x == (wchar_t*)*ptr), "Savestate verification failure: \"%ls\" != \"%ls\" (at %p).\n", x.c_str(), (wchar_t*)*ptr, ptr); break; -- cgit v1.2.3