Commit 75a5a487 by Robert Dewar Committed by Arnaud Charlet

s-osprim-mingw.adb: Minor reformatting Minor code reorganization

2009-07-07  Robert Dewar  <dewar@adacore.com>

	* s-osprim-mingw.adb: Minor reformatting
	Minor code reorganization

	* a-stzsea.adb, a-stwise.adb, a-strsea.adb (Index): Redo previous change
	(Ind should be Integer).

From-SVN: r149327
parent 85686ad9
2009-07-07 Robert Dewar <dewar@adacore.com> 2009-07-07 Robert Dewar <dewar@adacore.com>
* s-osprim-mingw.adb: Minor reformatting
Minor code reorganization
2009-07-07 Robert Dewar <dewar@adacore.com>
* prj-nmsc.adb: Minor reformatting * prj-nmsc.adb: Minor reformatting
2009-07-07 Pascal Obry <obry@adacore.com> 2009-07-07 Pascal Obry <obry@adacore.com>
......
...@@ -238,7 +238,7 @@ package body Ada.Strings.Search is ...@@ -238,7 +238,7 @@ package body Ada.Strings.Search is
Mapping : Maps.Character_Mapping := Maps.Identity) return Natural Mapping : Maps.Character_Mapping := Maps.Identity) return Natural
is is
PL1 : constant Integer := Pattern'Length - 1; PL1 : constant Integer := Pattern'Length - 1;
Ind : Natural; Ind : Integer; -- can be negative if Pattern'Length > Source'Length
Cur : Natural; Cur : Natural;
begin begin
...@@ -246,12 +246,6 @@ package body Ada.Strings.Search is ...@@ -246,12 +246,6 @@ package body Ada.Strings.Search is
raise Pattern_Error; raise Pattern_Error;
end if; end if;
-- If Pattern longer than Source it can't be found
if Pattern'Length > Source'Length then
return 0;
end if;
-- Forwards case -- Forwards case
if Going = Forward then if Going = Forward then
......
...@@ -233,7 +233,7 @@ package body Ada.Strings.Wide_Search is ...@@ -233,7 +233,7 @@ package body Ada.Strings.Wide_Search is
return Natural return Natural
is is
PL1 : constant Integer := Pattern'Length - 1; PL1 : constant Integer := Pattern'Length - 1;
Ind : Natural; Ind : Integer; -- can be negative if Pattern'Length > Source'Length
Cur : Natural; Cur : Natural;
begin begin
...@@ -241,12 +241,6 @@ package body Ada.Strings.Wide_Search is ...@@ -241,12 +241,6 @@ package body Ada.Strings.Wide_Search is
raise Pattern_Error; raise Pattern_Error;
end if; end if;
-- If Pattern longer than Source it can't be found
if Pattern'Length > Source'Length then
return 0;
end if;
-- Forwards case -- Forwards case
if Going = Forward then if Going = Forward then
......
...@@ -237,7 +237,7 @@ package body Ada.Strings.Wide_Wide_Search is ...@@ -237,7 +237,7 @@ package body Ada.Strings.Wide_Wide_Search is
return Natural return Natural
is is
PL1 : constant Integer := Pattern'Length - 1; PL1 : constant Integer := Pattern'Length - 1;
Ind : Natural; Ind : Integer; -- can be negative if Pattern'Length > Source'Length
Cur : Natural; Cur : Natural;
begin begin
...@@ -245,12 +245,6 @@ package body Ada.Strings.Wide_Wide_Search is ...@@ -245,12 +245,6 @@ package body Ada.Strings.Wide_Wide_Search is
raise Pattern_Error; raise Pattern_Error;
end if; end if;
-- If Pattern longer than Source it can't be found
if Pattern'Length > Source'Length then
return 0;
end if;
-- Forwards case -- Forwards case
if Going = Forward then if Going = Forward then
......
...@@ -157,13 +157,10 @@ package body System.OS_Primitives is ...@@ -157,13 +157,10 @@ package body System.OS_Primitives is
-- actions should be null. -- actions should be null.
Max_Elapsed : constant := 0; Max_Elapsed : constant := 0;
epoch_1970 : constant := 16#19D_B1DE_D53E_8000#; -- win32 UTC epoch epoch_1970 : constant := 16#19D_B1DE_D53E_8000#; -- win32 UTC epoch
system_time_ns : constant := 100; -- 100 ns per tick system_time_ns : constant := 100; -- 100 ns per tick
Sec_Unit : constant := 10#1#E9; Sec_Unit : constant := 10#1#E9;
Test_Now : aliased Long_Long_Integer; Test_Now : aliased Long_Long_Integer;
Loc_Ticks : aliased LARGE_INTEGER; Loc_Ticks : aliased LARGE_INTEGER;
Loc_Time : aliased Long_Long_Integer; Loc_Time : aliased Long_Long_Integer;
Elapsed : Long_Long_Integer; Elapsed : Long_Long_Integer;
...@@ -181,8 +178,8 @@ package body System.OS_Primitives is ...@@ -181,8 +178,8 @@ package body System.OS_Primitives is
-- time API. -- time API.
-- Try at most 10th times to reach the best synchronisation (below 1 -- Try at most 10th times to reach the best synchronisation (below 1
-- millisecond) otherwise the runtime will use the best value -- millisecond) otherwise the runtime will use the best value reached
-- reached during the runs. -- during the runs.
for K in 1 .. 10 loop for K in 1 .. 10 loop
GetSystemTimeAsFileTime (Loc_Time'Access); GetSystemTimeAsFileTime (Loc_Time'Access);
...@@ -219,17 +216,15 @@ package body System.OS_Primitives is ...@@ -219,17 +216,15 @@ package body System.OS_Primitives is
function Monotonic_Clock return Duration is function Monotonic_Clock return Duration is
Current_Ticks : aliased LARGE_INTEGER; Current_Ticks : aliased LARGE_INTEGER;
Elap_Secs_Tick : Duration; Elap_Secs_Tick : Duration;
begin begin
if QueryPerformanceCounter (Current_Ticks'Access) = Win32.FALSE then if QueryPerformanceCounter (Current_Ticks'Access) = Win32.FALSE then
return 0.0; return 0.0;
else
Elap_Secs_Tick :=
Duration (Long_Long_Float (Current_Ticks - BMTA.all) /
Long_Long_Float (TFA.all));
return BMCA.all + Elap_Secs_Tick;
end if; end if;
Elap_Secs_Tick :=
Duration (Long_Long_Float (Current_Ticks - BMTA.all) /
Long_Long_Float (TFA.all));
return BMCA.all + Elap_Secs_Tick;
end Monotonic_Clock; end Monotonic_Clock;
----------------- -----------------
......
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