From c80d48556afdb3226ee55ef42b8b3327b71c631f Mon Sep 17 00:00:00 2001 From: Robert Dewar Date: Thu, 13 Dec 2007 11:27:58 +0100 Subject: g-spchge.ads, [...]: New files. 2007-12-06 Robert Dewar * g-spchge.ads, g-spchge.adb, g-u3spch.adb, g-u3spch.ads, g-wispch.adb, g-wispch.ads, g-zspche.adb, g-zspche.ads, namet-sp.adb, namet-sp.ads: New files. * g-speche.adb: Use generic routine in g-spchge * s-wchcnv.ads, s-wchcnv.adb: Minor code cleanup (make formal type consistent with spec) * namet.adb: Update comments. * par-endh.adb (Evaluate_End_Entry): Use new Namet.Sp.Is_Bad_Spelling_Of function * par-load.adb (Load): Use new Namet.Sp.Is_Bad_Spelling_Of function * sem_aggr.adb (Resolve_Record_Aggregate): If a component of an ancestor is an access type initialized with a box, set its type explicitly, for use in subsequent expansion. (Check_Misspelled_Component): Use new Namet.Sp.Is_Bad_Spelling_Of function From-SVN: r130843 --- gcc/ada/s-wchcnv.adb | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'gcc/ada/s-wchcnv.adb') diff --git a/gcc/ada/s-wchcnv.adb b/gcc/ada/s-wchcnv.adb index b58290f..3e877aa 100644 --- a/gcc/ada/s-wchcnv.adb +++ b/gcc/ada/s-wchcnv.adb @@ -47,7 +47,7 @@ package body System.WCh_Cnv is function Char_Sequence_To_UTF_32 (C : Character; - EM : WC_Encoding_Method) return UTF_32_Code + EM : System.WCh_Con.WC_Encoding_Method) return UTF_32_Code is B1 : Unsigned_32; C1 : Character; @@ -94,7 +94,7 @@ package body System.WCh_Cnv is raise Constraint_Error; end if; - W := Shift_Left (W, 6) or (U and 2#00111111#); + W := Shift_Left (W, 6) or (U and 2#00111111#); end Get_UTF_Byte; -- Start of processing for Char_Sequence_To_Wide @@ -151,15 +151,8 @@ package body System.WCh_Cnv is -- 16#00_0080#-16#00_07FF#: 110xxxxx 10xxxxxx elsif (U and 2#11100000#) = 2#110_00000# then - W := Shift_Left (U and 2#00011111#, 6); - U := Unsigned_32 (Character'Pos (In_Char)); - - if (U and 2#11000000#) /= 2#10_000000# then - raise Constraint_Error; - end if; - - W := W or (U and 2#00111111#); - + W := U and 2#00011111#; + Get_UTF_Byte; return UTF_32_Code (W); -- 16#00_0800#-16#00_ffff#: 1110xxxx 10xxxxxx 10xxxxxx @@ -210,7 +203,6 @@ package body System.WCh_Cnv is end if; when WCEM_Brackets => - if C /= '[' then return Character'Pos (C); end if; -- cgit v1.1