fix formatting errors

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@34301 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2011-12-16 07:28:05 +00:00
parent ee3f0b14a0
commit c471992651

View file

@ -173,8 +173,7 @@ class_addIvar(Class cls, const char *name,
ivarlist->ivar_count++; ivarlist->ivar_count++;
// objc_ivar_list contains one ivar. Others follow it. // objc_ivar_list contains one ivar. Others follow it.
cls->ivars = realloc(ivarlist, sizeof(struct objc_ivar_list) cls->ivars = realloc(ivarlist, sizeof(struct objc_ivar_list)
+ (ivarlist->ivar_count - + (ivarlist->ivar_count - 1) * sizeof(struct objc_ivar));
1) * sizeof(struct objc_ivar));
} }
ivar = &cls->ivars->ivar_list[cls->ivars->ivar_count - 1]; ivar = &cls->ivars->ivar_list[cls->ivars->ivar_count - 1];
@ -1182,21 +1181,28 @@ objc_getProtocol(const char *name)
return p; return p;
} }
Protocol **objc_copyProtocolList(unsigned int *count) Protocol **
objc_copyProtocolList(unsigned int *count)
{ {
*count = 0; *count = 0;
return NULL; return NULL;
} }
BOOL protocol_conformsToProtocol(Protocol *p1, Protocol *p2) BOOL
protocol_conformsToProtocol(Protocol *p1, Protocol *p2)
{ {
struct objc_protocol_list *list = p1->protocol_list; struct objc_protocol_list *list = p1->protocol_list;
// A protocol trivially conforms to itself // A protocol trivially conforms to itself
if (strcmp(p1->protocol_name, p2->protocol_name) == 0) { return YES; } if (strcmp(p1->protocol_name, p2->protocol_name) == 0)
{
return YES;
}
for (list = p1->protocol_list; list != NULL; list = list->next) for (list = p1->protocol_list; list != NULL; list = list->next)
{ {
int i; int i;
for (i = 0; i < list->count; i++) for (i = 0; i < list->count; i++)
{ {
if (strcmp(list->list[i]->protocol_name, p2->protocol_name) == 0) if (strcmp(list->list[i]->protocol_name, p2->protocol_name) == 0)
@ -1212,7 +1218,8 @@ BOOL protocol_conformsToProtocol(Protocol *p1, Protocol *p2)
return NO; return NO;
} }
BOOL class_conformsToProtocol(Class cls, Protocol *protocol) BOOL
class_conformsToProtocol(Class cls, Protocol *protocol)
{ {
struct objc_protocol_list *protocols; struct objc_protocol_list *protocols;
@ -1222,9 +1229,11 @@ BOOL class_conformsToProtocol(Class cls, Protocol *protocol)
protocols != NULL; protocols = protocols->next) protocols != NULL; protocols = protocols->next)
{ {
int i; int i;
for (i = 0; i < protocols->count; i++) for (i = 0; i < protocols->count; i++)
{ {
Protocol *p1 = (Protocol*)protocols->list[i]; Protocol *p1 = (Protocol*)protocols->list[i];
if (strcmp(p1->protocol_name, protocol->protocol_name) == 0) if (strcmp(p1->protocol_name, protocol->protocol_name) == 0)
{ {
return YES; return YES;
@ -1263,10 +1272,10 @@ protocol_copyMethodDescriptionList(Protocol * p,
methods = p->class_methods; methods = p->class_methods;
} }
if (methods != NULL) if (methods != NULL)
{ {
int i; int i;
outputCount = methods->count; outputCount = methods->count;
output = malloc(outputCount * sizeof(struct objc_method_description)); output = malloc(outputCount * sizeof(struct objc_method_description));
@ -1293,6 +1302,7 @@ protocol_copyProtocolList(Protocol * p, unsigned int *count)
for (list = p->protocol_list; list != NULL; list = list->next) for (list = p->protocol_list; list != NULL; list = list->next)
{ {
int i; int i;
for (i = 0; i < list->count; i++) for (i = 0; i < list->count; i++)
{ {
outputCount++; outputCount++;
@ -1307,6 +1317,7 @@ protocol_copyProtocolList(Protocol * p, unsigned int *count)
for (list = p->protocol_list; list != NULL; list = list->next) for (list = p->protocol_list; list != NULL; list = list->next)
{ {
int i; int i;
for (i = 0; i < list->count; i++) for (i = 0; i < list->count; i++)
{ {
output[i] = (Protocol*)list->list[i]; output[i] = (Protocol*)list->list[i];