Minor tidyup

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@8120 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
richard 2000-11-15 11:40:00 +00:00
parent 3f338dcbe2
commit 5a65c79ae3
3 changed files with 55 additions and 31 deletions

View file

@ -1,3 +1,8 @@
2000-11-15 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSBundle.m: Minor tidying to avoid compiler warnings.
* Source/NSFileManager.m: ditto
Tue Nov 14 23:44:14 2000 Adam Fedor <fedor@yogi.doc.com>
* Source/GSString.m: Add limits.h (for Solaris)

View file

@ -316,27 +316,35 @@ static NSBundle *lastFrameworkBundle = nil;
void
_bundle_load_callback(Class theClass, Category *theCategory)
{
NSBundle *bundle = nil;
NSString *className;
NSString *path, *bundlePath = nil, *lastComponent;
NSString *libName, *frameworkVersion = nil;
BOOL isFramework = NO;
NSBundle *bundle = nil;
NSString *className;
#if LINKER_GETSYMBOL
NSString *path;
NSString *bundlePath = nil;
NSString *lastComponent;
NSString *libName;
NSString *frameworkVersion = nil;
BOOL isFramework = NO;
#endif
NSCAssert(_loadingBundle, NSInternalInconsistencyException);
if (theClass)
className = NSStringFromClass(theClass);
if (theClass != 0)
{
className = NSStringFromClass(theClass);
}
else
className = [NSString stringWithCString: theCategory->class_name];
{
className = [NSString stringWithCString: theCategory->class_name];
}
#if !LINKER_GETSYMBOL
if ([NSBundle _addFrameworkFromClass: theClass] == YES)
return;
#else
#if LINKER_GETSYMBOL
path = objc_get_symbol_path(theClass, theCategory);
if (lastSymbolPath && [lastSymbolPath isEqual: path] == YES)
isFramework = YES;
{
isFramework = YES;
}
else
{
NSString *s;
@ -378,10 +386,14 @@ _bundle_load_callback(Class theClass, Category *theCategory)
if (len > 3)
{
for (i = 3; i < len; i++)
if (cString[i] == '.')
break;
{
if (cString[i] == '.')
{
break;
}
}
if (i-3)
if (i > 3)
{
NSString *name;
@ -424,28 +436,29 @@ _bundle_load_callback(Class theClass, Category *theCategory)
if (isFramework == YES)
{
if (_bundles)
bundle = (NSBundle *)NSMapGet(_bundles, bundlePath);
if (!bundle && _releasedBundles)
if (_bundles != nil)
{
bundle = (NSBundle *)NSMapGet(_bundles, bundlePath);
}
if (bundle != nil && _releasedBundles != 0)
{
bundle = (NSBundle *)NSMapGet(_releasedBundles, bundlePath);
if (bundle)
if (bundle != nil)
{
NSMapInsert(_bundles, bundlePath, bundle);
NSMapRemove(_releasedBundles, bundlePath);
}
}
if (!bundle)
if (bundle != nil)
{
bundle = [NSBundle bundleWithPath: bundlePath];
bundle->_bundleType = NSBUNDLE_FRAMEWORK;
bundle->_codeLoaded = YES;
bundle->_frameworkVersion = RETAIN(frameworkVersion);
bundle->_bundleClasses = RETAIN([NSMutableArray
arrayWithCapacity: 2]);
bundle->_bundleClasses
= RETAIN([NSMutableArray arrayWithCapacity: 2]);
}
ASSIGN(lastFrameworkBundle, bundle);
@ -456,24 +469,31 @@ _bundle_load_callback(Class theClass, Category *theCategory)
{
bundle = lastFrameworkBundle;
if (lastFrameworkName)
if (lastFrameworkName != nil)
{
if ([className isEqual: lastFrameworkName] == YES)
{
bundle->_frameworkVersion = RETAIN([theClass frameworkVersion]);
DESTROY(lastFrameworkName);
}
}
}
else
{
bundle = _loadingBundle;
}
#else
if ([NSBundle _addFrameworkFromClass: theClass] == YES)
return;
bundle = _loadingBundle;
#endif
bundle = _loadingBundle;
/* Don't store categories */
if (!theCategory)
[(NSMutableArray *)[bundle _bundleClasses] addObject: [NSValue
valueWithNonretainedObject: (id)theClass]];
if (theCategory == 0)
{
[(NSMutableArray *)[bundle _bundleClasses] addObject:
[NSValue valueWithNonretainedObject: (id)theClass]];
}
}

View file

@ -1129,7 +1129,6 @@ static NSFileManager* defaultManager = nil;
NSMutableArray *content;
IMP nxtImp;
IMP addImp;
NSDictionary *attr;
BOOL is_dir;
/*