mirror of
https://github.com/official-stockfish/Stockfish.git
synced 2026-07-23 13:17:12 +00:00
Consistent Integer Types
example of using, to avoid mixed usage of std::uint/std::int and uint/int... ```cpp using u64 = std::uint64_t; using u32 = std::uint32_t; using u16 = std::uint16_t; using u8 = std::uint8_t; using i64 = std::int64_t; using i32 = std::int32_t; using i16 = std::int16_t; using i8 = std::int8_t; using usize = std::size_t; using isize = std::ptrdiff_t; #if defined(__GNUC__) && defined(IS_64BIT) __extension__ using u128 = unsigned __int128; __extension__ using i128 = signed __int128; #endif ``` closes https://github.com/official-stockfish/Stockfish/pull/6874 No functional change
This commit is contained in:
committed by
Joost VandeVondele
parent
e4a635486a
commit
dd3e1c4a50
+3
-4
@@ -21,7 +21,6 @@
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
#include <cstdint>
|
||||
|
||||
#include "search.h"
|
||||
#include "ucioption.h"
|
||||
@@ -35,9 +34,9 @@ void TimeManagement::clear() {
|
||||
availableNodes = -1; // When in 'nodes as time' mode
|
||||
}
|
||||
|
||||
void TimeManagement::advance_nodes_time(std::int64_t nodes) {
|
||||
void TimeManagement::advance_nodes_time(i64 nodes) {
|
||||
assert(useNodesTime);
|
||||
availableNodes = std::max(int64_t(0), availableNodes - nodes);
|
||||
availableNodes = std::max(i64(0), availableNodes - nodes);
|
||||
}
|
||||
|
||||
// Called at the beginning of the search and calculates
|
||||
@@ -83,7 +82,7 @@ void TimeManagement::init(Search::LimitsType& limits,
|
||||
|
||||
// These numbers are used where multiplications, divisions,
|
||||
// or comparisons with constants are involved.
|
||||
const int64_t scaleFactor = useNodesTime ? npmsec : 1;
|
||||
const i64 scaleFactor = useNodesTime ? npmsec : 1;
|
||||
const TimePoint scaledTime = limits.time[us] / scaleFactor;
|
||||
|
||||
// Maximum move horizon
|
||||
|
||||
Reference in New Issue
Block a user