<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:DengXian;
        panose-1:3 0 5 9 0 0 0 0 0 0;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:"\@DengXian";
        panose-1:3 0 5 9 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.m-8580915385391752522apple-tab-span
        {mso-style-name:m_-8580915385391752522apple-tab-span;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.pl-k
        {mso-style-name:pl-k;}
span.pl-c1
        {mso-style-name:pl-c1;}
span.pl-smi
        {mso-style-name:pl-smi;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1901012354;
        mso-list-type:hybrid;
        mso-list-template-ids:1084279118 336134145 336134147 336134149 336134145 336134147 336134149 336134145 336134147 336134149;}
@list l0:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-NZ link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Hi Kurt,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>If you want a few nit-picks (based on my personal preferences admittedly, and with no reference to any standards but my own):<o:p></o:p></span></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><span style='font-size:11.0pt;font-family:Symbol;color:#1F497D'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span dir=LTR></span><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>I hate the dangling brackets – it makes the code asymmetrical, how can you stand to look at it? (Ok, I prepared to concede, this might just be me!)<o:p></o:p></span></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><span style='font-size:11.0pt;font-family:Symbol;color:#1F497D'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span dir=LTR></span><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>I like to avoid single line if statements (i.e., with no brackets). Apart from it being inconsistent with other if statements, it can be easy to misread the code if it isn’t properly spaced and indented.<o:p></o:p></span></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><span style='font-size:11.0pt;font-family:Symbol;color:#1F497D'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span dir=LTR></span><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>I find that method of switch indenting hard to parse. I would do this, and always bracket the whole case expression for consistency (which is variable in your example):<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:Consolas;color:#1F497D'>switch (thing)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:Consolas;color:#1F497D'>{<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:Consolas;color:#1F497D'>    case C1:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:Consolas;color:#1F497D'>    {<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:Consolas;color:#1F497D'>        // Code part<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:Consolas;color:#1F497D'>    } break;<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:Consolas;color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:Consolas;color:#1F497D'>    case C2:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:Consolas;color:#1F497D'>    {<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:Consolas;color:#1F497D'>        // More code<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:Consolas;color:#1F497D'>    } // fallthrough<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:Consolas;color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:Consolas;color:#1F497D'>    default:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:Consolas;color:#1F497D'>    {<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:Consolas;color:#1F497D'>        // Code<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:Consolas;color:#1F497D'>    }<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:Consolas;color:#1F497D'>}<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:Consolas;color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><span style='font-size:11.0pt;font-family:Symbol;color:#1F497D'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span dir=LTR></span><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>There are some minor inconsistencies in the  use of spaces around commas and operators (again, my preference being for more space!):<o:p></o:p></span></p><p class=MsoListParagraph><span class=pl-k><span style='font-size:9.0pt;font-family:Consolas;color:#D73A49;background:white'>if</span></span><span style='font-size:9.0pt;font-family:Consolas;color:#24292E;background:white'> (</span><span class=pl-c1><span style='font-size:9.0pt;font-family:Consolas;color:#005CC5;background:white'>0</span></span><span style='font-size:9.0pt;font-family:Consolas;color:#24292E;background:white'>==P)                   vs            </span><span class=pl-k><span style='font-size:9.0pt;font-family:Consolas;color:#D73A49;background:white'>if</span></span><span style='font-size:9.0pt;font-family:Consolas;color:#24292E;background:white'> (</span><span class=pl-c1><span style='font-size:9.0pt;font-family:Consolas;color:#005CC5;background:white'>0 </span></span><span style='font-size:9.0pt;font-family:Consolas;color:#24292E;background:white'>== P)<o:p></o:p></span></p><p class=MsoListParagraph><span style='font-size:9.0pt;font-family:Consolas;color:#24292E;background:white'>XY xy = {</span><span class=pl-c1><span style='font-size:9.0pt;font-family:Consolas;color:#005CC5;background:white'>0.0</span></span><span style='font-size:9.0pt;font-family:Consolas;color:#24292E;background:white'>,</span><span class=pl-c1><span style='font-size:9.0pt;font-family:Consolas;color:#005CC5;background:white'>0.0</span></span><span style='font-size:9.0pt;font-family:Consolas;color:#24292E;background:white'>};          vs            XY xy = {</span><span class=pl-c1><span style='font-size:9.0pt;font-family:Consolas;color:#005CC5;background:white'>0.0</span></span><span style='font-size:9.0pt;font-family:Consolas;color:#24292E;background:white'>, </span><span class=pl-c1><span style='font-size:9.0pt;font-family:Consolas;color:#005CC5;background:white'>0.0</span></span><span style='font-size:9.0pt;font-family:Consolas;color:#24292E;background:white'>};<o:p></o:p></span></p><p class=MsoListParagraph><span lang=FR style='font-size:9.0pt;font-family:Consolas;color:#24292E;background:white'>(lp.<span class=pl-smi>lam</span>+P-&gt;<span class=pl-smi>lam0</span>)            vs            (lp.<span class=pl-smi>lam </span>+ P-&gt;<span class=pl-smi>lam0</span>)<o:p></o:p></span></p><p class=MsoNormal><span lang=FR style='font-size:9.0pt;font-family:Consolas;color:#24292E;background:white'><o:p>&nbsp;</o:p></span></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><span style='font-size:11.0pt;font-family:Symbol;color:#1F497D'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span dir=LTR></span><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Unless tools demand it, why the horizontal restrictions (or is this an artefact of github) ?<o:p></o:p></span></p><p class=MsoListParagraph><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>This is easier to read:<o:p></o:p></span></p><p class=MsoListParagraph><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>            lp.phi = aasin(P-&gt;ctx,cosc * Q-&gt;sinph0 + xy.y * sinc * Q-&gt;cosph0 / c_rh);<o:p></o:p></span></p><p class=MsoListParagraph><span style='font-size:9.0pt;font-family:Consolas;color:#24292E;background:white'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:Consolas;color:#24292E;background:white'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:Consolas;color:#24292E;background:white'>I just hope list reformatting doesn’t ruin my points </span><span style='font-size:9.0pt;font-family:Wingdings;color:#24292E;background:white'>J</span><span style='font-size:9.0pt;font-family:Consolas;color:#24292E;background:white'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:Consolas;color:#24292E;background:white'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Dan<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:Consolas;color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif'> proj-bounces@lists.maptools.org &lt;proj-bounces@lists.maptools.org&gt; <b>On Behalf Of </b>Kurt Schwehr<br><b>Sent:</b> Tuesday, 1 May 2018 07:45<br><b>To:</b> PROJ.4 and general Projections Discussions &lt;proj@lists.maptools.org&gt;<br><b>Subject:</b> Re: [Proj] Code style in Proj<o:p></o:p></span></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><div><p class=MsoNormal>Thanks for the&nbsp;proj_coord().&nbsp; I meant to look that up, but got interrupted by a poopy diaper.<o:p></o:p></p><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>I would be happy to create a draft document for people to comment on.&nbsp; It will be slow going as I only get little bits of time here and there for the next week.<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>I do have to say that I don't like removing the math.h from the main file.&nbsp; &nbsp;The cost is small and it frees you to refactor other headers without wide ranging changes each time.<o:p></o:p></p></div></div><div><div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div></div></div></div></body></html>