View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001664 | SOGo | Backend General | public | 2012-03-05 18:56 | 2012-05-29 20:17 |
Reporter | buzzdee | Assigned To | ludovic | ||
Priority | normal | Severity | block | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 1.3.12 | ||||
Target Version | 1.3.16 | Fixed in Version | 1.3.16 | ||
Summary | 0001664: exceptions on 64Bit with gnustep-base-1.24.0 | ||||
Description | Hi, with GNUstep base 1.24.0, NSNotFound changed to be NSIntegerMax instead of hardcoded 0x7fffffff, which now might be 0x7fffffffffffffffL on 64Bit platforms. Now, I just moved my openbsd installation to gnustep-base 1.24.0, and sogo 1.3.12c. Immediately after login I get the following exception now: EXCEPTION: <NSException: 0x200755248> NAME:NSRangeException REASON:Index -1 is out of range 7 (in 'replaceObjectAtIndex:withObject:') INFO:{Array = (Flagged, Attachment, Subject, Unread, Date, Priority, Size); Count = 7; Index = 4294967295; } The exception happens here: backtrace: (gdb) bt | ||||
Tags | No tags attached. | ||||
After the update of GNUstep, did you rebuild SOPE and SOGo? Because this change makes the gnustep binary-incompatible with code build with the previous versions. |
|
2012-03-05 19:04
|
patch-UI_MailerUI_UIxMailMainFrame_m (297 bytes)
$OpenBSD$ --- UI/MailerUI/UIxMailMainFrame.m.orig Mon Mar 5 19:59:23 2012 +++ UI/MailerUI/UIxMailMainFrame.m Mon Mar 5 19:59:43 2012 @@ -549,7 +549,7 @@ NSArray *available; NSDictionary *metaData; SOGoUserDefaults *ud; - unsigned int i; + NSUInteger i; if (!columnsOrder) { |
Yes, I rebuilt everything afterwards. Well, as it seems, the NSUInteger in that place is right, but i is only Attached patch fixes this immediate issue, but there might be more lurking. Sebastian |
|
I get a lot of warnings from gcc on amd64 in SOPE and SOGo, will hopefully find time tomorrow or in the next few days, to look at all of them, and provide patches. cheers |
|
With above patch, I can login to the mail interface, but clicking myself through some mails, I end up with this new backtrace. (gdb) bt I have to resort back to thunderbird for mail reading the next days, until I can fix all of those beasts ;) Sebastian |
|
Same problem again: it's the use if unsigned ints rather that NSUInteger that does taht. I have no time right now to work on this, but if you can provide a patch for those cases, it would be appreciated. |
|
here are all SOPE related warnings for the patches that will follow soon: cc SaxAttributeList.m -c \ cc SaxAttributes.m -c \ cc DOMNodeWithChildren.m -c \ cc XmlRpcDecoder.m -c \ cc XmlRpcSaxHandler.m -c \ cc StructuredText.m -c \ cc NGCalendarDateRange.m -c \ cc NGLockingStream.m -c \ cc NSString+Imap4.m -c \ cc NGHttpHeaderFields.m -c \ cc WOHttpAdaptor.m -c \ cc WODisplayGroup.m -c \ cc WOTabPanel.m -c \ cc EOExpressionArray.m -c \ cc PostgreSQL72Channel.m -c \ SECOND COMPILATION ROUND: cc PostgreSQL72Channel.m -c \ |
|
here are all SOGo related warnings for the patches that follow soon: cc CardGroup.m -c \ cc NSString+Utilities.m -c \ cc SOGoMailObject+Draft.m -c \ cc UIxMailPartAlternativeViewer.m -c \ cc UIxCalView.m -c \ cc UIxComponentEditor.m -c \ SECOND ROUND cc UIxMailPartAlternativeViewer.m -c \ |
|
2012-03-06 11:15
|
sope-patches-for-64-bit-and-deprecation-fixes.diff (14,687 bytes)
$OpenBSD$ fix deprecated warning --- sope-appserver/NGObjWeb/Associations/WOKeyPathAssociation.m.orig Sun Jan 22 13:22:00 2012 +++ sope-appserver/NGObjWeb/Associations/WOKeyPathAssociation.m Sun Jan 22 15:59:49 2012 @@ -939,8 +939,7 @@ static BOOL _setValue(WOKeyPathAssociation *self, id _ handleUnknownKey stuff ... */ -#if GNUSTEP_BASE_LIBRARY && ((GNUSTEP_BASE_MAJOR_VERSION >= 1) && \ - (GNUSTEP_BASE_MINOR_VERSION >= 11)) +#if GNUSTEP_BASE_LIBRARY // TODO: also do this for OSX 10.4? probably [object setValue:_value forKey:info->extra.key]; #else @@ -1097,9 +1096,9 @@ static BOOL _setValue(WOKeyPathAssociation *self, id _ return; } - if (info->type == WOKeyType_kvc) { // takeValue:forKey:.. + if (info->type == WOKeyType_kvc) { // setValue:forKey: NSCAssert(info->extra.key, @"no key object set .."); - [_wo takeValue:uintNumObj(_value) forKey:info->extra.key]; + [_wo setValue:uintNumObj(_value) forKey:info->extra.key]; return; } if (info->type == WOKeyType_binding) { // setValue:forBinding: @@ -1223,7 +1222,7 @@ static BOOL _setValue(WOKeyPathAssociation *self, id _ if (info->type == WOKeyType_kvc) { // takeValue:forKey: NSCAssert(info->extra.key, @"no key object set .."); - [_wo takeValue:intNumObj(_value) forKey:info->extra.key]; + [_wo setValue:intNumObj(_value) forKey:info->extra.key]; return; } @@ -1331,7 +1330,7 @@ static BOOL _setValue(WOKeyPathAssociation *self, id _ } else if (info->type == WOKeyType_kvc) { // takeValue:forKey: NSCAssert(info->extra.key, @"no key object set .."); - [_wo takeValue:[NumberClass numberWithBool:_value] + [_wo setValue:[NumberClass numberWithBool:_value] forKey:info->extra.key]; } else if (info->type == WOKeyType_binding) { // setValue:forBinding: $OpenBSD$ --- sope-appserver/NGObjWeb/NGHttp/NGHttpHeaderFields.m.orig Tue Mar 6 08:42:05 2012 +++ sope-appserver/NGObjWeb/NGHttp/NGHttpHeaderFields.m Tue Mar 6 08:42:54 2012 @@ -283,8 +283,9 @@ static void _parseUserAgent(NGHttpUserAgent *self) { if ([self->value hasPrefix:@"Mozilla"]) { // Mozilla Browser or compatible - NSRange r; - int idx, av, iv; + NSRange r; + int av, iv; + NSInteger idx; r = [self->value rangeOfString:@"/"]; idx = r.location; $OpenBSD$ --- sope-appserver/NGObjWeb/WODisplayGroup.m.orig Tue Feb 14 18:18:59 2012 +++ sope-appserver/NGObjWeb/WODisplayGroup.m Tue Mar 6 09:02:01 2012 @@ -372,7 +372,7 @@ static NSArray *uint0Array = nil; } - (void)setSelectedObject:(id)_obj { - unsigned idx; + NSUInteger idx; NSNumber *idxNumber; // TODO: maybe we need to retain the selection array and just swap the first @@ -430,7 +430,7 @@ static NSArray *uint0Array = nil; - (BOOL)selectObject:(id)_obj { /* returns YES if displayedObjects contains _obj otherwise NO */ NSNumber *idxNumber; - unsigned idx; + NSUInteger idx; if (![self->displayObjects containsObject:_obj]) return NO; @@ -951,13 +951,13 @@ static NSArray *uint0Array = nil; } - (BOOL)deleteSelection { - NSArray *objsToDelete; - unsigned i, count; + NSArray *objsToDelete; + NSUInteger i, count; objsToDelete = [[[self selectedObjects] shallowCopy] autorelease]; for (i = 0, count = [objsToDelete count]; i < count; i++) { - unsigned idx; + NSUInteger idx; idx = [self->objects indexOfObject:[objsToDelete objectAtIndex:i]]; if (idx == NSNotFound) { $OpenBSD$ --- sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpAdaptor.m.orig Tue Mar 6 08:43:24 2012 +++ sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpAdaptor.m Tue Mar 6 08:44:19 2012 @@ -396,7 +396,7 @@ static BOOL debugOn = NO; #if USE_POOLS NSAutoreleasePool *pool = nil; #endif - NSTimeInterval t; + NSTimeInterval t = 0; if (perfLogger) *(&t) = [[NSDate date] timeIntervalSince1970]; $OpenBSD$ --- sope-appserver/WOExtensions/WOTabPanel.m.orig Tue Mar 6 08:46:00 2012 +++ sope-appserver/WOExtensions/WOTabPanel.m Tue Mar 6 08:46:56 2012 @@ -156,7 +156,7 @@ WOComponent *sComponent; NSArray *ttabs; BOOL isInForm; - unsigned i, selIdx; + NSUInteger i, selIdx; NSString *selColor, *unselColor, *s; if ([_ctx isRenderingDisabled]) { $OpenBSD$ --- sope-core/NGExtensions/NGCalendarDateRange.m.orig Tue Mar 6 08:37:00 2012 +++ sope-core/NGExtensions/NGCalendarDateRange.m Tue Mar 6 08:38:28 2012 @@ -256,8 +256,8 @@ } return NO; } -- (unsigned)indexOfFirstIntersectingDateRange:(NGCalendarDateRange *)_range { - unsigned i, count; +- (NSUInteger)indexOfFirstIntersectingDateRange:(NGCalendarDateRange *)_range { + NSUInteger i, count; if (_range == nil) return NO; @@ -289,7 +289,7 @@ NGCalendarDateRange *rangeToAdd; NGCalendarDateRange *availRange; NGCalendarDateRange *newRange; - unsigned idx; + NSUInteger idx; rangeToAdd = [self objectAtIndex:i]; idx = [ma indexOfFirstIntersectingDateRange:rangeToAdd]; $OpenBSD: patch-sope-core_NGStreams_NGActiveSocket_m,v 1.1 2011/11/18 11:12:44 sebastia Exp $ MSG_NOSIGNAL is not POSIX, OpenBSD doesn't have it, so ignore it --- sope-core/NGStreams/NGActiveSocket.m.orig Thu Oct 6 09:15:44 2011 +++ sope-core/NGStreams/NGActiveSocket.m Thu Oct 6 10:04:09 2011 @@ -73,6 +73,10 @@ # define POLLRDNORM POLLIN #endif +#ifndef MSG_NOSIGNAL +#define MSG_NOSIGNAL 0 +#endif + @interface NGActiveSocket(PrivateMethods) - (id)_initWithDescriptor:(int)_fd $OpenBSD$ --- sope-core/NGStreams/NGLockingStream.m.orig Tue Mar 6 08:39:49 2012 +++ sope-core/NGStreams/NGLockingStream.m Tue Mar 6 08:40:08 2012 @@ -112,7 +112,7 @@ } - (BOOL)safeReadBytes:(void *)_buf count:(unsigned)_len { - BOOL res; + BOOL res = NO; [readLock lock]; $OpenBSD$ --- sope-gdl1/GDLAccess/EOExpressionArray.m.orig Tue Mar 6 08:47:03 2012 +++ sope-gdl1/GDLAccess/EOExpressionArray.m Tue Mar 6 08:47:32 2012 @@ -247,7 +247,7 @@ [self->array addObject:_object]; } -- (unsigned int)indexOfObject:(id)_object { +- (NSUInteger)indexOfObject:(id)_object { return [self->array indexOfObject:_object]; } $OpenBSD$ --- sope-gdl1/PostgreSQL/PostgreSQL72Channel.m.orig Tue Mar 6 09:14:49 2012 +++ sope-gdl1/PostgreSQL/PostgreSQL72Channel.m Tue Mar 6 09:15:13 2012 @@ -419,7 +419,7 @@ static int openConnectionCount = 0; { NSMutableDictionary *row; unsigned attrCount; - int *indices; + NSInteger *indices; unsigned cnt, fieldDictCount; if (self->currentTuple == self->tupleCount) { $OpenBSD$ --- sope-mime/NGImap4/NSString+Imap4.m.orig Tue Mar 6 08:41:01 2012 +++ sope-mime/NGImap4/NSString+Imap4.m Tue Mar 6 08:41:38 2012 @@ -151,7 +151,7 @@ static unsigned int _encodeToModifiedUTF7(unichar *_ch unsigned int processedSrc, processedDest, cycle; unichar c; char leftover; - BOOL hasLeftOver; + BOOL hasLeftOver = NO; processedSrc = 0; processedDest = 0; $OpenBSD$ --- sope-xml/DOM/DOMElement.m.orig Sat Jan 21 19:33:18 2012 +++ sope-xml/DOM/DOMElement.m Sat Jan 21 19:33:33 2012 @@ -104,7 +104,7 @@ static NSNull *null = nil; return self->namespaceURI; } -- (void)setLine:(NSUInteger)_line { +- (void)setLine:(NSInteger)_line { self->line = _line; } - (NSUInteger)line { $OpenBSD$ --- sope-xml/DOM/DOMNodeWithChildren.m.orig Tue Mar 6 08:27:58 2012 +++ sope-xml/DOM/DOMNodeWithChildren.m Tue Mar 6 08:29:04 2012 @@ -69,7 +69,7 @@ /* modification */ - (id<NSObject,DOMNode>)removeChild:(id<NSObject,DOMNode>)_node { - unsigned idx; + NSUInteger idx; if (self->childNodes == nil) /* this node has no childnodes ! */ @@ -133,7 +133,7 @@ /* sibling navigation */ - (id)_domNodeBeforeNode:(id)_node { - unsigned idx; + NSUInteger idx; if ((idx = [self->childNodes indexOfObject:_node]) == NSNotFound) /* given node isn't a child of this node */ @@ -145,7 +145,7 @@ return [self->childNodes objectAtIndex:(idx - 1)]; } - (id)_domNodeAfterNode:(id)_node { - unsigned idx, count; + NSUInteger idx, count; if ((count = [self->childNodes count]) == 0) /* this node has no children at all .. */ $OpenBSD$ --- sope-xml/DOM/DOMSaxHandler.m.orig Sat Jan 21 19:30:17 2012 +++ sope-xml/DOM/DOMSaxHandler.m Sat Jan 21 19:34:46 2012 @@ -27,7 +27,7 @@ #include <SaxObjC/SaxObjC.h> @interface NSObject(LineInfoProtocol) -- (void)setLine:(int)_line; +- (void)setLine:(NSInteger)_line; @end @implementation DOMSaxHandler $OpenBSD$ --- sope-xml/STXSaxDriver/ExtraSTX/StructuredText.m.orig Tue Mar 6 08:32:57 2012 +++ sope-xml/STXSaxDriver/ExtraSTX/StructuredText.m Tue Mar 6 08:34:44 2012 @@ -384,7 +384,7 @@ StructuredLine *line, *prevLine = nil; StructuredTextListItem *item = nil; StructuredStack *paragraphs; - int type; + NSInteger type; result = nil; paragraphs = [self paragraphs]; @@ -477,11 +477,11 @@ return [result autorelease]; } -- (int)listItemTypology:(StructuredLine *)aLine { - NSString *text; - int type = NSNotFound; - int i, h, length; - NSRange range; +- (NSInteger)listItemTypology:(StructuredLine *)aLine { + NSString *text; + NSInteger type = NSNotFound; + int i, h, length; + NSRange range; text = [aLine text]; $OpenBSD$ --- sope-xml/SaxObjC/SaxAttributeList.m.orig Tue Mar 6 08:25:26 2012 +++ sope-xml/SaxObjC/SaxAttributeList.m Tue Mar 6 08:26:14 2012 @@ -95,7 +95,7 @@ } - (void)removeAttribute:(NSString *)_name { - int idx; + NSInteger idx; if ((idx = [self->names indexOfObject:_name]) == NSNotFound) return; @@ -118,7 +118,7 @@ } - (NSString *)typeForName:(NSString *)_name { - int i; + NSInteger i; if ((i = [self->names indexOfObject:_name]) == NSNotFound) return nil; @@ -126,7 +126,7 @@ return [self typeAtIndex:i]; } - (NSString *)valueForName:(NSString *)_name { - int i; + NSInteger i; if ((i = [self->names indexOfObject:_name]) == NSNotFound) return nil; $OpenBSD$ --- sope-xml/SaxObjC/SaxAttributes.m.orig Tue Mar 6 08:26:28 2012 +++ sope-xml/SaxObjC/SaxAttributes.m Tue Mar 6 08:27:43 2012 @@ -160,7 +160,7 @@ /* lookup data by name */ - (NSString *)typeForRawName:(NSString *)_rawName { - unsigned int i; + NSUInteger i; if ((i = [self indexOfRawName:_rawName]) == NSNotFound) return nil; @@ -168,7 +168,7 @@ return [self typeAtIndex:i]; } - (NSString *)typeForName:(NSString *)_localName uri:(NSString *)_uri { - unsigned int i; + NSUInteger i; if ((i = [self indexOfName:_localName uri:_uri]) == NSNotFound) return nil; @@ -177,7 +177,7 @@ } - (NSString *)valueForRawName:(NSString *)_rawName { - unsigned int i; + NSUInteger i; if ((i = [self indexOfRawName:_rawName]) == NSNotFound) return nil; @@ -185,7 +185,7 @@ return [self valueAtIndex:i]; } - (NSString *)valueForName:(NSString *)_localName uri:(NSString *)_uri { - unsigned int i; + NSUInteger i; if ((i = [self indexOfName:_localName uri:_uri]) == NSNotFound) return nil; $OpenBSD$ --- sope-xml/XmlRpc/XmlRpcDecoder.m.orig Tue Mar 6 08:30:11 2012 +++ sope-xml/XmlRpc/XmlRpcDecoder.m Tue Mar 6 08:31:10 2012 @@ -584,7 +584,7 @@ static BOOL doDebug = NO; return result; } -- (int)decodeIntForKey:(NSString *)_key { +- (NSInteger)decodeIntForKey:(NSString *)_key { XmlRpcValue *newValue; int result; $OpenBSD$ --- sope-xml/XmlRpc/XmlRpcSaxHandler.m.orig Tue Mar 6 08:31:40 2012 +++ sope-xml/XmlRpc/XmlRpcSaxHandler.m Tue Mar 6 08:32:30 2012 @@ -239,8 +239,8 @@ static BOOL doDebug = NO; self->nextCharactersProcessor = @selector(_baseValue:length:); } - (void)start_dateTime:(id<SaxAttributes>)_attrs { - NSString *tz; - int idx; + NSString *tz; + NSInteger idx; [self->timeZone release]; self->timeZone = nil; [self->dateTime release]; self->dateTime = nil; @@ -529,8 +529,8 @@ static BOOL doDebug = NO; attributes:(id<SaxAttributes>)_attrs { NSString *tmp = nil; - SEL sel; - int idx; + SEL sel; + NSInteger idx; [self->tagStack addObject:_rawName]; $OpenBSD$ --- sope-core/NGExtensions/NGExtensions/NGCalendarDateRange.h.orig Tue Mar 6 08:38:50 2012 +++ sope-core/NGExtensions/NGExtensions/NGCalendarDateRange.h Tue Mar 6 08:39:13 2012 @@ -67,7 +67,7 @@ - (NSArray *)arrayByCreatingDateRangesFromObjectsWithStartDateKey:(NSString *)s andEndDateKey:(NSString *)e; -- (unsigned)indexOfFirstIntersectingDateRange:(NGCalendarDateRange *)_range; +- (NSUInteger)indexOfFirstIntersectingDateRange:(NGCalendarDateRange *)_range; - (BOOL)dateRangeArrayContainsDate:(NSCalendarDate *)_date; - (NSArray *)arrayByCompactingContainedDateRanges; $OpenBSD$ --- sope-gdl1/GDLAccess/EOExpressionArray.h.orig Tue Mar 6 08:47:45 2012 +++ sope-gdl1/GDLAccess/EOExpressionArray.h Tue Mar 6 08:48:02 2012 @@ -97,7 +97,7 @@ - (void)insertObject:(id)_obj atIndex:(unsigned int)_idx; - (void)addObjectsFromArray:(NSArray *)_array; - (void)addObject:(id)_object; -- (unsigned int)indexOfObject:(id)_object; +- (NSUInteger)indexOfObject:(id)_object; - (id)objectAtIndex:(unsigned int)_idx; - (id)lastObject; - (NSUInteger)count; $OpenBSD$ --- sope-gdl1/PostgreSQL/PostgreSQL72Channel.h.orig Tue Mar 6 09:03:33 2012 +++ sope-gdl1/PostgreSQL/PostgreSQL72Channel.h Tue Mar 6 09:03:05 2012 @@ -61,9 +61,9 @@ typedef struct { NSMutableDictionary *_attributesForTableName; NSMutableDictionary *_primaryKeysNamesForTableName; - int *fieldIndices; - NSString **fieldKeys; - id *fieldValues; + NSInteger *fieldIndices; + NSString **fieldKeys; + id *fieldValues; } - (void)setDebugEnabled:(BOOL)_flag; $OpenBSD$ --- sope-xml/STXSaxDriver/ExtraSTX/StructuredText.h.orig Tue Mar 6 08:34:57 2012 +++ sope-xml/STXSaxDriver/ExtraSTX/StructuredText.h Tue Mar 6 08:35:11 2012 @@ -78,7 +78,7 @@ - (StructuredTextLiteralBlock *)buildLiteralBlock; - (StructuredTextList *)buildList; -- (int)listItemTypology:(StructuredLine *)_line; +- (NSInteger)listItemTypology:(StructuredLine *)_line; @end $OpenBSD$ --- sope-xml/XmlRpc/XmlRpcCoder.h.orig Tue Mar 6 09:00:15 2012 +++ sope-xml/XmlRpc/XmlRpcCoder.h Tue Mar 6 09:00:31 2012 @@ -137,7 +137,7 @@ - (NSArray *)decodeArrayForKey:(NSString *)_key; - (NSData *)decodeBase64ForKey:(NSString *)_key; - (BOOL)decodeBooleanForKey:(NSString *)_key; -- (int)decodeIntForKey:(NSString *)_key; +- (NSInteger)decodeIntForKey:(NSString *)_key; - (double)decodeDoubleForKey:(NSString *)_key; - (NSString *)decodeStringForKey:(NSString *)_key; - (NSCalendarDate *)decodeDateTimeForKey:(NSString *)_key; |
2012-03-06 11:15
|
sogo-64Bit-fixes-and-other-minor-things.diff (3,455 bytes)
$OpenBSD$ --- SOPE/NGCards/CardGroup.m.orig Tue Mar 6 10:22:47 2012 +++ SOPE/NGCards/CardGroup.m Tue Mar 6 10:23:04 2012 @@ -391,7 +391,7 @@ static NGCardsSaxHandler *sax = nil; - (void) replaceThisElement: (CardElement *) oldElement withThisOne: (CardElement *) newElement { - unsigned int index; + NSUInteger index; index = [children indexOfObject: oldElement]; if (index != NSNotFound) $OpenBSD$ --- SoObjects/Mailer/SOGoMailObject+Draft.m.orig Tue Mar 6 10:34:47 2012 +++ SoObjects/Mailer/SOGoMailObject+Draft.m Tue Mar 6 10:35:55 2012 @@ -98,7 +98,7 @@ NSArray *types; NSDictionary *parts; NSString *rawPart, *content, *contentKey; - int index; + NSInteger index; BOOL htmlContent; content = @""; $OpenBSD$ --- SoObjects/SOGo/NSString+Utilities.m.orig Tue Mar 6 10:24:38 2012 +++ SoObjects/SOGo/NSString+Utilities.m Tue Mar 6 10:25:17 2012 @@ -470,7 +470,8 @@ static int cssEscapingCount; - (int) timeValue { - int i, time; + int time; + NSInteger i; if ([self length] > 0) { $OpenBSD$ --- UI/MailPartViewers/UIxMailPartAlternativeViewer.m.orig Tue Feb 14 22:31:30 2012 +++ UI/MailPartViewers/UIxMailPartAlternativeViewer.m Tue Mar 6 10:51:40 2012 @@ -89,10 +89,10 @@ return types; } -- (unsigned int) _preferredTypesPart: (NSArray *) types +- (NSUInteger) _preferredTypesPart: (NSArray *) types { unsigned int count, max; - unsigned int part; + NSUInteger part; const NSString *priorities[] = { @"multipart/related", @"multipart/mixed", @"text/calendar", @"text/html", @"text/plain" }; @@ -113,7 +113,8 @@ - (int) _selectPartIndexFromTypes: (NSArray *) _types { /* returns the index of the selected part or NSNotFound */ - unsigned count, max, part; + unsigned count, max; + NSUInteger part; part = [self _preferredTypesPart: _types]; if (part == NSNotFound) @@ -136,7 +137,7 @@ - (void) selectChildInfo { - unsigned idx; + NSUInteger idx; [childInfo release]; childInfo = nil; childIndex = 0; $OpenBSD$ --- UI/MailerUI/UIxMailEditor.m.orig Sun Jan 22 14:29:40 2012 +++ UI/MailerUI/UIxMailEditor.m Sun Jan 22 14:30:25 2012 @@ -384,7 +384,7 @@ static NSArray *infoKeys = nil; { if (![_info isNotNull]) return; [self debugWithFormat:@"loading info ..."]; - [self takeValuesFromDictionary:_info]; + [self setValuesForKeysWithDictionary:_info]; } - (NSDictionary *) storeInfo $OpenBSD$ --- UI/MailerUI/UIxMailMainFrame.m.orig Mon Mar 5 19:59:23 2012 +++ UI/MailerUI/UIxMailMainFrame.m Mon Mar 5 19:59:43 2012 @@ -549,7 +549,7 @@ NSArray *available; NSDictionary *metaData; SOGoUserDefaults *ud; - unsigned int i; + NSUInteger i; if (!columnsOrder) { $OpenBSD$ --- UI/Scheduler/UIxCalView.m.orig Tue Mar 6 10:39:14 2012 +++ UI/Scheduler/UIxCalView.m Tue Mar 6 10:39:03 2012 @@ -532,7 +532,8 @@ NSString *uidsString, *loc, *prevMethod, *userFolderID; id <WOActionResults> r; BOOL useGroups; - unsigned index; + NSUInteger index; + uidsString = [self queryParameterForKey: @"userUIDString"]; uidsString = [uidsString stringByTrimmingSpaces]; $OpenBSD$ --- UI/Scheduler/UIxComponentEditor.m.orig Tue Mar 6 10:39:47 2012 +++ UI/Scheduler/UIxComponentEditor.m Tue Mar 6 10:40:10 2012 @@ -524,7 +524,7 @@ iRANGE(2); iCalTrigger *aTrigger; NSString *duration, *quantity; unichar c; - unsigned int i; + NSUInteger i; if ([component hasAlarms]) { |
some parts of the patches are older, and I think I already opened other bug reports for them. They are just some deprecation warnings and the like... I tested the patches on my i386 box, SOGo is still working fine, and on amd64, I don't get those exceptions anymore, but I seem to have memory issues: Example segfault, when trying to write a new mail: 2012-03-06 11:07:23.326 sogod[8795] WARNING: IMAP4 connection pooling is disabled! Program received signal SIGSEGV, Segmentation fault. Or this one, just happened directly after login: 127.0.0.1 - - [06/Mar/2012:12:20:49 GMT] "GET /SOGo/sebastia HTTP/1.1" 302 0/0 0.018 - - - Program received signal SIGSEGV, Segmentation fault. Or this one, when I enter the address book: 27.0.0.1 - - [06/Mar/2012:12:29:20 GMT] "GET /SOGo/so/sebastia/Contacts HTTP/1.1" 302 0/0 0.002 - - - Program received signal SIGSEGV, Segmentation fault. what I did on the 64Bit box is to transfer the SOGo configuration from the 32Bit box, and to dump the database, and reimport it on the new database on the 64Bit host. Before imported the database in the new host, I had to modify the database dump for the sogo_folder_info table: values like: postgresql://SOGo:SOGo@<OLD HOST NAME>:5432/sogo/sogosebastia0010f717d45 were changed into: I changed the hostname. |
|
I made some more tests, also OGo is failing with gnustep-base-1.24.0 on amd64. I have some more patches for SOPE, since compiling OGo did spit out a lot of other warnings about methods not used from SOGo. I'll test more tomorrow, especially with the 1.23.0 gnustep-base and other things... |
|
I tried with gnustep-base 1.23.0, and it still segfaults on the amd64 box, when I open the contacts web interface. So probably the segfaults don't have anything to do with the NSNotFound change, since this is only in 1.24.0. |
|
I can confirm this error for gnustep-base-1.24.0 and OGo 1.3.13 (x86_64). EXCEPTION: <NSException: 0x10f99a8> NAME:NSRangeException REASON:Index -1 is out of range 7 (in 'replaceObjectAtIndex:withObject:') INFO:{Array = (Flagged, Attachment, Subject, Unread, Date, |
|
2012-03-19 19:00
|
fix_64_Bit_exceptions.diff (4,974 bytes)
$OpenBSD$ --- SoObjects/Mailer/SOGoDraftObject.m.orig Fri Mar 9 19:19:24 2012 +++ SoObjects/Mailer/SOGoDraftObject.m Mon Mar 19 19:56:47 2012 @@ -114,7 +114,8 @@ static NSString *headerKeys[] = {@"subject", @"to", @" range: (NSRange) theRange { const char *b, *bytes; - int i, len, slen; + int slen; + NSUInteger i, len; if (!theCString) { @@ -571,24 +572,25 @@ static NSString *userAgent = nil; NSEnumerator *allRecipients; NSString *currentRecipient; NGImap4EnvelopeAddress *currentAddress; - int count, max; + NSUInteger count, max; max = [addresses count]; allRecipients = [recipients objectEnumerator]; while (max > 0 - && ((currentRecipient = [allRecipients nextObject]))) - for (count = max - 1; count >= 0; count--) + && ((currentRecipient = [allRecipients nextObject]))) { + for (count = max ; count > 0; count--) { - currentAddress = [addresses objectAtIndex: count]; + currentAddress = [addresses objectAtIndex: count - 1]; if ([currentRecipient caseInsensitiveCompare: [currentAddress baseEMail]] == NSOrderedSame) { - [addresses removeObjectAtIndex: count]; + [addresses removeObjectAtIndex: count - 1]; max--; } } + } } - (void) _fillInReplyAddresses: (NSMutableDictionary *) _info @@ -695,7 +697,7 @@ static NSString *userAgent = nil; - (void) _fetchAttachments: (NSArray *) parts fromMail: (SOGoMailObject *) sourceMail { - unsigned int count, max; + NSUInteger count, max; NSArray *paths, *bodies; NSData *body; NSDictionary *currentInfo; @@ -861,7 +863,7 @@ static NSString *userAgent = nil; NSMutableArray *ma; NSFileManager *fm; NSArray *files; - unsigned count, max; + NSUInteger count, max; NSString *filename; fm = [NSFileManager defaultManager]; @@ -1210,7 +1212,7 @@ static NSString *userAgent = nil; { /* returns nil on error */ NSArray *names; - unsigned i, count; + NSUInteger i, count; NGMimeBodyPart *bodyPart; NSMutableArray *bodyParts; @@ -1293,7 +1295,7 @@ static NSString *userAgent = nil; - (NSString *) _quoteSpecials: (NSString *) address { NSString *result, *part, *s2; - int i, len; + NSUInteger i, len; // We want to correctly send mails to recipients such as : // foo.bar @@ -1342,7 +1344,7 @@ static NSString *userAgent = nil; { NSMutableArray *result; NSString *address; - int count, max; + NSUInteger count, max; max = [addresses count]; result = [NSMutableArray arrayWithCapacity: max]; $OpenBSD$ --- UI/MailPartViewers/UIxMailPartAlternativeViewer.m.orig Tue Feb 14 22:31:30 2012 +++ UI/MailPartViewers/UIxMailPartAlternativeViewer.m Fri Mar 9 18:29:19 2012 @@ -21,6 +21,7 @@ */ #import <Foundation/NSNull.h> +#import <Foundation/NSValue.h> #import <NGExtensions/NSObject+Logs.h> @@ -43,7 +44,7 @@ @interface UIxMailPartAlternativeViewer : UIxMailPartViewer { id childInfo; - unsigned int childIndex; + NSUInteger childIndex; } @end @@ -89,10 +90,10 @@ return types; } -- (unsigned int) _preferredTypesPart: (NSArray *) types +- (NSUInteger) _preferredTypesPart: (NSArray *) types { - unsigned int count, max; - unsigned int part; + NSUInteger count, max; + NSUInteger part; const NSString *priorities[] = { @"multipart/related", @"multipart/mixed", @"text/calendar", @"text/html", @"text/plain" }; @@ -113,7 +114,7 @@ - (int) _selectPartIndexFromTypes: (NSArray *) _types { /* returns the index of the selected part or NSNotFound */ - unsigned count, max, part; + NSUInteger count, max, part; part = [self _preferredTypesPart: _types]; if (part == NSNotFound) @@ -136,7 +137,7 @@ - (void) selectChildInfo { - unsigned idx; + NSUInteger idx; [childInfo release]; childInfo = nil; childIndex = 0; @@ -164,7 +165,7 @@ return childInfo; } -- (unsigned int) childIndex +- (NSUInteger) childIndex { if (!childIndex) [self selectChildInfo]; @@ -174,11 +175,9 @@ - (NSString *) childPartName { - char buf[8]; + NSNumber *part = [NSNumber numberWithUnsignedInteger: [self childIndex] +1]; - sprintf (buf, "%d", [self childIndex] + 1); - - return [NSString stringWithCString:buf]; + return [part stringValue]; } - (id) childPartPath $OpenBSD$ --- UI/MailerUI/UIxMailMainFrame.m.orig Fri Mar 9 17:40:27 2012 +++ UI/MailerUI/UIxMailMainFrame.m Fri Mar 9 17:40:53 2012 @@ -549,7 +549,7 @@ NSArray *available; NSDictionary *metaData; SOGoUserDefaults *ud; - unsigned int i; + NSUInteger i; if (!columnsOrder) { $OpenBSD$ --- UI/MailerUI/UIxMailMainFrame.h.orig Fri Mar 9 17:39:55 2012 +++ UI/MailerUI/UIxMailMainFrame.h Fri Mar 9 17:40:06 2012 @@ -31,7 +31,7 @@ NSMutableDictionary *moduleSettings; NSArray *columnsOrder; - int folderType; + NSInteger folderType; NSDictionary *currentColumn; } |
Since about two weeks now, I have SOGo running stable for me (so far), just using the just uploaded fix_64_Bit_exceptions.diff. With the first approach, I was too optimistic, and broke too much else I guess. arigion, do you have a chance to test the patch? |
|
I updated to OGo 1.3.14 (x86_64) now. |
|
Using sources currently available for download at sogo.nu (1.3.x) on a Gentoo Linux with GNUstep-base 1.24.0 I can confirm basic issue and fixing it using buzzdees latest patch. That way reading mail was possible. However, on switching to calendar another exception was logged: menon.toxa.de - - [14/Apr/2012:14:36:46 GMT] "GET /SOGo/so/esoletan/Mail//0/folderINBOX/expunge HTTP/1.1" 200 2/0 0.212 - - 16K I'm sorry for asking newbie (regarding GNUstep/ObjC) question: What about replacing all occurrences of "[unsigned] int" with "NS[U]Integer"? |
|
Its not that easy to change all occurrences to NS[U]Integer ;) |
|
2012-05-11 17:10
|
NSNotFound-comparison-warnings-in-SOPE-and-other-unsigned-int-and-int-conversions-to-NSUInteger.diff (20,951 bytes)
$OpenBSD$ --- sope-appserver/NGObjWeb/NGHttp/NGHttpHeaderFields.m.orig Fri May 11 14:36:17 2012 +++ sope-appserver/NGObjWeb/NGHttp/NGHttpHeaderFields.m Fri May 11 14:38:08 2012 @@ -145,7 +145,7 @@ - (NSString *)stringValue { NSMutableString *str = [[NSMutableString allocWithZone:[self zone]] init]; - int cnt, count = [self->charsets count]; + NSUInteger cnt, count = [self->charsets count]; for (cnt = 0; cnt < count; cnt++) { if (cnt != 0) [str appendString:@","]; @@ -201,7 +201,7 @@ - (NSString *)stringValue { NSMutableString *str; - int cnt, count; + NSUInteger cnt, count; str = [[NSMutableString allocWithZone:[self zone]] init]; count = [self->types count]; @@ -260,7 +260,7 @@ - (NSString *)stringValue { NSMutableString *str = [[NSMutableString allocWithZone:[self zone]] init]; - int cnt, count = [self->languages count]; + NSUInteger cnt, count = [self->languages count]; for (cnt = 0; cnt < count; cnt++) { if (cnt != 0) [str appendString:@", "]; @@ -283,8 +283,8 @@ static void _parseUserAgent(NGHttpUserAgent *self) { if ([self->value hasPrefix:@"Mozilla"]) { // Mozilla Browser or compatible - NSRange r; - int idx, av, iv; + NSRange r; + NSUInteger idx, av, iv; r = [self->value rangeOfString:@"/"]; idx = r.location; @@ -299,7 +299,7 @@ static void _parseUserAgent(NGHttpUserAgent *self) { self->browser = @"Mozilla"; - sscanf([tmp cString], "%i.%i", &av, &iv); + sscanf([tmp cString], "%"PRIuPTR".%"PRIuPTR"", &av, &iv); self->majorVersion = av; self->minorVersion = iv; @@ -310,7 +310,7 @@ static void _parseUserAgent(NGHttpUserAgent *self) { tmp = [self->value substringFromIndex:(idx + 5)]; self->browser = @"MSIE"; - sscanf([tmp cString], "%i.%i", &av, &iv); + sscanf([tmp cString], "%"PRIuPTR".%"PRIuPTR"", &av, &iv); self->majorVersion = av; self->minorVersion = iv; } @@ -553,8 +553,8 @@ static void _parseUserAgent(NGHttpUserAgent *self) { NSData *data = [_credentials dataByDecodingBase64]; if (data) { - char *str = (char *)[data bytes]; - int len = [data length]; + char *str = (char *)[data bytes]; + NSUInteger len = [data length]; char *start = str; while ((*str != '\0') && (*str != ':') && (len > 0)) { $OpenBSD$ --- sope-appserver/WOExtensions/WOTabPanel.m.orig Fri May 11 15:00:45 2012 +++ sope-appserver/WOExtensions/WOTabPanel.m Fri May 11 15:04:27 2012 @@ -82,7 +82,7 @@ { WOComponent *sComponent; NSArray *ttabs; - unsigned i; + NSUInteger i; sComponent = [_ctx component]; ttabs = [self->tabs valueInComponent:sComponent]; @@ -118,17 +118,17 @@ if ([section isEqualToString:@"tab"]) { WOComponent *sComponent; NSArray *ttabs; - int idx; + NSUInteger idx; [_ctx consumeElementID]; // consume 'tab' sComponent = [_ctx component]; ttabs = [self->tabs valueInComponent:sComponent]; - idx = [[_ctx currentElementID] intValue]; + idx = [[_ctx currentElementID] unsignedIntegerValue]; [_ctx consumeElementID]; // consume index - if (idx >= (int)[ttabs count]) { + if (idx >= [ttabs count]) { /* index out of range */ idx = 0; } @@ -156,7 +156,7 @@ WOComponent *sComponent; NSArray *ttabs; BOOL isInForm; - unsigned i, selIdx; + NSUInteger i, selIdx; NSString *selColor, *unselColor, *s; if ([_ctx isRenderingDisabled]) { $OpenBSD$ --- sope-core/NGExtensions/NGCalendarDateRange.m.orig Fri May 11 14:06:10 2012 +++ sope-core/NGExtensions/NGCalendarDateRange.m Fri May 11 14:08:30 2012 @@ -217,7 +217,7 @@ andEndDateKey:(NSString *)e { NSMutableArray *ma; - unsigned i, count; + NSUInteger i, count; count = [self count]; ma = [NSMutableArray arrayWithCapacity:count]; @@ -243,7 +243,7 @@ } - (BOOL)dateRangeArrayContainsDate:(NSCalendarDate *)_date { - unsigned i, count; + NSUInteger i, count; if (_date == nil) return NO; @@ -256,8 +256,8 @@ } return NO; } -- (unsigned)indexOfFirstIntersectingDateRange:(NGCalendarDateRange *)_range { - unsigned i, count; +- (NSUInteger)indexOfFirstIntersectingDateRange:(NGCalendarDateRange *)_range { + NSUInteger i, count; if (_range == nil) return NO; @@ -276,7 +276,7 @@ // TODO: this is a candidate for unit testing ... // TODO: pretty "slow" algorithm, improve NSMutableArray *ma; - unsigned i, count; + NSUInteger i, count; count = [self count]; if (count < 2) @@ -289,7 +289,7 @@ NGCalendarDateRange *rangeToAdd; NGCalendarDateRange *availRange; NGCalendarDateRange *newRange; - unsigned idx; + NSUInteger idx; rangeToAdd = [self objectAtIndex:i]; idx = [ma indexOfFirstIntersectingDateRange:rangeToAdd]; $OpenBSD$ --- sope-core/NGExtensions/NGExtensions/NGCalendarDateRange.h.orig Fri May 11 14:08:47 2012 +++ sope-core/NGExtensions/NGExtensions/NGCalendarDateRange.h Fri May 11 14:09:18 2012 @@ -67,7 +67,7 @@ - (NSArray *)arrayByCreatingDateRangesFromObjectsWithStartDateKey:(NSString *)s andEndDateKey:(NSString *)e; -- (unsigned)indexOfFirstIntersectingDateRange:(NGCalendarDateRange *)_range; +- (NSUInteger)indexOfFirstIntersectingDateRange:(NGCalendarDateRange *)_range; - (BOOL)dateRangeArrayContainsDate:(NSCalendarDate *)_date; - (NSArray *)arrayByCompactingContainedDateRanges; $OpenBSD$ --- sope-gdl1/PostgreSQL/PGResultSet.m.orig Fri May 11 16:12:08 2012 +++ sope-gdl1/PostgreSQL/PGResultSet.m Fri May 11 16:12:29 2012 @@ -98,12 +98,7 @@ } - (int)indexOfFieldNamed:(NSString *)_name { -#if LIB_FOUNDATION_LIBRARY - // TBD: might be wrong even in this case? - return PQfnumber(self->results, [_name cString]); -#else return PQfnumber(self->results, [_name UTF8String]); -#endif } - (int)fieldSizeAtIndex:(unsigned int)_idx { $OpenBSD$ --- sope-gdl1/PostgreSQL/PostgreSQL72Channel.m.orig Fri May 11 15:59:50 2012 +++ sope-gdl1/PostgreSQL/PostgreSQL72Channel.m Fri May 11 16:04:23 2012 @@ -394,21 +394,29 @@ static int openConnectionCount = 0; for (cnt = 0; cnt < attrCount; cnt++) { EOAttribute *attribute; +#ifndef GDL_USE_PQFNUMBER_INDEX + NSUInteger res; +#endif attribute = [_attributes objectAtIndex:cnt]; #if GDL_USE_PQFNUMBER_INDEX self->fieldIndices[cnt] = [self->resultSet indexOfFieldNamed:[attribute columnName]]; + if (self->fieldIndices[cnt] == -1) { + [PostgreSQL72Exception raiseWithFormat: + @"attribute %@ not covered by query", + attribute]; + } #else - self->fieldIndices[cnt] = - [fieldNames indexOfObject:[attribute columnName]]; -#endif + res = [fieldNames indexOfObject:[attribute columnName]]; - if (self->fieldIndices[cnt] == NSNotFound) { + if (res == NSNotFound) { [PostgreSQL72Exception raiseWithFormat: @"attribute %@ not covered by query", attribute]; } + self->fieldIndices[cnt] = (int)res; +#endif [fieldNames replaceObjectAtIndex:self->fieldIndices[cnt] withObject:null]; } [fieldNames release]; fieldNames = nil; $OpenBSD$ --- sope-xml/DOM/DOMNodeWithChildren.m.orig Fri May 11 13:40:52 2012 +++ sope-xml/DOM/DOMNodeWithChildren.m Fri May 11 13:42:31 2012 @@ -59,7 +59,7 @@ : nil; } - (id<NSObject,DOMNode>)lastChild { - unsigned count; + NSUInteger count; return (count = [self->childNodes count]) > 0 ? [self->childNodes objectAtIndex:(count - 1)] @@ -69,7 +69,7 @@ /* modification */ - (id<NSObject,DOMNode>)removeChild:(id<NSObject,DOMNode>)_node { - unsigned idx; + NSUInteger idx; if (self->childNodes == nil) /* this node has no childnodes ! */ @@ -93,7 +93,7 @@ if ([_node nodeType] == DOM_DOCUMENT_FRAGMENT_NODE) { id fragNodes; - unsigned i, count; + NSUInteger i, count; NSMutableArray *cache; fragNodes = [_node childNodes]; @@ -133,7 +133,7 @@ /* sibling navigation */ - (id)_domNodeBeforeNode:(id)_node { - unsigned idx; + NSUInteger idx; if ((idx = [self->childNodes indexOfObject:_node]) == NSNotFound) /* given node isn't a child of this node */ @@ -145,7 +145,7 @@ return [self->childNodes objectAtIndex:(idx - 1)]; } - (id)_domNodeAfterNode:(id)_node { - unsigned idx, count; + NSUInteger idx, count; if ((count = [self->childNodes count]) == 0) /* this node has no children at all .. */ $OpenBSD$ --- sope-xml/STXSaxDriver/ExtraSTX/StructuredText.h.orig Fri May 11 14:03:41 2012 +++ sope-xml/STXSaxDriver/ExtraSTX/StructuredText.h Fri May 11 14:05:24 2012 @@ -62,7 +62,7 @@ - (void)parse; -- (int)lineType:(StructuredLine *)_line; +- (NSUInteger)lineType:(StructuredLine *)_line; - (void)separateIntoBlocks; - (void)adjustLineLevels; @@ -78,7 +78,7 @@ - (StructuredTextLiteralBlock *)buildLiteralBlock; - (StructuredTextList *)buildList; -- (int)listItemTypology:(StructuredLine *)_line; +- (NSUInteger)listItemTypology:(StructuredLine *)_line; @end $OpenBSD$ --- sope-xml/STXSaxDriver/ExtraSTX/StructuredText.m.orig Fri May 11 13:57:49 2012 +++ sope-xml/STXSaxDriver/ExtraSTX/StructuredText.m Fri May 11 14:05:12 2012 @@ -105,7 +105,7 @@ NSString *text, *currentLine, *trimmedLine; NSMutableString *buf; NSCharacterSet *set; - int i, count; + NSUInteger i, count; set = [NSCharacterSet characterSetWithCharactersInString:@"\r"]; buf = [NSMutableString stringWithCapacity:256]; @@ -278,7 +278,7 @@ [objectStack release]; } -- (int)lineType:(StructuredLine *)aLine { +- (NSUInteger)lineType:(StructuredLine *)aLine { if ([self checkForListItem:aLine]) return StructuredTextParserLine_List; @@ -357,7 +357,7 @@ if ([[text stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceCharacterSet]] hasSuffix:@"::"]) { - int length; + NSUInteger length; length = [text length]; text = [text substringToIndex:length - 2]; @@ -384,7 +384,7 @@ StructuredLine *line, *prevLine = nil; StructuredTextListItem *item = nil; StructuredStack *paragraphs; - int type; + NSUInteger type; result = nil; paragraphs = [self paragraphs]; @@ -428,7 +428,7 @@ break; case StructuredTextList_DEFINITION: { NSArray *components; - int i, count; + NSUInteger i, count; components = [text componentsSeparatedByString:@" -- "]; count = [components count]; @@ -477,10 +477,10 @@ return [result autorelease]; } -- (int)listItemTypology:(StructuredLine *)aLine { - NSString *text; - int type = NSNotFound; - int i, h, length; +- (NSUInteger)listItemTypology:(StructuredLine *)aLine { + NSString *text; + NSUInteger type = NSNotFound; + NSUInteger i, h, length; NSRange range; text = [aLine text]; $OpenBSD$ --- sope-xml/SaxObjC/SaxAttributeList.m.orig Fri May 11 13:33:18 2012 +++ sope-xml/SaxObjC/SaxAttributeList.m Fri May 11 13:36:37 2012 @@ -33,7 +33,7 @@ } - (id)initWithAttributeList:(id<SaxAttributeList>)_attrList { if ((self = [self init])) { - unsigned i; + NSUInteger i; for (i = 0; i < [_attrList count]; i++) { [self->names addObject:[_attrList nameAtIndex:i]]; @@ -46,7 +46,7 @@ - (id)initWithAttributes:(id<SaxAttributes>)_attrList { if ((self = [self init])) { - int i, c; + NSUInteger i, c; for (i = 0, c = [_attrList count]; i < c; i++) { [self->names addObject:[_attrList rawNameAtIndex:i]]; @@ -67,7 +67,7 @@ /* modify operations */ - (void)setAttributeList:(id<SaxAttributeList>)_attrList { - unsigned i; + NSUInteger i; [self clear]; @@ -95,7 +95,7 @@ } - (void)removeAttribute:(NSString *)_name { - int idx; + NSUInteger idx; if ((idx = [self->names indexOfObject:_name]) == NSNotFound) return; @@ -118,7 +118,7 @@ } - (NSString *)typeForName:(NSString *)_name { - int i; + NSUInteger i; if ((i = [self->names indexOfObject:_name]) == NSNotFound) return nil; @@ -126,7 +126,7 @@ return [self typeAtIndex:i]; } - (NSString *)valueForName:(NSString *)_name { - int i; + NSUInteger i; if ((i = [self->names indexOfObject:_name]) == NSNotFound) return nil; @@ -157,7 +157,7 @@ - (NSString *)description { NSMutableString *s; NSString *is; - int i, c; + NSUInteger i, c; s = [[NSMutableString alloc] init]; [s appendFormat:@"<%08X[%@]:", self, NSStringFromClass([self class])]; $OpenBSD$ Fix Exception in OGo when uploading a calendar. --- sope-xml/SaxObjC/SaxAttributes.m.orig Fri Mar 23 15:16:19 2012 +++ sope-xml/SaxObjC/SaxAttributes.m Fri May 11 13:40:32 2012 @@ -36,7 +36,7 @@ } - (id)initWithAttributes:(id<SaxAttributes>)_attrs { if ((self = [self init])) { - int i, c; + NSUInteger i, c; for (i = 0, c = [_attrs count]; i < c; i++) { [self addAttribute:[_attrs nameAtIndex:i] @@ -51,7 +51,7 @@ - (id)initWithAttributeList:(id<SaxAttributeList>)_attrList { if ((self = [self init])) { - unsigned i; + NSUInteger i; for (i = 0; i < [_attrList count]; i++) { [self addAttribute:[_attrList nameAtIndex:i] uri:@"" @@ -115,7 +115,7 @@ } - (NSUInteger)indexOfName:(NSString *)_localPart uri:(NSString *)_uri { - unsigned int i, c; + NSUInteger i, c; for (i = 0, c = [self count]; i < c; i++) { NSString *name; @@ -160,7 +160,7 @@ /* lookup data by name */ - (NSString *)typeForRawName:(NSString *)_rawName { - unsigned int i; + NSUInteger i; if ((i = [self indexOfRawName:_rawName]) == NSNotFound) return nil; @@ -168,7 +168,7 @@ return [self typeAtIndex:i]; } - (NSString *)typeForName:(NSString *)_localName uri:(NSString *)_uri { - unsigned int i; + NSUInteger i; if ((i = [self indexOfName:_localName uri:_uri]) == NSNotFound) return nil; @@ -177,7 +177,7 @@ } - (NSString *)valueForRawName:(NSString *)_rawName { - unsigned int i; + NSUInteger i; if ((i = [self indexOfRawName:_rawName]) == NSNotFound) return nil; @@ -185,7 +185,7 @@ return [self valueAtIndex:i]; } - (NSString *)valueForName:(NSString *)_localName uri:(NSString *)_uri { - unsigned int i; + NSUInteger i; if ((i = [self indexOfName:_localName uri:_uri]) == NSNotFound) return nil; @@ -210,7 +210,7 @@ - (NSString *)description { NSMutableString *s; NSString *is; - int i, c; + NSUInteger i, c; s = [[NSMutableString alloc] init]; [s appendFormat:@"<%08X[%@]:", self, NSStringFromClass([self class])]; $OpenBSD$ --- sope-xml/XmlRpc/NSObject+XmlRpc.h.orig Fri May 11 13:55:58 2012 +++ sope-xml/XmlRpc/NSObject+XmlRpc.h Fri May 11 13:56:27 2012 @@ -29,7 +29,7 @@ @interface NSObject(XmlRpcValues) + (id)objectWithXmlRpcType:(NSString *)_type - characters:(unichar *)_chars length:(int)_len; + characters:(unichar *)_chars length:(NSUInteger)_len; @end $OpenBSD$ --- sope-xml/XmlRpc/NSObject+XmlRpc.m.orig Fri May 11 13:52:30 2012 +++ sope-xml/XmlRpc/NSObject+XmlRpc.m Fri May 11 13:55:47 2012 @@ -31,25 +31,25 @@ @interface NSString(XmlRpcParsing) - (id)initWithXmlRpcType:(NSString *)_type characters:(unichar *)_chars - length:(int)_len; + length:(NSUInteger)_len; @end @interface NSDate(XmlRpcParsing) - (id)initWithXmlRpcType:(NSString *)_type characters:(unichar *)_chars - length:(int)_len; + length:(NSUInteger)_len; @end @interface NSNumber(XmlRpcParsing) - (id)initWithXmlRpcType:(NSString *)_type characters:(unichar *)_chars - length:(int)_len; + length:(NSUInteger)_len; @end @interface NSData(XmlRpcParsing) - (id)initWithXmlRpcType:(NSString *)_type characters:(unichar *)_chars - length:(int)_len; + length:(NSUInteger)_len; @end @interface NSData(UsedNGExtensions) @@ -132,7 +132,7 @@ } + (id)objectWithXmlRpcType:(NSString *)_type - characters:(unichar *)_chars length:(int)_len + characters:(unichar *)_chars length:(NSUInteger)_len { static NSDictionary *typeToClass = nil; Class ObjClass = Nil; @@ -171,7 +171,7 @@ } - (id)initWithXmlRpcType:(NSString *)_type - characters:(unichar *)_chars length:(int)_len + characters:(unichar *)_chars length:(NSUInteger)_len { if ([self respondsToSelector:@selector(initWithString:)]) { NSString *s; @@ -194,7 +194,7 @@ /* NSData represents the xml-rpc base type 'base64' */ - (id)initWithXmlRpcType:(NSString *)_type - characters:(unichar *)_chars length:(int)_len + characters:(unichar *)_chars length:(NSUInteger)_len { NSString *v; @@ -215,7 +215,7 @@ /* NSDate represents the xml-rpc type dateTime.iso8601: */ - (id)initWithXmlRpcType:(NSString *)_type - characters:(unichar *)_chars length:(int)_len + characters:(unichar *)_chars length:(NSUInteger)_len { /* eg 19980717T14:08:55 */ if (_len < 17) { @@ -283,7 +283,7 @@ /* NSNumber represents the xml-rpc base types: 'int', 'double', 'boolean': */ - (id)initWithXmlRpcType:(NSString *)_type - characters:(unichar *)_chars length:(int)_len + characters:(unichar *)_chars length:(NSUInteger)_len { if ([_type isEqualToString:@"boolean"]) { BOOL v; @@ -318,7 +318,7 @@ @implementation NSString(XmlRpcParsing) - (id)initWithXmlRpcType:(NSString *)_type - characters:(unichar *)_chars length:(int)_len + characters:(unichar *)_chars length:(NSUInteger)_len { /* this is *never* called, since NSString+alloc returns a NSTemporaryString*/ return [self initWithCharacters:_chars length:_len]; $OpenBSD$ --- sope-xml/XmlRpc/XmlRpcDecoder.m.orig Fri May 11 16:20:10 2012 +++ sope-xml/XmlRpc/XmlRpcDecoder.m Fri May 11 16:46:42 2012 @@ -589,8 +589,8 @@ static BOOL doDebug = NO; int result; if ((newValue = [self beginDecodingKey:_key]) == nil) - /* any useful alternatives ? */ - return NSNotFound; + /* NSKeyedArchiver returns 0, we too */ + return 0; result = [self decodeInt]; [self finishedDecodingKey]; $OpenBSD$ --- sope-xml/XmlRpc/XmlRpcSaxHandler.m.orig Fri May 11 13:43:10 2012 +++ sope-xml/XmlRpc/XmlRpcSaxHandler.m Fri May 11 13:57:24 2012 @@ -158,7 +158,7 @@ static BOOL doDebug = NO; - (void)end_name { self->nextCharactersProcessor = NULL; } -- (void)_name:(unichar *)_chars length:(int)_len { +- (void)_name:(unichar *)_chars length:(NSUInteger)_len { NSString *name; name = [NSString stringWithCharacters:_chars length:_len]; [self->memberNameStack addObject:name]; @@ -184,7 +184,7 @@ static BOOL doDebug = NO; self->valueNestingLevel--; } -- (void)_dateValue:(unichar *)_chars length:(int)_len { +- (void)_dateValue:(unichar *)_chars length:(NSUInteger)_len { if (self->dateTime) return; @@ -193,7 +193,7 @@ static BOOL doDebug = NO; retain]; } -- (void)_baseValue:(unichar *)_chars length:(int)_len { +- (void)_baseValue:(unichar *)_chars length:(NSUInteger)_len { id value; if (self->valueNestingLevel == 0) { @@ -239,8 +239,8 @@ static BOOL doDebug = NO; self->nextCharactersProcessor = @selector(_baseValue:length:); } - (void)start_dateTime:(id<SaxAttributes>)_attrs { - NSString *tz; - int idx; + NSString *tz; + NSUInteger idx; [self->timeZone release]; self->timeZone = nil; [self->dateTime release]; self->dateTime = nil; @@ -467,7 +467,7 @@ static BOOL doDebug = NO; - (void)end_methodName { self->nextCharactersProcessor = NULL; } -- (void)_methodName:(unichar *)_chars length:(int)_len { +- (void)_methodName:(unichar *)_chars length:(NSUInteger)_len { [self->methodName release]; self->methodName = [[NSString alloc] initWithCharacters:_chars length:_len]; } @@ -529,8 +529,8 @@ static BOOL doDebug = NO; attributes:(id<SaxAttributes>)_attrs { NSString *tmp = nil; - SEL sel; - int idx; + SEL sel; + NSUInteger idx; [self->tagStack addObject:_rawName]; @@ -559,14 +559,14 @@ static BOOL doDebug = NO; namespace:(NSString *)_ns rawName:(NSString *)_rawName { - unsigned stackDepth, lastIdx; + NSUInteger stackDepth, lastIdx; NSString *tmp; SEL sel; if (self->nextCharactersProcessor != NULL) { - void (*m)(id, SEL, unichar *, int); + void (*m)(id, SEL, unichar *, NSUInteger); unichar *chars; - unsigned len; + NSUInteger len; len = [self->characters length]; chars = malloc(sizeof(unichar)*len); @@ -606,7 +606,7 @@ static BOOL doDebug = NO; } } -- (void)characters:(unichar *)_chars length:(int)_len { +- (void)characters:(unichar *)_chars length:(NSUInteger)_len { if (_len > 0) { [self->characters appendString: [NSString stringWithCharacters:_chars length:_len]]; |
This is the fix to SOPE. I hope I did not included any stuff that already got fixed from other patches to other bugs I uploaded. SOGo/OGo both still seem to be fine. Went through all major parts of both web interfaces and didn't stumbled above a problem yet. This is a large and intrusive patch. There are also some int to NSUInteger chages, where applicable. For example usually methods like -count -length ... return NSUInteger, and not unsigned int or int. |
|
2012-05-11 17:24
|
NSNotFound-fixes-for-SOGo.diff (7,848 bytes)
$OpenBSD$ --- SOPE/NGCards/CardGroup.m.orig Fri Mar 23 16:26:48 2012 +++ SOPE/NGCards/CardGroup.m Fri May 11 18:23:53 2012 @@ -354,7 +354,7 @@ static NGCardsSaxHandler *sax = nil; - (void) setChildrenAsCopy: (NSMutableArray *) someChildren { - unsigned int count, max; + NSUInteger count, max; ASSIGN (children, someChildren); @@ -399,7 +399,7 @@ static NGCardsSaxHandler *sax = nil; - (NSString *) description { NSMutableString *str; - unsigned int count, max; + NSUInteger count, max; str = [NSMutableString stringWithCapacity:64]; [str appendFormat:@"<%p[%@]:%@", @@ -421,7 +421,7 @@ static NGCardsSaxHandler *sax = nil; - (void) replaceThisElement: (CardElement *) oldElement withThisOne: (CardElement *) newElement { - unsigned int index; + NSUInteger index; index = [children indexOfObject: oldElement]; if (index != NSNotFound) $OpenBSD$ --- SoObjects/Mailer/SOGoMailObject+Draft.m.orig Fri Mar 23 16:26:51 2012 +++ SoObjects/Mailer/SOGoMailObject+Draft.m Fri May 11 18:26:26 2012 @@ -53,7 +53,7 @@ nil }; BOOL hasPrefix; - unsigned int i; + NSUInteger i; NSString *subject, *newSubject; hasPrefix = NO; @@ -99,7 +99,7 @@ NSDictionary *parts; NSString *rawPart, *content, *contentKey; SOGoUserDefaults *ud; - int index; + NSUInteger index; BOOL htmlComposition, htmlContent; content = @""; @@ -189,7 +189,7 @@ static NSString *sescape[] = { @"/", @"..", @"~", @"\"", @"'", @" ", @".", nil }; - unsigned int count, length; + NSUInteger count, length; subject = [self decodedSubject]; length = [subject length]; @@ -298,7 +298,7 @@ NSString *newPath; NSArray *subparts; NSString *type; - unsigned int i; + NSUInteger i; type = [[part objectForKey: @"type"] lowercaseString]; if ([type isEqualToString: @"multipart"]) $OpenBSD$ --- SoObjects/SOGo/NSString+Utilities.m.orig Tue Mar 6 10:24:38 2012 +++ SoObjects/SOGo/NSString+Utilities.m Tue Mar 6 10:25:17 2012 @@ -470,7 +470,8 @@ static int cssEscapingCount; - (int) timeValue { - int i, time; + int time; + NSInteger i; if ([self length] > 0) { $OpenBSD$ --- UI/MailPartViewers/UIxMailPartAlternativeViewer.m.orig Fri Mar 23 16:26:53 2012 +++ UI/MailPartViewers/UIxMailPartAlternativeViewer.m Fri May 11 18:30:29 2012 @@ -43,7 +43,7 @@ @interface UIxMailPartAlternativeViewer : UIxMailPartViewer { id childInfo; - unsigned int childIndex; + NSUInteger childIndex; } @end @@ -70,7 +70,7 @@ - (NSArray *) childPartTypes { NSMutableArray *types; - unsigned i, count; + NSUInteger i, count; NSArray *childParts; childParts = [[self bodyInfo] valueForKey:@"parts"]; @@ -89,10 +89,10 @@ return types; } -- (unsigned int) _preferredTypesPart: (NSArray *) types +- (NSUInteger) _preferredTypesPart: (NSArray *) types { - unsigned int count, max; - unsigned int part; + NSUInteger count, max; + NSUInteger part; const NSString *priorities[] = { @"multipart/related", @"multipart/mixed", @"text/calendar", @"text/html", @"text/plain" }; @@ -113,7 +113,7 @@ - (int) _selectPartIndexFromTypes: (NSArray *) _types { /* returns the index of the selected part or NSNotFound */ - unsigned count, max, part; + NSUInteger count, max, part; part = [self _preferredTypesPart: _types]; if (part == NSNotFound) @@ -136,7 +136,7 @@ - (void) selectChildInfo { - unsigned idx; + NSUInteger idx; [childInfo release]; childInfo = nil; childIndex = 0; @@ -164,7 +164,7 @@ return childInfo; } -- (unsigned int) childIndex +- (NSUInteger) childIndex { if (!childIndex) [self selectChildInfo]; @@ -176,7 +176,7 @@ { char buf[8]; - sprintf (buf, "%d", [self childIndex] + 1); + sprintf (buf, "%"PRIuPTR"", [self childIndex] + 1); return [NSString stringWithCString:buf]; } $OpenBSD$ --- UI/MailerUI/UIxMailEditor.m.orig Sun Jan 22 14:29:40 2012 +++ UI/MailerUI/UIxMailEditor.m Sun Jan 22 14:30:25 2012 @@ -384,7 +384,7 @@ static NSArray *infoKeys = nil; { if (![_info isNotNull]) return; [self debugWithFormat:@"loading info ..."]; - [self takeValuesFromDictionary:_info]; + [self setValuesForKeysWithDictionary:_info]; } - (NSDictionary *) storeInfo $OpenBSD$ --- UI/MailerUI/UIxMailMainFrame.m.orig Fri Mar 23 16:26:53 2012 +++ UI/MailerUI/UIxMailMainFrame.m Fri May 11 18:33:48 2012 @@ -125,8 +125,8 @@ // TODO: this is ugly, create reusable link facility in SOPE // TODO: remove 'search' and 'filterpopup', preserve sorting NSMutableString *ms; - NSArray *qp; - unsigned i, count; + NSArray *qp; + NSUInteger i, count; qp = [[u substringFromIndex:(r.location + r.length)] componentsSeparatedByString:@"&"]; @@ -193,8 +193,8 @@ SOGoMailAccounts *co; SOGoContactFolders *folders; SOGoParentFolder *folder; - WORequest *request; - int i, count; + WORequest *request; + NSUInteger i, count; parameters = nil; co = [self clientObject]; @@ -549,7 +549,7 @@ NSArray *available; NSDictionary *metaData; SOGoUserDefaults *ud; - unsigned int i; + NSUInteger i; if (!columnsOrder) { @@ -636,8 +636,8 @@ NSMutableArray *folders; NSMutableString *path; SOGoUserDefaults *ud; - NSString *s; - int i, j, k; + NSString *s; + NSUInteger i, j, k; ud = [[context activeUser] userDefaults]; folders = [NSMutableArray array]; $OpenBSD$ --- UI/Scheduler/UIxCalView.m.orig Fri Mar 23 16:26:54 2012 +++ UI/Scheduler/UIxCalView.m Fri May 11 18:36:39 2012 @@ -118,7 +118,7 @@ - (NSArray *) filterAppointments:(NSArray *) _apts { NSMutableArray *filtered; - unsigned i, count, p, pCount; + NSUInteger i, count, p, pCount; NSString *email, *partmailsString, *state, *pEmail; NSDictionary *info, *primaryIdentity; NSArray *partmails, *partstates; @@ -370,7 +370,7 @@ { NSArray *apts; NSMutableArray *filtered; - unsigned i, count; + NSUInteger i, count; if (allDayApts) return allDayApts; @@ -532,7 +532,8 @@ NSString *uidsString, *loc, *prevMethod, *userFolderID; id <WOActionResults> r; BOOL useGroups; - unsigned index; + NSUInteger index; + uidsString = [self queryParameterForKey: @"userUIDString"]; uidsString = [uidsString stringByTrimmingSpaces]; $OpenBSD$ --- UI/Scheduler/UIxComponentEditor.m.orig Fri Mar 23 16:26:54 2012 +++ UI/Scheduler/UIxComponentEditor.m Fri May 11 18:38:55 2012 @@ -525,7 +525,7 @@ iRANGE(2); iCalTrigger *aTrigger; NSString *duration, *quantity; unichar c; - unsigned int i; + NSUInteger i; if ([component hasAlarms]) { @@ -1289,7 +1289,7 @@ iRANGE(2); NSString *currentOwner; SOGoAppointmentFolder *currentCalendar; SOGoUser *currentUser; - unsigned i; + NSUInteger i; calendars = [self calendarList]; owners = [NSMutableArray arrayWithCapacity: [calendars count]]; @@ -1562,7 +1562,7 @@ RANGE(2); { NSString *cycleRep; NSArray *cycles; - unsigned i, count; + NSUInteger i, count; if (!_rrule) return [[self cycles] objectAtIndex:0]; @@ -1721,7 +1721,7 @@ RANGE(2); // s = [self queryParameterForKey:_qp]; // if(s && [s length] > 0) { // NSArray *es; -// unsigned i, count; +// NSUInteger i, count; // es = [s componentsSeparatedByString: @","]; // count = [es count]; @@ -1766,7 +1766,7 @@ RANGE(2); - (void) _handleAttendeesEdition { NSMutableArray *newAttendees; - unsigned int count, max; + NSUInteger count, max; NSString *currentEmail; iCalPerson *currentAttendee; NSString *json, *role, *partstat; @@ -2189,7 +2189,7 @@ RANGE(2); iCalTrigger *aTrigger; iCalAlarm *anAlarm; NSString *aValue; - unsigned int index; + NSUInteger index; anAlarm = [iCalAlarm new]; |
So the last two patches from Today should be used for testing. Further the patches to bugs reports: 0001800 and 0001801 which also contain unsigned int to NSUInteger conversions. Those two are already applied to the SOPE sources since yesterday. Hope it will now work for you too, and my patches don't break other things ;) Sebastian |
|
All the patches need to be applied or just the last two ones? |
|
Just the last two, the one for SOPE, and the one for SOGo. |
|
Fixes applied: and: |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2012-03-05 18:56 | buzzdee | New Issue | |
2012-03-05 18:57 |
|
Note Added: 0003521 | |
2012-03-05 19:04 | buzzdee | File Added: patch-UI_MailerUI_UIxMailMainFrame_m | |
2012-03-05 19:05 | buzzdee | Note Added: 0003522 | |
2012-03-05 19:06 | buzzdee | Note Added: 0003523 | |
2012-03-05 19:08 | buzzdee | Note Added: 0003524 | |
2012-03-05 19:17 |
|
Note Added: 0003525 | |
2012-03-06 11:13 | buzzdee | Note Added: 0003527 | |
2012-03-06 11:13 | buzzdee | Note Added: 0003528 | |
2012-03-06 11:15 | buzzdee | File Added: sope-patches-for-64-bit-and-deprecation-fixes.diff | |
2012-03-06 11:15 | buzzdee | File Added: sogo-64Bit-fixes-and-other-minor-things.diff | |
2012-03-06 11:30 | buzzdee | Note Added: 0003529 | |
2012-03-06 17:48 | buzzdee | Note Added: 0003531 | |
2012-03-07 16:05 | buzzdee | Note Added: 0003547 | |
2012-03-19 18:34 | arigion | Note Added: 0003597 | |
2012-03-19 19:00 | buzzdee | File Added: fix_64_Bit_exceptions.diff | |
2012-03-19 19:02 | buzzdee | Note Added: 0003598 | |
2012-03-26 13:55 | arigion | Note Added: 0003647 | |
2012-04-14 12:51 | soletan | Note Added: 0003739 | |
2012-04-14 13:03 | soletan | Note Edited: 0003739 | |
2012-05-11 17:09 | buzzdee | Note Added: 0003894 | |
2012-05-11 17:10 | buzzdee | File Added: NSNotFound-comparison-warnings-in-SOPE-and-other-unsigned-int-and-int-conversions-to-NSUInteger.diff | |
2012-05-11 17:14 | buzzdee | Note Added: 0003895 | |
2012-05-11 17:24 | buzzdee | File Added: NSNotFound-fixes-for-SOGo.diff | |
2012-05-11 17:28 | buzzdee | Note Added: 0003896 | |
2012-05-22 17:09 | ludovic | Note Added: 0003939 | |
2012-05-22 17:09 | ludovic | Target Version | => 1.3.16 |
2012-05-22 20:50 | buzzdee | Note Added: 0003963 | |
2012-05-29 20:17 | ludovic | Note Added: 0003983 | |
2012-05-29 20:17 | ludovic | Status | new => resolved |
2012-05-29 20:17 | ludovic | Fixed in Version | => 1.3.16 |
2012-05-29 20:17 | ludovic | Resolution | open => fixed |
2012-05-29 20:17 | ludovic | Assigned To | => ludovic |
2012-05-29 20:17 | ludovic | Status | resolved => closed |