(wrong string) ée

From: <git_AT_suckless.org>
Date: Wed, 27 Apr 2016 02:28:55 +0200 (CEST)

commit cf5f82f17769ad3f6729dc1344acc5431ae5344d
Author: Mattias Andrée <maandree_AT_kth.se>
AuthorDate: Wed Apr 27 02:27:52 2016 +0200
Commit: Mattias Andrée <maandree_AT_kth.se>
CommitDate: Wed Apr 27 02:27:52 2016 +0200

    Functions in the translation layers should static inline. Probably not always fair...
    
    Signed-off-by: Mattias Andrée <maandree_AT_kth.se>

diff --git a/bench/libgmp.h b/bench/libgmp.h
index b16edec..14ccca4 100644
--- a/bench/libgmp.h
+++ b/bench/libgmp.h
_AT_@ -14,7 +14,7 @@ static z_t _0, _1, _a, _b;
 static FILE *_fbuf;
 static gmp_randstate_t _randstate;
 
-static void
+static inline void
 zsetup(jmp_buf env)
 {
         static char buf[1000];
_AT_@ -27,7 +27,7 @@ zsetup(jmp_buf env)
         gmp_randinit_mt(_randstate);
 }
 
-static void
+static inline void
 zunsetup(void)
 {
         mpz_clear(_0);
_AT_@ -97,7 +97,7 @@ zunsetup(void)
 #define zmod mpz_tdiv_r
 #define zdivmod mpz_tdiv_qr
 
-static void
+static inline void
 zsetu(z_t r, unsigned long long int val)
 {
         uint32_t high = (uint32_t)(val >> 32);
_AT_@ -114,7 +114,7 @@ zsetu(z_t r, unsigned long long int val)
         
 }
 
-static void
+static inline void
 zseti(z_t r, long long int val)
 {
         if (val >= 0) {
_AT_@ -125,7 +125,7 @@ zseti(z_t r, long long int val)
         }
 }
 
-static void
+static inline void
 znot(z_t r, z_t a)
 {
         size_t bits = zbits(a);
_AT_@ -136,7 +136,7 @@ znot(z_t r, z_t a)
         zneg(r, r);
 }
 
-static void
+static inline void
 zsplit(z_t high, z_t low, z_t a, size_t brk)
 {
         if (low == a) {
_AT_@ -148,7 +148,7 @@ zsplit(z_t high, z_t low, z_t a, size_t brk)
         }
 }
 
-static void
+static inline void
 zbset(z_t r, z_t a, size_t bit, int mode)
 {
         if (r != a)
_AT_@ -161,7 +161,7 @@ zbset(z_t r, z_t a, size_t bit, int mode)
                 mpz_combit(r, bit);
 }
 
-static size_t
+static inline size_t
 zsave(z_t a, void *buffer)
 {
         size_t n = mpz_out_raw(_fbuf, a);
_AT_@ -170,7 +170,7 @@ zsave(z_t a, void *buffer)
         return n;
 }
 
-static size_t
+static inline size_t
 zload(z_t a, const void *buffer)
 {
         size_t n = mpz_inp_raw(a, _fbuf);
_AT_@ -179,7 +179,7 @@ zload(z_t a, const void *buffer)
         return n;
 }
 
-static void
+static inline void
 zrand(z_t r, int dev, int dist, z_t n)
 {
         size_t bits;
diff --git a/bench/libhebimath.h b/bench/libhebimath.h
index 7ddd6d6..f71b7e3 100644
--- a/bench/libhebimath.h
+++ b/bench/libhebimath.h
_AT_@ -12,7 +12,7 @@ typedef hebi_int z_t[1];
 
 static z_t _0, _1, _a, _b, _m;
 
-static void
+static inline void
 zsetup(jmp_buf env)
 {
         (void) env;
_AT_@ -23,7 +23,7 @@ zsetup(jmp_buf env)
         hebi_init(_m);
 }
 
-static void
+static inline void
 zunsetup(void)
 {
         hebi_destroy(_0);
_AT_@ -86,7 +86,7 @@ zunsetup(void)
 #define zsave(a, s) zstr(a, s, sizeof(s) - 1)
 #define zload(a, s) zsets(a, s)
 
-static size_t
+static inline size_t
 zbits(z_t a)
 {
         hebi_uword x = x;
_AT_@ -106,7 +106,7 @@ zbits(z_t a)
         return rc;
 }
 
-static size_t
+static inline size_t
 zlsb(z_t a)
 {
         hebi_uword x;
_AT_@ -125,7 +125,7 @@ zlsb(z_t a)
         return rc;
 }
 
-static void
+static inline void
 zptest(z_t w, z_t a, int t)
 {
         static int gave_up = 0;
_AT_@ -138,7 +138,7 @@ zptest(z_t w, z_t a, int t)
         (void) t;
 }
 
-static void
+static inline void
 zpowu(z_t r, z_t a, unsigned long long int b)
 {
         int neg = zsignum(a) < 0;
_AT_@ -153,7 +153,7 @@ zpowu(z_t r, z_t a, unsigned long long int b)
                 zneg(r, r);
 }
 
-static void
+static inline void
 zmodpowu(z_t r, z_t a, unsigned long long int b, z_t m)
 {
         int neg = zsignum(a) < 0;
_AT_@ -169,7 +169,7 @@ zmodpowu(z_t r, z_t a, unsigned long long int b, z_t m)
                 zneg(r, r);
 }
 
-static size_t
+static inline size_t
 zstr_length(z_t a, unsigned long long int radix)
 {
         size_t size_total = 1, size_temp;
_AT_@ -190,7 +190,7 @@ zstr_length(z_t a, unsigned long long int radix)
         return size_total + (zsignum(a) < 0);
 }
 
-static void
+static inline void
 zsplit(z_t high, z_t low, z_t a, size_t brk)
 {
         if (low == a) {
_AT_@ -202,7 +202,7 @@ zsplit(z_t high, z_t low, z_t a, size_t brk)
         }
 }
 
-static void
+static inline void
 zbset(z_t r, z_t a, size_t bit, int mode)
 {
         zrsh(_a, a, bit);
_AT_@ -217,7 +217,7 @@ zbset(z_t r, z_t a, size_t bit, int mode)
         }
 }
 
-static void
+static inline void
 zrand(z_t r, int dev, int dist, z_t n)
 {
         static int gave_up[] = {0, 0, 0};
_AT_@ -230,7 +230,7 @@ zrand(z_t r, int dev, int dist, z_t n)
         (void) n;
 }
 
-static void
+static inline void
 zand(z_t r, z_t a, z_t b)
 {
         int neg = hebi_sign(a) < 0 && hebi_sign(b) < 0;
_AT_@ -251,7 +251,7 @@ zand(z_t r, z_t a, z_t b)
                 zneg(r, r);
 }
 
-static void
+static inline void
 zor(z_t r, z_t a, z_t b)
 {
         int neg = hebi_sign(a) < 0 || hebi_sign(b) < 0;
_AT_@ -272,7 +272,7 @@ zor(z_t r, z_t a, z_t b)
                 zneg(r, r);
 }
 
-static void
+static inline void
 zxor(z_t r, z_t a, z_t b)
 {
         int neg = (hebi_sign(a) < 0) ^ (hebi_sign(b) < 0);
_AT_@ -293,7 +293,7 @@ zxor(z_t r, z_t a, z_t b)
                 zneg(r, r);
 }
 
-void
+static inline void
 zgcd(z_t r, z_t a, z_t b)
 {
         size_t shifts, a_lsb, b_lsb;
_AT_@ -333,7 +333,7 @@ zgcd(z_t r, z_t a, z_t b)
                 zneg(r, r);
 }
 
-static void
+static inline void
 znot(z_t r, z_t a)
 {
         size_t bits = zbits(a);
_AT_@ -346,7 +346,9 @@ znot(z_t r, z_t a)
         zneg(r, r);
 }
 
-int
+/* Prototype declared, but implementation missing, in hebimath */
+
+staint
 hebi_shl(hebi_int *r, const hebi_int *a, unsigned int b)
 {
         zsetu(_a, 2);
diff --git a/bench/libtfm.h b/bench/libtfm.h
index 0feff35..c4cc02b 100644
--- a/bench/libtfm.h
+++ b/bench/libtfm.h
_AT_@ -12,7 +12,7 @@ typedef fp_int z_t[1];
 static z_t _0, _1, _a, _b;
 static int _tmp;
 
-static void
+static inline void
 fp_set_int(z_t a, uint32_t d)
 {
         a->dp[0] = d;
_AT_@ -20,7 +20,7 @@ fp_set_int(z_t a, uint32_t d)
         a->sign = 0;
 }
 
-static void
+static inline void
 zsetup(jmp_buf env)
 {
         (void) env;
_AT_@ -32,7 +32,7 @@ zsetup(jmp_buf env)
         fp_set_int(_1, 1);
 }
 
-static void
+static inline void
 zunsetup(void)
 {
         /* Do nothing */
_AT_@ -102,7 +102,7 @@ zabs(z_t r, z_t a)
         fp_abs(a, r);
 }
 
-static void
+static inline void
 zswap(z_t a, z_t b)
 {
         z_t t;
_AT_@ -111,7 +111,7 @@ zswap(z_t a, z_t b)
         fp_copy(t, b);
 }
 
-static void
+static inline void
 zand(z_t r, z_t a, z_t b)
 {
         int i;
_AT_@ -123,7 +123,7 @@ zand(z_t r, z_t a, z_t b)
         r->sign = a->sign & b->sign;
 }
 
-static void
+static inline void
 zor(z_t r, z_t a, z_t b)
 {
         int i;
_AT_@ -137,7 +137,7 @@ zor(z_t r, z_t a, z_t b)
         r->sign = a->sign | b->sign;
 }
 
-static void
+static inline void
 zxor(z_t r, z_t a, z_t b)
 {
         int i;
_AT_@ -153,14 +153,14 @@ zxor(z_t r, z_t a, z_t b)
         r->sign = a->sign ^ b->sign;
 }
 
-static int
+static inline int
 zsave(z_t a, char *buf)
 {
         _tmp = buf ? fp_signed_bin_size(a) : (fp_to_signed_bin(a, (unsigned char *)buf), 0);
         return _tmp;
 }
 
-static void
+static inline void
 zsetu(z_t r, unsigned long long int val)
 {
         uint32_t high = (uint32_t)(val >> 32);
_AT_@ -177,7 +177,7 @@ zsetu(z_t r, unsigned long long int val)
         
 }
 
-static void
+static inline void
 zseti(z_t r, long long int val)
 {
         if (val >= 0) {
_AT_@ -188,7 +188,7 @@ zseti(z_t r, long long int val)
         }
 }
 
-static void
+static inline void
 zsplit(z_t high, z_t low, z_t a, size_t brk)
 {
         if (low == a) {
_AT_@ -200,7 +200,7 @@ zsplit(z_t high, z_t low, z_t a, size_t brk)
         }
 }
 
-static void
+static inline void
 znot(z_t r, z_t a)
 {
         fp_2expt(_a, (int)zbits(a));
_AT_@ -209,7 +209,7 @@ znot(z_t r, z_t a)
         zneg(r, r);
 }
 
-static int
+static inline int
 zbtest(z_t a, size_t bit)
 {
         fp_2expt(_b, (int)bit);
_AT_@ -217,7 +217,7 @@ zbtest(z_t a, size_t bit)
         return !zzero(_b);
 }
 
-static void
+static inline void
 zbset(z_t r, z_t a, size_t bit, int mode)
 {
         if (mode > 0) {
_AT_@ -229,7 +229,7 @@ zbset(z_t r, z_t a, size_t bit, int mode)
         }
 }
 
-static void
+static inline void
 zrand(z_t r, int dev, int dist, z_t n)
 {
         static int gave_up = 0;
_AT_@ -272,7 +272,7 @@ zrand(z_t r, int dev, int dist, z_t n)
         }
 }
 
-static void
+static inline void
 zpowu(z_t r, z_t a, unsigned long long int b)
 {
         int neg = zsignum(a) < 0;
diff --git a/bench/libtommath.h b/bench/libtommath.h
index af38977..08c7c18 100644
--- a/bench/libtommath.h
+++ b/bench/libtommath.h
_AT_@ -30,7 +30,7 @@ static jmp_buf jbuf;
 # define try(expr) do if ((error = (expr))) longjmp(jbuf, 1); while (0)
 #endif
 
-static void
+static inline void
 zsetup(jmp_buf env)
 {
         *jbuf = *env;
_AT_@ -40,7 +40,7 @@ zsetup(jmp_buf env)
         try(mp_init(_b));
 }
 
-static void
+static inline void
 zunsetup(void)
 {
         mp_clear(_0);
_AT_@ -176,7 +176,7 @@ zxor(z_t r, z_t a, z_t b)
         try(mp_xor(a, b, r));
 }
 
-static void
+static inline void
 znot(z_t r, z_t a)
 {
         try(mp_2expt(_a, (int)zbits(a)));
_AT_@ -185,7 +185,7 @@ znot(z_t r, z_t a)
         zneg(r, r);
 }
 
-static int
+static inline int
 zbtest(z_t a, size_t bit)
 {
         try(mp_2expt(_b, (int)bit));
_AT_@ -193,7 +193,7 @@ zbtest(z_t a, size_t bit)
         return !zzero(_b);
 }
 
-static void
+static inline void
 zbset(z_t r, z_t a, size_t bit, int mode)
 {
         if (mode > 0) {
_AT_@ -229,7 +229,7 @@ ztrunc(z_t r, z_t a, size_t b)
         try(mp_mod_2d(a, (int)b, r));
 }
 
-static void
+static inline void
 zsplit(z_t high, z_t low, z_t a, size_t brk)
 {
         if (low == a) {
_AT_@ -241,13 +241,13 @@ zsplit(z_t high, z_t low, z_t a, size_t brk)
         }
 }
 
-static void
+static inline void
 zsetu(z_t r, unsigned long long int val)
 {
         try(mp_set_long_long(r, val));
 }
 
-static void
+static inline void
 zseti(z_t r, long long int val)
 {
         if (val >= 0) {
_AT_@ -405,7 +405,7 @@ zdivmod(z_t q, z_t r, z_t a, z_t b)
         try(mp_div(a, b, q, r));
 }
 
-static void
+static inline void
 zrand(z_t r, int dev, int dist, z_t n)
 {
         static int gave_up = 0;
Received on Wed Apr 27 2016 - 02:28:55 CEST

This archive was generated by hypermail 2.3.0 : Wed Apr 27 2016 - 02:36:15 CEST