libzahl

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

commit c27c4204f0d734bc1a889b4405469ac83d568883
parent 3ae8c069900514c1785fe4a84b6cdb0157dff59e
Author: Mattias Andrée <maandree@kth.se>
Date:   Wed,  2 Mar 2016 21:16:00 +0100

Cleanup and add missing header inclusions

Signed-off-by: Mattias Andrée <maandree@kth.se>

Diffstat:
Msrc/zand.c | 1+
Msrc/zlsb.c | 3+--
Msrc/zor.c | 3+++
Msrc/zsetu.c | 2++
Msrc/zsplit.c | 2+-
Msrc/zstr.c | 3+++
Msrc/zxor.c | 3+++
7 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/src/zand.c b/src/zand.c @@ -1,6 +1,7 @@ /* See LICENSE file for copyright and license details. */ #include "internals" +#include <stdlib.h> #include <string.h> diff --git a/src/zlsb.c b/src/zlsb.c @@ -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) { diff --git a/src/zor.c b/src/zor.c @@ -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 @@ -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 @@ -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) diff --git a/src/zstr.c b/src/zstr.c @@ -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 diff --git a/src/zxor.c b/src/zxor.c @@ -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)