libzahl

big integer library
git clone git://git.suckless.org/libzahl
Log | Files | Refs | README | LICENSE

commit ef6bf64a3c9139ff1f1b2dce45f91cf826067a33
parent 3413d878a7b1a37ff362ddfa9141349e73af917a
Author: Mattias Andrée <maandree@kth.se>
Date:   Tue, 26 Apr 2016 23:10:15 +0200

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:
Msrc/internals.h | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git 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) {