Merge branch 'master' into jgrpp

# Conflicts:
#	src/autoreplace_gui.cpp
#	src/build_vehicle_gui.cpp
#	src/cheat_gui.cpp
#	src/company_gui.cpp
#	src/debug.cpp
#	src/engine_gui.h
#	src/error_gui.cpp
#	src/group_gui.cpp
#	src/industry_cmd.cpp
#	src/industry_gui.cpp
#	src/misc_gui.cpp
#	src/network/network_gui.cpp
#	src/newgrf.cpp
#	src/newgrf_debug_gui.cpp
#	src/newgrf_gui.cpp
#	src/order_gui.cpp
#	src/rail_gui.cpp
#	src/road_gui.cpp
#	src/saveload/saveload.cpp
#	src/screenshot_gui.cpp
#	src/sound/win32_s.cpp
#	src/statusbar_gui.cpp
#	src/strgen/strgen.cpp
#	src/table/newgrf_debug_data.h
#	src/timetable_gui.cpp
#	src/toolbar_gui.cpp
#	src/town_gui.cpp
#	src/vehicle_gui.cpp
#	src/video/sdl2_v.cpp
#	src/video/sdl_v.cpp
#	src/viewport.cpp
This commit is contained in:
Jonathan G Rennison
2024-05-31 18:43:32 +01:00
148 changed files with 1821 additions and 1696 deletions

View File

@@ -25,7 +25,7 @@
template <typename T>
constexpr T abs(const T a)
{
return (a < (T)0) ? -a : a;
return (a < static_cast<T>(0)) ? -a : a;
}
/**
@@ -41,7 +41,7 @@ constexpr T Align(const T x, uint n)
{
assert((n & (n - 1)) == 0 && n != 0);
n--;
return (T)((x + n) & ~((T)n));
return static_cast<T>((x + n) & ~static_cast<T>(n));
}
/**
@@ -57,8 +57,8 @@ constexpr T Align(const T x, uint n)
template <typename T>
constexpr T *AlignPtr(T *x, uint n)
{
static_assert(sizeof(size_t) == sizeof(void *));
return reinterpret_cast<T *>(Align((size_t)x, n));
static_assert(sizeof(uintptr_t) == sizeof(void *));
return reinterpret_cast<T *>(Align(reinterpret_cast<uintptr_t>(x), n));
}
/**
@@ -254,7 +254,7 @@ constexpr T Delta(const T a, const T b)
template <typename T>
constexpr bool IsInsideBS(const T x, const size_t base, const size_t size)
{
return (size_t)(x - base) < size;
return static_cast<size_t>(x - base) < size;
}
/**
@@ -271,9 +271,9 @@ template <typename T, std::enable_if_t<std::disjunction_v<std::is_convertible<T,
constexpr bool IsInsideMM(const T x, const size_t min, const size_t max) noexcept
{
if constexpr (std::is_base_of_v<StrongTypedefBase, T>) {
return (size_t)(x.base() - min) < (max - min);
return static_cast<size_t>(x.base() - min) < (max - min);
} else {
return (size_t)(x - min) < (max - min);
return static_cast<size_t>(x - min) < (max - min);
}
}