Fix warnings.
authorZoltan Varga <vargaz@gmail.com>
Sun, 3 Apr 2011 06:04:06 +0000 (08:04 +0200)
committerZoltan Varga <vargaz@gmail.com>
Sun, 3 Apr 2011 06:04:06 +0000 (08:04 +0200)
mono/mini/aot-compiler.c
mono/mini/exceptions-amd64.c
mono/mini/mini-amd64.c
mono/mini/mini-codegen.c
mono/mini/simd-intrinsics.c

index 54b29dabbb4b297884851fda29e2f7abd3e8a67e..5f645650f13dcdd2145518c49a61c8b42ad540a9 100644 (file)
@@ -5550,8 +5550,9 @@ mono_aot_type_hash (MonoType *t1)
                return ((hash << 5) - hash) ^ mono_metadata_type_hash (&t1->data.array->eklass->byval_arg);
        case MONO_TYPE_GENERICINST:
                return ((hash << 5) - hash) ^ 0;
+       default:
+               return hash;
        }
-       return hash;
 }
 
 /*
index 19e8663329b851fb5f6bae32589ffb99dd9736e7..5368f67faa3b495ab3cdb17f63f1f2337b4d4a55 100644 (file)
@@ -496,7 +496,7 @@ get_throw_trampoline (MonoTrampInfo **info, gboolean rethrow, gboolean corlib, g
                ji = mono_patch_info_list_prepend (ji, code - start, MONO_PATCH_INFO_JIT_ICALL_ADDR, corlib ? "mono_amd64_throw_corlib_exception" : "mono_amd64_throw_exception");
                amd64_mov_reg_membase (code, AMD64_R11, AMD64_RIP, 0, 8);
        } else {
-               amd64_mov_reg_imm (code, AMD64_R11, resume_unwind ? (mono_amd64_resume_unwind) : (corlib ? (gpointer)mono_amd64_throw_corlib_exception : (gpointer)mono_amd64_throw_exception));
+               amd64_mov_reg_imm (code, AMD64_R11, resume_unwind ? ((gpointer)mono_amd64_resume_unwind) : (corlib ? (gpointer)mono_amd64_throw_corlib_exception : (gpointer)mono_amd64_throw_exception));
        }
        amd64_call_reg (code, AMD64_R11);
        amd64_breakpoint (code);
index 0058b22c43860ead3d75de5bfd4ca79ed85e0c08..593451065676b69f8e5b90c6516cd4524161b038 100644 (file)
@@ -495,7 +495,7 @@ amd64_patch (unsigned char* code, gpointer target)
                /* call *<OFFSET>(%rip) */
                *(guint32*)(code + 2) = ((guint32)(guint64)target) - 7;
        }
-       else if ((code [0] == 0xe8)) {
+       else if (code [0] == 0xe8) {
                /* call <DISP> */
                gint64 disp = (guint8*)target - (guint8*)code;
                g_assert (amd64_is_imm32 (disp));
index 544114054ea3bd7cf4f452796a746fa7e198d8b8..95132411d909b5be177eedd7130e81972ca67a3c 100644 (file)
@@ -2488,8 +2488,9 @@ mono_is_regsize_var (MonoType *t)
                return FALSE;
        case MONO_TYPE_VALUETYPE:
                return FALSE;
+       default:
+               return FALSE;
        }
-       return FALSE;
 }
 
 #ifndef DISABLE_JIT
index d77d23df6bf2b52e6ea1e6cef420c9aa57f16110..24334ce1b73326ac705d3b115d5123f7544324de 100644 (file)
@@ -897,8 +897,9 @@ mono_type_to_expand_op (MonoType *type)
                return OP_EXPAND_R4;
        case MONO_TYPE_R8:
                return OP_EXPAND_R8;
+       default:
+               g_assert_not_reached ();
        }
-       g_assert_not_reached ();
 }
 
 static int
@@ -984,8 +985,9 @@ mono_type_to_extract_op (MonoType *type)
        case MONO_TYPE_U4:
        case MONO_TYPE_R4:
                return OP_EXTRACT_I4;
+       default:
+               g_assert_not_reached ();
        }
-       g_assert_not_reached ();
 }
 
 /*Returns the amount to shift the element index to get the dword it belongs to*/
@@ -1003,8 +1005,9 @@ mono_type_elements_shift_bits (MonoType *type)
        case MONO_TYPE_U4:
        case MONO_TYPE_R4:
                return 0;
+       default:
+               g_assert_not_reached ();
        }
-       g_assert_not_reached ();
 }
 
 static G_GNUC_UNUSED int
@@ -1027,8 +1030,9 @@ mono_type_to_insert_op (MonoType *type)
                return OP_INSERT_R4;
        case MONO_TYPE_R8:
                return OP_INSERT_R8;
+       default:
+               g_assert_not_reached ();
        }
-       g_assert_not_reached ();
 }
 
 static int
@@ -1051,8 +1055,9 @@ mono_type_to_slow_insert_op (MonoType *type)
                return OP_INSERTX_R4_SLOW;
        case MONO_TYPE_R8:
                return OP_INSERTX_R8_SLOW;
+       default:
+               g_assert_not_reached ();
        }
-       g_assert_not_reached ();
 }
 
 static MonoInst*