]> git.unchartedbackwaters.co.uk Git - francis/libjit.git/commitdiff
fix compiler warnings
authorAleksey Demakov <ademakov@gmail.com>
Tue, 27 Nov 2007 07:11:46 +0000 (07:11 +0000)
committerAleksey Demakov <ademakov@gmail.com>
Tue, 27 Nov 2007 07:11:46 +0000 (07:11 +0000)
ChangeLog
jit/jit-rules-x86.c

index e4704d54c7d842d4b839580e90f01f2487ca94cd..601dc1dd8a663762c2e72e3a23ccb01f7dc03585 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2007-11-27  Aleksey Demakov  <ademakov@gmail.com>
+
+       * jit/jit-rules-x86.c (_jit_gen_load_value): fix compiler warnings.
+
 2007-11-17  Aleksey Demakov  <ademakov@gmail.com>
 
        * jit/jit-insn.c (jit_insn_mark_offset): do not start new block
index 3c6e48b3f19990ed9464f255f8b33e46de9766b6..23aa616b1f975e7adf99503a181fbfb5dec0bed1 100644 (file)
@@ -803,8 +803,14 @@ _jit_gen_load_value(jit_gencode_t gen, int reg, int other_reg, jit_value_t value
                                float32_value = jit_value_get_float32_constant(value);
                                if(IS_WORD_REG(reg))
                                {
-                                       x86_mov_reg_imm(inst, _jit_reg_info[reg].cpu_reg,
-                                                       ((jit_int *)&float32_value)[0]);
+                                       union
+                                       {
+                                               jit_float32 float32_value;
+                                               jit_int int_value;
+                                       } un;
+
+                                       un.float32_value = float32_value;
+                                       x86_mov_reg_imm(inst, _jit_reg_info[reg].cpu_reg, un.int_value);
                                }
                                else
                                {
@@ -832,10 +838,17 @@ _jit_gen_load_value(jit_gencode_t gen, int reg, int other_reg, jit_value_t value
                                float64_value = jit_value_get_float64_constant(value);
                                if(IS_WORD_REG(reg))
                                {
+                                       union
+                                       {
+                                               jit_float64 float64_value;
+                                               jit_int int_value[2];
+                                       } un;
+
+                                       un.float64_value = float64_value;
                                        x86_mov_reg_imm(inst, _jit_reg_info[reg].cpu_reg,
-                                                       ((jit_int *)&float64_value)[0]);
+                                                       un.int_value[0]);
                                        x86_mov_reg_imm(inst, _jit_reg_info[other_reg].cpu_reg,
-                                                       ((jit_int *)&float64_value)[1]);
+                                                       un.int_value[1]);
                                }
                                else
                                {
@@ -863,10 +876,17 @@ _jit_gen_load_value(jit_gencode_t gen, int reg, int other_reg, jit_value_t value
                                nfloat_value = jit_value_get_nfloat_constant(value);
                                if(IS_WORD_REG(reg) && sizeof(jit_nfloat) == sizeof(jit_float64))
                                {
+                                       union
+                                       {
+                                               jit_nfloat nfloat_value;
+                                               jit_int int_value[2];
+                                       } un;
+
+                                       un.nfloat_value = nfloat_value;
                                        x86_mov_reg_imm(inst, _jit_reg_info[reg].cpu_reg,
-                                                       ((jit_int *)&nfloat_value)[0]);
+                                                       un.int_value[0]);
                                        x86_mov_reg_imm(inst, _jit_reg_info[other_reg].cpu_reg,
-                                                       ((jit_int *)&nfloat_value)[1]);
+                                                       un.int_value[1]);
                                }
                                else
                                {