Commit 9782a3044f2e657d3d4ea1ac53ea8fbdaa9fbfb1
Committed by
Stéphane Raimbault
1 parent
eab0c89c
Fix alignment problem
Build fails with -Werror and -Wcast-align on ARMv5 platform
Showing
1 changed file
with
4 additions
and
2 deletions
tests/unit-test-client.c
| ... | ... | @@ -41,6 +41,7 @@ int main(int argc, char *argv[]) |
| 41 | 41 | int nb_points; |
| 42 | 42 | int rc; |
| 43 | 43 | float real; |
| 44 | + uint32_t ireal; | |
| 44 | 45 | struct timeval old_response_timeout; |
| 45 | 46 | struct timeval response_timeout; |
| 46 | 47 | int use_backend; |
| ... | ... | @@ -324,8 +325,9 @@ int main(int argc, char *argv[]) |
| 324 | 325 | tab_rp_registers[0] == (UT_IREAL & 0xFFFF)) { |
| 325 | 326 | printf("OK\n"); |
| 326 | 327 | } else { |
| 327 | - printf("FAILED (%x != %x)\n", | |
| 328 | - *((uint32_t *)tab_rp_registers), UT_IREAL); | |
| 328 | + ireal = (uint32_t) tab_rp_registers[0] & 0xFFFF; | |
| 329 | + ireal |= (uint32_t) tab_rp_registers[1] << 16; | |
| 330 | + printf("FAILED (%x != %x)\n", ireal, UT_IREAL); | |
| 329 | 331 | goto close; |
| 330 | 332 | } |
| 331 | 333 | ... | ... |