aboutsummaryrefslogtreecommitdiffstats
path: root/src/internals.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-04-26 23:10:15 +0200
committerMattias Andrée <maandree@kth.se>2016-04-26 23:10:15 +0200
commitef6bf64a3c9139ff1f1b2dce45f91cf826067a33 (patch)
tree82f95d076c4fc79bfb33bf27572cab8bbca2b3bb /src/internals.h
parentEnsure that failure does not result in memory leak (diff)
downloadlibzahl-ef6bf64a3c9139ff1f1b2dce45f91cf826067a33.tar.gz
libzahl-ef6bf64a3c9139ff1f1b2dce45f91cf826067a33.tar.bz2
libzahl-ef6bf64a3c9139ff1f1b2dce45f91cf826067a33.tar.xz
zzero1 did not guarantee that all arguments were evaulated exactly once, thus made static inline
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--src/internals.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/internals.h b/src/internals.h
index 3ee7bd3..6454a21 100644
--- a/src/internals.h
+++ b/src/internals.h
@@ -111,7 +111,6 @@ extern struct zahl **libzahl_temp_stack_end;
#define zpositive(a) (zsignum(a) > 0)
#define zpositive1(a, b) (zpositive(a) + zpositive(b) > 0)
#define zpositive2(a, b) (zsignum(a) + zsignum(b) == 2)
-#define zzero1(a, b) (zzero(a) || zzero(b))
#define zzero2(a, b) (!(zsignum(a) | zsignum(b)))
#define zmemmove(d, s, n) memmove((d), (s), (n) * sizeof(zahl_char_t))
@@ -119,6 +118,12 @@ void libzahl_realloc(z_t a, size_t need);
void zmul_impl(z_t a, z_t b, z_t c);
void zsqr_impl(z_t a, z_t b);
+static inline int
+zzero1(z_t a, z_t b)
+{
+ return zzero(a) || zzero(b);
+}
+
static void
libzahl_failure(int error)
{