Fix types in array so alignment should be ok

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28760 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2009-10-02 14:01:04 +00:00
parent 1460f239ce
commit 1cd909d1e6

View file

@ -29,6 +29,7 @@
#include "Foundation/NSException.h"
#include "Foundation/NSZone.h"
#define GSI_ARRAY_TYPES 0
#define GSI_ARRAY_TYPE NSRange
#define GSI_ARRAY_NO_RELEASE 1
@ -1315,7 +1316,8 @@ static NSUInteger posForIndex(GSIArray array, NSUInteger index)
- (id) _initWithBytes: (const void*)bytes length: (NSUInteger)length
{
NSAssert(length % sizeof(NSRange) == 0, NSInvalidArgumentException);
NSAssert(length % sizeof(GSIArrayItem) == 0, NSInvalidArgumentException);
NSAssert(length % __alignof__(GSIArrayItem) == 0, NSInvalidArgumentException);
length /= sizeof(NSRange);
_data = NSZoneMalloc([self zone], sizeof(GSIArray_t));
_array->ptr = (GSIArrayItem*)bytes;