summaryrefslogtreecommitdiff
path: root/lib/libc/string
diff options
context:
space:
mode:
authortron <tron@NetBSD.org>2011-11-25 09:00:51 +0000
committertron <tron@NetBSD.org>2011-11-25 09:00:51 +0000
commit6648d2a97d60e5bc4ef2fe3b0fd58bfb364dfde9 (patch)
treeceb95a301428e591d58853bca53e7fa0ec9d2fe0 /lib/libc/string
parentcffbac4c966d2961f2e8a7b81d87d8714bfd26c8 (diff)
Add explicit casts to make lint happy and fix the NetBSD/i386 build.
Diffstat (limited to 'lib/libc/string')
-rw-r--r--lib/libc/string/wcscspn_bloom.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/libc/string/wcscspn_bloom.h b/lib/libc/string/wcscspn_bloom.h
index 897b1ff4664..afbd2f37888 100644
--- a/lib/libc/string/wcscspn_bloom.h
+++ b/lib/libc/string/wcscspn_bloom.h
@@ -1,4 +1,4 @@
-/* $NetBSD: wcscspn_bloom.h,v 1.1 2011/11/24 18:44:25 joerg Exp $ */
+/* $NetBSD: wcscspn_bloom.h,v 1.2 2011/11/25 09:00:51 tron Exp $ */
/*-
* Copyright (c) 2011 Joerg Sonnenberger,
@@ -50,8 +50,8 @@ wcscspn_bloom1(size_t x)
static inline size_t
wcscspn_bloom2(size_t x)
{
- return (uint32_t)(x * 2654435761U) /
- (0x100000000ULL / (BLOOM_MASK + 1));
+ return (size_t)((uint32_t)(x * 2654435761U) /
+ (0x100000000ULL / (BLOOM_MASK + 1)));
}
static inline void
@@ -62,9 +62,9 @@ wcsspn_bloom_init(size_t *bloom, const wchar_t *charset)
memset(bloom, 0, BLOOM_SIZE);
do {
val = wcscspn_bloom1((size_t)*charset);
- bloom[val / BLOOM_DIV] |= 1ULL << (val % BLOOM_DIV);
+ bloom[val / BLOOM_DIV] |= (size_t)(1ULL << (val % BLOOM_DIV));
val = wcscspn_bloom2((size_t)*charset);
- bloom[val / BLOOM_DIV] |= 1ULL << (val % BLOOM_DIV);
+ bloom[val / BLOOM_DIV] |= (size_t)(1ULL << (val % BLOOM_DIV));
}
while (*++charset);
}