Declare module private things static.

More fixing string encodings


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/branches/mswin-ng@23902 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Sheldon Gill 2006-10-18 05:14:04 +00:00
parent 58e065b674
commit 8b1ef1ab48
17 changed files with 143 additions and 111 deletions

109
ChangeLog
View file

@ -1,68 +1,87 @@
2006-10-18 Sheldon Gill <sheldon@westnet.net.au>
* Source/NSSocketPortNameServer.m
* Source/NSTimeZone.m
* Source/NSProcessInfo.m
* Source/NSSocketPort.m
* Source/NSKeyedArchiver.m
* Source/NSDebug.m
* Source/NSPort.m
* Source/NSMessagePort.m
* Source/win32/NSMessagePortWin32.m
* Source/NSInvocation.m
* Source/NSFileManager.m
* Source/objc-load.m
* Source/NSHTTPCookieStorage.m
* Source/NSException.m
* Source/Additions/Unicode.m
* Source/Additions/GSCompatibility.m
* Source/NSHost.m
* Source/NSObjCRuntime.m
* Headers/Foundation/NSException.h:
* Source/GSFFCallInvocation.m:
* Source/GSFFIInvocation.m:
* Source/NSBundle.m:
* Source/NSDecimal.m:
* Source/win32/GSRunLoopCtx.m:
Make private declarations static
* Source/GSHTTPURLHandle.m:
* Source/GSLocale.m:
* Source/NSBundle.m:
* Source/NSCalendarDate.m:
Fixing c-strings so that they use specific encodings
* Source/GSFormat.m:
Fix bug when printing strerror
2006-10-18 Sheldon Gill <sheldon@westnet.net.au>
* Source/NSSocketPortNameServer.m:
* Source/NSTimeZone.m:
* Source/NSProcessInfo.m:
* Source/NSSocketPort.m:
* Source/NSKeyedArchiver.m:
* Source/NSDebug.m:
* Source/NSPort.m:
* Source/NSMessagePort.m:
* Source/win32/NSMessagePortWin32.m:
* Source/NSInvocation.m:
* Source/NSFileManager.m:
* Source/objc-load.m:
* Source/NSHTTPCookieStorage.m:
* Source/NSException.m:
* Source/Additions/Unicode.m:
* Source/Additions/GSCompatibility.m:
* Source/NSHost.m:
* Source/NSObjCRuntime.m:
Fixing c-strings so that they use specific encodings
2006-10-03 Sheldon Gill <sheldon@westnet.net.au>
* Source\GSFileHandle.m
* Source\GSFormat.m
* Source\GSFTPURLHandle.m
* Source\GSHTTPURLHandle.m
* Source\GSStream.m
* Source\NSData.m
* Source\NSDistributedLock.m
* Source\NSFileManager.m
* Source\NSMessagePort.m
* Source\NSPipe.m
* Source\NSSocketPort.m
* Source\NSTask.m
* Source\NSThread.m
* Source\GSFileHandle.m:
* Source\GSFormat.m:
* Source\GSFTPURLHandle.m:
* Source\GSHTTPURLHandle.m:
* Source\GSStream.m:
* Source\NSData.m:
* Source\NSDistributedLock.m:
* Source\NSFileManager.m:
* Source\NSMessagePort.m:
* Source\NSPipe.m:
* Source\NSSocketPort.m:
* Source\NSTask.m:
* Source\NSThread.m:
* Source\win32\GSFileHandleWin32.m
* Source\win32\GSRunLoopCtxt.m
* Source\win32\NSMessagePortNameServerWin32.m
* Source\win32\NSMessagePortWin32.m
* Source\win32\NSStreamWin32.m
* Source\win32\GSFileHandleWin32.m:
* Source\win32\GSRunLoopCtxt.m:
* Source\win32\NSMessagePortNameServerWin32.m:
* Source\win32\NSMessagePortWin32.m:
* Source\win32\NSStreamWin32.m:
* Headers/Additions/GNUstepBase/GSObjCRuntime.h
* Headers/Additions/GNUstepBase/GSFunctions.h
* Additions\GSCompatibility.
* Additions\GSObjCRuntime.m
* Additions\GSFunctions.m
* Headers/Additions/GNUstepBase/GSObjCRuntime.h:
* Headers/Additions/GNUstepBase/GSFunctions.h:
* Additions\GSCompatibility.m:
* Additions\GSObjCRuntime.m:
* Additions\GSFunctions.m:
Moved GSPrintf() and GSLastErrorStr() to GSFunctions
Altered GSLastErrorStr(long) to GSLastError(void)
Fixed bug preventing GSLastErrorStr() returning net errors
* Headers/Additions/GNUstepBase/Win32_Utilities.h
* Headers/Additions/GNUstepBase/Win32_Utilities.h:
* Source/win32/Win32_Utilities.m:
Clean up and rationalise a little
2006-10-03 Sheldon Gill <sheldon@westnet.net.au>
* Source/NSLog.m
* Source/NSLog.m:
Better output on Win32. Cleaner module.
2006-09-20 Sheldon Gill <sheldon@westnet.net.au>
* Headers/Foundation/NSProcessInfo.h
* Headers/Foundation/NSProcessInfo.h:
* Source/NSProcessInfo.m:
Add operatingSystemVersionString
Change return of operatingSystem to be more useful
@ -81,7 +100,7 @@
Revert change making processes launch detached
* Source/NSString.m:
Corrected deprecation of -[cString]
* Headers/Foundation/NSString.h
* Headers/Foundation/NSString.h:
Re-added -[unicharString] as its useful and needed
2006-09-17 Sheldon Gill <sheldon@westnet.net.au>

View file

@ -335,7 +335,7 @@ GS_EXPORT void _NSRemoveHandler( NSHandler *handler );
[[NSAssertionHandler currentHandler] \
handleFailureInMethod: _cmd \
object: self \
file: [NSString stringWithCString: __FILE__] \
file: [NSString stringWithUTF8String: __FILE__] \
lineNumber: __LINE__ \
description: (desc) , ## args]; \
} \
@ -345,8 +345,8 @@ GS_EXPORT void _NSRemoveHandler( NSHandler *handler );
do { \
if (!(condition)) { \
[[NSAssertionHandler currentHandler] \
handleFailureInFunction: [NSString stringWithCString: __PRETTY_FUNCTION__] \
file: [NSString stringWithCString: __FILE__] \
handleFailureInFunction: [NSString stringWithUTF8String: __PRETTY_FUNCTION__] \
file: [NSString stringWithUTF8String: __FILE__] \
lineNumber: __LINE__ \
description: (desc) , ## args]; \
} \

View file

@ -285,7 +285,7 @@ enum {
- (NSString*) uppercaseString;
// Getting C Strings
- (const char*) cString;
- (const char*) cString; // DEPRECATED!! -SG
#ifndef STRICT_OPENSTEP
#if OS_API_VERSION(100400,GS_API_LATEST) && GS_API_VERSION(010200,GS_API_LATEST)
@ -591,9 +591,9 @@ enum {
- (id) initWithContentsOfURL: (NSURL*)url;
- (NSString*) substringWithRange: (NSRange)aRange;
- (NSComparisonResult) caseInsensitiveCompare: (NSString*)aString;
- (NSComparisonResult) compare: (NSString*)string
options: (unsigned int)mask
range: (NSRange)compareRange
- (NSComparisonResult) compare: (NSString*)string
options: (unsigned int)mask
range: (NSRange)compareRange
locale: (NSDictionary*)dict;
- (NSComparisonResult) localizedCompare: (NSString *)string;
- (NSComparisonResult) localizedCaseInsensitiveCompare: (NSString *)string;

View file

@ -141,7 +141,7 @@ static objc_mutex_t ff_callback_map_lock = NULL;
static vacallReturnTypeInfo returnTypeInfo [STATIC_CALLBACK_LIST_SIZE];
/* Function that implements the actual forwarding */
void
static void
GSInvocationCallback(void *callback_data, va_alist args);
/*
@ -168,7 +168,7 @@ gs_offset(const char *type, int index)
/* Determines if the structure type can be returned entirely in registers.
See the avcall or vacall man pages for more info. FIXME: I'm betting
this won't work if a structure contains another structure */
int
static int
gs_splittable (const char *type)
{
int i, numtypes;
@ -297,7 +297,7 @@ gs_find_by_receiver_best_typed_sel (id receiver, SEL sel)
Only passes the first part. Is used for determining
the return type for the vacall macros.
*/
void
static void
gs_sel_type_to_callback_type (const char *sel_type,
vacallReturnTypeInfo *vatype)
{
@ -771,7 +771,7 @@ gs_protocol_selector(const char *types)
* information.
*/
void
static void
GSInvocationCallback (void *callback_data, va_alist args)
{
id obj;

View file

@ -18,7 +18,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
*/
#include "Foundation/NSException.h"
#include "Foundation/NSCoder.h"
@ -44,7 +45,7 @@ typedef void (*ffi_closure_fun) (ffi_cif*,void*,void**,void*);
typedef void (*f_fun) ();
void GSFFIInvocationCallback(ffi_cif*, void*, void **, void*);
static void GSFFIInvocationCallback(ffi_cif*, void*, void **, void*);
/*
* If we are using the GNU ObjC runtime we could
@ -407,7 +408,7 @@ gs_protocol_selector(const char *types)
return NO;
}
void
static void
GSFFIInvocationCallback(ffi_cif *cif, void *retp, void **args, void *user)
{
id obj;

View file

@ -18,7 +18,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
*/
#include "config.h"

View file

@ -220,10 +220,10 @@ enum
/* Digits. */
/* Lower-case digits. */
const char _itowa_lower_digits[36]
static const char _itowa_lower_digits[36]
= "0123456789abcdefghijklmnopqrstuvwxyz";
/* Upper-case digits. */
const char _itowa_upper_digits[36]
static const char _itowa_upper_digits[36]
= "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
@ -1692,9 +1692,8 @@ NSDictionary *locale)
LABEL (form_strerror):
/* Print description of error ERRNO. */
string =
(unichar *) GSErrorString(save_errno);
is_long = 0; /* This is no wide-char string. */
string = (unichar *)[GSErrorString(save_errno) cStringUsingEncoding: NSUnicodeStringEncoding];
is_long = 1; /* This is wide-char string. */
goto LABEL (print_string);
LABEL (form_character):
/* Character. */
@ -1759,7 +1758,7 @@ NSDictionary *locale)
if (enc == GSUndefinedEncoding)
{
enc = GetDefEncoding();
enc = [NSString defaultCStringEncoding];
byteEncoding = GSIsByteEncoding(enc);
}

View file

@ -83,7 +83,7 @@ typedef void (*NSMT_retain_func_t)(NSMapTable *, const void *);
typedef void (*NSMT_release_func_t)(NSMapTable *, void *);
typedef NSString *(*NSMT_describe_func_t)(NSMapTable *, const void *);
const NSMapTableKeyCallBacks writeKeyCallBacks =
static const NSMapTableKeyCallBacks writeKeyCallBacks =
{
(NSMT_hash_func_t) _non_retained_id_hash,
(NSMT_is_equal_func_t) _non_retained_id_is_equal,

View file

@ -19,7 +19,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
*/
#include "config.h"
#include "GNUstepBase/GSLocale.h"
@ -75,12 +76,12 @@ GSSetLocale(int category, NSString *locale)
locale = nil;
if (clocale != 0)
{
locale = [NSString stringWithCString: clocale];
locale = [NSString stringWithUTF8String: clocale];
}
return locale;
}
#define GSLanginfo(value) [NSString stringWithCString: nl_langinfo (value)]
#define GSLanginfo(value) [NSString stringWithUTF8String: nl_langinfo (value)]
/* Creates a locale dictionary from information provided by i18n functions.
Many, but not all, of the keys are filled in or inferred from the
@ -154,33 +155,33 @@ GSDomainFromDefaultLocale(void)
/* Currency Information */
if (lconv->currency_symbol)
{
[dict setObject: [NSString stringWithCString: lconv->currency_symbol]
[dict setObject: [NSString stringWithUTF8String: lconv->currency_symbol]
forKey: NSCurrencySymbol];
}
if (lconv->int_curr_symbol)
{
[dict setObject: [NSString stringWithCString: lconv->int_curr_symbol]
[dict setObject: [NSString stringWithUTF8String: lconv->int_curr_symbol]
forKey: NSInternationalCurrencyString];
}
if (lconv->mon_decimal_point)
{
[dict setObject: [NSString stringWithCString: lconv->mon_decimal_point]
[dict setObject: [NSString stringWithUTF8String: lconv->mon_decimal_point]
forKey: NSInternationalCurrencyString];
}
if (lconv->mon_thousands_sep)
{
[dict setObject: [NSString stringWithCString: lconv->mon_thousands_sep]
[dict setObject: [NSString stringWithUTF8String: lconv->mon_thousands_sep]
forKey: NSInternationalCurrencyString];
}
if (lconv->decimal_point)
{
[dict setObject: [NSString stringWithCString: lconv->decimal_point]
[dict setObject: [NSString stringWithUTF8String: lconv->decimal_point]
forKey: NSDecimalSeparator];
}
if (lconv->thousands_sep)
{
[dict setObject: [NSString stringWithCString: lconv->thousands_sep]
[dict setObject: [NSString stringWithUTF8String: lconv->thousands_sep]
forKey: NSThousandsSeparator];
}

View file

@ -226,7 +226,7 @@ static NSString *ExecutablePath()
#ifdef PROCFS_EXE_LINK
executablePath = [[NSFileManager defaultManager]
pathContentOfSymbolicLinkAtPath:
[NSString stringWithCString: PROCFS_EXE_LINK]];
[NSString stringWithUTF8String: PROCFS_EXE_LINK]];
/*
On some systems, the link is of the form "[device]:inode", which
@ -464,8 +464,9 @@ _find_framework(NSString *name)
&& !strncmp ("NSFramework_", frameworkClass->name, 12))
{
/* The name of the framework. */
NSString *name = [NSString stringWithCString: &frameworkClass->name[12]];
NSString *name;
name = [NSString stringWithUTF8String: &frameworkClass->name[12]];
/* Important - gnustep-make mangles framework names to encode
* them as ObjC class names. Here we need to demangle them. We
* apply the reverse transformations in the reverse order.
@ -669,7 +670,7 @@ typedef struct {
@defs(NSBundle)
} *bptr;
void
static void
_bundle_load_callback(Class theClass, struct objc_category *theCategory)
{
NSCAssert(_loadingBundle, NSInternalInconsistencyException);

View file

@ -1064,7 +1064,7 @@ static inline int getDigits(const char *from, char *to, int limit)
NSString *currAMPM;
NSArray *amPMNames;
currAMPM = [NSString stringWithCString: tmpStr];
currAMPM = [NSString stringWithUTF8String: tmpStr];
amPMNames = [locale objectForKey: NSAMPMDesignation];
/*
@ -1170,7 +1170,7 @@ static inline int getDigits(const char *from, char *to, int limit)
tmpStr[tmpIdx - sourceIdx] = '\0';
sourceIdx += tmpIdx - sourceIdx;
{
NSString *z = [NSString stringWithCString: tmpStr];
NSString *z = [NSString stringWithUTF8String: tmpStr];
/* Abbreviations aren't one-to-one with time zone names
so just look for the zone named after the abbreviation,

View file

@ -187,8 +187,7 @@ readContentsOfFile(NSString* path, void** buf, unsigned int* len, NSZone* zone)
fileLength = ftell(theFile);
if (fileLength == -1)
{
NSWarnFLog(@"Ftell on %@ failed - %@", path,
GSLastError());
NSWarnFLog(@"Ftell on %@ failed - %@", path, GSLastError());
goto failure;
}
@ -1040,9 +1039,10 @@ failure:
{
#if defined(__MINGW32__)
NSWarnMLog(@"Rename ('%@' to '%@') failed - %@",
[NSString stringWithCharacters: wthePath length:wcslen(wthePath)],
[NSString stringWithCharacters:
wtheRealPath length:wcslen(wtheRealPath)],
[NSString stringWithCharacters: wthePath
length:wcslen(wthePath)],
[NSString stringWithCharacters: wtheRealPath
length:wcslen(wtheRealPath)],
GSLastError());
#else
NSWarnMLog(@"Rename ('%s' to '%s') failed - %@",
@ -3696,8 +3696,6 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
- (id) initWithCapacity: (unsigned int)bufferSize
{
int e;
shmid = shmget(IPC_PRIVATE, bufferSize, IPC_CREAT|VM_ACCESS);
if (shmid == -1) /* Created memory? */
{
@ -3709,7 +3707,6 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
}
bytes = shmat(shmid, 0, 0);
e = errno;
if (bytes == (void*)-1)
{
NSLog(@"[NSMutableDataShared -initWithCapacity:] shared memory "

View file

@ -18,7 +18,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
<title>NSDateFormatter class reference</title>
$Date$ $Revision$

View file

@ -19,7 +19,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
<title>NSDecimal class reference</title>
$Date$ $Revision$
@ -236,7 +237,7 @@ GSDecimalCompare(const GSDecimal *leftOperand, const GSDecimal *rightOperand)
static NSComparisonResult
NSSimpleCompare(const NSDecimal *leftOperand, const NSDecimal *rightOperand);
void
static void
GSDecimalRound(GSDecimal *result, int scale, NSRoundingMode mode)
{
int i;
@ -332,7 +333,7 @@ GSDecimalRound(GSDecimal *result, int scale, NSRoundingMode mode)
GSDecimalCompact(result);
}
NSCalculationError
static NSCalculationError
GSDecimalNormalize(GSDecimal *n1, GSDecimal *n2, NSRoundingMode mode)
{
// Both are valid numbers and the exponents are not equal
@ -673,7 +674,7 @@ NSDecimalMultiply(NSDecimal *result, const NSDecimal *l, const NSDecimal *r,
return error;
}
NSCalculationError
static NSCalculationError
GSSimpleDivide(NSDecimal *result, const NSDecimal *l, const NSDecimal *r,
NSRoundingMode mode);
@ -796,7 +797,7 @@ NSDecimalMultiplyByPowerOf10(NSDecimal *result, const NSDecimal *n, short power,
return NSCalculationNoError;
}
NSString*
static NSString*
GSDecimalString(const GSDecimal *number, NSDictionary *locale)
{
int i;
@ -902,7 +903,7 @@ NSDecimalMin(NSDecimal *result)
}
// Give back the value of a NSDecimal as a double
double
static double
GSDecimalDouble(GSDecimal *number)
{
double d = 0.0;
@ -931,7 +932,7 @@ GSDecimalDouble(GSDecimal *number)
// Create a NSDecimal with a cMantissa, exponent and a negative flag
void
static void
GSDecimalFromComponents(GSDecimal *result, unsigned long long mantissa,
short exponent, BOOL negative)
{
@ -963,7 +964,7 @@ GSDecimalFromComponents(GSDecimal *result, unsigned long long mantissa,
}
// Create a NSDecimal from a string using the local
void
static void
GSDecimalFromString(GSDecimal *result, NSString *numberValue,
NSDictionary *locale)
{
@ -1157,7 +1158,7 @@ NSDecimalNormalize(NSDecimal *n1, NSDecimal *n2, NSRoundingMode mode)
*/
}
NSCalculationError
static NSCalculationError
GSSimpleAdd(NSDecimal *result, const NSDecimal *left, const NSDecimal *right,
NSRoundingMode mode)
{
@ -1235,7 +1236,7 @@ GSSimpleMultiply(NSDecimal *result, NSDecimal *left, NSDecimal *right, NSRoundin
return error;
}
NSCalculationError
static NSCalculationError
GSSimpleDivide(NSDecimal *result, const NSDecimal *left, const NSDecimal *right,
NSRoundingMode mode)
{
@ -1535,7 +1536,7 @@ GSSimpleMultiply(NSDecimal *result, NSDecimal *l, NSDecimal *r, NSRoundingMode m
return error;
}
NSCalculationError
static NSCalculationError
GSSimpleDivide(NSDecimal *result, const NSDecimal *l, const NSDecimal *r,
NSRoundingMode mode)
{

View file

@ -18,7 +18,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
$Date$ $Revision$
*/

View file

@ -18,7 +18,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
*/
#include "config.h"

View file

@ -21,10 +21,10 @@
extern BOOL GSCheckTasks();
#if GS_WITH_GC == 0
SEL wRelSel;
SEL wRetSel;
IMP wRelImp;
IMP wRetImp;
static SEL wRelSel;
static SEL wRetSel;
static IMP wRelImp;
static IMP wRetImp;
static void
wRelease(NSMapTable* t, void* w)
@ -49,6 +49,17 @@ static const NSMapTableValueCallBacks WatcherMapValueCallBacks =
#endif
@implementation GSRunLoopCtxt
+ (void) initialize
{
#if GS_WITH_GC == 0
wRelSel = @selector(release);
wRetSel = @selector(retain);
wRelImp = [[GSRunLoopWatcher class] instanceMethodForSelector: wRelSel];
wRetImp = [[GSRunLoopWatcher class] instanceMethodForSelector: wRetSel];
#endif
}
- (void) dealloc
{
RELEASE(mode);
@ -426,8 +437,7 @@ static const NSMapTableValueCallBacks WatcherMapValueCallBacks =
BOOL found = NO;
NSDebugMLLog(@"NSRunLoop", @"WaitForMultipleObjects() error in "
@"-acceptInputForMode:beforeDate: %@",
GSLastError());
@"-acceptInputForMode:beforeDate: %@", GSLastError());
/*
* Check each handle in turn until either we find one which has an
* event signalled, or we find the one which caused the original
@ -448,8 +458,7 @@ static const NSMapTableValueCallBacks WatcherMapValueCallBacks =
if (found == NO)
{
NSLog(@"WaitForMultipleObjects() error in "
@"-acceptInputForMode:beforeDate: %@",
GSLastError());
@"-acceptInputForMode:beforeDate: %@", GSLastError());
abort ();
}
}