12 messages in net.java.dev.jna.usersRe: [jna-users] Structure
FromSent OnAttachments
Paul LoyJan 10, 2008 8:29 am.java
Paul LoyJan 10, 2008 9:31 am.java
Paul LoyJan 10, 2008 9:47 am.java
Timothy WallJan 14, 2008 5:08 am 
Timothy WallJan 14, 2008 5:23 am 
Paul LoyJan 14, 2008 5:46 am 
Paul LoyJan 14, 2008 8:56 am 
Paul LoyJan 14, 2008 9:21 am 
Timothy WallJan 14, 2008 9:57 am 
Timothy WallJan 14, 2008 11:32 am 
Paul LoyJan 15, 2008 2:05 am 
Timothy WallJan 15, 2008 5:41 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] StructureActions...
From:Timothy Wall (twal@dev.java.net)
Date:Jan 15, 2008 5:41:14 am
List:net.java.dev.jna.users

On Jan 15, 2008, at 5:06 AM, Paul Loy wrote:

AudioChannelLayout* layout = nil; int channels = 4;

UInt32 size = ((size_t) &((AudioChannelLayout *) 0)->mChannelDescriptions[channels]); layout = (AudioChannelLayout*)calloc(size);

One other thing to check here is whether size == sizeof (AudioChannelLayout)*channels.

It's possible that the compiler inserts alignment padding between structures in the array (JNA doesn't account for this possibility, mainly because it hasn't been encountered yet).

If padding is inserted, then a few Structure methods need to be modified to account for it.