diff options
| author | Mattias Andrée <maandree@kth.se> | 2016-03-02 21:16:00 +0100 |
|---|---|---|
| committer | Mattias Andrée <maandree@kth.se> | 2016-03-02 21:16:00 +0100 |
| commit | c27c4204f0d734bc1a889b4405469ac83d568883 (patch) | |
| tree | ff9fdcd42402bb2a7618a3ea3795cf3d63131940 /src | |
| parent | Add zand, zor, zxor, znot, zbtest, zsplit, and the newly introduced ztrunc (diff) | |
| download | libzahl-c27c4204f0d734bc1a889b4405469ac83d568883.tar.gz libzahl-c27c4204f0d734bc1a889b4405469ac83d568883.tar.bz2 libzahl-c27c4204f0d734bc1a889b4405469ac83d568883.tar.xz | |
Cleanup and add missing header inclusions
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src')
| -rw-r--r-- | src/zand.c | 1 | ||||
| -rw-r--r-- | src/zlsb.c | 3 | ||||
| -rw-r--r-- | src/zor.c | 3 | ||||
| -rw-r--r-- | src/zsetu.c | 2 | ||||
| -rw-r--r-- | src/zsplit.c | 2 | ||||
| -rw-r--r-- | src/zstr.c | 3 | ||||
| -rw-r--r-- | src/zxor.c | 3 |
7 files changed, 14 insertions, 3 deletions
@@ -1,6 +1,7 @@ /* See LICENSE file for copyright and license details. */ #include "internals" +#include <stdlib.h> #include <string.h> @@ -7,9 +7,8 @@ zlsb(z_t a) { size_t i = 0; zahl_char_t x; - if (zzero(a)) { + if (zzero(a)) return SIZE_MAX; - } for (;; i++) { x = a->chars[i]; if (x) { @@ -1,6 +1,9 @@ /* See LICENSE file for copyright and license details. */ #include "internals" +#include <stdlib.h> +#include <string.h> + void zor(z_t a, z_t b, z_t c) diff --git a/src/zsetu.c b/src/zsetu.c index dd1be17..c3c3510 100644 --- a/src/zsetu.c +++ b/src/zsetu.c @@ -1,6 +1,8 @@ /* See LICENSE file for copyright and license details. */ #include "internals" +#include <stdlib.h> + #define SIZE_MULTIPLE(fit, in) ((sizeof(fit) + sizeof(in) - 1) / sizeof(in)) diff --git a/src/zsplit.c b/src/zsplit.c index 40b3e54..3e7940b 100644 --- a/src/zsplit.c +++ b/src/zsplit.c @@ -13,7 +13,7 @@ zsplit(z_t high, z_t low, z_t a, size_t delim) return; } - chars = delim >> LB_BITS_PER_CHAR; + chars = FLOOR_BITS_TO_CHARS(delim); if (high == a) { if (a->used < chars) @@ -1,6 +1,9 @@ /* See LICENSE file for copyright and license details. */ #include "internals" +#include <stdlib.h> +#include <stdio.h> + #define num libzahl_tmp_str_num #define rem libzahl_tmp_str_rem @@ -1,6 +1,9 @@ /* See LICENSE file for copyright and license details. */ #include "internals" +#include <string.h> +#include <stdlib.h> + void zxor(z_t a, z_t b, z_t c) |
