Bug 339573

Summary: src/lib/astro/eclsolar.cpp:175: possible bad assignment ?
Product: [Applications] marble Reporter: dcb314
Component: generalAssignee: marble-bugs
Status: CONFIRMED ---    
Severity: normal CC: nienhueser, rahn
Priority: NOR    
Version: 1.10 (KDE Applications 14.12)   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:

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.