DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Wiles, Keith" <keith.wiles@intel.com>
To: Matthew Hall <mhall@mhcomputing.net>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PKTGEN] OK to reindent the pktgen (mix of tabs and spaces, etc.)?
Date: Mon, 4 Jan 2016 02:35:21 +0000	[thread overview]
Message-ID: <E5F2AE7B-FB01-489A-89EF-FB56B1271253@intel.com> (raw)
In-Reply-To: <56899BA7.60006@mhcomputing.net>

On 1/3/16, 4:07 PM, "dev on behalf of Matthew Hall" <dev-bounces@dpdk.org on behalf of mhall@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





  parent reply	other threads:[~2016-01-04  2:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-03 17:09 Wiles, Keith
2016-01-03 22:07 ` Matthew Hall
2016-01-03 23:06   ` Stephen Hemminger
2016-01-04  2:35   ` Wiles, Keith [this message]
2016-01-03 23:35 ` Ferruh Yigit
2016-01-04  0:15   ` Wiles, Keith

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E5F2AE7B-FB01-489A-89EF-FB56B1271253@intel.com \
    --to=keith.wiles@intel.com \
    --cc=dev@dpdk.org \
    --cc=mhall@mhcomputing.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).