From df4074fbed092b09474695aa286752ca41625332 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Sat, 24 Nov 2018 19:21:16 -0500 Subject: [PATCH] Remove a lot of unused constants. Spotted by Clang. No functional change intended. --- src/apps/deskbar/BarView.cpp | 1 - src/apps/deskbar/PreferencesWindow.cpp | 1 - src/apps/deskbar/ShowHideMenuItem.cpp | 1 - src/apps/deskbar/TimeView.cpp | 1 - src/apps/deskbar/WindowMenu.cpp | 12 ++---------- src/kits/game/FileGameSound.cpp | 6 ++---- src/kits/interface/MenuItem.cpp | 3 --- src/kits/interface/TextView.cpp | 1 - src/kits/package/hpkg/ReaderImplBase.cpp | 2 -- src/kits/tracker/FindPanel.cpp | 8 +------- src/kits/tracker/TaskLoop.cpp | 2 -- src/kits/tracker/TrackerInitialState.cpp | 1 - src/servers/app/decorator/DefaultDecorator.cpp | 1 - src/servers/app/stackandtile/SATDecorator.cpp | 3 --- src/servers/app/stackandtile/Stacking.cpp | 7 ++----- src/servers/keystore/StripeView.cpp | 1 - 16 files changed, 7 insertions(+), 44 deletions(-) diff --git a/src/apps/deskbar/BarView.cpp b/src/apps/deskbar/BarView.cpp index 526fa996d2..c362e04e4d 100644 --- a/src/apps/deskbar/BarView.cpp +++ b/src/apps/deskbar/BarView.cpp @@ -61,7 +61,6 @@ All rights reserved. const int32 kDefaultRecentDocCount = 10; -const int32 kDefaultRecentFolderCount = 10; const int32 kDefaultRecentAppCount = 10; const int32 kMenuTrackMargin = 20; diff --git a/src/apps/deskbar/PreferencesWindow.cpp b/src/apps/deskbar/PreferencesWindow.cpp index 99f9035578..e007ee68c6 100644 --- a/src/apps/deskbar/PreferencesWindow.cpp +++ b/src/apps/deskbar/PreferencesWindow.cpp @@ -37,7 +37,6 @@ #include "StatusView.h" -static const uint32 kSettingsViewChanged = 'Svch'; static const char* kSettingsFileName = "prefs_window_settings"; diff --git a/src/apps/deskbar/ShowHideMenuItem.cpp b/src/apps/deskbar/ShowHideMenuItem.cpp index 28f7a09f7b..2568ae9b9c 100644 --- a/src/apps/deskbar/ShowHideMenuItem.cpp +++ b/src/apps/deskbar/ShowHideMenuItem.cpp @@ -44,7 +44,6 @@ All rights reserved. #include "tracker_private.h" -const int32 kDesktopWindow = 4; const float kHPad = 10.0f; const float kVPad = 2.0f; diff --git a/src/apps/deskbar/TimeView.cpp b/src/apps/deskbar/TimeView.cpp index 5ea67ea13b..af13ce9294 100644 --- a/src/apps/deskbar/TimeView.cpp +++ b/src/apps/deskbar/TimeView.cpp @@ -56,7 +56,6 @@ All rights reserved. #include "CalendarMenuWindow.h" -static const char* const kMinString = "99:99 AM"; static const float kHMargin = 2.0; diff --git a/src/apps/deskbar/WindowMenu.cpp b/src/apps/deskbar/WindowMenu.cpp index bbd2673dc8..8d1781a37c 100644 --- a/src/apps/deskbar/WindowMenu.cpp +++ b/src/apps/deskbar/WindowMenu.cpp @@ -47,15 +47,7 @@ All rights reserved. #include "TeamMenuItem.h" #include "tracker_private.h" #include "WindowMenuItem.h" - - -const int32 kDesktopWindow = 1024; -const int32 kMenuWindow = 1025; -const uint32 kWindowScreen = 1026; -const uint32 kNormalWindow = 0; -const int32 kTeamFloater = 4; -const int32 kListFloater = 5; -const int32 kSystemFloater = 6; +#include "WindowPrivate.h" #undef B_TRANSLATION_CONTEXT @@ -68,7 +60,7 @@ const int32 kSystemFloater = 6; bool TWindowMenu::WindowShouldBeListed(client_window_info* info) { - return ((info->feel == kNormalWindow || info->feel == kWindowScreen) + return ((info->feel == B_NORMAL_WINDOW_FEEL || info->feel == kWindowScreenFeel) // Window has the right feel && info->show_hide_level <= 0); // Window is not hidden diff --git a/src/kits/game/FileGameSound.cpp b/src/kits/game/FileGameSound.cpp index bd7ad2d3ef..daf5063a5a 100644 --- a/src/kits/game/FileGameSound.cpp +++ b/src/kits/game/FileGameSound.cpp @@ -22,9 +22,7 @@ #include "GSUtility.h" -const int32 kPages = 20; -struct _gs_media_tracker -{ +struct _gs_media_tracker { BMediaFile* file; BMediaTrack* stream; int64 frames; @@ -384,7 +382,7 @@ BFileGameSound::Init(const entry_ref* file) fAudioStream = NULL; return B_NO_MEMORY; } - + status_t error = fAudioStream->file->InitCheck(); if (error != B_OK) return error; diff --git a/src/kits/interface/MenuItem.cpp b/src/kits/interface/MenuItem.cpp index 2d49398c01..7e1a982d19 100644 --- a/src/kits/interface/MenuItem.cpp +++ b/src/kits/interface/MenuItem.cpp @@ -27,9 +27,6 @@ #include "utf8_functions.h" -const float kLightBGTint - = (B_LIGHTEN_1_TINT + B_LIGHTEN_1_TINT + B_NO_TINT) / 3.0; - // map control key shortcuts to drawable Unicode characters // cf. http://unicode.org/charts/PDF/U2190.pdf const char* kUTF8ControlMap[] = { diff --git a/src/kits/interface/TextView.cpp b/src/kits/interface/TextView.cpp index 952e29cba0..6dcebadc9b 100644 --- a/src/kits/interface/TextView.cpp +++ b/src/kits/interface/TextView.cpp @@ -188,7 +188,6 @@ struct BTextView::LayoutData { }; -static const rgb_color kBlackColor = { 0, 0, 0, 255 }; static const rgb_color kBlueInputColor = { 152, 203, 255, 255 }; static const rgb_color kRedInputColor = { 255, 152, 152, 255 }; diff --git a/src/kits/package/hpkg/ReaderImplBase.cpp b/src/kits/package/hpkg/ReaderImplBase.cpp index c4e4978c15..612e132134 100644 --- a/src/kits/package/hpkg/ReaderImplBase.cpp +++ b/src/kits/package/hpkg/ReaderImplBase.cpp @@ -35,8 +35,6 @@ namespace BHPKG { namespace BPrivate { -static const size_t kScratchBufferSize = 64 * 1024; - static const uint16 kAttributeTypes[B_HPKG_ATTRIBUTE_ID_ENUM_COUNT] = { #define B_DEFINE_HPKG_ATTRIBUTE(id, type, name, constant) \ B_HPKG_ATTRIBUTE_TYPE_##type, diff --git a/src/kits/tracker/FindPanel.cpp b/src/kits/tracker/FindPanel.cpp index 2951a4d1d6..1a316e054d 100644 --- a/src/kits/tracker/FindPanel.cpp +++ b/src/kits/tracker/FindPanel.cpp @@ -92,12 +92,6 @@ All rights reserved. const char* kAllMimeTypes = "mime/ALLTYPES"; -const BRect kInitialRect(0, 0, 0, 0); -const int32 kInitialAttrModeWindowHeight = 140; -const int32 kIncrementPerAttribute = 30; -const float kMoreOptionsDelta = 20; - -const uint32 kMoreOptionsMessage = 'mrop'; const uint32 kNameModifiedMessage = 'nmmd'; const uint32 kSwitchToQueryTemplate = 'swqt'; const uint32 kRunSaveAsTemplatePanel = 'svtm'; @@ -217,7 +211,7 @@ MoreOptionsStruct::QueryTemporary(const BNode* node) FindWindow::FindWindow(const entry_ref* newRef, bool editIfTemplateOnly) : - BWindow(kInitialRect, B_TRANSLATE("Find"), B_TITLED_WINDOW, + BWindow(BRect(), B_TRANSLATE("Find"), B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_CLOSE_ON_ESCAPE | B_AUTO_UPDATE_SIZE_LIMITS), fFile(TryOpening(newRef)), diff --git a/src/kits/tracker/TaskLoop.cpp b/src/kits/tracker/TaskLoop.cpp index 482b09e03c..fb89ea801c 100644 --- a/src/kits/tracker/TaskLoop.cpp +++ b/src/kits/tracker/TaskLoop.cpp @@ -39,8 +39,6 @@ All rights reserved. #include "TaskLoop.h" -const float kTaskOverhead = 0.01f; - // this should really be specified by the task itself const float kIdleTreshold = 0.15f; const bigtime_t kInfinity = B_INFINITE_TIMEOUT; diff --git a/src/kits/tracker/TrackerInitialState.cpp b/src/kits/tracker/TrackerInitialState.cpp index 0a84c32ee4..8aacd748b0 100644 --- a/src/kits/tracker/TrackerInitialState.cpp +++ b/src/kits/tracker/TrackerInitialState.cpp @@ -93,7 +93,6 @@ static const char* kNetPositiveSignature = "application/x-vnd.Be-NPOS"; static const char* kPeopleSignature = "application/x-vnd.Be-PEPL"; static const BRect kDefaultFrame(40, 40, 695, 350); -static const int32 sDefaultQueryTemplateCount = 3; struct ColumnData diff --git a/src/servers/app/decorator/DefaultDecorator.cpp b/src/servers/app/decorator/DefaultDecorator.cpp index 51ad0c063b..efd3a0594f 100644 --- a/src/servers/app/decorator/DefaultDecorator.cpp +++ b/src/servers/app/decorator/DefaultDecorator.cpp @@ -51,7 +51,6 @@ static const float kBorderResizeLength = 22.0; -static const float kResizeKnobSize = 18.0; static inline uint8 diff --git a/src/servers/app/stackandtile/SATDecorator.cpp b/src/servers/app/stackandtile/SATDecorator.cpp index 62796aa2fa..91a753ee98 100644 --- a/src/servers/app/stackandtile/SATDecorator.cpp +++ b/src/servers/app/stackandtile/SATDecorator.cpp @@ -27,9 +27,6 @@ #endif -static const float kResizeKnobSize = 18.0; - - static const rgb_color kFrameColors[4] = { { 152, 152, 152, 255 }, { 240, 240, 240, 255 }, diff --git a/src/servers/app/stackandtile/Stacking.cpp b/src/servers/app/stackandtile/Stacking.cpp index f7192d8726..94bcba8fb2 100644 --- a/src/servers/app/stackandtile/Stacking.cpp +++ b/src/servers/app/stackandtile/Stacking.cpp @@ -29,9 +29,6 @@ using namespace BPrivate; -const float kMaxTabWidth = 165.; - - bool StackingEventHandler::HandleMessage(SATWindow* sender, BPrivate::LinkReceiver& link, BPrivate::LinkSender& reply) @@ -206,13 +203,13 @@ SATStacking::SATStacking(SATWindow* window) fSATWindow(window), fStackingParent(NULL) { - + } SATStacking::~SATStacking() { - + } diff --git a/src/servers/keystore/StripeView.cpp b/src/servers/keystore/StripeView.cpp index 6256e669d5..41f571496a 100644 --- a/src/servers/keystore/StripeView.cpp +++ b/src/servers/keystore/StripeView.cpp @@ -15,7 +15,6 @@ #include -static const float kTopOffset = 10.0f; static const int kIconStripeWidth = 30;