mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
avoid objc_skip_offset()
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29814 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
f710cb72e9
commit
7b12d4cc8e
4 changed files with 29 additions and 13 deletions
|
@ -231,7 +231,7 @@ GSObjCFindVariable(id obj, const char *name,
|
||||||
NSUInteger s;
|
NSUInteger s;
|
||||||
NSUInteger a;
|
NSUInteger a;
|
||||||
|
|
||||||
NSGetSizeAndAlignment(enc,&s, &a);
|
NSGetSizeAndAlignment(enc, &s, &a);
|
||||||
*size = s;
|
*size = s;
|
||||||
}
|
}
|
||||||
if (offset != 0)
|
if (offset != 0)
|
||||||
|
|
|
@ -804,13 +804,13 @@ gs_protocol_selector(const char *types)
|
||||||
}
|
}
|
||||||
while (*types != '\0')
|
while (*types != '\0')
|
||||||
{
|
{
|
||||||
if (*types == '-')
|
if (*types == '+' || *types == '-')
|
||||||
{
|
{
|
||||||
types++;
|
types++;
|
||||||
}
|
}
|
||||||
if (*types == '+' || isdigit(*types))
|
while(isdigit(*types))
|
||||||
{
|
{
|
||||||
types = objc_skip_offset(types);
|
types++;
|
||||||
}
|
}
|
||||||
while (*types == _C_CONST || *types == _C_GCINVISIBLE)
|
while (*types == _C_CONST || *types == _C_GCINVISIBLE)
|
||||||
{
|
{
|
||||||
|
|
|
@ -496,13 +496,13 @@ gs_protocol_selector(const char *types)
|
||||||
}
|
}
|
||||||
while (*types != '\0')
|
while (*types != '\0')
|
||||||
{
|
{
|
||||||
if (*types == '-')
|
if (*types == '+' || *types == '-')
|
||||||
{
|
{
|
||||||
types++;
|
types++;
|
||||||
}
|
}
|
||||||
if (*types == '+' || isdigit(*types))
|
while(isdigit(*types))
|
||||||
{
|
{
|
||||||
types = objc_skip_offset(types);
|
types++;
|
||||||
}
|
}
|
||||||
while (*types == _C_CONST || *types == _C_GCINVISIBLE)
|
while (*types == _C_CONST || *types == _C_GCINVISIBLE)
|
||||||
{
|
{
|
||||||
|
|
|
@ -137,12 +137,28 @@ const char *
|
||||||
NSGetSizeAndAlignment(const char *typePtr,
|
NSGetSizeAndAlignment(const char *typePtr,
|
||||||
NSUInteger *sizep, NSUInteger *alignp)
|
NSUInteger *sizep, NSUInteger *alignp)
|
||||||
{
|
{
|
||||||
typePtr = objc_skip_offset (typePtr);
|
if (typePtr != NULL)
|
||||||
typePtr = objc_skip_type_qualifiers (typePtr);
|
{
|
||||||
if (sizep)
|
/* Skip any offset, but don't call objc_skip_offset() as that's buggy.
|
||||||
*sizep = objc_sizeof_type (typePtr);
|
*/
|
||||||
if (alignp)
|
if (*typePtr == '+' || *typePtr == '-')
|
||||||
*alignp = objc_alignof_type (typePtr);
|
{
|
||||||
|
typePtr++;
|
||||||
|
}
|
||||||
|
while (isdigit(*typePtr))
|
||||||
|
{
|
||||||
|
typePtr++;
|
||||||
|
}
|
||||||
|
typePtr = objc_skip_type_qualifiers (typePtr);
|
||||||
|
if (sizep)
|
||||||
|
{
|
||||||
|
*sizep = objc_sizeof_type (typePtr);
|
||||||
|
}
|
||||||
|
if (alignp)
|
||||||
|
{
|
||||||
|
*alignp = objc_alignof_type (typePtr);
|
||||||
|
}
|
||||||
|
}
|
||||||
return typePtr;
|
return typePtr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue