<div dir="auto"><div><br><div class="gmail_extra"><br><div class="gmail_quote">On 14 Mar 2017 5:29 AM, "Jérémie Guichard" <<a href="mailto:djeBrest@gmail.com">djeBrest@gmail.com</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Ho!<div>I didn't realized I used the -Wfloat-conversion on C code only and not C++ when I did my previous round of float/double to int patch!</div><div><br></div><div>Looking into that now. There is a bunch of new warnings adding the flag but seems (at first look) to be managable.</div><div><br></div><div>Working on the patch right now...</div></div></blockquote></div></div></div><div dir="auto">Excellent!</div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_extra"><br><div class="gmail_quote"><div class="elided-text">2017-03-14 0:11 GMT+07:00 Dirk Hohndel <span dir="ltr"><<a href="mailto:dirk@hohndel.org" target="_blank">dirk@hohndel.org</a>></span>:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="elided-text"><span>On Mon, Mar 13, 2017 at 09:07:31AM -0700, Linus Torvalds wrote:<br>
> On Mon, Mar 13, 2017 at 12:35 AM, Rick Walsh <<a href="mailto:rickmwalsh@gmail.com" target="_blank">rickmwalsh@gmail.com</a>> wrote:<br>
> ><br>
> >  void PlannerSettingsWidget::setAscR<wbr>ate75(int rate)<br>
> >  {<br>
> > -       SettingsObjectWrapper::instan<wbr>ce()->planner_settings->setAsc<wbr>rate75(rate * UNIT_FACTOR);<br>
> > +       SettingsObjectWrapper::instan<wbr>ce()->planner_settings->setAsc<wbr>rate75(rate * UNIT_FACTOR + 0.5);<br>
> >  }<br>
><br>
> These should all definitely use "lrint()" rather than " + 0.5"<br>
> together with the integer truncation.<br>
</span></div></blockquote></div></div></blockquote></div></div></div><div dir="auto">And that's what happens when a civil engineer tries to teach himself C. Thanks for showing me the correct way.</div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="elided-text"><span><br>
</span>Agreed since UNIT_FACTOR is a floating point number.<br>
<br>
Can you send a patch / pull request that does that instead?</div></blockquote></div></div></blockquote></div></div></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="elided-text"></div></blockquote></div></div></blockquote></div></div></div><div dir="auto">I would when I found time, which is hard for me at the moment even if it is just making a simple change to a few lines. Luckily <span style="font-family:sans-serif">Jérémie has beaten me to it.</span></div><div dir="auto"><span style="font-family:sans-serif"><br></span></div><div dir="auto"><span style="font-family:sans-serif">Cheers,</span></div><div dir="auto"><span style="font-family:sans-serif"><br></span></div><div dir="auto"><span style="font-family:sans-serif">Rick</span></div><div dir="auto"><div class="gmail_extra"><br></div></div></div>