Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul D'Pong2020-06-10 15:50:56 -0400
committerAlexander Kurtakov2020-06-29 10:01:58 -0400
commit8ef224d3d30005def5e9470a454e89e2c54b3c7e (patch)
treeea2c1de0be6accb18d1542ba8823e049dd8c7c91
parent991b35c56a4fa4f028e3baac1fb5860130f7a0f5 (diff)
downloadeclipse.platform.swt-8ef224d3d30005def5e9470a454e89e2c54b3c7e.tar.gz
eclipse.platform.swt-8ef224d3d30005def5e9470a454e89e2c54b3c7e.tar.xz
eclipse.platform.swt-8ef224d3d30005def5e9470a454e89e2c54b3c7e.zip
Bug 564303 - Clean up SWT Tools of 32-bit support
Removed JNI64 flag, and comparisons between 32 & 64 bit types/functions. Changed functions & interfaces accordingly, to take away this dependency. Change-Id: I66adb0a4716f14a83df534c6c20f81a7ad60fc87 Signed-off-by: Paul D'Pong <sdamrong@redhat.com>
-rw-r--r--bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ASTField.java19
-rw-r--r--bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ASTMethod.java40
-rw-r--r--bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ASTParameter.java5
-rw-r--r--bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/JNIField.java2
-rw-r--r--bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/JNIGenerator.java1
-rw-r--r--bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/JNIItem.java2
-rw-r--r--bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/JNIMethod.java4
-rw-r--r--bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/JNIParameter.java2
-rw-r--r--bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/NativesGenerator.java161
-rw-r--r--bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ReflectClass.java12
-rw-r--r--bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ReflectField.java34
-rw-r--r--bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ReflectItem.java12
-rw-r--r--bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ReflectMethod.java78
-rw-r--r--bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ReflectParameter.java5
-rw-r--r--bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/StatsGenerator.java30
-rw-r--r--bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/StructsGenerator.java42
-rw-r--r--bundles/org.eclipse.swt.tools/plugin.properties1
17 files changed, 95 insertions, 355 deletions
diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ASTField.java b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ASTField.java
index 91bcb310fa..a770f77d02 100644
--- a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ASTField.java
+++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ASTField.java
@@ -21,7 +21,7 @@ public class ASTField extends ASTItem implements JNIField {
ASTClass declaringClass;
String name;
int modifiers;
- ASTType type, type64;
+ ASTType type;
String data;
int start;
@@ -44,18 +44,6 @@ public ASTField(ASTClass declaringClass, String source, FieldDeclaration field,
}
}
type = new ASTType(declaringClass.resolver, field.getType(), fragment.getExtraDimensions());
- type64 = this.type;
- if (GEN64) {
- String s = source.substring(field.getStartPosition(), field.getStartPosition() + field.getLength());
- if (type.isType("int") && s.contains("int /*long*/")) type64 = new ASTType("J");
- else if (type.isType("float") && s.contains("float /*double*/")) type64 = new ASTType("D");
- else if (type.isType("[I") && (s.contains("int /*long*/") || s.contains("int[] /*long[]*/"))) type64 = new ASTType("[J");
- else if (type.isType("[F") && (s.contains("float /*double*/")|| s.contains("float[] /*double[]*/"))) type64 = new ASTType("[D");
- else if (type.isType("long") && s.contains("long /*int*/")) type = new ASTType("I");
- else if (type.isType("double") && s.contains("double /*float*/")) type = new ASTType("F");
- else if (type.isType("[J") && (s.contains("long /*int*/")|| s.contains("long[] /*int[]*/"))) type = new ASTType("[I");
- else if (type.isType("[D") && (s.contains("double /*float*/")|| s.contains("double[] /*float[]*/"))) type = new ASTType("[F");
- }
}
@Override
@@ -91,11 +79,6 @@ public JNIType getType() {
}
@Override
-public JNIType getType64() {
- return type64;
-}
-
-@Override
public String getAccessor() {
return (String)getParam("accessor");
}
diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ASTMethod.java b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ASTMethod.java
index 8e7f89d78b..d3d9fccba0 100644
--- a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ASTMethod.java
+++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ASTMethod.java
@@ -22,8 +22,8 @@ public class ASTMethod extends ASTItem implements JNIMethod {
String name, qualifiedName;
int modifiers;
ASTClass declaringClass;
- ASTType[] paramTypes, paramTypes64;
- ASTType returnType, returnType64;
+ ASTType[] paramTypes;
+ ASTType returnType;
ASTParameter[] parameters;
Boolean unique;
String data;
@@ -49,40 +49,16 @@ public ASTMethod(ASTClass declaringClass, String source, MethodDeclaration metho
}
}
returnType = new ASTType(declaringClass.resolver, method.getReturnType2(), method.getExtraDimensions());
- returnType64 = returnType;
- if (GEN64) {
- String s = source.substring(method.getReturnType2().getStartPosition(), method.getName().getStartPosition());
- if (returnType.isType("int") && s.contains("int /*long*/")) returnType64 = new ASTType("J");
- else if (returnType.isType("float") && s.contains("float /*double*/")) returnType64 = new ASTType("D");
- else if (returnType.isType("[I") && (s.contains("int /*long*/") || s.contains("int[] /*long[]*/"))) returnType64 = new ASTType("[J");
- else if (returnType.isType("[F") && (s.contains("float /*double*/")|| s.contains("float[] /*double[]*/"))) returnType64 = new ASTType("[D");
- else if (returnType.isType("long") && s.contains("long /*int*/")) returnType = new ASTType("I");
- else if (returnType.isType("double") && s.contains("double /*float*/")) returnType = new ASTType("F");
- else if (returnType.isType("[J") && (s.contains("long /*int*/")|| s.contains("long[] /*int[]*/"))) returnType = new ASTType("[I");
- else if (returnType.isType("[D") && (s.contains("double /*float*/")|| s.contains("double[] /*float[]*/"))) returnType = new ASTType("[F");
- }
List<SingleVariableDeclaration> parameters = method.parameters();
paramTypes = new ASTType[parameters.size()];
- paramTypes64 = new ASTType[parameters.size()];
this.parameters = new ASTParameter[paramTypes.length];
int i = 0;
for (Iterator<SingleVariableDeclaration> iterator = parameters.iterator(); iterator.hasNext(); i++) {
SingleVariableDeclaration param = iterator.next();
paramTypes[i] = new ASTType(declaringClass.resolver, param.getType(), param.getExtraDimensions());
- paramTypes64[i] = paramTypes[i];
this.parameters[i] = new ASTParameter(this, i, param.getName().getIdentifier());
- if (GEN64) {
- String s = source.substring(param.getStartPosition(), param.getStartPosition() + param.getLength());
- if (paramTypes[i].isType("int") && s.contains("int /*long*/")) paramTypes64[i] = new ASTType("J");
- else if (paramTypes[i].isType("float") && s.contains("float /*double*/")) paramTypes64[i] = new ASTType("D");
- else if (paramTypes[i].isType("[I") && (s.contains("int /*long*/") || s.contains("int[] /*long[]*/"))) paramTypes64[i] = new ASTType("[J");
- else if (paramTypes[i].isType("[F") && (s.contains("float /*double*/")|| s.contains("float[] /*double[]*/"))) paramTypes64[i] = new ASTType("[D");
- else if (paramTypes[i].isType("long") && s.contains("long /*int*/")) paramTypes[i] = new ASTType("I");
- else if (paramTypes[i].isType("double") && s.contains("double /*float*/")) paramTypes[i] = new ASTType("F");
- else if (paramTypes[i].isType("[J") && (s.contains("long /*int*/")|| s.contains("long[] /*int[]*/"))) paramTypes[i] = new ASTType("[I");
- else if (paramTypes[i].isType("[D") && (s.contains("double /*float*/")|| s.contains("double[] /*float[]*/"))) paramTypes[i] = new ASTType("[F");
- }
+
if (tags != null) {
String name = param.getName().getIdentifier();
for (TagElement tag : tags) {
@@ -137,11 +113,6 @@ public JNIType[] getParameterTypes() {
}
@Override
-public JNIType[] getParameterTypes64() {
- return paramTypes64;
-}
-
-@Override
public JNIParameter[] getParameters() {
return this.parameters;
}
@@ -152,11 +123,6 @@ public JNIType getReturnType() {
}
@Override
-public JNIType getReturnType64() {
- return returnType64;
-}
-
-@Override
public String getAccessor() {
return (String)getParam("accessor");
}
diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ASTParameter.java b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ASTParameter.java
index 0ee7a1b37e..2043044f63 100644
--- a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ASTParameter.java
+++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ASTParameter.java
@@ -84,11 +84,6 @@ public JNIType getType() {
}
@Override
-public JNIType getType64() {
- return method.getParameterTypes64()[parameter];
-}
-
-@Override
public int getParameter() {
return parameter;
}
diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/JNIField.java b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/JNIField.java
index a1bbbab612..860a42108b 100644
--- a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/JNIField.java
+++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/JNIField.java
@@ -23,8 +23,6 @@ public int getModifiers();
public JNIType getType();
-public JNIType getType64();
-
public JNIClass getDeclaringClass();
public String getAccessor();
diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/JNIGenerator.java b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/JNIGenerator.java
index 8a91368fc9..cce26093ee 100644
--- a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/JNIGenerator.java
+++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/JNIGenerator.java
@@ -26,7 +26,6 @@ public abstract class JNIGenerator implements Flags {
PrintStream output;
ProgressMonitor progress;
- static final String JNI64 = "JNI64";
public JNIGenerator() {
delimiter = System.lineSeparator();
diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/JNIItem.java b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/JNIItem.java
index 6b10d363c1..4551ffcf1f 100644
--- a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/JNIItem.java
+++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/JNIItem.java
@@ -14,8 +14,6 @@
package org.eclipse.swt.tools.internal;
public interface JNIItem extends Flags {
-
- public static final boolean GEN64 = true;
public String[] getFlags();
diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/JNIMethod.java b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/JNIMethod.java
index f5fa89dd22..e4c9436a6f 100644
--- a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/JNIMethod.java
+++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/JNIMethod.java
@@ -27,12 +27,8 @@ public JNIParameter[] getParameters();
public JNIType getReturnType();
-public JNIType getReturnType64();
-
public JNIType[] getParameterTypes();
-public JNIType[] getParameterTypes64();
-
public JNIClass getDeclaringClass();
public String getAccessor();
diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/JNIParameter.java b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/JNIParameter.java
index 68527437bc..6f424721ea 100644
--- a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/JNIParameter.java
+++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/JNIParameter.java
@@ -27,7 +27,5 @@ public JNIClass getTypeClass();
public JNIType getType();
-public JNIType getType64();
-
public void setCast(String str);
}
diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/NativesGenerator.java b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/NativesGenerator.java
index c6e389e3d7..97e77ee238 100644
--- a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/NativesGenerator.java
+++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/NativesGenerator.java
@@ -175,44 +175,26 @@ void generateCallback(JNIMethod method, String function) {
public void generate(JNIMethod method) {
if (method.getFlag(FLAG_NO_GEN)) return;
- JNIType returnType = method.getReturnType(), returnType64 = method.getReturnType64();
+ JNIType returnType = method.getReturnType();
if (!(returnType.isType("void") || returnType.isPrimitive() || isSystemClass(returnType) || returnType.isType("java.lang.String"))) {
output("Warning: bad return type. :");
outputln(method.toString());
return;
}
JNIParameter[] params = method.getParameters();
- String function = getFunctionName(method), function64 = getFunctionName(method, method.getParameterTypes64());
- generateSourceStart(function, function64);
- boolean sameFunction = function.equals(function64);
- if (!sameFunction) {
- output("#ifndef ");
- output(JNI64);
- outputln();
- }
+ String function = getFunctionName(method);
+ generateSourceStart(function);
boolean isCPP = getCPP();
if (isCPP) {
output("extern \"C\" ");
- generateFunctionPrototype(method, function, params, returnType, returnType64, true);
+ generateFunctionPrototype(method, function, params, returnType, true);
outputln(";");
}
if (function.startsWith("CALLBACK_")) {
generateCallback(method, function);
}
- generateFunctionPrototype(method, function, params, returnType, returnType64, !sameFunction);
- if (!function.equals(function64)) {
- outputln();
- outputln("#else");
- if (isCPP) {
- output("extern \"C\" ");
- generateFunctionPrototype(method, function64, params, returnType, returnType64, true);
- outputln(";");
- }
- generateFunctionPrototype(method, function64, params, returnType, returnType64, !sameFunction);
- outputln();
- outputln("#endif");
- }
- generateFunctionBody(method, function, function64, params, returnType, returnType64);
+ generateFunctionPrototype(method, function, params, returnType, false);
+ generateFunctionBody(method, function, params, returnType);
generateSourceEnd();
outputln();
}
@@ -259,7 +241,7 @@ void generateNativeMacro(JNIClass clazz) {
}
boolean generateGetParameter(JNIParameter param, boolean critical, int indent) {
- JNIType paramType = param.getType(), paramType64 = param.getType64();
+ JNIType paramType = param.getType();
if (paramType.isPrimitive() || isSystemClass(paramType)) return false;
String iStr = String.valueOf(param.getParameter());
for (int j = 0; j < indent; j++) output("\t");
@@ -275,7 +257,7 @@ boolean generateGetParameter(JNIParameter param, boolean critical, int indent) {
if (critical) {
if (isCPP) {
output("(");
- output(componentType.getTypeSignature2(!paramType.equals(paramType64)));
+ output(componentType.getTypeSignature2(false));
output("*)");
output("env->GetPrimitiveArrayCritical(arg");
} else {
@@ -289,7 +271,7 @@ boolean generateGetParameter(JNIParameter param, boolean critical, int indent) {
} else {
output("(*env)->Get");
}
- output(componentType.getTypeSignature1(!paramType.equals(paramType64)));
+ output(componentType.getTypeSignature1(false));
if (isCPP) {
output("ArrayElements(arg");
} else {
@@ -338,7 +320,7 @@ boolean generateGetParameter(JNIParameter param, boolean critical, int indent) {
}
void generateSetParameter(JNIParameter param, boolean critical) {
- JNIType paramType = param.getType(), paramType64 = param.getType64();
+ JNIType paramType = param.getType();
if (paramType.isPrimitive() || isSystemClass(paramType)) return;
String iStr = String.valueOf(param.getParameter());
boolean isCPP = getCPP();
@@ -363,7 +345,7 @@ void generateSetParameter(JNIParameter param, boolean critical) {
} else {
output("(*env)->Release");
}
- output(componentType.getTypeSignature1(!paramType.equals(paramType64)));
+ output(componentType.getTypeSignature1(false));
if (isCPP) {
output("ArrayElements(arg");
} else {
@@ -425,14 +407,9 @@ void generateSetParameter(JNIParameter param, boolean critical) {
}
}
-void generateEnterExitMacro(JNIMethod method, String function, String function64, boolean enter) {
+void generateEnterExitMacro(JNIMethod method, String function, boolean enter) {
if (!enterExitMacro) return;
boolean tryCatch = method.getFlag(FLAG_TRYCATCH);
- if (!function.equals(function64)) {
- output("#ifndef ");
- output(JNI64);
- outputln();
- }
output("\t");
output(method.getDeclaringClass().getSimpleName());
output("_NATIVE_");
@@ -441,31 +418,19 @@ void generateEnterExitMacro(JNIMethod method, String function, String function64
output("(env, that, ");
output(function);
outputln("_FUNC);");
- if (!function.equals(function64)) {
- outputln("#else");
- output("\t");
- output(method.getDeclaringClass().getSimpleName());
- output("_NATIVE_");
- output(enter ? "ENTER" : "EXIT");
- if (tryCatch) output(enter ? "_TRY" : "_CATCH");
- output("(env, that, ");
- output(function64);
- outputln("_FUNC);");
- outputln("#endif");
- }
}
-boolean generateLocalVars(JNIParameter[] params, JNIType returnType, JNIType returnType64) {
+boolean generateLocalVars(JNIParameter[] params, JNIType returnType) {
boolean needsReturn = enterExitMacro;
for (int i = 0; i < params.length; i++) {
JNIParameter param = params[i];
- JNIType paramType = param.getType(), paramType64 = param.getType64();
+ JNIType paramType = param.getType();
if (paramType.isPrimitive() || isSystemClass(paramType)) continue;
output("\t");
if (paramType.isArray()) {
JNIType componentType = paramType.getComponentType();
if (componentType.isPrimitive()) {
- output(componentType.getTypeSignature2(!paramType.equals(paramType64)));
+ output(componentType.getTypeSignature2(false));
output(" *lparg" + i);
output("=NULL;");
} else {
@@ -494,7 +459,7 @@ boolean generateLocalVars(JNIParameter[] params, JNIType returnType, JNIType ret
if (needsReturn) {
if (!returnType.isType("void")) {
output("\t");
- output(returnType.getTypeSignature2(!returnType.equals(returnType64)));
+ output(returnType.getTypeSignature2(false));
outputln(" rc = 0;");
}
}
@@ -546,9 +511,9 @@ void generateSetters(JNIParameter[] params) {
}
}
-void generateDynamicFunctionCall(JNIMethod method, JNIParameter[] params, JNIType returnType, JNIType returnType64, boolean needsReturn) {
+void generateDynamicFunctionCall(JNIMethod method, JNIParameter[] params, JNIType returnType, boolean needsReturn) {
outputln("/*");
- generateFunctionCall(method, params, returnType, returnType64, needsReturn);
+ generateFunctionCall(method, params, returnType, needsReturn);
outputln("*/");
outputln("\t{");
@@ -561,9 +526,9 @@ void generateDynamicFunctionCall(JNIMethod method, JNIParameter[] params, JNITyp
outputln(")");
outputln("\t\tif (fp) {");
output("\t\t");
- generateFunctionCallLeftSide(method, returnType, returnType64, needsReturn);
+ generateFunctionCallLeftSide(method, returnType, needsReturn);
output("((");
- output(returnType.getTypeSignature2(!returnType.equals(returnType64)));
+ output(returnType.getTypeSignature2(false));
output(" (CALLING_CONVENTION*)(");
for (int i = 0; i < params.length; i++) {
if (i != 0) output(", ");
@@ -578,8 +543,8 @@ void generateDynamicFunctionCall(JNIMethod method, JNIParameter[] params, JNITyp
}
output(cast);
} else {
- JNIType paramType = param.getType(), paramType64 = param.getType64();
- output(paramType.getTypeSignature4(!paramType.equals(paramType64), isStruct));
+ JNIType paramType = param.getType();
+ output(paramType.getTypeSignature4(false, isStruct));
}
}
output("))");
@@ -592,7 +557,7 @@ void generateDynamicFunctionCall(JNIMethod method, JNIParameter[] params, JNITyp
outputln("\t}");
}
-void generateFunctionCallLeftSide(JNIMethod method, JNIType returnType, JNIType returnType64, boolean needsReturn) {
+void generateFunctionCallLeftSide(JNIMethod method, JNIType returnType, boolean needsReturn) {
output("\t");
if (!returnType.isType("void")) {
if (needsReturn) {
@@ -601,7 +566,7 @@ void generateFunctionCallLeftSide(JNIMethod method, JNIType returnType, JNIType
output("return ");
}
output("(");
- output(returnType.getTypeSignature2(!returnType.equals(returnType64)));
+ output(returnType.getTypeSignature2(false));
output(")");
}
if (method.getFlag(FLAG_ADDRESS)) {
@@ -639,7 +604,7 @@ void generateFunctionCallRightSide(JNIMethod method, JNIParameter[] params, int
}
}
-void generateFunctionCall(JNIMethod method, JNIParameter[] params, JNIType returnType, JNIType returnType64, boolean needsReturn) {
+void generateFunctionCall(JNIMethod method, JNIParameter[] params, JNIType returnType, boolean needsReturn) {
String name = method.getName();
String copy = (String)method.getParam("copy");
boolean isCPP = getCPP();
@@ -649,7 +614,7 @@ void generateFunctionCall(JNIMethod method, JNIParameter[] params, JNIType retur
output(copy);
output(" temp = ");
} else {
- generateFunctionCallLeftSide(method, returnType, returnType64, needsReturn);
+ generateFunctionCallLeftSide(method, returnType, needsReturn);
}
int paramStart = 0;
if (name.startsWith("_")) name = name.substring(1);
@@ -667,7 +632,7 @@ void generateFunctionCall(JNIMethod method, JNIParameter[] params, JNIType retur
output(cast);
} else {
output("(");
- output(returnType.getTypeSignature2(!returnType.equals(returnType64)));
+ output(returnType.getTypeSignature2(false));
output(" (");
output((String)method.getParam("convention"));
output("*)())");
@@ -676,17 +641,17 @@ void generateFunctionCall(JNIMethod method, JNIParameter[] params, JNIType retur
paramStart = 1;
} else if (name.startsWith("VtblCall") || name.startsWith("_VtblCall")) {
output("((");
- output(returnType.getTypeSignature2(!returnType.equals(returnType64)));
+ output(returnType.getTypeSignature2(false));
output(" (STDMETHODCALLTYPE *)(");
for (int i = 1; i < params.length; i++) {
if (i != 1) output(", ");
JNIParameter param = params[i];
- JNIType paramType = param.getType(), paramType64 = param.getType64();
- output(paramType.getTypeSignature4(!paramType.equals(paramType64), param.getFlag(FLAG_STRUCT)));
+ JNIType paramType = param.getType();
+ output(paramType.getTypeSignature4(true, param.getFlag(FLAG_STRUCT)));
}
output("))(*(");
- JNIType paramType = params[1].getType(), paramType64 = params[1].getType64();
- output(paramType.getTypeSignature4(!paramType.equals(paramType64), false));
+ JNIType paramType = params[1].getType();
+ output(paramType.getTypeSignature4(false, false));
output(" **)arg1)[arg0])");
paramStart = 1;
} else if (method.getFlag(FLAG_CPP) || method.getFlag(FLAG_SETTER) || method.getFlag(FLAG_GETTER) || method.getFlag(FLAG_ADDER)) {
@@ -768,7 +733,7 @@ void generateFunctionCall(JNIMethod method, JNIParameter[] params, JNIType retur
}
if (method.getFlag(Flags.FLAG_CAST)) {
output("((");
- String returnCast = returnType.getTypeSignature2(!returnType.equals(returnType64));
+ String returnCast = returnType.getTypeSignature2(false);
if (name.equals("objc_msgSend_bool") && returnCast.equals("jboolean")) {
returnCast = "BOOL";
}
@@ -783,13 +748,13 @@ void generateFunctionCall(JNIMethod method, JNIParameter[] params, JNIType retur
if (cast.endsWith(")")) cast = cast.substring(0, cast.length() - 1);
output(cast);
} else {
- JNIType paramType = param.getType(), paramType64 = param.getType64();
+ JNIType paramType = param.getType();
if (!(paramType.isPrimitive() || paramType.isArray())) {
if (param.getTypeClass().getFlag(FLAG_STRUCT)) {
output("struct ");
}
}
- output(paramType.getTypeSignature4(!paramType.equals(paramType64), param.getFlag(FLAG_STRUCT)));
+ output(paramType.getTypeSignature4(false, param.getFlag(FLAG_STRUCT)));
}
}
output("))");
@@ -828,7 +793,7 @@ void generateFunctionCall(JNIMethod method, JNIParameter[] params, JNIType retur
outputln("\t\t*copy = temp;");
output("\t\trc = ");
output("(");
- output(returnType.getTypeSignature2(!returnType.equals(returnType64)));
+ output(returnType.getTypeSignature2(false));
output(")");
outputln("copy;");
outputln("\t}");
@@ -848,8 +813,8 @@ void generateFunctionCall(JNIMethod method, JNIParameter[] params, JNIType retur
void generate_objc_msgSend_stret (JNIParameter[] params, String func) {
output("\t\t*lparg0 = (*(");
- JNIType paramType = params[0].getType(), paramType64 = params[0].getType64();
- output(paramType.getTypeSignature4(!paramType.equals(paramType64), true));
+ JNIType paramType = params[0].getType();
+ output(paramType.getTypeSignature4(false, true));
output(" (*)(");
for (int i = 1; i < params.length; i++) {
if (i != 1) output(", ");
@@ -860,13 +825,13 @@ void generate_objc_msgSend_stret (JNIParameter[] params, String func) {
if (cast.endsWith(")")) cast = cast.substring(0, cast.length() - 1);
output(cast);
} else {
- paramType = param.getType(); paramType64 = param.getType64();
+ paramType = param.getType();
if (!(paramType.isPrimitive() || paramType.isArray())) {
if (param.getTypeClass().getFlag(FLAG_STRUCT)) {
output("struct ");
}
}
- output(paramType.getTypeSignature4(!paramType.equals(paramType64), param.getFlag(FLAG_STRUCT)));
+ output(paramType.getTypeSignature4(false, param.getFlag(FLAG_STRUCT)));
}
}
output("))");
@@ -880,8 +845,8 @@ void generateReturn(JNIType returnType, boolean needsReturn) {
}
}
-void generateMemmove(JNIMethod method, String function, String function64, JNIParameter[] params) {
- generateEnterExitMacro(method, function, function64, true);
+void generateMemmove(JNIMethod method, String function, JNIParameter[] params) {
+ generateEnterExitMacro(method, function, true);
output("\t");
boolean get = params[0].getType().isPrimitive();
String className = params[get ? 1 : 0].getType().getSimpleName();
@@ -891,10 +856,10 @@ void generateMemmove(JNIMethod method, String function, String function64, JNIPa
output(className);
output(get ? " *)arg0)" : " *)arg1)");
outputln(";");
- generateEnterExitMacro(method, function, function64, false);
+ generateEnterExitMacro(method, function, false);
}
-void generateFunctionBody(JNIMethod method, String function, String function64, JNIParameter[] params, JNIType returnType, JNIType returnType64) {
+void generateFunctionBody(JNIMethod method, String function, JNIParameter[] params, JNIType returnType) {
outputln("{");
/* Custom GTK memmoves. */
@@ -902,28 +867,28 @@ void generateFunctionBody(JNIMethod method, String function, String function64,
if (name.startsWith("_")) name = name.substring(1);
boolean isMemove = (name.equals("memmove") || name.equals("MoveMemory")) && params.length == 2 && returnType.isType("void");
if (isMemove) {
- generateMemmove(method, function, function64, params);
+ generateMemmove(method, function, params);
} else {
- boolean needsReturn = generateLocalVars(params, returnType, returnType64);
- generateEnterExitMacro(method, function, function64, true);
+ boolean needsReturn = generateLocalVars(params, returnType);
+ generateEnterExitMacro(method, function, true);
boolean genFailTag = generateGetters(params);
if (method.getFlag(FLAG_DYNAMIC)) {
- generateDynamicFunctionCall(method, params, returnType, returnType64, needsReturn);
+ generateDynamicFunctionCall(method, params, returnType, needsReturn);
} else {
- generateFunctionCall(method, params, returnType, returnType64, needsReturn);
+ generateFunctionCall(method, params, returnType, needsReturn);
}
if (genFailTag) outputln("fail:");
generateSetters(params);
- generateEnterExitMacro(method, function, function64, false);
+ generateEnterExitMacro(method, function, false);
generateReturn(returnType, needsReturn);
}
outputln("}");
}
-void generateFunctionPrototype(JNIMethod method, String function, JNIParameter[] params, JNIType returnType, JNIType returnType64, boolean singleLine) {
+void generateFunctionPrototype(JNIMethod method, String function, JNIParameter[] params, JNIType returnType, boolean singleLine) {
output("JNIEXPORT ");
- output(returnType.getTypeSignature2(!returnType.equals(returnType64)));
+ output(returnType.getTypeSignature2(false));
output(" JNICALL ");
output(method.getDeclaringClass().getSimpleName());
output("_NATIVE(");
@@ -943,29 +908,17 @@ void generateFunctionPrototype(JNIMethod method, String function, JNIParameter[]
output(" that");
for (int i = 0; i < params.length; i++) {
output(", ");
- JNIType paramType = params[i].getType(), paramType64 = params[i].getType64();
- output(paramType.getTypeSignature2(!paramType.equals(paramType64)));
+ JNIType paramType = params[i].getType();
+ output(paramType.getTypeSignature2(false));
output(" arg" + i);
}
output(")");
if (!singleLine) outputln();
}
-void generateSourceStart(String function, String function64) {
- if (function.equals(function64)) {
- output("#ifndef NO_");
- outputln(function);
- } else {
- output("#if (!defined(NO_");
- output(function);
- output(") && !defined(");
- output(JNI64);
- output(")) || (!defined(NO_");
- output(function64);
- output(") && defined(");
- output(JNI64);
- outputln("))");
- }
+void generateSourceStart(String function) {
+ output("#ifndef NO_");
+ outputln(function);
}
void generateSourceEnd() {
diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ReflectClass.java b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ReflectClass.java
index b3a4ff7184..28bef06472 100644
--- a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ReflectClass.java
+++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ReflectClass.java
@@ -39,12 +39,12 @@ void checkMembers() {
if (fields != null) return;
String source = null;
CompilationUnit unit = null;
- if (JNIItem.GEN64) {
- source = JNIGenerator.loadFile(sourcePath);
- ASTParser parser = ASTParser.newParser(AST.JLS8);
- parser.setSource(source.toCharArray());
- unit = (CompilationUnit)parser.createAST(null);
- }
+
+ source = JNIGenerator.loadFile(sourcePath);
+ ASTParser parser = ASTParser.newParser(AST.JLS8);
+ parser.setSource(source.toCharArray());
+ unit = (CompilationUnit)parser.createAST(null);
+
Field[] fields = clazz.getDeclaredFields();
this.fields = new ReflectField[fields.length];
for (int i = 0; i < fields.length; i++) {
diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ReflectField.java b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ReflectField.java
index 37937b0185..f333eb6770 100644
--- a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ReflectField.java
+++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ReflectField.java
@@ -13,15 +13,13 @@
*******************************************************************************/
package org.eclipse.swt.tools.internal;
-import java.io.*;
import java.lang.reflect.*;
-import java.util.*;
import org.eclipse.jdt.core.dom.*;
public class ReflectField extends ReflectItem implements JNIField {
Field field;
- ReflectType type, type64;
+ ReflectType type;
ReflectClass declaringClass;
public ReflectField(ReflectClass declaringClass, Field field, String source, CompilationUnit unit) {
@@ -29,31 +27,6 @@ public ReflectField(ReflectClass declaringClass, Field field, String source, Com
this.field = field;
Class<?> clazz = field.getType();
type = new ReflectType(clazz);
- type64 = type;
- boolean changes = canChange64(clazz);
- if (changes && new File(declaringClass.sourcePath).exists()) {
- TypeDeclaration type1 = (TypeDeclaration)unit.types().get(0);
- Class<?> result = null;
- FieldDeclaration[] fields = type1.getFields();
- for (int i = 0; i < fields.length && result == null; i++) {
- FieldDeclaration node = fields[i];
- for (Iterator<?> iterator = node.fragments().iterator(); iterator.hasNext();) {
- VariableDeclarationFragment decl = (VariableDeclarationFragment) iterator.next();
- if (decl.getName().getIdentifier().equals(field.getName())) {
- String s = source.substring(node.getStartPosition(), node.getStartPosition() + node.getLength());
- if (clazz == int.class && s.contains("int /*long*/")) type64 = new ReflectType(long.class);
- else if (clazz == float.class && s.contains("float /*double*/")) type64 = new ReflectType(double.class);
- else if (clazz == int[].class && (s.contains("int /*long*/") || s.contains("int[] /*long[]*/"))) type64 = new ReflectType(long[].class);
- else if (clazz == float[].class && (s.contains("float /*double*/")|| s.contains("float[] /*double[]*/"))) type = new ReflectType(double[].class);
- else if (clazz == long.class && s.contains("long /*int*/")) type = new ReflectType(int.class);
- else if (clazz == double.class && s.contains("double /*float*/")) type = new ReflectType(float.class);
- else if (clazz == long[].class && (s.contains("long /*int*/")|| s.contains("long[] /*int[]*/"))) type = new ReflectType(int[].class);
- else if (clazz == double[].class && (s.contains("double /*float*/")|| s.contains("double[] /*float[]*/"))) type = new ReflectType(float[].class);
- break;
- }
- }
- }
- }
}
@Override
@@ -88,11 +61,6 @@ public JNIType getType() {
}
@Override
-public JNIType getType64() {
- return type64;
-}
-
-@Override
public String getAccessor() {
return (String)getParam("accessor");
}
diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ReflectItem.java b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ReflectItem.java
index 91a31a16ea..1a22950b4a 100644
--- a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ReflectItem.java
+++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ReflectItem.java
@@ -40,16 +40,4 @@ static boolean convertTo32Bit(JNIType[] paramTypes, boolean floatingPointTypes)
}
return changed;
}
-
-boolean canChange64(Class<?> clazz) {
- if (!GEN64) return false;
- return clazz == Integer.TYPE ||
- clazz == Long.TYPE ||
- clazz == Float.TYPE ||
- clazz == Double.TYPE ||
- clazz == int[].class ||
- clazz == long[].class ||
- clazz == float[].class ||
- clazz == double[].class;
-}
}
diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ReflectMethod.java b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ReflectMethod.java
index 4916b8372b..888e7aa2fd 100644
--- a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ReflectMethod.java
+++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ReflectMethod.java
@@ -13,17 +13,15 @@
*******************************************************************************/
package org.eclipse.swt.tools.internal;
-import java.io.*;
import java.lang.reflect.*;
-import java.util.*;
import org.eclipse.jdt.core.dom.*;
import org.eclipse.jdt.core.dom.Modifier;
public class ReflectMethod extends ReflectItem implements JNIMethod {
Method method;
- ReflectType returnType, returnType64;
- ReflectType[] paramTypes, paramTypes64;
+ ReflectType returnType;
+ ReflectType[] paramTypes;
ReflectClass declaringClass;
Boolean unique;
@@ -33,69 +31,9 @@ public ReflectMethod(ReflectClass declaringClass, Method method, String source,
Class<?> returnType = method.getReturnType();
Class<?>[] paramTypes = method.getParameterTypes();
this.returnType = new ReflectType(returnType);
- this.returnType64 = this.returnType;
this.paramTypes = new ReflectType[paramTypes.length];
- this.paramTypes64 = new ReflectType[paramTypes.length];
for (int i = 0; i < this.paramTypes.length; i++) {
- this.paramTypes[i] = this.paramTypes64[i] = new ReflectType(paramTypes[i]);
- }
- boolean changes = false;
- if ((method.getModifiers() & Modifier.NATIVE) != 0) {
- changes = canChange64(returnType);
- if (!changes) {
- for (int i = 0; i < paramTypes.length && !changes; i++) {
- changes |= canChange64(paramTypes[i]);
- }
- }
- }
- if (changes && new File(declaringClass.sourcePath).exists()) {
- String name = method.getName();
- TypeDeclaration type = (TypeDeclaration)unit.types().get(0);
- MethodDeclaration decl = null;
- MethodDeclaration[] methods = type.getMethods();
- for (int i = 0; i < methods.length && decl == null; i++) {
- MethodDeclaration node = methods[i];
- if (node.getName().getIdentifier().equals(name)) {
- if (!declaringClass.getSimpleName(returnType).equals(node.getReturnType2().toString())) continue;
- List<?> parameters = node.parameters();
- if (parameters.size() != paramTypes.length) continue;
- decl = node;
- for (int j = 0; j < paramTypes.length; j++) {
- if (!declaringClass.getSimpleName(paramTypes[j]).equals(((SingleVariableDeclaration)parameters.get(j)).getType().toString())) {
- decl = null;
- break;
- }
- }
- }
- }
- for (int i = 0; i < paramTypes.length; i++) {
- if (canChange64(paramTypes[i])) {
- Class<?> clazz = paramTypes[i];
- SingleVariableDeclaration node = (SingleVariableDeclaration)decl.parameters().get(i);
- String s = source.substring(node.getStartPosition(), node.getStartPosition() + node.getLength());
- if (clazz == int.class && s.contains("int /*long*/")) this.paramTypes64[i] = new ReflectType(long.class);
- else if (clazz == int[].class && (s.contains("int /*long*/") || s.contains("int[] /*long[]*/"))) this.paramTypes64[i] = new ReflectType(long[].class);
- else if (clazz == float.class && s.contains("float /*double*/")) this.paramTypes64[i] = new ReflectType(double.class);
- else if (clazz == float[].class && (s.contains("float /*double*/")|| s.contains("float[] /*double[]*/"))) this.paramTypes64[i] = new ReflectType(double[].class);
- else if (clazz == long.class && s.contains("long /*int*/")) this.paramTypes[i] = new ReflectType(int.class);
- else if (clazz == long[].class && (s.contains("long /*int*/")|| s.contains("long[] /*int[]*/"))) this.paramTypes[i] = new ReflectType(int[].class);
- else if (clazz == double.class && s.contains("double /*float*/")) this.paramTypes[i] = new ReflectType(float.class);
- else if (clazz == double[].class && (s.contains("double /*float*/")|| s.contains("double[] /*float[]*/"))) this.paramTypes[i] = new ReflectType(float[].class);
- }
- }
- if (canChange64(returnType)) {
- Class<?> clazz = returnType;
- ASTNode node = decl.getReturnType2();
- String s = source.substring(node.getStartPosition(), decl.getName().getStartPosition());
- if (clazz == int.class && s.contains("int /*long*/")) this.returnType64 = new ReflectType(long.class);
- else if (clazz == int[].class && (s.contains("int /*long*/") || s.contains("int[] /*long[]*/"))) this.returnType64 = new ReflectType(long[].class);
- else if (clazz == float.class && s.contains("float /*double*/")) this.returnType64 = new ReflectType(double.class);
- else if (clazz == float[].class && (s.contains("float /*double*/")|| s.contains("float[] /*double[]*/"))) this.returnType64 = new ReflectType(double[].class);
- else if (clazz == long.class && s.contains("long /*int*/")) this.returnType = new ReflectType(int.class);
- else if (clazz == long[].class && (s.contains("long /*int*/")|| s.contains("long[] /*int[]*/"))) this.returnType = new ReflectType(int[].class);
- else if (clazz == double.class && s.contains("double /*float*/")) this.returnType = new ReflectType(float.class);
- else if (clazz == double[].class && (s.contains("double /*float*/")|| s.contains("double[] /*float[]*/"))) this.returnType = new ReflectType(float[].class);
- }
+ this.paramTypes[i] = new ReflectType(paramTypes[i]);
}
}
@@ -149,11 +87,6 @@ public JNIType[] getParameterTypes() {
}
@Override
-public JNIType[] getParameterTypes64() {
- return paramTypes64;
-}
-
-@Override
public JNIParameter[] getParameters() {
Class<?>[] paramTypes = method.getParameterTypes();
ReflectParameter[] result = new ReflectParameter[paramTypes.length];
@@ -169,11 +102,6 @@ public JNIType getReturnType() {
}
@Override
-public JNIType getReturnType64() {
- return returnType64;
-}
-
-@Override
public String getAccessor() {
return (String)getParam("accessor");
}
diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ReflectParameter.java b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ReflectParameter.java
index 2996bba653..dff4498354 100644
--- a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ReflectParameter.java
+++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ReflectParameter.java
@@ -96,11 +96,6 @@ public JNIType getType() {
}
@Override
-public JNIType getType64() {
- return method.getParameterTypes64()[parameter];
-}
-
-@Override
public int getParameter() {
return parameter;
}
diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/StatsGenerator.java b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/StatsGenerator.java
index 7877ee0f8d..61262dc4ec 100644
--- a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/StatsGenerator.java
+++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/StatsGenerator.java
@@ -13,7 +13,7 @@
*******************************************************************************/
package org.eclipse.swt.tools.internal;
-import java.lang.reflect.Modifier;
+import java.lang.reflect.*;
public class StatsGenerator extends JNIGenerator {
@@ -115,22 +115,10 @@ void generateSourceFile(JNIClass clazz) {
sort(methods);
for (JNIMethod method : methods) {
if ((method.getModifiers() & Modifier.NATIVE) == 0) continue;
- String function = getFunctionName(method), function64 = getFunctionName(method, method.getParameterTypes64());
- if (!function.equals(function64)) {
- output("#ifndef ");
- output(JNI64);
- outputln();
- }
+ String function = getFunctionName(method);
output("\t\"");
output(function);
outputln("\",");
- if (!function.equals(function64)) {
- outputln("#else");
- output("\t\"");
- output(function64);
- outputln("\",");
- outputln("#endif");
- }
if (progress != null) progress.step();
}
outputln("};");
@@ -197,22 +185,10 @@ void generateFunctionEnum(JNIMethod[] methods) {
outputln("typedef enum {");
for (JNIMethod method : methods) {
if ((method.getModifiers() & Modifier.NATIVE) == 0) continue;
- String function = getFunctionName(method), function64 = getFunctionName(method, method.getParameterTypes64());
- if (!function.equals(function64)) {
- output("#ifndef ");
- output(JNI64);
- outputln();
- }
+ String function = getFunctionName(method);
output("\t");
output(function);
outputln("_FUNC,");
- if (!function.equals(function64)) {
- outputln("#else");
- output("\t");
- output(function64);
- outputln("_FUNC,");
- outputln("#endif");
- }
if (progress != null) progress.step();
}
JNIClass clazz = methods[0].getDeclaringClass();
diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/StructsGenerator.java b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/StructsGenerator.java
index c8f135ad94..6bbd8f4d08 100644
--- a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/StructsGenerator.java
+++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/StructsGenerator.java
@@ -260,11 +260,11 @@ void generateCacheFunction(JNIClass clazz) {
output(clazzName);
output("Fc.clazz, \"");
output(field.getName());
- JNIType type = field.getType(), type64 = field.getType64();
+ JNIType type = field.getType();
output("\", ");
- if (type.equals(type64)) output("\"");
- output(type.getTypeSignature(!type.equals(type64)));
- if (type.equals(type64)) output("\"");
+ output("\"");
+ output(type.getTypeSignature(false));
+ output("\"");
outputln(");");
}
output("\t");
@@ -299,7 +299,7 @@ void generateGetFields(JNIClass clazz) {
if (noWinCE) {
outputln("#ifndef _WIN32_WCE");
}
- JNIType type = field.getType(), type64 = field.getType64();
+ JNIType type = field.getType();
String typeName = type.getSimpleName();
String accessor = field.getAccessor();
if (accessor == null || accessor.length() == 0) accessor = field.getName();
@@ -314,7 +314,7 @@ void generateGetFields(JNIClass clazz) {
} else {
output("(*env)->Get");
}
- output(type.getTypeSignature1(!type.equals(type64)));
+ output(type.getTypeSignature1(false));
if (isCPP) {
output("Field(lpObject, ");
} else {
@@ -325,13 +325,13 @@ void generateGetFields(JNIClass clazz) {
output(field.getName());
output(");");
} else if (type.isArray()) {
- JNIType componentType = type.getComponentType(), componentType64 = type64.getComponentType();
+ JNIType componentType = type.getComponentType();
if (componentType.isPrimitive()) {
outputln("\t{");
output("\t");
- output(type.getTypeSignature2(!type.equals(type64)));
+ output(type.getTypeSignature2(false));
output(" lpObject1 = (");
- output(type.getTypeSignature2(!type.equals(type64)));
+ output(type.getTypeSignature2(false));
if (isCPP) {
output(")env->GetObjectField(lpObject, ");
} else {
@@ -346,7 +346,7 @@ void generateGetFields(JNIClass clazz) {
} else {
output("\t(*env)->Get");
}
- output(componentType.getTypeSignature1(!componentType.equals(componentType64)));
+ output(componentType.getTypeSignature1(false));
if (isCPP) {
output("ArrayRegion(lpObject1, 0, sizeof(lpStruct->");
} else {
@@ -356,11 +356,11 @@ void generateGetFields(JNIClass clazz) {
output(")");
if (!componentType.isType("byte")) {
output(" / sizeof(");
- output(componentType.getTypeSignature2(!componentType.equals(componentType64)));
+ output(componentType.getTypeSignature2(false));
output(")");
}
output(", (");
- output(type.getTypeSignature4(!type.equals(type64), false));
+ output(type.getTypeSignature4(false, false));
output(")");
if (field.getFlag(FLAG_STRUCT)) {
output("&");
@@ -451,7 +451,7 @@ void generateSetFields(JNIClass clazz) {
if (noWinCE) {
outputln("#ifndef _WIN32_WCE");
}
- JNIType type = field.getType(), type64 = field.getType64();
+ JNIType type = field.getType();
String typeName = type.getSimpleName();
String accessor = field.getAccessor();
if (accessor == null || accessor.length() == 0) accessor = field.getName();
@@ -462,7 +462,7 @@ void generateSetFields(JNIClass clazz) {
} else {
output("\t(*env)->Set");
}
- output(type.getTypeSignature1(!type.equals(type64)));
+ output(type.getTypeSignature1(false));
if (isCPP) {
output("Field(lpObject, ");
} else {
@@ -472,18 +472,18 @@ void generateSetFields(JNIClass clazz) {
output("Fc.");
output(field.getName());
output(", (");
- output(type.getTypeSignature2(!type.equals(type64)));
+ output(type.getTypeSignature2(false));
output(")lpStruct->");
output(accessor);
output(");");
} else if (type.isArray()) {
- JNIType componentType = type.getComponentType(), componentType64 = type64.getComponentType();
+ JNIType componentType = type.getComponentType();
if (componentType.isPrimitive()) {
outputln("\t{");
output("\t");
- output(type.getTypeSignature2(!type.equals(type64)));
+ output(type.getTypeSignature2(false));
output(" lpObject1 = (");
- output(type.getTypeSignature2(!type.equals(type64)));
+ output(type.getTypeSignature2(false));
if (isCPP) {
output(")env->GetObjectField(lpObject, ");
} else {
@@ -498,7 +498,7 @@ void generateSetFields(JNIClass clazz) {
} else {
output("\t(*env)->Set");
}
- output(componentType.getTypeSignature1(!componentType.equals(componentType64)));
+ output(componentType.getTypeSignature1(false));
if (isCPP) {
output("ArrayRegion(lpObject1, 0, sizeof(lpStruct->");
} else {
@@ -508,11 +508,11 @@ void generateSetFields(JNIClass clazz) {
output(")");
if (!componentType.isType("byte")) {
output(" / sizeof(");
- output(componentType.getTypeSignature2(!componentType.equals(componentType64)));
+ output(componentType.getTypeSignature2(false));
output(")");
}
output(", (");
- output(type.getTypeSignature4(!type.equals(type64), false));
+ output(type.getTypeSignature4(false, false));
output(")");
if (field.getFlag(FLAG_STRUCT)) {
output("&");
diff --git a/bundles/org.eclipse.swt.tools/plugin.properties b/bundles/org.eclipse.swt.tools/plugin.properties
index ebc363db1d..feb5be16e2 100644
--- a/bundles/org.eclipse.swt.tools/plugin.properties
+++ b/bundles/org.eclipse.swt.tools/plugin.properties
@@ -17,4 +17,3 @@ macViewName = Mac Generator
spyViewName = SWT Spy
sleakViewName = Sleak
jniBuilderName = JNI Builder
-enableCheck64Name = Report 32/64-bit Problems

Back to the top