projects
/
aubio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
cc81763
)
src/aubio_priv.h: protect SQR parameters, avoid redefining MIN/MAX
author
Paul Brossier
<piem@piem.org>
Sat, 5 Sep 2015 09:42:41 +0000
(11:42 +0200)
committer
Paul Brossier
<piem@piem.org>
Sat, 5 Sep 2015 09:42:41 +0000
(11:42 +0200)
src/aubio_priv.h
patch
|
blob
|
history
diff --git
a/src/aubio_priv.h
b/src/aubio_priv.h
index
69f88e7
..
83d3698
100644
(file)
--- a/
src/aubio_priv.h
+++ b/
src/aubio_priv.h
@@
-196,10
+196,14
@@
typedef enum {
/* handy shortcuts */
#define DB2LIN(g) (POW(10.0,(g)*0.05f))
#define LIN2DB(v) (20.0*LOG10(v))
/* handy shortcuts */
#define DB2LIN(g) (POW(10.0,(g)*0.05f))
#define LIN2DB(v) (20.0*LOG10(v))
-#define SQR(_a) (_a*_a)
-
-#define MAX(a,b) ( a > b ? a : b)
-#define MIN(a,b) ( a < b ? a : b)
+#define SQR(_a) ((_a)*(_a))
+
+#ifndef MAX
+#define MAX(a,b) (((a)>(b))?(a):(b))
+#endif /* MAX */
+#ifndef MIN
+#define MIN(a,b) (((a)<(b))?(a):(b))
+#endif /* MIN */
#define ELEM_SWAP(a,b) { register smpl_t t=(a);(a)=(b);(b)=t; }
#define ELEM_SWAP(a,b) { register smpl_t t=(a);(a)=(b);(b)=t; }