OSDN Git Service

Minor reformatting.
[pf3gnuchains/gcc-fork.git] / gcc / ada / s-stchop.adb
index c92c606..7c62aa5 100644 (file)
@@ -49,19 +49,18 @@ package body System.Stack_Checking.Operations is
    function Set_Stack_Info
      (Stack : not null access Stack_Access) return Stack_Access;
 
-   --  The function Set_Stack_Info is the actual function that updates
-   --  the cache containing a pointer to the Stack_Info. It may also
-   --  be used for detecting asynchronous abort in combination with
-   --  Invalidate_Self_Cache.
+   --  The function Set_Stack_Info is the actual function that updates the
+   --  cache containing a pointer to the Stack_Info. It may also be used for
+   --  detecting asynchronous abort in combination with Invalidate_Self_Cache.
 
    --  Set_Stack_Info should do the following things in order:
    --     1) Get the Stack_Access value for the current task
    --     2) Set Stack.all to the value obtained in 1)
    --     3) Optionally Poll to check for asynchronous abort
 
-   --  This order is important because if at any time a write to
-   --  the stack cache is pending, that write should be followed
-   --  by a Poll to prevent loosing signals.
+   --  This order is important because if at any time a write to the stack
+   --  cache is pending, that write should be followed by a Poll to prevent
+   --  loosing signals.
 
    --  Note: This function must be compiled with Polling turned off
 
@@ -126,15 +125,15 @@ package body System.Stack_Checking.Operations is
 
       if My_Stack.Base = Null_Address then
 
-         --  First invocation, initialize based on the assumption that
-         --  there are Environment_Stack_Size bytes available beyond
-         --  the current frame address.
+         --  First invocation, initialize based on the assumption that there
+         --  are Environment_Stack_Size bytes available beyond the current
+         --  frame address.
 
          if My_Stack.Size = 0 then
             My_Stack.Size := Storage_Offset (Default_Env_Stack_Size);
 
-            --  When the environment variable GNAT_STACK_LIMIT is set,
-            --  set Environment_Stack_Size to that number of kB.
+            --  When the environment variable GNAT_STACK_LIMIT is set, set
+            --  Environment_Stack_Size to that number of kB.
 
             Limit_Chars := System.CRTL.getenv ("GNAT_STACK_LIMIT" & ASCII.NUL);
 
@@ -147,8 +146,8 @@ package body System.Stack_Checking.Operations is
             end if;
          end if;
 
-         --  If a stack base address has been registered, honor it.
-         --  Fallback to the address of a local object otherwise.
+         --  If a stack base address has been registered, honor it. Fallback to
+         --  the address of a local object otherwise.
 
          if My_Stack.Limit /= System.Null_Address then
             My_Stack.Base := My_Stack.Limit;
@@ -187,7 +186,9 @@ package body System.Stack_Checking.Operations is
          raise Standard'Abort_Signal;
       end if;
 
-      return My_Stack; -- Never trust the cached value, but return local copy!
+      --  Never trust the cached value, but return local copy!
+
+      return My_Stack;
    end Set_Stack_Info;
 
    -----------------
@@ -215,22 +216,22 @@ package body System.Stack_Checking.Operations is
          raise Storage_Error with "stack overflow detected";
       end if;
 
-      --  This function first does a "cheap" check which is correct
-      --  if it succeeds. In case of failure, the full check is done.
-      --  Ideally the cheap check should be done in an optimized manner,
-      --  or be inlined.
+      --  This function first does a "cheap" check which is correct if it
+      --  succeeds. In case of failure, the full check is done. Ideally the
+      --  cheap check should be done in an optimized manner, or be inlined.
 
       if (Stack_Grows_Down and then
             (Frame_Address <= Cached_Stack.Base
-               and
+               and then
              Stack_Address > Cached_Stack.Limit))
         or else
          (not Stack_Grows_Down and then
             (Frame_Address >= Cached_Stack.Base
-               and
+               and then
              Stack_Address < Cached_Stack.Limit))
       then
          --  Cached_Stack is valid as it passed the stack check
+
          return Cached_Stack;
       end if;
 
@@ -247,22 +248,21 @@ package body System.Stack_Checking.Operations is
             (not Stack_Grows_Down and then
                (not (Frame_Address >= My_Stack.Base)))
          then
-            --  The returned Base is lower than the stored one,
-            --  so assume that the original one wasn't right and use the
-            --  current Frame_Address as new one. This allows initializing
-            --  Base with the Frame_Address as approximation.
-            --  During initialization the Frame_Address will be close to
-            --  the stack base anyway: the difference should be compensated
-            --  for in the stack reserve.
+            --  The returned Base is lower than the stored one, so assume that
+            --  the original one wasn't right and use the current Frame_Address
+            --  as new one. This allows Base to be initialized with the
+            --  Frame_Address as approximation. During initialization the
+            --  Frame_Address will be close to the stack base anyway: the
+            --  difference should be compensated for in the stack reserve.
 
             My_Stack.Base := Frame_Address;
          end if;
 
-         if (Stack_Grows_Down and then
-                  Stack_Address < My_Stack.Limit)
+         if (Stack_Grows_Down
+              and then Stack_Address < My_Stack.Limit)
            or else
-            (not Stack_Grows_Down and then
-                  Stack_Address > My_Stack.Limit)
+            (not Stack_Grows_Down
+              and then Stack_Address > My_Stack.Limit)
          then
             raise Storage_Error with "stack overflow detected";
          end if;