1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-15 07:40:23 +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:11:41 +00:00
parent 5523339ac5
commit 6758caa5e1
8 changed files with 16 additions and 16 deletions

View File

@ -232,7 +232,7 @@ static void wxOnAssert(const wxChar *fileName, int lineNumber, const wxChar *msg
static wxFrame *gParentFrame = NULL;
bool gInited = false;
static bool gInited = false;
bool gIsQuitting = false;
void QuitAudacity(bool bForce)

View File

@ -51,7 +51,7 @@ enum eCommandType { CtEffect, CtMenu, CtSpecial };
// TIDY-ME: Not currently translated,
// but there are issues to address if we do.
// CLEANSPEECH remnant
wxString SpecialCommands[] = {
static wxString SpecialCommands[] = {
wxT("NoAction"),
// wxT("Import"), // non-functioning
wxT("ExportMP3_56k_before"),

View File

@ -65,8 +65,8 @@ out.
#define BLOCKFILE_DEBUG_OUTPUT(op, i)
#endif
const int headerTagLen = 20;
char headerTag[headerTagLen + 1] = "AudacityBlockFile112";
static const int headerTagLen = 20;
static char headerTag[headerTagLen + 1] = "AudacityBlockFile112";
SummaryInfo::SummaryInfo(sampleCount samples)
{

View File

@ -46,8 +46,8 @@
#include "FFT.h"
int **gFFTBitTable = NULL;
const int MaxFastBits = 16;
static int **gFFTBitTable = NULL;
static const int MaxFastBits = 16;
/* Declare Static functions */
static int IsPowerOfTwo(int x);

View File

@ -175,7 +175,7 @@ int sf_num_simple_formats()
return count;
}
SF_FORMAT_INFO g_format_info;
static SF_FORMAT_INFO g_format_info;
SF_FORMAT_INFO *sf_simple_format(int i)
{

View File

@ -51,7 +51,7 @@ typedef pwxWindow (*tPanelFn)(int);
// This variable will hold the address of a subroutine in
// a DLL that can hijack the normal panel.
tPanelFn pPanelHijack=NULL;
static tPanelFn pPanelHijack=NULL;
// Next two commented out lines are handy when investigating
// strange DLL behaviour. Instead of dynamic linking,
@ -75,7 +75,7 @@ wxWindow * MakeHijackPanel()
// This variable will hold the address of a subroutine in a DLL that
// starts a thread and reads script commands.
tpRegScriptServerFunc scriptFn;
static tpRegScriptServerFunc scriptFn;
#ifdef EXPERIMENTAL_MODULE_PREFS
bool IsAllowedModule( wxString fname )

View File

@ -54,8 +54,8 @@ int PitchOctave(const double dMIDInote)
}
wxChar gPitchName[10];
wxChar * pPitchName;
static wxChar gPitchName[10];
static wxChar * pPitchName;
wxChar * PitchName(const double dMIDInote, const bool bWantFlats /* = false */)
{

View File

@ -25,11 +25,11 @@ ODTask requests and internals.
#include <wx/thread.h>
#include <wx/event.h>
ODLock gODInitedMutex;
bool gManagerCreated=false;
bool gPause=false; //to be loaded in and used with Pause/Resume before ODMan init.
static ODLock gODInitedMutex;
static bool gManagerCreated=false;
static bool gPause=false; //to be loaded in and used with Pause/Resume before ODMan init.
/// a flag that is set if we have loaded some OD blockfiles from PCM.
bool sHasLoadedOD=false;
static bool sHasLoadedOD=false;
ODManager* ODManager::pMan=NULL;
//init the accessor function pointer - use the first time version of the interface fetcher
@ -38,7 +38,7 @@ typedef ODManager* (*pfodman)();
pfodman ODManager::Instance = &(ODManager::InstanceFirstTime);
//libsndfile is not threadsafe - this deals with it
ODLock sLibSndFileMutex;
static ODLock sLibSndFileMutex;
DEFINE_EVENT_TYPE(EVT_ODTASK_UPDATE)