Module Name:    src
Committed By:   joerg
Date:           Mon Aug 17 14:15:07 UTC 2009

Modified Files:
        src/usr.bin/nbperf: nbperf-bdz.c

Log Message:
GCC doesn't trace switch (foo & 7) completely, so add a default: abort()
to avoid warnings about unused variables.
Consistently use \t for the output function.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/nbperf/nbperf-bdz.c

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

Modified files:

Index: src/usr.bin/nbperf/nbperf-bdz.c
diff -u src/usr.bin/nbperf/nbperf-bdz.c:1.1 src/usr.bin/nbperf/nbperf-bdz.c:1.2
--- src/usr.bin/nbperf/nbperf-bdz.c:1.1	Sat Aug 15 16:21:05 2009
+++ src/usr.bin/nbperf/nbperf-bdz.c	Mon Aug 17 14:15:07 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: nbperf-bdz.c,v 1.1 2009/08/15 16:21:05 joerg Exp $	*/
+/*	$NetBSD: nbperf-bdz.c,v 1.2 2009/08/17 14:15:07 joerg Exp $	*/
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: nbperf-bdz.c,v 1.1 2009/08/15 16:21:05 joerg Exp $");
+__RCSID("$NetBSD: nbperf-bdz.c,v 1.2 2009/08/17 14:15:07 joerg Exp $");
 
 #include <err.h>
 #include <inttypes.h>
@@ -259,42 +259,44 @@
 	fprintf(nbperf->output,
 	    "\tswitch ((idx >> 5) & 7) {\n"
 	    "\tcase 0:\n"
-	    "\t	idx2 = idx - holes64k[idx >> 16] - holes256[idx >> 8];\n"
-	    "\t	break;\n"
+	    "\t\tidx2 = idx - holes64k[idx >> 16] - holes256[idx >> 8];\n"
+	    "\t\tbreak;\n"
 	    "\tcase 1: case 2:\n"
-	    "\t	idx2 = idx - holes64k[idx >> 16] - holes256[idx >> 8]\n"
-	    "\t	    - holes256_64[idx >> 8];\n"
-	    "\t	break;\n"
+	    "\t\tidx2 = idx - holes64k[idx >> 16] - holes256[idx >> 8]\n"
+	    "\t\t    - holes256_64[idx >> 8];\n"
+	    "\t\tbreak;\n"
 	    "\tcase 3: case 4:\n"
-	    "\t	idx2 = idx - holes64k[idx >> 16] - holes256[idx >> 8]\n"
-	    "\t	    - holes256_128[idx >> 8];\n"
-	    "\t	break;\n"
+	    "\t\tidx2 = idx - holes64k[idx >> 16] - holes256[idx >> 8]\n"
+	    "\t\t    - holes256_128[idx >> 8];\n"
+	    "\t\tbreak;\n"
 	    "\tcase 5: case 6:\n"
-	    "\t	idx2 = idx - holes64k[idx >> 16] - holes256[idx >> 8]\n"
-	    "\t	    - holes256_192[idx >> 8];\n"
-	    "\t	break;\n"
+	    "\t\tidx2 = idx - holes64k[idx >> 16] - holes256[idx >> 8]\n"
+	    "\t\t    - holes256_192[idx >> 8];\n"
+	    "\t\tbreak;\n"
 	    "\tcase 7:\n"
-	    "\t	idx2 = idx - holes64k[(idx + 32) >> 16] -\n"
-	    "\t	    holes256[(idx + 32) >> 8];\n"
-	    "\t	break;\n"
+	    "\t\tidx2 = idx - holes64k[(idx + 32) >> 16] -\n"
+	    "\t\t    holes256[(idx + 32) >> 8];\n"
+	    "\t\tbreak;\n"
+	    "\tdefault:\n"
+	    "\t\tabort();\n"
 	    "\t}\n"
 	    "\tswitch ((idx >> 4) & 3) {\n"
 	    "\tcase 1:\n"
-	    "\t	m = (g[(idx >> 4) - 1] & (g[(idx >> 4) - 1] >> 1) & 0x55555555U);\n"
-	    "\t	idx2 -= popcount32(m);\n"
+	    "\t\tm = (g[(idx >> 4) - 1] & (g[(idx >> 4) - 1] >> 1) & 0x55555555U);\n"
+	    "\t\tidx2 -= popcount32(m);\n"
 	    "\tcase 0:\n"
-	    "\t	m = (g[idx >> 4] & (g[idx >> 4] >> 1) & 0x55555555U);\n"
-	    "\t	m &= ((2U << (2 * (idx & 15))) - 1);\n"
-	    "\t	idx2 -= popcount32(m);\n"
-	    "\t	break;\n"
+	    "\t\tm = (g[idx >> 4] & (g[idx >> 4] >> 1) & 0x55555555U);\n"
+	    "\t\tm &= ((2U << (2 * (idx & 15))) - 1);\n"
+	    "\t\tidx2 -= popcount32(m);\n"
+	    "\t\tbreak;\n"
 	    "\tcase 2:\n"
-	    "\t	m = (g[(idx >> 4) + 1] & (g[(idx >> 4) + 1] >> 1) & 0x55555555U);\n"
-	    "\t	idx2 += popcount32(m);\n"
+	    "\t\tm = (g[(idx >> 4) + 1] & (g[(idx >> 4) + 1] >> 1) & 0x55555555U);\n"
+	    "\t\tidx2 += popcount32(m);\n"
 	    "\tcase 3:\n"
-	    "\t	m = (g[idx >> 4] & (g[idx >> 4] >> 1) & 0x55555555U);\n"
-	    "\t	m &= ~((2U << (2 * (idx & 15))) - 1);\n"
-	    "\t	idx2 += popcount32(m);\n"
-	    "\t	break;\n"
+	    "\t\tm = (g[idx >> 4] & (g[idx >> 4] >> 1) & 0x55555555U);\n"
+	    "\t\tm &= ~((2U << (2 * (idx & 15))) - 1);\n"
+	    "\t\tidx2 += popcount32(m);\n"
+	    "\t\tbreak;\n"
 	    "\t}\n\n");
 
 	fprintf(nbperf->output,

Reply via email to