(objc_sizeof_type): Assign from ROUND,
authorKresten Krab Thorup <krab@gcc.gnu.org>
Mon, 15 Aug 1994 16:03:36 +0000 (16:03 +0000)
committerKresten Krab Thorup <krab@gcc.gnu.org>
Mon, 15 Aug 1994 16:03:36 +0000 (16:03 +0000)
        don't increment.  Remove ; after while to fix infinite loop.
        Add float and double cases.
        (objc_alignof_type):  Add float and double cases.

From-SVN: r7929

gcc/objc/encoding.c

index 479b4a1..27b4b8a 100644 (file)
@@ -103,6 +103,14 @@ objc_sizeof_type(const char* type)
     return sizeof(unsigned long);
     break;
 
+  case _C_FLT:
+    return sizeof(float);
+    break;
+
+  case _C_DBL:
+    return sizeof(double);
+    break;
+
   case _C_PTR:
   case _C_ATOM:
   case _C_CHARPTR:
@@ -122,10 +130,10 @@ objc_sizeof_type(const char* type)
       int acc_size = 0;
       int align;
       while (*type != _C_STRUCT_E && *type++ != '='); /* skip "<name>=" */
-      while (*type != _C_STRUCT_E);
+      while (*type != _C_STRUCT_E)
        {
          align = objc_alignof_type (type);       /* padd to alignment */
-         acc_size += ROUND (acc_size, align);
+         acc_size = ROUND (acc_size, align);
          acc_size += objc_sizeof_type (type);   /* add component size */
          type = objc_skip_typespec (type);              /* skip component */
        }
@@ -202,6 +210,14 @@ objc_alignof_type(const char* type)
     return __alignof__(unsigned long);
     break;
 
+  case _C_FLT:
+    return __alignof__(float);
+    break;
+
+  case _C_DBL:
+    return __alignof__(double);
+    break;
+
   case _C_ATOM:
   case _C_CHARPTR:
     return __alignof__(char*);