The International Simutrans Forum

 

Author Topic: [cleanup patch] move #include directive to top of file  (Read 3206 times)

0 Members and 1 Guest are viewing this topic.

Offline neroden

  • Devotees (Inactive)
  • *
  • Posts: 831
  • Nathanael Nerode
[cleanup patch] move #include directive to top of file
« on: July 11, 2010, 04:10:28 AM »
It's not good form to put an #include directive in the middle of a file, but such a thing was introduced recently.  This patch fixes this.

(Intended to be applied after the compilation / const correctness fix.)  EDIT: But can be applied independently.
« Last Edit: July 11, 2010, 04:01:08 PM by neroden »

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10642
  • Languages: De,EN,JP
Re: [cleanup patch] move #include directive to top of file
« Reply #1 on: July 11, 2010, 09:18:44 PM »
Since all those stettings are pretty much independent, I did it this way (to show that this is only needed to climate_stats). I intended it to do it this way also for forest and citystats. You give a valid argument, and a comment could achieve the same. I feel this warrants a little more discussion on how to proceed. (Although I actually nearly convinced (together with a comment).

Offline neroden

  • Devotees (Inactive)
  • *
  • Posts: 831
  • Nathanael Nerode
Re: [cleanup patch] move #include directive to top of file
« Reply #2 on: July 11, 2010, 10:17:10 PM »
Since all those stettings are pretty much independent, I did it this way (to show that this is only needed to climate_stats). I intended it to do it this way also for forest and citystats. You give a valid argument, and a comment could achieve the same. I feel this warrants a little more discussion on how to proceed. (Although I actually nearly convinced (together with a comment).

Comments are good.  :-)  Actually, perhaps each of the #include lines should have a comment right above it explaining why that header is needed.  That's what I do in my own code sometimes.