The International Simutrans Forum

 

Author Topic: Potentially unused variables  (Read 519 times)

0 Members and 1 Guest are viewing this topic.

Offline Freahk

  • Devotee
  • *
  • Posts: 1500
  • Languages: DE, EN
Potentially unused variables
« on: February 20, 2020, 11:59:56 PM »
I am a little confused about seconds_per_tick

My IDE clearly states it as unused.
Did I miss anything about that parameter?
What exactly does it do, or what exactly is it supposed to do?

My IDE had found some further unused variables and functions. I will, however only change distance, time, speed related stuff in this branch.

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Administrator
  • *
  • Posts: 20768
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Potentially unused variables
« Reply #1 on: February 21, 2020, 12:29:06 AM »
I think that this may have been added by someone else a long time ago; I cannot recall exactly how, if at all, this fits into the timing system now.

Offline Freahk

  • Devotee
  • *
  • Posts: 1500
  • Languages: DE, EN
Re: Potentially unused variables
« Reply #2 on: February 21, 2020, 12:51:02 AM »
Oops, I'm sorry.
seconds_per_tick actually is used in physics code.
I intended to refer to the "simtime_factor"

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Administrator
  • *
  • Posts: 20768
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Potentially unused variables
« Reply #3 on: February 21, 2020, 02:09:36 AM »
Ahh, yes: I did not write the physics code, and I have no idea of its internal workings.

Offline wlindley

  • Devotee
  • *
  • Posts: 1063
    • Hacking for fun and profit since 1977
  • Languages: EN, DE
Re: Potentially unused variables
« Reply #4 on: February 21, 2020, 04:39:43 PM »
simtime_factor seems to be a function returning a constant value.  The function is never called, and everything compiles and runs properly without it.  Probably no reason to keep cruft laying about.

Offline Ranran

  • Devotee
  • *
  • Posts: 1503
  • Languages: ja
Re: Potentially unused variables
« Reply #5 on: May 04, 2020, 01:06:52 PM »
I think the function uint16 get_population () const; declared in gebaeude.h is no longer used.