From 49a8923876107d7ea60582d3a63e0b132d73c002 Mon Sep 17 00:00:00 2001 From: helge Date: Tue, 4 Jul 2006 00:15:51 +0000 Subject: [PATCH] 64bit fixes git-svn-id: http://svn.opengroupware.org/SOPE/trunk@1300 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- sope-gdl1/GDLAccess/EOObjectUniquer.m | 2 +- sope-gdl1/GDLContentStore/GNUmakefile.preamble | 4 ++++ sope-gdl1/GDLContentStore/fhs.make | 7 ++++++- sope-gdl1/MySQL/GNUmakefile.preamble | 6 ++++++ sope-gdl1/MySQL/MySQL4Channel.m | 6 ++---- sope-gdl1/MySQL/NSString+MySQL4.m | 8 ++++---- sope-gdl1/MySQL/fhs.make | 8 +++++++- sope-gdl1/PostgreSQL/GNUmakefile.preamble | 6 +++++- sope-gdl1/PostgreSQL/fhs.make | 7 ++++++- sope-gdl1/SQLite3/GNUmakefile.preamble | 4 ++++ sope-gdl1/SQLite3/NSString+SQLite.m | 13 ++++++++----- sope-gdl1/SQLite3/SQLiteChannel.m | 5 ++--- sope-gdl1/SQLite3/fhs.make | 7 ++++++- 13 files changed, 61 insertions(+), 22 deletions(-) diff --git a/sope-gdl1/GDLAccess/EOObjectUniquer.m b/sope-gdl1/GDLAccess/EOObjectUniquer.m index 8a4dc0a1..68a16732 100644 --- a/sope-gdl1/GDLAccess/EOObjectUniquer.m +++ b/sope-gdl1/GDLAccess/EOObjectUniquer.m @@ -35,7 +35,7 @@ static unsigned uniquerHash(NSMapTable* table, EOUniquerRecord* rec) { // efficient hash for dictionaries is done in the concrete // dictionaries implementation; dictionaries are allocated // from EOPrimaryKeyDictionary concrete subclasses - return ((unsigned)(rec->entity) >> 4) + + return ((unsigned long)(rec->entity) >> 4L) + ((EOPrimaryKeyDictionary*)(rec->pkey))->fastHash; } diff --git a/sope-gdl1/GDLContentStore/GNUmakefile.preamble b/sope-gdl1/GDLContentStore/GNUmakefile.preamble index 97578001..e1624ee0 100644 --- a/sope-gdl1/GDLContentStore/GNUmakefile.preamble +++ b/sope-gdl1/GDLContentStore/GNUmakefile.preamble @@ -63,7 +63,11 @@ ADDITIONAL_LIB_DIRS += \ $(foreach dir,$(DEP_DIRS),-F$(GNUSTEP_BUILD_DIR)/$(dir)) endif +ifeq ($(findstring _64, $(GNUSTEP_TARGET_CPU)), _64) +SYSTEM_LIB_DIR += -L/usr/local/lib64 -L/usr/lib64 +else SYSTEM_LIB_DIR += -L/usr/local/lib -L/usr/lib +endif # platform specific settings diff --git a/sope-gdl1/GDLContentStore/fhs.make b/sope-gdl1/GDLContentStore/fhs.make index 8e576cd0..c78c575e 100644 --- a/sope-gdl1/GDLContentStore/fhs.make +++ b/sope-gdl1/GDLContentStore/fhs.make @@ -7,9 +7,14 @@ ifneq ($(FHS_INSTALL_ROOT),) FHS_INCLUDE_DIR=$(FHS_INSTALL_ROOT)/include/ -FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib/ FHS_BIN_DIR=$(FHS_INSTALL_ROOT)/bin/ +ifeq ($(findstring _64, $(GNUSTEP_TARGET_CPU)), _64) +SYSTEM_LIB_DIR += -L/usr/local/lib64 +else +SYSTEM_LIB_DIR += -L/usr/local/lib +endif + NONFHS_LIBDIR="$(GNUSTEP_LIBRARIES)/$(GNUSTEP_TARGET_LDIR)/" NONFHS_LIBNAME="$(LIBRARY_NAME)$(LIBRARY_NAME_SUFFIX)$(SHARED_LIBEXT)" NONFHS_BINDIR="$(GNUSTEP_TOOLS)/$(GNUSTEP_TARGET_LDIR)" diff --git a/sope-gdl1/MySQL/GNUmakefile.preamble b/sope-gdl1/MySQL/GNUmakefile.preamble index 29f4a5e8..5b1c29d0 100644 --- a/sope-gdl1/MySQL/GNUmakefile.preamble +++ b/sope-gdl1/MySQL/GNUmakefile.preamble @@ -75,4 +75,10 @@ ADDITIONAL_LIB_DIRS += \ $(foreach dir,$(DEP_DIRS),-F$(GNUSTEP_BUILD_DIR)/$(dir)) endif + +ifeq ($(findstring _64, $(GNUSTEP_TARGET_CPU)), _64) +SYSTEM_LIB_DIR += -L/usr/local/lib64 -L/usr/lib64 +else SYSTEM_LIB_DIR += -L/usr/local/lib -L/usr/lib +endif + diff --git a/sope-gdl1/MySQL/MySQL4Channel.m b/sope-gdl1/MySQL/MySQL4Channel.m index 1d40a120..93bfe8c9 100644 --- a/sope-gdl1/MySQL/MySQL4Channel.m +++ b/sope-gdl1/MySQL/MySQL4Channel.m @@ -197,7 +197,7 @@ static int openConnectionCount = 0; if (isDebuggingEnabled) { NSLog(@"MySQL4 channel 0x%p opened (connection=0x%p,%s)", - (unsigned)self, self->_connection, cDBName); + self, self->_connection, cDBName); } return YES; } @@ -680,9 +680,7 @@ static int openConnectionCount = 0; ms = [NSMutableString stringWithCapacity:64]; [ms appendFormat:@"<%@[0x%p] connection=0x%p", - NSStringFromClass([self class]), - self, - (unsigned)self->_connection]; + NSStringFromClass([self class]), self, self->_connection]; [ms appendString:@">"]; return ms; } diff --git a/sope-gdl1/MySQL/NSString+MySQL4.m b/sope-gdl1/MySQL/NSString+MySQL4.m index e9b9e8ad..e525b5bc 100644 --- a/sope-gdl1/MySQL/NSString+MySQL4.m +++ b/sope-gdl1/MySQL/NSString+MySQL4.m @@ -124,7 +124,7 @@ - (NSString *)_mySQL4StripEndSpaces { NSCharacterSet *spaceSet; NSMutableString *str; - IMP charAtIndex; + unichar (*charAtIndex)(id, SEL, int); NSRange range; if ([self length] == 0) @@ -132,7 +132,8 @@ spaceSet = [NSCharacterSet whitespaceCharacterSet]; str = [NSMutableString stringWithCapacity:[self length]]; - charAtIndex = [self methodForSelector:@selector(characterAtIndex:)]; + charAtIndex = (unichar (*)(id, SEL, int)) + [self methodForSelector:@selector(characterAtIndex:)]; range.length = 0; for (range.location = ([self length] - 1); @@ -140,8 +141,7 @@ range.location++, range.length++) { unichar c; - c = (unichar)(int)charAtIndex(self, @selector(characterAtIndex:), - range.location); + c = charAtIndex(self, @selector(characterAtIndex:), range.location); if (![spaceSet characterIsMember:c]) break; } diff --git a/sope-gdl1/MySQL/fhs.make b/sope-gdl1/MySQL/fhs.make index 6c5bd960..3e054e5f 100644 --- a/sope-gdl1/MySQL/fhs.make +++ b/sope-gdl1/MySQL/fhs.make @@ -4,7 +4,13 @@ ifneq ($(FHS_INSTALL_ROOT),) -FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib/ +ifeq ($(findstring _64, $(GNUSTEP_TARGET_CPU)), _64) +SYSTEM_LIB_DIR += -L/usr/local/lib64 +else +SYSTEM_LIB_DIR += -L/usr/local/lib +endif + + FHS_DB_DIR=$(FHS_LIB_DIR)sope-$(SOPE_MAJOR_VERSION).$(SOPE_MINOR_VERSION)/dbadaptors/ fhs-db-dirs :: diff --git a/sope-gdl1/PostgreSQL/GNUmakefile.preamble b/sope-gdl1/PostgreSQL/GNUmakefile.preamble index 220b5d4c..2a84eb78 100644 --- a/sope-gdl1/PostgreSQL/GNUmakefile.preamble +++ b/sope-gdl1/PostgreSQL/GNUmakefile.preamble @@ -80,8 +80,12 @@ ADDITIONAL_LIB_DIRS += \ $(foreach dir,$(DEP_DIRS),-F$(GNUSTEP_BUILD_DIR)/$(dir)) endif -SYSTEM_LIB_DIR += -L/usr/local/lib -L/usr/lib +ifeq ($(findstring _64, $(GNUSTEP_TARGET_CPU)), _64) +SYSTEM_LIB_DIR += -L/usr/local/lib64 -L/usr/lib64 +else +SYSTEM_LIB_DIR += -L/usr/local/lib -L/usr/lib +endif # TODO: not necessary? covered by pg_config? #ifeq ($(FOUNDATION_LIB),apple) diff --git a/sope-gdl1/PostgreSQL/fhs.make b/sope-gdl1/PostgreSQL/fhs.make index 6c5bd960..aae3415a 100644 --- a/sope-gdl1/PostgreSQL/fhs.make +++ b/sope-gdl1/PostgreSQL/fhs.make @@ -4,7 +4,12 @@ ifneq ($(FHS_INSTALL_ROOT),) -FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib/ +ifeq ($(findstring _64, $(GNUSTEP_TARGET_CPU)), _64) +SYSTEM_LIB_DIR += -L/usr/local/lib64 +else +SYSTEM_LIB_DIR += -L/usr/local/lib +endif + FHS_DB_DIR=$(FHS_LIB_DIR)sope-$(SOPE_MAJOR_VERSION).$(SOPE_MINOR_VERSION)/dbadaptors/ fhs-db-dirs :: diff --git a/sope-gdl1/SQLite3/GNUmakefile.preamble b/sope-gdl1/SQLite3/GNUmakefile.preamble index 8620c94c..95c5ae01 100644 --- a/sope-gdl1/SQLite3/GNUmakefile.preamble +++ b/sope-gdl1/SQLite3/GNUmakefile.preamble @@ -73,4 +73,8 @@ ADDITIONAL_LIB_DIRS += \ $(foreach dir,$(DEP_DIRS),-F$(GNUSTEP_BUILD_DIR)/$(dir)) endif +ifeq ($(findstring _64, $(GNUSTEP_TARGET_CPU)), _64) +SYSTEM_LIB_DIR += -L/usr/local/lib64 -L/usr/lib64 +else SYSTEM_LIB_DIR += -L/usr/local/lib -L/usr/lib +endif diff --git a/sope-gdl1/SQLite3/NSString+SQLite.m b/sope-gdl1/SQLite3/NSString+SQLite.m index 3d729b38..5df70fdf 100644 --- a/sope-gdl1/SQLite3/NSString+SQLite.m +++ b/sope-gdl1/SQLite3/NSString+SQLite.m @@ -125,13 +125,16 @@ } - (NSString *)_sqlite3StripEndSpaces { - if ([self length] > 0) { - NSCharacterSet *spaceSet = [NSCharacterSet whitespaceCharacterSet]; - NSMutableString *str = [NSMutableString stringWithCapacity:[self length]]; - IMP charAtIndex; + if ([self isNotEmpty]) { + NSCharacterSet *spaceSet; + NSMutableString *str; + unichar (*charAtIndex)(id, SEL, int); NSRange range; - charAtIndex = [self methodForSelector:@selector(characterAtIndex:)]; + spaceSet = [NSCharacterSet whitespaceCharacterSet]; + str = [NSMutableString stringWithCapacity:[self length]]; + charAtIndex = (unichar (*)(id, SEL, int)) + [self methodForSelector:@selector(characterAtIndex:)]; range.length = 0; for (range.location = ([self length] - 1); diff --git a/sope-gdl1/SQLite3/SQLiteChannel.m b/sope-gdl1/SQLite3/SQLiteChannel.m index acc1e472..11d1439f 100644 --- a/sope-gdl1/SQLite3/SQLiteChannel.m +++ b/sope-gdl1/SQLite3/SQLiteChannel.m @@ -164,7 +164,7 @@ static int openConnectionCount = 0; if (isDebuggingEnabled) { NSLog(@"SQLite channel 0x%p opened (connection=0x%p,%s)", - (unsigned)self, self->_connection, cDBName); + self, self->_connection, cDBName); } return YES; } @@ -619,8 +619,7 @@ static int openConnectionCount = 0; ms = [NSMutableString stringWithCapacity:64]; [ms appendFormat:@"<%@[0x%p] connection=0x%p", NSStringFromClass([self class]), - self, - (unsigned)self->_connection]; + self, self->_connection]; [ms appendString:@">"]; return ms; } diff --git a/sope-gdl1/SQLite3/fhs.make b/sope-gdl1/SQLite3/fhs.make index 6c5bd960..aae3415a 100644 --- a/sope-gdl1/SQLite3/fhs.make +++ b/sope-gdl1/SQLite3/fhs.make @@ -4,7 +4,12 @@ ifneq ($(FHS_INSTALL_ROOT),) -FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib/ +ifeq ($(findstring _64, $(GNUSTEP_TARGET_CPU)), _64) +SYSTEM_LIB_DIR += -L/usr/local/lib64 +else +SYSTEM_LIB_DIR += -L/usr/local/lib +endif + FHS_DB_DIR=$(FHS_LIB_DIR)sope-$(SOPE_MAJOR_VERSION).$(SOPE_MINOR_VERSION)/dbadaptors/ fhs-db-dirs :: -- 2.39.5