diff --git a/build/jam/Haiku64Image b/build/jam/Haiku64Image index 2139faeb50..a76301488e 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 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 3a52cb2ea2..7c97b76f9a 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 e5600c3b87..0ae798a326 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 aa3c441083..7f60b8f45c 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 be789f1fa3..edc08d33f7 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 33ec87306f..65fb3ebbe2 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 5ac1cba1ad..f2dbf2b184 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 a4ac77579a..5578dbf49f 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 f250aa884a..2fc100080f 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 2e462e1ac7..323cdfca8a 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 36e795701f..939fb192f8 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(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 d781ee7338..7d73de2a25 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(fGroups.RemoveItem(0L))) + while ((group = static_cast(fGroups.RemoveItem((int32)0))) != NULL) { delete group; } diff --git a/src/kits/tracker/InfoWindow.cpp b/src/kits/tracker/InfoWindow.cpp index 15138419c0..f57f4cc646 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 8a4e5155e5..bd55a0269f 100644 --- a/src/kits/tracker/Model.cpp +++ b/src/kits/tracker/Model.cpp @@ -1083,7 +1083,7 @@ Model::SupportsMimeType(const char* type, const BObjectList* 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 6c0a84a4ee..e00810be6b 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 7430bff230..f09542c15e 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 872a9d2b8f..47e045813e 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 31261dba17..99df1bbeb7 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 47ae4b3c64..5c104c7b42 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 0fe7285fef..32f4fb84b1 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 5a1e7ed7f8..b8ee82ad38 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 aa3468b073..20dfc36cbf 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 bf44a53b39..cb736b1738 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 3e6c25d32c..bc6f75ef3d 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); }