Re: [libvirt-java] [PATCH 10/65] Fix wrapping of native size_t data type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 13, 2014 at 04:22:18PM +0100, Claudio Bley wrote:
> Libvirt function parameters having type (pointer to) size_t were
> wrapped via JNA using int, long or even NativeLong. Alas, none of
> these is actually correct as the size of size_t may be the same as the
> size of either (unsigned) int, long or even long long on different
> platforms.
> 
> JNA provides the size of a native size_t to us, so using this
> information we define and use class SizeT and class SizeTByReference for
> wrapping a native size_t and size_t*, respectively.
> 
> Signed-off-by: Claudio Bley <cbley@xxxxxxxxxx>
> ---
>  src/main/java/org/libvirt/Domain.java              |    5 +-
>  src/main/java/org/libvirt/Secret.java              |   10 ++--
>  src/main/java/org/libvirt/Stream.java              |    7 ++-
>  src/main/java/org/libvirt/jna/Libvirt.java         |   14 +++---
>  src/main/java/org/libvirt/jna/SizeT.java           |   19 ++++++++
>  .../java/org/libvirt/jna/SizeTByReference.java     |   50 ++++++++++++++++++++
>  6 files changed, 87 insertions(+), 18 deletions(-)
>  create mode 100644 src/main/java/org/libvirt/jna/SizeT.java
>  create mode 100644 src/main/java/org/libvirt/jna/SizeTByReference.java

ACK

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]