[PATCH:libpciaccess 2/3] Remove useless extra "const" in "const sometype const * var = value; ". Found using clang -Wduplicate-decl-specifier.

Ian Romanick idr at freedesktop.org
Sat Jun 8 13:51:03 PDT 2013


On 06/07/2013 08:50 PM, Alan Coopersmith wrote:
> On 06/ 2/13 01:38 PM, Thomas Klausner wrote:
>> ---
>>   src/common_interface.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/common_interface.c b/src/common_interface.c
>> index 6dccf8e..8eace4e 100644
>> --- a/src/common_interface.c
>> +++ b/src/common_interface.c
>> @@ -268,7 +268,7 @@ pci_device_map_range(struct pci_device *dev,
>> pciaddr_t base,
>>
>>
>>       for (region = 0; region < 6; region++) {
>> -        const struct pci_mem_region const* r = &dev->regions[region];
>> +        const struct pci_mem_region * r = &dev->regions[region];
>
> Perhaps it was meant to be "const struct pci_mem_region * const r",
> in which the second const has a meaning?
>
> Looks like Ian added it in
> http://cgit.freedesktop.org/xorg/lib/libpciaccess/commit/?id=c65aa7630802c8dfcc06a20e515ace31ab0d0e48

Looking at the patch, that was probably my intention.  That was a 
loooooong time ago, so anything's possible.



More information about the xorg-devel mailing list