Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc/arch/powerpc64/gen Use __arraycount(), and cast to ...
details: https://anonhg.NetBSD.org/src/rev/56ad005c4d87
branches: trunk
changeset: 782865:56ad005c4d87
user: christos <christos%NetBSD.org@localhost>
date: Sat Nov 24 07:16:04 2012 +0000
description:
Use __arraycount(), and cast to u_int.
diffstat:
lib/libc/arch/powerpc64/gen/syncicache.c | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diffs (31 lines):
diff -r d184a7efd51c -r 56ad005c4d87 lib/libc/arch/powerpc64/gen/syncicache.c
--- a/lib/libc/arch/powerpc64/gen/syncicache.c Fri Nov 23 15:35:57 2012 +0000
+++ b/lib/libc/arch/powerpc64/gen/syncicache.c Sat Nov 24 07:16:04 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: syncicache.c,v 1.1 2006/07/01 16:37:20 ross Exp $ */
+/* $NetBSD: syncicache.c,v 1.2 2012/11/24 07:16:04 christos Exp $ */
/*
* Copyright (C) 1995-1997, 1999 Wolfgang Solfrank.
@@ -74,17 +74,16 @@
if (_cachelinesize)
return _cachelinesize;
- if (sysctl(cacheinfomib, sizeof(cacheinfomib) / sizeof(cacheinfomib[0]),
- &_cache_info, &clen, NULL, 0) == 0) {
+ if (sysctl(cacheinfomib, (u_int)__arraycount(cacheinfomib),
+ &_cache_info, &clen, NULL, 0) == 0) {
_cachelinesize = _cache_info.dcache_line_size;
return _cachelinesize;
}
/* Try older deprecated sysctl */
clen = sizeof(_cachelinesize);
- if (sysctl(cachemib, sizeof(cachemib) / sizeof(cachemib[0]),
- &_cachelinesize, &clen, NULL, 0) < 0
- || !_cachelinesize)
+ if (sysctl(cachemib, (u_int)__arraycount(cachemib),
+ &_cachelinesize, &clen, NULL, 0) < 0 || !_cachelinesize)
abort();
_cache_info.dcache_size = _cachelinesize;
Home |
Main Index |
Thread Index |
Old Index