The first header was used to include the SpiderMonkey JS API at once,
with safeguards and preprocessor defines. Nowadays, SpiderMonkey
provides modular headers allowing us to include what we use, refs #8086.
Some defines have to be moved to compiler options but it is apparently
a mistake from the SM developers:
https://bugzilla.mozilla.org/show_bug.cgi?id=1987876
wxWidgets can use X11 APIs or the GUI toolkits GTK or QT on Linux, with
pure Wayland only the option to use the toolkits remains for
wxGetKeyState().
wxGetKeyState() is only usable for modifier keys with either toolkit and
so we need to bookkeep ourself.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
As per the docs[1]: Note that since wxWidgets 2.9.1 you are strongly
encouraged to create the windows which are added to wxStaticBoxSizer as
children of wxStaticBox itself.
wxWigets 3.3 added a warning to that end.
[1] https://docs.wxwidgets.org/3.2/classwx_static_box_sizer.html
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
With v3.12.0 shfmt changed the behavior of the `--simplify` option to
ignore any EditorConfig when it's provided. Therefore, this option is
now moved to the EditorConfig as suggested by the shfmt author. See
https://github.com/mvdan/sh/issues/1173 for details.
Make include-what-you-use happy with some files in source/tools/atlas
and fix what needs to be fixed.
Update premake script to include missing deps and drop various extra
paths for simplification.
Don't always include wx/wx.h via precompiled.h in case PCH is disabled.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
For the memleak warning actually wx will free it for us, so just
suppress the warning.
```
source/soundmanager/data/SoundData.cpp:48:29: error: Iterators of different containers 'CSoundData::sSoundData' and 'sSoundData' are used together. [mismatchingContainers]
if ((itemFind = CSoundData::sSoundData.find( theData->GetFileName().string() )) != sSoundData.end())
^
source/soundmanager/data/SoundData.cpp:62:28: error: Iterators of different containers 'CSoundData::sSoundData' and 'sSoundData' are used together. [mismatchingContainers]
if ((itemFind = CSoundData::sSoundData.find(itemPath.string())) != sSoundData.end())
^
source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Terrain/Terrain.cpp:145:3: error: Memory leak: buf [memleak]
}
^
```
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Make include-what-you-use happy with some files in source/tools/atlas
and fix what needs to be fixed.
Define ATLASDLLIMPEXP in a regular header instead of a PCH header and
dedupe its definition.
wxWidgets uses WX_ATTRIBUTE_PRINTF this days, so remove the workaround
for ATTRIBUTE_PRINTF.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Make include-what-you-use happy with some files in source/tools/atlas
and fix what needs to be fixed.
Drop the wxWidgets specific handling of precompiled headers in some
places, it isn't consistently used which it would have to to have meaning
and was mostly for early VS implementation of precompiled headers and a
lot of time has gone by since.
Drop Borland C++ compiler specific quirk, that compiler was
discontinued long ago and doesn't support modern C++.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Make include-what-you-use happy with some files in source/tools/atlas
and fix what needs to be fixed.
Add "source" to include path for AtlasUI target to allow for absolute
includes. In the future all but one should be removed.
Drop check for at least boost 1.40.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Make include-what-you-use happy with some files in source/simulatation2
and fix what needs to be fixed.
source/simulation2/system/ComponentTest.h uses cxxtest, so add cxxtest
to the deps for simulation2 target.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Make include-what-you-use happy with some files in source/ps and fix
what needs to be fixed.
Delete source/ps/FutureForward.h as it is no longer used.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Make include-what-you-use happy with some files in source/simulation2
and fix what needs to be fixed.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
If there are multiple commits with bad copyrights then only the results
for one was printed and immediately returned failure. This change
collects all and returns success or failure after.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Make include-what-you-use happy with some files in source/graphics and
fix what needs to be fixed.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Make include-what-you-use happy with some files in source/renderer and
fix what needs to be fixed.
Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This improves the styling of the header of the profiler2 UI, by applying
the following changes:
- change the spinner animation to actually look like a spinner
- ensure open reports don't overflow the nav bar
- reduce the size of the server port input field
- add some paddings to make everything look more pleasing
`onchange()` triggers only when an element looses focus. For the graph
smoothing in the profiler2 UI we want to have the smoothing applied
immediately when modifying the slider, so let's use `oninput()` instead.
After Stan suggesting change in a review comment just enable the rule
'keyword-spacing' [1] and fix violations so this is no longer a topic in
spirit of #7812.
[1] https://eslint.style/rules/keyword-spacing
Ref: #7245
Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Previously the number of graph colors was limited, which resulted in the
reuse of colors if many different profiling regions or reports were
displayed. This commit changes so unique colors are generated for
each region/graph, by utilizing the beauty of the golden ratio.
Some have their editor configured to remove trailing whitespace and
editing such a file would "fix" it, adding an unrelated change.
Fix whitespace violations excluding third party libs and generated files
like glad or patches.
Enable pre-commit hook trailing-whitespace to enforce it in the future.
Fixes: #8016
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This removes the padding from the start and the end of the frequency
graphs, to remove the inaccurate steps it caused.
It also improves the smoothness of the frequency and frame-to-frame
graphs by painting each graph as a single line, instead of one line per
data point.
Requires HEAD to point to --to <commitish> for the files to be in the
state for copyright.py to produce expected results. Which isn't the case
in the gitea workflow.
Also use plumbing commands to on one hand make it more robust and on the
other hand to avoid bad files only in --from <commitish> to leak into
the check.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Make what could be considered a legendary hack less brittle.
C4312: 'reinterpret_cast': conversion from 'long' to 'void *' of greater size
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
The target file is checked in into vcs so this tool isn't used during
build and as such better lives in source/tools.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This replaces the old arclint eslint setup 1:1 rule wise, only porting
the configuration to a format recent eslint can read.
Further remove the arclint setup as it is no longer of use.
Thanks to Stan for reviewing all needed fixes to Javascript code to
allow for adding this without compromises.
Fixes: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This fixes 'no-trailing-spaces', 'semi', 'prefer-const' that made it in
since and 'no-shadow', 'no-multi-assign', 'no-invalid-this' as well as
'no-undef-init' in profiler.
Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Variables declared with `var` are also accible after accessing the
scope. This lead to shadowing because variables with the same name are
declared in a later scope.
Ref: #7812
Since variables declared with `var` don't respect all scopes, when used
in a loop it doesn't create a new variable each iteration. The
initializer value is always assigned to the same variable. That makes
problems when the variable is used in a callback. To work around that
the variable is copied in to a IIFE.
When not using `var` the iife isn't required.
Ref: #7812
This removes all global code and fixes eslint warnings 'no-shadow' and
'no-undef-init'. Leave other possible improvement style wise for an
other time.
Ref: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This refactors validate_dae.py to utilize multiple CPU cores. This makes
it significantly faster. It also improves code quality and adds commands
line options.
Instead of listing files recursively for each directory manually, this
uses the built-in glob functionality of Python's pathlib.Path. As
part of this the found paths are returned as generator instead of a
list. Together this results in easier to read code and better
performance.