(wrong string) ée

From: <git_AT_suckless.org>
Date: Tue, 1 Mar 2016 19:41:19 +0100 (CET)

commit 465749ec6de871ae244ebe6d3264c71eeb728fcc
Author: Mattias Andrée <maandree_AT_kth.se>
AuthorDate: Tue Mar 1 19:41:04 2016 +0100
Commit: Mattias Andrée <maandree_AT_kth.se>
CommitDate: Tue Mar 1 19:41:04 2016 +0100

    Add typedef zahl_char_t for internal use
    
    Signed-off-by: Mattias Andrée <maandree_AT_kth.se>

diff --git a/src/internals.h b/src/internals.h
index cc2d034..df973fb 100644
--- a/src/internals.h
+++ b/src/internals.h
_AT_@ -2,8 +2,10 @@
 #include "../zahl.h"
 
 #define BITS_PER_CHAR 32
-#define FLOOR_BITS_TO_CHARS(bits) ((bits) >> 5)
-#define CEILING_BITS_TO_CHARS(bits) (((bits) + (BITS_PER_CHAR - 1)) >> 5)
+#define LB_BITS_PER_CHAR 5
+
+#define FLOOR_BITS_TO_CHARS(bits) ((bits) >> LB_BITS_PER_CHAR)
+#define CEILING_BITS_TO_CHARS(bits) (((bits) + (BITS_PER_CHAR - 1)) >> LB_BITS_PER_CHAR)
 #define BITS_IN_LAST_CHAR(bits) ((bits) & (BITS_PER_CHAR - 1))
 
 #define LIST_TEMPS\
diff --git a/src/zbits.c b/src/zbits.c
index 014294e..8ada62f 100644
--- a/src/zbits.c
+++ b/src/zbits.c
_AT_@ -6,7 +6,7 @@ size_t
 zbits(z_t a)
 {
         size_t i;
- uint32_t x;
+ zahl_char_t x;
         if (zzero(a)) {
                 return 1;
         }
diff --git a/src/zlsb.c b/src/zlsb.c
index 2952a05..d63752e 100644
--- a/src/zlsb.c
+++ b/src/zlsb.c
_AT_@ -6,7 +6,7 @@ size_t
 zlsb(z_t a)
 {
         size_t i = 0;
- uint32_t x;
+ zahl_char_t x;
         if (zzero(a)) {
                 return SIZE_MAX;
         }
diff --git a/src/zsetu.c b/src/zsetu.c
index 385403c..dd1be17 100644
--- a/src/zsetu.c
+++ b/src/zsetu.c
_AT_@ -18,7 +18,7 @@ zsetu(z_t a, unsigned long long int b)
         SET_SIGNUM(a, 1);
         a->used = 0;
         while (b) {
- a->chars[a->used++] = (uint32_t)b;
+ a->chars[a->used++] = (zahl_char_t)b;
                 b >>= BITS_PER_CHAR;
         }
 }
diff --git a/zahl.h b/zahl.h
index e2634a8..c39510f 100644
--- a/zahl.h
+++ b/zahl.h
_AT_@ -9,12 +9,15 @@
 
 
 
+/* You should pretend like this typedef does not exist. */
+typedef uint32_t zahl_char_t;
+
 /* This structure should be considered opaque. */
 typedef struct {
         int sign;
         size_t used;
         size_t alloced;
- uint32_t *chars;
+ zahl_char_t *chars;
 } z_t[1];
 
 
Received on Tue Mar 01 2016 - 19:41:19 CET

This archive was generated by hypermail 2.3.0 : Tue Mar 01 2016 - 19:48:12 CET