* [PATCH] include/linux/bitops.h "integer" constants too large for u64
@ 2003-06-05 0:15 Mike Jones
0 siblings, 0 replies; only message in thread
From: Mike Jones @ 2003-06-05 0:15 UTC (permalink / raw)
To: linux-kernel
[-- Attachment #1.1: Type: text/plain, Size: 1405 bytes --]
Hi,
I'm using GCC 3.3 to compile 2.5.70-mm4, and am being bombarded by
warnings regarding the use of integer constants in
include/linux/bitops.h. The attached patch, which is trivial, should
fix the problem.
Please CC me on any replies, as I am not subscribed to the linux-kernel
mailing list.
Regards,
Mike Jones
An excerpt of the warnings displayed on almost every compiled file:
include/linux/bitops.h: In function `generic_hweight64':
include/linux/bitops.h:118: warning: integer constant is too large for
"unsigned long" type
include/linux/bitops.h:118: warning: integer constant is too large for
"unsigned long" type
include/linux/bitops.h:119: warning: integer constant is too large for
"unsigned long" type
include/linux/bitops.h:119: warning: integer constant is too large for
"unsigned long" type
include/linux/bitops.h:120: warning: integer constant is too large for
"unsigned long" type
include/linux/bitops.h:120: warning: integer constant is too large for
"unsigned long" type
include/linux/bitops.h:121: warning: integer constant is too large for
"unsigned long" type
include/linux/bitops.h:121: warning: integer constant is too large for
"unsigned long" type
include/linux/bitops.h:122: warning: integer constant is too large for
"unsigned long" type
include/linux/bitops.h:122: warning: integer constant is too large for
"unsigned long" type
[-- Attachment #1.2: Type: text/plain, Size: 1229 bytes --]
--- bitops.h 2003-06-04 20:06:07.000000000 -0400
+++ linux-2.5.70/include/linux/bitops.h 2003-06-04 20:03:56.000000000 -0400
@@ -115,12 +115,12 @@
return generic_hweight32((unsigned int)(w >> 32)) +
generic_hweight32((unsigned int)w);
- res = (w & 0x5555555555555555) + ((w >> 1) & 0x5555555555555555);
- res = (res & 0x3333333333333333) + ((res >> 2) & 0x3333333333333333);
- res = (res & 0x0F0F0F0F0F0F0F0F) + ((res >> 4) & 0x0F0F0F0F0F0F0F0F);
- res = (res & 0x00FF00FF00FF00FF) + ((res >> 8) & 0x00FF00FF00FF00FF);
- res = (res & 0x0000FFFF0000FFFF) + ((res >> 16) & 0x0000FFFF0000FFFF);
- return (res & 0x00000000FFFFFFFF) + ((res >> 32) & 0x00000000FFFFFFFF);
+ res = (w & 0x5555555555555555ULL) + ((w >> 1) & 0x5555555555555555ULL);
+ res = (res & 0x3333333333333333ULL) + ((res >> 2) & 0x3333333333333333ULL);
+ res = (res & 0x0F0F0F0F0F0F0F0FULL) + ((res >> 4) & 0x0F0F0F0F0F0F0F0FULL);
+ res = (res & 0x00FF00FF00FF00FFULL) + ((res >> 8) & 0x00FF00FF00FF00FFULL);
+ res = (res & 0x0000FFFF0000FFFFULL) + ((res >> 16) & 0x0000FFFF0000FFFFULL);
+ return (res & 0x00000000FFFFFFFFULL) + ((res >> 32) & 0x00000000FFFFFFFFULL);
}
static inline unsigned long hweight_long(unsigned long w)
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 155 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-06-05 0:02 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-05 0:15 [PATCH] include/linux/bitops.h "integer" constants too large for u64 Mike Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®