浏览代码

Fix alignment problem

Build fails with -Werror and -Wcast-align on ARMv5 platform
Alexander Dahl 12 年之前
父节点
当前提交
9782a3044f
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      tests/unit-test-client.c

+ 4 - 2
tests/unit-test-client.c

@@ -41,6 +41,7 @@ int main(int argc, char *argv[])
     int nb_points;
     int rc;
     float real;
+    uint32_t ireal;
     struct timeval old_response_timeout;
     struct timeval response_timeout;
     int use_backend;
@@ -324,8 +325,9 @@ int main(int argc, char *argv[])
         tab_rp_registers[0] == (UT_IREAL & 0xFFFF)) {
         printf("OK\n");
     } else {
-        printf("FAILED (%x != %x)\n",
-               *((uint32_t *)tab_rp_registers), UT_IREAL);
+        ireal = (uint32_t) tab_rp_registers[0] & 0xFFFF;
+        ireal |= (uint32_t) tab_rp_registers[1] << 16;
+        printf("FAILED (%x != %x)\n", ireal, UT_IREAL);
         goto close;
     }