mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-18 11:41:06 +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
db81f051db
commit
3d3b1e37fc
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>
|
2007-05-23 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
* Headers/Foundation/NSCompoundPredicate.h: Add some common ivars.
|
* Headers/Foundation/NSCompoundPredicate.h: Add some common ivars.
|
||||||
|
|
|
@ -144,6 +144,78 @@ static vacallReturnTypeInfo returnTypeInfo [STATIC_CALLBACK_LIST_SIZE];
|
||||||
static void
|
static void
|
||||||
GSInvocationCallback(void *callback_data, va_alist args);
|
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
|
* Recursively calculate the offset using the offset of the previous
|
||||||
* sub-type
|
* 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. */
|
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;
|
goto failure;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue