From: Kresten Krab Thorup Date: Mon, 15 Aug 1994 16:03:36 +0000 (+0000) Subject: (objc_sizeof_type): Assign from ROUND, X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f4e12fadd15690790c13acfb0e32be9303a81132;p=platform%2Fupstream%2Fgcc.git (objc_sizeof_type): Assign from ROUND, 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 --- diff --git a/gcc/objc/encoding.c b/gcc/objc/encoding.c index 479b4a1..27b4b8a 100644 --- a/gcc/objc/encoding.c +++ b/gcc/objc/encoding.c @@ -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 "=" */ - 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*);