News:

Simutrans Tools
Know our tools that can help you to create add-ons, install and customize Simutrans.

[cleanup patch] move #include directive to top of file

Started by neroden, July 11, 2010, 04:10:28 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

neroden

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.

prissi

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).

neroden

Quote from: prissi 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).

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.