Followup to D739. There are a few more in the network code, but these would require a rebase of echotangoecho's network rewrite.
Details
- Reviewers
elexis - Group Reviewers
Restricted Owners Package (Owns No Changed Paths) Restricted Owners Package (Owns No Changed Paths) - Commits
- rP20519: More ScriptInterface const.
Compile it.
Diff Detail
- Repository
- rP 0 A.D. Public Repository
- Branch
- upstream
- Lint
Lint Skipped - Unit
Unit Tests Skipped - Build Status
Buildable 3800 Build 6591: Vulcan Build (Windows) Jenkins Build 6590: Vulcan Build Jenkins Build 6589: arc lint + arc unit
Event Timeline
Build is green
Updating workspaces. Build (release)... Build (debug)... Running release tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Running debug tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Checking XML files...
http://jenkins-master:8080/job/phabricator/1953/ for more details.
Executing section Default... Executing section Source... source/tools/atlas/GameInterface/Handlers/MapHandlers.cpp | 33| #include·"lib/tex/tex.h" | | [MAJOR] CPPCheckBear (syntaxError): | | Invalid number of character ({) when these macros are defined: ''. source/tools/atlas/GameInterface/Handlers/MapHandlers.cpp | 33| #include·"lib/tex/tex.h" | | [MAJOR] CPPCheckBear (syntaxError): | | Invalid number of character ({) when these macros are defined: 'MESSAGES_SKIP_STRUCTS'. source/tools/atlas/GameInterface/Handlers/MapHandlers.cpp | 33| #include·"lib/tex/tex.h" | | [MAJOR] CPPCheckBear (syntaxError): | | Invalid number of character ({) when these macros are defined: '_MSC_VER'. Executing section JS... Executing section XML GUI... Executing section Python... Executing section Perl...
http://jenkins-master:8080/job/phabricator_lint/470/ for more details.
It seems one of those in the simulation code could be made const.
The others cannot be (unless my last check of was wrong) as they
are calling some registration functions for the JS interface code.
Build is green
Updating workspaces. Build (release)... Build (debug)... Running release tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Running debug tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Checking XML files...
http://jenkins-master:8080/job/phabricator/2041/ for more details.
Executing section Default... Executing section Source... source/tools/atlas/GameInterface/Handlers/MapHandlers.cpp | 33| #include·"lib/tex/tex.h" | | [MAJOR] CPPCheckBear (syntaxError): | | Invalid number of character ({) when these macros are defined: ''. source/tools/atlas/GameInterface/Handlers/MapHandlers.cpp | 33| #include·"lib/tex/tex.h" | | [MAJOR] CPPCheckBear (syntaxError): | | Invalid number of character ({) when these macros are defined: 'MESSAGES_SKIP_STRUCTS'. source/tools/atlas/GameInterface/Handlers/MapHandlers.cpp | 33| #include·"lib/tex/tex.h" | | [MAJOR] CPPCheckBear (syntaxError): | | Invalid number of character ({) when these macros are defined: '_MSC_VER'. Executing section JS... Executing section XML GUI... Executing section Python... Executing section Perl...
http://jenkins-master:8080/job/phabricator_lint/530/ for more details.
What about the ones in GameSetup/GameSetup.cpp?
All other are either const, or are init functions or are in network so further patch is complete.
FindPlaceableTemplates functions got removed, so needs a rebase, also is the scriptinterface inclusion in TemplateLoader.h still needed?
Those end up in that one function that takes a pointer after some long and slightly confusing code. And that function needs to be able to take a nullptr in one case IIRC, which makes the whole thing somewhat ugly.
I tried changing that but it is more complicated (or rather annoying) than it looks, so at some point I decided that it isn't worth it and having it stick out like a sore thumb might cause someone to fix that.
All other are either const, or are init functions or are in network so further patch is complete.
FindPlaceableTemplates functions got removed, so needs a rebase, also is the scriptinterface inclusion in TemplateLoader.h still needed?
Nope, seems useless. Actually was useless before this change too, since it was a reference already.
Given that it needs a rebase, and that one network patch hasn't seen a lot of activity I'll just merge them.
Compiles, game starts and doesn't fall apart. Agreeing with bb's review.
Didn't test if those were call things that can be made const.
We can still add more afterwards if we find them.
(As usual better have this committed to prevent unneeded compile times, rebases and rereviews IMO)
And thanks for the followup patch.
source/ps/Game.cpp | ||
---|---|---|
188 | good move | |
source/ps/TemplateLoader.h | ||
22 | ack unused (while paramnode is used) | |
source/scriptinterface/ScriptInterface.cpp | ||
609 | Ack unused |
Successful build - Chance fights ever on the side of the prudent.
Updating workspaces... Build (release)... Build (debug)... Running release tests... Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK! Running debug tests... Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK! Checking XML files...
Executing section Default... Executing section Source... source/tools/atlas/GameInterface/Handlers/MapHandlers.cpp | 33| #include·"lib/tex/tex.h" | | [MAJOR] CPPCheckBear (syntaxError): | | Invalid number of character ({) when these macros are defined: ''. source/tools/atlas/GameInterface/Handlers/MapHandlers.cpp | 33| #include·"lib/tex/tex.h" | | [MAJOR] CPPCheckBear (syntaxError): | | Invalid number of character ({) when these macros are defined: 'MESSAGES_SKIP_STRUCTS'. source/tools/atlas/GameInterface/Handlers/MapHandlers.cpp | 33| #include·"lib/tex/tex.h" | | [MAJOR] CPPCheckBear (syntaxError): | | Invalid number of character ({) when these macros are defined: '_MSC_VER'. Executing section JS...