libzahl

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

commit ea5c6307c674d345295de3e1301ea16586880484
parent 04dc4ce9b5dc52fd455de8bcbdfef52321c1e4df
Author: Mattias Andrée <maandree@kth.se>
Date:   Fri, 29 Apr 2016 18:55:33 +0200

Change UNSAFE to ZAHL_UNSAFE, so it can be used in zahl-inlines.h

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

Diffstat:
Mbench/libhebimath.h | 2+-
Mbench/libtfm.h | 2+-
Mbench/libtommath.h | 2+-
Mconfig.mk | 2+-
Msrc/internals.h | 2+-
Msrc/zrand.c | 2+-
Mtest.c | 2+-
7 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/bench/libhebimath.h b/bench/libhebimath.h @@ -29,7 +29,7 @@ static jmp_buf jbuf; #define UNIFORM 1 #define MODUNIFORM 2 -#ifdef UNSAFE +#ifdef ZAHL_UNSAFE # define try(expr) (expr) #else # define try(expr) do if ((error = (expr))) longjmp(jbuf, 1); while (0) diff --git a/bench/libtfm.h b/bench/libtfm.h @@ -24,7 +24,7 @@ static z_t _0, _1, _a, _b; static int _tmp, error; static jmp_buf jbuf; -#ifdef UNSAFE +#ifdef ZAHL_UNSAFE # define try(expr) (expr) #else # define try(expr) do if ((error = (expr))) longjmp(jbuf, 1); while (0) diff --git a/bench/libtommath.h b/bench/libtommath.h @@ -24,7 +24,7 @@ static z_t _0, _1, _a, _b; static int _tmp, error; static jmp_buf jbuf; -#ifdef UNSAFE +#ifdef ZAHL_UNSAFE # define try(expr) (expr) #else # define try(expr) do if ((error = (expr))) longjmp(jbuf, 1); while (0) diff --git a/config.mk b/config.mk @@ -15,7 +15,7 @@ RANLIB = ranlib # you have to add -DSECURE_RANDOM_PATHNAME=... to CPPFLAGS. # Remove -DGOOD_RAND if the higher bits have higher entropy in the lower # bits in rand(3), this was historically the case. -# Add -DUNSAFE if you rather libzahl did not check for errors. +# Add -DZAHL_UNSAFE if you rather libzahl did not check for errors. CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -DGOOD_RAND CFLAGS = -std=c99 -flto -O3 -Wall -pedantic diff --git a/src/internals.h b/src/internals.h @@ -97,7 +97,7 @@ extern void *libzahl_temp_allocation; #define likely(expr) ZAHL_LIKELY(expr) #define unlikely(expr) ZAHL_UNLIKELY(expr) -#if defined(UNSAFE) +#if defined(ZAHL_UNSAFE) # define check(expr) 0 #else # define check(expr) unlikely(expr) diff --git a/src/zrand.c b/src/zrand.c @@ -209,7 +209,7 @@ zrand(z_t r, enum zranddev dev, enum zranddist dist, z_t n) break; default: -#if !defined(UNSAFE) +#if !defined(ZAHL_UNSAFE) libzahl_failure(EINVAL); #endif break; diff --git a/test.c b/test.c @@ -787,7 +787,7 @@ main(void) assert((zseti(a, 11), zptest(0, a, 100)), != NONPRIME); assert((zseti(a, 101), zptest(0, a, 100)), != NONPRIME); -#if defined(UNSAFE) +#if defined(ZAHL_UNSAFE) (void) env2; #else assert_nr(zdivmod(a, b, _0, _0));