2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 <2020> 2021 2022 2023 2024 2025 | Index | 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 <2020> 2021 2022 2023 2024 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: [Merge] ~dirk.zimoch/epics-base:CleanupWhitespace into epics-base:7.0 |
From: | Marty Kraimer via Core-talk <core-talk at aps.anl.gov> |
To: | core-talk at aps.anl.gov |
Date: | Thu, 16 Apr 2020 07:17:24 -0400 |
In Dirk's message the following appears:
if (i<10) doThis(i); else {
I have seen this cause problems when doThis(i); is changed from a single statement to multiple statements. Better is if (i<10) { doThis(i); } else { ... } Marty On 4/16/20 3:42 AM, Dirk Zimoch via Core-talk wrote:
What is your favorite coding style, mine looks like this: int function(int a, int b) { int i; for (i=a; i<b; i++) { if (i<10) doThis(i); else { switch (i) { case 42: doSomethingSpecial(); break; default: { doTheNormalThing(i, a, b); break; } } } } return 0; }