Bug 339573 - src/lib/astro/eclsolar.cpp:175: possible bad assignment ?
Summary: src/lib/astro/eclsolar.cpp:175: possible bad assignment ?
Status: CONFIRMED
Alias: None
Product: marble
Classification: Applications
Component: general (show other bugs)
Version: 1.10 (KDE Applications 14.12)
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: marble-bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-01 14:32 UTC by dcb314
Modified: 2021-03-09 22:51 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dcb314 2014-10-01 14:32:06 UTC
src/lib/astro/eclsolar.cpp:175:28: warning: implicit conversion from 'double' to 'int' changes value from 0.01 to 0 [-Wliteral-conversion]

  if (s < 0.01) eb_cstep = 0.01;

$ fgrep eb_cstep `find ../BUILD/marble-4.14.1 -name \*.h -print`
../BUILD/marble-4.14.1/src/lib/astro/eclsolar.h:      int eb_cstep;   // step width in minutes used for central eclipse output
$ 



Reproducible: Always
Comment 1 Dennis Nienhüser 2014-10-02 03:48:42 UTC
Maybe the real intention is
eb_cstep = max( 0, floor( s ) );
However a value of 0 seems to be problematic later on, I spot a divison by zero that would follow from that.

The good news is that the corresponding method is never called, i.e. a candidate for removal altogether. Would still be nice to clear it up with someone who knows more about the code in question. Torsten, can you chime in, or follow up with Holger?
Comment 2 Dennis Nienhüser 2014-10-02 03:49:59 UTC
Ehm, I don't mean Holger, but Gerhard :)
Sorry for the bugspam.
Comment 3 Justin Zobel 2021-03-09 22:51:36 UTC
Thank you for the bug report.

As this report hasn't seen any changes in 5 years or more, we ask if you can please confirm that the issue still persists.

If this bug is no longer persisting or relevant please change the status to resolved.