CVS difference for acats/cd/cd30002.a

Differences between 1.3 and version 1.4
Log of other versions for file acats/cd/cd30002.a

--- acats/cd/cd30002.a	1998/10/30 18:47:13	1.3
+++ acats/cd/cd30002.a	1999/01/18 21:52:42	1.4
@@ -60,6 +60,8 @@
 --      26 SEP 98   RLB    Fixed value on line 130 so check and dec. match.
 --      30 OCT 98   RLB    Split Multiple_Alignment and revised the
 --                         calculation to work on all targets.
+--      18 JAN 99   RLB    Repaired again to work on targets where word size
+--                         equals storage unit.
 --!
 ----------------------------------------------------------------- CD30002_0
 
@@ -68,6 +70,7 @@
 package CD30002_0 is
 
   S_Units_per_Word : constant := System.Word_Size/System.Storage_Unit;
+	-- Must be 1 or greater.
 
   Multiple_Type_Alignment : constant :=
       Integer'Min ( Impdef.Max_Default_Alignment,
@@ -81,6 +84,12 @@
       -- Calculate a reasonable object alignment, but not larger than
       -- the implementation is required to support.
 
+  Small_Alignment : constant :=
+      Integer'Max ( S_Units_per_Word / 2, 1);
+      -- Calculate a reasonable small alignment, but not less than 1.
+      -- (If S_Units_per_Word = 1, 1/2 => 0 which causes problems
+      -- verifying alignment.)
+
   subtype Storage_Element is System.Storage_Elements.Storage_Element;
 
   type Some_Stuff is array(1..S_Units_Per_Word) of Storage_Element;
@@ -92,7 +101,7 @@
       use Impdef.Max_Linker_Alignment;                        -- N/A => ERROR.
 
   type Quarter is mod 4; -- two bits
-    for Quarter'Alignment use S_Units_per_Word / 2;           -- N/A => ERROR.
+    for Quarter'Alignment use Small_Alignment;                -- N/A => ERROR.
 
   type Half is mod 16; -- nibble
     for Half'Alignment use Multiple_Type_Alignment;                -- N/A => ERROR.
@@ -132,7 +141,7 @@
 
   Quarter_Object : CD30002_0.O_Quarter;
     for Quarter_Object'Alignment
-        use CD30002_0.S_Units_per_Word / 2;                   -- N/A => ERROR.
+        use CD30002_0.Small_Alignment;                        -- N/A => ERROR.
 
   Half_Object    : CD30002_0.O_Half;
     for Half_Object'Alignment
@@ -168,7 +177,7 @@
     Report.Failed("Max alignment subtype" & NAC);
   end if;
 
-  if A2I(My_Quarter'Address) mod (CD30002_0.S_Units_per_Word / 2) /= 0 then
+  if A2I(My_Quarter'Address) mod (CD30002_0.Small_Alignment) /= 0 then
     Report.Failed("Factor of words subtype" & NAC);
   end if;
 
@@ -181,7 +190,7 @@
   end if;
 
   if A2I(Quarter_Object'Address) 
-       mod (CD30002_0.S_Units_per_Word / 2) /= 0 then
+       mod (CD30002_0.Small_Alignment) /= 0 then
     Report.Failed("Factor of words object" & NAC);
   end if;
 

Questions? Ask the ACAA Technical Agent