Commits

Ronald Oussoren committed 45eb15b

Reneable code that recognizes pointers-to-structs in pointer-support.m. Someone
had disabled this code without understanding why the code was there. This code
recognizes that '^{NSModalSession}' is the same as '^{NSModalSession=ffff}'.

This is needed because @encode(structPtr) returns the second result when the
full declaration of a struct is seen while the first result is returned when
there's just a forward declaration.

  • Participants
  • Parent commits dcc9635
  • Branches pyobjc-ancient

Comments (0)

Files changed (1)

File Modules/objc/pointer-support.m

 static int item_count = 0;
 
 static int find_offset(const char* signature) {
-	/* XXX:
-	 * I don't know what the heck this was supposed to do
-	 */
-#if 0
 	if (signature[1] == _C_STRUCT_B) {
 		int o1, o2;
 
 
 		return (o1 < o2) ? o1 : o2;
 	}
-#endif
 	return strlen(signature);
 }
 
 	for (i = 0; i < item_count; i++) {
 		if (strncmp(signature, items[i].signature, items[i].offset) == 0) {
 			return &items[i];
-			/* XXX: What was this supposed to do? */
-#if 0
 			if (signature[1] != _C_STRUCT_B || signature[items[i].offset] == '=' || signature[items[i].offset] == _C_STRUCT_E) {
 				return &items[i];
 			}
-#endif
 		}
 	}
 	return NULL;