mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Fix logging level for when unable to open file.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@25204 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
42852601c6
commit
f342610121
3 changed files with 78 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
2007-05-29 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSData.m: when unable to open a file, log should be debug
|
||||
level rather than warn level.
|
||||
|
||||
2007-05-23 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Headers/Foundation/NSCompoundPredicate.h: Add some common ivars.
|
||||
|
|
|
@ -144,6 +144,78 @@ static vacallReturnTypeInfo returnTypeInfo [STATIC_CALLBACK_LIST_SIZE];
|
|||
static void
|
||||
GSInvocationCallback(void *callback_data, va_alist args);
|
||||
|
||||
/* Count the number of subtypes in a structure
|
||||
*/
|
||||
static const char *gs_subtypes(const char *type, int *result)
|
||||
{
|
||||
int count = 0;
|
||||
|
||||
if (*type == _C_STRUCT_B)
|
||||
{
|
||||
type++;
|
||||
while (*type != _C_STRUCT_E && *type++ != '='); /* skip "<name>=" */
|
||||
while (*type != '\0' && *type != _C_STRUCT_E)
|
||||
{
|
||||
count++;
|
||||
if (*type == _C_STRUCT_B)
|
||||
{
|
||||
/* count a nested structure as a single type.
|
||||
*/
|
||||
type = gs_subtypes (type, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
type = objc_skip_typespec (type);
|
||||
}
|
||||
}
|
||||
if (*type == _C_STRUCT_E)
|
||||
{
|
||||
type++; /* step past end of struct */
|
||||
}
|
||||
}
|
||||
if (result != 0)
|
||||
{
|
||||
*result = count;
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
/* return the index'th subtype
|
||||
*/
|
||||
static const char *gs_subtype(const char *type, int index)
|
||||
{
|
||||
int count = 0;
|
||||
|
||||
if (*type != _C_STRUCT_B)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
type++;
|
||||
while (*type != _C_STRUCT_E && *type++ != '='); /* skip "<name>=" */
|
||||
while (*type != '\0' && *type != _C_STRUCT_E)
|
||||
{
|
||||
if (count++ == index)
|
||||
{
|
||||
return type;
|
||||
}
|
||||
if (*type == _C_STRUCT_B)
|
||||
{
|
||||
/* count and skip a nested structure as a single type.
|
||||
*/
|
||||
type = gs_subtypes (type, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
type = objc_skip_typespec (type);
|
||||
}
|
||||
}
|
||||
if (*type == _C_STRUCT_E)
|
||||
{
|
||||
type++; /* step past end of struct */
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
/*
|
||||
* Recursively calculate the offset using the offset of the previous
|
||||
* sub-type
|
||||
|
|
|
@ -164,7 +164,7 @@ readContentsOfFile(NSString* path, void** buf, unsigned int* len, NSZone* zone)
|
|||
|
||||
if (theFile == 0) /* We failed to open the file. */
|
||||
{
|
||||
NSWarnFLog(@"Open (%@) attempt failed - %@", path, [NSError _last]);
|
||||
NSDebugFLog(@"Open (%@) attempt failed - %@", path, [NSError _last]);
|
||||
goto failure;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue