From caddc641c1682911446623c09d95170423aaa0de Mon Sep 17 00:00:00 2001 From: "Joseph R. Prostko" Date: Thu, 15 Nov 2012 17:55:57 -0500 Subject: [PATCH] Changes to allow Haiku source to build with GCC 4.7 * GCC 4.7 is more picky than GCC 4.6, so have to make changes accordingly * Changes include addressing issues with scoping, redeclaration, etc. Thanks Rene and Ingo for your input on these changes --- headers/os/interface/LayoutBuilder.h | 2 +- src/apps/readonlybootprompt/BootPromptWindow.cpp | 8 ++++---- src/bin/bfs_tools/lib/Stack.h | 2 ++ src/kits/interface/AbstractLayout.cpp | 4 ++++ src/kits/interface/Layout.cpp | 2 +- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/headers/os/interface/LayoutBuilder.h b/headers/os/interface/LayoutBuilder.h index 3b50c7d494..61bb7be213 100644 --- a/headers/os/interface/LayoutBuilder.h +++ b/headers/os/interface/LayoutBuilder.h @@ -1328,7 +1328,7 @@ MenuItem::MenuItem(ParentBuilder* parentBuilder, BMenu* menu, Menu(menu), fMenuItem(item) { - SetParent(parentBuilder); + this->SetParent(parentBuilder); } diff --git a/src/apps/readonlybootprompt/BootPromptWindow.cpp b/src/apps/readonlybootprompt/BootPromptWindow.cpp index 25dbfbc5a1..12611894cc 100644 --- a/src/apps/readonlybootprompt/BootPromptWindow.cpp +++ b/src/apps/readonlybootprompt/BootPromptWindow.cpp @@ -224,10 +224,10 @@ BootPromptWindow::MessageReceived(BMessage* message) // Select default keymap by language BLanguage language(item->Language()); - BMenuItem* item = _KeymapItemForLanguage(language); - if (item != NULL) { - item->SetMarked(true); - _ActivateKeymap(item->Message()); + BMenuItem* keymapItem = _KeymapItemForLanguage(language); + if (keymapItem != NULL) { + keymapItem->SetMarked(true); + _ActivateKeymap(keymapItem->Message()); } } // Calling it here is a cheap way of preventing the user to have diff --git a/src/bin/bfs_tools/lib/Stack.h b/src/bin/bfs_tools/lib/Stack.h index d42908f56b..60a8e02c09 100644 --- a/src/bin/bfs_tools/lib/Stack.h +++ b/src/bin/bfs_tools/lib/Stack.h @@ -6,6 +6,8 @@ */ +#include + #include diff --git a/src/kits/interface/AbstractLayout.cpp b/src/kits/interface/AbstractLayout.cpp index 1788b4bec9..e61cd09964 100644 --- a/src/kits/interface/AbstractLayout.cpp +++ b/src/kits/interface/AbstractLayout.cpp @@ -30,6 +30,10 @@ struct BAbstractLayout::Proxy { { } + virtual ~Proxy() + { + } + virtual BSize MinSize() const = 0; virtual void SetMinSize(const BSize&) = 0; diff --git a/src/kits/interface/Layout.cpp b/src/kits/interface/Layout.cpp index ded10e2023..98cffc5b1a 100644 --- a/src/kits/interface/Layout.cpp +++ b/src/kits/interface/Layout.cpp @@ -222,7 +222,7 @@ bool BLayout::RemoveItem(BLayoutItem* item) { int32 index = IndexOfItem(item); - return (index >= 0 ? RemoveItem(index) : false); + return (index >= 0 ? RemoveItem(index) != NULL : false); }