Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++20-ify #267

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open

C++20-ify #267

wants to merge 19 commits into from

Commits on May 4, 2023

  1. Configuration menu
    Copy the full SHA
    4040038 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7272660 View commit details
    Browse the repository at this point in the history
  3. Convert weapon selection system to std::vector

    Also introduces a new "inrange" function, useful for future refactorings
    to std::vector
    voidanix committed May 4, 2023
    Configuration menu
    Copy the full SHA
    2ba65bb View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    f07eb85 View commit details
    Browse the repository at this point in the history
  5. Fix unneeded parenthesis

    voidanix committed May 4, 2023
    Configuration menu
    Copy the full SHA
    3b800a4 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    c8143e6 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    bb50c90 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    af57554 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    dd33dfb View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    d7b723e View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    3eb9dac View commit details
    Browse the repository at this point in the history
  12. Fix -Wint-in-bool-context

    The mattrig macro expands the mw argument at one point into:
    
    if (curmat != MAT_WATER ? S_SPLASH2 : S_SPLASH1 >= 0)
    
    Co-authored-by: Robert Alm Nilsson <[email protected]>
    voidanix and Robert Alm Nilsson committed May 4, 2023
    Configuration menu
    Copy the full SHA
    64ae458 View commit details
    Browse the repository at this point in the history
  13. tools: Remove custom NULL

    There should be no reason to overwrite this as the C++ spec already
    specifies it. Compilers nowadays also gift us a dedicated warning for this
    kind of situation (-Wzero-as-null-pointer-constant).
    
    Remove it and specify <cstddef> to still make NULL accessible.
    voidanix committed May 4, 2023
    Configuration menu
    Copy the full SHA
    d938486 View commit details
    Browse the repository at this point in the history
  14. engine: Use std::atomic, not volatile for errors

    This usage of volatile has been deprecated since C++20: use std::atomic
    in its place.
    voidanix committed May 4, 2023
    Configuration menu
    Copy the full SHA
    7cdfbc2 View commit details
    Browse the repository at this point in the history
  15. weapons: Prevent arithmetic between different enum types

    Deprecated in C++20
    voidanix committed May 4, 2023
    Configuration menu
    Copy the full SHA
    5b28d72 View commit details
    Browse the repository at this point in the history

Commits on May 11, 2023

  1. cmake: Bump to C++20

    Enable new language features that allow everyone to write better, safer and
    faster C++ code (and not let the game die).
    voidanix committed May 11, 2023
    Configuration menu
    Copy the full SHA
    5e849f7 View commit details
    Browse the repository at this point in the history
  2. Remove implicit fallthroughs

    As of C++17, we can specify whether we want our switch cases to
    fall-through or not (in presence of a break statement): specifying these
    avoids unnecessary compiler warnings and makes the code clearer as to what
    it is doing.
    
    Specify the fallthrough attribute where needed and replace the comments
    that specify its explicit usage.
    voidanix committed May 11, 2023
    Configuration menu
    Copy the full SHA
    c4fe739 View commit details
    Browse the repository at this point in the history
  3. tools: Use STL's std::clamp

    As of C++17, the STL already provides us with std::clamp which in turn
    makes the implementation here provided redundant and possibly broken:
    remove the implementation here defined and use the one provided by
    <algorithm>.
    voidanix committed May 11, 2023
    Configuration menu
    Copy the full SHA
    ef24b40 View commit details
    Browse the repository at this point in the history
  4. tools: Use STL defined mathematical constants

    As of C++20, the STL already provides us with mathematical constants that
    make the macro-fied ones used in tools redundant and possibly inaccurate:
    remove our definitions of the macros and use the constants defined in the
    <numbers> header.
    voidanix committed May 11, 2023
    Configuration menu
    Copy the full SHA
    bbcb572 View commit details
    Browse the repository at this point in the history