12 Commits (cf36feaa61a00bdffc3234d9d9a68d8ba91f5719)

Author SHA1 Message Date
Rosen Penev bd6a996181 clang-tidy: use using
Found with modernize-use-using

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Robin Mills d632988bbd Massive code prolog cleanup. 4 years ago
Luis Díaz Más 603692a1d8 Copyright to Exiv2 authors 7 years ago
Dan Čermák 2dacb19933 [safe_op] Add Safe::abs(), calculates absoulte value without UB
Add a drop-in replacement for std::abs which never produces
negative values and thereby never invokes undefined behavior.
7 years ago
Dan Čermák bf51a76e4e [safe_op] Fix ODR violation in compiler builtin specializations
The compiler instrinsics are exposed via fully specialized template functions
which must not be defined twice (which they accidentally were). Declaring them
as inline fixes this issue.
7 years ago
Dan Čermák bb2019149a [safe_op] Don't use overflow intrinsics in MSVC 2005 7 years ago
Dan Čermák 06ec1e6984 [safe_op] Refactored addition overflow checks using functions only
- templated structs were not required, SFINAE works for functions too
  => use instead, removes some unneeded code
- fix non-usage of builtins with clang
- adjust unit tests
7 years ago
Dan Čermák 684c8c89de [safe_op] Simplified unsigned int overflow check
Simply check for overflows after the addition, as no undefined behavior can
occur here.
7 years ago
Dan Čermák 31b96b58e7 [safe_op] improved signed int overflow checks via integer promotion
The fallback signed integer overflow check is quite expensive, but the addition
can be safely performed when saved in an int due to integer promotion
rules. This makes the check a little less expensive.
7 years ago
Dan Čermák 029b997ca0 [safe_op] fixed typo in doc-comment 7 years ago
Dan Čermák 7c00e9128d Fix compilation error with gcc < 5
- overflow builtins were added with gcc 5.0
8 years ago
Dan Čermák ca7c699aa1 Added overflow safe addition function 8 years ago