Module Name:    src
Committed By:   joerg
Date:           Fri Nov 25 17:48:23 UTC 2011

Modified Files:
        src/lib/libc/string: wcscspn_bloom.h

Log Message:
If we have to cast, do it properly.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/string/wcscspn_bloom.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/string/wcscspn_bloom.h
diff -u src/lib/libc/string/wcscspn_bloom.h:1.3 src/lib/libc/string/wcscspn_bloom.h:1.4
--- src/lib/libc/string/wcscspn_bloom.h:1.3	Fri Nov 25 16:46:56 2011
+++ src/lib/libc/string/wcscspn_bloom.h	Fri Nov 25 17:48:22 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: wcscspn_bloom.h,v 1.3 2011/11/25 16:46:56 dholland Exp $	*/
+/*	$NetBSD: wcscspn_bloom.h,v 1.4 2011/11/25 17:48:22 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2011 Joerg Sonnenberger,
@@ -64,9 +64,9 @@ wcsspn_bloom_init(size_t *bloom, const w
 	memset(bloom, 0, BLOOM_SIZE);
 	do {
 		val = wcscspn_bloom1((size_t)*charset);
-		bloom[val / BLOOM_DIV] |= (size_t)(1ULL << (val % BLOOM_DIV));
+		bloom[val / BLOOM_DIV] |= (size_t)1 << (val % BLOOM_DIV);
 		val = wcscspn_bloom2((size_t)*charset);
-		bloom[val / BLOOM_DIV] |= (size_t)(1ULL << (val % BLOOM_DIV));
+		bloom[val / BLOOM_DIV] |= (size_t)1 << (val % BLOOM_DIV);
 	}
 	while (*++charset);
 }
@@ -77,10 +77,10 @@ wcsspn_in_bloom(const size_t *bloom, wch
 	size_t val;
 
 	val = wcscspn_bloom1((size_t)ch);
-	if (bloom[val / BLOOM_DIV] & (1ULL << (val % BLOOM_DIV)))
+	if (bloom[val / BLOOM_DIV] & ((size_t)1 << (val % BLOOM_DIV)))
 		return 1;
 	val = wcscspn_bloom2((size_t)ch);
-	if (bloom[val / BLOOM_DIV] & (1ULL << (val % BLOOM_DIV)))
+	if (bloom[val / BLOOM_DIV] & ((size_t)1 << (val % BLOOM_DIV)))
 		return 1;
 	return 0;
 }

Reply via email to