eet_data: guarantee double-word alignment for temporary stack buffer.

The code was giving enough memory to store doubles and longs, but they
could be unaligned as "unsigned char" allows 1-byte alignment, while
double may require 8 bytes.

By specifying the array as "long long" we force certain alignment in a
platform independent way. As this array is small enough and
short-lived, the number of items were not changed, this results in
more bytes on the stack but it shouldn't matter.
This commit is contained in:
Gustavo Sverzut Barbieri 2014-01-20 21:37:09 -02:00
parent dbc4669d68
commit 0d1d51f64e
1 changed files with 2 additions and 2 deletions

View File

@ -3640,7 +3640,7 @@ _eet_data_descriptor_decode(Eet_Free_Context *context,
if (!edd && group_type == EET_G_UNKNOWN && IS_SIMPLE_TYPE(type))
{
unsigned char dd[128];
unsigned long long dd[128];
ret = eet_data_get_type(ed,
type,
@ -4535,7 +4535,7 @@ eet_data_get_unknown(Eet_Free_Context *context,
if (IS_SIMPLE_TYPE(type))
{
unsigned char dd[128];
unsigned long long dd[128];
ret = eet_data_get_type(ed,
type,