Skip to content

Commit

Permalink
Merge pull request #69 from nickynick/bool-fix
Browse files Browse the repository at this point in the history
Use bool instead of _Bool (may cause compilation error for Objective-C++ code)
  • Loading branch information
cloudkite committed May 21, 2014
2 parents 69711b9 + a73fa12 commit 198622e
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions Masonry/MASUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,6 @@ static inline id _MASBoxValue(const char *type, ...) {
} else if (strcmp(type, @encode(MASEdgeInsets)) == 0) {
MASEdgeInsets actual = (MASEdgeInsets)va_arg(v, MASEdgeInsets);
obj = [NSValue value:&actual withObjCType:type];
} else if (strcmp(type, @encode(char)) == 0) {
char actual = (char)va_arg(v, int);
obj = [NSNumber numberWithChar:actual];
} else if(strcmp(type, @encode(_Bool)) == 0) {
_Static_assert(sizeof(_Bool) <= sizeof(int), "Expected _Bool to be subject to vararg type promotion");
_Bool actual = (_Bool)va_arg(v, int);
obj = [NSNumber numberWithBool:actual];
} else if (strcmp(type, @encode(double)) == 0) {
double actual = (double)va_arg(v, double);
obj = [NSNumber numberWithDouble:actual];
Expand All @@ -113,6 +106,12 @@ static inline id _MASBoxValue(const char *type, ...) {
} else if (strcmp(type, @encode(short)) == 0) {
short actual = (short)va_arg(v, int);
obj = [NSNumber numberWithShort:actual];
} else if (strcmp(type, @encode(char)) == 0) {
char actual = (char)va_arg(v, int);
obj = [NSNumber numberWithChar:actual];
} else if (strcmp(type, @encode(bool)) == 0) {
bool actual = (bool)va_arg(v, int);
obj = [NSNumber numberWithBool:actual];
} else if (strcmp(type, @encode(unsigned char)) == 0) {
unsigned char actual = (unsigned char)va_arg(v, unsigned int);
obj = [NSNumber numberWithUnsignedChar:actual];
Expand Down

0 comments on commit 198622e

Please # to comment.