From: helge Date: Wed, 27 Jul 2005 12:26:12 +0000 (+0000) Subject: fixed gcc 4.0 warnings X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74c32d088f9a4c1fb9bdf006ee3b353b46fac2e2;p=sope fixed gcc 4.0 warnings git-svn-id: http://svn.opengroupware.org/SOPE/trunk@940 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- diff --git a/sope-appserver/NGObjWeb/SoObjects/README b/sope-appserver/NGObjWeb/SoObjects/README index d231d3aa..7c767558 100644 --- a/sope-appserver/NGObjWeb/SoObjects/README +++ b/sope-appserver/NGObjWeb/SoObjects/README @@ -22,6 +22,19 @@ NOTES => both, when found, are added to the traversal path, this has the advantage that it leaves the URI of a node intact +FAQ +=== + +Q: Why is that in NGObjWeb and not in a separate framework? +A: The idea is that the WO concept could be represented on top of SoObjects, + that is, the request handler, the session object etc could all become + SoObjects. The main control would be passed over to SOPE. Eg: + /MyApp/wo/1283746571/18233445.1.2.3.4.5 + Could be + MyApp lookup: wo => WORequestHandler + wo lookup: 1283746571 => WOSession + 1283746571 lookup: 18233445.1.2.3.4.5 => WOContext with element-id + Class Hierarchy =============== diff --git a/sope-gdl1/PostgreSQL/ChangeLog b/sope-gdl1/PostgreSQL/ChangeLog index 7de6d4cd..6e4ff66b 100644 --- a/sope-gdl1/PostgreSQL/ChangeLog +++ b/sope-gdl1/PostgreSQL/ChangeLog @@ -1,3 +1,11 @@ +2005-07-27 Helge Hess + + * v4.5.42 + + * PostgreSQL72Channel+Model.m: fixed an EOJoin related gcc 4.0 warning + + * NSCalendarDate+PGVal.m: fixed gcc 4.0 signed-warnings + 2005-04-21 Helge Hess * PostgreSQL72Channel.m: changed for -describeResults: API (v4.5.41) diff --git a/sope-gdl1/PostgreSQL/NSCalendarDate+PGVal.m b/sope-gdl1/PostgreSQL/NSCalendarDate+PGVal.m index d7470cce..616a3fe7 100644 --- a/sope-gdl1/PostgreSQL/NSCalendarDate+PGVal.m +++ b/sope-gdl1/PostgreSQL/NSCalendarDate+PGVal.m @@ -51,8 +51,8 @@ static NSTimeZone *gmt02 = nil; attribute:(EOAttribute *)_attribute adaptorChannel:(PostgreSQL72Channel *)_channel { - static unsigned char buf[28]; // reused buffer - unsigned char *p; + static char buf[28]; // reused buffer THREAD + char *p; NSTimeZone *attrTZ; NSCalendarDate *date; int year, month, day, hour, min, sec, tzOffset = 0; diff --git a/sope-gdl1/PostgreSQL/PostgreSQL72Channel+Model.m b/sope-gdl1/PostgreSQL/PostgreSQL72Channel+Model.m index 80d974d6..b82a2a20 100644 --- a/sope-gdl1/PostgreSQL/PostgreSQL72Channel+Model.m +++ b/sope-gdl1/PostgreSQL/PostgreSQL72Channel+Model.m @@ -204,7 +204,9 @@ static BOOL debugOn = NO; da = [fkey objectForKey:@"targetAttr"]; dt = [fkey objectForKey:@"targetTable"]; rel = [[[EORelationship alloc] init] autorelease]; - join = [[[EOJoin alloc] init] autorelease]; + + // TODO: do something about the join (just use rel?) + join = [[[NSClassFromString(@"EOJoin") alloc] init] autorelease]; if ([pkeys containsObject:sa]) relName = [@"to" stringByAppendingString:[dt _pgModelMakeClassName]]; diff --git a/sope-gdl1/PostgreSQL/Version b/sope-gdl1/PostgreSQL/Version index 05ec198e..a3c4ecc6 100644 --- a/sope-gdl1/PostgreSQL/Version +++ b/sope-gdl1/PostgreSQL/Version @@ -1,5 +1,5 @@ # version file -SUBMINOR_VERSION:=41 +SUBMINOR_VERSION:=42 # v4.5.41 requires libGDLAccess v4.5.50 diff --git a/sope-gdl1/SQLite3/ChangeLog b/sope-gdl1/SQLite3/ChangeLog index 5291a2ac..82d728b8 100644 --- a/sope-gdl1/SQLite3/ChangeLog +++ b/sope-gdl1/SQLite3/ChangeLog @@ -1,3 +1,7 @@ +2005-07-27 Helge Hess + + * fixed gcc 4.0 warnings (char signedness) (v4.5.18) + 2005-04-21 Helge Hess * v4.5.17 diff --git a/sope-gdl1/SQLite3/NSCalendarDate+SQLiteVal.m b/sope-gdl1/SQLite3/NSCalendarDate+SQLiteVal.m index b1b8c1a0..679496a7 100644 --- a/sope-gdl1/SQLite3/NSCalendarDate+SQLiteVal.m +++ b/sope-gdl1/SQLite3/NSCalendarDate+SQLiteVal.m @@ -53,9 +53,9 @@ static NSTimeZone *gmt01 = nil; static NSTimeZone *gmt02 = nil; - (id)initWithSQLiteData:(const void *)_value length:(int)_length { - static unsigned char buf[28]; // reused buffer, THREAD + static char buf[28]; // reused buffer, THREAD const char *_cstr = _value; - unsigned char *p; + char *p; NSTimeZone *attrTZ; NSCalendarDate *date; int year, month, day, hour, min, sec, tzOffset; @@ -156,7 +156,7 @@ static NSTimeZone *gmt02 = nil; } - (id)initWithSQLiteText:(const unsigned char *)_value { - return [self initWithSQLiteData:_value length:strlen(_value)]; + return [self initWithSQLiteData:_value length:strlen((char *)_value)]; } /* generating value */ diff --git a/sope-gdl1/SQLite3/NSData+SQLiteVal.m b/sope-gdl1/SQLite3/NSData+SQLiteVal.m index c1f871c7..128a6d86 100644 --- a/sope-gdl1/SQLite3/NSData+SQLiteVal.m +++ b/sope-gdl1/SQLite3/NSData+SQLiteVal.m @@ -37,7 +37,7 @@ return [self initWithBytes:&_value length:sizeof(double)]; } - (id)initWithSQLiteText:(const unsigned char *)_value { - return [self initWithBytes:_value length:strlen(_value)]; + return [self initWithBytes:_value length:strlen((char *)_value)]; } - (id)initWithSQLiteData:(const void *)_value length:(int)_length { return [self initWithBytes:_value length:_length]; diff --git a/sope-gdl1/SQLite3/NSNumber+SQLiteVal.m b/sope-gdl1/SQLite3/NSNumber+SQLiteVal.m index 92118b23..cad24292 100644 --- a/sope-gdl1/SQLite3/NSNumber+SQLiteVal.m +++ b/sope-gdl1/SQLite3/NSNumber+SQLiteVal.m @@ -36,9 +36,9 @@ return [self initWithDouble:_value]; } - (id)initWithSQLiteText:(const unsigned char *)_value { - return index(_value, '.') != NULL - ? [self initWithDouble:atof(_value)] - : [self initWithInt:atoi(_value)]; + return index((char *)_value, '.') != NULL + ? [self initWithDouble:atof((char *)_value)] + : [self initWithInt:atoi((char *)_value)]; } - (id)initWithSQLiteData:(const void *)_value length:(int)_length { diff --git a/sope-gdl1/SQLite3/NSString+SQLiteVal.m b/sope-gdl1/SQLite3/NSString+SQLiteVal.m index f5104c67..09002057 100644 --- a/sope-gdl1/SQLite3/NSString+SQLiteVal.m +++ b/sope-gdl1/SQLite3/NSString+SQLiteVal.m @@ -44,7 +44,7 @@ static Class EOExprClass = Nil; } - (id)initWithSQLiteText:(const unsigned char *)_value { - return [self initWithUTF8String:_value]; + return [self initWithUTF8String:(char *)_value]; } - (id)initWithSQLiteData:(const void *)_value length:(int)_length { @@ -98,7 +98,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/SQLite3/SQLiteChannel+Model.m b/sope-gdl1/SQLite3/SQLiteChannel+Model.m index 1932633b..22e5095a 100644 --- a/sope-gdl1/SQLite3/SQLiteChannel+Model.m +++ b/sope-gdl1/SQLite3/SQLiteChannel+Model.m @@ -103,29 +103,37 @@ } - (EOModel *)describeModelWithTableNames:(NSArray *)_tableNames { - NSMutableArray *buildRelShips = [NSMutableArray arrayWithCapacity:64]; - EOModel *model = AUTORELEASE([EOModel new]); - 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]; + // TODO: is this correct for SQLite?! + NSMutableArray *buildRelShips; + EOModel *model; + int cnt, tc; + + buildRelShips = [NSMutableArray arrayWithCapacity:64]; + model = [[[EOModel alloc] init] autorelease]; + + for (cnt = 0, tc = [_tableNames count]; cnt < tc; cnt++) { + 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 _sqlite3ModelMakeClassName]]; [entity setClassName: - [@"EO" stringByAppendingString:[tableName _sqlite3ModelMakeClassName]]]; + [@"EO" stringByAppendingString: + [tableName _sqlite3ModelMakeClassName]]]; [entity setExternalName:tableName]; [classProperties addObjectsFromArray:[entity classProperties]]; [primaryKeyAttributes addObjectsFromArray:[entity primaryKeyAttributes]]; @@ -145,17 +153,22 @@ [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: diff --git a/sope-gdl1/SQLite3/SQLiteChannel.m b/sope-gdl1/SQLite3/SQLiteChannel.m index a44bf264..92b0e997 100644 --- a/sope-gdl1/SQLite3/SQLiteChannel.m +++ b/sope-gdl1/SQLite3/SQLiteChannel.m @@ -114,7 +114,7 @@ static int openConnectionCount = 0; } - (BOOL)openChannel { - const unsigned char *cDBName; + const char *cDBName; SQLiteAdaptor *adaptor; int rc; diff --git a/sope-gdl1/SQLite3/SQLiteValues.m b/sope-gdl1/SQLite3/SQLiteValues.m index e02bf04c..969c56a7 100644 --- a/sope-gdl1/SQLite3/SQLiteValues.m +++ b/sope-gdl1/SQLite3/SQLiteValues.m @@ -106,7 +106,7 @@ if ([self respondsToSelector:@selector(initWithString:)]) { NSString *s; - s = [[NSString alloc] initWithUTF8String:_value]; + s = [[NSString alloc] initWithUTF8String:(char *)_value]; self = [(NSString *)self initWithString:s]; [s release]; return self; diff --git a/sope-gdl1/SQLite3/Version b/sope-gdl1/SQLite3/Version index 937ad5bb..eaa8b063 100644 --- a/sope-gdl1/SQLite3/Version +++ b/sope-gdl1/SQLite3/Version @@ -1,5 +1,5 @@ # Version file -SUBMINOR_VERSION:=17 +SUBMINOR_VERSION:=18 # v4.5.17 requires libGDLAccess v4.5.50