diff options
| author | Mattias Andrée <maandree@kth.se> | 2016-03-04 10:45:10 +0100 |
|---|---|---|
| committer | Mattias Andrée <maandree@kth.se> | 2016-03-04 10:47:53 +0100 |
| commit | aff09967d194d062ae8d83c0fbe1edf158804ef9 (patch) | |
| tree | 793f32bc01e780bb6457570f9ea7a8e7ff94f7bb /src/internals.h | |
| parent | Add makefile and fix errors (diff) | |
| download | libzahl-aff09967d194d062ae8d83c0fbe1edf158804ef9.tar.gz libzahl-aff09967d194d062ae8d83c0fbe1edf158804ef9.tar.bz2 libzahl-aff09967d194d062ae8d83c0fbe1edf158804ef9.tar.xz | |
Clean up, fix a few bugs, and add a test
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/internals.h')
| -rw-r--r-- | src/internals.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/internals.h b/src/internals.h index 77ea29b..5b1f9c3 100644 --- a/src/internals.h +++ b/src/internals.h @@ -62,7 +62,8 @@ extern int libzahl_set_up; #define zmemcmp(a, b, n) memcmp(a, b, (n) * sizeof(zahl_char_t)) #define SET_SIGNUM(a, signum) ((a)->sign = (signum)) -#define SET(a, b) do { if (a != b) zset(a, b); } while (0) +#define SET(a, b) do { if ((a) != (b)) zset(a, b); } while (0) +#define ENSURE_SIZE(a, n) do { if ((a)->alloced < (n)) zahl_realloc(a, (n)); } while (0) #define MIN(a, b) ((a) < (b) ? (a) : (b)) #define MAX(a, b) ((a) > (b) ? (a) : (b)) |
