qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] target-i386: fix build with -Werror


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH] target-i386: fix build with -Werror
Date: Fri, 29 Jun 2012 17:24:35 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120421 Thunderbird/12.0

Am 29.06.2012 08:41, schrieb Dunrong Huang:
> Commit c4baa0503d9623f1ce891f525ccd140c598bc29a improved SSE table type
> safety but raises compile error of incompatible pointer type.

What's the difference between the signatures?

Regards,
Andreas

> Fix it by casting to correct function type
> 
> Signed-off-by: Dunrong Huang <address@hidden>
> ---
>  target-i386/translate.c |   22 +++++++++++-----------
>  1 files changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/target-i386/translate.c b/target-i386/translate.c
> index a902f4a..81928b5 100644
> --- a/target-i386/translate.c
> +++ b/target-i386/translate.c
> @@ -2950,20 +2950,20 @@ static const SSEFunc_0_pp sse_op_table2[3 * 8][2] = {
>  static const SSEFunc_0_pi sse_op_table3a[4] = {
>      gen_helper_cvtsi2ss,
>      gen_helper_cvtsi2sd,
> -    X86_64_ONLY(gen_helper_cvtsq2ss),
> -    X86_64_ONLY(gen_helper_cvtsq2sd),
> +    X86_64_ONLY((SSEFunc_0_pi)gen_helper_cvtsq2ss),
> +    X86_64_ONLY((SSEFunc_0_pi)gen_helper_cvtsq2sd),
>  };
>  
>  static const SSEFunc_i_p sse_op_table3b[4 * 2] = {
>      gen_helper_cvttss2si,
>      gen_helper_cvttsd2si,
> -    X86_64_ONLY(gen_helper_cvttss2sq),
> -    X86_64_ONLY(gen_helper_cvttsd2sq),
> +    X86_64_ONLY((SSEFunc_i_p)gen_helper_cvttss2sq),
> +    X86_64_ONLY((SSEFunc_i_p)gen_helper_cvttsd2sq),
>  
>      gen_helper_cvtss2si,
>      gen_helper_cvtsd2si,
> -    X86_64_ONLY(gen_helper_cvtss2sq),
> -    X86_64_ONLY(gen_helper_cvtsd2sq),
> +    X86_64_ONLY((SSEFunc_i_p)gen_helper_cvtss2sq),
> +    X86_64_ONLY((SSEFunc_i_p)gen_helper_cvtsd2sq),
>  };
>  
>  static const SSEFunc_0_pp sse_op_table4[8][4] = {
> @@ -3568,8 +3568,8 @@ static void gen_sse(DisasContext *s, int b, 
> target_ulong pc_start, int rex_r)
>                  tcg_gen_trunc_tl_i32(cpu_tmp2_i32, cpu_T[0]);
>                  sse_fn_pi(cpu_ptr0, cpu_tmp2_i32);
>              } else {
> -                sse_fn_pl = sse_op_table3a[(s->dflag == 2) * 2 +
> -                                           ((b >> 8) - 2)];
> +                sse_fn_pl = (SSEFunc_0_pl)sse_op_table3a[(s->dflag == 2) * 2 
> +
> +                                                         ((b >> 8) - 2)];
>                  sse_fn_pl(cpu_ptr0, cpu_T[0]);
>              }
>              break;
> @@ -3630,9 +3630,9 @@ static void gen_sse(DisasContext *s, int b, 
> target_ulong pc_start, int rex_r)
>                  sse_fn_i_p(cpu_tmp2_i32, cpu_ptr0);
>                  tcg_gen_extu_i32_tl(cpu_T[0], cpu_tmp2_i32);
>              } else {
> -                sse_fn_l_p = sse_op_table3b[(s->dflag == 2) * 2 +
> -                                            ((b >> 8) - 2) +
> -                                            (b & 1) * 4];
> +                sse_fn_l_p = (SSEFunc_l_p)sse_op_table3b[(s->dflag == 2) * 2 
> +
> +                                                         ((b >> 8) - 2) +
> +                                                         (b & 1) * 4];
>                  sse_fn_l_p(cpu_T[0], cpu_ptr0);
>              }
>              gen_op_mov_reg_T0(ot, reg);


-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

[Prev in Thread] Current Thread [Next in Thread]