Commit b9dee9f6 authored by Aaron Dierking's avatar Aaron Dierking Committed by Guillem Jover

Use CHAR_BIT instead of NBBY in strnvis()

<sys/param.h> is not available on Windows.
Signed-off-by: Guillem Jover's avatarGuillem Jover <guillem@hadrons.org>
parent 81c3c3e4
...@@ -57,7 +57,6 @@ ...@@ -57,7 +57,6 @@
#include <sys/cdefs.h> #include <sys/cdefs.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/param.h>
#include <assert.h> #include <assert.h>
#pragma GCC diagnostic push #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) ...@@ -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. */ /* See comment in istrsenvisx() output loop, below. */
wmsk = 0; wmsk = 0;
for (i = sizeof(wmsk) - 1; i >= 0; i--) { for (i = sizeof(wmsk) - 1; i >= 0; i--) {
shft = i * NBBY; shft = i * CHAR_BIT;
bmsk = (uint64_t)0xffLL << shft; bmsk = (uint64_t)0xffLL << shft;
wmsk |= bmsk; wmsk |= bmsk;
if ((c & wmsk) || i == 0) if ((c & wmsk) || i == 0)
...@@ -539,7 +538,7 @@ istrsenvisx(char **mbdstp, size_t *dlen, const char *mbsrc, size_t mblength, ...@@ -539,7 +538,7 @@ istrsenvisx(char **mbdstp, size_t *dlen, const char *mbsrc, size_t mblength,
clen = 0; clen = 0;
wmsk = 0; wmsk = 0;
for (i = sizeof(wmsk) - 1; i >= 0; i--) { for (i = sizeof(wmsk) - 1; i >= 0; i--) {
shft = i * NBBY; shft = i * CHAR_BIT;
bmsk = (uint64_t)0xffLL << shft; bmsk = (uint64_t)0xffLL << shft;
wmsk |= bmsk; wmsk |= bmsk;
if ((*dst & wmsk) || i == 0) if ((*dst & wmsk) || i == 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment