<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Kurt,
<div class=""><br class="">
</div>
<div class="">I think it looks good. I tried compiling the code and again I had the problem with declarations like</div>
<div class=""><br class="">
</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>XY xy = {0.0, 0.0};</div>
<div class=""><br class="">
</div>
<div class="">I’ve fixed those in a fork of your gist. See revision 2 in [0] for a proposed solution that I think</div>
<div class="">is in line with your ideas</div>
<div class=""><br class="">
</div>
<div class="">I like how you’ve separated includes from the standard library on the PROJ internal includes. On</div>
<div class="">a related note (for those who don’t already know) I have recently introduced the proj_math.h</div>
<div class="">header which is intended as a PROJ replacement of math.h. proj_math.h’s purpose in life is to</div>
<div class="">make sure that we can use C99 math functions on systems where they are not available.</div>
<div class="">proj_math.h includes math.h and defines functions such as isnan() and hypot(). This way they</div>
<div class="">can be used as you would on a C99-compatible system as long as proj_math.h is included.</div>
<div class="">See revision 3 in [0].</div>
<div class=""><br class="">
</div>
<div class="">Would you be willing to write up a simple style guide for PROJ based on the ideas you have presented in</div>
<div class="">this thread?</div>
<div class="">
<div><br class="">
</div>
<div>/Kristian</div>
<div><br class="">
</div>
<div>[0]&nbsp;<a href="https://gist.github.com/kbevers/17ec703942646e401b28a0975b28771d/revisions" class="">https://gist.github.com/kbevers/17ec703942646e401b28a0975b28771d/revisions</a></div>
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 24 Apr 2018, at 12:05, Mateusz Loskot &lt;<a href="mailto:mateusz@loskot.net" class="">mateusz@loskot.net</a>&gt; wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="">On 24 April 2018 at 11:45, Thomas Knudsen &lt;<a href="mailto:knudsen.thomas@gmail.com" class="">knudsen.thomas@gmail.com</a>&gt; wrote:<br class="">
<blockquote type="cite" class="">
<blockquote type="cite" class="">In C too, but since C99.<br class="">
</blockquote>
<br class="">
AFAIK this only applies to the &quot;for (int i = 0; &nbsp;i &lt; n; i&#43;&#43;)&quot; syntax.<br class="">
<br class="">
while (...) {<br class="">
&nbsp;&nbsp;&nbsp;int i = 123, j = 345;<br class="">
&nbsp;&nbsp;&nbsp;k = i &#43; j;<br class="">
}<br class="">
<br class="">
has been correct (and imho, preferable) syntax since K&amp;R C<br class="">
</blockquote>
<br class="">
AFAIK, it's about compound statement.<br class="">
C89 requires declaration at the top of blocks, while C99 lifts that:<br class="">
<br class="">
$ cat test.c<br class="">
int main()<br class="">
{<br class="">
&nbsp;&nbsp;&nbsp;int i = 0;<br class="">
&nbsp;&nbsp;&nbsp;while (i &lt; 10)<br class="">
&nbsp;&nbsp;&nbsp;{<br class="">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int j = 345;<br class="">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;i = i &#43; j;<br class="">
&nbsp;&nbsp;&nbsp;}<br class="">
<br class="">
&nbsp;&nbsp;&nbsp;{<br class="">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int z = 0;<br class="">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;z = 1;<br class="">
&nbsp;&nbsp;&nbsp;}<br class="">
&nbsp;&nbsp;&nbsp;int x = 1;<br class="">
}<br class="">
<br class="">
$ gcc -std=c89 -pedantic test.c<br class="">
test.c: In function ‘main’:<br class="">
test.c:14:5: warning: ISO C90 forbids mixed declarations and code<br class="">
[-Wdeclaration-after-statement]<br class="">
&nbsp;&nbsp;&nbsp;&nbsp;int x = 1;<br class="">
&nbsp;&nbsp;&nbsp;&nbsp;^~~<br class="">
<br class="">
$ gcc -std=c99 -pedantic test.c<br class="">
$<br class="">
<br class="">
<br class="">
Best regards,<br class="">
-- <br class="">
Mateusz Loskot, <a href="http://mateusz.loskot.net" class="">http://mateusz.loskot.net</a><br class="">
_______________________________________________<br class="">
Proj mailing list<br class="">
<a href="mailto:Proj@lists.maptools.org" class="">Proj@lists.maptools.org</a><br class="">
http://lists.maptools.org/mailman/listinfo/proj</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>