patch by Mathias Bauer <mathias_bauer@gmx.net>

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37758 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2014-03-19 09:38:40 +00:00
parent 5244db9446
commit 51fc1f745e
3 changed files with 47 additions and 0 deletions

View file

@ -1090,6 +1090,25 @@ GSObjCGetVal(NSObject *self, const char *key, SEL sel,
}
break;
case _C_BOOL:
{
bool v;
if (sel == 0)
{
v = *(bool *)((char *)self + offset);
}
else
{
bool (*imp)(id, SEL) =
(bool (*)(id, SEL))[self methodForSelector: sel];
v = (*imp)(self, sel);
}
val = [NSNumber numberWithBool: v];
}
break;
case _C_SHT:
{
short v;
@ -1534,6 +1553,26 @@ GSObjCSetVal(NSObject *self, const char *key, id val, SEL sel,
}
break;
case _C_BOOL:
{
bool v = [val boolValue];
if (sel == 0)
{
bool *ptr = (bool*)((char *)self + offset);
*ptr = v;
}
else
{
void (*imp)(id, SEL, bool) =
(void (*)(id, SEL, bool))[self methodForSelector: sel];
(*imp)(self, sel, v);
}
}
break;
case _C_SHT:
{
short v = [val shortValue];