Commit Graph

18 Commits

Author SHA1 Message Date
Andrea Blankenstijn 5f341149fa clang-format header sorting conf fix. Some spacing and order of
include/declaration changes.
2021-08-24 00:12:57 +02:00
Andrea Blankenstijn f6ae2c51e8 Comment a bit the code. 2021-08-23 23:50:14 +02:00
Andrea Blankenstijn 5020eab828 remove some asserts and use exceptions for the remaining ones. 2021-08-23 18:41:11 +02:00
Andrea Blankenstijn 0c0b03aeac fix sdl include path 2021-08-23 00:00:57 +02:00
Andrea Blankenstijn a19d2ea6bd - mark as const every single read only variable.
- mark as const every pointer that can be const.
- in implementation mark const args passed by value that are meant to be read-only.
- wrap in a lambda complex initializations of (const) values.
- argument passing:
  - pass by value arguments of cheap-to-copy types or meant to be copied
    anyway.
  - pass by (const) reference args not meant to outlive called
    function scope and not cheap-to-copy.
  - pass (const) pointers to (const) args when null is a valid option
    and pointed data aren't expected to outlive function scope.
  - use string_view for non-owned strings (not meant to outlive function
    scope).
  - use span for collection types like vector and arrays.
  - fancy pointers passing:
    - pass by value if a reference will be held:
    - pass by const reference if a reference _may_ be hell.
    - when no references are meant to be held:
        - dereference the pointer to pass the pointed data by reference
          if null is not an option.
        - pass the underlying raw pointer if null is an option.
… and random subtle changes and fixes here and there that I forgot to mention.
2021-08-22 00:57:55 +02:00
Andrea Blankenstijn 76d319fb69 trash commit, style, small api changes (ref vs ptr) and who knows 2021-08-19 15:00:44 +02:00
Andrea Blankenstijn 07f7061c20 public api before private members 2021-08-15 16:13:05 +02:00
Andrea Blankenstijn 3458ca123b pass by value vs by ref thing 2021-08-14 16:37:42 +02:00
Andrea Blankenstijn b11d574d9c constructor style refactor 2021-08-14 11:53:51 +02:00
Andrea Blankenstijn 3570cf301a format code 2021-08-14 09:25:28 +02:00
Andrea Blankenstijn 7c5277dabd They say members defined in header are implicitly inline.
Also remove the static from static inline (is that C specific?)
2021-08-14 09:17:51 +02:00
Andrea Blankenstijn 5cb15abe11 code formatting. 2021-08-12 16:10:49 +02:00
Andrea Blankenstijn d1cd97809e littles things 2021-08-12 16:09:26 +02:00
Andrea Blankenstijn d3be108df6 don't pass by ref scalar types, copy them. 2021-08-12 16:08:08 +02:00
Andrea Blankenstijn 0642d89803 Suppressed or defaulted constructors/assignment operators 2021-08-12 15:29:25 +02:00
Andrea Blankenstijn 31763a4563 fix missing cmath include. don't understand how it compiled until now. 2021-08-12 15:22:58 +02:00
Andrea Blankenstijn e71a16208b noexcept correctness intent 2021-08-08 16:04:33 +02:00
Andrea Blankenstijn cab6fa0cf4 wip general code improvement 2021-08-07 20:11:28 +02:00