qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 04/22] vl: convert -tb-size to qemu_strtoul


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH 04/22] vl: convert -tb-size to qemu_strtoul
Date: Mon, 3 Jul 2017 12:46:06 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

On 07/03/2017 09:34 AM, Paolo Bonzini wrote:
-extern int tcg_tb_size;
+extern unsigned long tcg_tb_size;

size_t would be more natural.

I don't think we support any hosts for which sizeof(size_t) != sizeof(unsigned long), but perhaps

        unsigned lomg tmp;
        if (qemu_strtoul(optarg, NULL, 0, &tmp) < 0
            || tmp != (size_t)tmp) {
          error_report("Invalid argument to -tb-size");
          exit(1);
        }
        tcg_tb_size = tmp;

where I'd expect the extra comparison to be optimized away.

But I'm not overly concerned either way, so

Reviewed-by: Richard Henderson <address@hidden>


r~



reply via email to

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