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.
This commit is contained in:
Alex Smith 2012-08-05 08:46:30 +01:00
parent f429464535
commit 3fed1a15f5
36 changed files with 167 additions and 128 deletions

View File

@ -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 <driver>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
: <input>keyboard <input>mouse <input>tablet <input>wacom ;
# create directories that will remain empty
AddDirectoryToHaikuImage common bin ;
AddDirectoryToHaikuImage common include ;

View File

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

View File

@ -26,7 +26,11 @@ typedef uint32_t in_addr_t;
* and we are not allowed to import all the BeOS types here.
*/
#ifndef htonl
# 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))

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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<uint8 *>(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<uint8 *> (&fHeader)) + pos;
} else {
@ -153,7 +153,7 @@ BBitmapStream::WriteAt(off_t pos, const void* data, size_t size)
written += toWrite;
data = (reinterpret_cast<const uint8 *> (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,

View File

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

View File

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

View File

@ -175,7 +175,7 @@ Variable::ToString() const
} else {
string << "Variable ";
if (!fIsValid)
string << "(invalid," << (int32)this << ")";
string << "(invalid," << (addr_t)this << ")";
else
string << Index();
}

View File

@ -189,9 +189,9 @@ AppServer::_DispatchMessage(int32 code, BPrivate::LinkReceiver& msg)
int32 version;
if (msg.Read<int32>(&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;
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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<rgb_color>(&viewColor);
link.Read<int32>(&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<bool>(&minimize);
if (link.Read<int32>(&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<int32>(&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,

View File

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

View File

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

View File

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

View File

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

View File

@ -17,7 +17,7 @@
#include <FontPrivate.h>
const uint32 kInvalidFamilyFlags = ~0UL;
const uint32 kInvalidFamilyFlags = ~(uint32)0;
static int

View File

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

View File

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