correct some casts

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8693 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2006-02-03 22:06:54 +00:00
commit 8ee5690cea

View file

@ -5682,7 +5682,7 @@ allow the calling function to read the double * value after returning from the f
jfieldID fid = jenv->GetFieldID(clazz, "swigCPtr", "J"); jfieldID fid = jenv->GetFieldID(clazz, "swigCPtr", "J");
jlong cPtr = jenv->GetLongField($input, fid); jlong cPtr = jenv->GetLongField($input, fid);
MyDouble *pMyDouble = NULL; MyDouble *pMyDouble = NULL;
*(MyDouble **)&pMyDouble = *(MyDouble **)&cPtr; *(MyDouble **)(void *)&pMyDouble = *(MyDouble **)(void *)&cPtr;
$1 = &pMyDouble->value; $1 = &pMyDouble->value;
} }
@ -5847,7 +5847,7 @@ Add the following before the definition of <tt>vehicle_factory</tt>:
<div class="code"><pre> <div class="code"><pre>
%typemap(out) Vehicle * { %typemap(out) Vehicle * {
Ambulance *downcast = dynamic_cast&lt;Ambulance *&gt;($1); Ambulance *downcast = dynamic_cast&lt;Ambulance *&gt;($1);
*(Ambulance **)&amp;$result = downcast; *(Ambulance **)(void *)&amp;$result = downcast;
} }
%typemap(javaout) Vehicle * { %typemap(javaout) Vehicle * {
@ -5915,7 +5915,7 @@ Note that in this case, the Java class is constructed using JNI code rather than
jmethodID mid = jenv-&gt;GetMethodID(clazz, "&lt;init&gt;", "(JZ)V"); jmethodID mid = jenv-&gt;GetMethodID(clazz, "&lt;init&gt;", "(JZ)V");
if (mid) { if (mid) {
jlong cptr = 0; jlong cptr = 0;
*(Ambulance **)&amp;cptr = ambulance; *(Ambulance **)(void *)&amp;cptr = ambulance;
$result = jenv-&gt;NewObject(clazz, mid, cptr, false); $result = jenv-&gt;NewObject(clazz, mid, cptr, false);
} }
} }
@ -5926,7 +5926,7 @@ Note that in this case, the Java class is constructed using JNI code rather than
jmethodID mid = jenv-&gt;GetMethodID(clazz, "&lt;init&gt;", "(JZ)V"); jmethodID mid = jenv-&gt;GetMethodID(clazz, "&lt;init&gt;", "(JZ)V");
if (mid) { if (mid) {
jlong cptr = 0; jlong cptr = 0;
*(FireEngine **)&amp;cptr = fireengine; *(FireEngine **)(void *)&amp;cptr = fireengine;
$result = jenv-&gt;NewObject(clazz, mid, cptr, false); $result = jenv-&gt;NewObject(clazz, mid, cptr, false);
} }
} }