mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
more static analyser fixups
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@36532 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
be54d9fa01
commit
f418b79b35
8 changed files with 50 additions and 46 deletions
|
@ -2044,8 +2044,6 @@ static NSStringEncoding defaultEncoding;
|
|||
{
|
||||
NSDirectoryEnumerator *direnum;
|
||||
NSMutableArray *content;
|
||||
IMP nxtImp;
|
||||
IMP addImp;
|
||||
BOOL is_dir;
|
||||
|
||||
/*
|
||||
|
@ -2055,6 +2053,7 @@ static NSStringEncoding defaultEncoding;
|
|||
{
|
||||
return nil;
|
||||
}
|
||||
content = [NSMutableArray arrayWithCapacity: 128];
|
||||
/* We initialize the directory enumerator with justContents == YES,
|
||||
which tells the NSDirectoryEnumerator code that we only enumerate
|
||||
the contents non-recursively once, and exit. NSDirectoryEnumerator
|
||||
|
@ -2064,17 +2063,20 @@ static NSStringEncoding defaultEncoding;
|
|||
followSymlinks: NO
|
||||
justContents: YES
|
||||
for: self];
|
||||
content = [NSMutableArray arrayWithCapacity: 128];
|
||||
|
||||
nxtImp = [direnum methodForSelector: @selector(nextObject)];
|
||||
addImp = [content methodForSelector: @selector(addObject:)];
|
||||
|
||||
while ((path = (*nxtImp)(direnum, @selector(nextObject))) != nil)
|
||||
if (nil != direnum)
|
||||
{
|
||||
(*addImp)(content, @selector(addObject:), path);
|
||||
}
|
||||
RELEASE(direnum);
|
||||
IMP nxtImp;
|
||||
IMP addImp;
|
||||
|
||||
nxtImp = [direnum methodForSelector: @selector(nextObject)];
|
||||
addImp = [content methodForSelector: @selector(addObject:)];
|
||||
|
||||
while ((path = (*nxtImp)(direnum, @selector(nextObject))) != nil)
|
||||
{
|
||||
(*addImp)(content, @selector(addObject:), path);
|
||||
}
|
||||
RELEASE(direnum);
|
||||
}
|
||||
return [content makeImmutableCopyOnFail: NO];
|
||||
}
|
||||
|
||||
|
@ -2113,30 +2115,31 @@ static NSStringEncoding defaultEncoding;
|
|||
NSDirectoryEnumerator *direnum;
|
||||
NSMutableArray *content;
|
||||
BOOL isDir;
|
||||
IMP nxtImp;
|
||||
IMP addImp;
|
||||
|
||||
if (![self fileExistsAtPath: path isDirectory: &isDir] || !isDir)
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
content = [NSMutableArray arrayWithCapacity: 128];
|
||||
direnum = [[NSDirectoryEnumerator alloc] initWithDirectoryPath: path
|
||||
recurseIntoSubdirectories: YES
|
||||
followSymlinks: NO
|
||||
justContents: NO
|
||||
for: self];
|
||||
content = [NSMutableArray arrayWithCapacity: 128];
|
||||
|
||||
nxtImp = [direnum methodForSelector: @selector(nextObject)];
|
||||
addImp = [content methodForSelector: @selector(addObject:)];
|
||||
|
||||
while ((path = (*nxtImp)(direnum, @selector(nextObject))) != nil)
|
||||
if (nil != direnum)
|
||||
{
|
||||
(*addImp)(content, @selector(addObject:), path);
|
||||
IMP nxtImp;
|
||||
IMP addImp;
|
||||
|
||||
nxtImp = [direnum methodForSelector: @selector(nextObject)];
|
||||
addImp = [content methodForSelector: @selector(addObject:)];
|
||||
|
||||
while ((path = (*nxtImp)(direnum, @selector(nextObject))) != nil)
|
||||
{
|
||||
(*addImp)(content, @selector(addObject:), path);
|
||||
}
|
||||
RELEASE(direnum);
|
||||
}
|
||||
|
||||
RELEASE(direnum);
|
||||
|
||||
return [content makeImmutableCopyOnFail: NO];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue