mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-25 09:41:15 +00:00
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:
parent
1460f239ce
commit
1cd909d1e6
1 changed files with 3 additions and 1 deletions
|
@ -29,6 +29,7 @@
|
||||||
#include "Foundation/NSException.h"
|
#include "Foundation/NSException.h"
|
||||||
#include "Foundation/NSZone.h"
|
#include "Foundation/NSZone.h"
|
||||||
|
|
||||||
|
#define GSI_ARRAY_TYPES 0
|
||||||
#define GSI_ARRAY_TYPE NSRange
|
#define GSI_ARRAY_TYPE NSRange
|
||||||
|
|
||||||
#define GSI_ARRAY_NO_RELEASE 1
|
#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
|
- (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);
|
length /= sizeof(NSRange);
|
||||||
_data = NSZoneMalloc([self zone], sizeof(GSIArray_t));
|
_data = NSZoneMalloc([self zone], sizeof(GSIArray_t));
|
||||||
_array->ptr = (GSIArrayItem*)bytes;
|
_array->ptr = (GSIArrayItem*)bytes;
|
||||||
|
|
Loading…
Reference in a new issue