Commit Graph

17 Commits

Author SHA1 Message Date
Lioncash 81f9b4a4ee General: Mark functions as nodiscard where applicable
Given this aims to be a general purpose math library for use in various
other libraries applications for axiodl, we can annotate functions that
return by value or reference with [[nodiscard]] where it's very obvious
that not making use of the return value is a bug.

This allows the compiler to diagnose and emit warnings for these API
misuses at compile-time, preventing silent bugs from occurring.

Any cases where not using the return value is desirable may still be
casted to void in order to silence warnings.
2020-03-04 03:07:54 -05:00
Lioncash 9045766c52 CVector2i: Make CVector2f-related constructor non-constexpr
These make use of SIMD accessors, which aren't constexpr.
2019-09-06 02:25:33 -04:00
Lioncash 890c1e28e0 CVector2i: Add static assert for enforcing vector size
Provides compile-time guarantees about struct layout.
2019-09-04 03:05:28 -04:00
Lioncash c39186d3ba CVector2i: Make conversions to float explicit 2019-09-04 02:53:29 -04:00
Lioncash 056515b2d3 CVector2i: Make interface constexpr where applicable
These are just manipulating two integral values, so they can be made
constexpr. While we're at it, we can also apply the noexcept specifier.
2019-09-04 02:53:06 -04:00
Lioncash 3083285c79 CVector2i: Implement operator!= in terms of operator==
Same behavior, but without duplicated inverted logic.
2019-09-04 02:42:58 -04:00
Lioncash 5f892dda81 CVector2i: Remove use of union and unnamed struct
Nothing uses the v data array, so we can remove it entirely. This
removes the use of a compiler extension (anonymous struct), and
simplifies the underlying data within the vector.
2019-09-04 02:41:28 -04:00
Lioncash dafc850598 zeus: Amend inclusions
Trims out unused headers and ensures the necessary includes are
included.
2019-09-01 04:30:53 -04:00
Jack Andersen b854e76dc9 constexpr refactor 2019-02-23 21:15:32 -10:00
Jack Andersen e172225845 New code style refactor 2018-12-07 19:23:50 -10:00
Jack Andersen e8dfecbb6e SIMD refactor 2018-12-07 15:16:50 -10:00
Jack Andersen 0fc3e5e9ca CVector2f-CVector2i interop 2018-11-01 22:15:50 -10:00
Jack Andersen 20603da60d Convert to pragma once 2018-10-06 17:39:40 -10:00
Jack Andersen a0ca6ed66c Add equality tests to CVector2i 2017-05-18 09:26:44 -10:00
Jack Andersen caff50dfa5 Some arithmetic operators for CVector2i 2016-12-30 14:50:54 -10:00
Jack Andersen b15e66a710 Bulk-run of clang-format 2016-07-08 08:42:42 -10:00
Jack Andersen a76d43d5df Humungous refactor 2016-03-04 13:03:26 -10:00