qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH for-3.1 2/2] disas/nanomips: Fix format strings


From: Aleksandar Markovic
Subject: Re: [Qemu-devel] [PATCH for-3.1 2/2] disas/nanomips: Fix format strings
Date: Sun, 23 Dec 2018 18:10:38 +0100

On Tue, Nov 27, 2018 at 1:19 PM Stefan Weil <address@hidden> wrote:
>
> Signed-off-by: Stefan Weil <address@hidden>
> ---
>  disas/nanomips.cpp | 18 +++++++++++-------
>  1 file changed, 11 insertions(+), 7 deletions(-)
>

Hi, Stefan,

My plan is to accept this patch plus (in the same patch) following
changes in nanomips.h:

This code:

typedef unsigned short uint16;
typedef unsigned int uint32;
typedef long long int64;
typedef unsigned long long uint64;

namespace img
{
    typedef unsigned long long address;
}

should become:

typedef uint16_t uint16;
typedef uint32_t uint32;
typedef int64_t int64;
typedef uint64_t uint64;

namespace img
{
    typedef uint64_t address;
}

The reason is that I would like to keep custom types. The custom types
names "uint32", "int64", etc. are admittedly too generic, but that
will change in further development, and it looks do not bother any
compiler so far. This means that patch 1/1 will not be applied.

There is no need for respin, I will do the corrections while
integrating pull request.

Please let me know if you object over this.

Thanks again for bringing all these issues!

Aleksandar




> diff --git a/disas/nanomips.cpp b/disas/nanomips.cpp
> index 4c3cfceaba..a3f69348b3 100644
> --- a/disas/nanomips.cpp
> +++ b/disas/nanomips.cpp
> @@ -284,7 +284,8 @@ uint64_t NMD::renumber_registers(uint64_t index, uint64_t 
> *register_list,
>      }
>
>      throw std::runtime_error(img::format(
> -                   "Invalid register mapping index %d, size of list = %d",
> +                   "Invalid register mapping index %" PRIu64
> +                   ", size of list = %zu",
>                     index, register_list_size));
>  }
>
> @@ -501,7 +502,8 @@ std::string NMD::GPR(uint64_t reg)
>          return gpr_reg[reg];
>      }
>
> -    throw std::runtime_error(img::format("Invalid GPR register index %d", 
> reg));
> +    throw std::runtime_error(img::format("Invalid GPR register index %" 
> PRIu64,
> +                                         reg));
>  }
>
>
> @@ -518,7 +520,8 @@ std::string NMD::FPR(uint64_t reg)
>          return fpr_reg[reg];
>      }
>
> -    throw std::runtime_error(img::format("Invalid FPR register index %d", 
> reg));
> +    throw std::runtime_error(img::format("Invalid FPR register index %" 
> PRIu64,
> +                                         reg));
>  }
>
>
> @@ -532,26 +535,27 @@ std::string NMD::AC(uint64_t reg)
>          return ac_reg[reg];
>      }
>
> -    throw std::runtime_error(img::format("Invalid AC register index %d", 
> reg));
> +    throw std::runtime_error(img::format("Invalid AC register index %" 
> PRIu64,
> +                                         reg));
>  }
>
>
>  std::string NMD::IMMEDIATE(uint64_t value)
>  {
> -    return img::format("0x%x", value);
> +    return img::format("0x%" PRIx64, value);
>  }
>
>
>  std::string NMD::IMMEDIATE(int64_t value)
>  {
> -    return img::format("%d", value);
> +    return img::format("%" PRId64, value);
>  }
>
>
>  std::string NMD::CPR(uint64_t reg)
>  {
>      /* needs more work */
> -    return img::format("CP%d", reg);
> +    return img::format("CP%" PRIu64, reg);
>  }
>
>
> --
> 2.11.0
>
>



reply via email to

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