On 3/19/19 7:36 AM, Andrea Bolognani wrote:
On Thu, 2019-03-14 at 10:43 -0400, Cole Robinson wrote:
[...]
> +typedef enum {
> + ARG_QEMU_CAPS = 1,
Any specific reason to start from 1 rather than 0, or even leaving
out the start value entirely?
Nope it's not necessary, I've dropped it. I think it was left over from
earlier patch state
> +
> + ARG_END = QEMU_CAPS_LAST,
> +} testInfoArgNames;
The name of the enum should be singular, otherwise it will look
weird when you declare a variable of the type, like...
> static int
> testInfoSetArgs(struct testInfo *info, ...)
> {
> va_list argptr;
> - int ret = 0;
> + testInfoArgNames argname;
... here.
[...]
> + while ((argname = va_arg(argptr, int)) < ARG_END) {
> + switch (argname) {
I think you should either call va_arg() with testInfoArgNames as the
second argument, or make the argname variable int and then have an
explicit cast in the switch().
I went with the former
Thanks,
Cole