Skip to main content
Topic: [cleanup patch] move #include directive to top of file (Read 7123 times) previous topic - next topic

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

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.

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

Reply #1
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).

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

Reply #2
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.