Commit 5b2da948 by Arnaud Charlet

s-wwdcha.adb: Minor code reorganization Remove dead code

2008-08-22  Robert Dewar  <dewar@adacore.com>

	* s-wwdcha.adb: Minor code reorganization
	Remove dead code

From-SVN: r139490
parent f5e811d5
2008-08-22 Arnaud Charlet <charlet@adacore.com>
* lib-xref.ads: Fix typo in subprogram reference definition.
2008-08-22 Robert Dewar <dewar@adacore.com>
* s-sopco3.adb: Minor code fix to avoid warning
* s-sopco4.adb: Minor code fix to avoid warning
* s-sopco5.adb: Minor code fix to avoid warning
* s-strops.adb: Minor code fix to avoid warning
* s-utf_32.adb (Get_Category): Fix obvious typo
* s-wwdcha.adb: Minor code reorganization
Remove dead code
2008-08-22 Robert Dewar <dewar@adacore.com> 2008-08-22 Robert Dewar <dewar@adacore.com>
* checks.adb (Determine_Range): Deal with values that might be invalid * checks.adb (Determine_Range): Deal with values that might be invalid
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -43,20 +43,11 @@ package body System.WWd_Char is ...@@ -43,20 +43,11 @@ package body System.WWd_Char is
begin begin
W := 0; W := 0;
for C in Lo .. Hi loop for C in Lo .. Hi loop
-- For Character range, use length of image declare
S : constant Wide_String := Character'Wide_Image (C);
if Character'Pos (C) < 256 then begin
declare W := Natural'Max (W, S'Length);
S : constant Wide_String := Character'Wide_Image (C); end;
begin
W := Natural'Max (W, S'Length);
end;
-- For wide character, always max out at 12 (Hex_hhhhhhhh)
else
return 12;
end if;
end loop; end loop;
return W; return W;
...@@ -72,21 +63,11 @@ package body System.WWd_Char is ...@@ -72,21 +63,11 @@ package body System.WWd_Char is
begin begin
W := 0; W := 0;
for C in Lo .. Hi loop for C in Lo .. Hi loop
declare
-- For Character range, use length of image S : constant String := Character'Image (C);
begin
if Character'Pos (C) < 256 then W := Natural'Max (W, S'Length);
declare end;
S : constant String := Character'Image (C);
begin
W := Natural'Max (W, S'Length);
end;
-- For wide character, always max out at 12 (Hex_hhhhhhhh)
else
return 12;
end if;
end loop; end loop;
return W; return W;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment