[Freeciv-tickets] [freeciv] #44902: Cast int to double, compare to 0.01

Zurück zum Archiv-Index
OSDN Ticket System norep****@osdn*****
Wed Jun 22 06:53:37 JST 2022


#44902: Cast int to double, compare to 0.01

  Open Date: 2022-06-22 00:33
Last Update: 2022-06-22 00:53

URL for this Ticket:
    https://osdn.net//projects/freeciv/ticket/44902
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=44902

---------------------------------------------------------------------

Last Changes/Comment on this Ticket:
2022-06-22 00:53 Updated by: cazfi

Comment:

Reply To (Anonymous)

get_seconds_to_new_turn() returns int, not double. Even then it would be a pretty stringent test (less than one frame worth of time).
Looking around where the get_seconds_to_new_turn() value comes, there seems to be more double/integer confusion (there's 'ceil() + 0.1' assigned to that integer...)
I think the point of that test is to avoid displaying negative values if the turn change takes longer than estimated (the estimate is just the lenght of the previous turn change)

---------------------------------------------------------------------
Ticket Status:

      Reporter: (Anonymous)
         Owner: (None)
          Type: Bugs
        Status: Open
      Priority: 5 - Medium
     MileStone: (None)
     Component: (None)
      Severity: 5 - Medium
    Resolution: None
---------------------------------------------------------------------

Ticket details:

I'm not sure what this code is supposed to do, but it looks wrong:
https://github.com/freeciv/freeciv/blob/master/client/text.c#L1555
get_seconds_to_new_turn() returns int, not double. Even then it would be a pretty stringent test (less than one frame worth of time).

-- 
Ticket information of Freeciv project
Freeciv Project is hosted on OSDN

Project URL: https://osdn.net/projects/freeciv/
OSDN: https://osdn.net

URL for this Ticket:
    https://osdn.net/projects/freeciv/ticket/44902
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=44902



More information about the Freeciv-tickets mailing list
Zurück zum Archiv-Index