Browse Source

allow void pointer types to return as a long int (try 2)

toddw 12 years ago
parent
commit
d793be31a8
1 changed files with 6 additions and 6 deletions
  1. 6 6
      xpcom/src/VariantUtils.cpp

+ 6 - 6
xpcom/src/VariantUtils.cpp

@@ -2083,7 +2083,11 @@ PyObject *PyXPCOM_InterfaceVariantHelper::MakeSinglePythonResult(int index)
 	  case nsXPTType::T_WCHAR:
 		ret = PyUnicode_FromPRUnichar( ((PRUnichar *)ns_v.ptr), 1 );
 		break;
-//	  case nsXPTType::T_VOID:
+	  case nsXPTType::T_VOID:
+		// we really can't do anything useful with this; just pass it to
+		// Python as an integer and hope it's close enough
+		ret = PyLong_FromVoidPtr( *((void **)ns_v.ptr));
+		break;
 	  case nsXPTType::T_IID: {
 		// guard against null IIDs
 		nsIID* iid = *reinterpret_cast<nsIID**>(ns_v.ptr);
@@ -2562,11 +2566,7 @@ PyObject *PyXPCOM_GatewayVariantHelper::MakeSingleParam(int index, PythonTypeDes
 		ret = PyUnicode_FromPRUnichar(&temp, 1);
 		break;
 		}
-	  case nsXPTType::T_VOID:
-		// we really can't do anything useful with this; just pass it to
-		// Python as an integer and hope it's close enough
-		ret = PyLong_FromVoidPtr( *((void **)ns_v.ptr));
-		break;
+//	  case nsXPTType::T_VOID:
 	  case nsXPTType::T_IID: {
 		  ret = Py_nsIID::PyObjectFromIID( * DEREF_IN_OR_OUT(ns_v.val.p, const nsIID *) );
 		  break;