OpenMSX Git (2017/01/01) is complie. OpenMSX is an open source MSX emulator which is free according to the Debian Free Software Guidelines, available under the GNU General Public License.For copyright reasons the emulator cannot be distributed with original BIOS ROM images. OpenMSX includes C-BIOS a minimal implementation of the MSX BIOS, allowing to play quite some games without the need to have an original MSX BIOS ROM image. You can also use your own BIOS ROM image if you please.
OpenMSX Git Changelog:
* Small tweaks (e.g. make constants static)
Found while going over the "clang-tidy check=clang-analyzer-*" output.
All actual clang-analyzer warnings were false-positives, but likely because
I've already run the old "clang-analyzer" tool several times in the past (and
fixed the real issues then).
* Fix "clang-tidy -check=misc-unused-using-decls" warnings
* Silince "clang-tidy -check=misc-string-integer-assignment"
Nothing wrong with this code, but add casts to silence the warning.
This warning tries to catch bugs like
myString += someInt
where you meant
myString += toString(someInt)
so having this check warning-free is worth the extra (useless) casts.
* Bug fix in DirAsDSK
Only the first few bytes instead of the whole FAT were copied.
Classic "memcpy(dst, src, sizeof(dst))"-bug, discovered by
clang-tidy -check=misc-sizeof-container
* Fix some "clang-tidy -check=misc-*" warnings
More in detail: fixed most of these:
misc-assert-side-effect
misc-macro-parentheses
misc-misplaced-widening-cast (only some)
* Fix some "clang-tidy -check=performance-*" warnings
* Fix some "clang-tidy -check=readability*" warnings
More in detail: fixed most of these:
readability-simplify-boolean-expr
readability-redundant-string-init
* Fix most "clang-tidy -check=modernize-pass-by-value" warnings
The idea here is that 'sink' parameters (those that will be copied by the
callee) should be passed by value rather than by const-reference. And then the
callee should move the parameter rather copy it.
Because the parameter is passed by value it's now possible the caller needs to
make a copy of it. In that case we trade one copy in the callee for one copy in
the caller and we gain nothing. But it's also possible the callee has an rvalue
that can be moved instead of copied. In that case a copy is replaced by a move.
This all assumes that moves are cheaper than copies. Very often this is indeed
the case. An exception is our TclObject class, there the copy and move
constructors are equally expensive (or equally cheap). So passing those by
const-reference is still better than passing by value, and I didn't follow the
clang-tidy suggestion.
* Fix "clang-tidy -check=modernize-use-override" warnings
* Fix "clang-tidy -check=modernize-use-emplace" warnings
* Fix "clang-tidy -check=modernize-loop-convert" warnings
* Fixed some "clang-tidy modernize-raw-string-literal" warnings
E.g. replace the complicated string literal
"RUN\\\"CAS:\\\""
with
R"(RUN\"CAS:\")"
both mean exactly the same, but the latter has less confusing escaping.
There were _many_ more warnings about stuff like:
string err = "Invalid option: \"" + option + "\".";
Though personally I prefer this over the suggested alternative:
string err = R"(Invalid option: ")" + option + R"(".)";
Maybe I'll change my mind later when I'm more used to the new
raw-string-literal syntax.
While going over these warnings I also tweaked some calls to
string_ref::starts_with().
myStringRef.starts_with("-") -> myStringRef.starts_with('-')
* Fix "clang-tidy -check=modernize-use-bool-literals" warnings
* Fix all "clang-tidy -check=modernize-deprecated-headers" warnings
* Fix all "clang-tidy -check=modernize-use-default" warnings
This warning suggests to replace explicitly empty implemented
constructor/destructor like e.g.
Foo::~Foo
{
}
with '=default' declared constructor/destructors, e.g.
Foo::~Foo = default;
See here for how this is different and why the latter is (theoretically) better
https://stackoverflow.com/questions/13576055/how-is-default-different-from-for-default-constructor-and-destructor
Where possible I also moved destructors from the .cc to the .hh file. This
sometimes allows the compiler to make better inlining decisions.
I doubt this change will have a measurable speed impact for openMSX. But even
if there's no speed benefit at all, it's a nice cleanup (removes ~300 lines of
code). And it's always good to have less warnings from static code analyzers
like clang-tidy.
Download: OpenMSX Git (2017/01/01) x86
Download: OpenMSX Git (2017/01/01) x64
Source: Here
0 Comments
Post a Comment