<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Dirk,<div class=""><br class=""></div><div class="">you committed</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; color: rgb(175, 173, 36);" class="">commit 59299f0ab34ca4d75e0b02d9a83f23ec6348e1df</div><div style="margin: 0px; font-size: 11px; line-height: normal;" class="">Author: Dirk Hohndel <<a href="mailto:dirk@hohndel.org" class="">dirk@hohndel.org</a>></div><div style="margin: 0px; font-size: 11px; line-height: normal;" class="">Date:   Wed Mar 9 18:42:39 2016 -0800</div><div style="margin: 0px; font-size: 11px; line-height: normal; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal;" class="">    Clean up signedness confusion in planner.c</div><div class=""><br class=""></div><div class="">in which you declared several ints to be unsigned. This breaks at least the ascents in recreational mode, see #1030.</div><div class=""><br class=""></div><div class="">I located the problem to be that we have </div><div class=""><br class=""></div><div class="">
<pre style="margin-top: 0px; margin-bottom: 0px;" class=""><!--StartFragment--><span style=" color:#808000;" class="">unsigned</span><span style=" color:#c0c0c0;" class=""> </span><span style=" color:#808000;" class="">int</span><span style=" color:#c0c0c0;" class=""> </span>deltad<!--EndFragment--></pre><div class=""><br class=""></div></div><div class="">in line 1097 but we do the comparison</div><div class=""><span style="color: rgb(192, 192, 192);" class=""></span><br class=""></div><div class=""><div class="">
<pre style="margin-top: 0px; margin-bottom: 0px;" class=""><!--StartFragment--><span style=" color:#808000;" class="">if</span><span style=" color:#c0c0c0;" class=""> </span>(deltad<span style=" color:#c0c0c0;" class=""> </span>-<span style=" color:#c0c0c0;" class=""> </span>depth<span style=" color:#c0c0c0;" class=""> </span>><span style=" color:#c0c0c0;" class=""> </span><span style=" color:#000080;" class="">0</span>)<!--EndFragment--></pre><div class=""><br class=""></div></div></div><div class="">in line 1103. Now, depth happens to be signed (and it needs to be since we stop ascending when we step through the surface, i.e. reach negative depth which is of course not possible for unsigned values). This above comparison, however, gets casted to unsigned int and thus clearly makes no longer sense. (You can see the ascent problem goes away when deltad is made signed again. </div><div class=""><br class=""></div><div class="">I could now simply send a patch that does exactly that. But I wonder, what you intended to do with your above patch. It is not the first time I run into troubles when mixing signed and unsigned integers in expressions and in particular in comparisons where the implicit cast is to unsigned (which for me almost never makes sense) and which does not even cause a compiler warning (I think it should, at least it would save me a lot of debugging time, I see, there is -Wconversion).</div><div class=""><br class=""></div><div class="">Anyway, my conclusion from all this trouble in the past was to _always_ use the signed version since this prevents the trouble. As far as I can see, the potential cost is that the maximally representable number is only half the size but this should not be a problem for us since we stay safely away from those limits.</div><div class=""><br class=""></div><div class="">So, could you please explain to me your rationale for adding the unsigned statements in your above patch as I am clearly missing something.</div><div class=""><br class=""></div><div class="">Best</div><div class="">Robert</div><div class=""><br class=""></div><div class="">
<div style="color: rgb(0, 0, 0); font-family: Menlo;  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Menlo; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Menlo; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Menlo; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class="">-- <br class="">.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oO<br class="">Robert C. Helling     Elite Master Course Theoretical and Mathematical Physics<br class="">                      Scientific Coordinator<br class="">                      Ludwig Maximilians Universitaet Muenchen, Dept. Physik<br class="">                      Phone: +49 89 2180-4523  Theresienstr. 39, rm. B339<br class="">                      <a href="http://www.atdotde.de" class="">http://www.atdotde.de</a></div><div style="color: rgb(0, 0, 0); font-family: Menlo; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""></div><div style="color: rgb(0, 0, 0); font-family: Menlo; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Enhance your privacy, use cryptography! My PGP keys have fingerprints</div><div style="color: rgb(0, 0, 0); font-family: Menlo; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">A9D1 A01D 13A5 31FA 6515  BB44 0820 367C 36BC 0C1D    and</div><div style="color: rgb(0, 0, 0); font-family: Menlo; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">DCED 37B6 251C 7861 270D  5613 95C7 9D32 9A8D 9B8F</div><div style="color: rgb(0, 0, 0); font-family: Menlo; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""></div></div></div><br class="Apple-interchange-newline"></div><br class="Apple-interchange-newline"><br class="Apple-interchange-newline">
</div>
<br class=""></div></body></html>