projects
/
aubio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f3848c0
)
[aubio_priv] add AUBIO_ASSERT_EQUAL_SHAPE helper
author
Paul Brossier
<piem@piem.org>
Mon, 7 Jan 2019 21:51:34 +0000
(22:51 +0100)
committer
Paul Brossier
<piem@piem.org>
Mon, 7 Jan 2019 21:51:34 +0000
(22:51 +0100)
src/aubio_priv.h
patch
|
blob
|
history
diff --git
a/src/aubio_priv.h
b/src/aubio_priv.h
index
28bbaa9
..
019258e
100644
(file)
--- a/
src/aubio_priv.h
+++ b/
src/aubio_priv.h
@@
-399,4
+399,12
@@
uint_t aubio_log(sint_t level, const char_t *fmt, ...);
// goto to failure if condition x is not true
#define AUBIO_GOTO_FAILURE(x) if (!(x)) goto failure
+#define AUBIO_ASSERT_EQUAL_SHAPE(t1, t2) { \
+ AUBIO_ASSERT(t1 && t2); \
+ AUBIO_ASSERT(t1->ndim == t2->ndim); \
+ uint_t nn; \
+ for (nn = 0; nn < t1->ndim; nn++) \
+ AUBIO_ASSERT(t1->shape[nn] == t2->shape[nn]); \
+ }
+
#endif /* AUBIO_PRIV_H */