Re: [PATCH] qemu: Use 'idx' instead of 'index' for variable name

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

 




On 04/14/2015 06:51 AM, Daniel P. Berrange wrote:
> On Tue, Apr 14, 2015 at 06:45:48AM -0400, John Ferlan wrote:
>> Apparently for Xen-devel 'index' is a global and causes a build failure,
>> so just use the shortened 'idx' instead to avoid the conflict.
>>
>> Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
>> ---
>>
>> I did try modify cfg.mk to add a syntax check similar to the ii,jj,kk
>> checks, but it tripped up over 'index' declarations inside structures.
>> I'd be happy to add one, but I need some help formatting it... Here's
>> what I had:
>>
>> sc_prohibit_int_index:
>>         @prohibit='\<(int|unsigned) ([^(=]* )*(index)\>(\s|,|;)'    \
>>         halt='use different name than 'index' for declaration'      \
>>         $(_sc_search_regexp)
> 
> We could just rename the fields in the structs too - wouldn't be the
> end of the world to use idx in those too just to simplify our life.
> 
> ACK to your immediate fix now anyway.
> 
> Regards,
> Daniel
> 

I thought of that too, but it picked up a few comments too

...
src/libvirt-domain.c:11105: * "block.<num>.backingIndex" - unsigned int
giving the <backingStore> index,
...
src/util/virnetdev.c:870: * @ifindex: Pointer to int where the index
will be written into


So rather than "wait" I figured get this out there now and see what
feedback I can get to make a rule...

Thanks for the quick review - I'll push what I have and generate
something for the other 'index' uses.

John

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]