Commits

Ronald Oussoren committed 6f2b1e6

Fix most, if not all, 64-bit issues in the Cocoa wrappers.

Comments (0)

Files changed (16)

pyobjc-framework-Cocoa/Lib/AppKit/PyObjC.bridgesupport

     <arg type='@' type64='@' />
     <arg type='@' type64='@' />
     <arg type='@' type64='@' />
-    <arg sel_of_type='v@:@i^v' type=':' />
-    <arg sel_of_type='v@:@i^v' type=':' type64=':' />
+    <arg sel_of_type='v@:@i^v' sel_of_type64='v@:@q^v' type=':' />
+    <arg sel_of_type='v@:@i^v' sel_of_type64='v@:@q^v' type=':' type64=':' />
     <arg type='^v' type64='^v' />
     <arg type='@' type64='@' printf_format='true' />
   </function>
     <arg type='@' type64='@' />
     <arg type='@' type64='@' />
     <arg type='@' type64='@' />
-    <arg sel_of_type='v@:@i^v' type=':' />
-    <arg sel_of_type='v@:@i^v' type=':' type64=':' />
+    <arg sel_of_type='v@:@i^v' sel_of_type64='v@:@q^v' type=':' />
+    <arg sel_of_type='v@:@i^v' sel_of_type64='v@:@q^v' type=':' type64=':' />
     <arg type='^v' type64='^v' />
     <arg type='@' type64='@' printf_format='true' />
   </function>
     <arg type='@' type64='@' />
     <arg type='@' type64='@' />
     <arg type='@' type64='@' />
-    <arg sel_of_type='v@:@i^v' type=':' />
-    <arg sel_of_type='v@:@i^v' type=':' type64=':' />
+    <arg sel_of_type='v@:@i^v' sel_of_type64='v@:@q^v' type=':' />
+    <arg sel_of_type='v@:@i^v' sel_of_type64='v@:@q^v' type=':' type64=':' />
     <arg type='^v' type64='^v' />
     <arg type='@' type64='@' printf_format='true' />
   </function>
   <informal_protocol name='NSDraggingDestination'>
     <method selector='concludeDragOperation:' type='v@:@' />
     <method selector='draggingEnded:' type='v@:@' />
-    <method selector='draggingEntered:' type='I@:@' />
+    <method selector='draggingEntered:' type='I@:@' type64='Q@:@'/>
     <method selector='draggingExited:' type='v@:@' />
-    <method selector='draggingUpdated:' type='I@:@' />
+    <method selector='draggingUpdated:' type='I@:@' type64='Q@:@'/>
     <method selector='performDragOperation:' type='B@:@' />
     <method selector='prepareForDragOperation:' type='B@:@' />
     <method selector='wantsPeriodicDraggingUpdates' type='B@:' />
   <informal_protocol name='NSDraggingSource'>
     <method selector='draggedImage:beganAt:' type='v@:@{_NSPoint=ff}' type64='v@:@{CGPoint=dd}' />
     <method selector='draggedImage:endedAt:deposited:' type='v@:@{_NSPoint=ff}B' type64='v@:@{CGPoint=dd}B' />
-    <method selector='draggedImage:endedAt:operation:' type='v@:@{_NSPoint=ff}I' />
+    <method selector='draggedImage:endedAt:operation:' type='v@:@{_NSPoint=ff}I' type64='v@:@{CGPoint=dd}I' />
     <method selector='draggedImage:movedTo:' type='v@:@{_NSPoint=ff}' type64='v@:@{CGPoint=dd}' />
-    <method selector='draggingSourceOperationMaskForLocal:' type='I@:B' />
+    <method selector='draggingSourceOperationMaskForLocal:' type='I@:B' type64='Q@:B'/>
     <method selector='ignoreModifierKeysWhileDragging' type='B@:' />
     <!-- <method selector='namesOfPromisedFilesDroppedAtDestination:' type='@@:@' /> -->
   </informal_protocol>
   </informal_protocol>
   <informal_protocol name='NSImageDelegate'>
     <method selector='image:didLoadPartOfRepresentation:withValidRows:' type='v@:@@i' type64='v@:@@q' />
-    <method selector='image:didLoadRepresentation:withStatus:' type='v@:@@I' />
+    <method selector='image:didLoadRepresentation:withStatus:' type='v@:@@I' type64='v@:@@Q'/>
     <method selector='image:didLoadRepresentationHeader:' type='v@:@@' />
     <method selector='image:willLoadRepresentation:' type='v@:@@' />
     <method selector='imageDidNotDraw:inRect:' type='@@:@{_NSRect={_NSPoint=ff}{_NSSize=ff}}' type64='@@:@{CGRect={CGPoint=dd}{CGSize=dd}}' />
     <method selector='outlineView:persistentObjectForItem:' type='@@:@@' /> -->
     <method selector='outlineView:setObjectValue:forTableColumn:byItem:' type='v@:@@@@' />
     <method selector='outlineView:sortDescriptorsDidChange:' type='v@:@@' />
-    <method selector='outlineView:validateDrop:proposedItem:proposedChildIndex:' type='I@:@@@i' />
+    <method selector='outlineView:validateDrop:proposedItem:proposedChildIndex:' type='I@:@@@i' type64='Q@:@@@q' />
     <method selector='outlineView:writeItems:toPasteboard:' type='B@:@@@' />
   </informal_protocol>
   <informal_protocol name='NSOutlineViewDelegate'>
     <method class_method='true' selector='setDefaultPlaceholder:forMarker:withBinding:' type='v@:@@@' />
   </informal_protocol>
   <informal_protocol name='NSRuleEditorDelegateMethods'>
-    <method selector='ruleEditor:child:forCriterion:withRowType:' type='@@:@i@I' />
+    <method selector='ruleEditor:child:forCriterion:withRowType:' type='@@:@i@I' type64='@@:@q@Q' />
     <method selector='ruleEditor:displayValueForCriterion:inRow:' type='@@:@@i' type64='@@:@@q' />
-    <method selector='ruleEditor:numberOfChildrenForCriterion:withRowType:' type='i@:@@I' />
+    <method selector='ruleEditor:numberOfChildrenForCriterion:withRowType:' type='i@:@@I' type64='q@:@@Q'/>
     <method selector='ruleEditor:predicatePartsForCriterion:withDisplayValue:inRow:' type='@@:@@@i' type64='@@:@@@q' />
     <method selector='ruleEditorRowsDidChange:' type='v@:@' />
   </informal_protocol>
   </informal_protocol>
   <informal_protocol name='NSTableDataSource'>
     <method selector='numberOfRowsInTableView:' type='i@:@' type64='q@:@' />
-    <method selector='tableView:acceptDrop:row:dropOperation:' type='B@:@@iI' />
+    <method selector='tableView:acceptDrop:row:dropOperation:' type='B@:@@iI' type64='B@:@@qQ' />
     <!-- <method selector='tableView:namesOfPromisedFilesDroppedAtDestination:forDraggedRowsWithIndexes:' type='@@:@@@' /> -->
     <method selector='tableView:objectValueForTableColumn:row:' type='@@:@@i' type64='@@:@@q' />
     <method selector='tableView:setObjectValue:forTableColumn:row:' type='v@:@@@i' type64='v@:@@@q' />
     <method selector='tableView:sortDescriptorsDidChange:' type='v@:@@' />
-    <method selector='tableView:validateDrop:proposedRow:proposedDropOperation:' type='I@:@@iI' />
+    <method selector='tableView:validateDrop:proposedRow:proposedDropOperation:' type='I@:@@iI' type64='Q@:@@qQ'/>
     <method selector='tableView:writeRows:toPasteboard:' type='B@:@@@' />
     <method selector='tableView:writeRowsWithIndexes:toPasteboard:' type='B@:@@@' />
   </informal_protocol>
     <method selector='tokenFieldCell:readFromPasteboard:' type='@@:@@' />
     <method selector='tokenFieldCell:representedObjectForEditingString:' type='@@:@@' /> -->
     <method selector='tokenFieldCell:shouldAddObjects:atIndex:' type='@@:@@I' type64='@@:@@Q' />
-    <method selector='tokenFieldCell:styleForRepresentedObject:' type='I@:@@' />
+    <method selector='tokenFieldCell:styleForRepresentedObject:' type='I@:@@' type64='Q@:@@'/>
     <method selector='tokenFieldCell:writeRepresentedObjects:toPasteboard:' type='B@:@@@' />
   </informal_protocol>
   <informal_protocol name='NSTokenFieldDelegate'>
     </method>
     <method selector='shouldBreakLineByHyphenatingBeforeCharacterAtIndex:'>
       <retval type='B' />
-      <arg index='0' type='I' />
+      <arg index='0' type='I' type64='Q' />
     </method>
     <method selector='shouldBreakLineByWordBeforeCharacterAtIndex:'>
       <retval type='B' />
-      <arg index='0' type='I' />
+      <arg index='0' type='I' type64='Q' />
     </method>
     <method selector='substituteGlyphsInRange:withGlyphs:'>
       <arg index='0' type='{_NSRange=II}' type64='{_NSRange=QQ}' />
     </method>
     <method selector='sortUsingFunction:context:'>
 	    <arg index='0' function_pointer='true' function_pointer_retained='false'>
-		    <retval type='i'/>
+		    <retval type='i' type64='q'/>
 		    <arg type='@' />
 		    <arg type='@' />
 		    <arg type='@' />
 	    <arg index='1' type='@' />
     </method>
     <method selector='sortUsingSelector:'>
-      <arg index='0' sel_of_type='i@:@' />
+      <arg index='0' sel_of_type='i@:@' sel_of_type64='q@:@' />
     </method>
     <method selector='tabKeyTraversesCells'>
       <retval type='B' />
     </method>
     <method selector='draggedImage:endedAt:operation:'>
       <arg index='1' type='{_NSPoint=ff}' type64='{CGPoint=dd}' />
-      <arg index='2' type='I' />
+      <arg index='2' type='I' type64='Q' />
     </method>
     <method selector='draggedImage:movedTo:'>
       <arg index='1' type='{_NSPoint=ff}' type64='{CGPoint=dd}' />
       <retval type='{_NSPoint=ff}' type64='{CGPoint=dd}' />
     </method>
     <method selector='draggingEntered:'>
-      <retval type='I' />
+      <retval type='I' type64='Q' />
     </method>
     <method selector='draggingLocation'>
       <retval type='{_NSPoint=ff}' type64='{CGPoint=dd}' />
       <retval type='i' type64='q' />
     </method>
     <method selector='draggingSourceOperationMask'>
-      <retval type='I' />
+      <retval type='I' type64='Q' />
     </method>
     <method selector='draggingSourceOperationMaskForLocal:'>
-      <retval type='I' />
+      <retval type='I' type64='Q' />
       <arg index='0' type='B' />
     </method>
     <method selector='draggingUpdated:'>
-      <retval type='I' />
+      <retval type='I' type64='Q' />
     </method>
     <method selector='drawWithFrame:inView:'>
       <retval type='v' />
       <arg index='2' type='i' type64='q' />
     </method>
     <method selector='image:didLoadRepresentation:withStatus:'>
-      <arg index='2' type='I' />
+      <arg index='2' type='I' type64='Q' />
     </method>
     <method selector='imageDidNotDraw:inRect:'>
       <arg index='1' type='{_NSRect={_NSPoint=ff}{_NSSize=ff}}' type64='{CGRect={CGPoint=dd}{CGSize=dd}}' />
       <arg index='5' type='{_NSPoint=ff}' type64='{CGPoint=dd}' />
     </method>
     <method selector='outlineView:validateDrop:proposedItem:proposedChildIndex:'>
-      <retval type='I' />
+      <retval type='I' type64='Q' />
       <arg index='3' type='i' type64='q' />
     </method>
     <method selector='outlineView:writeItems:toPasteboard:'>
       <retval type='B' />
     </method>
     <method selector='pathControl:validateDrop:'>
-      <retval type='I' />
+      <retval type='I' type64='Q' />
     </method>
     <method selector='pathControl:willDisplayOpenPanel:'>
       <retval type='v' />
     </method>
     <method selector='ruleEditor:child:forCriterion:withRowType:'>
       <arg index='1' type='i' type64='q' />
-      <arg index='3' type='I' />
+      <arg index='3' type='I' type64='Q' />
     </method>
     <method selector='ruleEditor:displayValueForCriterion:inRow:'>
       <arg index='2' type='i' type64='q' />
     </method>
     <method selector='ruleEditor:numberOfChildrenForCriterion:withRowType:'>
       <retval type='i' type64='q' />
-      <arg index='2' type='I' />
+      <arg index='2' type='I' type64='Q' />
     </method>
     <method selector='ruleEditor:predicatePartsForCriterion:withDisplayValue:inRow:'>
       <arg index='3' type='i' type64='q' />
     <method selector='tableView:acceptDrop:row:dropOperation:'>
       <retval type='B' />
       <arg index='2' type='i' type64='q' />
-      <arg index='3' type='I' />
+      <arg index='3' type='I' type64='Q' />
     </method>
     <method selector='tableView:dataCellForTableColumn:row:'>
       <retval type='@' />
       <arg index='2' type='i' type64='q' />
     </method>
     <method selector='tableView:validateDrop:proposedRow:proposedDropOperation:'>
-      <retval type='I' />
+      <retval type='I' type64='Q' />
       <arg index='2' type='i' type64='q' />
-      <arg index='3' type='I' />
+      <arg index='3' type='I' type64='Q' />
     </method>
     <method selector='tableView:willDisplayCell:forTableColumn:row:'>
       <retval type='v' />
     </method>
     <method selector='textView:completions:forPartialWordRange:indexOfSelectedItem:'>
       <arg index='2' type='{_NSRange=II}' type64='{_NSRange=QQ}' />
-      <arg index='3' type_modifier='N' type='^i' type64='^l' />
+      <arg index='3' type_modifier='N' type='^i' type64='^q' />
     </method>
     <method selector='textView:doCommandBySelector:'>
       <retval type='B' />
     </method>
     <method selector='tokenField:completionsForSubstring:indexOfToken:indexOfSelectedItem:'>
       <arg index='2' type='i' type64='q' />
-      <arg index='3' type_modifier='o' type='^i'  type64='^l'/>
+      <arg index='3' type_modifier='o' type='^i'  type64='^q'/>
     </method>
     <method selector='tokenField:hasMenuForRepresentedObject:'>
       <retval type='B' />
       <arg index='2' type='I' type64='Q' />
     </method>
     <method selector='tokenField:styleForRepresentedObject:'>
-      <retval type='I' />
+      <retval type='I' type64='Q' />
     </method>
     <method selector='tokenField:writeRepresentedObjects:toPasteboard:'>
       <retval type='B' />
     </method>
     <method selector='tokenFieldCell:completionsForSubstring:indexOfToken:indexOfSelectedItem:'>
       <arg index='2' type='i' type64='q' />
-      <arg index='3' type_modifier='o' type='^i' type64='^l' />
+      <arg index='3' type_modifier='o' type='^i' type64='^q' />
     </method>
     <method selector='tokenFieldCell:hasMenuForRepresentedObject:'>
       <retval type='B' />
       <arg index='2' type='I' type64='Q' />
     </method>
     <method selector='tokenFieldCell:styleForRepresentedObject:'>
-      <retval type='I' />
+      <retval type='I' type64='Q' />
     </method>
     <method selector='tokenFieldCell:writeRepresentedObjects:toPasteboard:'>
       <retval type='B' />
       <retval type='B' />
     </method>
     <method selector='beginForDirectory:file:types:modelessDelegate:didEndSelector:contextInfo:'>
-      <arg index='4' sel_of_type='v@:@i^v' type=':' />
+      <arg index='4' sel_of_type='v@:@i^v' sel_of_type64='v@:@q^v' type=':' />
       <arg index='5' type='^v' />
     </method>
     <method selector='beginSheetForDirectory:file:types:modalForWindow:modalDelegate:didEndSelector:contextInfo:'>
-      <arg index='5' sel_of_type='v@:@i^v' />
+      <arg index='5' sel_of_type='v@:@i^v' sel_of_type64='v@:@q^v' />
       <arg index='6' type='^v' />
     </method>
     <method selector='canChooseDirectories'>
   </class>
   <class name='NSPageLayout'>
     <method selector='beginSheetWithPrintInfo:modalForWindow:delegate:didEndSelector:contextInfo:'>
-      <arg index='3' sel_of_type='v@:@i^v' />
+      <arg index='3' sel_of_type='v@:@i^v' sel_of_type64='v@:@q^v' />
       <arg index='4' type='^v' />
     </method>
   </class>
   </class>
   <class name='NSPrintPanel'>
     <method selector='beginSheetWithPrintInfo:modalForWindow:delegate:didEndSelector:contextInfo:'>
-      <arg index='3' sel_of_type='v@:@i^v' />
+      <arg index='3' sel_of_type='v@:@i^v' sel_of_type64='v@:@q^v' />
       <arg index='4' type='^v' />
     </method>
   </class>
       <retval type='B' />
     </method>
     <method selector='beginSheetForDirectory:file:types:modalForWindow:modalDelegate:didEndSelector:contextInfo:'>
-      <arg index='5' sel_of_type='v@:@i^v' />
+      <arg index='5' sel_of_type='v@:@i^v' sel_of_type64='v@:@q^v' />
       <arg index='6' type='^v' />
     </method>
     <method selector='beginForDirectory:file:types:modelessDelegate:didEndSelector:contextInfo:'>
-      <arg index='4' sel_of_type='v@:@i^v' type=':' />
+      <arg index='4' sel_of_type='v@:@i^v' type=':' sel_of_type64='v@:@q^v' />
       <arg index='5' type='^v' />
     </method>
     <method selector='beginSheetForDirectory:file:modalForWindow:modalDelegate:didEndSelector:contextInfo:'>
-      <arg index='4' sel_of_type='v@:@i^v' />
+      <arg index='4' sel_of_type='v@:@i^v' sel_of_type64='v@:@q^v' />
       <arg index='5' type='^v' />
     </method>
     <method selector='canCreateDirectories'>
     </method>
     <method selector='shouldBreakLineByHyphenatingBeforeCharacterAtIndex:'>
       <retval type='B' />
+      <arg index='0' type='I' type64='Q' />
     </method>
     <method selector='shouldBreakLineByWordBeforeCharacterAtIndex:'>
       <retval type='B' />
+      <arg index='0' type='I' type64='Q' />
     </method>
     <method selector='substituteGlyphsInRange:withGlyphs:'>
       <arg index='0' type='{_NSRange=II}' type64='{_NSRange=QQ}' />

pyobjc-framework-Cocoa/Lib/CoreFoundation/PyObjC.bridgesupport

     <arg type='l' type64='l' />
   </function>
   <function name='CFURLGetPortNumber'>
-    <retval type='l' type64='l' />
+    <retval type='l' type64='i' />
     <arg type='^{__CFURL=}' />
   </function>
   <function name='CFURLGetString'>

pyobjc-framework-Cocoa/Lib/Foundation/PyObjC.bridgesupport

   <enum name='NSDataReadingMapped' value='1' />
   <enum name='NSDataReadingUncached' value='2' />
   <enum name='NSDataWritingAtomic' value='1' />
-  <enum name='NSUndefinedDateComponent' value='2147483647' value64='-1' />
+  <enum name='NSUndefinedDateComponent' value='2147483647' value64='9223372036854775807' />
   <enum name='NSUndoCloseGroupingRunLoopOrdering' value='350000' />
   <enum name='NSUnicodeStringEncoding' value='10' />
   <enum name='NSUnionSetExpressionType' value='5' />
 	  </method>
 	  <method selector='sortedArrayUsingComparator:'>
 		  <arg index='0' block='true' >
-			  <retval type='i'/>
+			  <retval type='l'/>
 			  <arg type='@' />
 			  <arg type='@' />
 		  </arg>
 	  </method>
 	  <method selector='sortedArrayWithOptions:usingComparator:'>
 		  <arg index='1' block='true' >
-			  <retval type='i'/>
+			  <retval type='l'/>
 			  <arg type='@' />
 			  <arg type='@' />
 		  </arg>
 	  </method>
 	  <method selector='indexOfObject:inSortedRange:options:usingComparator:'>
 		  <arg index='3' block='true' >
-			  <retval type='i'/>
+			  <retval type='l'/>
 			  <arg type='@' />
 			  <arg type='@' />
 		  </arg>
 	  </method>
 	  <method selector='sortedArrayUsingFunction:context:' >
 		  <arg index='0' function_pointer='true' function_pointer_retained='false'>
-			  <retval type='i'/>
+			  <retval type='l'/>
 			  <arg type='@' />
 			  <arg type='@' />
 			  <arg type='@' />
 	  </method>
 	  <method selector='sortedArrayUsingFunction:context:hint:' >
 		  <arg index='0' function_pointer='true' function_pointer_retained='false'>
-			  <retval type='i'/>
+			  <retval type='l'/>
 			  <arg type='@' />
 			  <arg type='@' />
 			  <arg type='@' />
 	  </method>
 	  <method selector='keysSortedByValueWithOptions:usingComparator:'>
 		  <arg index='1' block='true' >
-			  <retval type='i'/>
+			  <retval type='i' type64='q'/>
 			  <arg type='@' />
 			  <arg type='@' />
 		  </arg>
   <class name='NSMutableArray'>
 	  <method selector='sortUsingComparator:'>
 		  <arg index='0' block='true' >
-			  <retval type='i'/>
+			  <retval type='l'/>
 			  <arg type='@' />
 			  <arg type='@' />
 		  </arg>
 	  </method>
 	  <method selector='sortWithOptions:usingComparator:'>
 		  <arg index='1' block='true' >
-			  <retval type='i'/>
+			  <retval type='l'/>
 			  <arg type='@' />
 			  <arg type='@' />
 		  </arg>
 	  </method>
 	  <method selector='sortUsingFunction:context:' >
 		  <arg index='0' function_pointer='true' function_pointer_retained='false' >
-			  <retval type='i' />
+			  <retval type='l' />
 			  <arg type='@' />
 			  <arg type='@' />
 			  <arg type='@' />
 	  </method>
 	  <method selector='sortUsingFunction:context:range:' >
 		  <arg index='0' function_pointer='true' function_pointer_retained='false' >
-			  <retval type='i' />
+			  <retval type='l' />
 			  <arg type='@' />
 			  <arg type='@' />
 			  <arg type='@' />
     </method>
     <method selector='spellServer:findMisspelledWordInString:language:wordCount:countOnly:'>
       <retval type='{_NSRange=II}' type64='{_NSRange=QQ}' />
-      <arg index='3' type_modifier='o' type="^i" type64="^l" />
+      <arg index='3' type_modifier='o' type="^i" type64="^q" />
       <arg index='4' type='B' />
     </method>
     <method selector='spellServer:suggestCompletionsForPartialWordRange:inString:language:'>
     </method>
     <method selector='stream:handleEvent:'>
       <retval type='v' />
-      <arg index='1' type='I' />
+      <arg index='1' type='I' type64='Q' />
     </method>
     <method selector='superclass'>
       <retval type='#' />

pyobjc-framework-Cocoa/Modules/_AppKit_nsbitmap.m

 {
 	PyObject* result;
 	PyObject* maybeNone;
-	char *dataPlanes[5];
+	unsigned char *dataPlanes[5];
 	int garbage;
 	int width, height;
 	int bps, spp;
 			PyObjCSelector_GetClass(method),
 			PyObjCObject_GetObject(self));
     
-		newImageRep = objc_msgSendSuper(&super,
+		newImageRep = ((id(*)(struct objc_super*, SEL, unsigned char**, NSInteger, NSInteger, NSInteger, NSInteger, BOOL, BOOL, id, NSInteger, NSInteger))objc_msgSendSuper)(&super,
 				PyObjCSelector_GetSelector(method),
 				dataPlanes, width, height, bps, spp, 
 				hasAlpha, isPlanar, colorSpaceNameString, 
 		return -1;
 	}
 
-	return -1;
+	return 0;
 }

pyobjc-framework-Cocoa/Modules/_AppKit_nsview.m

 	PyObject* v;
 	NSRect* rects;
 	PyObject* arg1, *arg2;
-	int count;
+	NSInteger count;
 
 	if  (!PyArg_ParseTuple(arguments, "OO", &arg1, &arg2)) {
 		return NULL;
 			PyObjCObject_GetObject(self));
 
 			
-		objc_msgSendSuper(&super,
+		((void(*)(struct objc_super*, SEL, NSRect**, NSInteger*))objc_msgSendSuper)(&super,
 				PyObjCSelector_GetSelector(method),
 				&rects, &count);
 	PyObjC_HANDLER

pyobjc-framework-Cocoa/PyObjCTest/test_convenience.py

 
     def testHash(self):
         for hashValue in (0, sys.maxint, sys.maxint + 1L, 0xFFFFFFFFL):
-            expect = struct.unpack('i', struct.pack('I', hashValue))[0]
+            expect = struct.unpack('l', struct.pack('L', hashValue))[0]
             # Python can't hash to -1.  Surprise! :)
             if expect == -1:
                 expect = -2

pyobjc-framework-Cocoa/PyObjCTest/test_nsarray.py

         self.assertArgIsIn(NSMutableArray.removeObjectsFromIndices_numIndices_, 0)
         self.assertArgSizeInArg(NSMutableArray.removeObjectsFromIndices_numIndices_, 0, 1)
 
-        self.assertArgIsFunction(NSArray.sortedArrayUsingFunction_context_, 0, 'i@@@', False)
+        self.assertArgIsFunction(NSArray.sortedArrayUsingFunction_context_, 0, 'l@@@', False)
         self.assertArgHasType(NSArray.sortedArrayUsingFunction_context_, 1, '@')
-        self.assertArgIsFunction(NSArray.sortedArrayUsingFunction_context_hint_, 0, 'i@@@', False)
+        self.assertArgIsFunction(NSArray.sortedArrayUsingFunction_context_hint_, 0, 'l@@@', False)
         self.assertArgHasType(NSArray.sortedArrayUsingFunction_context_hint_, 1, '@')
 
-        self.assertArgIsFunction(NSMutableArray.sortUsingFunction_context_, 0, 'i@@@', False)
+        self.assertArgIsFunction(NSMutableArray.sortUsingFunction_context_, 0, 'l@@@', False)
         self.assertArgHasType(NSMutableArray.sortUsingFunction_context_, 1, '@')
 
         self.assertIsNullTerminated(NSArray.arrayWithObjects_)
                 objc._C_NSBOOL + '@'+objc._C_NSUInteger+'o^'+objc._C_NSBOOL)
 
         self.assertArgIsBlock(NSArray.sortedArrayUsingComparator_,
-                0, 'i@@')
+                0, 'l@@')
         self.assertArgIsBlock(NSArray.sortedArrayWithOptions_usingComparator_,
-                1, 'i@@')
+                1, 'l@@')
         self.assertArgIsBlock(NSArray.indexOfObject_inSortedRange_options_usingComparator_,
-                3, 'i@@')
+                3, 'l@@')
         self.assertArgHasType(NSArray.indexOfObject_inSortedRange_options_usingComparator_, 1, NSRange.__typestr__)
 
 
 
         self.assertArgIsBlock(NSMutableArray.sortUsingComparator_,
-                0, 'i@@')
+                0, 'l@@')
         self.assertArgIsBlock(NSMutableArray.sortWithOptions_usingComparator_,
-                1, 'i@@')
+                1, 'l@@')
 
 
 

pyobjc-framework-Cocoa/PyObjCTest/test_nsatstypesetter.py

         m = o.willSetLineFragmentRect_forGlyphRange_usedRect_baselineOffset_.__metadata__()
         self.assertStartswith(m['arguments'][2]['type'], 'N^{')
         self.assertStartswith(m['arguments'][4]['type'], 'N^{')
-        self.assertStartswith(m['arguments'][5]['type'], 'N^f')
+        self.assertStartswith(m['arguments'][5]['type'], 'N^' + objc._C_CGFloat)
         
         m = o.shouldBreakLineByWordBeforeCharacterAtIndex_.__metadata__()
         self.assertEqual(m['retval']['type'], objc._C_NSBOOL)
-        self.assertEqual(m['arguments'][2]['type'], objc._C_UINT)
+        self.assertEqual(m['arguments'][2]['type'], objc._C_NSUInteger)
 
         m = o.shouldBreakLineByHyphenatingBeforeCharacterAtIndex_.__metadata__()
         self.assertEqual(m['retval']['type'], objc._C_NSBOOL)

pyobjc-framework-Cocoa/PyObjCTest/test_nsbitmapimagerep.py

         self.assertEqual(len(bitmapData), len(singlePlane))
         self.assertEqual(bitmapData, singlePlane)
         
-        a = array.array('I', [255]*4)
+        a = array.array('L', [255]*4)
         self.assertArgIsOut(NSBitmapImageRep.getPixel_atX_y_, 0)
         d = i2.getPixel_atX_y_(a, 1, 1)
         self.assertIsObject(a, d)

pyobjc-framework-Cocoa/PyObjCTest/test_nscolor.py

 from PyObjCTools.TestSupport import *
 from AppKit import *
 import array
+import sys
 
 class TestRegressions (TestCase):
     def testQualifiersInSignature(self):
         self.assertIsInstance(b, float)
         self.assertIsInstance(a, float)
 
-        a = array.array('f', [0] * 6)
+        if sys.maxint > 2**32:
+            a = array.array('d', [0] * 6)
+        else:
+            a = array.array('f', [0] * 6)
         v = color.getComponents_(a)
         self.assertEqual(a[0], 1.0)
 

pyobjc-framework-Cocoa/PyObjCTest/test_nsdictionary.py

         self.assertArgIsBlock(NSDictionary.enumerateKeysAndObjectsUsingBlock_, 0, 'v@@o^'+objc._C_NSBOOL)
         self.assertArgIsBlock(NSDictionary.enumerateKeysAndObjectsWithOptions_usingBlock_, 1, 'v@@o^'+objc._C_NSBOOL)
         self.assertArgIsBlock(NSDictionary.keysSortedByValueUsingComparator_, 0, 'i@@')
-        self.assertArgIsBlock(NSDictionary.keysSortedByValueWithOptions_usingComparator_, 1, 'i@@')
+        self.assertArgIsBlock(NSDictionary.keysSortedByValueWithOptions_usingComparator_, 1, objc._C_NSInteger + b'@@')
 
         self.assertArgIsBlock(NSDictionary.keysOfEntriesPassingTest_, 0, objc._C_NSBOOL + '@@o^' + objc._C_NSBOOL)
         self.assertArgIsBlock(NSDictionary.keysOfEntriesWithOptions_passingTest_, 1, objc._C_NSBOOL + '@@o^' + objc._C_NSBOOL)

pyobjc-framework-Cocoa/PyObjCTest/test_nsgraphicscontext.py

             None, 255, 255, 8, 4, True, False, NSCalibratedRGBColorSpace, 0, 0, 0)
         context = NSGraphicsContext.graphicsContextWithBitmapImageRep_(img)
         self.assertIsInstance(context, NSGraphicsContext)
-        port = context.graphicsPort()
         if Quartz is not None:
+            port = context.graphicsPort()
             self.assertIsInstance(port, Quartz.CGContextRef)
 
         self.assertArgHasType(NSGraphicsContext.graphicsContextWithGraphicsPort_flipped_, 0, '^{CGContext=}')

pyobjc-framework-Cocoa/PyObjCTest/test_nsmatrix.py

         self.assertResultIsBOOL(NSMatrix.allowsEmptySelection)
         self.assertArgIsBOOL(NSMatrix.setAllowsEmptySelection_, 0)
         self.assertArgIsBOOL(NSMatrix.sendAction_to_forAllCells_, 2)
-        self.assertArgIsSEL(NSMatrix.sendAction_to_forAllCells_, 0, objc._C_NSBOOL + '@:@')
-        self.assertArgIsSEL(NSMatrix.sortUsingSelector_, 0, 'i@:@')
+        self.assertArgIsSEL(NSMatrix.sendAction_to_forAllCells_, 0, objc._C_NSBOOL + b'@:@')
+        self.assertArgIsSEL(NSMatrix.sortUsingSelector_, 0, objc._C_NSInteger + b'@:@')
         self.assertArgIsOut(NSMatrix.getNumberOfRows_columns_, 0)
         self.assertArgIsOut(NSMatrix.getNumberOfRows_columns_, 1)
         self.assertArgIsOut(NSMatrix.getRow_column_ofCell_, 0)
         self.assertArgIsOut(NSMatrix.getRow_column_forPoint_, 0)
         self.assertArgIsOut(NSMatrix.getRow_column_forPoint_, 1)
 
-        self.assertArgIsFunction(NSMatrix.sortUsingFunction_context_, 0, 'i@@@', False)
+        self.assertArgIsFunction(NSMatrix.sortUsingFunction_context_, 0, objc._C_NSInteger + b'@@@', False)
         self.assertArgHasType(NSMatrix.sortUsingFunction_context_, 1, objc._C_ID)
 
 

pyobjc-framework-Cocoa/PyObjCTest/test_nsnumber.py

         n = NSNumber.numberWithInt_(1)
         self.assertRaises(AttributeError, setattr, n, 'foo', 2)
 
-        n = NSNumber.numberWithLongLong_(sys.maxint + 2)
+        n = NSNumber.numberWithLongLong_(2**32 + 2)
         self.assertRaises(AttributeError, setattr, n, 'foo', 2)
 
     def testUseAsBasicType(self):
         # NSNumber stores unsigned numbers as signed numbers
         # This is a bug in Cocoa... (RADAR #4007594), fixed in 10.5
         if sdkForPython() < (10, 5):
-		self.assertEqual(NSNumber.numberWithUnsignedInt_(sys.maxint+1),
-			    -sys.maxint-1)
+		self.assertEqual(NSNumber.numberWithUnsignedInt_(2**31),
+			    -(2**31))
 	else:
-		self.assertEqual(NSNumber.numberWithUnsignedInt_(sys.maxint+1),
-			    sys.maxint+1)
+		self.assertEqual(NSNumber.numberWithUnsignedInt_(2**31),
+			    (2**31))
 
     def testMethods(self):
-        v = NSNumber.numberWithUnsignedInt_(sys.maxint+1)
+        v = NSNumber.numberWithUnsignedInt_(2**31)
 
-        self.assertEqual(v.unsignedIntValue(), sys.maxint+1)
-        self.assertEqual(v.intValue(), -sys.maxint-1)
+        self.assertEqual(v.unsignedIntValue(), 2**31)
+        self.assertEqual(v.intValue(), -(2**31))
 
         v = NSNumber.numberWithInt_(10)
         self.assertEqual(v.doubleValue(), float(10))
         self.assert_(isinstance(n, (int, long)))
         self.assert_(isinstance(n, NSNumber))
 
-        n = NSNumber.numberWithLongLong_(sys.maxint * 1024L)
-        self.assertEqual(n, sys.maxint * 1024L)
+        n = NSNumber.numberWithLongLong_(2**32 * 1024L)
+        self.assertEqual(n, 2**32 * 1024L)
         self.assert_(isinstance(n, (int, long)))
         self.assert_(isinstance(n, NSNumber))
 
-        n = NSNumber.numberWithUnsignedLongLong_(sys.maxint + 100)
-        self.assertEqual(n, sys.maxint + 100)
+        n = NSNumber.numberWithUnsignedLongLong_(2**32 + 100)
+        self.assertEqual(n, 2**32 + 100)
         self.assert_(isinstance(n, (int, long)))
         self.assert_(isinstance(n, NSNumber))
 

pyobjc-framework-Cocoa/PyObjCTest/test_nsopenpanel.py

         self.assertArgIsBOOL(NSOpenPanel.setCanChooseFiles_, 0)
 
         panel = NSOpenPanel.openPanel()
-        self.assertArgIsSEL(panel.beginSheetForDirectory_file_types_modalForWindow_modalDelegate_didEndSelector_contextInfo_, 5, 'v@:@i^v')
-        self.assertArgHasType(panel.beginSheetForDirectory_file_types_modalForWindow_modalDelegate_didEndSelector_contextInfo_, 6, '^v')
+        self.assertArgIsSEL(panel.beginSheetForDirectory_file_types_modalForWindow_modalDelegate_didEndSelector_contextInfo_, 5, b'v@:@' + objc._C_NSInteger + b'^v')
+        self.assertArgHasType(panel.beginSheetForDirectory_file_types_modalForWindow_modalDelegate_didEndSelector_contextInfo_, 6, b'^v')
 
-        self.assertArgIsSEL(panel.beginForDirectory_file_types_modelessDelegate_didEndSelector_contextInfo_, 4, 'v@:@i^v')
-        self.assertArgHasType(panel.beginForDirectory_file_types_modelessDelegate_didEndSelector_contextInfo_, 5, '^v')
+        self.assertArgIsSEL(panel.beginForDirectory_file_types_modelessDelegate_didEndSelector_contextInfo_, 4, b'v@:@'+objc._C_NSInteger+b'^v')
+        self.assertArgHasType(panel.beginForDirectory_file_types_modelessDelegate_didEndSelector_contextInfo_, 5, b'^v')
 
 
 

pyobjc-framework-Cocoa/PyObjCTest/test_nsview.py

 
     def test_knowsPageRange(self):
         method = ObjCTestNSView_KnowPageRange.knowsPageRange_
-        self.assertEqual(method.__metadata__()['arguments'][2]['type'], 'o^{_NSRange=II}')
+        self.assertEqual(method.__metadata__()['arguments'][2]['type'], 'o^' + NSRange.__typestr__)
 
     def test_rectForPage(self):
         method = ObjCTestNSView_KnowPageRange.rectForPage_
-        self.assertEqual(objc.splitSignature(method.signature), objc.splitSignature("{_NSRect={_NSPoint=ff}{_NSSize=ff}}12@0:4i8"))
+
+
+        self.assertEqual(objc.splitSignature(method.signature), objc.splitSignature(NSRect.__typestr__+b"@:" + objc._C_NSInteger))
 
 
 class TestHeader (TestCase):