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.
This commit is contained in:
Alex Smith
2012-08-05 10:24:22 +01:00
parent e5363c936a
commit adf8818ec0
24 changed files with 76 additions and 66 deletions
+2 -2
View File
@@ -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 zdiff zforce zgrep zip zipcloak <bin>zipgrep zipnote zipsplit zmore znew
; ;
SYSTEM_APPS = ; SYSTEM_APPS = Terminal ;
SYSTEM_PREFERENCES = ; SYSTEM_PREFERENCES = ;
@@ -42,7 +42,7 @@ SYSTEM_DEMOS = ;
SYSTEM_LIBS = libbe.so libbnetapi.so libnetwork.so SYSTEM_LIBS = libbe.so libbnetapi.so libnetwork.so
libroot.so libroot-addon-icu.so libroot.so libroot-addon-icu.so
libtextencoding.so libtranslation.so libtextencoding.so libtracker.so libtranslation.so
$(HAIKU_SHARED_LIBSTDC++) $(HAIKU_SHARED_LIBSUPC++) $(HAIKU_SHARED_LIBSTDC++) $(HAIKU_SHARED_LIBSUPC++)
$(HAIKU_FREETYPE_CURRENT_LIB) $(HAIKU_FREETYPE_CURRENT_LIB)
; ;
+7
View File
@@ -116,6 +116,13 @@ if [ "$SAFEMODE" != "yes" ]; then
waitfor _input_server_event_loop_ # wait for input devices waitfor _input_server_event_loop_ # wait for input devices
fi 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. # Now ask the user if he wants to run the Installer or continue to the Desktop.
if [ "$isReadOnly" = "yes" ]; then if [ "$isReadOnly" = "yes" ]; then
# Create Installer link (using the write overlay) # Create Installer link (using the write overlay)
+2 -2
View File
@@ -386,7 +386,7 @@ TermParse::EscParse()
int32 srcLen = sizeof(cbuf); int32 srcLen = sizeof(cbuf);
int32 dstLen = sizeof(dstbuf); int32 dstLen = sizeof(dstbuf);
long dummyState = 0; int32 dummyState = 0;
int width = 1; int width = 1;
BAutolock locker(fBuffer); BAutolock locker(fBuffer);
@@ -1250,7 +1250,7 @@ TermParse::_DeviceStatusReport(int n)
} }
case 6: case 6:
// Cursor position report requested // 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().y + 1,
fBuffer->Cursor().x + 1); fBuffer->Cursor().x + 1);
write(fFd, sbuf, len); write(fFd, sbuf, len);
+2 -2
View File
@@ -1560,7 +1560,7 @@ TermView::KeyDown(const char *bytes, int32 numBytes)
if (fEncoding != M_UTF8) { if (fEncoding != M_UTF8) {
char destBuffer[16]; char destBuffer[16];
int32 destLen = sizeof(destBuffer); int32 destLen = sizeof(destBuffer);
long state = 0; int32 state = 0;
convert_from_utf8(fEncoding, bytes, &numBytes, destBuffer, convert_from_utf8(fEncoding, bytes, &numBytes, destBuffer,
&destLen, &state, '?'); &destLen, &state, '?');
_ScrollTo(0, true); _ScrollTo(0, true);
@@ -1758,7 +1758,7 @@ TermView::MessageReceived(BMessage *msg)
if (msg->WasDropped() && (msg->what == B_SIMPLE_DATA if (msg->WasDropped() && (msg->what == B_SIMPLE_DATA
|| msg->what == B_MIME_DATA)) { || msg->what == B_MIME_DATA)) {
char *text; char *text;
int32 numBytes; ssize_t numBytes;
//rgb_color *color; //rgb_color *color;
int32 i = 0; int32 i = 0;
+1 -1
View File
@@ -1553,7 +1553,7 @@ TermWindow::_MakeWindowSizeMenu()
char label[32]; char label[32];
int32 columns = windowSizes[i][0]; int32 columns = windowSizes[i][0];
int32 rows = windowSizes[i][1]; 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); BMessage* message = new BMessage(MSG_COLS_CHANGED);
message->AddInt32("columns", columns); message->AddInt32("columns", columns);
message->AddInt32("rows", rows); message->AddInt32("rows", rows);
+2 -2
View File
@@ -1308,7 +1308,7 @@ BContainerWindow::SetLayoutState(BNode* node, const BMessage* message)
for (int32 index = 0; index < count; index++) { for (int32 index = 0; index < count; index++) {
const void* buffer; const void* buffer;
int32 size; ssize_t size;
result = message->FindData(name, type, index, &buffer, &size); result = message->FindData(name, type, index, &buffer, &size);
if (result != B_OK) { if (result != B_OK) {
PRINT(("error reading %s \n", name)); PRINT(("error reading %s \n", name));
@@ -3059,7 +3059,7 @@ BContainerWindow::BuildAddOnMenu(BMenu* menu)
// found the addons menu, empty it first // found the addons menu, empty it first
for (;;) { for (;;) {
item = menu->RemoveItem(0L); item = menu->RemoveItem((int32)0);
if (!item) if (!item)
break; break;
delete item; delete item;
+1 -1
View File
@@ -229,7 +229,7 @@ BCountView::Draw(BRect updateRect)
else { else {
itemString.SetTo(B_TRANSLATE("%num items")); itemString.SetTo(B_TRANSLATE("%num items"));
char numString[256]; char numString[256];
snprintf(numString, sizeof(numString), "%ld", fLastCount); snprintf(numString, sizeof(numString), "%" B_PRId32, fLastCount);
itemString.ReplaceFirst("%num", numString); itemString.ReplaceFirst("%num", numString);
} }
} }
+1 -1
View File
@@ -462,7 +462,7 @@ BDeskWindow::MessageReceived(BMessage* message)
{ {
if (message->WasDropped()) { if (message->WasDropped()) {
const rgb_color* color; const rgb_color* color;
int32 size; ssize_t size;
// handle "roColour"-style color drops // handle "roColour"-style color drops
if (message->FindData("RGBColor", 'RGBC', if (message->FindData("RGBColor", 'RGBC',
(const void**)&color, &size) == B_OK) { (const void**)&color, &size) == B_OK) {
+3 -3
View File
@@ -73,14 +73,14 @@ MakeNodeFromName(node_ref* node, char* name)
static inline void static inline void
MakeRefName(char* refName, const node_ref* node) 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 static inline void
MakeModeName(char* modeName, const node_ref* node) 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(); BMessage* clip = be_clipboard->Data();
if (clip != NULL) { if (clip != NULL) {
char deviceName[6]; char deviceName[6];
sprintf(deviceName, "r%ld_", device); sprintf(deviceName, "r%" B_PRIdDEV "_", device);
int32 index = 0; int32 index = 0;
char* refName; char* refName;
+4 -4
View File
@@ -1264,7 +1264,7 @@ LowLevelCopy(BEntry* srcEntry, StatStruct* srcStat, BDirectory* destDir,
const size_t kMaxBufferSize = 1024* 1024; const size_t kMaxBufferSize = 1024* 1024;
size_t bufsize = kMinBufferSize; 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 // File bigger than the buffer size: determine an optimal buffer size
system_info sinfo; system_info sinfo;
get_system_info(&sinfo); get_system_info(&sinfo);
@@ -2343,7 +2343,7 @@ FSMakeOriginalName(char* name, BDirectory* destDir, const char* suffix)
fnum = 1; fnum = 1;
strcpy(temp_name, name); strcpy(temp_name, name);
while (destDir->Contains(temp_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)) { if (strlen(temp_name) > (B_FILE_NAME_LENGTH - 1)) {
// The name has grown too long. Maybe we just went from // 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. // truncate the 'root' name and continue.
// ??? should we reset fnum or not ??? // ??? should we reset fnum or not ???
root[strlen(root) - 1] = '\0'; 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) { if (error == B_OK) {
// close possible parent window, if specified // close possible parent window, if specified
const node_ref* nodeToClose = 0; const node_ref* nodeToClose = 0;
int32 numBytes; ssize_t numBytes;
refs->FindData("nodeRefsToClose", B_RAW_TYPE, refs->FindData("nodeRefsToClose", B_RAW_TYPE,
(const void**)&nodeToClose, &numBytes); (const void**)&nodeToClose, &numBytes);
if (nodeToClose) if (nodeToClose)
+2 -2
View File
@@ -2303,7 +2303,7 @@ FindPanel::RestoreWindowState(const BNode* node)
BTextControl* textControl = dynamic_cast<BTextControl*>(view); BTextControl* textControl = dynamic_cast<BTextControl*>(view);
if (textControl != NULL && Mode() == kByFormulaItem) { if (textControl != NULL && Mode() == kByFormulaItem) {
int32 selStart = 0; int32 selStart = 0;
int32 selEnd = LONG_MAX; int32 selEnd = INT32_MAX;
node->ReadAttr("_trk/focusedSelStart", B_INT32_TYPE, 0, node->ReadAttr("_trk/focusedSelStart", B_INT32_TYPE, 0,
&selStart, sizeof(selStart)); &selStart, sizeof(selStart));
node->ReadAttr("_trk/focusedSelEnd", B_INT32_TYPE, 0, node->ReadAttr("_trk/focusedSelEnd", B_INT32_TYPE, 0,
@@ -3162,7 +3162,7 @@ MostUsedNames::~MostUsedNames()
if (entry->count < -10 && i > 0) if (entry->count < -10 && i > 0)
continue; 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) if (file.Write(line, strlen(line)) < B_OK)
break; break;
} }
+2 -2
View File
@@ -27,7 +27,7 @@ TMenuItemGroup::~TMenuItemGroup()
if (fMenu == NULL) { if (fMenu == NULL) {
BMenuItem* item; BMenuItem* item;
while ((item = RemoveItem(0L)) != NULL) while ((item = RemoveItem((int32)0)) != NULL)
delete item; delete item;
} }
} }
@@ -176,7 +176,7 @@ TGroupedMenu::TGroupedMenu(const char* name)
TGroupedMenu::~TGroupedMenu() TGroupedMenu::~TGroupedMenu()
{ {
TMenuItemGroup* group; TMenuItemGroup* group;
while ((group = static_cast<TMenuItemGroup*>(fGroups.RemoveItem(0L))) while ((group = static_cast<TMenuItemGroup*>(fGroups.RemoveItem((int32)0)))
!= NULL) { != NULL) {
delete group; delete group;
} }
+1 -1
View File
@@ -675,7 +675,7 @@ BInfoWindow::GetSizeString(BString &result, off_t size, int32 fileCount)
// TODO: use BCountry::FormatNumber // TODO: use BCountry::FormatNumber
if (size >= kKBSize) { if (size >= kKBSize) {
char numStr[128]; char numStr[128];
snprintf(numStr, sizeof(numStr), "%Ld", size); snprintf(numStr, sizeof(numStr), "%" B_PRIdOFF, size);
BString bytes; BString bytes;
uint32 length = strlen(numStr); uint32 length = strlen(numStr);
+4 -4
View File
@@ -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 // check if this model lists the type of dropped document as supported
const char* mimeSignature; const char* mimeSignature;
int32 bufferLength; ssize_t bufferLength;
if (message.FindData("types", 'CSTR', index, if (message.FindData("types", 'CSTR', index,
(const void**)&mimeSignature, &bufferLength)) { (const void**)&mimeSignature, &bufferLength)) {
@@ -1157,7 +1157,7 @@ Model::IsSuperHandler() const
for (int32 index = 0; ; index++) { for (int32 index = 0; ; index++) {
const char* mimeSignature; const char* mimeSignature;
int32 bufferLength; ssize_t bufferLength;
if (message.FindData("types", 'CSTR', index, if (message.FindData("types", 'CSTR', index,
(const void**)&mimeSignature, &bufferLength)) { (const void**)&mimeSignature, &bufferLength)) {
@@ -1271,8 +1271,8 @@ Model::GetVersionString(BString &result, version_kind kind)
return error; return error;
char vstr[32]; char vstr[32];
sprintf(vstr, "%ld.%ld.%ld", version.major, version.middle, sprintf(vstr, "%" B_PRId32 ".%" B_PRId32 ".%" B_PRId32, version.major,
version.minor); version.middle, version.minor);
result = vstr; result = vstr;
return B_OK; return B_OK;
} }
+1 -1
View File
@@ -171,7 +171,7 @@ MountMenu::AddDynamicItem(add_state)
{ {
// remove old items // remove old items
for (;;) { for (;;) {
BMenuItem* item = RemoveItem(0L); BMenuItem* item = RemoveItem((int32)0);
if (item == NULL) if (item == NULL)
break; break;
delete item; delete item;
+15 -14
View File
@@ -211,7 +211,7 @@ BPoseView::BPoseView(Model* model, BRect bounds, uint32 viewMode,
fVScrollBar(NULL), fVScrollBar(NULL),
fModel(model), fModel(model),
fActivePose(NULL), 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)), fPoseList(new PoseList(40, true)),
fFilteredPoseList(new PoseList()), fFilteredPoseList(new PoseList()),
fVSPoseList(new PoseList()), fVSPoseList(new PoseList()),
@@ -227,10 +227,10 @@ BPoseView::BPoseView(Model* model, BRect bounds, uint32 viewMode,
fDropTarget(NULL), fDropTarget(NULL),
fAlreadySelectedDropTarget(NULL), fAlreadySelectedDropTarget(NULL),
fSelectionHandler(be_app), fSelectionHandler(be_app),
fLastClickPt(LONG_MAX, LONG_MAX), fLastClickPt(INT32_MAX, INT32_MAX),
fLastClickTime(0), fLastClickTime(0),
fLastClickedPose(NULL), fLastClickedPose(NULL),
fLastExtent(LONG_MAX, LONG_MAX, LONG_MIN, LONG_MIN), fLastExtent(INT32_MAX, INT32_MAX, INT32_MIN, INT32_MIN),
fTitleView(NULL), fTitleView(NULL),
fRefFilter(NULL), fRefFilter(NULL),
fAutoScrollInc(20), fAutoScrollInc(20),
@@ -4513,7 +4513,7 @@ BPoseView::HandleDropCommon(BMessage* message, Model* targetModel, BPose* target
return false; return false;
// find the text // find the text
int32 textLength; ssize_t textLength;
const char* text; const char* text;
if (message->FindData(kPlainTextMimeType, B_MIME_TYPE, (const void**)&text, if (message->FindData(kPlainTextMimeType, B_MIME_TYPE, (const void**)&text,
&textLength) != B_OK) &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 // pick up TextView styles if available and save them with the file
const text_run_array* textRuns = NULL; 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, if (message->FindData("application/x-vnd.Be-text_run_array", B_MIME_TYPE,
(const void**)&textRuns, &dataSize) == B_OK && textRuns && dataSize) { (const void**)&textRuns, &dataSize) == B_OK && textRuns && dataSize) {
// save styles the same way StyledEdit does // save styles the same way StyledEdit does
void* data = BTextView::FlattenRunArray(textRuns, &dataSize); int32 tmpSize = dataSize;
file.WriteAttr("styles", B_RAW_TYPE, 0, data, (size_t)dataSize); void* data = BTextView::FlattenRunArray(textRuns, &tmpSize);
file.WriteAttr("styles", B_RAW_TYPE, 0, data, (size_t)tmpSize);
free(data); free(data);
} }
@@ -7037,7 +7038,7 @@ BPoseView::WasDoubleClick(const BPose* pose, BPoint point)
&& fabs(delta.x) < kDoubleClickTresh && fabs(delta.x) < kDoubleClickTresh
&& fabs(delta.y) < kDoubleClickTresh && fabs(delta.y) < kDoubleClickTresh
&& pose == fLastClickedPose) { && pose == fLastClickedPose) {
fLastClickPt.Set(LONG_MAX, LONG_MAX); fLastClickPt.Set(INT32_MAX, INT32_MAX);
fLastClickedPose = NULL; fLastClickedPose = NULL;
fLastClickTime = 0; fLastClickTime = 0;
return true; return true;
@@ -7336,7 +7337,7 @@ BPoseView::SelectPosesListMode(BRect selectionRect, BList** oldList)
if (selectionRect.Intersects(poseRect)) { if (selectionRect.Intersects(poseRect)) {
bool selected = pose->IsSelected(); bool selected = pose->IsSelected();
pose->Select(!fSelectionList->HasItem(pose)); 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 // this sucks, need to clean up using a vector class instead
// of BList // of BList
@@ -7358,9 +7359,9 @@ BPoseView::SelectPosesListMode(BRect selectionRect, BList** oldList)
// on those which are no longer enclosed // on those which are no longer enclosed
count = (*oldList)->CountItems(); count = (*oldList)->CountItems();
for (int32 index = 0; index < count; index++) { 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); BPose* pose = poseList->ItemAt(oldIndex);
pose->Select(!pose->IsSelected()); pose->Select(!pose->IsSelected());
loc.Set(0, oldIndex * fListElemHeight); loc.Set(0, oldIndex * fListElemHeight);
@@ -7400,7 +7401,7 @@ BPoseView::SelectPosesIconMode(BRect selectionRect, BList** oldList)
if (selectionRect.Intersects(poseRect)) { if (selectionRect.Intersects(poseRect)) {
bool selected = pose->IsSelected(); bool selected = pose->IsSelected();
pose->Select(!fSelectionList->HasItem(pose)); pose->Select(!fSelectionList->HasItem(pose));
newList->AddItem((void*)index); newList->AddItem((void*)(addr_t)index);
if ((selected != pose->IsSelected()) if ((selected != pose->IsSelected())
&& poseRect.Intersects(bounds)) { && poseRect.Intersects(bounds)) {
@@ -7421,9 +7422,9 @@ BPoseView::SelectPosesIconMode(BRect selectionRect, BList** oldList)
// on those which are no longer enclosed // on those which are no longer enclosed
count = (*oldList)->CountItems(); count = (*oldList)->CountItems();
for (int32 index = 0; index < count; index++) { 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); BPose* pose = fVSPoseList->ItemAt(oldIndex);
pose->Select(!pose->IsSelected()); pose->Select(!pose->IsSelected());
BRect poseRect(pose->CalcRect(this)); BRect poseRect(pose->CalcRect(this));
+1 -1
View File
@@ -1014,7 +1014,7 @@ BPoseView::AddToExtent(const BRect&rect)
inline void inline void
BPoseView::ClearExtent() BPoseView::ClearExtent()
{ {
fExtent.Set(LONG_MAX, LONG_MAX, LONG_MIN, LONG_MIN); fExtent.Set(INT32_MAX, INT32_MAX, INT32_MIN, INT32_MIN);
} }
+4 -4
View File
@@ -200,7 +200,7 @@ ScalarValueSetting::Value() const
void void
ScalarValueSetting::GetValueAsString(char* buffer) const 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; int32 newValue;
if ((*argv)[0] == '0' && (*argv)[1] == 'x') if ((*argv)[0] == '0' && (*argv)[1] == 'x')
sscanf(*argv,"%lx",&newValue); sscanf(*argv, "%" B_PRIx32, &newValue);
else else
newValue = atoi(*argv); newValue = atoi(*argv);
@@ -253,14 +253,14 @@ HexScalarValueSetting::HexScalarValueSetting(const char* name,
void void
HexScalarValueSetting::GetValueAsString(char* buffer) const HexScalarValueSetting::GetValueAsString(char* buffer) const
{ {
sprintf(buffer, "0x%08lx", fValue); sprintf(buffer, "0x%08" B_PRIx32, fValue);
} }
void void
HexScalarValueSetting::SaveSettingValue(Settings* settings) HexScalarValueSetting::SaveSettingValue(Settings* settings)
{ {
settings->Write("0x%08lx", fValue); settings->Write("0x%08" B_PRIx32, fValue);
} }
+4 -4
View File
@@ -86,8 +86,8 @@ class ScalarValueSetting : public SettingsArgvDispatcher {
public: public:
ScalarValueSetting(const char* name, int32 defaultValue, ScalarValueSetting(const char* name, int32 defaultValue,
const char* valueExpectedErrorString, const char* valueExpectedErrorString,
const char* wrongValueErrorString, int32 min = LONG_MIN, const char* wrongValueErrorString, int32 min = INT32_MIN,
int32 max = LONG_MAX); int32 max = INT32_MAX);
void ValueChanged(int32 newValue); void ValueChanged(int32 newValue);
int32 Value() const; int32 Value() const;
@@ -112,8 +112,8 @@ class HexScalarValueSetting : public ScalarValueSetting {
public: public:
HexScalarValueSetting(const char* name, int32 defaultValue, HexScalarValueSetting(const char* name, int32 defaultValue,
const char* valueExpectedErrorString, const char* valueExpectedErrorString,
const char* wrongValueErrorString, int32 min = LONG_MIN, const char* wrongValueErrorString, int32 min = INT32_MIN,
int32 max = LONG_MAX); int32 max = INT32_MAX);
void GetValueAsString(char* buffer) const; void GetValueAsString(char* buffer) const;
+6 -4
View File
@@ -103,8 +103,10 @@ ArgvParser::SendArgv(ArgvHandler argvHandlerFunc, void* passThru)
NextArgv(); NextArgv();
fCurrentArgv[fArgc] = 0; fCurrentArgv[fArgc] = 0;
const char* result = (argvHandlerFunc)(fArgc, fCurrentArgv, passThru); const char* result = (argvHandlerFunc)(fArgc, fCurrentArgv, passThru);
if (result) if (result) {
printf("File %s; Line %ld # %s", fFileName, fLineNo, result); printf("File %s; Line %" B_PRId32 " # %s", fFileName, fLineNo,
result);
}
MakeArgvEmpty(); MakeArgvEmpty();
if (result) if (result)
return B_ERROR; return B_ERROR;
@@ -188,8 +190,8 @@ ArgvParser::EachArgvPrivate(const char* name, ArgvHandler argvHandlerFunc,
// handle new line // handle new line
fEatComment = false; fEatComment = false;
if (!fSawBackslash && (fInDoubleQuote || fInSingleQuote)) { if (!fSawBackslash && (fInDoubleQuote || fInSingleQuote)) {
printf("File %s ; Line %ld # unterminated quote\n", name, printf("File %s ; Line %" B_PRId32 " # unterminated quote\n",
fLineNo); name, fLineNo);
result = B_ERROR; result = B_ERROR;
break; break;
} }
+1 -1
View File
@@ -580,7 +580,7 @@ BStatusView::InitStatus(int32 totalItems, off_t totalSize,
if (totalItems > 0) { if (totalItems > 0) {
char totalStr[32]; char totalStr[32];
buffer.SetTo(B_TRANSLATE("of %items")); buffer.SetTo(B_TRANSLATE("of %items"));
snprintf(totalStr, sizeof(totalStr), "%ld", totalItems); snprintf(totalStr, sizeof(totalStr), "%" B_PRId32, totalItems);
buffer.ReplaceFirst("%items", totalStr); buffer.ReplaceFirst("%items", totalStr);
} }
+1 -1
View File
@@ -122,7 +122,7 @@ TemplatesMenu::BuildMenu(bool addItems)
fOpenItem = NULL; fOpenItem = NULL;
int32 count = CountItems(); int32 count = CountItems();
while (count--) while (count--)
delete RemoveItem(0L); delete RemoveItem((int32)0);
// Add the Folder // Add the Folder
IconMenuItem* menuItem = new IconMenuItem(B_TRANSLATE("New folder"), IconMenuItem* menuItem = new IconMenuItem(B_TRANSLATE("New folder"),
+1 -1
View File
@@ -415,7 +415,7 @@ TTracker::MessageReceived(BMessage* message)
case kCloseWindowAndChildren: case kCloseWindowAndChildren:
{ {
const node_ref* itemNode; const node_ref* itemNode;
int32 bytes; ssize_t bytes;
message->FindData("node_ref", B_RAW_TYPE, message->FindData("node_ref", B_RAW_TYPE,
(const void**)&itemNode, &bytes); (const void**)&itemNode, &bytes);
CloseWindowAndChildren(itemNode); CloseWindowAndChildren(itemNode);
+8 -8
View File
@@ -1300,7 +1300,7 @@ GenericAttributeText::ReadValue(BString* result)
GenericValueStruct tmp; GenericValueStruct tmp;
if (fModel->Node()->GetAttrInfo(fColumn->AttrName(), &info) if (fModel->Node()->GetAttrInfo(fColumn->AttrName(), &info)
== B_OK) { == B_OK) {
if (info.size && info.size <= sizeof(int64)) { if (info.size && info.size <= (off_t)sizeof(int64)) {
length = fModel->Node()->ReadAttr(fColumn->AttrName(), length = fModel->Node()->ReadAttr(fColumn->AttrName(),
fColumn->AttrType(), 0, &tmp, (size_t)info.size); fColumn->AttrType(), 0, &tmp, (size_t)info.size);
} }
@@ -1460,22 +1460,22 @@ GenericAttributeText::FitValue(BString* result, const BPoseView* view)
break; break;
case B_INT32_TYPE: case B_INT32_TYPE:
sprintf(buffer, "%ld", fValue.int32t); sprintf(buffer, "%" B_PRId32, fValue.int32t);
fFullValueText = buffer; fFullValueText = buffer;
break; break;
case B_UINT32_TYPE: case B_UINT32_TYPE:
sprintf(buffer, "%ld", fValue.uint32t); sprintf(buffer, "%" B_PRId32, fValue.uint32t);
fFullValueText = buffer; fFullValueText = buffer;
break; break;
case B_INT64_TYPE: case B_INT64_TYPE:
sprintf(buffer, "%Ld", fValue.int64t); sprintf(buffer, "%" B_PRId64, fValue.int64t);
fFullValueText = buffer; fFullValueText = buffer;
break; break;
case B_UINT64_TYPE: case B_UINT64_TYPE:
sprintf(buffer, "%Ld", fValue.uint64t); sprintf(buffer, "%" B_PRId64, fValue.uint64t);
fFullValueText = buffer; fFullValueText = buffer;
break; break;
@@ -1886,10 +1886,10 @@ DurationAttributeText::FitValue(BString* result, const BPoseView* view)
char buffer[256]; char buffer[256];
if (hours > 0) { if (hours > 0) {
snprintf(buffer, sizeof(buffer), "%s%ld:%02ld:%02ld", snprintf(buffer, sizeof(buffer), "%s%" B_PRId32 ":%02" B_PRId32 ":%02"
negative ? "-" : "", hours, minutes, seconds); B_PRId32, negative ? "-" : "", hours, minutes, seconds);
} else { } else {
snprintf(buffer, sizeof(buffer), "%s%ld:%02ld", snprintf(buffer, sizeof(buffer), "%s%" B_PRId32 ":%02" B_PRId32,
negative ? "-" : "", minutes, seconds); negative ? "-" : "", minutes, seconds);
} }