diff options
author | Kresten Krab Thorup <krab@gcc.gnu.org> | 1994-08-15 16:03:36 +0000 |
---|---|---|
committer | Kresten Krab Thorup <krab@gcc.gnu.org> | 1994-08-15 16:03:36 +0000 |
commit | f4e12fadd15690790c13acfb0e32be9303a81132 (patch) | |
tree | 3f7d766a3577e1428a5567e5f2e499ba8a2d0a53 /gcc/objc/encoding.c | |
parent | 121b312b9074813750141689cf9359576da87d81 (diff) | |
download | gcc-f4e12fadd15690790c13acfb0e32be9303a81132.zip gcc-f4e12fadd15690790c13acfb0e32be9303a81132.tar.gz gcc-f4e12fadd15690790c13acfb0e32be9303a81132.tar.bz2 |
(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
Diffstat (limited to 'gcc/objc/encoding.c')
-rw-r--r-- | gcc/objc/encoding.c | 20 |
1 files changed, 18 insertions, 2 deletions
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 "<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*); |