From 81e49626c4a5b370ce0dec028eaa5b829c298290 Mon Sep 17 00:00:00 2001 From: joerg Date: Mon, 17 Aug 2009 14:15:07 +0000 Subject: [PATCH] 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. --- usr.bin/nbperf/nbperf-bdz.c | 58 +++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/usr.bin/nbperf/nbperf-bdz.c b/usr.bin/nbperf/nbperf-bdz.c index a8e8eb6cbb95..715d0dfc70d4 100644 --- a/usr.bin/nbperf/nbperf-bdz.c +++ b/usr.bin/nbperf/nbperf-bdz.c @@ -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 -__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 #include @@ -259,42 +259,44 @@ print_hash(struct nbperf *nbperf, struct state *state) 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,