On 1/3/16, 4:07 PM, "dev on behalf of Matthew Hall" <dev-bounces at dpdk.org on behalf of mhall at mhcomputing.net> wrote:
>On 1/3/16 9:09 AM, Wiles, Keith wrote: >> Pktgen is setup for tabs for 4 (with replace tabs with spaces), using tab >> stop of 8 is just wrong IMO :-) >> Just started using kdevelop instead of eclipse, so I may have corrupted the >> style some :-( > >The problem I found was a number of files had an incompatible >combination of the two formats. > >Personally, I agree tab size 4 w/ spaces instead of tabs is easiest to >read and edit. But I could live with any space based system for the most >part. I find tab based systems are unpleasant because it is difficult >when tabs are used for one thing and spaces for another thing. This >annoyance also applies to DPDK and the kernel but it's too late for both >of those. > >> At least it is suppose to be done that way. I will reformat the code (with >> tabs=4) and have a look at the output. > >Thanks this will be a big help. > >> I can run the astyle on the code and look at the output, if it looks OK I >> will submit it to the repo > >Sounds great... it is no big hurry on my end but I want to start with a >clean slate before I get invested in the code, and start really hitting >it hard, and making patches. > >The formatting command I provided is not perfect, but it was the best I >could do with the various popular indenter tools to try to avoid messing >up too much of the rest of the good code in the files in the process of >fixing the format. > >You might be able to improve it a bit further w/ some additional >experimentation since you are the original maintainer of the code >obviously. Or perhaps reformat using tools in Eclipse or KDevelop? I had >good luck w/ Eclipse before with special configuration but I only mostly >used the Java mode not the C / C++ one which is less good. I push a version of Pktgen with cleaned up formatting using ?uncrustify 0.61? and 'UniversalIndentGUI 1.2.0 Rev 1070 13 Aug 2015?. I put the script and configuration file in the top directory. The formatting looks close to DPDK coding guidelines, but I am sure some tweaks would need to be done. Uncrustify has a huge number of options and not always clear as to the effect an option has on the code. Header files seems to get effected a bit more then C code as the formatting is usual done by hand I guess. The only way to see the deltas is with UnviersalIndentGUI tool. All of this is on the ?dev? branch, so let me know what you think. ++Keith > >Matthew. > Regards, Keith