summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2008-09-01 09:27:04 +0200
committerSimon Josefsson <simon@josefsson.org>2008-09-01 09:27:04 +0200
commit69009347e0a41249758f65c498c16cf5a2564d8f (patch)
treea9103b599b8c16fde59a32b6f069cba39bc62180
parent05f7bb5e714f8d3a535d36cc31ed8ce13b79b835 (diff)
downloadgnulib-69009347e0a41249758f65c498c16cf5a2564d8f.tar.gz
Fix bitrotate module.
-rw-r--r--ChangeLog10
-rw-r--r--lib/bitrotate.h4
-rw-r--r--modules/bitrotate3
3 files changed, 14 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index c4682c9203..d085060b00 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2008-09-01 Simon Josefsson <simon@josefsson.org>
+
+ * modules/bitrotate (configure.ac): Need
+ AC_REQUIRE([AC_C_INLINE]).
+ (Description): Mention stdint.h. Reported by Bruno Haible
+ <bruno@clisp.org>.
+
+ * lib/bitrotate.h (rotr16, rotl16): Fix mask value. Reported by
+ Paolo Bonzini <bonzini@gnu.org>.
+
2008-08-31 Bruno Haible <bruno@clisp.org>
Assume Solaris specific bi-arch conventions on Solaris systems.
diff --git a/lib/bitrotate.h b/lib/bitrotate.h
index f3b6a66477..8123a5c7f4 100644
--- a/lib/bitrotate.h
+++ b/lib/bitrotate.h
@@ -45,7 +45,7 @@ rotr32 (uint32_t x, int n)
static inline uint16_t
rotl16 (uint16_t x, int n)
{
- return ((x << n) | (x >> (16 - n))) & 0xFFFFFFFF;
+ return ((x << n) | (x >> (16 - n))) & 0xFFFF;
}
/* Given an unsigned 16-bit argument X, return the value corresponding
@@ -54,7 +54,7 @@ rotl16 (uint16_t x, int n)
static inline uint16_t
rotr16 (uint16_t x, int n)
{
- return ((x >> n) | (x << (16 - n))) & 0xFFFFFFFF;
+ return ((x >> n) | (x << (16 - n))) & 0xFFFF;
}
#endif /* _GL_BITROTATE_H */
diff --git a/modules/bitrotate b/modules/bitrotate
index df94a61c20..064519c030 100644
--- a/modules/bitrotate
+++ b/modules/bitrotate
@@ -1,5 +1,5 @@
Description:
-Rotate bits in 16 and 32 bit integers.
+Rotate bits in 16 and 32 bit integers using stdint.h.
Files:
lib/bitrotate.h
@@ -7,6 +7,7 @@ lib/bitrotate.h
Depends-on:
configure.ac:
+AC_REQUIRE([AC_C_INLINE])
Makefile.am:
lib_SOURCES += bitrotate.h