Skip to content

Commit

Permalink
SADLY: consider __objc_max
Browse files Browse the repository at this point in the history
  • Loading branch information
DHowett committed Feb 17, 2018
1 parent ef18759 commit 9630cf1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions encoding2.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ inline static void round_up(size_t *v, size_t b)
*v += b - (*v % b);
}
}
inline static size_t max(size_t v, size_t v2)
inline static size_t __objc_max(size_t v, size_t v2)
{
return v>v2 ? v : v2;
}
Expand Down Expand Up @@ -249,7 +249,7 @@ static const char *sizeof_union_field(const char *type, size_t *size)
{
size_t field_size = 0;
const char *end = sizeof_type(type, &field_size);
*size = max(*size, field_size);
*size = __objc_max(*size, field_size);
return end;
}

Expand All @@ -263,15 +263,15 @@ static const char *alignof_type(const char *type, size_t *align)
#define APPLY_TYPE(typeName, name, capitalizedName, encodingChar) \
case encodingChar:\
{\
*align = max((alignof(typeName) * 8), *align);\
*align = __objc_max((alignof(typeName) * 8), *align);\
return type + 1;\
}
#define NON_INTEGER_TYPES 1
#define SKIP_ID 1
#include "type_encoding_cases.h"
case '@':
{
*align = max((alignof(id) * 8), *align);\
*align = __objc_max((alignof(id) * 8), *align);\
if (*(type+1) == '?')
{
type++;
Expand All @@ -288,7 +288,7 @@ static const char *alignof_type(const char *type, size_t *align)
#define APPLY_TYPE(typeName, name, capitalizedName, encodingChar) \
case encodingChar:\
{\
*align = max((alignof(_Complex typeName) * 8), *align);\
*align = __objc_max((alignof(_Complex typeName) * 8), *align);\
return type + 1;\
}
#include "type_encoding_cases.h"
Expand Down Expand Up @@ -327,7 +327,7 @@ static const char *alignof_type(const char *type, size_t *align)
}
case '^':
{
*align = max((alignof(void*) * 8), *align);
*align = __objc_max((alignof(void*) * 8), *align);
// All pointers look the same to me.
size_t ignored = 0;
// Skip the definition of the pointeee type.
Expand Down

0 comments on commit 9630cf1

Please sign in to comment.