13 messages in net.java.dev.jna.usersRe: [jna-users] "Can't determine size...
FromSent OnAttachments
Zsolt KútiMay 11, 2009 12:18 pm 
Timothy WallMay 11, 2009 12:22 pm 
Zsolt KútiMay 11, 2009 12:46 pm 
Timothy WallMay 11, 2009 1:06 pm 
Zsolt KútiMay 14, 2009 1:30 pm 
Timothy WallMay 14, 2009 1:58 pm 
Zsolt KútiMay 16, 2009 12:19 pm 
Timothy WallMay 16, 2009 6:42 pm 
Zsolt KútiMay 17, 2009 10:32 am 
Timothy WallMay 17, 2009 10:41 am 
Zsolt KútiMay 17, 2009 11:08 am 
Timothy WallMay 17, 2009 12:47 pm 
Zsolt KútiMay 18, 2009 10:33 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [jna-users] "Can't determine size of nested structure"Actions...
From:Zsolt Kúti (kut@t-online.hu)
Date:May 16, 2009 12:19:10 pm
List:net.java.dev.jna.users

On Thu, 14 May 2009 16:59:18 -0400 Timothy Wall <twal@dev.java.net> wrote:

bit fields are packed in a compiler-specific manner, but are usually packed together in integer-sized chunks.

you can double check the offsets of your structure's fields by using gcc's offsetof built-in or printing the difference between the field address and the structure base address.

keep checking your field mappings until the structures have the same size; alternatively, if you don't actually need to access the structure's contents, you can just make a single byte[] field of the appropriate size.

Hi Timothy,

Thanks for your continued help! My apologies for the probably basic questions, but there are so many new things here, I am feeling bit lost. Now I managed to have same struct sizes, but I get still garbage in it.

So here is a bit more on the context. The C function is: f(struct my_struct *s[])

In Java it becomes: class my_struc extends Structure { ... }

int f(my_struct[] s);

One my problems, that I need to create an array size of which I do not know. The other is the garbage in it. I don know what should I do?

Thanks Zsolt