summaryrefslogtreecommitdiff
path: root/include/bitstring.h
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2015-11-20 20:27:20 +0000
committerchristos <christos@NetBSD.org>2015-11-20 20:27:20 +0000
commit2f06744537d5a23b6f1f934d83e490be8cf8f248 (patch)
treef4b47472871921a9dff110b18c1f60738558426e /include/bitstring.h
parentad73b9993df5e065461e66ec410d7c441075e293 (diff)
keep value as an int.
Diffstat (limited to 'include/bitstring.h')
-rw-r--r--include/bitstring.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/bitstring.h b/include/bitstring.h
index e93e464ce26..332bea3c1ca 100644
--- a/include/bitstring.h
+++ b/include/bitstring.h
@@ -1,4 +1,4 @@
-/* $NetBSD: bitstring.h,v 1.10 2015/11/20 20:24:49 christos Exp $ */
+/* $NetBSD: bitstring.h,v 1.11 2015/11/20 20:27:20 christos Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -110,7 +110,8 @@ typedef unsigned char bitstr_t;
/* find first bit clear in name */
#define bit_ffc(name, nbits, value) do { \
bitstr_t *_name = name; \
- size_t _bit, _nbits = nbits, _value = -1; \
+ size_t _bit, _nbits = nbits; \
+ int _value = -1; \
for (_bit = 0; _bit < _nbits; ++_bit) \
if (!bit_test(_name, _bit)) { \
_value = _bit; \
@@ -122,7 +123,8 @@ typedef unsigned char bitstr_t;
/* find first bit set in name */
#define bit_ffs(name, nbits, value) do { \
bitstr_t *_name = name; \
- size_t _bit, _nbits = nbits, _value = -1; \
+ size_t _bit, _nbits = nbits; \
+ int _value = -1; \
for (_bit = 0; _bit < _nbits; ++_bit) \
if (bit_test(_name, _bit)) { \
_value = _bit; \