-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
exception
when Constraint_Error =>
- Osint.Fail
- ("numeric value out of range for switch: ", (1 => S));
+ Osint.Fail ("numeric value out of range for switch: " & S);
end;
return Result;
if Switch_Chars'Last >= Ptr + 3
and then Switch_Chars (Ptr .. Ptr + 3) = "gnat"
then
- Osint.Fail ("invalid switch: """, Switch_Chars, """"
- & " (gnat not needed here)");
+ Osint.Fail ("invalid switch: """ & Switch_Chars & """"
+ & " (gnat not needed here)");
end if;
-- Loop to scan through switches given in switch string
end if;
Ptr := Ptr + 1;
- Scan_Pos (Switch_Chars, Max, Ptr, Maximum_Errors, C);
+ Scan_Pos (Switch_Chars, Max, Ptr, Maximum_Messages, C);
-- Processing for n switch
case Switch_Chars (Ptr) is
when 'e' =>
- Warning_Mode := Treat_As_Error;
+ Warning_Mode := Treat_As_Error;
when 's' =>
- Warning_Mode := Suppress;
+ Warning_Mode := Suppress;
when others =>
Bad_Switch (Switch_Chars);
-- Processing for W switch
when 'W' =>
- if Ptr = Max then
- Bad_Switch (Switch_Chars);
- end if;
-
Ptr := Ptr + 1;
- for J in WC_Encoding_Method loop
- if Switch_Chars (Ptr) = WC_Encoding_Letters (J) then
- Wide_Character_Encoding_Method := J;
- exit;
+ if Ptr > Max then
+ Bad_Switch (Switch_Chars);
+ end if;
- elsif J = WC_Encoding_Method'Last then
+ begin
+ Wide_Character_Encoding_Method :=
+ Get_WC_Encoding_Method (Switch_Chars (Ptr));
+ exception
+ when Constraint_Error =>
Bad_Switch (Switch_Chars);
- end if;
- end loop;
+ end;
+
+ Wide_Character_Encoding_Method_Specified := True;
Upper_Half_Encoding :=
Wide_Character_Encoding_Method in