Patric Stout
a3cfd23cf9
Codechange: rename byte to uint8_t ( #12308 )
2024-03-16 23:59:32 +01:00
frosch
b1718478c8
Codechange: Replace old non-standard attributes with C++17/20 standard attributes.
2024-02-02 22:29:28 +01:00
Rubidium
e3f49ee7a0
Codechange: coding style fixes
2024-01-04 16:23:54 +01:00
Rubidium
eaae0bb5e7
Codechange: automatic adding of _t to (u)int types, and WChar to char32_t
...
for i in `find src -type f|grep -v 3rdparty/fmt|grep -v 3rdparty/catch2|grep -v 3rdparty/opengl|grep -v stdafx.h`; do sed 's/uint16& /uint16 \&/g;s/int8\([ >*),;[]\)/int8_t\1/g;s/int16\([ >*),;[]\)/int16_t\1/g;s/int32\([ >*),;[]\)/int32_t\1/g;s/int64\([ >*),;[]\)/int64_t\1/g;s/ uint32(/ uint32_t(/g;s/_uint8_t/_uint8/;s/Uint8_t/Uint8/;s/ft_int64_t/ft_int64/g;s/uint64$/uint64_t/;s/WChar/char32_t/g;s/char32_t char32_t/char32_t WChar/' -i $i; done
2023-07-19 19:30:14 +02:00
Rubidium
68ff3fd062
Change: include fmt.h C++ headers in stdafx.h
...
This to prevent compilation issues between runs with and without precompiled
headers. Also remove the headers from the rest of the code base as they are
not needed there anymore, although they do relatively little harm.
2023-05-08 16:49:23 +02:00
Rubidium
969a3dc0f3
Codechange: introduce generic ClampTo function to clamp to the range of a type
2023-05-06 21:26:13 +02:00
Rubidium
1ed0b35520
Fix #10009 : bad overflow protection when taking out loans
2023-01-15 12:04:50 +01:00
Michael Lutz
13528bfcd0
Codechange: Un-bitstuff all remaining commands.
2021-12-16 22:28:32 +01:00
Tyler Trahan
48c1c7f221
Cleanup: Fix typo in overflowsafe_type comment
2021-11-09 20:51:38 +01:00
Charles Pigott
f1dfc2f482
Codechange: Make OverflowSafeInt constexpr
2021-07-20 10:42:03 +01:00
Charles Pigott
549a58731f
Codechange: Remove (unused) ability to specify min/max of OverflowSafeInt
2021-07-20 10:42:03 +01:00
Charles Pigott
e6e2a67aa1
Codechange: Use GCC/clang builtins for overflow safety when supported
2021-07-20 10:42:03 +01:00
Charles Pigott
3d0d9edafd
Fix: OverflowSafeInt could underflow
...
Notably, a company with an extremely negative amount of money would
suddenly become very rich
2021-07-20 10:42:03 +01:00
Charles Pigott
1e439979f7
Fix: OverflowSafeInt negation not handling INT64_MIN
...
INT64_MIN negated is above INT64_MAX, and would overflow.
Instead, when negating INT64_MIN make it INT64_MAX.
This does mean that -(-(INT64_MIN)) != INT64_MIN.
2021-07-20 10:42:03 +01:00
S. D. Cloudt
13cc8a0cee
Cleanup: Removed SVN headers
2019-11-10 17:59:20 +00:00
alberth
8fe8765aaa
(svn r26685) -Fix: Tighten parameter bound checks on GSCargoMonitor functions, and return -1 on out-of-bound parameters.
2014-07-12 17:04:14 +00:00
rubidium
ab964a6cee
(svn r26651) -Fix: make sure an abs is used that supports int64 when using abs on those variables
2014-06-17 19:01:45 +00:00
alberth
732e073261
(svn r24776) -Doc: Typo fixes, additions, and additional dots collected from various sources (including Eagle_rainbow, MinchinWeb)
2012-12-01 13:12:39 +00:00
truebrain
1c9bec1999
(svn r23640) -Fix: stop using FORCEINLINE (1/3rd of the instances were, the others were still regular inline), but make sure inline is always a 'forced' inline (I am looking at you MSVC)
2011-12-20 17:57:56 +00:00
rubidium
7eba2bf4d3
(svn r21890) -Cleanup: remove some unneeded includes
2011-01-22 14:52:20 +00:00
rubidium
7fbc33dae1
(svn r17248) -Fix: add GPL license notice where appropriate
2009-08-21 20:21:05 +00:00
rubidium
a1e822df6b
(svn r16130) -Fix [FS#2855]: the overflowsafe type didn't like dividing by int64 larger than MAX_INT32 causing division by negative numbers and small anomolies when drawing graphs.
2009-04-23 23:29:44 +00:00
rubidium
91fa34ea11
(svn r12873) -Fix [FS#1946]: MSVC is whining because it doesn't understand that bytes should be cast to ints.
2008-04-24 17:53:45 +00:00
rubidium
01e20c9140
(svn r11674) -Codechange: refactor some functions out of macros.h into more logical locations.
2007-12-21 19:21:21 +00:00
rubidium
d5c4ba8246
(svn r11673) -Codechange: move the overflow safe type to a separate file.
2007-12-21 08:34:53 +00:00