Commits

Ronald Oussoren committed 81709f8

fixes for a number of compiler warnings

  • Participants
  • Parent commits ebd3f00
  • Branches pyobjc-ancient

Comments (0)

Files changed (5)

Modules/objc/alloc_hack.m

 	IMP anIMP;
 	Class aClass;
 	SEL volatile aSel;
-	id retval;
+	volatile id retval = nil;
 
 	if (PyArg_ParseTuple(arguments, "") < 0) {
 		return NULL;

Modules/objc/formal-protocol.m

 		theProtocol->protocol_list->list[i] = NULL;
 	}
 
-	if (numInstance != NULL) {
+	if (numInstance != 0) {
 		theProtocol->instance_methods = malloc(
 			sizeof(struct objc_method_description_list) +
 			(1+numInstance)  * sizeof(struct objc_method_description));
 		}
 		theProtocol->instance_methods->count = 0;
 	}
-	if (numClass != NULL) {
+	if (numClass != 0) {
 		theProtocol->class_methods = malloc(
 			sizeof(struct objc_method_description_list) + 
 			(1+numClass)  * sizeof(struct objc_method_description));
 	return NULL;
 }
 
-static int 
-signaturesEqual(char* sig1, char* sig2)
-{
-	char buf1[1024];
-	char buf2[1024];
-	int r;
-
-	/* Return 0 if the two signatures are not equal */
-	if (strcmp(sig1, sig2) == 0) return 1;
-
-	/* For some reason compiler-generated signatures contain numbers that
-	 * are not used by the runtime. These are irrelevant for our comparison
-	 */
-	r = PyObjCRT_SimplifySignature(sig1, buf1, sizeof(buf1));
-	if (r == -1) { 
-		return 0; 
-	}
-
-	r = PyObjCRT_SimplifySignature(sig2, buf2, sizeof(buf2));
-	if (r == -1) { 
-		return 0; 
-	}
-
-
-	return strcmp(buf1, buf2) == 0;
-}
-
-
-extern PyObject* findSelInDict(PyObject* clsdict, SEL selector);
-extern int signaturesEqual(char* sig1, char* sig2);
-
-
 static int
 do_verify(
 	const char* protocol_name, 

Modules/objc/informal-protocol.h

 int PyObjCInformalProtocol_Warnings(char* name, PyObject* clsdict, PyObject* protocols);
 PyObject* PyObjCInformalProtocol_FindProtocol(SEL selector);
 
+/* TODO: rename */
+PyObject* findSelInDict(PyObject* clsdict, SEL selector);
+int signaturesEqual(char* sig1, char* sig2);
+
+
+
 #endif /* PyObjC_INFORMAL_PROTOCOL_H */

Modules/objc/informal-protocol.m

 	return NULL;
 }
 
-/* XXX: Make public */
 PyObject*
 findSelInDict(PyObject* clsdict, SEL selector)
 {

Modules/objc/mach_inject.m

 	if( !err ) {
 		//assert( (void*)threadEntry >= image && (void*)threadEntry <= (image+imageSize) );
 		ASSERT_CAST( void*, threadEntry );
-		threadEntryOffset = ((void*) threadEntry) - image;
+		threadEntryOffset = ((char*) threadEntry) - (char*)image;
 		
 		ASSERT_CAST( void*, remoteCode );
-		imageOffset = ((void*) remoteCode) - image;
+		imageOffset = ((char*) remoteCode) - (char*)image;
 	}
 	
 	//	Allocate the thread.