mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-26 18:21:04 +00:00
* Source/NSBundle.m (+initialize): Remove usage of classes local array.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@24188 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
1bf651cc0c
commit
aa738fa379
2 changed files with 7 additions and 26 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2006-12-05 Matt Rice <ratmice@gmail.com>
|
||||||
|
|
||||||
|
* Source/NSBundle.m (+initialize): Remove usage of classes local array.
|
||||||
|
|
||||||
2006-12-05 Richard Frith-Macdonald <rfm@gnu.org>
|
2006-12-05 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* NSURL.m: Check for missing scheme and return nil.
|
* NSURL.m: Check for missing scheme and return nil.
|
||||||
|
|
|
@ -777,39 +777,16 @@ _bundle_load_callback(Class theClass, struct objc_category *theCategory)
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
int i, numBufClasses = 10, numClasses = 0;
|
|
||||||
Class *classes;
|
|
||||||
|
|
||||||
classes = objc_malloc(sizeof(Class) * numBufClasses);
|
|
||||||
|
|
||||||
while ((class = objc_next_class(&state)))
|
while ((class = objc_next_class(&state)))
|
||||||
{
|
{
|
||||||
unsigned int len = strlen (class->name);
|
unsigned int len = strlen (class->name);
|
||||||
|
|
||||||
if (len > 12 * sizeof(char)
|
if (len > sizeof("NSFramework_")
|
||||||
&& !strncmp("NSFramework_", class->name, 12))
|
&& !strncmp("NSFramework_", class->name, 12))
|
||||||
{
|
{
|
||||||
classes[numClasses++] = class;
|
[self _addFrameworkFromClass: class];
|
||||||
}
|
|
||||||
if (numClasses == numBufClasses)
|
|
||||||
{
|
|
||||||
Class *ptr;
|
|
||||||
|
|
||||||
numBufClasses += 10;
|
|
||||||
ptr = objc_realloc(classes, sizeof(Class) * numBufClasses);
|
|
||||||
|
|
||||||
if (!ptr)
|
|
||||||
break;
|
|
||||||
|
|
||||||
classes = ptr;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < numClasses; i++)
|
|
||||||
{
|
|
||||||
[self _addFrameworkFromClass: classes[i]];
|
|
||||||
}
|
|
||||||
objc_free(classes);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if 0
|
#if 0
|
||||||
|
|
Loading…
Reference in a new issue