diff options
author | Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org> | 2011-12-07 02:36:37 +0059 |
---|---|---|
committer | Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org> | 2011-12-07 02:36:37 +0059 |
commit | 476f639d0aeb31d5d02b73c597732be4b042f7b5 (patch) | |
tree | b3621a7689ec74c715211917476981e1a1fd31e8 | |
parent | 38d0f27b33c60b9be4c636af74bcbbae0bfb28b0 (diff) | |
download | srec-linaro_android_4.0.1.tar.gz |
srec: Fix aliasing violationlinaro_android_4.0.1
This allows getting rid of the -fno-strict-aliasing compiler flag,
allowing the compiler to take advantage of a rather useful optimization.
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
-rw-r--r-- | seti/sltsEngine/src/run_seq_lts.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/seti/sltsEngine/src/run_seq_lts.c b/seti/sltsEngine/src/run_seq_lts.c index 1d9fb05..609d05f 100644 --- a/seti/sltsEngine/src/run_seq_lts.c +++ b/seti/sltsEngine/src/run_seq_lts.c @@ -939,11 +939,15 @@ SWIsltsResult free_lts(LTS_HANDLE hlts) int find_phone(const char *ph, PM *pm) { ESR_ReturnCode rc; - int iRet = -1; - rc = PHashTableGetValue((PHashTable*)pm->phoneH, ph, (void**)(void*)&iRet); + union { + void *v; + int i; + } iRet; + iRet.i = -1; + rc = PHashTableGetValue((PHashTable*)pm->phoneH, ph, &iRet.v); if (rc != ESR_SUCCESS) PLogError("error while in find_phone(%s,%x)\n", ph, pm); - return iRet; + return iRet.i; } int find_best_string(const char *str, LTS* lts) |