On Wed, 2004-02-04 at 00:52, Leopold Toetsch wrote:

> Pushing zero as offset should do The Right Thing, that is proper
> aligning the item. Tighter packed structures can be achieved with
> explicit offset parameters.

In this case, it doesn't, as the struct I'm emulating is:

        typedef struct {
                Uint8 type; /* SDL_KEYDOWN or SDL_KEYUP */
                Uint8 which;    /* The keyboard device index */
                Uint8 state;    /* SDL_PRESSED or SDL_RELEASED */
                SDL_keysym keysym;
        } SDL_KeyboardEvent;

SDL_keysym itself is a struct:

        typedef struct {
                Uint8 scancode;         /* hardware specific */
                SDLKey sym;         /* SDL virtual keysym */
                SDLMod mod;         /* current key modifiers */
                Uint16 unicode;         /* translated character */
        } SDL_keysym;

SDLKey and SDLMod are both enums.

As I understand it (and correct me if I'm wrong), SDL_keysym needs a
byte of padding on my architecture within SDL_KeyboardEvent.  I can add
that padding manually, but I'm not convinced that'll be portable to
different architectures.

That's the kind of padding I'd like unmanagedstruct.pmc to be able to do
for me.

> > Is this one for the TODO list, or did I catch a pumpking in good
> > humours?

> Takers wanted :)

I'm happy to submit this as a TODO if I have the story straight.

-- c

Reply via email to