From f5d1410313c308aa7262b441abf787976d122069 Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Sun, 24 Feb 2019 16:31:15 +0100 Subject: [PATCH 1/3] javacpp: updated dependency to new version (1.4.4) The latest and greatest. --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 9a7e52de..d6cd0a15 100644 --- a/pom.xml +++ b/pom.xml @@ -68,7 +68,7 @@ org.bytedeco javacpp - 1.1 + 1.4.4 junit @@ -100,7 +100,7 @@ org.bytedeco javacpp - 1.1 + 1.4.4 ${platform.properties} ${project.build.outputDirectory} From a570e8762f5de7762142de0c9231ecca5ef931bb Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Tue, 26 Feb 2019 18:41:37 +0100 Subject: [PATCH 2/3] Variant: use get for getters Replace all the wrappers with direct calls to the native version a la "T Variant::get()". --- src/main/java/org/g_node/nix/Variant.java | 40 +++-------------------- 1 file changed, 5 insertions(+), 35 deletions(-) diff --git a/src/main/java/org/g_node/nix/Variant.java b/src/main/java/org/g_node/nix/Variant.java index 3cfa4dfb..94fc8b6f 100644 --- a/src/main/java/org/g_node/nix/Variant.java +++ b/src/main/java/org/g_node/nix/Variant.java @@ -150,70 +150,40 @@ public void setString(String value) { // Getters //-------------------------------------------------- - private native void get(@Cast("bool*") @ByRef BoolPointer out); - /** * Getter for boolean value. * * @return boolean data. */ - public boolean getBoolean() { - BoolPointer bp = new BoolPointer(1); - get(bp); - return bp.get(); - } - - private native void get(@Cast("int32_t*") @ByRef IntPointer value); + public native @Cast("bool") @Name("get") boolean getBoolean(); /** * Getter for 32 bit integer value. * * @return 32 bit integer data as int. */ - public int getInt() { - IntPointer p = new IntPointer(1); - get(p); - return p.get(); - } - - private native void get(@Cast("int64_t*") @ByRef LongPointer value); + public native @Cast("int32_t") @Name("get") int getInt(); /** * Getter for 64 bit integer value. * * @return 64 bit int in NIX as long. */ - public long getLong() { - LongPointer p = new LongPointer(1); - get(p); - return p.get(); - } - - private native void get(@ByRef double[] value); + public native @Cast("int64_t") @Name("get") long getLong(); /** * Getter for double value. * * @return double data. */ - public double getDouble() { - double[] val = new double[1]; - get(val); - return val[0]; - } - - private native void get(@StdString BytePointer value); + public native @Cast("double") @Name("get") double getDouble(); /** * Getter for string value. * * @return string data. */ - public String getString() { - BytePointer bp = new BytePointer(1); - get(bp); - return bp.getString(); - } + public native @StdString @Name("get") String getString(); //-------------------------------------------------- // Other functions From 0d3b729dd381788deb20d38c18c0d911cabcfc76 Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Tue, 26 Feb 2019 18:43:07 +0100 Subject: [PATCH 3/3] appveyor: don't ignore failing tests Because test should not failed and if they fail the MUST not be ignored. --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 9b7229bd..bf41d3c9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -49,7 +49,7 @@ install: build_script: # Build NIX Java bindings - - mvn clean package -DnixIncludePath=C:/projects/nix-java/nix/include -DboostIncludePath=%BOOST_INCLUDEDIR% -DnixLinkPath=C:/projects/nix-java/nix/build/Release -Dhdf5LinkPath=%HDF5_BASE%/bin -DboostLinkPath=%BOOST_ROOT%/lib -Dmaven.test.failure.ignore=true -Dplatform.dependency=false + - mvn clean package -DnixIncludePath=C:/projects/nix-java/nix/include -DboostIncludePath=%BOOST_INCLUDEDIR% -DnixLinkPath=C:/projects/nix-java/nix/build/Release -Dhdf5LinkPath=%HDF5_BASE%/bin -DboostLinkPath=%BOOST_ROOT%/lib -Dplatform.dependency=false on_failure: