diff --git a/livesupport/src/products/gLiveSupport/src/AdvancedSearchEntry.cxx b/livesupport/src/products/gLiveSupport/src/AdvancedSearchEntry.cxx index e36082282..6b55fdc2a 100644 --- a/livesupport/src/products/gLiveSupport/src/AdvancedSearchEntry.cxx +++ b/livesupport/src/products/gLiveSupport/src/AdvancedSearchEntry.cxx @@ -48,41 +48,44 @@ using namespace LiveSupport::GLiveSupport; /* ================================================ local constants & macros */ +namespace { + /*------------------------------------------------------------------------------ * The localization key for "File type: " before the file type selector box. *----------------------------------------------------------------------------*/ -static const std::string fileTypeLabelKey = "fileTypeTextLabel"; +const std::string fileTypeLabelKey = "fileTypeTextLabel"; /*------------------------------------------------------------------------------ * The localization key for "all" in the file type selector box. *----------------------------------------------------------------------------*/ -static const std::string allLocalizationKey = "allFileType"; +const std::string allLocalizationKey = "allFileType"; /*------------------------------------------------------------------------------ * The localization key for "playlist" in the file type selector box. *----------------------------------------------------------------------------*/ -static const std::string playlistLocalizationKey = "playlistFileType"; +const std::string playlistLocalizationKey = "playlistFileType"; /*------------------------------------------------------------------------------ * The localization key for "audioClip" in the file type selector box. *----------------------------------------------------------------------------*/ -static const std::string audioClipLocalizationKey = "audioClipFileType"; +const std::string audioClipLocalizationKey = "audioClipFileType"; /*------------------------------------------------------------------------------ * The search key for "all" in the file type selector box. *----------------------------------------------------------------------------*/ -static const std::string allSearchKey = "all"; +const std::string allSearchKey = "all"; /*------------------------------------------------------------------------------ * The search key for "playlist" in the file type selector box. *----------------------------------------------------------------------------*/ -static const std::string playlistSearchKey = "playlist"; +const std::string playlistSearchKey = "playlist"; /*------------------------------------------------------------------------------ * The search key for "audioClip" in the file type selector box. *----------------------------------------------------------------------------*/ -static const std::string audioClipSearchKey = "audioClip"; +const std::string audioClipSearchKey = "audioClip"; +} /* =============================================== local function prototypes */ diff --git a/livesupport/src/products/gLiveSupport/src/AudioPlayerTest.cxx b/livesupport/src/products/gLiveSupport/src/AudioPlayerTest.cxx index 31826aa40..ac2adbd00 100644 --- a/livesupport/src/products/gLiveSupport/src/AudioPlayerTest.cxx +++ b/livesupport/src/products/gLiveSupport/src/AudioPlayerTest.cxx @@ -66,24 +66,27 @@ using namespace LiveSupport::gLiveSupport; CPPUNIT_TEST_SUITE_REGISTRATION(AudioPlayerTest); +namespace { + /** * The name of the configuration file for the audio player. */ -static const std::string audioPlayerConfigFileName +const std::string audioPlayerConfigFileName = "etc/audioPlayer.xml"; /** * The name of the configuration file for the local storage. */ -static const std::string storageClientConfigFileName +const std::string storageClientConfigFileName = "storageClient.xml"; /** * The name of the configuration file for the authentication client. */ -static const std::string authenticationClientConfigFileName +const std::string authenticationClientConfigFileName = "authenticationClient.xml"; +} /* =============================================== local function prototypes */ diff --git a/livesupport/src/products/gLiveSupport/src/GLiveSupport.cxx b/livesupport/src/products/gLiveSupport/src/GLiveSupport.cxx index 965ccc7c4..2fd544e3a 100644 --- a/livesupport/src/products/gLiveSupport/src/GLiveSupport.cxx +++ b/livesupport/src/products/gLiveSupport/src/GLiveSupport.cxx @@ -92,77 +92,80 @@ const std::string configFileDirStr = "/.livesupport/"; *----------------------------------------------------------------------------*/ const std::string configFileNameStr = "gLiveSupport.xml"; +namespace { + /*------------------------------------------------------------------------------ * The name of the config element for the list of supported languages *----------------------------------------------------------------------------*/ -static const std::string supportedLanguagesElementName = "supportedLanguages"; +const std::string supportedLanguagesElementName = "supportedLanguages"; /*------------------------------------------------------------------------------ * The name of the config element for a supported language. *----------------------------------------------------------------------------*/ -static const std::string languageElementName = "language"; +const std::string languageElementName = "language"; /*------------------------------------------------------------------------------ * The name of the attribute for the locale id for a supported language *----------------------------------------------------------------------------*/ -static const std::string localeAttrName = "locale"; +const std::string localeAttrName = "locale"; /*------------------------------------------------------------------------------ * The name of the attribute for the name for a supported language *----------------------------------------------------------------------------*/ -static const std::string nameAttrName = "name"; +const std::string nameAttrName = "name"; /*------------------------------------------------------------------------------ * The name of the config element for the sound output player *----------------------------------------------------------------------------*/ -static const std::string outputPlayerElementName = "outputPlayer"; +const std::string outputPlayerElementName = "outputPlayer"; /*------------------------------------------------------------------------------ * The name of the config element for the sound cue player *----------------------------------------------------------------------------*/ -static const std::string cuePlayerElementName = "cuePlayer"; +const std::string cuePlayerElementName = "cuePlayer"; /*------------------------------------------------------------------------------ * The name of the config element for the station logo image *----------------------------------------------------------------------------*/ -static const std::string stationLogoConfigElementName = "stationLogo"; +const std::string stationLogoConfigElementName = "stationLogo"; /*------------------------------------------------------------------------------ * The name of the config element for the test audio file location *----------------------------------------------------------------------------*/ -static const std::string testAudioUrlConfigElementName = "testAudioUrl"; +const std::string testAudioUrlConfigElementName = "testAudioUrl"; /*------------------------------------------------------------------------------ * The name of the user preference for storing window positions *----------------------------------------------------------------------------*/ -static const std::string windowPositionsKey = "windowPositions"; +const std::string windowPositionsKey = "windowPositions"; /*------------------------------------------------------------------------------ * The name of the user preference for storing the token of the edited p.l. *----------------------------------------------------------------------------*/ -static const std::string editedPlaylistTokenKey = "editedPlaylistToken"; +const std::string editedPlaylistTokenKey = "editedPlaylistToken"; /*------------------------------------------------------------------------------ * Static constant for the key of the scheduler not available key *----------------------------------------------------------------------------*/ -static const std::string schedulerNotReachableKey = "schedulerNotReachableMsg"; +const std::string schedulerNotReachableKey = "schedulerNotReachableMsg"; /*------------------------------------------------------------------------------ * Static constant for the key of the storage not available key *----------------------------------------------------------------------------*/ -static const std::string storageNotReachableKey = "storageNotReachableMsg"; +const std::string storageNotReachableKey = "storageNotReachableMsg"; /*------------------------------------------------------------------------------ * Static constant for the key of the authentication not available key *----------------------------------------------------------------------------*/ -static const std::string authenticationNotReachableKey = +const std::string authenticationNotReachableKey = "authenticationNotReachableMsg"; /*------------------------------------------------------------------------------ * Static constant for the key of the locale not available key *----------------------------------------------------------------------------*/ -static const std::string localeNotAvailableKey = "localeNotAvailableMsg"; +const std::string localeNotAvailableKey = "localeNotAvailableMsg"; +} /* =============================================== local function prototypes */ diff --git a/livesupport/src/products/gLiveSupport/src/GLiveSupportTest.cxx b/livesupport/src/products/gLiveSupport/src/GLiveSupportTest.cxx index e0089c103..caa51ccc6 100644 --- a/livesupport/src/products/gLiveSupport/src/GLiveSupportTest.cxx +++ b/livesupport/src/products/gLiveSupport/src/GLiveSupportTest.cxx @@ -73,29 +73,32 @@ using namespace LiveSupport::GLiveSupport; CPPUNIT_TEST_SUITE_REGISTRATION(GLiveSupportTest); +namespace { + /** * The name of the generic configuration file for the GLiveSupport object. */ -static const std::string gLiveSupportEtcConfigFileName +const std::string gLiveSupportEtcConfigFileName = "etc/gLiveSupport.xml"; /** * The name of the user-specific configuration file for the * GLiveSupport object, relative to the user's home directory. */ -static const std::string gLiveSupportUserConfigFileName +const std::string gLiveSupportUserConfigFileName = "/.livesupport/gLiveSupport.xml"; /** * The login name. */ -static const std::string login = "root"; +const std::string login = "root"; /** * The password. */ -static const std::string password = "q"; +const std::string password = "q"; +} /* =============================================== local function prototypes */ diff --git a/livesupport/src/products/gLiveSupport/src/KeyboardShortcut.cxx b/livesupport/src/products/gLiveSupport/src/KeyboardShortcut.cxx index 95a92cab5..dc7ce95e2 100644 --- a/livesupport/src/products/gLiveSupport/src/KeyboardShortcut.cxx +++ b/livesupport/src/products/gLiveSupport/src/KeyboardShortcut.cxx @@ -49,15 +49,17 @@ using namespace LiveSupport::GLiveSupport; *----------------------------------------------------------------------------*/ const std::string KeyboardShortcut::configElementName = "keyboardShortcut"; +namespace { + /** * The name of the attribute of the action element. */ -static const std::string actionAttributeName = "action"; +const std::string actionAttributeName = "action"; /** * The name of the attribute of the key element. */ -static const std::string keyAttributeName = "key"; +const std::string keyAttributeName = "key"; /* * The modifier keys we check against. @@ -67,12 +69,13 @@ static const std::string keyAttributeName = "key"; * Gdk::MOD3_MASK (don't know what; always off on my computer), * Gdk::BUTTONX_MASK (mouse buttons, X = 1..5). */ -static const Gdk::ModifierType modifiersChecked = Gdk::SHIFT_MASK - | Gdk::CONTROL_MASK - | Gdk::MOD1_MASK // Alt - | Gdk::MOD4_MASK // Windows key - | Gdk::MOD5_MASK; // AltGr +const Gdk::ModifierType modifiersChecked = Gdk::SHIFT_MASK + | Gdk::CONTROL_MASK + | Gdk::MOD1_MASK // Alt + | Gdk::MOD4_MASK // Windows key + | Gdk::MOD5_MASK; // AltGr +} /* =============================================== local function prototypes */ diff --git a/livesupport/src/products/gLiveSupport/src/KeyboardShortcutContainer.cxx b/livesupport/src/products/gLiveSupport/src/KeyboardShortcutContainer.cxx index fe1a8b0d3..9fe4347f7 100644 --- a/livesupport/src/products/gLiveSupport/src/KeyboardShortcutContainer.cxx +++ b/livesupport/src/products/gLiveSupport/src/KeyboardShortcutContainer.cxx @@ -49,12 +49,14 @@ using namespace LiveSupport::GLiveSupport; */ const std::string KeyboardShortcutContainer::configElementName = "keyboardShortcutContainer"; +namespace { /** * The name of the window name sub-element. */ -static const std::string windowNameAttributeName = "windowName"; +const std::string windowNameAttributeName = "windowName"; +} /* =============================================== local function prototypes */ diff --git a/livesupport/src/products/gLiveSupport/src/KeyboardShortcutTest.cxx b/livesupport/src/products/gLiveSupport/src/KeyboardShortcutTest.cxx index a1e1d6353..a54a020b6 100644 --- a/livesupport/src/products/gLiveSupport/src/KeyboardShortcutTest.cxx +++ b/livesupport/src/products/gLiveSupport/src/KeyboardShortcutTest.cxx @@ -55,11 +55,14 @@ using namespace LiveSupport::GLiveSupport; CPPUNIT_TEST_SUITE_REGISTRATION(KeyboardShortcutTest); +namespace { + /** * The name of the test keyboard shortcut config file. */ -static const std::string configFileName = "etc/keyboardShortcut.xml"; +const std::string configFileName = "etc/keyboardShortcut.xml"; +} /* =============================================== local function prototypes */ diff --git a/livesupport/src/products/gLiveSupport/src/LiveModeWindow.cxx b/livesupport/src/products/gLiveSupport/src/LiveModeWindow.cxx index de6ff3d6c..6ff6fa5bd 100644 --- a/livesupport/src/products/gLiveSupport/src/LiveModeWindow.cxx +++ b/livesupport/src/products/gLiveSupport/src/LiveModeWindow.cxx @@ -54,11 +54,14 @@ using namespace LiveSupport::GLiveSupport; /* ================================================ local constants & macros */ +namespace { + /** * The name of the window, used by the keyboard shortcuts (or by the .gtkrc). */ -static const Glib::ustring windowName = "liveModeWindow"; +const Glib::ustring windowName = "liveModeWindow"; +} /* =============================================== local function prototypes */ diff --git a/livesupport/src/products/gLiveSupport/src/NowPlaying.cxx b/livesupport/src/products/gLiveSupport/src/NowPlaying.cxx index 70b72bc3f..3c35fde78 100644 --- a/livesupport/src/products/gLiveSupport/src/NowPlaying.cxx +++ b/livesupport/src/products/gLiveSupport/src/NowPlaying.cxx @@ -51,11 +51,14 @@ using namespace LiveSupport::GLiveSupport; /* ================================================ local constants & macros */ +namespace { + /** * This should be 1/4th of MasterPanelWindow::updateTimeConstant. */ -static const int blinkingConstant = 5; +const int blinkingConstant = 5; +} /* =============================================== local function prototypes */ diff --git a/livesupport/src/products/gLiveSupport/src/OptionsWindow.cxx b/livesupport/src/products/gLiveSupport/src/OptionsWindow.cxx index ee4d1b1f3..61f9757ff 100644 --- a/livesupport/src/products/gLiveSupport/src/OptionsWindow.cxx +++ b/livesupport/src/products/gLiveSupport/src/OptionsWindow.cxx @@ -52,11 +52,14 @@ using namespace LiveSupport::GLiveSupport; /* ================================================ local constants & macros */ +namespace { + /** * The name of the window, used by the keyboard shortcuts (or by the .gtkrc). */ -static const Glib::ustring windowName = "optionsWindow"; +const Glib::ustring windowName = "optionsWindow"; +} /* =============================================== local function prototypes */ diff --git a/livesupport/src/products/gLiveSupport/src/SchedulerWindow.cxx b/livesupport/src/products/gLiveSupport/src/SchedulerWindow.cxx index a629a34f6..685d1380f 100644 --- a/livesupport/src/products/gLiveSupport/src/SchedulerWindow.cxx +++ b/livesupport/src/products/gLiveSupport/src/SchedulerWindow.cxx @@ -51,11 +51,14 @@ using namespace LiveSupport::GLiveSupport; /* ================================================ local constants & macros */ +namespace { + /** * The name of the window, used by the keyboard shortcuts (or by the .gtkrc). */ -static const Glib::ustring windowName = "schedulerWindow"; +const Glib::ustring windowName = "schedulerWindow"; +} /* =============================================== local function prototypes */ diff --git a/livesupport/src/products/gLiveSupport/src/ScratchpadWindow.cxx b/livesupport/src/products/gLiveSupport/src/ScratchpadWindow.cxx index f4b3ccec0..2576b7935 100644 --- a/livesupport/src/products/gLiveSupport/src/ScratchpadWindow.cxx +++ b/livesupport/src/products/gLiveSupport/src/ScratchpadWindow.cxx @@ -53,16 +53,19 @@ using namespace LiveSupport::GLiveSupport; /* ================================================ local constants & macros */ +namespace { + /** * The name of the window, used by the keyboard shortcuts (or by the .gtkrc). */ -static const Glib::ustring windowName = "scratchpadWindow"; +const Glib::ustring windowName = "scratchpadWindow"; /*------------------------------------------------------------------------------ * The name of the user preference for storing Scratchpad contents *----------------------------------------------------------------------------*/ -static const Glib::ustring userPreferencesKeyName = "scratchpadContents"; +const Glib::ustring userPreferencesKeyName = "scratchpadContents"; +} /* =============================================== local function prototypes */ diff --git a/livesupport/src/products/gLiveSupport/src/SimplePlaylistManagementWindow.cxx b/livesupport/src/products/gLiveSupport/src/SimplePlaylistManagementWindow.cxx index 952e674ff..831982daf 100644 --- a/livesupport/src/products/gLiveSupport/src/SimplePlaylistManagementWindow.cxx +++ b/livesupport/src/products/gLiveSupport/src/SimplePlaylistManagementWindow.cxx @@ -52,11 +52,14 @@ using namespace LiveSupport::GLiveSupport; /* ================================================ local constants & macros */ +namespace { + /** * The name of the window, used by the keyboard shortcuts (or by the .gtkrc). */ -static const Glib::ustring windowName = "simplePlaylistManagementWindow"; +const Glib::ustring windowName = "simplePlaylistManagementWindow"; +} /* =============================================== local function prototypes */ diff --git a/livesupport/src/products/gLiveSupport/src/TestRunner.cxx b/livesupport/src/products/gLiveSupport/src/TestRunner.cxx index 7c771db10..73dc13f6f 100644 --- a/livesupport/src/products/gLiveSupport/src/TestRunner.cxx +++ b/livesupport/src/products/gLiveSupport/src/TestRunner.cxx @@ -65,52 +65,58 @@ using namespace LiveSupport::Core; /* ================================================ local constants & macros */ +namespace { + /** * Our copyright notice, should be at most 80 columns */ -static const char copyrightNotice[] = +const char copyrightNotice[] = "Copyright (c) 2004 Media Development Loan Fund under the GNU GPL"; /** * String describing the short options. */ -static const char options[] = "ho:s:v"; +const char options[] = "ho:s:v"; /** * Structure describing the long options */ -static const struct option longOptions[] = { - { "help", no_argument, 0, 'h' }, - { "output", required_argument, 0, 'o' }, - { "stylesheet", required_argument, 0, 's' }, - { "version", no_argument, 0, 'v' }, - { 0, 0, 0, 0 } -}; +const struct option longOptions[] = + { + { "help", no_argument, 0, 'h' }, + { "output", required_argument, 0, 'o' }, + { "stylesheet", required_argument, 0, 's' }, + { "version", no_argument, 0, 'v' }, + { 0, 0, 0, 0 } + }; /** * The encoding to use for the output file. */ -static const std::string encoding = "utf-8"; +const std::string encoding = "utf-8"; /** * The output XML file name. */ -static Ptr::Ref xmlOutFileName; +Ptr::Ref xmlOutFileName; /** * The XSLT attached to the output file. */ -static Ptr::Ref xsltFileName; +Ptr::Ref xsltFileName; +} /* =============================================== local function prototypes */ +namespace { + /** * Print program version. * * @param os the std::ostream to print to. */ -static void +void printVersion ( std::ostream & os ); /** @@ -119,7 +125,7 @@ printVersion ( std::ostream & os ); * @param invocation the command line command used to invoke this program. * @param os the std::ostream to print to. */ -static void +void printUsage ( const char invocation[], std::ostream & os ); @@ -131,9 +137,10 @@ printUsage ( const char invocation[], * @return true of all went well, false in case the program should exit * after this call. */ -static bool +bool processArguments(int argc, char *argv[]); +} /* ============================================================= module code */ diff --git a/livesupport/src/products/gLiveSupport/src/main.cxx b/livesupport/src/products/gLiveSupport/src/main.cxx index 6785016f0..e6622df6b 100644 --- a/livesupport/src/products/gLiveSupport/src/main.cxx +++ b/livesupport/src/products/gLiveSupport/src/main.cxx @@ -63,27 +63,31 @@ using namespace LiveSupport::GLiveSupport; /* ================================================ local constants & macros */ +namespace { + /** * Our copyright notice, should be at most 80 columns */ -static const char copyrightNotice[] = +const char copyrightNotice[] = "Copyright (c) 2004 Media Development Loan Fund under the GNU GPL"; /** * String describing the short options. */ -static const char options[] = "c:hv"; +const char options[] = "c:hv"; /** * Structure describing the long options */ -static const struct option longOptions[] = { - { "config", required_argument, 0, 'c' }, - { "help", no_argument, 0, 'h' }, - { "version", no_argument, 0, 'v' }, - { 0, 0, 0, 0 } -}; +const struct option longOptions[] = + { + { "config", required_argument, 0, 'c' }, + { "help", no_argument, 0, 'h' }, + { "version", no_argument, 0, 'v' }, + { 0, 0, 0, 0 } + }; +} /* =============================================== local function prototypes */