From owner-p4-projects@FreeBSD.ORG Fri Jun 13 11:24:41 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 159461065671; Fri, 13 Jun 2008 11:24:41 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBD051065670 for ; Fri, 13 Jun 2008 11:24:40 +0000 (UTC) (envelope-from konrad@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id B0F3B8FC19 for ; Fri, 13 Jun 2008 11:24:40 +0000 (UTC) (envelope-from konrad@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m5DBOev7038184 for ; Fri, 13 Jun 2008 11:24:40 GMT (envelope-from konrad@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m5DBOeOY038182 for perforce@freebsd.org; Fri, 13 Jun 2008 11:24:40 GMT (envelope-from konrad@FreeBSD.org) Date: Fri, 13 Jun 2008 11:24:40 GMT Message-Id: <200806131124.m5DBOeOY038182@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to konrad@FreeBSD.org using -f From: Konrad Jankowski To: Perforce Change Reviews Cc: Subject: PERFORCE change 143415 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jun 2008 11:24:41 -0000 http://perforce.freebsd.org/chv.cgi?CH=143415 Change 143415 by konrad@vspredator on 2008/06/13 11:24:32 Batch generation script. Quieten the output of posix.sh a little. Add a 'verbose flag to colldef.c. Affected files ... .. //depot/projects/soc2008/konrad_collation/colldef/colldef.c#2 edit .. //depot/projects/soc2008/konrad_collation/scripts/generate.sh#1 add .. //depot/projects/soc2008/konrad_collation/scripts/posix.sh#3 edit Differences ... ==== //depot/projects/soc2008/konrad_collation/colldef/colldef.c#2 (text+ko) ==== @@ -66,6 +66,8 @@ char used; } weights_uncompressed[WEIGHT_TABLE_SIZE]; +int verbose = 0; + void usage(char *name); void assign_weights(int codepoint, char *weights); @@ -293,6 +295,10 @@ printf("\n"); } +/* + * Find sparse places between neighbouring weights + * and eliminate them. + */ void compress_weights(void) { @@ -315,24 +321,16 @@ printf("min = %d min2 = %d\n", min, min2); #endif - reduce(min2, min + 1); + reduce(min2, start); } -} - -void -compress_weights2(void) -{ - int i; - - for (i = 0; i < WEIGHT_TABLE_SIZE; i++) { - - } + if (verbose) + printf("maximal weight: %d\n", start - 1); } void binary_output(char *out_file) { - int i; + int i, j; int out; /* @@ -341,12 +339,9 @@ */ if ((out = open(out_file, O_WRONLY | O_CREAT | O_TRUNC, 0644)) == -1) err(1, "open(%s)", out_file); - for (i = 0; i < WEIGHT_TABLE_SIZE; i++) { - weight_table[i][0] = weights_uncompressed[i].w[0]; - weight_table[i][1] = weights_uncompressed[i].w[1]; - weight_table[i][2] = weights_uncompressed[i].w[2]; - weight_table[i][3] = weights_uncompressed[i].w[3]; - } + for (i = 0; i < WEIGHT_TABLE_SIZE; i++) + for (j = 0; j < NWEIGHTS; j++) + weight_table[i][j] = weights_uncompressed[i].w[j]; if (write(out, weight_table, sizeof(weight_table)) != sizeof(weight_table)) errx(1, "not full write"); @@ -365,7 +360,7 @@ char *in_file = DEFAULT_IN_FILE; char *out_file = DEFAULT_OUT_FILE; - while ((ch = getopt(argc, argv, "hf:o:")) != -1) { + while ((ch = getopt(argc, argv, "hf:o:v")) != -1) { switch (ch) { case 'f': in_file = optarg; @@ -373,6 +368,9 @@ case 'o': out_file = optarg; break; + case 'v': + verbose = 1; + break; default: usage(argv[0]); } ==== //depot/projects/soc2008/konrad_collation/scripts/posix.sh#3 (text+ko) ==== @@ -31,8 +31,9 @@ # This one is a cpu-killer - # sed needs to process more substitutions, than the input file length. -echo "running sed" -time sed -f sed_cmd -i '' $OUTFILE +#echo "running sed" +#time \ + sed -f sed_cmd -i '' $OUTFILE # We now get rid of the more advanced lines - those that specify # expansions. # Deleting them will be disabled once support in the colldef.c comes up.