Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Alignment Issues with *ManagedStruct?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Chromatic  
View profile  
 More options Feb 3 2004, 2:48 am
Newsgroups: perl.perl6.internals
From: chroma...@wgz.org (Chromatic)
Date: Mon, 02 Feb 2004 23:13:32 -0800
Local: Tues, Feb 3 2004 2:13 am
Subject: Alignment Issues with *ManagedStruct?

Hi there,

While adding support for handling keyboard events to the SDL bindings
(see the attached patch; it's not for applying, as the documentation is
lacking and the interface exposes too many details), I discovered that
the alignment of members within a struct matters quite a bit.

That is, to make the keyed struct work correctly, I had to add extra
bytes of padding in the appropriate places.  This works, at least on my
platform, but I'm not sure how portable it is.

If you have the SDL headers installed on your system, I'm trying to make
the Parrot equivalent of an SDL_Event, the mess that it is.  In
particular, I added one byte of padding before keysym and three bytes
before keysym.sym.

Is this indeed unportable?  If so, is there a way to work around this
without writing C code for every afflicted structure?  Is it a case of
making the struct PMCs smarter?  Or have I fixed it with my nasty
workaround?

-- c

  sdl_key_events.patch
4K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.