summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@profusion.mobi>2014-01-20 21:37:09 -0200
committerGustavo Sverzut Barbieri <barbieri@profusion.mobi>2014-01-20 21:44:42 -0200
commit0d1d51f64ed5813eefe410fb16ec60ffa32d0588 (patch)
treec698d2dea66ecda2c6d8e6db1481629b194ed41f /src
parentdbc4669d6818d733d1d512f766ad8cf4c799dbba (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/lib/eet/eet_data.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/eet/eet_data.c b/src/lib/eet/eet_data.c
index 2afdbf5320..b687b2e0ff 100644
--- a/src/lib/eet/eet_data.c
+++ b/src/lib/eet/eet_data.c
@@ -3640,7 +3640,7 @@ _eet_data_descriptor_decode(Eet_Free_Context *context,
3640 3640
3641 if (!edd && group_type == EET_G_UNKNOWN && IS_SIMPLE_TYPE(type)) 3641 if (!edd && group_type == EET_G_UNKNOWN && IS_SIMPLE_TYPE(type))
3642 { 3642 {
3643 unsigned char dd[128]; 3643 unsigned long long dd[128];
3644 3644
3645 ret = eet_data_get_type(ed, 3645 ret = eet_data_get_type(ed,
3646 type, 3646 type,
@@ -4535,7 +4535,7 @@ eet_data_get_unknown(Eet_Free_Context *context,
4535 4535
4536 if (IS_SIMPLE_TYPE(type)) 4536 if (IS_SIMPLE_TYPE(type))
4537 { 4537 {
4538 unsigned char dd[128]; 4538 unsigned long long dd[128];
4539 4539
4540 ret = eet_data_get_type(ed, 4540 ret = eet_data_get_type(ed,
4541 type, 4541 type,