(wrong string) ée

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

commit 3cbe3666b87d1c256eddf2d26f2238bfc000083f
Author: Mattias Andrée <maandree_AT_kth.se>
AuthorDate: Tue Mar 1 19:33:46 2016 +0100
Commit: Mattias Andrée <maandree_AT_kth.se>
CommitDate: Tue Mar 1 19:33:46 2016 +0100

    zsetu: change macro from CHARS_PER_TYPE to SIZE_MULTIPLE
    
    Signed-off-by: Mattias Andrée <maandree_AT_kth.se>

diff --git a/src/zsetu.c b/src/zsetu.c
index 78b78bb..385403c 100644
--- a/src/zsetu.c
+++ b/src/zsetu.c
_AT_@ -1,7 +1,7 @@
 /* See LICENSE file for copyright and license details. */
 #include "internals"
 
-#define CHARS_PER_TYPE(t) (sizeof(t) / (BITS_PER_CHAR >> 3))
+#define SIZE_MULTIPLE(fit, in) ((sizeof(fit) + sizeof(in) - 1) / sizeof(in))
 
 
 void
_AT_@ -11,9 +11,9 @@ zsetu(z_t a, unsigned long long int b)
                 SET_SIGNUM(a, 0);
                 return;
         }
- if (a->alloced < CHARS_PER_TYPE(b)) {
- a->alloced = CHARS_PER_TYPE(b);
- a->chars = realloc(a->chars, CHARS_PER_TYPE(b) * sizeof(*(a->chars)))
+ if (a->alloced < SIZE_MULTIPLE(b, *(a->chars))) {
+ a->alloced = SIZE_MULTIPLE(b, *(a->chars));
+ a->chars = realloc(a->chars, SIZE_MULTIPLE(b, *(a->chars)) * sizeof(*(a->chars)))
         }
         SET_SIGNUM(a, 1);
         a->used = 0;
Received on Tue Mar 01 2016 - 19:33:58 CET

This archive was generated by hypermail 2.3.0 : Tue Mar 01 2016 - 19:36:13 CET