1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-29 06:59:27 +02:00

Make a large number of global variables static so they only have file scope when that is all they need. Part of a patch by Campbell Barton

This commit is contained in:
RichardAsh1981@gmail.com 2013-09-21 19:30:00 +00:00
parent eee032648e
commit 61de872bf2
5 changed files with 10 additions and 10 deletions

View File

@ -32,8 +32,8 @@
#include "Printing.h"
// Globals, so that we remember settings from session to session
wxPrintData *gPrintData = NULL;
wxPageSetupData *gPageSetupData = NULL;
static wxPrintData *gPrintData = NULL;
static wxPageSetupData *gPageSetupData = NULL;
class AudacityPrintout : public wxPrintout
{

View File

@ -2282,7 +2282,7 @@ void AudacityProject::OpenFiles(AudacityProject *proj)
// Most of this string was duplicated 3 places. Made the warning consistent in this global.
// The %s is to be filled with the version string.
wxString gsLegacyFileWarning =
static wxString gsLegacyFileWarning =
_("This file was saved by Audacity version %s. The format has changed. \
\n\nAudacity can try to open and save this file, but saving it in this \
\nversion will then prevent any 1.2 or earlier version opening it. \

View File

@ -44,9 +44,9 @@
#include "Prefs.h"
#include "Dither.h"
Dither::DitherType gLowQualityDither = Dither::none;
Dither::DitherType gHighQualityDither = Dither::none;
Dither gDitherAlgorithm;
static Dither::DitherType gLowQualityDither = Dither::none;
static Dither::DitherType gHighQualityDither = Dither::none;
static Dither gDitherAlgorithm;
void InitDitherers()
{

View File

@ -186,7 +186,7 @@ WX_DEFINE_USER_EXPORTED_OBJARRAY( ArrayOfColours )
#include "AllThemeResources.h"
// Include the ImageCache...
unsigned char ImageCacheAsData[] = {
static unsigned char ImageCacheAsData[] = {
#include "ThemeAsCeeCode.h"
};

View File

@ -7314,11 +7314,11 @@ wxString TrackPanel::TrackSubText(Track * t)
/// Handle the menu options that change a track between
/// left channel, right channel, and mono.
int channels[] = { Track::LeftChannel, Track::RightChannel,
static int channels[] = { Track::LeftChannel, Track::RightChannel,
Track::MonoChannel
};
const wxChar *channelmsgs[] = { _("Left Channel"), _("Right Channel"),
static const wxChar *channelmsgs[] = { _("Left Channel"), _("Right Channel"),
_("Mono")
};
@ -7592,7 +7592,7 @@ const int nRates=12;
/// gRates MUST CORRESPOND DIRECTLY TO THE RATES AS LISTED IN THE MENU!!
/// IN THE SAME ORDER!!
int gRates[nRates] = { 8000, 11025, 16000, 22050, 44100, 48000, 88200, 96000,
static int gRates[nRates] = { 8000, 11025, 16000, 22050, 44100, 48000, 88200, 96000,
176400, 192000, 352800, 384000 };
/// This method handles the selection from the Rate