Ronald Oussoren avatar Ronald Oussoren committed e6b8996

- Don't disable the wrapper for initWithBitmapDataPlanes:pixelsWide:pixelsHigh:bitsPerSample:samplesPerPixel:hasAlpha:isPlanar:colorSpaceName:bytesPerRow:bitsPerPixel: in _AppKitMapping_NSBitmapImageRep.m
- Remove unused variable in OC_PythonObject.m
- Add support for type bool in objc_support.[hm].

Comments (0)

Files changed (4)


 		return -1;
+#if 0
 	if (PyObjC_RegisterMethodMapping(class_NSBitmapImageRep, 
 		return -1;
 	return 0;


 	PyObject* keyName;
 	PyObject* pyValue;
 	PyObject* val;
-	id res;
 	if (setKeyFunc == NULL) {
 		PyObject* name;


 #define _C_ONEWAY   'V'
 #define _C_LNGLNG   'q'
 #define _C_ULNGLNG   'Q'
+#define _C_BOOL	'B'		/* (Objective-)C++ 'bool' */
 /* Return a number that is likely to change when the method list changes,


 	       *type == _C_ONEWAY) {
+	while (isdigit(*type)) type++;
 	return type;
 	type = PyObjCRT_SkipTypeQualifiers (type);
 	switch (*type) {
-	case 'B':	
-		/* This turned up on Panther, without documentation */
-		NSLog(@"Parsing typespec containing unsupported code 'B'");
-		type++;
-		break;
 	/* The following are one character type codes */
 	case _C_UNDEF:
 	case _C_ID:
 #ifdef _C_ATOM
 	case _C_ATOM:
+#ifdef _C_BOOL
+	case _C_BOOL:
 	case _C_SHT:
 	case _C_USHT:
 	case _C_INT:
 			"PyObjCRT_SkipTypeSpec: Unhandled type '%#x'", *type); 
+		abort();
 		return NULL;
 	case _C_UCHR:  return __alignof__ (unsigned char);
 	case _C_SHT:   return __alignof__ (short);
 	case _C_USHT:  return __alignof__ (unsigned short);
+#ifdef _C_BOOL
+	case _C_BOOL:   return __alignof__ (bool);
 	case _C_INT:   return __alignof__ (int);
 	case _C_UINT:  return __alignof__ (unsigned int);
 	case _C_LNG:   return __alignof__ (long);
 	case _C_STRUCT_B:
-		/* The align of a struct is the largest alignment of one of 
-		 * its members
+		/* The alignment of a struct is the alignment of it's first
+		 * member
 		struct { int x; double y; } fooalign;
 		while(*type != _C_STRUCT_E && *type++ != '=') /* do nothing */;
 		if (*type != _C_STRUCT_E) {
-			int    item_align;
-			int    maxalign = 0;
-			while (*type != _C_STRUCT_E) {
-				item_align = objc_alignof_type(type);
-				if (item_align == -1) return -1;
-				type = PyObjCRT_SkipTypeSpec(type);
-				maxalign = MAX(item_align, maxalign);
-			}
-			return maxalign;
+			return objc_alignof_type(type);
 		} else {
 			return __alignof__ (fooalign);
 	case _C_UCHR:    return sizeof(unsigned char);
 	case _C_SHT:     return sizeof(short);
 	case _C_USHT:    return sizeof(unsigned short);
+#ifdef _C_BOOL
+	case _C_BOOL:    return sizeof(bool);
 	case _C_INT:     return sizeof(int);
 	case _C_UINT:    return sizeof(unsigned int);
 	case _C_LNG:     return sizeof(long);
+#ifdef _C_BOOL
+	case _C_BOOL:
+		retobject = (PyObject *) PyInt_FromLong (*(bool*) datum);
+		break;
 	case _C_INT:
 		retobject = (PyObject *) PyInt_FromLong (*(int*) datum);
 		return r;
+#ifdef _C_BOOL:
+	case _C_BOOL:
+		*(bool*)datum = PyObject_IsTrue(argument);
+		return 0;
 	case _C_INT:
 		r = depythonify_signed_int_value(argument, "int",
 			&temp, INT_MIN, INT_MAX);
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.