From 3fed1a15f58e8d6fe6b492f3b94bb3625ffeddbd Mon Sep 17 00:00:00 2001 From: Alex Smith Date: Sun, 5 Aug 2012 08:46:30 +0100 Subject: [PATCH] Get app_server working on x86_64. With this commit, app_server now compiles and runs at boot! Nothing particularly interesting happens, just the blue background and a mouse pointer. Remote backends are broken and not compiled in, see #8834. Note that it won't be possible to build this quite yet, need to get the FreeType package uploaded. --- build/jam/Haiku64Image | 35 +++++++++--- build/jam/OptionalBuildFeatures | 4 +- headers/posix/netinet/in.h | 6 +- .../devices/wacom/MasterServerDevice.cpp | 2 +- src/kits/interface/ListView.cpp | 2 +- src/kits/network/libbind/irs/lcl_sv.cpp | 6 +- src/kits/network/libnetapi/init.cpp | 4 +- src/kits/shared/IconButton.cpp | 2 +- src/kits/translation/BitmapStream.cpp | 16 +++--- src/libs/linprog/Constraint.cpp | 2 +- src/libs/linprog/LinearSpec.cpp | 2 +- src/libs/linprog/Variable.cpp | 2 +- src/servers/app/AppServer.cpp | 10 ++-- src/servers/app/ClientMemoryAllocator.cpp | 16 +++--- src/servers/app/Desktop.cpp | 10 ++-- src/servers/app/DesktopSettings.cpp | 4 +- src/servers/app/DrawState.cpp | 12 ++-- src/servers/app/EventStream.cpp | 6 +- src/servers/app/IntPoint.cpp | 2 +- src/servers/app/IntRect.cpp | 3 +- src/servers/app/Jamfile | 7 ++- src/servers/app/MessageLooper.cpp | 4 +- src/servers/app/MultiLocker.cpp | 10 ++-- src/servers/app/MultiLocker.h | 4 +- src/servers/app/ScreenManager.cpp | 2 +- src/servers/app/ServerApp.cpp | 30 +++++----- src/servers/app/ServerBitmap.cpp | 5 +- src/servers/app/ServerFont.cpp | 2 +- src/servers/app/ServerWindow.cpp | 56 +++++++++---------- src/servers/app/View.cpp | 8 ++- .../app/drawing/AccelerantHWInterface.cpp | 2 +- .../app/drawing/Painter/AGGTextRenderer.cpp | 2 +- src/servers/app/font/FontCacheEntry.cpp | 2 +- src/servers/app/font/FontFamily.cpp | 2 +- src/servers/app/font/FontManager.cpp | 7 ++- src/servers/syslog_daemon/syslog_output.cpp | 6 +- 36 files changed, 167 insertions(+), 128 deletions(-) diff --git a/build/jam/Haiku64Image b/build/jam/Haiku64Image index 7f4f1b05a5..2139faeb50 100644 --- a/build/jam/Haiku64Image +++ b/build/jam/Haiku64Image @@ -40,13 +40,20 @@ SYSTEM_PREFERENCES = ; SYSTEM_DEMOS = ; -SYSTEM_LIBS = libbe.so libroot.so libroot-addon-icu.so +SYSTEM_LIBS = libbe.so libbnetapi.so libnetwork.so + libroot.so libroot-addon-icu.so + libtextencoding.so libtranslation.so $(HAIKU_SHARED_LIBSTDC++) $(HAIKU_SHARED_LIBSUPC++) + $(HAIKU_FREETYPE_CURRENT_LIB) ; PRIVATE_SYSTEM_LIBS = ; -SYSTEM_SERVERS = registrar ; +SYSTEM_SERVERS = app_server input_server registrar syslog_daemon ; + +SYSTEM_ADD_ONS_ACCELERANTS = vesa.accelerant ; + +SYSTEM_ADD_ONS_DRIVERS_GRAPHICS = vesa ; SYSTEM_ADD_ONS_BUS_MANAGERS = $(ATA_ONLY)ata pci ps2 isa scsi config_manager ; SYSTEM_ADD_ONS_FILE_SYSTEMS = bfs iso9660 attribute_overlay write_overlay ; @@ -79,6 +86,7 @@ AddNewDriversToHaikuImage disk scsi : scsi_cd scsi_disk ; # legacy drivers AddDriversToHaikuImage : console dprintf null random tty zero ; +AddDriversToHaikuImage graphics : $(SYSTEM_ADD_ONS_DRIVERS_GRAPHICS) ; AddDriversToHaikuImage input : ps2_hid ; # kernel @@ -88,6 +96,12 @@ AddFilesToHaikuImage system : kernel_$(TARGET_ARCH) ; AddLibrariesToHaikuHybridImage system lib : $(SYSTEM_LIBS) $(PRIVATE_SYSTEM_LIBS) ; +# libfreetype.so links to the current freetype lib +AddSymlinkToHaikuHybridImage system lib : $(HAIKU_FREETYPE_CURRENT_LIB:BS) + : $(HAIKU_FREETYPE_CURRENT_LINK) : : true ; +AddSymlinkToHaikuHybridImage system lib : $(HAIKU_FREETYPE_CURRENT_LINK) + : libfreetype.so : : true ; + # servers AddFilesToHaikuImage system servers : $(SYSTEM_SERVERS) ; @@ -139,11 +153,11 @@ local fortuneFiles = [ Glob $(HAIKU_TOP)/data/system/data/fortunes fortuneFiles = $(fortuneFiles:G=data!fortunes) ; AddFilesToHaikuImage system data fortunes : $(fortuneFiles) ; -#local fontDir = [ FDirName $(HAIKU_TOP) data system data fonts ] ; -#local psFonts = [ Glob $(fontDir)/psfonts : *.afm *.pfb ] ; -#local ttFonts = [ Glob $(fontDir)/ttfonts : *.ttf ] ; -#AddFilesToHaikuImage system data fonts psfonts : $(psFonts) ; -#AddFilesToHaikuImage system data fonts ttfonts : $(ttFonts) ; +local fontDir = [ FDirName $(HAIKU_TOP) data system data fonts ] ; +local psFonts = [ Glob $(fontDir)/psfonts : *.afm *.pfb ] ; +local ttFonts = [ Glob $(fontDir)/ttfonts : *.ttf ] ; +AddFilesToHaikuImage system data fonts psfonts : $(psFonts) ; +AddFilesToHaikuImage system data fonts ttfonts : $(ttFonts) ; local keymapFiles = [ Glob [ FDirName $(HAIKU_TOP) src data keymaps ] : *.keymap ] ; @@ -218,6 +232,13 @@ AddBootModuleSymlinksToHaikuImage bfs ; +# add-ons +AddFilesToHaikuImage system add-ons accelerants + : $(SYSTEM_ADD_ONS_ACCELERANTS) ; + +AddFilesToHaikuImage system add-ons input_server devices + : keyboard mouse tablet wacom ; + # create directories that will remain empty AddDirectoryToHaikuImage common bin ; AddDirectoryToHaikuImage common include ; diff --git a/build/jam/OptionalBuildFeatures b/build/jam/OptionalBuildFeatures index a77f820e47..aaed4ed7ee 100644 --- a/build/jam/OptionalBuildFeatures +++ b/build/jam/OptionalBuildFeatures @@ -380,9 +380,11 @@ if $(TARGET_ARCH) = x86 { # Freetype local freetypeBaseURL = $(baseURL)/lib ; -if $(TARGET_ARCH) = ppc || $(TARGET_ARCH) = x86 { +if $(TARGET_ARCH) = ppc || $(TARGET_ARCH) = x86 || $(TARGET_ARCH) = x86_64 { if $(TARGET_ARCH) = ppc { HAIKU_FREETYPE_FILE = freetype-2.4.9-ppc-gcc4-2012-06-26.zip ; + } else if $(TARGET_ARCH) = x86_64 { + HAIKU_FREETYPE_FILE = freetype-2.4.9-x86_64-2012-08-04.zip ; } else if $(HAIKU_GCC_VERSION[1]) >= 4 { HAIKU_FREETYPE_FILE = freetype-2.4.9-x86-gcc4-2012-06-15.zip ; } else { diff --git a/headers/posix/netinet/in.h b/headers/posix/netinet/in.h index 36310d1161..ab891cb8dd 100644 --- a/headers/posix/netinet/in.h +++ b/headers/posix/netinet/in.h @@ -26,7 +26,11 @@ typedef uint32_t in_addr_t; * and we are not allowed to import all the BeOS types here. */ #ifndef htonl - extern unsigned long __swap_int32(unsigned long); /* private */ +# ifdef __HAIKU_BEOS_COMPATIBLE_TYPES + extern unsigned long __swap_int32(unsigned long); /* private */ +# else + extern unsigned int __swap_int32(unsigned int); /* private */ +# endif extern uint16_t __swap_int16(uint16_t); /* private */ # if BYTE_ORDER == LITTLE_ENDIAN # define htonl(x) ((uint32_t)__swap_int32(x)) diff --git a/src/add-ons/input_server/devices/wacom/MasterServerDevice.cpp b/src/add-ons/input_server/devices/wacom/MasterServerDevice.cpp index 4c3675d63f..69ea6fd8e0 100644 --- a/src/add-ons/input_server/devices/wacom/MasterServerDevice.cpp +++ b/src/add-ons/input_server/devices/wacom/MasterServerDevice.cpp @@ -60,7 +60,7 @@ MasterServerDevice::~MasterServerDevice() // cleanup _StopAll(); if (_LockDevices()) { - while (PointingDevice* device = (PointingDevice*)fDevices.RemoveItem(0L)) + while (PointingDevice* device = (PointingDevice*)fDevices.RemoveItem((int32)0)) delete device; _UnlockDevices(); } diff --git a/src/kits/interface/ListView.cpp b/src/kits/interface/ListView.cpp index 508900f746..77755d9e3d 100644 --- a/src/kits/interface/ListView.cpp +++ b/src/kits/interface/ListView.cpp @@ -498,7 +498,7 @@ BListView::MouseDown(BPoint point) doubleClick = true; if (doubleClick && index >= fFirstSelected && index <= fLastSelected) { - fTrack->drag_start.Set(LONG_MAX, LONG_MAX); + fTrack->drag_start.Set(INT32_MAX, INT32_MAX); Invoke(); return; } diff --git a/src/kits/network/libbind/irs/lcl_sv.cpp b/src/kits/network/libbind/irs/lcl_sv.cpp index 0d1f2e423c..c0e7218156 100644 --- a/src/kits/network/libbind/irs/lcl_sv.cpp +++ b/src/kits/network/libbind/irs/lcl_sv.cpp @@ -107,9 +107,9 @@ find_own_image(image_info* _info) int32 cookie = 0; image_info info; while (get_next_image_info(B_CURRENT_TEAM, &cookie, &info) == B_OK) { - if (((uint32)info.text <= (uint32)find_own_image - && (uint32)info.text + (uint32)info.text_size - > (uint32)find_own_image)) { + if (((addr_t)info.text <= (addr_t)find_own_image + && (addr_t)info.text + (size_t)info.text_size + > (addr_t)find_own_image)) { // found us *_info = info; return B_OK; diff --git a/src/kits/network/libnetapi/init.cpp b/src/kits/network/libnetapi/init.cpp index bffee43a83..c311573fdd 100644 --- a/src/kits/network/libnetapi/init.cpp +++ b/src/kits/network/libnetapi/init.cpp @@ -20,8 +20,8 @@ find_own_image() int32 cookie = 0; image_info info; while (get_next_image_info(B_CURRENT_TEAM, &cookie, &info) == B_OK) { - if (((uint32)info.text <= (uint32)find_own_image - && (uint32)info.text + (uint32)info.text_size > (uint32)find_own_image)) { + if (((addr_t)info.text <= (addr_t)find_own_image + && (addr_t)info.text + (size_t)info.text_size > (addr_t)find_own_image)) { // found us __gNetAPIStart = (addr_t)min_c(info.text, info.data); __gNetAPIEnd = min_c((addr_t)info.text + info.text_size, diff --git a/src/kits/shared/IconButton.cpp b/src/kits/shared/IconButton.cpp index 5881fd5bd5..fb55ff030e 100644 --- a/src/kits/shared/IconButton.cpp +++ b/src/kits/shared/IconButton.cpp @@ -520,7 +520,7 @@ BIconButton::TrimIcon(bool keepAspect) uint32 bpr = fNormalBitmap->BytesPerRow(); uint32 width = fNormalBitmap->Bounds().IntegerWidth() + 1; uint32 height = fNormalBitmap->Bounds().IntegerHeight() + 1; - BRect trimmed(LONG_MAX, LONG_MAX, LONG_MIN, LONG_MIN); + BRect trimmed(INT32_MAX, INT32_MAX, INT32_MIN, INT32_MIN); for (uint32 y = 0; y < height; y++) { uint8* b = bits + 3; bool rowHasAlpha = false; diff --git a/src/kits/translation/BitmapStream.cpp b/src/kits/translation/BitmapStream.cpp index 5faf1c360b..db2572f62f 100644 --- a/src/kits/translation/BitmapStream.cpp +++ b/src/kits/translation/BitmapStream.cpp @@ -82,13 +82,13 @@ BBitmapStream::ReadAt(off_t pos, void* buffer, size_t size) return B_NO_INIT; if (size == 0) return B_OK; - if (pos >= fSize || pos < 0 || buffer == NULL) + if (pos >= (off_t)fSize || pos < 0 || buffer == NULL) return B_BAD_VALUE; ssize_t toRead; void *source; - if (pos < sizeof(TranslatorBitmap)) { + if (pos < (off_t)sizeof(TranslatorBitmap)) { toRead = sizeof(TranslatorBitmap) - pos; source = (reinterpret_cast(fBigEndianHeader)) + pos; } else { @@ -122,7 +122,7 @@ BBitmapStream::WriteAt(off_t pos, const void* data, size_t size) { if (size == 0) return B_OK; - if (!data || pos < 0 || pos > fSize) + if (!data || pos < 0 || pos > (off_t)fSize) return B_BAD_VALUE; ssize_t written = 0; @@ -131,7 +131,7 @@ BBitmapStream::WriteAt(off_t pos, const void* data, size_t size) void *dest; // We depend on writing the header separately in detecting // changes to it - if (pos < sizeof(TranslatorBitmap)) { + if (pos < (off_t)sizeof(TranslatorBitmap)) { toWrite = sizeof(TranslatorBitmap) - pos; dest = (reinterpret_cast (&fHeader)) + pos; } else { @@ -153,7 +153,7 @@ BBitmapStream::WriteAt(off_t pos, const void* data, size_t size) written += toWrite; data = (reinterpret_cast (data)) + toWrite; size -= toWrite; - if (pos > fSize) + if (pos > (off_t)fSize) fSize = pos; // If we change the header, the rest needs to be reset if (pos == sizeof(TranslatorBitmap)) { @@ -185,7 +185,7 @@ BBitmapStream::WriteAt(off_t pos, const void* data, size_t size) return error; } if ((uint32)fBitmap->BytesPerRow() != fHeader.rowBytes) { - fprintf(stderr, "BitmapStream %ld %ld\n", + fprintf(stderr, "BitmapStream %" B_PRId32 " %" B_PRId32 "\n", fBitmap->BytesPerRow(), fHeader.rowBytes); return B_MISMATCHED_VALUES; } @@ -218,7 +218,7 @@ BBitmapStream::Seek(off_t position, uint32 seekMode) else if (seekMode == SEEK_END) position += fSize; - if (position < 0 || position > fSize) + if (position < 0 || position > (off_t)fSize) return B_BAD_VALUE; fPosition = position; @@ -257,7 +257,7 @@ BBitmapStream::SetSize(off_t size) { if (size < 0) return B_BAD_VALUE; - if (fBitmap && (size > fHeader.dataSize + sizeof(TranslatorBitmap))) + if (fBitmap && (size > (off_t)(fHeader.dataSize + sizeof(TranslatorBitmap)))) return B_BAD_VALUE; // Problem: // What if someone calls SetSize() before writing the header, diff --git a/src/libs/linprog/Constraint.cpp b/src/libs/linprog/Constraint.cpp index e723c3a43f..e6a34d2b5a 100644 --- a/src/libs/linprog/Constraint.cpp +++ b/src/libs/linprog/Constraint.cpp @@ -344,7 +344,7 @@ Constraint::ToString() const BString string; string << "Constraint "; string << fLabel; - string << "(" << (int32)this << "): "; + string << "(" << (addr_t)this << "): "; if (fIsValid) { for (int i = 0; i < fLeftSide->CountItems(); i++) { diff --git a/src/libs/linprog/LinearSpec.cpp b/src/libs/linprog/LinearSpec.cpp index a266f0485f..7dffdf1d5d 100644 --- a/src/libs/linprog/LinearSpec.cpp +++ b/src/libs/linprog/LinearSpec.cpp @@ -656,7 +656,7 @@ BString LinearSpec::ToString() const { BString string; - string << "LinearSpec " << (int32)this << ":\n"; + string << "LinearSpec " << (addr_t)this << ":\n"; for (int i = 0; i < fVariables.CountItems(); i++) { Variable* variable = fVariables.ItemAt(i); string += variable->ToString(); diff --git a/src/libs/linprog/Variable.cpp b/src/libs/linprog/Variable.cpp index 2febce1cff..51cf3fa1a0 100644 --- a/src/libs/linprog/Variable.cpp +++ b/src/libs/linprog/Variable.cpp @@ -175,7 +175,7 @@ Variable::ToString() const } else { string << "Variable "; if (!fIsValid) - string << "(invalid," << (int32)this << ")"; + string << "(invalid," << (addr_t)this << ")"; else string << Index(); } diff --git a/src/servers/app/AppServer.cpp b/src/servers/app/AppServer.cpp index 76e09927c3..a17a9d0e64 100644 --- a/src/servers/app/AppServer.cpp +++ b/src/servers/app/AppServer.cpp @@ -189,9 +189,9 @@ AppServer::_DispatchMessage(int32 code, BPrivate::LinkReceiver& msg) int32 version; if (msg.Read(&version) < B_OK || version != AS_PROTOCOL_VERSION) { - syslog(LOG_ERR, "Application for user %ld with port %ld does " - "not support the current server protocol.\n", userID, - replyPort); + syslog(LOG_ERR, "Application for user %" B_PRId32 " with port " + "%" B_PRId32 " does not support the current server " + "protocol.\n", userID, replyPort); } else { desktop = _FindDesktop(userID, targetScreen); if (desktop == NULL) { @@ -245,8 +245,8 @@ AppServer::_DispatchMessage(int32 code, BPrivate::LinkReceiver& msg) #endif default: - STRACE(("Server::MainLoop received unexpected code %ld (offset %ld)\n", - code, code - SERVER_TRUE)); + STRACE(("Server::MainLoop received unexpected code %" B_PRId32 " " + "(offset %" B_PRId32 ")\n", code, code - SERVER_TRUE)); break; } } diff --git a/src/servers/app/ClientMemoryAllocator.cpp b/src/servers/app/ClientMemoryAllocator.cpp index a1ab4cfce8..8f3001d992 100644 --- a/src/servers/app/ClientMemoryAllocator.cpp +++ b/src/servers/app/ClientMemoryAllocator.cpp @@ -189,14 +189,14 @@ ClientMemoryAllocator::Free(block* freeBlock) void ClientMemoryAllocator::Dump() { - debug_printf("Application %ld, %s: chunks:\n", fApplication->ClientTeam(), - fApplication->Signature()); + debug_printf("Application %" B_PRId32 ", %s: chunks:\n", + fApplication->ClientTeam(), fApplication->Signature()); chunk_list::Iterator iterator = fChunks.GetIterator(); int32 i = 0; while (struct chunk* chunk = iterator.Next()) { - debug_printf(" [%4ld] %p, area %ld, base %p, size %lu\n", i++, chunk, - chunk->area, chunk->base, chunk->size); + debug_printf(" [%4" B_PRId32 "] %p, area %" B_PRId32 ", base %p, " + "size %lu\n", i++, chunk, chunk->area, chunk->base, chunk->size); } debug_printf("free blocks:\n"); @@ -204,8 +204,8 @@ ClientMemoryAllocator::Dump() block_list::Iterator blockIterator = fFreeBlocks.GetIterator(); i = 0; while (struct block* block = blockIterator.Next()) { - debug_printf(" [%6ld] %p, chunk %p, base %p, size %lu\n", i++, block, - block->chunk, block->base, block->size); + debug_printf(" [%6" B_PRId32 "] %p, chunk %p, base %p, size %lu\n", + i++, block, block->chunk, block->base, block->size); } } @@ -254,8 +254,8 @@ ClientMemoryAllocator::_AllocateChunk(size_t size, bool& newArea) #ifdef HAIKU_TARGET_PLATFORM_LIBBE_TEST strcpy(name, "client heap"); #else - snprintf(name, sizeof(name), "heap:%ld:%s", fApplication->ClientTeam(), - fApplication->SignatureLeaf()); + snprintf(name, sizeof(name), "heap:%" B_PRId32 ":%s", + fApplication->ClientTeam(), fApplication->SignatureLeaf()); #endif area_id area = create_area(name, (void**)&address, B_ANY_ADDRESS, size, B_NO_LOCK, B_READ_AREA | B_WRITE_AREA); diff --git a/src/servers/app/Desktop.cpp b/src/servers/app/Desktop.cpp index 3b280e2c50..1a0bc3178f 100644 --- a/src/servers/app/Desktop.cpp +++ b/src/servers/app/Desktop.cpp @@ -203,7 +203,7 @@ KeyboardFilter::Filter(BMessage* message, EventTarget** _target, if ((modifiers & B_CONTROL_KEY) != 0) #endif { - STRACE(("Set Workspace %ld\n", key - 1)); + STRACE(("Set Workspace %" B_PRId32 "\n", key - 1)); fDesktop->SetWorkspaceAsync(key - B_F1_KEY, takeWindow); return B_SKIP_MESSAGE; @@ -2640,8 +2640,8 @@ Desktop::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link) } default: - printf("Desktop %d:%s received unexpected code %ld\n", 0, "baron", - code); + printf("Desktop %d:%s received unexpected code %" B_PRId32 "\n", 0, + "baron", code); if (link.NeedsReply()) { // the client is now blocking and waiting for a reply! @@ -3366,8 +3366,8 @@ Desktop::_SetCurrentWorkspaceConfiguration() if (status != B_OK) { // The application having the direct screen lock didn't give it up in // time, make it crash - syslog(LOG_ERR, "Team %ld did not give up its direct screen lock.\n", - fDirectScreenTeam); + syslog(LOG_ERR, "Team %" B_PRId32 " did not give up its direct screen " + "lock.\n", fDirectScreenTeam); debug_thread(fDirectScreenTeam); fDirectScreenTeam = -1; diff --git a/src/servers/app/DesktopSettings.cpp b/src/servers/app/DesktopSettings.cpp index c983c69ad0..ea269a7acc 100644 --- a/src/servers/app/DesktopSettings.cpp +++ b/src/servers/app/DesktopSettings.cpp @@ -293,7 +293,7 @@ DesktopSettingsPrivate::_Load() // colors for (int32 i = 0; i < kNumColors; i++) { char colorName[12]; - snprintf(colorName, sizeof(colorName), "color%ld", + snprintf(colorName, sizeof(colorName), "color%" B_PRId32, (int32)index_to_color_which(i)); settings.FindInt32(colorName, (int32*)&fShared.colors[i]); @@ -438,7 +438,7 @@ DesktopSettingsPrivate::Save(uint32 mask) for (int32 i = 0; i < kNumColors; i++) { char colorName[12]; - snprintf(colorName, sizeof(colorName), "color%ld", + snprintf(colorName, sizeof(colorName), "color%" B_PRId32, (int32)index_to_color_which(i)); settings.AddInt32(colorName, (const int32&)fShared.colors[i]); } diff --git a/src/servers/app/DrawState.cpp b/src/servers/app/DrawState.cpp index f1c16c649f..da95451036 100644 --- a/src/servers/app/DrawState.cpp +++ b/src/servers/app/DrawState.cpp @@ -635,10 +635,10 @@ DrawState::PrintToStream() const fHighColor.red, fHighColor.green, fHighColor.blue, fHighColor.alpha); printf("\t LowColor: r=%d g=%d b=%d a=%d\n", fLowColor.red, fLowColor.green, fLowColor.blue, fLowColor.alpha); - printf("\t Pattern: %llu\n", fPattern.GetInt64()); + printf("\t Pattern: %" B_PRIu64 "\n", fPattern.GetInt64()); - printf("\t DrawMode: %lu\n", (uint32)fDrawingMode); - printf("\t AlphaSrcMode: %ld\t AlphaFncMode: %ld\n", + printf("\t DrawMode: %" B_PRIu32 "\n", (uint32)fDrawingMode); + printf("\t AlphaSrcMode: %" B_PRId32 "\t AlphaFncMode: %" B_PRId32 "\n", (int32)fAlphaSrcMode, (int32)fAlphaFncMode); printf("\t LineCap: %d\t LineJoin: %d\t MiterLimit: %.2f\n", @@ -652,9 +652,9 @@ DrawState::PrintToStream() const printf("\t Size: %.1f (%.1f)\n", fFont.Size(), fUnscaledFontSize); printf("\t Shear: %.2f\n", fFont.Shear()); printf("\t Rotation: %.2f\n", fFont.Rotation()); - printf("\t Spacing: %ld\n", fFont.Spacing()); - printf("\t Encoding: %ld\n", fFont.Encoding()); + printf("\t Spacing: %" B_PRId32 "\n", fFont.Spacing()); + printf("\t Encoding: %" B_PRId32 "\n", fFont.Encoding()); printf("\t Face: %d\n", fFont.Face()); - printf("\t Flags: %lu\n", fFont.Flags()); + printf("\t Flags: %" B_PRIu32 "\n", fFont.Flags()); } diff --git a/src/servers/app/EventStream.cpp b/src/servers/app/EventStream.cpp index 73f968680f..803467b1de 100644 --- a/src/servers/app/EventStream.cpp +++ b/src/servers/app/EventStream.cpp @@ -266,9 +266,9 @@ InputServerStream::_MessageFromPort(BMessage** _message, bigtime_t timeout) delete[] buffer; if (status != B_OK) { - printf("Unflatten event failed: %s, port message code was: %ld - %c%c%c%c\n", - strerror(status), code, (int8)(code >> 24), (int8)(code >> 16), - (int8)(code >> 8), (int8)code); + printf("Unflatten event failed: %s, port message code was: %" B_PRId32 + " - %c%c%c%c\n", strerror(status), code, (int8)(code >> 24), + (int8)(code >> 16), (int8)(code >> 8), (int8)code); delete message; return status; } diff --git a/src/servers/app/IntPoint.cpp b/src/servers/app/IntPoint.cpp index 4a6fe90c32..d974e49e86 100644 --- a/src/servers/app/IntPoint.cpp +++ b/src/servers/app/IntPoint.cpp @@ -26,7 +26,7 @@ IntPoint::ConstrainTo(const IntRect& r) void IntPoint::PrintToStream() const { - printf("IntPoint(x:%ld, y:%ld)\n", x, y); + printf("IntPoint(x:%" B_PRId32 ", y:%" B_PRId32 ")\n", x, y); } diff --git a/src/servers/app/IntRect.cpp b/src/servers/app/IntRect.cpp index f3e0c39105..7c9a53d4c0 100644 --- a/src/servers/app/IntRect.cpp +++ b/src/servers/app/IntRect.cpp @@ -209,7 +209,8 @@ IntRect::OffsetToCopy(int32 dx, int32 dy) void IntRect::PrintToStream() const { - printf("IntRect(l:%ld, t:%ld, r:%ld, b:%ld)\n", left, top, right, bottom); + printf("IntRect(l:%" B_PRId32 ", t:%" B_PRId32 ", r:%" B_PRId32 ", b:%" + B_PRId32 ")\n", left, top, right, bottom); } diff --git a/src/servers/app/Jamfile b/src/servers/app/Jamfile index 7011f32ad6..3974d1221a 100644 --- a/src/servers/app/Jamfile +++ b/src/servers/app/Jamfile @@ -36,6 +36,11 @@ Includes [ FGristFiles AppServer.cpp BitmapManager.cpp : $(HAIKU_FREETYPE_HEADERS_DEPENDENCY) ; +local BROKEN_64 = ; +if $(TARGET_ARCH) != x86_64 { + BROKEN_64 = "" ; +} + Server app_server : Angle.cpp AppServer.cpp @@ -87,7 +92,7 @@ Server app_server : # libraries : libtranslation.so libbe.so libbnetapi.so - libasdrawing.a libasremote.a libashtml5.a + libasdrawing.a $(BROKEN_64)libasremote.a $(BROKEN_64)libashtml5.a libpainter.a libagg.a $(HAIKU_FREETYPE_LIB) libstackandtile.a liblinprog.a libtextencoding.so libshared.a $(TARGET_LIBSTDC++) diff --git a/src/servers/app/MessageLooper.cpp b/src/servers/app/MessageLooper.cpp index 507092da50..e801712eed 100644 --- a/src/servers/app/MessageLooper.cpp +++ b/src/servers/app/MessageLooper.cpp @@ -147,8 +147,8 @@ MessageLooper::_MessageLooper() // that shouldn't happen, it's our port char name[256]; _GetLooperName(name, 256); - printf("MessageLooper \"%s\": Someone deleted our message port %ld, %s!\n", - name, receiver.Port(), strerror(status)); + printf("MessageLooper \"%s\": Someone deleted our message port %" + B_PRId32 ", %s!\n", name, receiver.Port(), strerror(status)); break; } diff --git a/src/servers/app/MultiLocker.cpp b/src/servers/app/MultiLocker.cpp index f693a31060..979a360635 100644 --- a/src/servers/app/MultiLocker.cpp +++ b/src/servers/app/MultiLocker.cpp @@ -149,7 +149,7 @@ MultiLocker::InitCheck() contained. */ bool -MultiLocker::IsWriteLocked(uint32* _stackBase, thread_id* _thread) const +MultiLocker::IsWriteLocked(addr_t* _stackBase, thread_id* _thread) const { #if TIMING bigtime_t start = system_time(); @@ -163,7 +163,7 @@ MultiLocker::IsWriteLocked(uint32* _stackBase, thread_id* _thread) const // this is managed by taking the address of the item on the // stack and dividing it by the size of the memory pages // if it is the same as the cached stack_page, there is a match - uint32 stackBase = (uint32)&writeLockHolder / B_PAGE_SIZE; + addr_t stackBase = (addr_t)&writeLockHolder / B_PAGE_SIZE; thread_id thread = 0; if (fWriterStackBase == stackBase) { @@ -248,7 +248,7 @@ MultiLocker::WriteLock() bool locked = false; if (fInit == B_OK) { - uint32 stackBase = 0; + addr_t stackBase = 0; thread_id thread = -1; if (IsWriteLocked(&stackBase, &thread)) { @@ -434,7 +434,7 @@ MultiLocker::WriteLock() if (fInit != B_OK) debugger("lock not initialized"); - uint32 stackBase = 0; + addr_t stackBase = 0; thread_id thread = -1; if (IsWriteLocked(&stackBase, &thread)) { @@ -508,7 +508,7 @@ MultiLocker::WriteUnlock() } else { char message[256]; snprintf(message, sizeof(message), "Non-writer attempting to " - "WriteUnlock() - write holder: %ld", fWriterThread); + "WriteUnlock() - write holder: %" B_PRId32, fWriterThread); debugger(message); } diff --git a/src/servers/app/MultiLocker.h b/src/servers/app/MultiLocker.h index 318aea9012..eac9ea5ea6 100644 --- a/src/servers/app/MultiLocker.h +++ b/src/servers/app/MultiLocker.h @@ -57,7 +57,7 @@ public: bool WriteUnlock(); // does the current thread hold a write lock ? - bool IsWriteLocked(uint32 *stackBase = NULL, + bool IsWriteLocked(addr_t *stackBase = NULL, thread_id *thread = NULL) const; #if MULTI_LOCKER_DEBUG @@ -97,7 +97,7 @@ private: status_t fInit; int32 fWriterNest; thread_id fWriterThread; - uint32 fWriterStackBase; + addr_t fWriterStackBase; #if MULTI_LOCKER_TIMING uint32 rl_count; diff --git a/src/servers/app/ScreenManager.cpp b/src/servers/app/ScreenManager.cpp index 064bb79f2d..fda23d34c7 100644 --- a/src/servers/app/ScreenManager.cpp +++ b/src/servers/app/ScreenManager.cpp @@ -105,7 +105,7 @@ ScreenManager::AcquireScreens(ScreenOwner* owner, int32* wishList, } } -#if TEST_MODE == 0 +#if TEST_MODE == 0 && !defined(__x86_64__) if (added == 0 && target != NULL) { // there's a specific target screen we want to initialize // TODO: right now we only support remote screens, but we could diff --git a/src/servers/app/ServerApp.cpp b/src/servers/app/ServerApp.cpp index 6f7a6b92d5..90651ea40d 100644 --- a/src/servers/app/ServerApp.cpp +++ b/src/servers/app/ServerApp.cpp @@ -109,7 +109,8 @@ ServerApp::ServerApp(Desktop* desktop, port_id clientReplyPort, fSignature = "application/no-signature"; char name[B_OS_NAME_LENGTH]; - snprintf(name, sizeof(name), "a<%ld:%s", clientTeam, SignatureLeaf()); + snprintf(name, sizeof(name), "a<%" B_PRId32 ":%s", clientTeam, + SignatureLeaf()); fMessagePort = create_port(DEFAULT_MONITOR_PORT_SIZE, name); if (fMessagePort < B_OK) @@ -141,8 +142,8 @@ ServerApp::ServerApp(Desktop* desktop, port_id clientReplyPort, desktop->UnlockSingleWindow(); STRACE(("ServerApp %s:\n", Signature())); - STRACE(("\tBApp port: %ld\n", fClientReplyPort)); - STRACE(("\tReceiver port: %ld\n", fMessagePort)); + STRACE(("\tBApp port: %" B_PRId32 "\n", fClientReplyPort)); + STRACE(("\tReceiver port: %" B_PRId32 "\n", fMessagePort)); } @@ -505,7 +506,7 @@ ServerApp::NotifyDeleteClientArea(area_id serverArea) void ServerApp::_GetLooperName(char* name, size_t length) { - snprintf(name, length, "a:%ld:%s", ClientTeam(), SignatureLeaf()); + snprintf(name, length, "a:%" B_PRId32 ":%s", ClientTeam(), SignatureLeaf()); } @@ -567,13 +568,14 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link) { fMapLocker.Lock(); - debug_printf("Application %ld, %s: %d bitmaps:\n", ClientTeam(), - Signature(), (int)fBitmapMap.size()); + debug_printf("Application %" B_PRId32 ", %s: %d bitmaps:\n", + ClientTeam(), Signature(), (int)fBitmapMap.size()); BitmapMap::const_iterator iterator = fBitmapMap.begin(); for (; iterator != fBitmapMap.end(); iterator++) { ServerBitmap* bitmap = iterator->second; - debug_printf(" [%ld] %ldx%ld, area %ld, size %ld\n", + debug_printf(" [%" B_PRId32 "] %" B_PRId32 "x%" B_PRId32 ", " + "area %" B_PRId32 ", size %" B_PRId32 "\n", bitmap->Token(), bitmap->Width(), bitmap->Height(), bitmap->Area(), bitmap->BitsLength()); } @@ -765,8 +767,8 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link) ServerBitmap* bitmap = _FindBitmap(token); if (bitmap != NULL) { - STRACE(("ServerApp %s: Deleting Bitmap %ld\n", Signature(), - token)); + STRACE(("ServerApp %s: Deleting Bitmap %" B_PRId32 "\n", + Signature(), token)); _DeleteBitmap(bitmap); } @@ -787,7 +789,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link) ServerBitmap* bitmap = GetBitmap(token); if (bitmap != NULL) { STRACE(("ServerApp %s: Get overlay restrictions for bitmap " - "%ld\n", Signature(), token)); + "%" B_PRId32 "\n", Signature(), token)); status = fDesktop->HWInterface()->GetOverlayRestrictions( bitmap->Overlay(), &restrictions); @@ -3161,8 +3163,8 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link) } default: - printf("ServerApp %s received unhandled message code %ld\n", - Signature(), code); + printf("ServerApp %s received unhandled message code %" B_PRId32 + "\n", Signature(), code); if (link.NeedsReply()) { // the client is now blocking and waiting for a reply! @@ -3199,8 +3201,8 @@ ServerApp::_MessageLooper() status_t err = B_OK; while (!fQuitting) { - STRACE(("info: ServerApp::_MessageLooper() listening on port %ld.\n", - fMessagePort)); + STRACE(("info: ServerApp::_MessageLooper() listening on port %" B_PRId32 + ".\n", fMessagePort)); err = receiver.GetNextMessage(code, B_INFINITE_TIMEOUT); if (err != B_OK || code == B_QUIT_REQUESTED) { diff --git a/src/servers/app/ServerBitmap.cpp b/src/servers/app/ServerBitmap.cpp index be3806fdb3..0123bbfb21 100644 --- a/src/servers/app/ServerBitmap.cpp +++ b/src/servers/app/ServerBitmap.cpp @@ -209,8 +209,9 @@ ServerBitmap::Owner() const void ServerBitmap::PrintToStream() { - printf("Bitmap@%p: (%ld:%ld), space %ld, bpr %ld, buffer %p\n", - this, fWidth, fHeight, (int32)fSpace, fBytesPerRow, fBuffer); + printf("Bitmap@%p: (%" B_PRId32 ":%" B_PRId32 "), space %" B_PRId32 ", " + "bpr %" B_PRId32 ", buffer %p\n", this, fWidth, fHeight, (int32)fSpace, + fBytesPerRow, fBuffer); } diff --git a/src/servers/app/ServerFont.cpp b/src/servers/app/ServerFont.cpp index 6102961bce..0c5a616387 100644 --- a/src/servers/app/ServerFont.cpp +++ b/src/servers/app/ServerFont.cpp @@ -666,7 +666,7 @@ class BoundingBoxConsumer { BoundingBoxConsumer(Transformable& transform, BRect* rectArray, bool asString) : rectArray(rectArray) - , stringBoundingBox(LONG_MAX, LONG_MAX, LONG_MIN, LONG_MIN) + , stringBoundingBox(INT32_MAX, INT32_MAX, INT32_MIN, INT32_MIN) , fAsString(asString) , fCurves(fPathAdaptor) , fContour(fCurves) diff --git a/src/servers/app/ServerWindow.cpp b/src/servers/app/ServerWindow.cpp index 8ffea2423f..1e33f70942 100644 --- a/src/servers/app/ServerWindow.cpp +++ b/src/servers/app/ServerWindow.cpp @@ -234,14 +234,14 @@ ServerWindow::~ServerWindow() for (int32 i = 0; i < count; i++) { profile* p = (profile*)profiles.ItemAtFast(i); string_for_message_code(p->code, codeName); - printf("[%s] called %ld times, %g secs (%Ld usecs per call)\n", - codeName.String(), p->count, p->time / 1000000.0, + printf("[%s] called %" B_PRId32 " times, %g secs (%" B_PRId64 " usecs " + "per call)\n", codeName.String(), p->count, p->time / 1000000.0, p->time / p->count); } if (sRedrawProcessingTime.count > 0) { - printf("average redraw processing time: %g secs, count: %ld (%lld " - "usecs per call)\n", sRedrawProcessingTime.time / 1000000.0, - sRedrawProcessingTime.count, + printf("average redraw processing time: %g secs, count: %" B_PRId32 " " + "(%" B_PRId64 " usecs per call)\n", + sRedrawProcessingTime.time / 1000000.0, sRedrawProcessingTime.count, sRedrawProcessingTime.time / sRedrawProcessingTime.count); } // if (sNextMessageTime.count > 0) { @@ -326,7 +326,7 @@ ServerWindow::_GetLooperName(char* name, size_t length) if (title == NULL || !title[0]) title = "Unnamed Window"; - snprintf(name, length, "w:%ld:%s", ClientTeam(), title); + snprintf(name, length, "w:%" B_PRId32 ":%s", ClientTeam(), title); } @@ -522,7 +522,7 @@ ServerWindow::_CreateView(BPrivate::LinkReceiver& link, View** _parent) link.Read(&viewColor); link.Read(&parentToken); - STRACE(("ServerWindow(%s)::_CreateView()-> view %s, token %ld\n", + STRACE(("ServerWindow(%s)::_CreateView()-> view %s, token %" B_PRId32 "\n", fTitle, name, token)); View* newView; @@ -612,8 +612,8 @@ ServerWindow::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link) link.Read(&minimize); if (link.Read(&showLevel) == B_OK) { DTRACE(("ServerWindow %s: Message AS_MINIMIZE_WINDOW, " - "showLevel: %ld, minimize: %d\n", Title(), showLevel, - minimize)); + "showLevel: %" B_PRId32 ", minimize: %d\n", Title(), + showLevel, minimize)); if (showLevel <= 0) { // window is currently hidden - ignore the minimize request @@ -942,8 +942,8 @@ ServerWindow::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link) link.Read(&maxHeight); */ DTRACE(("ServerWindow %s: Message AS_SET_SIZE_LIMITS: " - "x: %ld-%ld, y: %ld-%ld\n", - Title(), minWidth, maxWidth, minHeight, maxHeight)); + "x: %" B_PRId32 "-%" B_PRId32 ", y: %" B_PRId32 "-%" B_PRId32 + "\n", Title(), minWidth, maxWidth, minHeight, maxHeight)); fWindow->SetSizeLimits(minWidth, maxWidth, minHeight, maxHeight); @@ -1112,12 +1112,12 @@ ServerWindow::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link) // TODO: if this happens, we probably want to kill the app and // clean up debug_printf("ServerWindow %s: Message " - "\n\n\nAS_SET_CURRENT_VIEW: view not found, token %ld\n", - fTitle, token); + "\n\n\nAS_SET_CURRENT_VIEW: view not found, token %" + B_PRId32 "\n", fTitle, token); current = NULL; } else { DTRACE(("\n\n\nServerWindow %s: Message AS_SET_CURRENT_VIEW: %s, " - "token %ld\n", fTitle, current->Name(), token)); + "token %" B_PRId32 "\n", fTitle, current->Name(), token)); _SetCurrentView(current); } break; @@ -1457,7 +1457,7 @@ fDesktop->LockSingleWindow(); break; DTRACE(("ServerWindow %s: Message AS_VIEW_RESIZE_MODE: " - "View: %s -> %ld\n", Title(), fCurrentView->Name(), + "View: %s -> %" B_PRId32 "\n", Title(), fCurrentView->Name(), resizeMode)); fCurrentView->SetResizeMode(resizeMode); @@ -1482,8 +1482,8 @@ fDesktop->LockSingleWindow(); } DTRACE(("ServerWindow %s: Message AS_VIEW_SET_FLAGS: " - "View: %s -> flags: %lu\n", Title(), fCurrentView->Name(), - flags)); + "View: %s -> flags: %" B_PRIu32 "\n", Title(), + fCurrentView->Name(), flags)); break; } case AS_VIEW_HIDE: @@ -1929,7 +1929,7 @@ fDesktop->LockSingleWindow(); break; DTRACE(("ServerWindow %s: Message AS_VIEW_SET_CLIP_REGION: " - "View: %s -> rect count: %ld, frame = " + "View: %s -> rect count: %" B_PRId32 ", frame = " "BRect(%.1f, %.1f, %.1f, %.1f)\n", Title(), fCurrentView->Name(), rectCount, region.Frame().left, region.Frame().top, @@ -1976,8 +1976,8 @@ fDesktop->LockSingleWindow(); break; DTRACE(("ServerWindow %s: Message AS_VIEW_INVALIDATE_REGION: " - "View: %s -> rect count: %ld, frame: BRect(%.1f, %.1f, " - "%.1f, %.1f)\n", Title(), + "View: %s -> rect count: %" B_PRId32 ", frame: BRect(%.1f, " + "%.1f, %.1f, %.1f)\n", Title(), fCurrentView->Name(), region.CountRects(), region.Frame().left, region.Frame().top, region.Frame().right, region.Frame().bottom)); @@ -2141,7 +2141,7 @@ ServerWindow::_DispatchViewDrawingMessage(int32 code, if (!fCurrentView->IsVisible() || !fWindow->IsVisible()) { if (link.NeedsReply()) { debug_printf("ServerWindow::DispatchViewDrawingMessage() got " - "message %ld that needs a reply!\n", code); + "message %" B_PRId32 " that needs a reply!\n", code); // the client is now blocking and waiting for a reply! fLink.StartMessage(B_ERROR); fLink.Flush(); @@ -2285,8 +2285,8 @@ ServerWindow::_DispatchViewDrawingMessage(int32 code, ServerBitmap* bitmap = fServerApp->GetBitmap(info.bitmapToken); if (bitmap != NULL) { DTRACE(("ServerWindow %s: Message AS_VIEW_DRAW_BITMAP: " - "View: %s, bitmap: %ld (size %ld x %ld), " - "BRect(%.1f, %.1f, %.1f, %.1f) -> " + "View: %s, bitmap: %" B_PRId32 " (size %" B_PRId32 " x " + "%" B_PRId32 "), BRect(%.1f, %.1f, %.1f, %.1f) -> " "BRect(%.1f, %.1f, %.1f, %.1f)\n", fTitle, fCurrentView->Name(), info.bitmapToken, bitmap->Width(), bitmap->Height(), @@ -3388,7 +3388,7 @@ ServerWindow::_MessageLooper() #ifdef PROFILE_MESSAGE_LOOP bigtime_t diff = system_time() - start; if (diff > 10000) { - printf("ServerWindow %s: lock acquisition took %Ld usecs\n", + printf("ServerWindow %s: lock acquisition took %" B_PRId64 " usecs\n", Title(), diff); } #endif @@ -3470,8 +3470,8 @@ ServerWindow::_MessageLooper() sMessageProfile[code].time += diff; #endif if (diff > 10000) { - printf("ServerWindow %s: message %ld took %Ld usecs\n", - Title(), code, diff); + printf("ServerWindow %s: message %" B_PRId32 " took %" + B_PRId64 " usecs\n", Title(), code, diff); } } #endif @@ -3554,8 +3554,8 @@ ServerWindow::HandleDirectConnection(int32 bufferState, int32 driverState) if (fDirectWindowInfo == NULL) return; - STRACE(("HandleDirectConnection(bufferState = %ld, driverState = %ld)\n", - bufferState, driverState)); + STRACE(("HandleDirectConnection(bufferState = %" B_PRId32 ", driverState = " + "%" B_PRId32 ")\n", bufferState, driverState)); status_t status = fDirectWindowInfo->SetState( (direct_buffer_state)bufferState, (direct_driver_state)driverState, diff --git a/src/servers/app/View.cpp b/src/servers/app/View.cpp index 26141c49d2..cbc0aadd88 100644 --- a/src/servers/app/View.cpp +++ b/src/servers/app/View.cpp @@ -1614,9 +1614,11 @@ void View::PrintToStream() const { printf("View: %s\n", Name()); - printf(" fToken: %ld\n", fToken); - printf(" fFrame: IntRect(%ld, %ld, %ld, %ld)\n", fFrame.left, fFrame.top, fFrame.right, fFrame.bottom); - printf(" fScrollingOffset: IntPoint(%ld, %ld)\n", fScrollingOffset.x, fScrollingOffset.y); + printf(" fToken: %" B_PRId32 "\n", fToken); + printf(" fFrame: IntRect(%" B_PRId32 ", %" B_PRId32 ", %" B_PRId32 ", %" B_PRId32 ")\n", + fFrame.left, fFrame.top, fFrame.right, fFrame.bottom); + printf(" fScrollingOffset: IntPoint(%" B_PRId32 ", %" B_PRId32 ")\n", + fScrollingOffset.x, fScrollingOffset.y); printf(" fHidden: %d\n", fHidden); printf(" fVisible: %d\n", fVisible); printf(" fWindow: %p\n", fWindow); diff --git a/src/servers/app/drawing/AccelerantHWInterface.cpp b/src/servers/app/drawing/AccelerantHWInterface.cpp index fe6e4427f6..5c606951b1 100644 --- a/src/servers/app/drawing/AccelerantHWInterface.cpp +++ b/src/servers/app/drawing/AccelerantHWInterface.cpp @@ -962,7 +962,7 @@ AccelerantHWInterface::GetMonitorInfo(monitor_info* info) memset(info, 0, sizeof(monitor_info)); strlcpy(info->vendor, edid.vendor.manufacturer, sizeof(info->vendor)); if (edid.vendor.serial != 0) { - snprintf(info->serial_number, sizeof(info->serial_number), "%lu", + snprintf(info->serial_number, sizeof(info->serial_number), "%" B_PRIu32, edid.vendor.serial); } info->product_id = edid.vendor.prod_id; diff --git a/src/servers/app/drawing/Painter/AGGTextRenderer.cpp b/src/servers/app/drawing/Painter/AGGTextRenderer.cpp index 7c4a0775c2..754ea5172f 100644 --- a/src/servers/app/drawing/Painter/AGGTextRenderer.cpp +++ b/src/servers/app/drawing/Painter/AGGTextRenderer.cpp @@ -131,7 +131,7 @@ public: fDryRun(dryRun), fSubpixelAntiAliased(subpixelAntiAliased), fVector(false), - fBounds(LONG_MAX, LONG_MAX, LONG_MIN, LONG_MIN), + fBounds(INT32_MAX, INT32_MAX, INT32_MIN, INT32_MIN), fNextCharPos(nextCharPos), fTransformedGlyph(transformedGlyph), diff --git a/src/servers/app/font/FontCacheEntry.cpp b/src/servers/app/font/FontCacheEntry.cpp index 5b11338828..306f99de67 100644 --- a/src/servers/app/font/FontCacheEntry.cpp +++ b/src/servers/app/font/FontCacheEntry.cpp @@ -371,7 +371,7 @@ FontCacheEntry::GenerateSignature(char* signature, size_t signatureSize, bool hinting = font.Hinting(); uint8 averageWeight = gSubpixelAverageWeight; - snprintf(signature, signatureSize, "%ld,%u,%d,%d,%.1f,%d,%d", + snprintf(signature, signatureSize, "%" B_PRId32 ",%u,%d,%d,%.1f,%d,%d", font.GetFamilyAndStyle(), charMap, font.Face(), int(renderingType), font.Size(), hinting, averageWeight); } diff --git a/src/servers/app/font/FontFamily.cpp b/src/servers/app/font/FontFamily.cpp index e75f79e24d..3d1532e60a 100644 --- a/src/servers/app/font/FontFamily.cpp +++ b/src/servers/app/font/FontFamily.cpp @@ -17,7 +17,7 @@ #include -const uint32 kInvalidFamilyFlags = ~0UL; +const uint32 kInvalidFamilyFlags = ~(uint32)0; static int diff --git a/src/servers/app/font/FontManager.cpp b/src/servers/app/font/FontManager.cpp index 357243e8b7..1e5e2cfdef 100644 --- a/src/servers/app/font/FontManager.cpp +++ b/src/servers/app/font/FontManager.cpp @@ -642,7 +642,8 @@ FontManager::_FindDirectory(node_ref& nodeRef) void FontManager::_RemoveDirectory(font_directory* directory) { - FTRACE(("FontManager: Remove directory (%Ld)!\n", directory->directory.node)); + FTRACE(("FontManager: Remove directory (%" B_PRIdINO ")!\n", + directory->directory.node)); fDirectories.RemoveItem(directory, false); @@ -704,8 +705,8 @@ FontManager::_AddPath(BEntry& entry, font_directory** _newDirectory) if (status != B_OK) { // we cannot watch this directory - while this is unfortunate, // it's not a critical error - printf("could not watch directory %ld:%Ld\n", nodeRef.device, - nodeRef.node); + printf("could not watch directory %" B_PRIdDEV ":%" B_PRIdINO "\n", + nodeRef.device, nodeRef.node); // TODO: should go into syslog() } else { BPath path(&entry); diff --git a/src/servers/syslog_daemon/syslog_output.cpp b/src/servers/syslog_daemon/syslog_output.cpp index a751e40d36..270ee27884 100644 --- a/src/servers/syslog_daemon/syslog_output.cpp +++ b/src/servers/syslog_daemon/syslog_output.cpp @@ -50,7 +50,7 @@ prepare_output() // check file size struct stat stat; if (fstat(sLog, &stat) == 0) { - if (stat.st_size < sLogMaxSize) + if (stat.st_size < (off_t)sLogMaxSize) needNew = false; else tooLarge = true; @@ -100,7 +100,7 @@ write_to_log(const char *buffer, int32 length) if (sRepeatCount > 0) { char repeat[64]; ssize_t size = snprintf(repeat, sizeof(repeat), - "Last message repeated %ld time%s\n", sRepeatCount, + "Last message repeated %" B_PRId32 " time%s\n", sRepeatCount, sRepeatCount > 1 ? "s" : ""); sRepeatCount = 0; if (write(sLog, repeat, strlen(repeat)) < size) @@ -144,7 +144,7 @@ syslog_output(syslog_message &message) } if ((message.options & LOG_PID) != 0) { - pos += snprintf(header + pos, sizeof(header) - pos, "[%ld]", + pos += snprintf(header + pos, sizeof(header) - pos, "[%" B_PRId32 "]", message.from); }