qemu-ppc
[Top][All Lists]
Advanced

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

Re: [PATCH 24/26] hw/usb/usb-hcd: Use UHCI type definitions


From: Paolo Bonzini
Subject: Re: [PATCH 24/26] hw/usb/usb-hcd: Use UHCI type definitions
Date: Sun, 5 Jul 2020 07:37:38 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0

On 04/07/20 21:44, BALATON Zoltan wrote:
> 
> No it's OK, no need to list all defines. I just did not notice the macro
> argument that's why I was wondering where it comes from. This seems to
> be used elsewhere at least here:
> 
> hw/audio/es1370.c:#define a(n) if (val & CTRL_##n) strcat (buf, " "#n)
> hw/audio/es1370.c:#define a(n) if (val & SCTRL_##n) strcat (buf, " "#n)
> hw/audio/es1370.c:#define b(n) if (!(val & SCTRL_##n)) strcat (buf, " "#n)
> 
> Maybe writing it without the space between "# is clearer as then it
> looks more like it's part of the value.

I think keeping the space is better.

The reason is that CTRL_##n pastes together CTRL_ and n, but " "#n is
different:

1) First, it turns n into a string, for example "1"

2) Then, just because there is another string just before, the two are
concatenated, as in "CTRL_" "1".

Paolo




reply via email to

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