From 1ef9783c3faed6a18e8cc2fba34f48b50bedd08a Mon Sep 17 00:00:00 2001 From: John Glover Date: Sat, 30 Jun 2012 18:48:33 +0100 Subject: [sndobj] Make ErrorMessage method const char* --- src/sndobj/FFT.cpp | 4 ---- src/sndobj/HammingTable.cpp | 5 ++--- src/sndobj/HammingTable.h | 2 +- src/sndobj/HarmTable.cpp | 11 ++--------- src/sndobj/HarmTable.h | 2 +- src/sndobj/SndIO.cpp | 9 +++------ src/sndobj/SndIO.h | 2 +- src/sndobj/SndObj.cpp | 31 +------------------------------ src/sndobj/SndObj.h | 3 +-- src/sndobj/Table.h | 2 +- 10 files changed, 13 insertions(+), 58 deletions(-) (limited to 'src') diff --git a/src/sndobj/FFT.cpp b/src/sndobj/FFT.cpp index cee737d..10ec76f 100644 --- a/src/sndobj/FFT.cpp +++ b/src/sndobj/FFT.cpp @@ -244,7 +244,6 @@ FFT::DoProcess(){ void FFT::fft(double* signal){ - // FFT function rfftw_one(m_plan, signal, m_ffttmp); @@ -259,7 +258,4 @@ FFT::fft(double* signal){ m_output[i] = m_ffttmp[i2]/m_norm; m_output[i+1] = m_ffttmp[m_fftsize-(i2)]/m_norm; } - - } - diff --git a/src/sndobj/HammingTable.cpp b/src/sndobj/HammingTable.cpp index 20c37b5..f63c43c 100644 --- a/src/sndobj/HammingTable.cpp +++ b/src/sndobj/HammingTable.cpp @@ -77,10 +77,10 @@ HammingTable :: MakeTable(){ ///////////////// ERROR HANDLING /////////////////////////////// -char* +const char* HammingTable::ErrorMessage(){ - char* message; + const char* message; switch(m_error){ @@ -95,5 +95,4 @@ HammingTable::ErrorMessage(){ } return message; - } diff --git a/src/sndobj/HammingTable.h b/src/sndobj/HammingTable.h index 9a054ec..c65e55b 100644 --- a/src/sndobj/HammingTable.h +++ b/src/sndobj/HammingTable.h @@ -38,7 +38,7 @@ class HammingTable : public Table { public: void SetParam(long L, double alpha=.54); - char* ErrorMessage(); + const char* ErrorMessage(); short MakeTable(); HammingTable(); HammingTable(long L, double alpha); diff --git a/src/sndobj/HarmTable.cpp b/src/sndobj/HarmTable.cpp index 28fcd09..a858efa 100644 --- a/src/sndobj/HarmTable.cpp +++ b/src/sndobj/HarmTable.cpp @@ -129,10 +129,10 @@ HarmTable :: MakeTable(){ ///////////////// ERROR HANDLING /////////////////////////////// -char* +const char* HarmTable::ErrorMessage(){ - char* message; + const char* message; switch(m_error){ @@ -150,11 +150,4 @@ HarmTable::ErrorMessage(){ } return message; - } - - - - - - diff --git a/src/sndobj/HarmTable.h b/src/sndobj/HarmTable.h index 98671df..dfe1096 100644 --- a/src/sndobj/HarmTable.h +++ b/src/sndobj/HarmTable.h @@ -44,7 +44,7 @@ class HarmTable : public Table { void SetHarm(int harm, int type); - char* ErrorMessage(); + const char* ErrorMessage(); short MakeTable(); HarmTable(); void SetPhase(double phase){ m_phase = (double)(phase*TWOPI); } diff --git a/src/sndobj/SndIO.cpp b/src/sndobj/SndIO.cpp index 6f79feb..dfa790c 100644 --- a/src/sndobj/SndIO.cpp +++ b/src/sndobj/SndIO.cpp @@ -115,9 +115,9 @@ SndIO::SndIO(short channels, short bits, SndObj** inputlist, return 1; } - char* SndIO::ErrorMessage(){ +const char* SndIO::ErrorMessage(){ - char* message; + const char* message; switch(m_error){ @@ -148,7 +148,4 @@ SndIO::SndIO(short channels, short bits, SndObj** inputlist, } return message; - - } - - +} diff --git a/src/sndobj/SndIO.h b/src/sndobj/SndIO.h index ad9456e..78a9ac0 100644 --- a/src/sndobj/SndIO.h +++ b/src/sndobj/SndIO.h @@ -128,7 +128,7 @@ class SndIO { virtual ~SndIO(); virtual short Read(); virtual short Write(); - virtual char* ErrorMessage(); + virtual const char* ErrorMessage(); int Error() { return m_error; } }; diff --git a/src/sndobj/SndObj.cpp b/src/sndobj/SndObj.cpp index a111426..e5b557c 100644 --- a/src/sndobj/SndObj.cpp +++ b/src/sndobj/SndObj.cpp @@ -201,36 +201,7 @@ SndObj::operator<<(SndIO& in){ for(int n=0;n