Skip to content

Refactor/Modernization Tasks #533

@arch1t3cht

Description

@arch1t3cht

Incomplete list, to be updated over time. Tasks are collected here mostly to track them, not because they're high priority or even certain to be good ideas at all. Some of these tasks may need to wait until right after some stable release so there's a sufficiently long testing window in case the refactors break something.

  • Fix all compiler warnings.
    • All compiler warnings for clang -Wall -Wextra -Wpedantic are fixed except for vendored code but gcc still shows some warnings on equivalent settings.
  • Opt into further compiler warnings on clang, in particular to make gcc and clang agree more on their warnings
    • I usually use clang locally because it has the better language server integration, so ideally I'd like as many (useful) warnings as possible to be shown with clang.
  • Enable -Werror on the CI?
    • This may require pushing all vendored dependencies into subprojects or dedicated static_libraries so that warnings can be disabled for those.
    • What to do about dependencies that were vendored but significantly changed in Aegisub? (cajun, MatroskaParser, lualpeg to some degree)
  • Bump lualpeg?
  • Enforce some commit message style?
  • Set up clang-tidy.
    • Many of the later points are implemented in clang-tidy rules.
    • Rules could be added incrementally while more and more of the below rules are implemented.
  • Add include guards for all headers (replacing #pragma once).
  • Eradicate unsigned integers.
  • Eradicate volatile.
  • Use C++20 ranges.
  • Use constraints for all template parameters.
  • Replace all typedefs with using.
  • Use scoped enums where applicable.
  • Add override, noexcept, nodiscard, const, constexpr, etc. everywhere applicable.
  • Audit all const_casts and reinterpret_casts.
  • Various other clang-tidy checks.
  • Replace static with anonymous namespaces.
  • Organize all of Aegisub's functions into namespaces better.
  • Replace agi::scoped_holder with std::unique_ptr for pointer handles?
  • Replace Aegisub's own string formatting with std::format?
    • How to handle translations with this?
  • Add -DwxNO_IMPLICIT_WXSTRING_ENCODING (or a weaker variant)?
  • Set UTF-8 locales where possible.
    • The C++ global locale should already be UTF-8.
    • Set the C locale to UTF-8 where possible.
      • Affects C conversion functions like mbstowcs/wcstombs.
      • In particular affects default conversions from and to wxStrings
    • Set the Windows process codepage to UTF-8 (and get rid of agi::fs::path?)
      • Affects std::filesystem::path conversions.
      • Affects luajit io functions (file operations, ffi.load, etc.)
        • May in particular allow us to get rid of unicode-monkeypatch.lua.
      • Will probably do this after 3.5. Requires May 2019 update of Windows 10.
  • Get rid of immediate mode / display lists / other deprecated OpenGL features in the video display and visual tools and use OpenGL 3.0 features conforming to the (forward-compatible) 3.0 core profile.
  • Clean up meson.build:
    • Group into sections with comments.
    • Use newer meson features (better fallback logic, dependency: get_option(...), etc).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions