General Cleanup
I tried to get back to refactoring mentioned in an old merge request !80 (closed). I've borrowed a lot of code from there, still this might not be all, it's a start :). If you think that it would be better split into smaller merge requests, let me know.
Let me reiterate what was said there:
- Made all narrowing conversions explicit with
static_cast
or changing the types - Removed a whole bunch of unnecessary memory allocations
-
constexpr char[]
instead of globalstd::string
s -
std::move
and `emplace_back - range-for
-
- General modernization
- NULL -> nullptr
- std::list -> std::vector (closes #37 (closed))
- Don't use delete, use RAII
- STL algorithms
- References instead of pointers
- Use more standard library types ()
Tested it inside amd64 qemu both as a package after logging in and using pmbootstrab install --add osk-sdl --fde
and it seems to work fine, unfortunately I don't have any device to test it on (yet!). The only issue that I've run into is that while running with --fde
on-screen keyboard can't be used. Although I've heard that it's a known problem.