summaryrefslogtreecommitdiff
path: root/common/lib/libc/string/popcount64.c
diff options
context:
space:
mode:
authorjoerg <joerg@NetBSD.org>2009-07-21 16:10:48 +0000
committerjoerg <joerg@NetBSD.org>2009-07-21 16:10:48 +0000
commit9a4b5deb763e8f00c8a4abcb3bb0bbfc7e445649 (patch)
tree17225be8377112e72b038b8bd21a246618d2a0bb /common/lib/libc/string/popcount64.c
parent57ba504b86b9b107786c88c0279931bbb6f6fed1 (diff)
Add explicit casts to make lint happy.
Diffstat (limited to 'common/lib/libc/string/popcount64.c')
-rw-r--r--common/lib/libc/string/popcount64.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/common/lib/libc/string/popcount64.c b/common/lib/libc/string/popcount64.c
index ffc0e37982f..6971c05826f 100644
--- a/common/lib/libc/string/popcount64.c
+++ b/common/lib/libc/string/popcount64.c
@@ -1,4 +1,4 @@
-/* $NetBSD: popcount64.c,v 1.1 2009/07/21 14:55:32 joerg Exp $ */
+/* $NetBSD: popcount64.c,v 1.2 2009/07/21 16:10:48 joerg Exp $ */
/*-
* Copyright (c) 2009 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: popcount64.c,v 1.1 2009/07/21 14:55:32 joerg Exp $");
+__RCSID("$NetBSD: popcount64.c,v 1.2 2009/07/21 16:10:48 joerg Exp $");
#if !defined(_KERNEL) && !defined(_STANDALONE)
#include <limits.h>
@@ -54,7 +54,8 @@ __RCSID("$NetBSD: popcount64.c,v 1.1 2009/07/21 14:55:32 joerg Exp $");
unsigned int
popcount64(uint64_t v)
{
- return popcount32(v >> 32) + popcount32(v & 0xffffffffU);
+ return popcount32((uint32_t)(v >> 32)) +
+ popcount32((uint32_t)(v & 0xffffffffU));
}
#else
unsigned int