diff options
author | Uli Schlachter <psychon@znc.in> | 2011-08-24 12:47:16 +0200 |
---|---|---|
committer | Peter Harris <pharris@opentext.com> | 2011-08-24 10:28:49 -0400 |
commit | aa02096b8e7f94ad3c998a8d5af54963ee860b13 (patch) | |
tree | b32be331d88adc6c4ad489941aedf6569baa10de /src/xcb_auth.c | |
parent | 4f25ee16443b29e1a25bd26a724e1e0a577e21ff (diff) |
Compute alignment correctly
The code previously assumed that everything has to be aligned to a 4 byte
boundary. This assumption is wrong as e.g. the STR struct from xproto shows.
Instead, each type has to be aligned to its natural alignment. So a char doesn't
need any alignment, a INT16 gets aligned to a 2-byte-boundary and a INT32 gets
the old 4 byte alignment.
I'm not 100% sure that this commit is correct, but some quick tests with awesome
and cairo-xcb went well.
This commit causes lots of dead assignments to xcb_align_to since only the last
field's alignment is actually used, but this simplified this patch a lot.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=34037
Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Peter Harris <pharris@opentext.com>
Diffstat (limited to 'src/xcb_auth.c')
0 files changed, 0 insertions, 0 deletions