From owner-p4-projects@FreeBSD.ORG Mon Aug 18 19:03:12 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 44EB51065685; Mon, 18 Aug 2008 19:03:12 +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 083B71065672 for ; Mon, 18 Aug 2008 19:03:12 +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 C7B4C8FC1C for ; Mon, 18 Aug 2008 19:03:11 +0000 (UTC) (envelope-from konrad@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.2/8.14.2) with ESMTP id m7IJ3B1H011328 for ; Mon, 18 Aug 2008 19:03:11 GMT (envelope-from konrad@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.2/8.14.1/Submit) id m7IJ3BgD011326 for perforce@freebsd.org; Mon, 18 Aug 2008 19:03:11 GMT (envelope-from konrad@FreeBSD.org) Date: Mon, 18 Aug 2008 19:03:11 GMT Message-Id: <200808181903.m7IJ3BgD011326@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 147755 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: Mon, 18 Aug 2008 19:03:13 -0000 http://perforce.freebsd.org/chv.cgi?CH=147755 Change 147755 by konrad@vspredator on 2008/08/18 19:02:21 Fix errors in debug mode of colldef.apple. Affected files ... .. //depot/projects/soc2008/konrad_collation/colldef.apple/parse.y#7 edit Differences ... ==== //depot/projects/soc2008/konrad_collation/colldef.apple/parse.y#7 (text+ko) ==== @@ -395,11 +395,12 @@ if (fclose(fp) != 0) err(EX_IOERR, "IO error closing destination file %s", out_file); - #ifdef COLLATE_DEBUG + /* Do it first, before conversion to network byte order. */ if (debug) collate_print_tables(); #endif + exit(EX_OK); } ; @@ -509,6 +510,10 @@ order_line1 : | ELEM { struct symbol *s = getsymbol($1, EXISTS); + +#ifdef VSDEBUG + printf("\n%s(%d) ", showwcs(s->name, CHARMAP_SYMBOL_LEN), s->u.wc); +#endif if (s->val != PRI_UNDEFINED) yyerror("<%s> redefined", showwcs($1, CHARMAP_SYMBOL_LEN)); if (prev_line == LINE_ELLIPSIS) { @@ -789,10 +794,16 @@ ; expansion : weight_ex - | expansion weight_ex + | expansion weight_ex_null ; weight2 : weight - | EXPAND expansion EXPAND { weight_index++; } + | EXPAND expansion EXPAND { +#ifdef VSDEBUG + printf("[%d]=%d ", + weight_index, weight_table[weight_index]->val); +#endif + weight_index++; + } ; weights : | weight @@ -833,6 +844,17 @@ weight_table[weight_index] = s; } ; +weight_ex_null : ELEM { + struct symbol *s; + + if (weight_index >= directive_count) + yyerror("More weights than specified by order_start (%d >= %d, %s)", weight_index, + directive_count, showwcs($1, CHARMAP_SYMBOL_LEN)); + s = getsymbol($1, EXISTS); + if (order_pass && s->val == PRI_UNDEFINED) + printf("<%s> is undefined\n", showwcs($1, CHARMAP_SYMBOL_LEN)); +} +; order_end : ORDER_END '\n' ; charmap : DEFN CHAR { @@ -1419,7 +1441,7 @@ for (i = 0; i < UCHAR_MAX + 1; i++, p2++) { printf("\t%s :", show(i)); for(z = 0; z < info.directive_count; z++) - printf(" %d", p2->pri[z]); + printf(" %d", ntohl(p2->pri[z])); putchar('\n'); } } @@ -1427,9 +1449,9 @@ struct __collate_st_large_char_pri *p2 = __collate_large_char_pri_table; printf("Large priority table:\n"); for (i = info.large_pri_count; i-- > 0; p2++) { - printf("\t%s :", show(p2->val)); + printf("\t%s :", show(ntohl(p2->val))); for(z = 0; z < info.directive_count; z++) - printf(" %d", p2->pri.pri[z]); + printf(" %d", ntohl(p2->pri.pri[z])); putchar('\n'); } }