mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-07 07:12:34 +02:00
apply parts of Campbell Bartons patch for cleaning up compiler warnings: add static qualifiers to methods, ensure prototypes match definitions and some whitespace and comment changes
This commit is contained in:
parent
9d0daf8662
commit
b95918fe52
@ -214,7 +214,7 @@ DEFINE_EVENT_TYPE(EVT_RELEASE_KEYBOARD);
|
||||
DEFINE_EVENT_TYPE(EVT_CAPTURE_KEY);
|
||||
|
||||
#ifdef __WXGTK__
|
||||
void wxOnAssert(const wxChar *fileName, int lineNumber, const wxChar *msg)
|
||||
static void wxOnAssert(const wxChar *fileName, int lineNumber, const wxChar *msg)
|
||||
{
|
||||
if (msg)
|
||||
printf("ASSERTION FAILED: %s\n%s: %d\n", (const char *)wxString(msg).mb_str(), (const char *)wxString(fileName).mb_str(), lineNumber);
|
||||
@ -461,10 +461,10 @@ typedef void (*_gnome_interaction_key_return_fn)(gint, gboolean);
|
||||
static _gnome_client_request_interaction_fn gnome_client_request_interaction;
|
||||
static _gnome_interaction_key_return_fn gnome_interaction_key_return;
|
||||
|
||||
void interact_cb(GnomeClient *client,
|
||||
gint key,
|
||||
GnomeDialogType type,
|
||||
gpointer data)
|
||||
static void interact_cb(GnomeClient *client,
|
||||
gint key,
|
||||
GnomeDialogType type,
|
||||
gpointer data)
|
||||
{
|
||||
wxCloseEvent e(wxEVT_QUERY_END_SESSION, wxID_ANY);
|
||||
e.SetEventObject(&wxGetApp());
|
||||
@ -475,13 +475,13 @@ void interact_cb(GnomeClient *client,
|
||||
gnome_interaction_key_return(key, e.GetVeto());
|
||||
}
|
||||
|
||||
gboolean save_yourself_cb(GnomeClient *client,
|
||||
gint phase,
|
||||
GnomeSaveStyle style,
|
||||
gboolean shutdown,
|
||||
GnomeInteractStyle interact,
|
||||
gboolean fast,
|
||||
gpointer user_data)
|
||||
static gboolean save_yourself_cb(GnomeClient *client,
|
||||
gint phase,
|
||||
GnomeSaveStyle style,
|
||||
gboolean shutdown,
|
||||
GnomeInteractStyle interact,
|
||||
gboolean fast,
|
||||
gpointer user_data)
|
||||
{
|
||||
if (!shutdown || interact != GNOME_INTERACT_ANY) {
|
||||
return TRUE;
|
||||
|
@ -928,7 +928,7 @@ void AudioIO::HandleDeviceChange()
|
||||
#endif // USE_PORTMIXER
|
||||
}
|
||||
|
||||
PaSampleFormat AudacityToPortAudioSampleFormat(sampleFormat format)
|
||||
static PaSampleFormat AudacityToPortAudioSampleFormat(sampleFormat format)
|
||||
{
|
||||
switch(format) {
|
||||
case int16Sample:
|
||||
@ -3210,11 +3210,11 @@ void AudioIO::AILAProcess(double maxPeak) {
|
||||
|
||||
#define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
|
||||
void DoSoftwarePlaythrough(const void *inputBuffer,
|
||||
sampleFormat inputFormat,
|
||||
int inputChannels,
|
||||
float *outputBuffer,
|
||||
int len)
|
||||
static void DoSoftwarePlaythrough(const void *inputBuffer,
|
||||
sampleFormat inputFormat,
|
||||
int inputChannels,
|
||||
float *outputBuffer,
|
||||
int len)
|
||||
{
|
||||
float *tempBuffer = (float *)alloca(len * sizeof(float));
|
||||
int i, j;
|
||||
|
@ -56,8 +56,8 @@ WX_DECLARE_HASH_MAP(BlockFile *, bool,
|
||||
// Given a project, returns a single array of all SeqBlocks
|
||||
// in the current set of tracks. Enumerating that array allows
|
||||
// you to process all block files in the current set.
|
||||
void GetAllSeqBlocks(AudacityProject *project,
|
||||
BlockArray *outBlocks)
|
||||
static void GetAllSeqBlocks(AudacityProject *project,
|
||||
BlockArray *outBlocks)
|
||||
{
|
||||
TrackList *tracks = project->GetTracks();
|
||||
TrackListIterator iter(tracks);
|
||||
|
@ -79,7 +79,7 @@ wxFileConfig *gPrefs = NULL;
|
||||
int gMenusDirty = 0;
|
||||
|
||||
// Copy one entry from one wxConfig object to another
|
||||
void CopyEntry(wxString path, wxConfigBase *src, wxConfigBase *dst, wxString entry)
|
||||
static void CopyEntry(wxString path, wxConfigBase *src, wxConfigBase *dst, wxString entry)
|
||||
{
|
||||
switch(src->GetEntryType(entry)) {
|
||||
case wxConfigBase::Type_Unknown:
|
||||
@ -110,7 +110,7 @@ void CopyEntry(wxString path, wxConfigBase *src, wxConfigBase *dst, wxString ent
|
||||
}
|
||||
|
||||
// Recursive routine to copy all groups and entries from one wxConfig object to another
|
||||
void CopyEntriesRecursive(wxString path, wxConfigBase *src, wxConfigBase *dst)
|
||||
static void CopyEntriesRecursive(wxString path, wxConfigBase *src, wxConfigBase *dst)
|
||||
{
|
||||
wxString entryName;
|
||||
long entryIndex;
|
||||
|
@ -745,7 +745,7 @@ AudacityProject::AudacityProject(wxWindow * parent, wxWindowID id,
|
||||
#endif // CLEANSPEECH
|
||||
mShowId3Dialog(true), //lda
|
||||
mLastFocusedWindow(NULL),
|
||||
mKeyboardCaptured(false),
|
||||
mKeyboardCaptured(NULL),
|
||||
mImportXMLTagHandler(NULL),
|
||||
mAutoSaving(false),
|
||||
mIsRecovered(false),
|
||||
|
@ -3195,7 +3195,7 @@ bool TrackPanel::IsDragZooming()
|
||||
return (abs(mZoomEnd - mZoomStart) > DragThreshold);
|
||||
}
|
||||
|
||||
/// Determines if drag zooming is active
|
||||
/// Determines if the a modal tool is active
|
||||
bool TrackPanel::IsMouseCaptured()
|
||||
{
|
||||
return (mMouseCapture != IsUncaptured);
|
||||
|
@ -71,7 +71,7 @@ to get its definition, rather than rolling our own.
|
||||
#include "../Internat.h"
|
||||
|
||||
|
||||
wxUint32 SwapUintEndianess(wxUint32 in)
|
||||
static wxUint32 SwapUintEndianess(wxUint32 in)
|
||||
{
|
||||
wxUint32 out;
|
||||
unsigned char *p_in = (unsigned char *) ∈
|
||||
|
@ -221,7 +221,7 @@ static CHOICES sampRates[] =
|
||||
#define ID_CBR 7003
|
||||
#define ID_QUALITY 7004
|
||||
|
||||
void InitMP3_Statics()
|
||||
static void InitMP3_Statics()
|
||||
{
|
||||
for (size_t i=0; i < WXSIZEOF(fixRates); i++)
|
||||
{
|
||||
|
@ -30,7 +30,7 @@
|
||||
static FILE *g_raw_debug_file = NULL;
|
||||
#endif
|
||||
|
||||
float AmpStat(float *data, int len)
|
||||
static float AmpStat(float *data, int len)
|
||||
{
|
||||
float sum, sumofsquares, avg, variance, dev;
|
||||
int i;
|
||||
@ -57,7 +57,7 @@ float AmpStat(float *data, int len)
|
||||
return dev;
|
||||
}
|
||||
|
||||
float JumpStat(float *data, int len)
|
||||
static float JumpStat(float *data, int len)
|
||||
{
|
||||
float avg;
|
||||
int i;
|
||||
@ -74,7 +74,7 @@ float JumpStat(float *data, int len)
|
||||
return avg;
|
||||
}
|
||||
|
||||
float SecondDStat(float *data, int len)
|
||||
static float SecondDStat(float *data, int len)
|
||||
{
|
||||
int i;
|
||||
float v1=0, v2=0, v3=0;
|
||||
@ -93,7 +93,7 @@ float SecondDStat(float *data, int len)
|
||||
return sum/len;
|
||||
}
|
||||
|
||||
float RedundantStereo(float *data, int len)
|
||||
static float RedundantStereo(float *data, int len)
|
||||
{
|
||||
int i;
|
||||
int c = 0;
|
||||
@ -106,12 +106,12 @@ float RedundantStereo(float *data, int len)
|
||||
return ((c * 2.0) / (len - 2));
|
||||
}
|
||||
|
||||
void ExtractFloats(bool doublePrec,
|
||||
bool bigendian,
|
||||
bool stereo,
|
||||
int offset,
|
||||
char *rawData, int dataSize,
|
||||
float *data1, float *data2, int *len1, int *len2)
|
||||
static void ExtractFloats(bool doublePrec,
|
||||
bool bigendian,
|
||||
bool stereo,
|
||||
int offset,
|
||||
char *rawData, int dataSize,
|
||||
float *data1, float *data2, int *len1, int *len2)
|
||||
{
|
||||
int rawCount = 0;
|
||||
int dataCount1 = 0;
|
||||
@ -183,13 +183,13 @@ void ExtractFloats(bool doublePrec,
|
||||
*len2 = dataCount2;
|
||||
}
|
||||
|
||||
void Extract(bool bits16,
|
||||
bool sign,
|
||||
bool stereo,
|
||||
bool bigendian,
|
||||
bool offset,
|
||||
char *rawData, int dataSize,
|
||||
float *data1, float *data2, int *len1, int *len2)
|
||||
static void Extract(bool bits16,
|
||||
bool sign,
|
||||
bool stereo,
|
||||
bool bigendian,
|
||||
bool offset,
|
||||
char *rawData, int dataSize,
|
||||
float *data1, float *data2, int *len1, int *len2)
|
||||
{
|
||||
int rawCount = 0;
|
||||
int dataCount1 = 0;
|
||||
@ -284,8 +284,8 @@ void Extract(bool bits16,
|
||||
*len2 = dataCount2;
|
||||
}
|
||||
|
||||
int GuessFloatFormats(int numTests, char **rawData, int dataSize,
|
||||
int *out_offset, int *out_channels)
|
||||
static int GuessFloatFormats(int numTests, char **rawData, int dataSize,
|
||||
int *out_offset, int *out_channels)
|
||||
{
|
||||
int format;
|
||||
int bestOffset = 0;
|
||||
@ -519,7 +519,7 @@ int GuessFloatFormats(int numTests, char **rawData, int dataSize,
|
||||
return format;
|
||||
}
|
||||
|
||||
int Guess8Bit(int numTests, char **rawData, int dataSize, int *out_channels)
|
||||
static int Guess8Bit(int numTests, char **rawData, int dataSize, int *out_channels)
|
||||
{
|
||||
bool guessSigned = false;
|
||||
bool guessStereo = false;
|
||||
@ -677,9 +677,9 @@ int Guess8Bit(int numTests, char **rawData, int dataSize, int *out_channels)
|
||||
return SF_FORMAT_RAW | SF_FORMAT_PCM_U8;
|
||||
}
|
||||
|
||||
int Guess16Bit(int numTests, char **rawData,
|
||||
int dataSize, bool evenMSB,
|
||||
int *out_offset, int *out_channels)
|
||||
static int Guess16Bit(int numTests, char **rawData,
|
||||
int dataSize, bool evenMSB,
|
||||
int *out_offset, int *out_channels)
|
||||
{
|
||||
int format;
|
||||
bool guessSigned = false;
|
||||
@ -953,8 +953,8 @@ int Guess16Bit(int numTests, char **rawData,
|
||||
return format;
|
||||
}
|
||||
|
||||
int GuessIntFormats(int numTests, char **rawData, int dataSize,
|
||||
int *out_offset, int *out_channels)
|
||||
static int GuessIntFormats(int numTests, char **rawData, int dataSize,
|
||||
int *out_offset, int *out_channels)
|
||||
{
|
||||
int format = SF_FORMAT_RAW;
|
||||
bool guess16bit = false;
|
||||
|
@ -191,7 +191,7 @@ void KeyConfigPrefs::CreateList()
|
||||
mList->SetColumnWidth(KeyComboColumn, 250);
|
||||
}
|
||||
|
||||
int wxCALLBACK SortCallback(long item1, long item2, long sortData)
|
||||
static int wxCALLBACK SortCallback(long item1, long item2, long sortData)
|
||||
{
|
||||
wxArrayString *names = (wxArrayString *) sortData;
|
||||
|
||||
|
@ -36,6 +36,8 @@ Gives an Error message with an option for help.
|
||||
#include "../Project.h"
|
||||
#include "../Prefs.h"
|
||||
|
||||
#include "ErrorDialog.h"
|
||||
|
||||
|
||||
class ErrorDialog : public wxDialog
|
||||
{
|
||||
@ -180,7 +182,10 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
void ShowHtmlText( wxWindow * pParent, const wxString &Title, const wxString &HtmlText, bool bIsFile = false, bool bModal = false )
|
||||
void ShowHtmlText(wxWindow *pParent,
|
||||
const wxString &Title,
|
||||
const wxString &HtmlText,
|
||||
bool bIsFile = false, bool bModal = false)
|
||||
{
|
||||
LinkingHtmlWindow *html;
|
||||
|
||||
@ -283,7 +288,7 @@ void ErrorDialog::OnHelp(wxCommandEvent &event)
|
||||
|
||||
void ShowErrorDialog(wxWindow *parent,
|
||||
const wxString &dlogTitle,
|
||||
const wxString &message,
|
||||
const wxString &message,
|
||||
const wxString &helpURL,
|
||||
const bool Close)
|
||||
{
|
||||
@ -293,10 +298,10 @@ void ShowErrorDialog(wxWindow *parent,
|
||||
}
|
||||
|
||||
void ShowModelessErrorDialog(wxWindow *parent,
|
||||
const wxString &dlogTitle,
|
||||
const wxString &message,
|
||||
const wxString &helpURL,
|
||||
const bool Close)
|
||||
const wxString &dlogTitle,
|
||||
const wxString &message,
|
||||
const wxString &helpURL,
|
||||
const bool Close)
|
||||
{
|
||||
ErrorDialog *dlog = new ErrorDialog(parent, dlogTitle, message, helpURL, Close, false);
|
||||
dlog->CentreOnParent();
|
||||
@ -306,10 +311,10 @@ void ShowModelessErrorDialog(wxWindow *parent,
|
||||
}
|
||||
|
||||
void ShowAliasMissingDialog(AudacityProject *parent,
|
||||
const wxString &dlogTitle,
|
||||
const wxString &message,
|
||||
const wxString &helpURL,
|
||||
const bool Close)
|
||||
const wxString &dlogTitle,
|
||||
const wxString &message,
|
||||
const wxString &helpURL,
|
||||
const bool Close)
|
||||
{
|
||||
ErrorDialog *dlog = new AliasedFileMissingDialog(parent, dlogTitle, message, helpURL, Close, false);
|
||||
// Don't center because in many cases (effect, export, etc) there will be a progress bar in the center that blocks this.
|
||||
@ -335,7 +340,7 @@ void ShowAliasMissingDialog(AudacityProject *parent,
|
||||
void ShowInfoDialog( wxWindow *parent,
|
||||
const wxString &dlogTitle,
|
||||
const wxString &shortMsg,
|
||||
const wxString &message,
|
||||
const wxString &message,
|
||||
const int xSize, const int ySize)
|
||||
{
|
||||
wxDialog dlog(parent, wxID_ANY,
|
||||
@ -374,8 +379,8 @@ void ShowInfoDialog( wxWindow *parent,
|
||||
|
||||
|
||||
void ShowHelpDialog(wxWindow *parent,
|
||||
const wxString &localFileName,
|
||||
const wxString &remoteURL)
|
||||
const wxString &localFileName,
|
||||
const wxString &remoteURL)
|
||||
{
|
||||
AudacityProject * pProj = GetActiveProject();
|
||||
wxString HelpMode = wxT("Local");
|
||||
|
@ -48,8 +48,9 @@ void ShowInfoDialog( wxWindow *parent,
|
||||
|
||||
/// Displays a new window with wxHTML help.
|
||||
void ShowHtmlText( wxWindow * pParent,
|
||||
const wxString &Title,
|
||||
const wxString &HtmlText );
|
||||
const wxString &Title,
|
||||
const wxString &HtmlText,
|
||||
bool bIsFile, bool bModal);
|
||||
|
||||
/// Displays a file in your browser, if it's available locally,
|
||||
/// OR else links to the internet.
|
||||
|
Loading…
x
Reference in New Issue
Block a user