diff options
author | Aaron Dierking <aarond@fb.com> | 2018-06-14 11:38:31 -0700 |
---|---|---|
committer | Guillem Jover <guillem@hadrons.org> | 2018-06-18 04:31:00 +0200 |
commit | b9dee9f69a6e9f03418bde5638642ddc8df18f74 (patch) | |
tree | ec7d449463b1d37d444e41e2a7d15a1b557ca35f | |
parent | 81c3c3e4054f88049c4401b1d472188c75bdd5e4 (diff) |
Use CHAR_BIT instead of NBBY in strnvis()
<sys/param.h> is not available on Windows.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
-rw-r--r-- | src/vis.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -57,7 +57,6 @@ #include <sys/cdefs.h> #include <sys/types.h> -#include <sys/param.h> #include <assert.h> #pragma GCC diagnostic push @@ -308,7 +307,7 @@ do_svis(wchar_t *dst, wint_t c, int flags, wint_t nextc, const wchar_t *extra) /* See comment in istrsenvisx() output loop, below. */ wmsk = 0; for (i = sizeof(wmsk) - 1; i >= 0; i--) { - shft = i * NBBY; + shft = i * CHAR_BIT; bmsk = (uint64_t)0xffLL << shft; wmsk |= bmsk; if ((c & wmsk) || i == 0) @@ -539,7 +538,7 @@ istrsenvisx(char **mbdstp, size_t *dlen, const char *mbsrc, size_t mblength, clen = 0; wmsk = 0; for (i = sizeof(wmsk) - 1; i >= 0; i--) { - shft = i * NBBY; + shft = i * CHAR_BIT; bmsk = (uint64_t)0xffLL << shft; wmsk |= bmsk; if ((*dst & wmsk) || i == 0) |