X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Funiname%2Fgen-uninames.lisp;h=d08e93f068ab77d70128885c2e17c61b93283c81;hb=9436b51b876432bb26c2345e138e8ddd7c6a7fb2;hp=01b9cffe7df9e7ca357a84a015a1592273a429b0;hpb=919363c034b12712d2d9a416c1e1a722e2b05d32;p=gnulib.git diff --git a/lib/uniname/gen-uninames.lisp b/lib/uniname/gen-uninames.lisp index 01b9cffe7..d08e93f06 100755 --- a/lib/uniname/gen-uninames.lisp +++ b/lib/uniname/gen-uninames.lisp @@ -42,14 +42,16 @@ (unless (or (<= #xF900 code #xFA2D) (<= #xFA30 code #xFA6A) (<= #xFA70 code #xFAD9) (<= #x2F800 code #x2FA1D)) ; Transform the code so that it fits in 16 bits. In - ; Unicode 3.1 the following ranges are used. + ; Unicode 5.1 the following ranges are used. ; 0x00000..0x04DFF >>12= 0x00..0x04 -> 0x0..0x4 - ; 0x0A000..0x0A4FF >>12= 0x0A -> 0x5 + ; 0x0A000..0x0AAFF >>12= 0x0A -> 0x5 ; 0x0F900..0x0FFFF >>12= 0x0F -> 0x6 - ; 0x10300..0x104FF >>12= 0x10 -> 0x7 - ; 0x1D000..0x1D7DD >>12= 0x1D -> 0x8 - ; 0x2F800..0x2FAFF >>12= 0x2F -> 0x9 - ; 0xE0000..0xE00FF >>12= 0xE0 -> 0xA + ; 0x10000..0x10A58 >>12= 0x10 -> 0x7 + ; 0x12000..0x12473 >>12= 0x12 -> 0x8 + ; 0x1D000..0x1D7FF >>12= 0x1D -> 0x9 + ; 0x1F000..0x1F093 >>12= 0x1F -> 0xA + ; 0x2F800..0x2FAFF >>12= 0x2F -> 0xB + ; 0xE0000..0xE00FF >>12= 0xE0 -> 0xC (flet ((transform (x) (dpb (case (ash x -12) @@ -57,9 +59,11 @@ (#x0A 5) (#x0F 6) (#x10 7) - (#x1D 8) - (#x2F 9) - (#xE0 #xA) + (#x12 8) + (#x1D 9) + (#x1F #xA) + (#x2F #xB) + (#xE0 #xC) (t (error "Update the transform function for 0x~5,'0X" x)) ) (byte 8 12) @@ -118,6 +122,7 @@ ;; Output the tables. (with-open-file (ostream outputfile :direction :output #+UNICODE :external-format #+UNICODE charset:ascii) + (format ostream "/* DO NOT EDIT! GENERATED AUTOMATICALLY! */~%") (format ostream "/*~%") (format ostream " * ~A~%" (file-namestring outputfile)) (format ostream " *~%") @@ -252,7 +257,9 @@ (incf i (length (unicode-char-word-indices uc))) ) ) (format ostream "};~%") - (format ostream "static const struct { uint16_t code; uint16_t name; } unicode_name_to_code[~D] = {~%" + (format ostream "static const struct { uint16_t code; uint32_t name:24; }~%") + (format ostream "#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)~%__attribute__((__packed__))~%#endif~%") + (format ostream "unicode_name_to_code[~D] = {~%" (length all-chars) ) (dolist (uc all-chars) @@ -266,7 +273,9 @@ (format ostream "~%") ) (format ostream "};~%") - (format ostream "static const struct { uint16_t code; uint16_t name; } unicode_code_to_name[~D] = {~%" + (format ostream "static const struct { uint16_t code; uint32_t name:24; }~%") + (format ostream "#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)~%__attribute__((__packed__))~%#endif~%") + (format ostream "unicode_code_to_name[~D] = {~%" (length all-chars) ) (dolist (uc (sort (copy-list all-chars) #'< :key #'unicode-char-code))