From 48a89e0e110907a7a60ed8f5a0977e3b34661259 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 5 Mar 2016 20:59:03 +0100 Subject: zinit is now an inline function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- zahl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'zahl.h') diff --git a/zahl.h b/zahl.h index a5946fc..39d08a2 100644 --- a/zahl.h +++ b/zahl.h @@ -42,7 +42,6 @@ void zunsetup(void); /* Free resources used by libzahl */ /* Memory functions. */ -void zinit(z_t); /* Prepare a for use. */ void zfree(z_t); /* Free resources in a. */ void zswap(z_t, z_t); /* (a, b) := (b, a) */ size_t zsave(z_t, void *); /* Store a into b (if !!b), and return number of written bytes. */ @@ -140,9 +139,10 @@ void zperror(const char *); /* Identical to perror(3p) except it supp /* Inline functions. */ +static inline void zinit(z_t a) { a->alloced = 0; a->chars = 0; } /* Prepare a for use. */ static inline int zeven(z_t a) { return !a->sign || !(a->chars[0] & 1); } /* Is a even? */ static inline int zodd(z_t a) { return a->sign && (a->chars[0] & 1); } /* Is a odd? */ static inline int zeven_nonzero(z_t a) { return !(a->chars[0] & 1); } /* Is a even? Assumes a ≠ 0. */ static inline int zodd_nonzero(z_t a) { return (a->chars[0] & 1); } /* Is a odd? Assumes a ≠ 0. */ static inline int zzero(z_t a) { return !a->sign; } /* Is a zero? */ -static inline int zsignum(z_t a) { return a->sign; } /* a/|a|, 0 if a is zero */ +static inline int zsignum(z_t a) { return a->sign; } /* a/|a|, 0 if a is zero. */ -- cgit v1.2.3-70-g09d2