From: helge Date: Wed, 27 Jul 2005 12:33:34 +0000 (+0000) Subject: fixed gcc 4.0 warnings X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a9ce008e83582ff2949f176861a5be732ede8249;p=sope fixed gcc 4.0 warnings git-svn-id: http://svn.opengroupware.org/SOPE/trunk@941 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- diff --git a/sope-gdl1/MySQL/ChangeLog b/sope-gdl1/MySQL/ChangeLog index 5c75ebbb..d4dd5e72 100644 --- a/sope-gdl1/MySQL/ChangeLog +++ b/sope-gdl1/MySQL/ChangeLog @@ -1,3 +1,7 @@ +2005-07-27 Helge Hess + + * fixed gcc 4.0 warnings (char signedness) (v4.5.11) + 2005-04-23 Helge Hess * GNUmakefile.preamble: fixed include flags (v4.5.10) diff --git a/sope-gdl1/MySQL/MySQL4Channel+Model.m b/sope-gdl1/MySQL/MySQL4Channel+Model.m index 06a6c2e7..173c5291 100644 --- a/sope-gdl1/MySQL/MySQL4Channel+Model.m +++ b/sope-gdl1/MySQL/MySQL4Channel+Model.m @@ -108,24 +108,28 @@ int cnt, tc = [_tableNames count]; for (cnt = 0; cnt < tc; cnt++) { - NSMutableDictionary *relNamesUsed = - [NSMutableDictionary dictionaryWithCapacity:16]; - NSMutableArray *classProperties = - [NSMutableArray arrayWithCapacity:16]; - NSMutableArray *primaryKeyAttributes = - [NSMutableArray arrayWithCapacity:2]; - NSString *tableName = [_tableNames objectAtIndex:cnt]; - NSArray *attributes = [self _attributesForTableName:tableName]; - NSArray *pkeys = [self _primaryKeysNamesForTableName:tableName]; - NSArray *fkeys = [self _foreignKeysForTableName:tableName]; - EOEntity *entity = [[EOEntity new] autorelease]; - int cnt2; - int ac = [attributes count]; - int fkc = [fkeys count]; - + NSMutableDictionary *relNamesUsed; + NSMutableArray *classProperties, *primaryKeyAttributes; + NSString *tableName; + NSArray *attributes, *pkeys, *fkeys; + EOEntity *entity; + int cnt2, ac, fkc; + + relNamesUsed = [NSMutableDictionary dictionaryWithCapacity:16]; + classProperties = [NSMutableArray arrayWithCapacity:16]; + primaryKeyAttributes = [NSMutableArray arrayWithCapacity:2]; + tableName = [_tableNames objectAtIndex:cnt]; + attributes = [self _attributesForTableName:tableName]; + pkeys = [self _primaryKeysNamesForTableName:tableName]; + fkeys = [self _foreignKeysForTableName:tableName]; + entity = [[[EOEntity alloc] init] autorelease]; + ac = [attributes count]; + fkc = [fkeys count]; + [entity setName:[tableName _mySQL4ModelMakeClassName]]; [entity setClassName: - [@"EO" stringByAppendingString:[tableName _mySQL4ModelMakeClassName]]]; + [@"EO" stringByAppendingString: + [tableName _mySQL4ModelMakeClassName]]]; [entity setExternalName:tableName]; [classProperties addObjectsFromArray:[entity classProperties]]; [primaryKeyAttributes addObjectsFromArray:[entity primaryKeyAttributes]]; @@ -145,18 +149,23 @@ [entity setPrimaryKeyAttributes:primaryKeyAttributes]; for (cnt2 = 0; cnt2 < fkc; cnt2++) { - NSDictionary *fkey = [fkeys objectAtIndex:cnt2]; - NSMutableArray *classProperties = - AUTORELEASE([NSMutableArray new]); - NSString *sa = [fkey objectForKey:@"sourceAttr"]; - NSString *da = [fkey objectForKey:@"targetAttr"]; - NSString *dt = [fkey objectForKey:@"targetTable"]; - EORelationship *rel = - [[[EORelationship alloc] init] autorelease]; - EOJoin *join = - [[[EOJoin alloc] init] autorelease]; - NSString *relName = nil; - + NSDictionary *fkey; + NSMutableArray *classProperties; + NSString *sa, *da, *dt; + EORelationship *rel; + EOJoin *join; // TODO: fix me, EOJoin is deprecated + NSString *relName; + + fkey = [fkeys objectAtIndex:cnt2]; + classProperties = [NSMutableArray arrayWithCapacity:8]; + sa = [fkey objectForKey:@"sourceAttr"]; + da = [fkey objectForKey:@"targetAttr"]; + dt = [fkey objectForKey:@"targetTable"]; + rel = [[[EORelationship alloc] init] autorelease]; + + // TODO: fix me + join = [[[NSClassFromString(@"EOJoin") alloc] init] autorelease]; + if ([pkeys containsObject:sa]) { relName = [@"to" stringByAppendingString: [dt _mySQL4ModelMakeClassName]]; diff --git a/sope-gdl1/MySQL/MySQL4Channel.m b/sope-gdl1/MySQL/MySQL4Channel.m index 24b39f12..89fd9930 100644 --- a/sope-gdl1/MySQL/MySQL4Channel.m +++ b/sope-gdl1/MySQL/MySQL4Channel.m @@ -115,7 +115,7 @@ static int openConnectionCount = 0; } - (BOOL)openChannel { - const unsigned char *cDBName; + const char *cDBName; MySQL4Adaptor *adaptor; NSString *host, *socket; void *rc; diff --git a/sope-gdl1/MySQL/NSData+MySQL4Val.m b/sope-gdl1/MySQL/NSData+MySQL4Val.m index 42795d26..13d6419b 100644 --- a/sope-gdl1/MySQL/NSData+MySQL4Val.m +++ b/sope-gdl1/MySQL/NSData+MySQL4Val.m @@ -37,7 +37,7 @@ return [self initWithBytes:&_value length:sizeof(double)]; } - (id)initWithMySQL4Text:(const unsigned char *)_value { - return [self initWithBytes:_value length:strlen(_value)]; + return [self initWithBytes:_value length:strlen((char *)_value)]; } - (id)initWithMySQL4Data:(const void *)_value length:(int)_length { return [self initWithBytes:_value length:_length]; diff --git a/sope-gdl1/MySQL/NSString+MySQL4Val.m b/sope-gdl1/MySQL/NSString+MySQL4Val.m index df4c1199..59549dd0 100644 --- a/sope-gdl1/MySQL/NSString+MySQL4Val.m +++ b/sope-gdl1/MySQL/NSString+MySQL4Val.m @@ -121,7 +121,7 @@ static Class EOExprClass = Nil; return [s autorelease]; } case 'i': case 'I': { // int - unsigned char buf[128]; + char buf[128]; sprintf(buf, "%i", [self intValue]); return [NSString stringWithCString:buf]; } diff --git a/sope-gdl1/MySQL/Version b/sope-gdl1/MySQL/Version index c7825e07..6f0aa782 100644 --- a/sope-gdl1/MySQL/Version +++ b/sope-gdl1/MySQL/Version @@ -1,3 +1,3 @@ # Version file -SUBMINOR_VERSION:=10 +SUBMINOR_VERSION:=11