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