This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: gen-table -vs- Unicode 3.1 (Was: Patch installed for gcc and java dir const-ification)


>>>>> "Kaveh" == Kaveh R Ghazi <ghazi@caip.rutgers.edu> writes:

Kaveh> Sure.  But when I ran 3.0.1 through gen-table.pl the output was
Kaveh> vastly different from the old chartables.h.  It had a whole
Kaveh> bunch of (char*)0 extra lines and somehow a parsing error got
Kaveh> inserted so it wouldn't compile.  I think the gen-table.pl
Kaveh> script encounters some input that it didn't expect and doesn't
Kaveh> yield valid C code.

I looked into this.
gen-table doesn't expect any characters after \uffff, and the 3.0.1
tables include some entries in that range.
I'm checking in the appended.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	* gen-table.pl: Don't process characters after \uffff.  Added
	comment pointing to input file.

Index: gen-table.pl
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/gen-table.pl,v
retrieving revision 1.3
diff -u -r1.3 gen-table.pl
--- gen-table.pl 2001/12/28 22:27:29 1.3
+++ gen-table.pl 2001/12/29 02:15:40
@@ -1,6 +1,6 @@
 #! /usr/bin/perl
 
-#    Copyright (C) 2000 Free Software Foundation
+#    Copyright (C) 2000, 2001 Free Software Foundation
 
 #    This program is free software; you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
@@ -20,10 +20,14 @@
 # gen-table.pl - Generate tables for gcj from Unicode data.
 # Usage: perl gen-table.pl DATA-FILE
 #
-# A suitable DATA-FILE is available at:
-# ftp://www.unicode.org/Public/3.0-Update/UnicodeData-3.0.0.txt
+# You can find the Unicode data file here:
+#   ftp://www.unicode.org/Public/3.0-Update1/UnicodeData-3.0.1.txt
+# Please update this URL when this program is used with a more
+# recent version of the table.  Note that this table cannot be
+# distributed with gcc.
+# This program should not be re-run indiscriminately.  Care must be
+# taken that what it generates is in sync with the Java specification.
 
-
 # Names of fields in Unicode data table.
 $CODE = 0;
 $NAME = 1;
@@ -80,6 +84,7 @@
     }
 
     $code = hex ($fields[$CODE]);
+    last if $code > 0xffff;
     if ($code > $last_code + 1)
     {
 	# Found a gap.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]