X11 native get put double

(cherry picked from commit f101bc1108)
(cherry picked from commit 344fe36ceb)
This commit is contained in:
Denis Konoplev
2019-10-11 18:37:13 +03:00
committed by Vitaly Provodin
parent 64ee132f06
commit e3d124653d

View File

@@ -367,6 +367,20 @@ final class Native {
return res;
}
/**
* Access to C double data(eight bytes)
*/
static final int DOUBLE_SIZE = 8;
static double getDouble(long ptr) { return unsafe.getDouble(ptr); }
static double getDouble(long ptr, int index) { return getDouble(ptr + DOUBLE_SIZE * index); }
/**
* Stores to C double data(eight bytes)
*/
static void putDouble(long ptr, double data) { unsafe.putDouble(ptr, data); }
static void putDouble(long ptr, int index, double data) {
putDouble(ptr + index * DOUBLE_SIZE, data);
}
/**
* Access to C "unsigned long" date type, which is XID in X