added 4 changesets to branch 'refs/remotes/xyzzy-github/x86_64' old head: 3fed1a15f58e8d6fe6b492f3b94bb3625ffeddbd new head: e1be7d07d668af884caab7ff42e15cf95a609692 ---------------------------------------------------------------------------- e5363c9: Style fix. adf8818: Compilation fixes for Terminal, add to image. It runs, but has shown up various bugs: app_server crashes, kernel panics, rendering problems. Working on fixing these now. 284d75b: Merge branch 'master' into x86_64 e1be7d0: Fixed a 64-bit calculation error. [ Alex Smith <alex@xxxxxxxxxxxxxxxx> ] ---------------------------------------------------------------------------- 45 files changed, 767 insertions(+), 101 deletions(-) build/jam/Haiku64Image | 4 +- data/system/boot/Bootscript | 7 + headers/private/graphics/common/dp_raw.h | 6 + src/add-ons/accelerants/radeon_hd/displayport.cpp | 75 ++++++- src/add-ons/accelerants/radeon_hd/displayport.h | 1 + src/apps/debugger/Jamfile | 4 + .../debugger/user_interface/cli/CliCommand.cpp | 11 + src/apps/debugger/user_interface/cli/CliCommand.h | 2 + .../debugger/user_interface/cli/CliContext.cpp | 175 +++++++++++++++- src/apps/debugger/user_interface/cli/CliContext.h | 28 ++- .../user_interface/cli/CliContinueCommand.cpp | 45 ++++ .../user_interface/cli/CliContinueCommand.h | 20 ++ .../debugger/user_interface/cli/CliQuitCommand.cpp | 2 +- .../user_interface/cli/CliStackTraceCommand.cpp | 86 ++++++++ .../user_interface/cli/CliStackTraceCommand.h | 20 ++ .../debugger/user_interface/cli/CliStopCommand.cpp | 45 ++++ .../debugger/user_interface/cli/CliStopCommand.h | 20 ++ .../user_interface/cli/CliThreadCommand.cpp | 58 +++++ .../debugger/user_interface/cli/CliThreadCommand.h | 20 ++ .../cli/CommandLineUserInterface.cpp | 97 +++++++-- .../user_interface/cli/CommandLineUserInterface.h | 3 +- src/apps/terminal/TermParse.cpp | 4 +- src/apps/terminal/TermView.cpp | 4 +- src/apps/terminal/TermWindow.cpp | 2 +- src/kits/tracker/ContainerWindow.cpp | 4 +- src/kits/tracker/CountView.cpp | 2 +- src/kits/tracker/DeskWindow.cpp | 2 +- src/kits/tracker/FSClipboard.cpp | 6 +- src/kits/tracker/FSUtils.cpp | 8 +- src/kits/tracker/FindPanel.cpp | 4 +- src/kits/tracker/GroupedMenu.cpp | 4 +- src/kits/tracker/InfoWindow.cpp | 2 +- src/kits/tracker/Model.cpp | 8 +- src/kits/tracker/MountMenu.cpp | 2 +- src/kits/tracker/PoseView.cpp | 29 +-- src/kits/tracker/PoseView.h | 2 +- src/kits/tracker/Settings.cpp | 8 +- src/kits/tracker/Settings.h | 8 +- src/kits/tracker/SettingsHandler.cpp | 10 +- src/kits/tracker/StatusWindow.cpp | 2 +- src/kits/tracker/TemplatesMenu.cpp | 2 +- src/kits/tracker/Tracker.cpp | 2 +- src/kits/tracker/WidgetAttributeText.cpp | 16 +- src/servers/app/drawing/DrawingEngine.cpp | 4 +- src/servers/input/MethodMenuItem.cpp | 4 +- ############################################################################ Commit: e5363c936abbfb22c0e76cf0f48aae3b7ab37433 Author: Alex Smith <alex@xxxxxxxxxxxxxxxx> Date: Sun Aug 5 09:16:11 2012 UTC Style fix. ---------------------------------------------------------------------------- diff --git a/src/servers/input/MethodMenuItem.cpp b/src/servers/input/MethodMenuItem.cpp index f6c7b2f..5df7b75 100644 --- a/src/servers/input/MethodMenuItem.cpp +++ b/src/servers/input/MethodMenuItem.cpp @@ -17,7 +17,7 @@ #include <string.h> #include "MethodMenuItem.h" -MethodMenuItem::MethodMenuItem(void *cookie, const char* name, const uchar* icon, BMenu *subMenu, BMessenger &messenger) +MethodMenuItem::MethodMenuItem(void* cookie, const char* name, const uchar* icon, BMenu* subMenu, BMessenger& messenger) : BMenuItem(subMenu), fIcon(BRect(0, 0, MENUITEM_ICON_SIZE - 1, MENUITEM_ICON_SIZE - 1), B_CMAP8), fCookie(cookie) @@ -28,7 +28,7 @@ MethodMenuItem::MethodMenuItem(void *cookie, const char* name, const uchar* icon } -MethodMenuItem::MethodMenuItem(void *cookie, const char* name, const uchar* icon) +MethodMenuItem::MethodMenuItem(void* cookie, const char* name, const uchar* icon) : BMenuItem(name, NULL), fIcon(BRect(0, 0, MENUITEM_ICON_SIZE - 1, MENUITEM_ICON_SIZE - 1), B_CMAP8), fCookie(cookie) ############################################################################ Commit: adf8818ec004e8a20614523f3e893303ea318642 Author: Alex Smith <alex@xxxxxxxxxxxxxxxx> Date: Sun Aug 5 09:24:22 2012 UTC Compilation fixes for Terminal, add to image. It runs, but has shown up various bugs: app_server crashes, kernel panics, rendering problems. Working on fixing these now. ---------------------------------------------------------------------------- diff --git a/build/jam/Haiku64Image b/build/jam/Haiku64Image index 2139fae..a763014 100644 --- a/build/jam/Haiku64Image +++ b/build/jam/Haiku64Image @@ -34,7 +34,7 @@ SYSTEM_BIN = "[" addattr base64 basename bash beep cal cat catattr chgrp chmod zdiff zforce zgrep zip zipcloak <bin>zipgrep zipnote zipsplit zmore znew ; -SYSTEM_APPS = ; +SYSTEM_APPS = Terminal ; SYSTEM_PREFERENCES = ; @@ -42,7 +42,7 @@ SYSTEM_DEMOS = ; SYSTEM_LIBS = libbe.so libbnetapi.so libnetwork.so libroot.so libroot-addon-icu.so - libtextencoding.so libtranslation.so + libtextencoding.so libtracker.so libtranslation.so $(HAIKU_SHARED_LIBSTDC++) $(HAIKU_SHARED_LIBSUPC++) $(HAIKU_FREETYPE_CURRENT_LIB) ; diff --git a/data/system/boot/Bootscript b/data/system/boot/Bootscript index 3a52cb2..7c97b76 100644 --- a/data/system/boot/Bootscript +++ b/data/system/boot/Bootscript @@ -116,6 +116,13 @@ if [ "$SAFEMODE" != "yes" ]; then waitfor _input_server_event_loop_ # wait for input devices fi +# TODO: remove this when x86_64 is more complete. +if [ "$(uname -m)" = "x86_64" ]; then + cd /boot/home + launch system/apps/Terminal + exit +fi + # Now ask the user if he wants to run the Installer or continue to the Desktop. if [ "$isReadOnly" = "yes" ]; then # Create Installer link (using the write overlay) diff --git a/src/apps/terminal/TermParse.cpp b/src/apps/terminal/TermParse.cpp index e5600c3..0ae798a 100644 --- a/src/apps/terminal/TermParse.cpp +++ b/src/apps/terminal/TermParse.cpp @@ -386,7 +386,7 @@ TermParse::EscParse() int32 srcLen = sizeof(cbuf); int32 dstLen = sizeof(dstbuf); - long dummyState = 0; + int32 dummyState = 0; int width = 1; BAutolock locker(fBuffer); @@ -1250,7 +1250,7 @@ TermParse::_DeviceStatusReport(int n) } case 6: // Cursor position report requested - len = sprintf(sbuf, "\033[%ld;%ldR", + len = sprintf(sbuf, "\033[%" B_PRId32 ";%" B_PRId32 "R", fBuffer->Cursor().y + 1, fBuffer->Cursor().x + 1); write(fFd, sbuf, len); diff --git a/src/apps/terminal/TermView.cpp b/src/apps/terminal/TermView.cpp index aa3c441..7f60b8f 100644 --- a/src/apps/terminal/TermView.cpp +++ b/src/apps/terminal/TermView.cpp @@ -1560,7 +1560,7 @@ TermView::KeyDown(const char *bytes, int32 numBytes) if (fEncoding != M_UTF8) { char destBuffer[16]; int32 destLen = sizeof(destBuffer); - long state = 0; + int32 state = 0; convert_from_utf8(fEncoding, bytes, &numBytes, destBuffer, &destLen, &state, '?'); _ScrollTo(0, true); @@ -1758,7 +1758,7 @@ TermView::MessageReceived(BMessage *msg) if (msg->WasDropped() && (msg->what == B_SIMPLE_DATA || msg->what == B_MIME_DATA)) { char *text; - int32 numBytes; + ssize_t numBytes; //rgb_color *color; int32 i = 0; diff --git a/src/apps/terminal/TermWindow.cpp b/src/apps/terminal/TermWindow.cpp index be789f1..edc08d3 100644 --- a/src/apps/terminal/TermWindow.cpp +++ b/src/apps/terminal/TermWindow.cpp @@ -1553,7 +1553,7 @@ TermWindow::_MakeWindowSizeMenu() char label[32]; int32 columns = windowSizes[i][0]; int32 rows = windowSizes[i][1]; - snprintf(label, sizeof(label), "%ldx%ld", columns, rows); + snprintf(label, sizeof(label), "%" B_PRId32 "x%" B_PRId32, columns, rows); BMessage* message = new BMessage(MSG_COLS_CHANGED); message->AddInt32("columns", columns); message->AddInt32("rows", rows); diff --git a/src/kits/tracker/ContainerWindow.cpp b/src/kits/tracker/ContainerWindow.cpp index 33ec873..65fb3eb 100644 --- a/src/kits/tracker/ContainerWindow.cpp +++ b/src/kits/tracker/ContainerWindow.cpp @@ -1308,7 +1308,7 @@ BContainerWindow::SetLayoutState(BNode* node, const BMessage* message) for (int32 index = 0; index < count; index++) { const void* buffer; - int32 size; + ssize_t size; result = message->FindData(name, type, index, &buffer, &size); if (result != B_OK) { PRINT(("error reading %s \n", name)); @@ -3059,7 +3059,7 @@ BContainerWindow::BuildAddOnMenu(BMenu* menu) // found the addons menu, empty it first for (;;) { - item = menu->RemoveItem(0L); + item = menu->RemoveItem((int32)0); if (!item) break; delete item; diff --git a/src/kits/tracker/CountView.cpp b/src/kits/tracker/CountView.cpp index 5ac1cba..f2dbf2b 100644 --- a/src/kits/tracker/CountView.cpp +++ b/src/kits/tracker/CountView.cpp @@ -229,7 +229,7 @@ BCountView::Draw(BRect updateRect) else { itemString.SetTo(B_TRANSLATE("%num items")); char numString[256]; - snprintf(numString, sizeof(numString), "%ld", fLastCount); + snprintf(numString, sizeof(numString), "%" B_PRId32, fLastCount); itemString.ReplaceFirst("%num", numString); } } diff --git a/src/kits/tracker/DeskWindow.cpp b/src/kits/tracker/DeskWindow.cpp index a4ac775..5578dbf 100644 --- a/src/kits/tracker/DeskWindow.cpp +++ b/src/kits/tracker/DeskWindow.cpp @@ -462,7 +462,7 @@ BDeskWindow::MessageReceived(BMessage* message) { if (message->WasDropped()) { 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) { diff --git a/src/kits/tracker/FSClipboard.cpp b/src/kits/tracker/FSClipboard.cpp index f250aa8..2fc1000 100644 --- a/src/kits/tracker/FSClipboard.cpp +++ b/src/kits/tracker/FSClipboard.cpp @@ -73,14 +73,14 @@ MakeNodeFromName(node_ref* node, char* name) static inline void MakeRefName(char* refName, const node_ref* node) { - sprintf(refName, "r%ld_%Ld", node->device, node->node); + sprintf(refName, "r%" B_PRIdDEV "_%" B_PRIdINO, node->device, node->node); } static inline void MakeModeName(char* modeName, const node_ref* node) { - sprintf(modeName, "m%ld_%Ld", node->device, node->node); + sprintf(modeName, "m%" B_PRIdDEV "_%" B_PRIdINO, node->device, node->node); } @@ -702,7 +702,7 @@ BClipboardRefsWatcher::RemoveNodesByDevice(dev_t device) BMessage* clip = be_clipboard->Data(); if (clip != NULL) { char deviceName[6]; - sprintf(deviceName, "r%ld_", device); + sprintf(deviceName, "r%" B_PRIdDEV "_", device); int32 index = 0; char* refName; diff --git a/src/kits/tracker/FSUtils.cpp b/src/kits/tracker/FSUtils.cpp index 2e462e1..323cdfc 100644 --- a/src/kits/tracker/FSUtils.cpp +++ b/src/kits/tracker/FSUtils.cpp @@ -1264,7 +1264,7 @@ LowLevelCopy(BEntry* srcEntry, StatStruct* srcStat, BDirectory* destDir, const size_t kMaxBufferSize = 1024* 1024; size_t bufsize = kMinBufferSize; - if (bufsize < srcStat->st_size) { + if ((off_t)bufsize < srcStat->st_size) { // File bigger than the buffer size: determine an optimal buffer size system_info sinfo; get_system_info(&sinfo); @@ -2343,7 +2343,7 @@ FSMakeOriginalName(char* name, BDirectory* destDir, const char* suffix) fnum = 1; strcpy(temp_name, name); while (destDir->Contains(temp_name)) { - sprintf(temp_name, "%s %ld", copybase, ++fnum); + sprintf(temp_name, "%s %" B_PRId32, copybase, ++fnum); if (strlen(temp_name) > (B_FILE_NAME_LENGTH - 1)) { // The name has grown too long. Maybe we just went from @@ -2352,7 +2352,7 @@ FSMakeOriginalName(char* name, BDirectory* destDir, const char* suffix) // truncate the 'root' name and continue. // ??? should we reset fnum or not ??? root[strlen(root) - 1] = '\0'; - sprintf(temp_name, "%s%s %ld", root, suffix, fnum); + sprintf(temp_name, "%s%s %" B_PRId32, root, suffix, fnum); } } @@ -3233,7 +3233,7 @@ _TrackerLaunchAppWithDocuments(const entry_ref* appRef, const BMessage* refs, if (error == B_OK) { // close possible parent window, if specified const node_ref* nodeToClose = 0; - int32 numBytes; + ssize_t numBytes; refs->FindData("nodeRefsToClose", B_RAW_TYPE, (const void**)&nodeToClose, &numBytes); if (nodeToClose) diff --git a/src/kits/tracker/FindPanel.cpp b/src/kits/tracker/FindPanel.cpp index 36e7957..939fb19 100644 --- a/src/kits/tracker/FindPanel.cpp +++ b/src/kits/tracker/FindPanel.cpp @@ -2303,7 +2303,7 @@ FindPanel::RestoreWindowState(const BNode* node) BTextControl* textControl = dynamic_cast<BTextControl*>(view); if (textControl != NULL && Mode() == kByFormulaItem) { int32 selStart = 0; - int32 selEnd = LONG_MAX; + int32 selEnd = INT32_MAX; node->ReadAttr("_trk/focusedSelStart", B_INT32_TYPE, 0, &selStart, sizeof(selStart)); node->ReadAttr("_trk/focusedSelEnd", B_INT32_TYPE, 0, @@ -3162,7 +3162,7 @@ MostUsedNames::~MostUsedNames() if (entry->count < -10 && i > 0) continue; - sprintf(line, "%ld %s\n", entry->count, entry->name); + sprintf(line, "%" B_PRId32 " %s\n", entry->count, entry->name); if (file.Write(line, strlen(line)) < B_OK) break; } diff --git a/src/kits/tracker/GroupedMenu.cpp b/src/kits/tracker/GroupedMenu.cpp index d781ee7..7d73de2 100644 --- a/src/kits/tracker/GroupedMenu.cpp +++ b/src/kits/tracker/GroupedMenu.cpp @@ -27,7 +27,7 @@ TMenuItemGroup::~TMenuItemGroup() if (fMenu == NULL) { BMenuItem* item; - while ((item = RemoveItem(0L)) != NULL) + while ((item = RemoveItem((int32)0)) != NULL) delete item; } } @@ -176,7 +176,7 @@ TGroupedMenu::TGroupedMenu(const char* name) TGroupedMenu::~TGroupedMenu() { TMenuItemGroup* group; - while ((group = static_cast<TMenuItemGroup*>(fGroups.RemoveItem(0L))) + while ((group = static_cast<TMenuItemGroup*>(fGroups.RemoveItem((int32)0))) != NULL) { delete group; } diff --git a/src/kits/tracker/InfoWindow.cpp b/src/kits/tracker/InfoWindow.cpp index 1513841..f57f4cc 100644 --- a/src/kits/tracker/InfoWindow.cpp +++ b/src/kits/tracker/InfoWindow.cpp @@ -675,7 +675,7 @@ BInfoWindow::GetSizeString(BString &result, off_t size, int32 fileCount) // TODO: use BCountry::FormatNumber if (size >= kKBSize) { char numStr[128]; - snprintf(numStr, sizeof(numStr), "%Ld", size); + snprintf(numStr, sizeof(numStr), "%" B_PRIdOFF, size); BString bytes; uint32 length = strlen(numStr); diff --git a/src/kits/tracker/Model.cpp b/src/kits/tracker/Model.cpp index 8a4e515..bd55a02 100644 --- a/src/kits/tracker/Model.cpp +++ b/src/kits/tracker/Model.cpp @@ -1083,7 +1083,7 @@ Model::SupportsMimeType(const char* type, const BObjectList<BString>* list, // check if this model lists the type of dropped document as supported const char* mimeSignature; - int32 bufferLength; + ssize_t bufferLength; if (message.FindData("types", 'CSTR', index, (const void**)&mimeSignature, &bufferLength)) { @@ -1157,7 +1157,7 @@ Model::IsSuperHandler() const for (int32 index = 0; ; index++) { const char* mimeSignature; - int32 bufferLength; + ssize_t bufferLength; if (message.FindData("types", 'CSTR', index, (const void**)&mimeSignature, &bufferLength)) { @@ -1271,8 +1271,8 @@ Model::GetVersionString(BString &result, version_kind kind) return error; char vstr[32]; - sprintf(vstr, "%ld.%ld.%ld", version.major, version.middle, - version.minor); + sprintf(vstr, "%" B_PRId32 ".%" B_PRId32 ".%" B_PRId32, version.major, + version.middle, version.minor); result = vstr; return B_OK; } diff --git a/src/kits/tracker/MountMenu.cpp b/src/kits/tracker/MountMenu.cpp index 6c0a84a..e00810b 100644 --- a/src/kits/tracker/MountMenu.cpp +++ b/src/kits/tracker/MountMenu.cpp @@ -171,7 +171,7 @@ MountMenu::AddDynamicItem(add_state) { // remove old items for (;;) { - BMenuItem* item = RemoveItem(0L); + BMenuItem* item = RemoveItem((int32)0); if (item == NULL) break; delete item; diff --git a/src/kits/tracker/PoseView.cpp b/src/kits/tracker/PoseView.cpp index 7430bff..f09542c 100644 --- a/src/kits/tracker/PoseView.cpp +++ b/src/kits/tracker/PoseView.cpp @@ -211,7 +211,7 @@ BPoseView::BPoseView(Model* model, BRect bounds, uint32 viewMode, fVScrollBar(NULL), fModel(model), fActivePose(NULL), - fExtent(LONG_MAX, LONG_MAX, LONG_MIN, LONG_MIN), + fExtent(INT32_MAX, INT32_MAX, INT32_MIN, INT32_MIN), fPoseList(new PoseList(40, true)), fFilteredPoseList(new PoseList()), fVSPoseList(new PoseList()), @@ -227,10 +227,10 @@ BPoseView::BPoseView(Model* model, BRect bounds, uint32 viewMode, fDropTarget(NULL), fAlreadySelectedDropTarget(NULL), fSelectionHandler(be_app), - fLastClickPt(LONG_MAX, LONG_MAX), + fLastClickPt(INT32_MAX, INT32_MAX), fLastClickTime(0), fLastClickedPose(NULL), - fLastExtent(LONG_MAX, LONG_MAX, LONG_MIN, LONG_MIN), + fLastExtent(INT32_MAX, INT32_MAX, INT32_MIN, INT32_MIN), fTitleView(NULL), fRefFilter(NULL), fAutoScrollInc(20), @@ -4513,7 +4513,7 @@ BPoseView::HandleDropCommon(BMessage* message, Model* targetModel, BPose* target return false; // find the text - int32 textLength; + ssize_t textLength; const char* text; if (message->FindData(kPlainTextMimeType, B_MIME_TYPE, (const void**)&text, &textLength) != B_OK) @@ -4540,12 +4540,13 @@ BPoseView::HandleDropCommon(BMessage* message, Model* targetModel, BPose* target // pick up TextView styles if available and save them with the file const text_run_array* textRuns = NULL; - int32 dataSize = 0; + ssize_t dataSize = 0; if (message->FindData("application/x-vnd.Be-text_run_array", B_MIME_TYPE, (const void**)&textRuns, &dataSize) == B_OK && textRuns && dataSize) { // save styles the same way StyledEdit does - void* data = BTextView::FlattenRunArray(textRuns, &dataSize); - file.WriteAttr("styles", B_RAW_TYPE, 0, data, (size_t)dataSize); + int32 tmpSize = dataSize; + void* data = BTextView::FlattenRunArray(textRuns, &tmpSize); + file.WriteAttr("styles", B_RAW_TYPE, 0, data, (size_t)tmpSize); free(data); } @@ -7037,7 +7038,7 @@ BPoseView::WasDoubleClick(const BPose* pose, BPoint point) && fabs(delta.x) < kDoubleClickTresh && fabs(delta.y) < kDoubleClickTresh && pose == fLastClickedPose) { - fLastClickPt.Set(LONG_MAX, LONG_MAX); + fLastClickPt.Set(INT32_MAX, INT32_MAX); fLastClickedPose = NULL; fLastClickTime = 0; return true; @@ -7336,7 +7337,7 @@ BPoseView::SelectPosesListMode(BRect selectionRect, BList** oldList) if (selectionRect.Intersects(poseRect)) { bool selected = pose->IsSelected(); pose->Select(!fSelectionList->HasItem(pose)); - newList->AddItem((void*)index); + newList->AddItem((void*)(addr_t)index); // this sucks, need to clean up using a vector class instead // of BList @@ -7358,9 +7359,9 @@ BPoseView::SelectPosesListMode(BRect selectionRect, BList** oldList) // on those which are no longer enclosed count = (*oldList)->CountItems(); for (int32 index = 0; index < count; index++) { - int32 oldIndex = (int32)(*oldList)->ItemAt(index); + int32 oldIndex = (addr_t)(*oldList)->ItemAt(index); - if (!newList->HasItem((void*)oldIndex)) { + if (!newList->HasItem((void*)(addr_t)oldIndex)) { BPose* pose = poseList->ItemAt(oldIndex); pose->Select(!pose->IsSelected()); loc.Set(0, oldIndex * fListElemHeight); @@ -7400,7 +7401,7 @@ BPoseView::SelectPosesIconMode(BRect selectionRect, BList** oldList) if (selectionRect.Intersects(poseRect)) { bool selected = pose->IsSelected(); pose->Select(!fSelectionList->HasItem(pose)); - newList->AddItem((void*)index); + newList->AddItem((void*)(addr_t)index); if ((selected != pose->IsSelected()) && poseRect.Intersects(bounds)) { @@ -7421,9 +7422,9 @@ BPoseView::SelectPosesIconMode(BRect selectionRect, BList** oldList) // on those which are no longer enclosed count = (*oldList)->CountItems(); for (int32 index = 0; index < count; index++) { - int32 oldIndex = (int32)(*oldList)->ItemAt(index); + int32 oldIndex = (addr_t)(*oldList)->ItemAt(index); - if (!newList->HasItem((void*)oldIndex)) { + if (!newList->HasItem((void*)(addr_t)oldIndex)) { BPose* pose = fVSPoseList->ItemAt(oldIndex); pose->Select(!pose->IsSelected()); BRect poseRect(pose->CalcRect(this)); diff --git a/src/kits/tracker/PoseView.h b/src/kits/tracker/PoseView.h index 872a9d2..47e0458 100644 --- a/src/kits/tracker/PoseView.h +++ b/src/kits/tracker/PoseView.h @@ -1014,7 +1014,7 @@ BPoseView::AddToExtent(const BRect&rect) inline void BPoseView::ClearExtent() { - fExtent.Set(LONG_MAX, LONG_MAX, LONG_MIN, LONG_MIN); + fExtent.Set(INT32_MAX, INT32_MAX, INT32_MIN, INT32_MIN); } diff --git a/src/kits/tracker/Settings.cpp b/src/kits/tracker/Settings.cpp index 31261db..99df1bb 100644 --- a/src/kits/tracker/Settings.cpp +++ b/src/kits/tracker/Settings.cpp @@ -200,7 +200,7 @@ ScalarValueSetting::Value() const void ScalarValueSetting::GetValueAsString(char* buffer) const { - sprintf(buffer, "%ld", fValue); + sprintf(buffer, "%" B_PRId32, fValue); } @@ -212,7 +212,7 @@ ScalarValueSetting::Handle(const char* const* argv) int32 newValue; if ((*argv)[0] == '0' && (*argv)[1] == 'x') - sscanf(*argv,"%lx",&newValue); + sscanf(*argv, "%" B_PRIx32, &newValue); else newValue = atoi(*argv); @@ -253,14 +253,14 @@ HexScalarValueSetting::HexScalarValueSetting(const char* name, void HexScalarValueSetting::GetValueAsString(char* buffer) const { - sprintf(buffer, "0x%08lx", fValue); + sprintf(buffer, "0x%08" B_PRIx32, fValue); } void HexScalarValueSetting::SaveSettingValue(Settings* settings) { - settings->Write("0x%08lx", fValue); + settings->Write("0x%08" B_PRIx32, fValue); } diff --git a/src/kits/tracker/Settings.h b/src/kits/tracker/Settings.h index 47ae4b3..5c104c7 100644 --- a/src/kits/tracker/Settings.h +++ b/src/kits/tracker/Settings.h @@ -86,8 +86,8 @@ class ScalarValueSetting : public SettingsArgvDispatcher { public: ScalarValueSetting(const char* name, int32 defaultValue, const char* valueExpectedErrorString, - const char* wrongValueErrorString, int32 min = LONG_MIN, - int32 max = LONG_MAX); + const char* wrongValueErrorString, int32 min = INT32_MIN, + int32 max = INT32_MAX); void ValueChanged(int32 newValue); int32 Value() const; @@ -112,8 +112,8 @@ class HexScalarValueSetting : public ScalarValueSetting { public: HexScalarValueSetting(const char* name, int32 defaultValue, const char* valueExpectedErrorString, - const char* wrongValueErrorString, int32 min = LONG_MIN, - int32 max = LONG_MAX); + const char* wrongValueErrorString, int32 min = INT32_MIN, + int32 max = INT32_MAX); void GetValueAsString(char* buffer) const; diff --git a/src/kits/tracker/SettingsHandler.cpp b/src/kits/tracker/SettingsHandler.cpp index 0fe7285..32f4fb8 100644 --- a/src/kits/tracker/SettingsHandler.cpp +++ b/src/kits/tracker/SettingsHandler.cpp @@ -103,8 +103,10 @@ ArgvParser::SendArgv(ArgvHandler argvHandlerFunc, void* passThru) NextArgv(); fCurrentArgv[fArgc] = 0; const char* result = (argvHandlerFunc)(fArgc, fCurrentArgv, passThru); - if (result) - printf("File %s; Line %ld # %s", fFileName, fLineNo, result); + if (result) { + printf("File %s; Line %" B_PRId32 " # %s", fFileName, fLineNo, + result); + } MakeArgvEmpty(); if (result) return B_ERROR; @@ -188,8 +190,8 @@ ArgvParser::EachArgvPrivate(const char* name, ArgvHandler argvHandlerFunc, // handle new line fEatComment = false; if (!fSawBackslash && (fInDoubleQuote || fInSingleQuote)) { - printf("File %s ; Line %ld # unterminated quote\n", name, - fLineNo); + printf("File %s ; Line %" B_PRId32 " # unterminated quote\n", + name, fLineNo); result = B_ERROR; break; } diff --git a/src/kits/tracker/StatusWindow.cpp b/src/kits/tracker/StatusWindow.cpp index 5a1e7ed..b8ee82a 100644 --- a/src/kits/tracker/StatusWindow.cpp +++ b/src/kits/tracker/StatusWindow.cpp @@ -580,7 +580,7 @@ BStatusView::InitStatus(int32 totalItems, off_t totalSize, if (totalItems > 0) { char totalStr[32]; buffer.SetTo(B_TRANSLATE("of %items")); - snprintf(totalStr, sizeof(totalStr), "%ld", totalItems); + snprintf(totalStr, sizeof(totalStr), "%" B_PRId32, totalItems); buffer.ReplaceFirst("%items", totalStr); } diff --git a/src/kits/tracker/TemplatesMenu.cpp b/src/kits/tracker/TemplatesMenu.cpp index aa3468b..20dfc36 100644 --- a/src/kits/tracker/TemplatesMenu.cpp +++ b/src/kits/tracker/TemplatesMenu.cpp @@ -122,7 +122,7 @@ TemplatesMenu::BuildMenu(bool addItems) fOpenItem = NULL; int32 count = CountItems(); while (count--) - delete RemoveItem(0L); + delete RemoveItem((int32)0); // Add the Folder IconMenuItem* menuItem = new IconMenuItem(B_TRANSLATE("New folder"), diff --git a/src/kits/tracker/Tracker.cpp b/src/kits/tracker/Tracker.cpp index bf44a53..cb736b1 100644 --- a/src/kits/tracker/Tracker.cpp +++ b/src/kits/tracker/Tracker.cpp @@ -415,7 +415,7 @@ TTracker::MessageReceived(BMessage* message) case kCloseWindowAndChildren: { const node_ref* itemNode; - int32 bytes; + ssize_t bytes; message->FindData("node_ref", B_RAW_TYPE, (const void**)&itemNode, &bytes); CloseWindowAndChildren(itemNode); diff --git a/src/kits/tracker/WidgetAttributeText.cpp b/src/kits/tracker/WidgetAttributeText.cpp index 3e6c25d..bc6f75e 100644 --- a/src/kits/tracker/WidgetAttributeText.cpp +++ b/src/kits/tracker/WidgetAttributeText.cpp @@ -1300,7 +1300,7 @@ GenericAttributeText::ReadValue(BString* result) GenericValueStruct tmp; if (fModel->Node()->GetAttrInfo(fColumn->AttrName(), &info) == B_OK) { - if (info.size && info.size <= sizeof(int64)) { + if (info.size && info.size <= (off_t)sizeof(int64)) { length = fModel->Node()->ReadAttr(fColumn->AttrName(), fColumn->AttrType(), 0, &tmp, (size_t)info.size); } @@ -1460,22 +1460,22 @@ GenericAttributeText::FitValue(BString* result, const BPoseView* view) break; case B_INT32_TYPE: - sprintf(buffer, "%ld", fValue.int32t); + sprintf(buffer, "%" B_PRId32, fValue.int32t); fFullValueText = buffer; break; case B_UINT32_TYPE: - sprintf(buffer, "%ld", fValue.uint32t); + sprintf(buffer, "%" B_PRId32, fValue.uint32t); fFullValueText = buffer; break; case B_INT64_TYPE: - sprintf(buffer, "%Ld", fValue.int64t); + sprintf(buffer, "%" B_PRId64, fValue.int64t); fFullValueText = buffer; break; case B_UINT64_TYPE: - sprintf(buffer, "%Ld", fValue.uint64t); + sprintf(buffer, "%" B_PRId64, fValue.uint64t); fFullValueText = buffer; break; @@ -1886,10 +1886,10 @@ DurationAttributeText::FitValue(BString* result, const BPoseView* view) char buffer[256]; if (hours > 0) { - snprintf(buffer, sizeof(buffer), "%s%ld:%02ld:%02ld", - negative ? "-" : "", hours, minutes, seconds); + snprintf(buffer, sizeof(buffer), "%s%" B_PRId32 ":%02" B_PRId32 ":%02" + B_PRId32, negative ? "-" : "", hours, minutes, seconds); } else { - snprintf(buffer, sizeof(buffer), "%s%ld:%02ld", + snprintf(buffer, sizeof(buffer), "%s%" B_PRId32 ":%02" B_PRId32, negative ? "-" : "", minutes, seconds); } ############################################################################ Commit: 284d75bd6a374d25aea846a0722e87685be5e15d Author: Alex Smith <alex@xxxxxxxxxxxxxxxx> Date: Sun Aug 5 09:33:20 2012 UTC Merge branch 'master' into x86_64 ---------------------------------------------------------------------------- ############################################################################ Commit: e1be7d07d668af884caab7ff42e15cf95a609692 Author: Alex Smith <alex@xxxxxxxxxxxxxxxx> Date: Sun Aug 5 11:59:46 2012 UTC Fixed a 64-bit calculation error. ---------------------------------------------------------------------------- diff --git a/src/servers/app/drawing/DrawingEngine.cpp b/src/servers/app/drawing/DrawingEngine.cpp index 4e3a836..4ec70d7 100644 --- a/src/servers/app/drawing/DrawingEngine.cpp +++ b/src/servers/app/drawing/DrawingEngine.cpp @@ -1513,7 +1513,7 @@ DrawingEngine::CopyRect(BRect src, int32 xOffset, int32 yOffset) const src = src & dst; // calc offset in buffer - bits += (int32)src.left * 4 + (int32)src.top * bytesPerRow; + bits += (ssize_t)src.left * 4 + (ssize_t)src.top * bytesPerRow; uint32 width = src.IntegerWidth() + 1; uint32 height = src.IntegerHeight() + 1; @@ -1554,7 +1554,7 @@ DrawingEngine::_CopyRect(uint8* src, uint32 width, uint32 height, yIncrement = bytesPerRow; } - uint8* dst = src + yOffset * bytesPerRow + xOffset * 4; + uint8* dst = src + (ssize_t)yOffset * bytesPerRow + (ssize_t)xOffset * 4; if (xIncrement == 1) { uint8 tmpBuffer[width * 4];