summaryrefslogtreecommitdiff
path: root/gcc/ada/s-wchwts.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2008-08-05 13:42:08 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2008-08-05 13:42:08 +0000
commit9828d38095de947645523aa3ea8070c8e1bb99a0 (patch)
tree41315687c8149a8c962459a87f301abcc4795770 /gcc/ada/s-wchwts.adb
parent96b387a535b0c460a630a2a0bd493c34dee44b2d (diff)
downloadgcc-9828d38095de947645523aa3ea8070c8e1bb99a0.tar.gz
2008-08-05 Vincent Celier <celier@adacore.com>
* s-wchwts.adb: (Wide_String_To_String): Returns a String with the same 'First as its parameter S. (Wide_Wide_String_To_String): Ditto * s-wchwts.ads: (Wide_String_To_String): Document that the lowest index of the returned String is equal to S'First. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@138708 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/s-wchwts.adb')
-rw-r--r--gcc/ada/s-wchwts.adb12
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/ada/s-wchwts.adb b/gcc/ada/s-wchwts.adb
index ed660fefc0f..1dc2fce4a87 100644
--- a/gcc/ada/s-wchwts.adb
+++ b/gcc/ada/s-wchwts.adb
@@ -88,16 +88,16 @@ package body System.WCh_WtS is
(S : Wide_String;
EM : WC_Encoding_Method) return String
is
- R : String (1 .. 5 * S'Length); -- worst case length!
+ R : String (S'First .. S'First + 5 * S'Length); -- worst case length!
RP : Natural;
begin
- RP := 0;
+ RP := R'First - 1;
for SP in S'Range loop
Store_UTF_32_Character (Wide_Character'Pos (S (SP)), R, RP, EM);
end loop;
- return R (1 .. RP);
+ return R (R'First .. RP);
end Wide_String_To_String;
--------------------------------
@@ -108,17 +108,17 @@ package body System.WCh_WtS is
(S : Wide_Wide_String;
EM : WC_Encoding_Method) return String
is
- R : String (1 .. 7 * S'Length); -- worst case length!
+ R : String (S'First .. S'First + 7 * S'Length); -- worst case length!
RP : Natural;
begin
- RP := 0;
+ RP := R'First - 1;
for SP in S'Range loop
Store_UTF_32_Character (Wide_Wide_Character'Pos (S (SP)), R, RP, EM);
end loop;
- return R (1 .. RP);
+ return R (R'First .. RP);
end Wide_Wide_String_To_String;
end System.WCh_WtS;