1 diff -Naur rezound-0.12.3beta~/src/backend/ALFO.h rezound-0.12.3beta/src/backend/ALFO.h
2 --- rezound-0.12.3beta~/src/backend/ALFO.h 2008-03-18 22:20:36.000000000 -0400
3 +++ rezound-0.12.3beta/src/backend/ALFO.h 2008-03-18 22:30:06.000000000 -0400
9 +#define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
12 +#if GCC_VERSION >= 403
15 +# define STATIC static
18 #include "../../config/common.h"
20 #include "CSound_defs.h"
24 #include <CNestedDataFile/anytype.h>
25 -template<> static const CLFODescription string_to_anytype<CLFODescription>(const string &str,CLFODescription &ret)
26 +template<> STATIC const CLFODescription string_to_anytype<CLFODescription>(const string &str,CLFODescription &ret)
29 f.parseString(s2at::remove_surrounding_quotes(str));
34 -template<> static const string anytype_to_string<CLFODescription>(const CLFODescription &any)
35 +template<> STATIC const string anytype_to_string<CLFODescription>(const CLFODescription &any)
37 CNestedDataFile f; any.writeToFile(&f,"");
38 return "\""+s2at::escape_chars(istring(f.asString()).searchAndReplace("\n"," ",true))+"\"";
39 diff -Naur rezound-0.12.3beta~/src/backend/CGraphParamValueNode.h rezound-0.12.3beta/src/backend/CGraphParamValueNode.h
40 --- rezound-0.12.3beta~/src/backend/CGraphParamValueNode.h 2008-03-18 22:20:36.000000000 -0400
41 +++ rezound-0.12.3beta/src/backend/CGraphParamValueNode.h 2008-03-18 22:33:30.000000000 -0400
43 #ifndef __CGraphParamValueNode_H__
44 #define __CGraphParamValueNode_H__
47 +#define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
50 +#if GCC_VERSION >= 403
53 +# define STATIC static
56 #include "../../config/common.h"
59 typedef vector<CGraphParamValueNode> CGraphParamValueNodeList;
61 #include <CNestedDataFile/anytype.h>
62 -template<> static const CGraphParamValueNode string_to_anytype<CGraphParamValueNode>(const string &_str,CGraphParamValueNode &ret)
63 +template<> STATIC const CGraphParamValueNode string_to_anytype<CGraphParamValueNode>(const string &_str,CGraphParamValueNode &ret)
65 const string str=s2at::remove_surrounding_quotes(_str);
66 const size_t pos=str.find("|");
71 -template<> static const string anytype_to_string<CGraphParamValueNode>(const CGraphParamValueNode &any)
72 +template<> STATIC const string anytype_to_string<CGraphParamValueNode>(const CGraphParamValueNode &any)
74 return "\""+anytype_to_string<double>(any.x)+"|"+anytype_to_string<double>(any.y)+"\"";
76 diff -Naur rezound-0.12.3beta~/src/backend/CPluginMapping.h rezound-0.12.3beta/src/backend/CPluginMapping.h
77 --- rezound-0.12.3beta~/src/backend/CPluginMapping.h 2008-03-18 22:20:36.000000000 -0400
78 +++ rezound-0.12.3beta/src/backend/CPluginMapping.h 2008-03-18 22:30:22.000000000 -0400
80 #ifndef __CPluginMapping_H__
81 #define __CPluginMapping_H__
84 +#define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
87 +#if GCC_VERSION >= 403
90 +# define STATIC static
93 #include "../../config/common.h"
99 #include <CNestedDataFile/anytype.h>
100 -template<> static const CPluginMapping string_to_anytype<CPluginMapping>(const string &str,CPluginMapping &ret)
101 +template<> STATIC const CPluginMapping string_to_anytype<CPluginMapping>(const string &str,CPluginMapping &ret)
104 f.parseString(s2at::remove_surrounding_quotes(str));
109 -template<> static const string anytype_to_string<CPluginMapping>(const CPluginMapping &any)
110 +template<> STATIC const string anytype_to_string<CPluginMapping>(const CPluginMapping &any)
113 any.writeToFile(&f,"");
114 diff -Naur rezound-0.12.3beta~/src/backend/CSound_defs.h rezound-0.12.3beta/src/backend/CSound_defs.h
115 --- rezound-0.12.3beta~/src/backend/CSound_defs.h 2008-03-18 22:20:36.000000000 -0400
116 +++ rezound-0.12.3beta/src/backend/CSound_defs.h 2008-03-18 22:31:38.000000000 -0400
118 #ifndef __CSound_defs_H__
119 #define __CSound_defs_H__
122 +#define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
125 +#if GCC_VERSION >= 403
128 +# define STATIC static
131 #include "../../config/common.h"
134 @@ -161,10 +171,10 @@
138 - template<> static inline const int8_t convert_sample<int8_t,int8_t>(const register int8_t sample) { return sample; }
139 + template<> STATIC inline const int8_t convert_sample<int8_t,int8_t>(const register int8_t sample) { return sample; }
142 - template<> static inline const int16_t convert_sample<int8_t,int16_t>(const register int8_t sample) { return sample*256; }
143 + template<> STATIC inline const int16_t convert_sample<int8_t,int16_t>(const register int8_t sample) { return sample*256; }
146 //template<> static inline const int24_t convert_sample<int8_t,int24_t>(const register int8_t sample) { }
148 //template<> static inline const int32_t convert_sample<int8_t,int32_t>(const register int8_t sample) { }
151 - template<> static inline const float convert_sample<int8_t,float>(const register int8_t sample) { return ((float)sample)/127.0f; }
152 + template<> STATIC inline const float convert_sample<int8_t,float>(const register int8_t sample) { return ((float)sample)/127.0f; }
155 //template<> static inline const double convert_sample<int8_t,double>(const register int8_t sample) { }
156 @@ -181,22 +191,22 @@
160 - template<> static inline const int8_t convert_sample<int16_t,int8_t>(const register int16_t sample) { return sample/256; }
161 + template<> STATIC inline const int8_t convert_sample<int16_t,int8_t>(const register int16_t sample) { return sample/256; }
163 // int16_t -> int16_t
164 - template<> static inline const int16_t convert_sample<int16_t,int16_t>(const register int16_t sample) { return sample; }
165 + template<> STATIC inline const int16_t convert_sample<int16_t,int16_t>(const register int16_t sample) { return sample; }
167 // int16_t -> int24_t
168 - template<> static inline const int24_t convert_sample<int16_t,int24_t>(const register int16_t sample) { int24_t r; r.set(sample*256); return r; }
169 + template<> STATIC inline const int24_t convert_sample<int16_t,int24_t>(const register int16_t sample) { int24_t r; r.set(sample*256); return r; }
171 // int16_t -> int32_t
172 - template<> static inline const int32_t convert_sample<int16_t,int32_t>(const register int16_t sample) { return sample*65536; }
173 + template<> STATIC inline const int32_t convert_sample<int16_t,int32_t>(const register int16_t sample) { return sample*65536; }
176 - template<> static inline const float convert_sample<int16_t,float>(const register int16_t sample) { return (float)sample/32767.0f; }
177 + template<> STATIC inline const float convert_sample<int16_t,float>(const register int16_t sample) { return (float)sample/32767.0f; }
180 - template<> static inline const double convert_sample<int16_t,double>(const register int16_t sample) { return (double)sample/32767.0; }
181 + template<> STATIC inline const double convert_sample<int16_t,double>(const register int16_t sample) { return (double)sample/32767.0; }
185 @@ -204,16 +214,16 @@
186 //template<> static inline const int8_t convert_sample<int24_t,int8_t>(const int24_t sample) { }
188 // int24_t -> int16_t
189 - template<> static inline const int16_t convert_sample<int24_t,int16_t>(const int24_t sample) { return sample.get()>>8; }
190 + template<> STATIC inline const int16_t convert_sample<int24_t,int16_t>(const int24_t sample) { return sample.get()>>8; }
192 // int24_t -> int24_t
193 - template<> static inline const int24_t convert_sample<int24_t,int24_t>(const int24_t sample) { return sample; }
194 + template<> STATIC inline const int24_t convert_sample<int24_t,int24_t>(const int24_t sample) { return sample; }
196 // int24_t -> int32_t
197 //template<> static inline const int32_t convert_sample<int24_t,int32_t>(const int24_t sample) { }
200 - template<> static inline const float convert_sample<int24_t,float>(const int24_t sample) { return sample.get()/8388607.0f; }
201 + template<> STATIC inline const float convert_sample<int24_t,float>(const int24_t sample) { return sample.get()/8388607.0f; }
204 //template<> static inline const double convert_sample<int24_t,double>(const int24_t sample) { }
205 @@ -224,16 +234,16 @@
206 //template<> static inline const int8_t convert_sample<int32_t,int8_t>(const register int32_t sample) { }
208 // int32_t -> int16_t
209 - template<> static inline const int16_t convert_sample<int32_t,int16_t>(const register int32_t sample) { return sample/65536; }
210 + template<> STATIC inline const int16_t convert_sample<int32_t,int16_t>(const register int32_t sample) { return sample/65536; }
212 // int32_t -> int24_t
213 //template<> static inline const int24_t convert_sample<int32_t,int24_t>(const register int32_t sample) { }
215 // int32_t -> int32_t
216 - template<> static inline const int32_t convert_sample<int32_t,int32_t>(const register int32_t sample) { return sample; }
217 + template<> STATIC inline const int32_t convert_sample<int32_t,int32_t>(const register int32_t sample) { return sample; }
220 - template<> static inline const float convert_sample<int32_t,float>(const register int32_t sample) { return ((double)sample)/2147483647.0; }
221 + template<> STATIC inline const float convert_sample<int32_t,float>(const register int32_t sample) { return ((double)sample)/2147483647.0; }
224 //template<> static inline const double convert_sample<int32_t,double >(const register int32_t sample) { }
225 @@ -241,22 +251,22 @@
229 - template<> static inline const int8_t convert_sample<float,int8_t>(const register float sample) { return (int8_t)floorf((sample>1.0f ? 1.0f : (sample<-1.0f ? -1.0f : sample))*127.0f); }
230 + template<> STATIC inline const int8_t convert_sample<float,int8_t>(const register float sample) { return (int8_t)floorf((sample>1.0f ? 1.0f : (sample<-1.0f ? -1.0f : sample))*127.0f); }
233 - template<> static inline const int16_t convert_sample<float,int16_t>(const register float sample) { return (int16_t)floorf((sample>1.0f ? 1.0f : (sample<-1.0f ? -1.0f : sample))*32767.0f); }
234 + template<> STATIC inline const int16_t convert_sample<float,int16_t>(const register float sample) { return (int16_t)floorf((sample>1.0f ? 1.0f : (sample<-1.0f ? -1.0f : sample))*32767.0f); }
237 - template<> static inline const int24_t convert_sample<float,int24_t>(const register float sample) { int24_t r; r.set((int_fast32_t)floorf((sample>1.0f ? 1.0f : (sample<-1.0f ? -1.0f : sample))*8388607.0f)); return r; }
238 + template<> STATIC inline const int24_t convert_sample<float,int24_t>(const register float sample) { int24_t r; r.set((int_fast32_t)floorf((sample>1.0f ? 1.0f : (sample<-1.0f ? -1.0f : sample))*8388607.0f)); return r; }
241 - template<> static inline const int32_t convert_sample<float,int32_t>(const register float sample) { return (int32_t) floor((double)(sample>1.0f ? 1.0f : (sample<-1.0f ? -1.0f : sample)) * 2147483647.0); }
242 + template<> STATIC inline const int32_t convert_sample<float,int32_t>(const register float sample) { return (int32_t) floor((double)(sample>1.0f ? 1.0f : (sample<-1.0f ? -1.0f : sample)) * 2147483647.0); }
245 - template<> static inline const float convert_sample<float,float>(const register float sample) { return sample; }
246 + template<> STATIC inline const float convert_sample<float,float>(const register float sample) { return sample; }
249 - template<> static inline const double convert_sample<float,double>(const register float sample) { return (double)sample; }
250 + template<> STATIC inline const double convert_sample<float,double>(const register float sample) { return (double)sample; }
255 //template<> static inline const int8_t convert_sample<double,int8_t>(const register double sample) { }
258 - template<> static inline const int16_t convert_sample<double,int16_t>(const register double sample) { return (int16_t)floor((sample>1.0 ? 1.0 : (sample<-1.0 ? -1.0 : sample))*32767.0); }
259 + template<> STATIC inline const int16_t convert_sample<double,int16_t>(const register double sample) { return (int16_t)floor((sample>1.0 ? 1.0 : (sample<-1.0 ? -1.0 : sample))*32767.0); }
262 //template<> static inline const int24_t convert_sample<double,int24_t>(const register double sample) { }
263 @@ -273,10 +283,10 @@
264 //template<> static inline const int32_t convert_sample<double,int32_t>(const register double sample) { }
267 - template<> static inline const float convert_sample<double,float>(const register double sample) { return (float)sample; }
268 + template<> STATIC inline const float convert_sample<double,float>(const register double sample) { return (float)sample; }
271 - template<> static inline const double convert_sample<double,double>(const register double sample) { return sample; }
272 + template<> STATIC inline const double convert_sample<double,double>(const register double sample) { return sample; }
276 diff -Naur rezound-0.12.3beta~/src/backend/Generate/CGenerateNoiseAction.cpp rezound-0.12.3beta/src/backend/Generate/CGenerateNoiseAction.cpp
277 --- rezound-0.12.3beta~/src/backend/Generate/CGenerateNoiseAction.cpp 2008-03-18 22:20:36.000000000 -0400
278 +++ rezound-0.12.3beta/src/backend/Generate/CGenerateNoiseAction.cpp 2008-03-18 22:33:05.000000000 -0400
280 #include "CGenerateNoiseAction.h"
282 #include "../CActionParameters.h"
285 CGenerateNoiseAction::CGenerateNoiseAction(const AActionFactory *factory,const CActionSound *actionSound,const double _noiseLength,const double _volume,const NoiseTypes _noiseType,const StereoImage _stereoImage,const double _maxParticleVelocity):
286 AAction(factory,actionSound),
287 diff -Naur rezound-0.12.3beta~/src/misc/CNestedDataFile/anytype.h rezound-0.12.3beta/src/misc/CNestedDataFile/anytype.h
288 --- rezound-0.12.3beta~/src/misc/CNestedDataFile/anytype.h 2008-03-18 22:20:36.000000000 -0400
289 +++ rezound-0.12.3beta/src/misc/CNestedDataFile/anytype.h 2008-03-18 22:33:11.000000000 -0400
291 #ifndef __anytype_H__
292 #define __anytype_H__
295 +#define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
298 +#if GCC_VERSION >= 403
301 +# define STATIC static
306 #include <vector> // for the vector implemenation to/from string
309 // template specializations of string_to_anytype
311 -template<> static const string string_to_anytype<string>(const string &str,string &ret) { return s2at::unescape_chars(s2at::remove_surrounding_quotes(str)); }
312 +template<> STATIC const string string_to_anytype<string>(const string &str,string &ret) { return s2at::unescape_chars(s2at::remove_surrounding_quotes(str)); }
314 -template<> static const bool string_to_anytype<bool>(const string &str,bool &ret) { return s2at::remove_surrounding_quotes(str)=="true" ? ret=true : ret=false; }
315 +template<> STATIC const bool string_to_anytype<bool>(const string &str,bool &ret) { return s2at::remove_surrounding_quotes(str)=="true" ? ret=true : ret=false; }
317 -template<> static const char string_to_anytype<char>(const string &str,char &ret) { istringstream ss(s2at::remove_surrounding_quotes(str)); NO_LOCALE(ss) ret=0; ss >> ret; return ret; }
318 -template<> static const unsigned char string_to_anytype<unsigned char>(const string &str,unsigned char &ret) { istringstream ss(s2at::remove_surrounding_quotes(str)); NO_LOCALE(ss) ret=0; ss >> ret; return ret; }
319 +template<> STATIC const char string_to_anytype<char>(const string &str,char &ret) { istringstream ss(s2at::remove_surrounding_quotes(str)); NO_LOCALE(ss) ret=0; ss >> ret; return ret; }
320 +template<> STATIC const unsigned char string_to_anytype<unsigned char>(const string &str,unsigned char &ret) { istringstream ss(s2at::remove_surrounding_quotes(str)); NO_LOCALE(ss) ret=0; ss >> ret; return ret; }
322 -template<> static const short string_to_anytype<short>(const string &str,short &ret) { istringstream ss(s2at::remove_surrounding_quotes(str)); NO_LOCALE(ss) ret=0; ss >> ret; return ret; }
323 -template<> static const unsigned short string_to_anytype<unsigned short>(const string &str,unsigned short &ret) { istringstream ss(s2at::remove_surrounding_quotes(str)); NO_LOCALE(ss) ret=0; ss >> ret; return ret; }
324 +template<> STATIC const short string_to_anytype<short>(const string &str,short &ret) { istringstream ss(s2at::remove_surrounding_quotes(str)); NO_LOCALE(ss) ret=0; ss >> ret; return ret; }
325 +template<> STATIC const unsigned short string_to_anytype<unsigned short>(const string &str,unsigned short &ret) { istringstream ss(s2at::remove_surrounding_quotes(str)); NO_LOCALE(ss) ret=0; ss >> ret; return ret; }
327 -template<> static const int string_to_anytype<int>(const string &str,int &ret) { istringstream ss(s2at::remove_surrounding_quotes(str)); NO_LOCALE(ss) ret=0; ss >> ret; return ret; }
328 -template<> static const unsigned int string_to_anytype<unsigned int>(const string &str,unsigned int &ret) { istringstream ss(s2at::remove_surrounding_quotes(str)); NO_LOCALE(ss) ret=0; ss >> ret; return ret; }
329 +template<> STATIC const int string_to_anytype<int>(const string &str,int &ret) { istringstream ss(s2at::remove_surrounding_quotes(str)); NO_LOCALE(ss) ret=0; ss >> ret; return ret; }
330 +template<> STATIC const unsigned int string_to_anytype<unsigned int>(const string &str,unsigned int &ret) { istringstream ss(s2at::remove_surrounding_quotes(str)); NO_LOCALE(ss) ret=0; ss >> ret; return ret; }
332 -template<> static const long string_to_anytype<long>(const string &str,long &ret) { istringstream ss(s2at::remove_surrounding_quotes(str)); NO_LOCALE(ss) ret=0; ss >> ret; return ret; }
333 -template<> static const unsigned long string_to_anytype<unsigned long>(const string &str,unsigned long &ret) { istringstream ss(s2at::remove_surrounding_quotes(str)); NO_LOCALE(ss) ret=0; ss >> ret; return ret; }
334 +template<> STATIC const long string_to_anytype<long>(const string &str,long &ret) { istringstream ss(s2at::remove_surrounding_quotes(str)); NO_LOCALE(ss) ret=0; ss >> ret; return ret; }
335 +template<> STATIC const unsigned long string_to_anytype<unsigned long>(const string &str,unsigned long &ret) { istringstream ss(s2at::remove_surrounding_quotes(str)); NO_LOCALE(ss) ret=0; ss >> ret; return ret; }
337 -template<> static const long long string_to_anytype<long long>(const string &str,long long &ret) { istringstream ss(s2at::remove_surrounding_quotes(str)); NO_LOCALE(ss) ret=0; ss >> ret; return ret; }
338 -template<> static const unsigned long long string_to_anytype<unsigned long long>(const string &str,unsigned long long &ret) { istringstream ss(s2at::remove_surrounding_quotes(str)); NO_LOCALE(ss) ret=0; ss >> ret; return ret; }
339 +template<> STATIC const long long string_to_anytype<long long>(const string &str,long long &ret) { istringstream ss(s2at::remove_surrounding_quotes(str)); NO_LOCALE(ss) ret=0; ss >> ret; return ret; }
340 +template<> STATIC const unsigned long long string_to_anytype<unsigned long long>(const string &str,unsigned long long &ret) { istringstream ss(s2at::remove_surrounding_quotes(str)); NO_LOCALE(ss) ret=0; ss >> ret; return ret; }
342 -template<> static const float string_to_anytype<float>(const string &str,float &ret) { istringstream ss(s2at::remove_surrounding_quotes(str)); NO_LOCALE(ss) ret=0.0f; ss >> ret; return ret; }
343 -template<> static const double string_to_anytype<double>(const string &str,double &ret) { istringstream ss(s2at::remove_surrounding_quotes(str)); NO_LOCALE(ss) ret=0.0; ss >> ret; return ret; }
344 -template<> static const long double string_to_anytype<long double>(const string &str,long double &ret) { istringstream ss(s2at::remove_surrounding_quotes(str)); NO_LOCALE(ss) ret=0.0; ss >> ret; return ret; }
345 +template<> STATIC const float string_to_anytype<float>(const string &str,float &ret) { istringstream ss(s2at::remove_surrounding_quotes(str)); NO_LOCALE(ss) ret=0.0f; ss >> ret; return ret; }
346 +template<> STATIC const double string_to_anytype<double>(const string &str,double &ret) { istringstream ss(s2at::remove_surrounding_quotes(str)); NO_LOCALE(ss) ret=0.0; ss >> ret; return ret; }
347 +template<> STATIC const long double string_to_anytype<long double>(const string &str,long double &ret) { istringstream ss(s2at::remove_surrounding_quotes(str)); NO_LOCALE(ss) ret=0.0; ss >> ret; return ret; }
349 // I really wished that I didn't have to explicitly use 'vector' in the definition; I'd have like to use any container with an iterator interface
351 @@ -119,31 +129,31 @@
353 // template specializations of anytype_to_string
355 -template<> static const string anytype_to_string<string>(const string &any) { return "\""+s2at::escape_chars(any)+"\""; }
356 +template<> STATIC const string anytype_to_string<string>(const string &any) { return "\""+s2at::escape_chars(any)+"\""; }
358 -template<> static const string anytype_to_string<bool>(const bool &any) { return any ? "true" : "false"; }
359 +template<> STATIC const string anytype_to_string<bool>(const bool &any) { return any ? "true" : "false"; }
361 -template<> static const string anytype_to_string<char>(const char &any) { ostringstream ss; NO_LOCALE(ss) ss << any; return ss.str(); }
362 -template<> static const string anytype_to_string<unsigned char>(const unsigned char &any) { ostringstream ss; NO_LOCALE(ss) ss << any; return ss.str(); }
363 +template<> STATIC const string anytype_to_string<char>(const char &any) { ostringstream ss; NO_LOCALE(ss) ss << any; return ss.str(); }
364 +template<> STATIC const string anytype_to_string<unsigned char>(const unsigned char &any) { ostringstream ss; NO_LOCALE(ss) ss << any; return ss.str(); }
366 -template<> static const string anytype_to_string<short>(const short &any) { ostringstream ss; NO_LOCALE(ss) ss << any; return ss.str(); }
367 -template<> static const string anytype_to_string<unsigned short>(const unsigned short &any) { ostringstream ss; NO_LOCALE(ss) ss << any; return ss.str(); }
368 +template<> STATIC const string anytype_to_string<short>(const short &any) { ostringstream ss; NO_LOCALE(ss) ss << any; return ss.str(); }
369 +template<> STATIC const string anytype_to_string<unsigned short>(const unsigned short &any) { ostringstream ss; NO_LOCALE(ss) ss << any; return ss.str(); }
371 -template<> static const string anytype_to_string<int>(const int &any) { ostringstream ss; NO_LOCALE(ss) ss << any; return ss.str(); }
372 -template<> static const string anytype_to_string<unsigned int>(const unsigned int &any) { ostringstream ss; NO_LOCALE(ss) ss << any; return ss.str(); }
373 +template<> STATIC const string anytype_to_string<int>(const int &any) { ostringstream ss; NO_LOCALE(ss) ss << any; return ss.str(); }
374 +template<> STATIC const string anytype_to_string<unsigned int>(const unsigned int &any) { ostringstream ss; NO_LOCALE(ss) ss << any; return ss.str(); }
376 -template<> static const string anytype_to_string<long>(const long &any) { ostringstream ss; NO_LOCALE(ss) ss << any; return ss.str(); }
377 -template<> static const string anytype_to_string<unsigned long>(const unsigned long &any) { ostringstream ss; NO_LOCALE(ss) ss << any; return ss.str(); }
378 +template<> STATIC const string anytype_to_string<long>(const long &any) { ostringstream ss; NO_LOCALE(ss) ss << any; return ss.str(); }
379 +template<> STATIC const string anytype_to_string<unsigned long>(const unsigned long &any) { ostringstream ss; NO_LOCALE(ss) ss << any; return ss.str(); }
381 -template<> static const string anytype_to_string<long long>(const long long &any) { ostringstream ss; NO_LOCALE(ss) ss << any; return ss.str(); }
382 -template<> static const string anytype_to_string<unsigned long long>(const unsigned long long &any) { ostringstream ss; NO_LOCALE(ss) ss << any; return ss.str(); }
383 +template<> STATIC const string anytype_to_string<long long>(const long long &any) { ostringstream ss; NO_LOCALE(ss) ss << any; return ss.str(); }
384 +template<> STATIC const string anytype_to_string<unsigned long long>(const unsigned long long &any) { ostringstream ss; NO_LOCALE(ss) ss << any; return ss.str(); }
386 // I've picked a rather arbitrary way of formatting floats one way or another depending on how big it is.. I wish there were a way to output the ascii in such a way as to preserve all the information in the float (without printing the hex of it or something like that)
388 #include <math.h> // for isnan which I hope is there (maybe fix in common.h if it's not
389 -template<> static const string anytype_to_string<float>(const float &any) { if(isnan(any)) return "0"; else { ostringstream ss; NO_LOCALE(ss) if(any>999999.0) {ss.setf(ios::scientific); ss.width(0); ss.precision(12); ss.fill(' '); } else {ss.setf(ios::fixed); ss.precision(6); ss.fill(' '); } ss << any; return istring(ss.str()).trim(); } }
390 -template<> static const string anytype_to_string<double>(const double &any) { if(isnan(any)) return "0"; else { ostringstream ss; NO_LOCALE(ss) if(any>999999.0) {ss.setf(ios::scientific); ss.width(0); ss.precision(12); ss.fill(' '); } else {ss.setf(ios::fixed); ss.precision(6); ss.fill(' '); } ss << any; return istring(ss.str()).trim(); } }
391 -template<> static const string anytype_to_string<long double>(const long double &any) { if(isnan(any)) return "0"; else { ostringstream ss; NO_LOCALE(ss) if(any>999999.0) {ss.setf(ios::scientific); ss.width(0); ss.precision(12); ss.fill(' '); } else {ss.setf(ios::fixed); ss.precision(6); ss.fill(' '); } ss << any; return istring(ss.str()).trim(); } }
392 +template<> STATIC const string anytype_to_string<float>(const float &any) { if(isnan(any)) return "0"; else { ostringstream ss; NO_LOCALE(ss) if(any>999999.0) {ss.setf(ios::scientific); ss.width(0); ss.precision(12); ss.fill(' '); } else {ss.setf(ios::fixed); ss.precision(6); ss.fill(' '); } ss << any; return istring(ss.str()).trim(); } }
393 +template<> STATIC const string anytype_to_string<double>(const double &any) { if(isnan(any)) return "0"; else { ostringstream ss; NO_LOCALE(ss) if(any>999999.0) {ss.setf(ios::scientific); ss.width(0); ss.precision(12); ss.fill(' '); } else {ss.setf(ios::fixed); ss.precision(6); ss.fill(' '); } ss << any; return istring(ss.str()).trim(); } }
394 +template<> STATIC const string anytype_to_string<long double>(const long double &any) { if(isnan(any)) return "0"; else { ostringstream ss; NO_LOCALE(ss) if(any>999999.0) {ss.setf(ios::scientific); ss.width(0); ss.precision(12); ss.fill(' '); } else {ss.setf(ios::fixed); ss.precision(6); ss.fill(' '); } ss << any; return istring(ss.str()).trim(); } }
397 // I really wished that I didn't have to explicitly use 'vector' in the definition, I'd have like to use any container with an iterator interface
398 diff -Naur rezound-0.12.3beta~/src/misc/endian_util.h rezound-0.12.3beta/src/misc/endian_util.h
399 --- rezound-0.12.3beta~/src/misc/endian_util.h 2008-03-18 22:20:36.000000000 -0400
400 +++ rezound-0.12.3beta/src/misc/endian_util.h 2008-03-18 22:29:18.000000000 -0400
402 #ifndef __endian_util_H__
403 #define __endian_util_H__
406 +#define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
409 +#if GCC_VERSION >= 403
412 +# define STATIC static
416 * This header files given functionality to convenient change endian-ness of values
417 * and through the use of very few function names regardless of the type.
418 @@ -131,13 +141,13 @@
421 // --- implementation for 1 byte quantities (nothing)
422 - template<> inline static void really_swap_endian_ptr<1>(void *value,const unsigned size)
423 + template<> inline STATIC void really_swap_endian_ptr<1>(void *value,const unsigned size)
428 // --- implementation for 2 byte quantities
429 - template<> inline static void really_swap_endian_ptr<2>(void *value,const unsigned size)
430 + template<> inline STATIC void really_swap_endian_ptr<2>(void *value,const unsigned size)
432 const register uint16_t v=((uint16_t *)value)[0];
433 ((uint16_t *)value)[0]=
437 // --- implementation for 4 byte quantities
438 - template<> inline static void really_swap_endian_ptr<4>(void *value,const unsigned size)
439 + template<> inline STATIC void really_swap_endian_ptr<4>(void *value,const unsigned size)
441 const register uint32_t v=((uint32_t *)value)[0];
442 ((uint32_t *)value)[0]=
446 // --- implementation for 8 byte quantities
447 - template<> inline static void really_swap_endian_ptr<8>(void *value,const unsigned size)
448 + template<> inline STATIC void really_swap_endian_ptr<8>(void *value,const unsigned size)
450 const register uint64_t v=((uint64_t *)value)[0];
451 // of 8, swap upper most and lower most octets then the next two inward, and so on ..