Avoid an unnecessary copy of a string.
Limit variable scope.

Issue found by cppcheck.
Pre instead of post increment a variable.

Issue found by cppcheck.
Validate a pointer before deferring it.

The problem was introduced in 818ffad0, David Mikos please review this
patch.

Issue found by cppcheck.
Remove an unused private function.

Issue found by cppcheck.
Minor formatting improvements in GUI2.

These improvements are done in preparation to use clang format on the gui
directory.
Use clang-format on the gui directory.

Most of the formatting has been done automatically, but some minor manual
polishing has been applied afterwards.

Also add .clang-format file containing the settings used for the
formatting.
Pre instead of post increment a variable.

Issue found by cppcheck.
Pre instead of post increment a variable.

Issue found by cppcheck.
Pre instead of post increment a variable.

Issue found by cppcheck.
Pre instead of post increment a variable.

Issue found by cppcheck.
Remove a variable which is only assigned.

Issue found by cppcheck.
Remove a variable which is only assigned.

Issue found by cppcheck.
Remove a variable which is only assigned.

Issue found by cppcheck.
Remove a variable which is only assigned.

Issue found by cppcheck.
Remove a variable which is only assigned.

Issue found by cppcheck.
Limit variable scope.

Also avoid shadowing the variable res.

Issue found by cppcheck.
Remove an unneeded temporary variable.

Issue found by cppcheck.
add translatable default filename to editor save box.
add default cursor selection to save game dialog