Some build fixes for DEBUG=1.

This commit is contained in:
Alex Smith 2012-12-20 19:22:16 +00:00
parent e7bcffbb59
commit 6c6fcaf95b
6 changed files with 22 additions and 16 deletions

View File

@ -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)

View File

@ -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;

View File

@ -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);

View File

@ -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

View File

@ -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));
}

View File

@ -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));
}