projects
/
aubio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bacf0c6
)
[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>
Wed, 29 Dec 2021 16:51:47 +0000
(11:51 -0500)
src/aubio_priv.h
patch
|
blob
|
history
diff --git
a/src/aubio_priv.h
b/src/aubio_priv.h
index
99dd299
..
11ba1c4
100644
(file)
--- a/
src/aubio_priv.h
+++ b/
src/aubio_priv.h
@@
-412,4
+412,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 */