simplification, including use of strtoull() everywhere

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35503 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2012-09-03 13:36:45 +00:00
parent a553252cc9
commit 0623c0c0c2
33 changed files with 41 additions and 66 deletions

View file

@ -1,3 +1,40 @@
2012-09-03 Richard Frith-Macdonald <rfm@gnu.org>
* Source\NSTimeZone.m:
* Source\NSBundle.m:
* Source\NSPropertyList.m:
* Source\NSProcessInfo.m:
* Source\NSSocketPort.m:
* Source\NSRunLoop.m:
* Source\NSMessagePortNameServer.m:
* Source\NSDistributedLock.m:
* Source\GSHTTPURLHandle.m:
* Source\NSZone.m:
* Source\NSPage.m:
* Source\NSMessagePort.m:
* Source\NSUnarchiver.m:
* Source\win32\GSFileHandle.m:
* Source\NSFileManager.m:
* Source\common.h:
* Source\NSString.m:
* Source\Additions\NSData+GNUstepBase.m:
* Source\Additions\Unicode.m:
* Source\Additions\NSMutableString+GNUstepBase.m:
* Source\Additions\NSError+GNUstepBase.m:
* Source\Additions\GSMime.m:
* Source\Additions\NSString+GNUstepBase.m:
* Source\Additions\GCArray.m:
* Source\Additions\GSXML.m:
* Source\Additions\NSNumber+GNUstepBase.m:
* Source\Additions\GSObjCRuntime.m:
* Source\GSString.m:
* Source\NSObjCRuntime.m:
* Source\GSFormat.m:
* Source\GSFileHandle.m:
* Source\NSTask.m:
On windows with mingw we can use strtoull() rather than _strtoui64().
Also, remove redundant header includes since string.h is in common.h
2012-09-03 Niels Grewe <niels.grewe@halbordnung.de>
* configure.ac: Fallback to the non icu-config check for ICU in

View file

@ -25,7 +25,6 @@
*/
#import "common.h"
#include <string.h>
#ifndef NeXT_Foundation_LIBRARY
#import "Foundation/NSException.h"
#import "Foundation/NSRange.h"

View file

@ -82,7 +82,6 @@
int cState
#include <string.h>
#include <ctype.h>
#import "Foundation/NSArray.h"

View file

@ -51,7 +51,6 @@
#include <objc/Protocol.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#ifndef NeXT_RUNTIME

View file

@ -46,7 +46,6 @@
#ifndef _XOPEN_SOURCE
#define _XOPEN_SOURCE 600
#endif
#include <string.h>
#include <stdio.h>

View file

@ -29,7 +29,6 @@
#import "GNUstepBase/NSData+GNUstepBase.h"
#import "GNUstepBase/NSString+GNUstepBase.h"
#include <string.h>
#include <ctype.h>
/**

View file

@ -37,11 +37,9 @@
#else
#define _XOPEN_SOURCE 600
#endif
#include <string.h>
#import "common.h"
#include <errno.h>
#include <stdio.h>
#import "Foundation/NSDictionary.h"

View file

@ -23,7 +23,6 @@
*/
#import "common.h"
#include <string.h>
#include <ctype.h>
#import "Foundation/NSException.h"

View file

@ -24,7 +24,6 @@
*/
#import "common.h"
#include <string.h>
#include <ctype.h>
#import "GNUstepBase/NSNumber+GNUstepBase.h"

View file

@ -23,7 +23,6 @@
*/
#import "common.h"
#include <string.h>
#include <ctype.h>
#import "Foundation/NSException.h"
#import "GNUstepBase/NSString+GNUstepBase.h"

View file

@ -47,7 +47,6 @@
#import "../GSPrivate.h"
#include <stdio.h>
#include <string.h>
#if HAVE_LANGINFO_CODESET
#include <langinfo.h>

View file

@ -72,8 +72,6 @@
#endif
#include <netdb.h>
#include <string.h>
/*
* Stuff for setting the sockets into non-blocking mode.
*/

View file

@ -58,7 +58,6 @@
#endif
#include <stdio.h>
#include <string.h>
#import "Foundation/NSArray.h"
#import "Foundation/NSCharacterSet.h"

View file

@ -49,8 +49,6 @@
#import "GSURLPrivate.h"
#import "GSPrivate.h"
#include <string.h>
#ifdef HAVE_SYS_FILE_H
# include <sys/file.h>
#endif

View file

@ -49,12 +49,11 @@
#import "GSPrivate.h"
#ifdef HAVE_MALLOC_H
#if defined(__OpenBSD__)
#include <stdlib.h>
#else
#if !defined(__OpenBSD__)
#include <malloc.h>
#endif
#endif
#ifdef HAVE_ALLOCA_H
#include <alloca.h>
#endif

View file

@ -61,8 +61,6 @@ NSString * const NSBundleDidLoadNotification = @"NSBundleDidLoadNotification";
NSString * const NSShowNonLocalizedStrings = @"NSShowNonLocalizedStrings";
NSString * const NSLoadedClasses = @"NSLoadedClasses";
#include <string.h>
static NSFileManager *
manager()
{

View file

@ -26,7 +26,6 @@
*/
#import "common.h"
#include <string.h>
#define EXPOSE_NSDistributedLock_IVARS 1
#import "Foundation/NSDistributedLock.h"
#import "Foundation/NSFileManager.h"

View file

@ -63,7 +63,6 @@
#import "GNUstepBase/NSObject+GNUstepBase.h"
#import "GNUstepBase/NSString+GNUstepBase.h"
#include <string.h>
#include <stdio.h>
/* determine directory reading files */

View file

@ -54,7 +54,6 @@
#include <sys/types.h>
#include <sys/un.h>
#include <arpa/inet.h> /* for inet_ntoa() */
#include <string.h> /* for strchr() */
#include <ctype.h> /* for strchr() */
#if defined(HAVE_SYS_FCNTL_H)

View file

@ -54,7 +54,6 @@
# include <fcntl.h>
#endif
#include <string.h>
#include <sys/un.h>
/* Older systems (Solaris) compatibility */

View file

@ -32,7 +32,6 @@
#endif
#import "Foundation/NSException.h"
#include <string.h>
/**
* Returns a string object containing the name for

View file

@ -26,7 +26,6 @@
*/
#import "common.h"
#include <string.h>
#include <stdio.h>
#if __mach__
#include <mach.h>

View file

@ -57,16 +57,11 @@
#import "common.h"
#include <stdio.h>
#include <string.h>
#ifdef HAVE_WINDOWS_H
# include <windows.h>
#endif
#ifdef HAVE_STRERROR
# include <errno.h>
#endif
#if defined(HAVE_SYS_SIGNAL_H)
# include <sys/signal.h>
#elif defined(HAVE_SIGNAL_H)

View file

@ -24,7 +24,6 @@
*/
#import "common.h"
#include <string.h>
#import "GNUstepBase/GSMime.h"
#import "Foundation/NSArray.h"
@ -1147,13 +1146,8 @@ static id parsePlItem(pldata* pld)
}
else
{
#if defined(__MINGW__)
result = [[NSNumber alloc]
initWithUnsignedLongLong: _strtoui64(buf, 0, 10)];
#else
result = [[NSNumber alloc]
initWithUnsignedLongLong: strtoull(buf, 0, 10)];
#endif
}
}
else if (type == 'B')

View file

@ -61,7 +61,6 @@
#endif
#include <math.h>
#include <time.h>
#include <string.h> /* for memset() */
NSString * const NSDefaultRunLoopMode = @"NSDefaultRunLoopMode";

View file

@ -57,7 +57,6 @@
#include <netinet/in.h>
#include <arpa/inet.h> /* for inet_ntoa() */
#endif /* !__MINGW__ */
#include <string.h> /* for strchr() */
#include <ctype.h> /* for strchr() */
#if defined(HAVE_SYS_FCNTL_H)

View file

@ -46,12 +46,6 @@
#define GS_UNSAFE_REGEX 1
#import "common.h"
#include <stdio.h>
#include <string.h>
/* OpenBSD recommends impodring stdlib but not malloc.h for malloc */
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
#endif
#import "Foundation/NSAutoreleasePool.h"
#import "Foundation/NSCalendarDate.h"
@ -3351,11 +3345,7 @@ static UCollator *GSICUCollatorOpen(NSStringCompareOptions mask, NSLocale *local
{
uint64_t v;
#if defined(__MINGW__)
v = _strtoui64(ptr, 0, 10);
#else
v = strtoul(ptr, 0, 10);
#endif
return (int)v;
}
}
@ -3376,11 +3366,7 @@ static UCollator *GSICUCollatorOpen(NSStringCompareOptions mask, NSLocale *local
{
uint64_t v;
#if defined(__MINGW__)
v = _strtoui64(ptr, 0, 10);
#else
v = strtoull(ptr, 0, 10);
#endif
v = (uint64_t)strtoull(ptr, 0, 10);
return (NSInteger)v;
}
}
@ -3401,11 +3387,7 @@ static UCollator *GSICUCollatorOpen(NSStringCompareOptions mask, NSLocale *local
{
unsigned long long l;
#if defined(__MINGW__)
l = _strtoui64(ptr, 0, 10);
#else
l = strtoull(ptr, 0, 10);
#endif
return (long long)l;
}
}

View file

@ -48,7 +48,6 @@
#import "GNUstepBase/NSObject+GNUstepBase.h"
#import "GSPrivate.h"
#include <string.h>
#include <sys/types.h>
#if defined(__FreeBSD__) || defined(__OpenBSD__)
#include <fcntl.h>

View file

@ -88,7 +88,6 @@
#define EXPOSE_NSTimeZone_IVARS 1
#import "GNUstepBase/GSLock.h"
#include <stdio.h>
#include <string.h>
#include <time.h>
#import "Foundation/NSArray.h"
#import "Foundation/NSCoder.h"

View file

@ -32,7 +32,6 @@
#endif
#define EXPOSE_NSUnarchiver_IVARS 1
#include <string.h>
#import "Foundation/NSDictionary.h"
#import "Foundation/NSException.h"
#import "Foundation/NSByteOrder.h"

View file

@ -88,7 +88,6 @@
#import "common.h"
#include <stddef.h>
#include <string.h>
#import "Foundation/NSException.h"
#import "Foundation/NSLock.h"
#import "GSPrivate.h"

View file

@ -31,7 +31,7 @@
#import "config.h"
#if defined(HAVE_STRING_H)
/* For POSIX strerror_r()
/* For POSIX strerror_r() and others
*/
#include <string.h>
#endif

View file

@ -53,8 +53,6 @@
#include <io.h>
#include <stdio.h>
#include <string.h>
#ifndef O_BINARY
#ifdef _O_BINARY
#define O_BINARY _O_BINARY