From 6c6fcaf95bd0900cec88e13d58795f5241850037 Mon Sep 17 00:00:00 2001 From: Alex Smith Date: Thu, 20 Dec 2012 19:22:16 +0000 Subject: [PATCH] Some build fixes for DEBUG=1. --- headers/os/support/Debug.h | 10 ++++++---- src/kits/interface/PicturePlayer.cpp | 6 ++++-- src/kits/tracker/OpenWithWindow.cpp | 2 +- src/kits/tracker/QueryPoseView.cpp | 14 ++++++++------ src/kits/tracker/Tests.cpp | 4 ++-- src/kits/tracker/Utilities.cpp | 2 +- 6 files changed, 22 insertions(+), 16 deletions(-) diff --git a/headers/os/support/Debug.h b/headers/os/support/Debug.h index 78aefdc678..1f88b2716b 100644 --- a/headers/os/support/Debug.h +++ b/headers/os/support/Debug.h @@ -47,11 +47,13 @@ extern "C" { PRINT(("%s\t", #OBJ)); \ (OBJ).PrintToStream(); \ } ((void)0) - #define TRACE() _debugPrintf("File: %s, Line: %d, Thread: %ld\n", \ - __FILE__, __LINE__, find_thread(NULL)) + #define TRACE() _debugPrintf("File: %s, Line: %d, Thread: %" \ + B_PRId32 "\n", __FILE__, __LINE__, \ + find_thread(NULL)) - #define SERIAL_TRACE() _sPrintf("File: %s, Line: %d, Thread: %ld\n", \ - __FILE__, __LINE__, find_thread(NULL)) + #define SERIAL_TRACE() _sPrintf("File: %s, Line: %d, Thread: %" \ + B_PRId32 "\n", __FILE__, __LINE__, \ + find_thread(NULL)) #define DEBUGGER(MSG) if (_rtDebugFlag) debugger(MSG) #if !defined(ASSERT) diff --git a/src/kits/interface/PicturePlayer.cpp b/src/kits/interface/PicturePlayer.cpp index 4f0906751e..5a1fcbdf40 100644 --- a/src/kits/interface/PicturePlayer.cpp +++ b/src/kits/interface/PicturePlayer.cpp @@ -562,14 +562,16 @@ PicturePlayer::Play(void **callBackTable, int32 tableEntries, void *userData) #if DEBUG numOps++; #if DEBUG > 1 - fprintf(file, "executed in %lld usecs\n", system_time() - startOpTime); + fprintf(file, "executed in %" B_PRId64 " usecs\n", system_time() + - startOpTime); #endif #endif // TODO: what if too much was read, should we return B_ERROR? } #if DEBUG - fprintf(file, "Done! %ld ops, rendering completed in %lld usecs.\n", numOps, system_time() - startTime); + fprintf(file, "Done! %" B_PRId32 " ops, rendering completed in %" + B_PRId64 " usecs.\n", numOps, system_time() - startTime); fclose(file); #endif return B_OK; diff --git a/src/kits/tracker/OpenWithWindow.cpp b/src/kits/tracker/OpenWithWindow.cpp index c7869fa5f5..fb2414037d 100644 --- a/src/kits/tracker/OpenWithWindow.cpp +++ b/src/kits/tracker/OpenWithWindow.cpp @@ -903,7 +903,7 @@ OpenWithPoseView::HandleMessageDropped(BMessage* DEBUG_ONLY(message)) #if DEBUG // in debug mode allow tweaking the colors const rgb_color* color; - int32 size; + ssize_t size; // handle roColour-style color drops if (message->FindData("RGBColor", 'RGBC', (const void**)&color, &size) == B_OK) { SetViewColor(*color); diff --git a/src/kits/tracker/QueryPoseView.cpp b/src/kits/tracker/QueryPoseView.cpp index e50efa9af6..b74a3a9f1d 100644 --- a/src/kits/tracker/QueryPoseView.cpp +++ b/src/kits/tracker/QueryPoseView.cpp @@ -299,7 +299,7 @@ BQueryPoseView::InitDirentIterator(const entry_ref* ref) timeData.tm_min = 0; nextHour = mktime(&timeData); - PRINT(("%ld minutes, %ld seconds till next hour\n", + PRINT(("%" B_PRId32 " minutes, %" B_PRId32 " seconds till next hour\n", (nextHour - now) / 60, (nextHour - now) % 60)); time_t nextMinute = now + 60; @@ -308,7 +308,7 @@ BQueryPoseView::InitDirentIterator(const entry_ref* ref) timeData.tm_sec = 0; nextMinute = mktime(&timeData); - PRINT(("%ld seconds till next minute\n", nextMinute - now)); + PRINT(("%" B_PRId32 " seconds till next minute\n", nextMinute - now)); bigtime_t delta; if (fQueryListContainer->DynamicDateRefreshEveryMinute()) @@ -325,16 +325,18 @@ BQueryPoseView::InitDirentIterator(const entry_ref* ref) int32 hoursTillMidnight = minutesTillMidnight/60; minutesTillMidnight %= 60; - PRINT(("%ld hours, %ld minutes, %ld seconds till midnight\n", - hoursTillMidnight, minutesTillMidnight, secondsTillMidnight)); + PRINT(("%" B_PRId32 " hours, %" B_PRId32 " minutes, %" B_PRId32 + " seconds till midnight\n", hoursTillMidnight, minutesTillMidnight, + secondsTillMidnight)); int32 refreshInSeconds = delta % 60; int32 refreshInMinutes = delta / 60; int32 refreshInHours = refreshInMinutes / 60; refreshInMinutes %= 60; - PRINT(("next refresh in %ld hours, %ld minutes, %ld seconds\n", - refreshInHours, refreshInMinutes, refreshInSeconds)); + PRINT(("next refresh in %" B_PRId32 " hours, %" B_PRId32 "minutes, %" + B_PRId32 " seconds\n", refreshInHours, refreshInMinutes, + refreshInSeconds)); #endif // bump up to microseconds diff --git a/src/kits/tracker/Tests.cpp b/src/kits/tracker/Tests.cpp index 7b3c3f0b59..71ac80f89d 100644 --- a/src/kits/tracker/Tests.cpp +++ b/src/kits/tracker/Tests.cpp @@ -179,12 +179,12 @@ IconSpewer::DrawSomeNew() view->SetHighColor(Color(0, 0, 0)); char buffer[256]; if (cycleTime) { - sprintf(buffer, "last cycle time %Ld ms", cycleTime/1000); + sprintf(buffer, "last cycle time %" B_PRId64 " ms", cycleTime/1000); view->DrawString(buffer, BPoint(20, bounds.bottom - 20)); } if (numDrawn) { - sprintf(buffer, "average draw time %Ld us per icon", + sprintf(buffer, "average draw time %" B_PRId64 " us per icon", watch.ElapsedTime() / numDrawn); view->DrawString(buffer, BPoint(20, bounds.bottom - 30)); } diff --git a/src/kits/tracker/Utilities.cpp b/src/kits/tracker/Utilities.cpp index c9cca8c1b8..f5b2bb60a0 100644 --- a/src/kits/tracker/Utilities.cpp +++ b/src/kits/tracker/Utilities.cpp @@ -261,7 +261,7 @@ PoseInfo::EndianSwap(void* castToThis) void PoseInfo::PrintToStream() { - PRINT(("%s, inode:%Lx, location %f %f\n", + PRINT(("%s, inode:%" B_PRIx64 ", location %f %f\n", fInvisible ? "hidden" : "visible", fInitedDirectory, fLocation.x, fLocation.y)); }