diff --git a/src/analyzer/atsp/atsp.h b/src/analyzer/atsp/atsp.h index e7ff1e5dc4..19a4cb304b 100644 --- a/src/analyzer/atsp/atsp.h +++ b/src/analyzer/atsp/atsp.h @@ -226,9 +226,9 @@ class ATSP final double pLowerBound; bool pUseUpperBound; bool pUseLowerBound; - yuint64 pRoundingCount; - yuint64 pRounding80percentCount; - yuint64 pRoundingCountTotal; + uint64_t pRoundingCount; + uint64_t pRounding80percentCount; + uint64_t pRoundingCountTotal; Yuni::ShortString16 tsName; uint pEnabledAreaCount; @@ -286,8 +286,8 @@ class ATSP final durjour = 24 }; - yuint64 pLimitMemory; - yuint64 pCacheMemoryUsed; + uint64_t pLimitMemory; + uint64_t pCacheMemoryUsed; uint pCacheLastValidIndex; Matrix<>* pCacheMatrix; diff --git a/src/cmake/common-settings.cmake b/src/cmake/common-settings.cmake index 86ece44167..fc34d0a780 100644 --- a/src/cmake/common-settings.cmake +++ b/src/cmake/common-settings.cmake @@ -5,6 +5,8 @@ set(CMAKE_CXX_STANDARD 17) set(COMMON_GCC_FLAGS "-Wall -W -Wextra -Wfatal-errors") if (NOT WIN32) +# These flags are incompatible with non-x86 architectures (e.g ARM) +# TODO remove set(COMMON_GCC_FLAGS "${COMMON_GCC_FLAGS} -pipe -msse -msse2 -Wunused-but-set-variable -Wunused-but-set-parameter") set(COMMON_GCC_FLAGS "${COMMON_GCC_FLAGS} -Werror=return-type") endif() diff --git a/src/ext/yuni/src/yuni/cmake/core/check-includes.cmake b/src/ext/yuni/src/yuni/cmake/core/check-includes.cmake index 0c60eb38e9..19f0ac0009 100644 --- a/src/ext/yuni/src/yuni/cmake/core/check-includes.cmake +++ b/src/ext/yuni/src/yuni/cmake/core/check-includes.cmake @@ -1,8 +1,3 @@ - - -# stdint.h -check_include_file(stdint.h YUNI_HAS_STDINT_H) - # stdio.h check_include_file(stdio.h YUNI_HAS_STDIO_H) diff --git a/src/ext/yuni/src/yuni/cmake/core/core.cmake b/src/ext/yuni/src/yuni/cmake/core/core.cmake index 56fc0af8f8..7f18ad44db 100644 --- a/src/ext/yuni/src/yuni/cmake/core/core.cmake +++ b/src/ext/yuni/src/yuni/cmake/core/core.cmake @@ -65,8 +65,6 @@ if (MSVC) set(yuni_additional_os_specific core/system/gettimeofday.cpp core/system/username.cpp - core/system/windows/msinttypes/inttypes.h - core/system/windows/msinttypes/stdint.h core/system/windows.hdr.h) else() set(yuni_additional_os_specific "") diff --git a/src/ext/yuni/src/yuni/cmake/net.cmake b/src/ext/yuni/src/yuni/cmake/net.cmake index 23edc8f875..e70c6ee113 100644 --- a/src/ext/yuni/src/yuni/cmake/net.cmake +++ b/src/ext/yuni/src/yuni/cmake/net.cmake @@ -27,9 +27,6 @@ set(SRC_PRIVATE_NET_MESSAGE_TRANSPORT_REST ) source_group("Private\\Net\\Messaging\\Transport\\REST" FILES ${SRC_PRIVATE_NET_MESSAGE_TRANSPORT_REST}) -if (YUNI_HAS_STDINT_H) - set_source_files_properties(private/net/messaging/transport/rest/mongoose.c PROPERTIES COMPILE_FLAGS -DHAVE_STDINT) -endif() if (YUNI_HAS_GCC_NOWARNING) set_source_files_properties(private/net/messaging/transport/rest/mongoose.c PROPERTIES COMPILE_FLAGS -w) endif() diff --git a/src/ext/yuni/src/yuni/cmake/platform.cmake b/src/ext/yuni/src/yuni/cmake/platform.cmake index adbe3e0489..5c2e042fc8 100644 --- a/src/ext/yuni/src/yuni/cmake/platform.cmake +++ b/src/ext/yuni/src/yuni/cmake/platform.cmake @@ -2,10 +2,6 @@ /* This file is generated by CMake */ - -/* stdint.h */ -#cmakedefine YUNI_HAS_STDINT_H - /* stdio.h */ #cmakedefine YUNI_HAS_STDIO_H diff --git a/src/ext/yuni/src/yuni/core/atomic/int.h b/src/ext/yuni/src/yuni/core/atomic/int.h index 12625402f7..c40c201df4 100644 --- a/src/ext/yuni/src/yuni/core/atomic/int.h +++ b/src/ext/yuni/src/yuni/core/atomic/int.h @@ -97,15 +97,15 @@ class YUNI_DECL Int final YUNI_ATOMIC_INHERITS /*! ** \brief Constructor with an initial value (int16) */ - Int(sint16 v); + Int(int16_t v); /*! - ** \brief Constructor with an initial value (int32) + ** \brief Constructor with an initial value (int32_t) */ - Int(sint32 v); + Int(int32_t v); /*! ** \brief Constructor with an initial value (int64) */ - Int(sint64 v); + Int(int64_t v); /*! ** \brief Copy constructor diff --git a/src/ext/yuni/src/yuni/core/atomic/int.hxx b/src/ext/yuni/src/yuni/core/atomic/int.hxx index bcd0400378..769fa74a4d 100644 --- a/src/ext/yuni/src/yuni/core/atomic/int.hxx +++ b/src/ext/yuni/src/yuni/core/atomic/int.hxx @@ -26,7 +26,7 @@ inline Int::Int() : } template class TP> -inline Int::Int(sint16 v) : +inline Int::Int(int16_t v) : #if YUNI_ATOMIC_MUST_USE_MUTEX != 1 pValue(static_cast(v)) #else @@ -36,7 +36,7 @@ inline Int::Int(sint16 v) : } template class TP> -inline Int::Int(sint32 v) : +inline Int::Int(int32_t v) : #if YUNI_ATOMIC_MUST_USE_MUTEX != 1 pValue(static_cast(v)) #else @@ -46,7 +46,7 @@ inline Int::Int(sint32 v) : } template class TP> -inline Int::Int(sint64 v) : +inline Int::Int(int64_t v) : #if YUNI_ATOMIC_MUST_USE_MUTEX != 1 pValue(static_cast(v)) #else diff --git a/src/ext/yuni/src/yuni/core/atomic/traits.h b/src/ext/yuni/src/yuni/core/atomic/traits.h index 8ced8495a7..7d1a735a11 100644 --- a/src/ext/yuni/src/yuni/core/atomic/traits.h +++ b/src/ext/yuni/src/yuni/core/atomic/traits.h @@ -95,7 +95,7 @@ struct TypeFromSize<1> final { size = 32 }; - typedef sint32 Type; + typedef int32_t Type; }; // Int16 @@ -104,12 +104,12 @@ struct TypeFromSize<16> final { // On OS X, there are only routines for int32_t and int64_t // With MinGW, it simply does not exist - // It seems that the best solution is to use int32 everywhere + // It seems that the best solution is to use int32_t everywhere enum { size = 32 }; - typedef sint32 Type; + typedef int32_t Type; }; // Int32 @@ -120,7 +120,7 @@ struct TypeFromSize<32> final { size = 32 }; - typedef sint32 Type; + typedef int32_t Type; }; // Int64 @@ -131,7 +131,7 @@ struct TypeFromSize<64> final { size = 64 }; - typedef sint64 Type; + typedef int64_t Type; }; // Thread-safe operations @@ -224,7 +224,7 @@ struct Operator<32, TP> final } template - static void Set(T& t, sint32 newvalue) + static void Set(T& t, int32_t newvalue) { #ifdef YUNI_OS_WINDOWS ::InterlockedExchange((LONG*)&t.pValue, newvalue); @@ -341,7 +341,7 @@ struct Operator<64, TP> final } template - static void Set(T& t, sint64 newvalue) + static void Set(T& t, int64_t newvalue) { #ifdef YUNI_OS_WINDOWS #ifdef YUNI_OS_MINGW32 diff --git a/src/ext/yuni/src/yuni/core/bit/bit.h b/src/ext/yuni/src/yuni/core/bit/bit.h index 398b4acbff..aadef85097 100644 --- a/src/ext/yuni/src/yuni/core/bit/bit.h +++ b/src/ext/yuni/src/yuni/core/bit/bit.h @@ -48,7 +48,7 @@ namespace Bit */ template uint Count(T data); -yuint32 Count(yuint32 data); +uint32_t Count(uint32_t data); /*! ** \brief Get if the bit at a given index diff --git a/src/ext/yuni/src/yuni/core/bit/bit.hxx b/src/ext/yuni/src/yuni/core/bit/bit.hxx index cd07745b38..114fff05b7 100644 --- a/src/ext/yuni/src/yuni/core/bit/bit.hxx +++ b/src/ext/yuni/src/yuni/core/bit/bit.hxx @@ -15,10 +15,10 @@ namespace Yuni { namespace Bit { -inline yuint32 Count(yuint32 i) +inline uint32_t Count(uint32_t i) { #ifdef YUNI_HAS_GCC_BUILTIN_POPCOUNT - return static_cast(__builtin_popcount(i)); + return static_cast(__builtin_popcount(i)); #else // variable-precision SWAR algorithm i = i - ((i >> 1) & 0x55555555); diff --git a/src/ext/yuni/src/yuni/core/color/rgb.hxx b/src/ext/yuni/src/yuni/core/color/rgb.hxx index 7d99e09a9e..37375805d5 100644 --- a/src/ext/yuni/src/yuni/core/color/rgb.hxx +++ b/src/ext/yuni/src/yuni/core/color/rgb.hxx @@ -805,28 +805,28 @@ inline Yuni::Color::RGB::template Calculat return r; \ } -YUNI_COLOR_RGB_OPERATOR_TYPE_RGB(Yuni::sint8) -YUNI_COLOR_RGB_OPERATOR_TYPE_RGB(Yuni::sint16) -YUNI_COLOR_RGB_OPERATOR_TYPE_RGB(Yuni::sint32) -YUNI_COLOR_RGB_OPERATOR_TYPE_RGB(Yuni::sint64) -YUNI_COLOR_RGB_OPERATOR_TYPE_RGB(Yuni::uint8) -YUNI_COLOR_RGB_OPERATOR_TYPE_RGB(Yuni::uint16) -YUNI_COLOR_RGB_OPERATOR_TYPE_RGB(Yuni::uint32) -YUNI_COLOR_RGB_OPERATOR_TYPE_RGB(Yuni::uint64) +YUNI_COLOR_RGB_OPERATOR_TYPE_RGB(int8_t) +YUNI_COLOR_RGB_OPERATOR_TYPE_RGB(int16_t) +YUNI_COLOR_RGB_OPERATOR_TYPE_RGB(int32_t) +YUNI_COLOR_RGB_OPERATOR_TYPE_RGB(int64_t) +YUNI_COLOR_RGB_OPERATOR_TYPE_RGB(uint8_t) +YUNI_COLOR_RGB_OPERATOR_TYPE_RGB(uint16_t) +YUNI_COLOR_RGB_OPERATOR_TYPE_RGB(uint32_t) +YUNI_COLOR_RGB_OPERATOR_TYPE_RGB(uint64_t) YUNI_COLOR_RGB_OPERATOR_TYPE_RGB(float) YUNI_COLOR_RGB_OPERATOR_TYPE_RGB(double) #ifdef YUNI_HAS_LONG_DOUBLE YUNI_COLOR_RGB_OPERATOR_TYPE_RGB(long double) #endif -YUNI_COLOR_RGB_OPERATOR_RGB_TYPE(Yuni::sint8) -YUNI_COLOR_RGB_OPERATOR_RGB_TYPE(Yuni::sint16) -YUNI_COLOR_RGB_OPERATOR_RGB_TYPE(Yuni::sint32) -YUNI_COLOR_RGB_OPERATOR_RGB_TYPE(Yuni::sint64) -YUNI_COLOR_RGB_OPERATOR_RGB_TYPE(Yuni::uint8) -YUNI_COLOR_RGB_OPERATOR_RGB_TYPE(Yuni::uint16) -YUNI_COLOR_RGB_OPERATOR_RGB_TYPE(Yuni::uint32) -YUNI_COLOR_RGB_OPERATOR_RGB_TYPE(Yuni::uint64) +YUNI_COLOR_RGB_OPERATOR_RGB_TYPE(int8_t) +YUNI_COLOR_RGB_OPERATOR_RGB_TYPE(int16_t) +YUNI_COLOR_RGB_OPERATOR_RGB_TYPE(int32_t) +YUNI_COLOR_RGB_OPERATOR_RGB_TYPE(int64_t) +YUNI_COLOR_RGB_OPERATOR_RGB_TYPE(uint8_t) +YUNI_COLOR_RGB_OPERATOR_RGB_TYPE(uint16_t) +YUNI_COLOR_RGB_OPERATOR_RGB_TYPE(uint32_t) +YUNI_COLOR_RGB_OPERATOR_RGB_TYPE(uint64_t) YUNI_COLOR_RGB_OPERATOR_RGB_TYPE(float) YUNI_COLOR_RGB_OPERATOR_RGB_TYPE(double) #ifdef YUNI_HAS_LONG_DOUBLE diff --git a/src/ext/yuni/src/yuni/core/color/rgba.hxx b/src/ext/yuni/src/yuni/core/color/rgba.hxx index 9fb1b5219d..0e1c3650b7 100644 --- a/src/ext/yuni/src/yuni/core/color/rgba.hxx +++ b/src/ext/yuni/src/yuni/core/color/rgba.hxx @@ -869,28 +869,28 @@ inline Yuni::Color::RGBA::template Calcul return r; \ } -YUNI_COLOR_RGBA_OPERATOR_TYPE_RGBA(Yuni::sint8) -YUNI_COLOR_RGBA_OPERATOR_TYPE_RGBA(Yuni::sint16) -YUNI_COLOR_RGBA_OPERATOR_TYPE_RGBA(Yuni::sint32) -YUNI_COLOR_RGBA_OPERATOR_TYPE_RGBA(Yuni::sint64) -YUNI_COLOR_RGBA_OPERATOR_TYPE_RGBA(Yuni::uint8) -YUNI_COLOR_RGBA_OPERATOR_TYPE_RGBA(Yuni::uint16) -YUNI_COLOR_RGBA_OPERATOR_TYPE_RGBA(Yuni::uint32) -YUNI_COLOR_RGBA_OPERATOR_TYPE_RGBA(Yuni::uint64) +YUNI_COLOR_RGBA_OPERATOR_TYPE_RGBA(int8_t) +YUNI_COLOR_RGBA_OPERATOR_TYPE_RGBA(int16_t) +YUNI_COLOR_RGBA_OPERATOR_TYPE_RGBA(int32_t) +YUNI_COLOR_RGBA_OPERATOR_TYPE_RGBA(int64_t) +YUNI_COLOR_RGBA_OPERATOR_TYPE_RGBA(uint8_t) +YUNI_COLOR_RGBA_OPERATOR_TYPE_RGBA(uint16_t) +YUNI_COLOR_RGBA_OPERATOR_TYPE_RGBA(uint32_t) +YUNI_COLOR_RGBA_OPERATOR_TYPE_RGBA(uint64_t) YUNI_COLOR_RGBA_OPERATOR_TYPE_RGBA(float) YUNI_COLOR_RGBA_OPERATOR_TYPE_RGBA(double) #ifdef YUNI_HAS_LONG_DOUBLE YUNI_COLOR_RGBA_OPERATOR_TYPE_RGBA(long double) #endif -YUNI_COLOR_RGBA_OPERATOR_RGBA_TYPE(Yuni::sint8) -YUNI_COLOR_RGBA_OPERATOR_RGBA_TYPE(Yuni::sint16) -YUNI_COLOR_RGBA_OPERATOR_RGBA_TYPE(Yuni::sint32) -YUNI_COLOR_RGBA_OPERATOR_RGBA_TYPE(Yuni::sint64) -YUNI_COLOR_RGBA_OPERATOR_RGBA_TYPE(Yuni::uint8) -YUNI_COLOR_RGBA_OPERATOR_RGBA_TYPE(Yuni::uint16) -YUNI_COLOR_RGBA_OPERATOR_RGBA_TYPE(Yuni::uint32) -YUNI_COLOR_RGBA_OPERATOR_RGBA_TYPE(Yuni::uint64) +YUNI_COLOR_RGBA_OPERATOR_RGBA_TYPE(int8_t) +YUNI_COLOR_RGBA_OPERATOR_RGBA_TYPE(int16_t) +YUNI_COLOR_RGBA_OPERATOR_RGBA_TYPE(int32_t) +YUNI_COLOR_RGBA_OPERATOR_RGBA_TYPE(int64_t) +YUNI_COLOR_RGBA_OPERATOR_RGBA_TYPE(uint8_t) +YUNI_COLOR_RGBA_OPERATOR_RGBA_TYPE(uint16_t) +YUNI_COLOR_RGBA_OPERATOR_RGBA_TYPE(uint32_t) +YUNI_COLOR_RGBA_OPERATOR_RGBA_TYPE(uint64_t) YUNI_COLOR_RGBA_OPERATOR_RGBA_TYPE(float) YUNI_COLOR_RGBA_OPERATOR_RGBA_TYPE(double) #ifdef YUNI_HAS_LONG_DOUBLE diff --git a/src/ext/yuni/src/yuni/core/getopt/option.h b/src/ext/yuni/src/yuni/core/getopt/option.h index 5fad5448e3..7ca533ad62 100644 --- a/src/ext/yuni/src/yuni/core/getopt/option.h +++ b/src/ext/yuni/src/yuni/core/getopt/option.h @@ -122,30 +122,30 @@ class Flag }; template<> -class Flag +class Flag { public: - static void Enable(sint16& out) + static void Enable(int16_t& out) { out = 1; } }; template<> -class Flag +class Flag { public: - static void Enable(sint32& out) + static void Enable(int32_t& out) { out = 1; } }; template<> -class Flag +class Flag { public: - static void Enable(sint64& out) + static void Enable(int64_t& out) { out = 1; } @@ -162,20 +162,20 @@ class Flag }; template<> -class Flag +class Flag { public: - static void Enable(uint32& out) + static void Enable(uint32_t& out) { out = 1u; } }; template<> -class Flag +class Flag { public: - static void Enable(uint64& out) + static void Enable(uint64_t& out) { out = 1u; } diff --git a/src/ext/yuni/src/yuni/core/hash/checksum/checksum.h b/src/ext/yuni/src/yuni/core/hash/checksum/checksum.h index 22906034a5..9172766d62 100644 --- a/src/ext/yuni/src/yuni/core/hash/checksum/checksum.h +++ b/src/ext/yuni/src/yuni/core/hash/checksum/checksum.h @@ -63,7 +63,7 @@ class YUNI_DECL IChecksum *length ** \return The hash value */ - virtual const String& fromRawData(const void* rawdata, uint64 size = AutoDetectNullChar) = 0; + virtual const String& fromRawData(const void* rawdata, uint64_t size = AutoDetectNullChar) = 0; /*! ** \brief Compute the hash of a given file diff --git a/src/ext/yuni/src/yuni/core/hash/checksum/md5.cpp b/src/ext/yuni/src/yuni/core/hash/checksum/md5.cpp index 941bf0a60b..28929bcda2 100644 --- a/src/ext/yuni/src/yuni/core/hash/checksum/md5.cpp +++ b/src/ext/yuni/src/yuni/core/hash/checksum/md5.cpp @@ -97,7 +97,7 @@ namespace Checksum namespace // anonymous { typedef unsigned char MD5TypeByte; // 8-bit byte -typedef uint32 MD5TypeUInt32; // 32-bit word +typedef uint32_t MD5TypeUInt32; // 32-bit word /*! * \brief Define the state of the MD5 Algorithm @@ -376,7 +376,7 @@ void md5DigestToString(String& s, MD5TypeByte digest[16]) } // anonymous namespace -const String& MD5::fromRawData(const void* rawdata, uint64 size) +const String& MD5::fromRawData(const void* rawdata, uint64_t size) { pValue.clear(); if (!rawdata) @@ -408,7 +408,7 @@ const String& MD5::fromFile(const String& filename) md5ImplInit(&state); char buffer[1024]; - uint64 len = 0u; + uint64_t len = 0u; while (0 != (len = stream.read((char*)buffer, 1024u))) md5ImplAppend( diff --git a/src/ext/yuni/src/yuni/core/hash/checksum/md5.h b/src/ext/yuni/src/yuni/core/hash/checksum/md5.h index b9c424e5c2..669b03c027 100644 --- a/src/ext/yuni/src/yuni/core/hash/checksum/md5.h +++ b/src/ext/yuni/src/yuni/core/hash/checksum/md5.h @@ -66,7 +66,7 @@ class YUNI_DECL MD5 final : public Hash::Checksum::IChecksum ** \param size Size of the given buffer. ** \return The hash value */ - static String FromRawData(const void* rawdata, uint64 size = AutoDetectNullChar); + static String FromRawData(const void* rawdata, uint64_t size = AutoDetectNullChar); public: //! \name Constructor & Destructor @@ -82,7 +82,7 @@ class YUNI_DECL MD5 final : public Hash::Checksum::IChecksum //@} virtual const String& fromRawData(const void* rawdata, - uint64 size = AutoDetectNullChar) override; + uint64_t size = AutoDetectNullChar) override; virtual const String& fromFile(const String& filename) override; }; // class Hash::Checksum::MD5 diff --git a/src/ext/yuni/src/yuni/core/hash/checksum/md5.hxx b/src/ext/yuni/src/yuni/core/hash/checksum/md5.hxx index 05bb1c7bc9..1ef1664eb6 100644 --- a/src/ext/yuni/src/yuni/core/hash/checksum/md5.hxx +++ b/src/ext/yuni/src/yuni/core/hash/checksum/md5.hxx @@ -22,7 +22,7 @@ inline String MD5::FromString(const String& s) return MD5().fromString(s); } -inline String MD5::FromRawData(const void* rawdata, uint64 size) +inline String MD5::FromRawData(const void* rawdata, uint64_t size) { return MD5().fromRawData(rawdata, size); } diff --git a/src/ext/yuni/src/yuni/core/process/program/process-info.h b/src/ext/yuni/src/yuni/core/process/program/process-info.h index efb540341a..8e0314c7aa 100644 --- a/src/ext/yuni/src/yuni/core/process/program/process-info.h +++ b/src/ext/yuni/src/yuni/core/process/program/process-info.h @@ -69,7 +69,7 @@ class Program::ProcessSharedInfo final : public Yuni::NonCopyable= pStartTime) ? (pEndTime - pStartTime) : 0; + int64_t duration = (pEndTime >= pStartTime) ? (pEndTime - pStartTime) : 0; // Making sure that the process ID is invalid { @@ -308,7 +308,7 @@ bool Program::execute(uint timeout) return processReady; } -int Program::wait(sint64* duration) +int Program::wait(int64_t* duration) { ProcessSharedInfo::Ptr envptr = pEnv; if (YUNI_UNLIKELY(!envptr)) diff --git a/src/ext/yuni/src/yuni/core/process/program/program.h b/src/ext/yuni/src/yuni/core/process/program/program.h index 96e97ccd11..618d4a0d14 100644 --- a/src/ext/yuni/src/yuni/core/process/program/program.h +++ b/src/ext/yuni/src/yuni/core/process/program/program.h @@ -181,7 +181,7 @@ class YUNI_DECL Program final ** \return The exit status of the process ** \see durationPrecision() */ - int wait(sint64* duration = nullptr); + int wait(int64_t* duration = nullptr); /*! ** \brief Terminate the execution of the process diff --git a/src/ext/yuni/src/yuni/core/process/program/stream.h b/src/ext/yuni/src/yuni/core/process/program/stream.h index 1f3a168367..19dc6036cd 100644 --- a/src/ext/yuni/src/yuni/core/process/program/stream.h +++ b/src/ext/yuni/src/yuni/core/process/program/stream.h @@ -46,7 +46,7 @@ class Stream } //! The execution has finished - virtual void onStop(bool /*killed*/, int /*exitstatus*/, sint64 /*duration*/) + virtual void onStop(bool /*killed*/, int /*exitstatus*/, int64_t /*duration*/) { } }; diff --git a/src/ext/yuni/src/yuni/core/process/program/windows.inc.hpp b/src/ext/yuni/src/yuni/core/process/program/windows.inc.hpp index d2ada79200..41867db389 100644 --- a/src/ext/yuni/src/yuni/core/process/program/windows.inc.hpp +++ b/src/ext/yuni/src/yuni/core/process/program/windows.inc.hpp @@ -86,7 +86,7 @@ bool Program::ThreadMonitor::spawnProcess() SECURITY_ATTRIBUTES saAttr; // Set the bInheritHandle flag so pipe handles are inherited. - saAttr.nLength = (uint32)sizeof(SECURITY_ATTRIBUTES); + saAttr.nLength = (uint32_t)sizeof(SECURITY_ATTRIBUTES); saAttr.bInheritHandle = TRUE; saAttr.lpSecurityDescriptor = nullptr; @@ -115,7 +115,7 @@ bool Program::ThreadMonitor::spawnProcess() // handles in the program are inherited by the child. STARTUPINFOEX startInfo; ::ZeroMemory(&startInfo, sizeof(STARTUPINFOEX)); - startInfo.StartupInfo.cb = (uint32)sizeof(STARTUPINFOEX); + startInfo.StartupInfo.cb = (uint32_t)sizeof(STARTUPINFOEX); startInfo.lpAttributeList = attrList; startInfo.StartupInfo.dwFlags |= STARTF_USESTDHANDLES; startInfo.StartupInfo.hStdOutput = channels.infd[1]; @@ -124,7 +124,7 @@ bool Program::ThreadMonitor::spawnProcess() #else STARTUPINFO startInfo; ::ZeroMemory(&startInfo, sizeof(STARTUPINFO)); - startInfo.cb = (uint32)sizeof(STARTUPINFO); + startInfo.cb = (uint32_t)sizeof(STARTUPINFO); startInfo.dwFlags |= STARTF_USESTDHANDLES; startInfo.hStdOutput = channels.infd[1]; startInfo.hStdInput = channels.outfd[0]; @@ -338,7 +338,7 @@ void Program::ThreadMonitor::onKill() { // killing the sub-process, until it is really dead ::TerminateProcess(processHandle, (uint)-127); - uint32 waitStatus = ::WaitForSingleObject(processHandle, INFINITE); + uint32_t waitStatus = ::WaitForSingleObject(processHandle, INFINITE); // getting the current time as soon as possible pEndTime = currentTime(); switch (waitStatus) diff --git a/src/ext/yuni/src/yuni/core/static/if.h b/src/ext/yuni/src/yuni/core/static/if.h index 0bb8f8277b..98f0f4f57a 100644 --- a/src/ext/yuni/src/yuni/core/static/if.h +++ b/src/ext/yuni/src/yuni/core/static/if.h @@ -26,7 +26,7 @@ namespace Static ** class IntWrapper ** { ** public: -** typedef typename Yuni::Static::If::Type IntType; +** typedef typename Yuni::Static::If::Type IntType; ** ** }; ** \endcode diff --git a/src/ext/yuni/src/yuni/core/static/types.h b/src/ext/yuni/src/yuni/core/static/types.h index a5430c2566..572d2d46d9 100644 --- a/src/ext/yuni/src/yuni/core/static/types.h +++ b/src/ext/yuni/src/yuni/core/static/types.h @@ -237,7 +237,7 @@ struct IsFundamental }; }; template<> -struct IsFundamental +struct IsFundamental { enum { @@ -247,7 +247,7 @@ struct IsFundamental }; #endif template<> -struct IsFundamental +struct IsFundamental { enum { @@ -256,7 +256,7 @@ struct IsFundamental }; }; template<> -struct IsFundamental +struct IsFundamental { enum { @@ -286,7 +286,7 @@ struct IsFundamental }; #endif template<> -struct IsFundamental +struct IsFundamental { enum { @@ -295,7 +295,7 @@ struct IsFundamental }; }; template<> -struct IsFundamental +struct IsFundamental { enum { diff --git a/src/ext/yuni/src/yuni/core/string/string.h b/src/ext/yuni/src/yuni/core/string/string.h index 1ad866b644..2150226e6a 100644 --- a/src/ext/yuni/src/yuni/core/string/string.h +++ b/src/ext/yuni/src/yuni/core/string/string.h @@ -362,14 +362,14 @@ class YUNI_DECL CString final : protected Private::CStringImpl::Data::CString(bool value) } template -inline CString::CString(yint64 value) +inline CString::CString(int64_t value) { assign(value); } template -inline CString::CString(yint32 value) +inline CString::CString(int32_t value) { assign(value); } template -inline CString::CString(yuint64 value) +inline CString::CString(uint64_t value) { assign(value); } template -inline CString::CString(yuint32 value) +inline CString::CString(uint32_t value) { assign(value); } diff --git a/src/ext/yuni/src/yuni/core/string/traits/append.h b/src/ext/yuni/src/yuni/core/string/traits/append.h index 13f0d20444..0a40e93d7a 100644 --- a/src/ext/yuni/src/yuni/core/string/traits/append.h +++ b/src/ext/yuni/src/yuni/core/string/traits/append.h @@ -236,12 +236,12 @@ class Append final } \ } -YUNI_PRIVATE_MEMORY_BUFFER_APPEND_IMPL_INT(sint16); -YUNI_PRIVATE_MEMORY_BUFFER_APPEND_IMPL_INT(sint32); -YUNI_PRIVATE_MEMORY_BUFFER_APPEND_IMPL_INT(sint64); -YUNI_PRIVATE_MEMORY_BUFFER_APPEND_IMPL_INT(uint16); -YUNI_PRIVATE_MEMORY_BUFFER_APPEND_IMPL_INT(uint32); -YUNI_PRIVATE_MEMORY_BUFFER_APPEND_IMPL_INT(uint64); +YUNI_PRIVATE_MEMORY_BUFFER_APPEND_IMPL_INT(int16_t); +YUNI_PRIVATE_MEMORY_BUFFER_APPEND_IMPL_INT(int32_t); +YUNI_PRIVATE_MEMORY_BUFFER_APPEND_IMPL_INT(int64_t); +YUNI_PRIVATE_MEMORY_BUFFER_APPEND_IMPL_INT(uint16_t); +YUNI_PRIVATE_MEMORY_BUFFER_APPEND_IMPL_INT(uint32_t); +YUNI_PRIVATE_MEMORY_BUFFER_APPEND_IMPL_INT(uint64_t); #ifdef YUNI_HAS_LONG YUNI_PRIVATE_MEMORY_BUFFER_APPEND_IMPL_INT(long); YUNI_PRIVATE_MEMORY_BUFFER_APPEND_IMPL_INT(unsigned long); diff --git a/src/ext/yuni/src/yuni/core/string/traits/into.h b/src/ext/yuni/src/yuni/core/string/traits/into.h index 8d1574efb0..9572f31bed 100644 --- a/src/ext/yuni/src/yuni/core/string/traits/into.h +++ b/src/ext/yuni/src/yuni/core/string/traits/into.h @@ -369,20 +369,20 @@ class AutoDetectBaseNumber final } \ } -YUNI_CORE_EXTENSION_ISTRING_TO_NUMERIC(sint16, strtol); -YUNI_CORE_EXTENSION_ISTRING_TO_NUMERIC(sint32, strtol); +YUNI_CORE_EXTENSION_ISTRING_TO_NUMERIC(int16_t, strtol); +YUNI_CORE_EXTENSION_ISTRING_TO_NUMERIC(int32_t, strtol); #ifdef YUNI_OS_MSVC -YUNI_CORE_EXTENSION_ISTRING_TO_NUMERIC(sint64, _strtoi64); +YUNI_CORE_EXTENSION_ISTRING_TO_NUMERIC(int64_t, _strtoi64); #else -YUNI_CORE_EXTENSION_ISTRING_TO_NUMERIC(sint64, strtoll); +YUNI_CORE_EXTENSION_ISTRING_TO_NUMERIC(int64_t, strtoll); #endif -YUNI_CORE_EXTENSION_ISTRING_TO_NUMERIC(uint16, strtoul); -YUNI_CORE_EXTENSION_ISTRING_TO_NUMERIC(uint32, strtoul); +YUNI_CORE_EXTENSION_ISTRING_TO_NUMERIC(uint16_t, strtoul); +YUNI_CORE_EXTENSION_ISTRING_TO_NUMERIC(uint32_t, strtoul); #ifdef YUNI_OS_MSVC -YUNI_CORE_EXTENSION_ISTRING_TO_NUMERIC(uint64, _strtoui64); +YUNI_CORE_EXTENSION_ISTRING_TO_NUMERIC(uint64_t, _strtoui64); #else -YUNI_CORE_EXTENSION_ISTRING_TO_NUMERIC(uint64, strtoull); +YUNI_CORE_EXTENSION_ISTRING_TO_NUMERIC(uint64_t, strtoull); #endif #ifdef YUNI_HAS_LONG @@ -575,8 +575,8 @@ class Into final template static bool Perform(const StringT& s, const void*& out) { - Static::If::Type p; - if (Into::Perform(s, p)) + Static::If::Type p; + if (Into::Perform(s, p)) { out = reinterpret_cast(p); return true; @@ -588,8 +588,8 @@ class Into final template static void* Perform(const StringT& s) { - return reinterpret_cast((sizeof(void*) == 4) ? Into::Perform(s) - : Into::Perform(s)); + return reinterpret_cast((sizeof(void*) == 4) ? Into::Perform(s) + : Into::Perform(s)); } }; diff --git a/src/ext/yuni/src/yuni/core/string/utf8char.h b/src/ext/yuni/src/yuni/core/string/utf8char.h index 33fe63d588..d88471415a 100644 --- a/src/ext/yuni/src/yuni/core/string/utf8char.h +++ b/src/ext/yuni/src/yuni/core/string/utf8char.h @@ -68,7 +68,7 @@ class YUNI_DECL Char final enum { //! The maximum valid code point - codePointMax = static_cast(0x0010ffffu), + codePointMax = static_cast(0x0010ffffu), //! Ascii maximum value asciiLimit = 0x80, }; @@ -89,7 +89,7 @@ class YUNI_DECL Char final */ uint size() const; - uint32 value() const; + uint32_t value() const; template void write(StreamT& out) const; @@ -133,7 +133,7 @@ class YUNI_DECL Char final private: //! The UTF-8 character - uint32 pValue; + uint32_t pValue; // A friend ! template friend class Yuni::CString; diff --git a/src/ext/yuni/src/yuni/core/string/utf8char.hxx b/src/ext/yuni/src/yuni/core/string/utf8char.hxx index b95bd0902a..befa1efbde 100644 --- a/src/ext/yuni/src/yuni/core/string/utf8char.hxx +++ b/src/ext/yuni/src/yuni/core/string/utf8char.hxx @@ -27,7 +27,7 @@ inline Char::Char(uint c) : pValue(c) { } -inline uint32 Char::value() const +inline uint32_t Char::value() const { return pValue; } @@ -45,7 +45,7 @@ inline Char& Char::operator=(const Char& rhs) inline Char& Char::operator=(uint value) { - pValue = static_cast(value); + pValue = static_cast(value); return *this; } diff --git a/src/ext/yuni/src/yuni/core/system/environment.cpp b/src/ext/yuni/src/yuni/core/system/environment.cpp index 3a5bdfd83a..8f278e971e 100644 --- a/src/ext/yuni/src/yuni/core/system/environment.cpp +++ b/src/ext/yuni/src/yuni/core/system/environment.cpp @@ -112,21 +112,21 @@ bool ReadAsBool(const AnyString& name) return false; } -yint64 ReadAsInt64(const AnyString& name, yint64 defvalue) +int64_t ReadAsInt64(const AnyString& name, int64_t defvalue) { #ifdef YUNI_OS_WINDOWS { String out; ReadImpl(name, out, false); if (not out.empty()) - return out.to(); + return out.to(); } #else { #ifdef YUNI_HAS_STDLIB_H AnyString value = ::getenv(name.c_str()); if (not value.empty()) - return value.to(); + return value.to(); #else #error not implemented #endif diff --git a/src/ext/yuni/src/yuni/core/system/environment.h b/src/ext/yuni/src/yuni/core/system/environment.h index 53c3d033a3..b9b390c449 100644 --- a/src/ext/yuni/src/yuni/core/system/environment.h +++ b/src/ext/yuni/src/yuni/core/system/environment.h @@ -32,7 +32,7 @@ YUNI_DECL bool ReadAsBool(const AnyString& name); ** \param name Name of the variable ** \param defvalue The default value to take if the value of the variable is empty */ -YUNI_DECL yint64 ReadAsInt64(const AnyString& name, yint64 defvalue = 0); +YUNI_DECL int64_t ReadAsInt64(const AnyString& name, int64_t defvalue = 0); /*! ** \brief Get a value from the current environment diff --git a/src/ext/yuni/src/yuni/core/system/gettimeofday.cpp b/src/ext/yuni/src/yuni/core/system/gettimeofday.cpp index 928ad0d51c..a8d3ec2aee 100644 --- a/src/ext/yuni/src/yuni/core/system/gettimeofday.cpp +++ b/src/ext/yuni/src/yuni/core/system/gettimeofday.cpp @@ -23,8 +23,8 @@ int gettimeofday(struct timeval* tv, struct timezone* tz) { struct _timeb timebuffer; _ftime64_s(&timebuffer); - tv->tv_sec = (sint64)(timebuffer.time); - tv->tv_usec = (sint64)(timebuffer.millitm * 1000); + tv->tv_sec = (int64_t)(timebuffer.time); + tv->tv_usec = (int64_t)(timebuffer.millitm * 1000); } if (NULL != tz) diff --git a/src/ext/yuni/src/yuni/core/system/gettimeofday.h b/src/ext/yuni/src/yuni/core/system/gettimeofday.h index 369f2fc623..963f9bce66 100644 --- a/src/ext/yuni/src/yuni/core/system/gettimeofday.h +++ b/src/ext/yuni/src/yuni/core/system/gettimeofday.h @@ -45,8 +45,8 @@ struct timezone struct timeval { - sint64 tv_sec; - sint64 tv_usec; + int64_t tv_sec; + int64_t tv_usec; }; YUNI_DECL int gettimeofday(struct timeval* tv, struct timezone* tz); diff --git a/src/ext/yuni/src/yuni/core/system/memory.cpp b/src/ext/yuni/src/yuni/core/system/memory.cpp index e4937ace5c..a872a46b02 100644 --- a/src/ext/yuni/src/yuni/core/system/memory.cpp +++ b/src/ext/yuni/src/yuni/core/system/memory.cpp @@ -53,20 +53,20 @@ enum #ifdef YUNI_OS_WINDOWS #define SYSTEM_MEMORY_IS_IMPLEMENTED -uint64 Total() +uint64_t Total() { // see http://msdn.microsoft.com/en-us/library/aa366589(VS.85).aspx MEMORYSTATUSEX statex; statex.dwLength = (DWORD)sizeof(statex); - return (GlobalMemoryStatusEx(&statex)) ? (uint64)statex.ullTotalPhys : (uint64)defaultTotal; + return (GlobalMemoryStatusEx(&statex)) ? (uint64_t)statex.ullTotalPhys : (uint64_t)defaultTotal; } -uint64 Available() +uint64_t Available() { // see http://msdn.microsoft.com/en-us/library/aa366589(VS.85).aspx MEMORYSTATUSEX statex; statex.dwLength = (DWORD)sizeof(statex); - return (GlobalMemoryStatusEx(&statex)) ? (uint64)statex.ullAvailPhys : (uint64)defaultAvailable; + return (GlobalMemoryStatusEx(&statex)) ? (uint64_t)statex.ullAvailPhys : (uint64_t)defaultAvailable; } bool Usage::update() @@ -77,8 +77,8 @@ bool Usage::update() if (GlobalMemoryStatusEx(&statex)) { - total = (uint64)statex.ullTotalPhys; - available = (uint64)statex.ullAvailPhys; + total = (uint64_t)statex.ullTotalPhys; + available = (uint64_t)statex.ullAvailPhys; return true; } available = defaultAvailable; @@ -115,7 +115,7 @@ static inline int fgetline(FILE* fp, char* s, int maxlen) return (!i) ? EOF : i; } -static inline uint64 readvalue(char* line) +static inline uint64_t readvalue(char* line) { // Here is a sample for /proc/meminfo : // @@ -162,9 +162,9 @@ static inline uint64 readvalue(char* line) *line = '\0'; #ifdef YUNI_OS_32 - return (uint64)atol(first) * 1024u; + return (uint64_t)atol(first) * 1024u; #else - return (uint64)atoll(first) * 1024u; + return (uint64_t)atoll(first) * 1024u; #endif } @@ -226,30 +226,30 @@ bool Usage::update() // Checking the amount of the total physical memory, which can not be equal to 0 if (!total) { - total = (uint64)defaultTotal; + total = (uint64_t)defaultTotal; return false; } return true; } // Error, using default values - total = (uint64)defaultTotal; - available = (uint64)defaultAvailable; + total = (uint64_t)defaultTotal; + available = (uint64_t)defaultAvailable; return false; } -uint64 Available() +uint64_t Available() { return Usage().available; } -uint64 Total() +uint64_t Total() { #ifdef YUNI_OS_LINUX { // Directly using sysinfo (2), which should be faster than parsing /proc/meminfo struct sysinfo s; - return (!sysinfo(&s)) ? (s.mem_unit * s.totalram) : (uint64)defaultTotal; + return (!sysinfo(&s)) ? (s.mem_unit * s.totalram) : (uint64_t)defaultTotal; } #else { @@ -263,15 +263,15 @@ uint64 Total() #ifdef YUNI_OS_MAC #define SYSTEM_MEMORY_IS_IMPLEMENTED -uint64 Total() +uint64_t Total() { int mib[2] = {CTL_HW, HW_MEMSIZE}; - uint64 memory; - size_t len = sizeof(uint64); - return (!sysctl(mib, 2, &memory, &len, NULL, 0)) ? memory : (uint64)defaultTotal; + uint64_t memory; + size_t len = sizeof(uint64_t); + return (!sysctl(mib, 2, &memory, &len, NULL, 0)) ? memory : (uint64_t)defaultTotal; } -uint64 Available() +uint64_t Available() { // Good readings :) // http://www.booktou.com/node/148/0321278542/ch06lev1sec3.html @@ -286,7 +286,7 @@ uint64 Available() vm_size_t page_size; host_page_size(host, &page_size); - return (uint64)(vm_stat.free_count) * (uint64)page_size; + return (uint64_t)(vm_stat.free_count) * (uint64_t)page_size; } bool Usage::update() @@ -296,14 +296,14 @@ bool Usage::update() // Total int mib[2] = {CTL_HW, HW_MEMSIZE}; - size_t len = sizeof(uint64); + size_t len = sizeof(uint64_t); size_t sttotal; if (sysctl(mib, 2, &sttotal, &len, NULL, 0)) { - total = (uint64)defaultTotal; + total = (uint64_t)defaultTotal; return false; } - total = (uint64)sttotal; + total = (uint64_t)sttotal; return true; } @@ -312,12 +312,12 @@ bool Usage::update() #ifndef SYSTEM_MEMORY_IS_IMPLEMENTED #warning Yuni::System::Memory: The implementation is missing for this operating system -uint64 Total() +uint64_t Total() { return defaultTotal; } -uint64 Available() +uint64_t Available() { return defaultAvailable; } diff --git a/src/ext/yuni/src/yuni/core/system/memory.h b/src/ext/yuni/src/yuni/core/system/memory.h index 7f457969d7..b563ee12a6 100644 --- a/src/ext/yuni/src/yuni/core/system/memory.h +++ b/src/ext/yuni/src/yuni/core/system/memory.h @@ -24,7 +24,7 @@ namespace Memory ** value will be used. (see defaultAvailable) ** \return A value in bytes */ -YUNI_DECL uint64 Total(); +YUNI_DECL uint64_t Total(); /*! ** \brief Get the amount of available physical memory @@ -33,7 +33,7 @@ YUNI_DECL uint64 Total(); ** value will be used. (see defaultAvailable) ** \return A value in bytes */ -YUNI_DECL uint64 Available(); +YUNI_DECL uint64_t Available(); /*! ** \brief Information about the current memory usage @@ -73,9 +73,9 @@ YUNI_DECL class Usage final public: //! The amount of the available physical memory (in bytes) - uint64 available; + uint64_t available; //! The amount of the total physical memory (in bytes) - uint64 total; + uint64_t total; }; // class Usage diff --git a/src/ext/yuni/src/yuni/core/system/process.cpp b/src/ext/yuni/src/yuni/core/system/process.cpp index ce2cee86cf..f7f997c022 100644 --- a/src/ext/yuni/src/yuni/core/system/process.cpp +++ b/src/ext/yuni/src/yuni/core/system/process.cpp @@ -20,12 +20,12 @@ namespace Yuni { -uint64 ProcessID() +uint64_t ProcessID() { #if defined(YUNI_OS_WINDOWS) - return (uint64)GetCurrentProcessId(); + return (uint64_t)GetCurrentProcessId(); #else - return (uint64)getpid(); + return (uint64_t)getpid(); #endif } diff --git a/src/ext/yuni/src/yuni/core/system/process.h b/src/ext/yuni/src/yuni/core/system/process.h index 7942372217..9cabe73c06 100644 --- a/src/ext/yuni/src/yuni/core/system/process.h +++ b/src/ext/yuni/src/yuni/core/system/process.h @@ -16,6 +16,6 @@ namespace Yuni /*! ** \brief Get the current process ID */ -YUNI_DECL uint64 ProcessID(); +YUNI_DECL uint64_t ProcessID(); } // namespace Yuni diff --git a/src/ext/yuni/src/yuni/core/system/stdint.h b/src/ext/yuni/src/yuni/core/system/stdint.h index 10b28193c2..74d804c94b 100644 --- a/src/ext/yuni/src/yuni/core/system/stdint.h +++ b/src/ext/yuni/src/yuni/core/system/stdint.h @@ -16,16 +16,7 @@ ** \brief Standard types used by the Yuni Library */ -#ifdef YUNI_HAS_STDINT_H #include -#else -#ifdef YUNI_OS_MSVC -#include "windows/msinttypes/stdint.h" -#include "windows/msinttypes/inttypes.h" -#else -#error "stdint.h is missing for this platform" -#endif -#endif #ifdef YUNI_OS_MSVC #define YUNI_MSVC_SECURE_VSPRINTF @@ -43,25 +34,18 @@ namespace Yuni { -/* \todo Fix support for int128 on Visual Studio 10 */ -#if defined(YUNI_HAS_INT128_T) && !defined(__DISABLED_SUPPORT_FOR_INT128) -/* 128-bit unsigned int */ -typedef unsigned __int128 uint128; -typedef __int128 sint128; -#endif - /*! 64-bit unsigned int, guaranteed to be 8 bytes in size */ -typedef uint64_t uint64; +typedef uint64_t uint64_t; /*! 64-bit unsigned int, guaranteed to be 8 bytes in size */ -typedef int64_t sint64; +typedef int64_t int64_t; /*! 32-bit unsigned int, guaranteed to be 4 bytes in size */ -typedef uint32_t uint32; +typedef uint32_t uint32_t; /*! 32-bit unsigned int, guaranteed to be 4 bytes in size */ -typedef int32_t sint32; +typedef int32_t int32_t; /*! 16-bit unsigned int, guaranteed to be 2 bytes in size */ typedef uint16_t uint16; /*! 16-bit unsigned int, guaranteed to be 2 bytes in size */ -typedef int16_t sint16; +typedef int16_t int16_t; /*! 8-bit unsigned int, guaranteed to be 1 byte in size */ typedef unsigned char uint8; /*! 8-bit unsigned int, guaranteed to be 1 byte in size */ @@ -74,11 +58,11 @@ typedef unsigned char uchar; ** \brief Constant int64 value to indicate that the size must be autodetected by the location ** of the terminating null character */ -static const uint64 AutoDetectNullChar = static_cast(-1); +static const uint64_t AutoDetectNullChar = static_cast(-1); #ifndef YUNI_HAS_SSIZE_T /*! ssize_t */ -typedef Yuni::sint64 ssize_t; +typedef int64_t ssize_t; #endif /*! Decimal floating-point (32 bits) */ @@ -96,30 +80,7 @@ typedef double float64; /* C types */ -/* \todo Fix support for int128 on Visual Studio 10 */ -#if defined(YUNI_HAS_INT128_T) && !defined(__DISABLED_SUPPORT_FOR_INT128) -/*! 128-bit unsigned int */ -typedef unsigned __int128 yuint128; -typedef __int128 yint128; -#endif - -/*! 64-bit unsigned int, guaranteed to be 8 bytes in size */ -typedef uint64_t yuint64; -/*! 64-bit unsigned int, guaranteed to be 8 bytes in size */ -typedef int64_t yint64; -/*! 32-bit unsigned int, guaranteed to be 4 bytes in size */ -typedef uint32_t yuint32; -/*! 32-bit unsigned int, guaranteed to be 4 bytes in size */ -typedef int32_t yint32; -/*! 16-bit unsigned int, guaranteed to be 2 bytes in size */ -typedef uint16_t yuint16; -/*! 16-bit unsigned int, guaranteed to be 2 bytes in size */ -typedef int16_t yint16; -/*! 8-bit unsigned int, guaranteed to be 1 byte in size */ -typedef unsigned char yuint8; -/*! 8-bit unsigned int, guaranteed to be 1 byte in size */ -typedef char yint8; - +// TODO REMOVE THIS GARBAGE /*! Decimal floating-point (32 bits) */ typedef float yfloat32; /*! Decimal floating-point (32 bits) */ diff --git a/src/ext/yuni/src/yuni/core/system/windows.hdr.h b/src/ext/yuni/src/yuni/core/system/windows.hdr.h index 93cb43d43d..e1131cbee6 100644 --- a/src/ext/yuni/src/yuni/core/system/windows.hdr.h +++ b/src/ext/yuni/src/yuni/core/system/windows.hdr.h @@ -49,7 +49,7 @@ namespace Yuni { namespace Windows { -inline yint64 FILETIMEToTimestamp(const FILETIME& filetime) +inline int64_t FILETIMEToTimestamp(const FILETIME& filetime) { LARGE_INTEGER date, adjust; date.HighPart = filetime.dwHighDateTime; diff --git a/src/ext/yuni/src/yuni/core/system/windows/msinttypes/changelog.txt b/src/ext/yuni/src/yuni/core/system/windows/msinttypes/changelog.txt deleted file mode 100644 index cf0539c253..0000000000 --- a/src/ext/yuni/src/yuni/core/system/windows/msinttypes/changelog.txt +++ /dev/null @@ -1,138 +0,0 @@ ------------------------------------------------------------------------- -r26 | 2009-10-02 13:36:47 +0400 | 2 lines - -[Issue 5] Change to "stdint.h" to let compiler search for it in local directory. - ------------------------------------------------------------------------- -r25 | 2009-09-17 23:46:49 +0400 | 2 lines - -[Issue 4] Fix incorrect int8_t behaviour if compiled with /J flag. - ------------------------------------------------------------------------- -r24 | 2009-05-13 14:53:48 +0400 | 2 lines - -Forgot about #ifdef __cplusplus guard around 'extern "C"', so inclusion to C files has been broken. - ------------------------------------------------------------------------- -r23 | 2009-05-12 01:27:45 +0400 | 3 lines - -[Issue 2] Always wrap is included. - ------------------------------------------------------------------------- -r19 | 2007-07-04 02:14:40 +0400 | 3 lines - -Explicitly cast to appropriate type INT8_MIN, INT16_MIN, INT32_MIN and INT64_MIN constants. -Due to their unusual definition in Visual Studio headers (-_Ix_MAX-1) they are propagated to int and thus do not have expected type, causing VS6 strict compiler to claim about type inconsistency. - ------------------------------------------------------------------------- -r18 | 2007-06-26 16:53:23 +0400 | 2 lines - -Better handling of (U)INTx_C macros - now they generate constants of exact width. - ------------------------------------------------------------------------- -r17 | 2007-03-29 20:16:14 +0400 | 2 lines - -Fix typo: Miscrosoft -> Microsoft. - ------------------------------------------------------------------------- -r16 | 2007-02-24 17:32:58 +0300 | 4 lines - -Remove include, as it is not present in Visual Studio 2005 Epxress Edition and required only for INT_PTR and UINT_PTR types. - -'intptr_t' and 'uintptr_t' types now defined explicitly with #ifdef _WIN64. - ------------------------------------------------------------------------- -r15 | 2007-02-11 20:53:05 +0300 | 2 lines - -More correct fix for compilation under VS6. - ------------------------------------------------------------------------- -r14 | 2007-02-11 20:04:32 +0300 | 2 lines - -Bugfix: fix compiling under VS6, when stdint.h enclosed in 'extern "C" {}'. - ------------------------------------------------------------------------- -r13 | 2006-12-13 16:53:11 +0300 | 2 lines - -Make _inline modifier for imaxdiv default option. Use STATIC_IMAXDIV to make it static. - ------------------------------------------------------------------------- -r12 | 2006-12-13 16:42:24 +0300 | 2 lines - -Error message changed: VC6 supported from now. - ------------------------------------------------------------------------- -r11 | 2006-12-13 16:39:33 +0300 | 2 lines - -All (U)INT* types changed to (unsigned) __int*. This should make stdint.h compatible with VC6. - ------------------------------------------------------------------------- -r10 | 2006-12-13 16:20:57 +0300 | 3 lines - -Added INLINE_IMAXDIV define switch. -If INLINE_IMAXDIV is defined imaxdiv() have static modifier. If not - it is _inline. - ------------------------------------------------------------------------- -r9 | 2006-12-13 15:53:52 +0300 | 2 lines - -Error message for non-MSC compiler changed. - ------------------------------------------------------------------------- -r8 | 2006-12-13 12:47:48 +0300 | 2 lines - -Added #ifndef for SIZE_MAX (it is defined in limits.h on MSVSC 8). - ------------------------------------------------------------------------- -r7 | 2006-12-13 01:08:02 +0300 | 2 lines - -License chaged to BSD-derivative. - ------------------------------------------------------------------------- -r6 | 2006-12-13 00:53:20 +0300 | 2 lines - -Added include to avoid warnings when it is included after stdint.h. - ------------------------------------------------------------------------- -r5 | 2006-12-12 00:58:05 +0300 | 2 lines - -BUGFIX: Definitions of INTPTR_MIN, INTPTR_MAX and UINTPTR_MAX for WIN32 and WIN64 was mixed up. - ------------------------------------------------------------------------- -r4 | 2006-12-12 00:51:55 +0300 | 2 lines - -Rise #error if _MSC_VER is not defined. I.e. compiler other then Microsoft Visual C++ is used. - ------------------------------------------------------------------------- -r3 | 2006-12-11 22:54:14 +0300 | 2 lines - -Added include to stdint.h. - ------------------------------------------------------------------------- -r2 | 2006-12-11 21:39:27 +0300 | 2 lines - -Initial check in. - ------------------------------------------------------------------------- -r1 | 2006-12-11 21:30:23 +0300 | 1 line - -Initial directory structure. ------------------------------------------------------------------------- diff --git a/src/ext/yuni/src/yuni/core/system/windows/msinttypes/inttypes.h b/src/ext/yuni/src/yuni/core/system/windows/msinttypes/inttypes.h deleted file mode 100644 index a4b1c191c3..0000000000 --- a/src/ext/yuni/src/yuni/core/system/windows/msinttypes/inttypes.h +++ /dev/null @@ -1,306 +0,0 @@ -// ISO C9x compliant inttypes.h for Microsoft Visual Studio -// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 -// -// Copyright (c) 2006 Alexander Chemeris -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. The name of the author may be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED -// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _MSC_VER // [ -#error "Use this header only with Microsoft Visual C++ compilers!" -#endif // _MSC_VER ] - -#ifndef _MSC_INTTYPES_H_ // [ -#define _MSC_INTTYPES_H_ - -#if _MSC_VER > 1000 -#pragma once -#endif - -#include "stdint.h" - -// 7.8 Format conversion of integer types - -typedef struct -{ - intmax_t quot; - intmax_t rem; -} imaxdiv_t; - -// 7.8.1 Macros for format specifiers - -#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) // [ See footnote 185 at page 198 - -// The fprintf macros for signed integers are: -#define PRId8 "d" -#define PRIi8 "i" -#define PRIdLEAST8 "d" -#define PRIiLEAST8 "i" -#define PRIdFAST8 "d" -#define PRIiFAST8 "i" - -#define PRId16 "hd" -#define PRIi16 "hi" -#define PRIdLEAST16 "hd" -#define PRIiLEAST16 "hi" -#define PRIdFAST16 "hd" -#define PRIiFAST16 "hi" - -#define PRId32 "I32d" -#define PRIi32 "I32i" -#define PRIdLEAST32 "I32d" -#define PRIiLEAST32 "I32i" -#define PRIdFAST32 "I32d" -#define PRIiFAST32 "I32i" - -#define PRId64 "I64d" -#define PRIi64 "I64i" -#define PRIdLEAST64 "I64d" -#define PRIiLEAST64 "I64i" -#define PRIdFAST64 "I64d" -#define PRIiFAST64 "I64i" - -#define PRIdMAX "I64d" -#define PRIiMAX "I64i" - -#define PRIdPTR "Id" -#define PRIiPTR "Ii" - -// The fprintf macros for unsigned integers are: -#define PRIo8 "o" -#define PRIu8 "u" -#define PRIx8 "x" -#define PRIX8 "X" -#define PRIoLEAST8 "o" -#define PRIuLEAST8 "u" -#define PRIxLEAST8 "x" -#define PRIXLEAST8 "X" -#define PRIoFAST8 "o" -#define PRIuFAST8 "u" -#define PRIxFAST8 "x" -#define PRIXFAST8 "X" - -#define PRIo16 "ho" -#define PRIu16 "hu" -#define PRIx16 "hx" -#define PRIX16 "hX" -#define PRIoLEAST16 "ho" -#define PRIuLEAST16 "hu" -#define PRIxLEAST16 "hx" -#define PRIXLEAST16 "hX" -#define PRIoFAST16 "ho" -#define PRIuFAST16 "hu" -#define PRIxFAST16 "hx" -#define PRIXFAST16 "hX" - -#define PRIo32 "I32o" -#define PRIu32 "I32u" -#define PRIx32 "I32x" -#define PRIX32 "I32X" -#define PRIoLEAST32 "I32o" -#define PRIuLEAST32 "I32u" -#define PRIxLEAST32 "I32x" -#define PRIXLEAST32 "I32X" -#define PRIoFAST32 "I32o" -#define PRIuFAST32 "I32u" -#define PRIxFAST32 "I32x" -#define PRIXFAST32 "I32X" - -#define PRIo64 "I64o" -#define PRIu64 "I64u" -#define PRIx64 "I64x" -#define PRIX64 "I64X" -#define PRIoLEAST64 "I64o" -#define PRIuLEAST64 "I64u" -#define PRIxLEAST64 "I64x" -#define PRIXLEAST64 "I64X" -#define PRIoFAST64 "I64o" -#define PRIuFAST64 "I64u" -#define PRIxFAST64 "I64x" -#define PRIXFAST64 "I64X" - -#define PRIoMAX "I64o" -#define PRIuMAX "I64u" -#define PRIxMAX "I64x" -#define PRIXMAX "I64X" - -#define PRIoPTR "Io" -#define PRIuPTR "Iu" -#define PRIxPTR "Ix" -#define PRIXPTR "IX" - -// The fscanf macros for signed integers are: -#define SCNd8 "d" -#define SCNi8 "i" -#define SCNdLEAST8 "d" -#define SCNiLEAST8 "i" -#define SCNdFAST8 "d" -#define SCNiFAST8 "i" - -#define SCNd16 "hd" -#define SCNi16 "hi" -#define SCNdLEAST16 "hd" -#define SCNiLEAST16 "hi" -#define SCNdFAST16 "hd" -#define SCNiFAST16 "hi" - -#define SCNd32 "ld" -#define SCNi32 "li" -#define SCNdLEAST32 "ld" -#define SCNiLEAST32 "li" -#define SCNdFAST32 "ld" -#define SCNiFAST32 "li" - -#define SCNd64 "I64d" -#define SCNi64 "I64i" -#define SCNdLEAST64 "I64d" -#define SCNiLEAST64 "I64i" -#define SCNdFAST64 "I64d" -#define SCNiFAST64 "I64i" - -#define SCNdMAX "I64d" -#define SCNiMAX "I64i" - -#ifdef _WIN64 // [ -#define SCNdPTR "I64d" -#define SCNiPTR "I64i" -#else // _WIN64 ][ -#define SCNdPTR "ld" -#define SCNiPTR "li" -#endif // _WIN64 ] - -// The fscanf macros for unsigned integers are: -#define SCNo8 "o" -#define SCNu8 "u" -#define SCNx8 "x" -#define SCNX8 "X" -#define SCNoLEAST8 "o" -#define SCNuLEAST8 "u" -#define SCNxLEAST8 "x" -#define SCNXLEAST8 "X" -#define SCNoFAST8 "o" -#define SCNuFAST8 "u" -#define SCNxFAST8 "x" -#define SCNXFAST8 "X" - -#define SCNo16 "ho" -#define SCNu16 "hu" -#define SCNx16 "hx" -#define SCNX16 "hX" -#define SCNoLEAST16 "ho" -#define SCNuLEAST16 "hu" -#define SCNxLEAST16 "hx" -#define SCNXLEAST16 "hX" -#define SCNoFAST16 "ho" -#define SCNuFAST16 "hu" -#define SCNxFAST16 "hx" -#define SCNXFAST16 "hX" - -#define SCNo32 "lo" -#define SCNu32 "lu" -#define SCNx32 "lx" -#define SCNX32 "lX" -#define SCNoLEAST32 "lo" -#define SCNuLEAST32 "lu" -#define SCNxLEAST32 "lx" -#define SCNXLEAST32 "lX" -#define SCNoFAST32 "lo" -#define SCNuFAST32 "lu" -#define SCNxFAST32 "lx" -#define SCNXFAST32 "lX" - -#define SCNo64 "I64o" -#define SCNu64 "I64u" -#define SCNx64 "I64x" -#define SCNX64 "I64X" -#define SCNoLEAST64 "I64o" -#define SCNuLEAST64 "I64u" -#define SCNxLEAST64 "I64x" -#define SCNXLEAST64 "I64X" -#define SCNoFAST64 "I64o" -#define SCNuFAST64 "I64u" -#define SCNxFAST64 "I64x" -#define SCNXFAST64 "I64X" - -#define SCNoMAX "I64o" -#define SCNuMAX "I64u" -#define SCNxMAX "I64x" -#define SCNXMAX "I64X" - -#ifdef _WIN64 // [ -#define SCNoPTR "I64o" -#define SCNuPTR "I64u" -#define SCNxPTR "I64x" -#define SCNXPTR "I64X" -#else // _WIN64 ][ -#define SCNoPTR "lo" -#define SCNuPTR "lu" -#define SCNxPTR "lx" -#define SCNXPTR "lX" -#endif // _WIN64 ] - -#endif // __STDC_FORMAT_MACROS ] - -// 7.8.2 Functions for greatest-width integer types - -// 7.8.2.1 The imaxabs function -#define imaxabs _abs64 - -// 7.8.2.2 The imaxdiv function - -// This is modified version of div() function from Microsoft's div.c found -// in %MSVC.NET%\crt\src\div.c -#ifdef STATIC_IMAXDIV // [ -static -#else // STATIC_IMAXDIV ][ -_inline -#endif // STATIC_IMAXDIV ] - imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom) -{ - imaxdiv_t result; - - result.quot = numer / denom; - result.rem = numer % denom; - - if (numer < 0 && result.rem > 0) - { - // did division wrong; must fix up - ++result.quot; - result.rem -= denom; - } - - return result; -} - -// 7.8.2.3 The strtoimax and strtoumax functions -#define strtoimax _strtoi64 -#define strtoumax _strtoui64 - -// 7.8.2.4 The wcstoimax and wcstoumax functions -#define wcstoimax _wcstoi64 -#define wcstoumax _wcstoui64 - -#endif // _MSC_INTTYPES_H_ ] diff --git a/src/ext/yuni/src/yuni/core/system/windows/msinttypes/stdint.h b/src/ext/yuni/src/yuni/core/system/windows/msinttypes/stdint.h deleted file mode 100644 index 2dbab34d50..0000000000 --- a/src/ext/yuni/src/yuni/core/system/windows/msinttypes/stdint.h +++ /dev/null @@ -1,244 +0,0 @@ -// ISO C9x compliant stdint.h for Microsoft Visual Studio -// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 -// -// Copyright (c) 2006-2008 Alexander Chemeris -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. The name of the author may be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED -// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _MSC_VER // [ -#error "Use this header only with Microsoft Visual C++ compilers!" -#endif // _MSC_VER ] - -#ifndef _MSC_STDINT_H_ // [ -#define _MSC_STDINT_H_ - -#if _MSC_VER > 1000 -#pragma once -#endif - -#include - -// For Visual Studio 6 in C++ mode and for many Visual Studio versions when -// compiling for ARM we should wrap include with 'extern "C++" {}' -// or compiler give many errors like this: -// error C2733: second C linkage of overloaded function 'wmemchr' not allowed -#ifdef __cplusplus -extern "C" -{ -#endif -#include -#ifdef __cplusplus -} -#endif - -// Define _W64 macros to mark types changing their size, like intptr_t. -#ifndef _W64 -#if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 -#define _W64 __w64 -#else -#define _W64 -#endif -#endif - -// 7.18.1 Integer types - -// 7.18.1.1 Exact-width integer types - -// Visual Studio 6 and Embedded Visual C++ 4 doesn't -// realize that, e.g. char has the same size as __int8 -// so we give up on __intX for them. -#if (_MSC_VER < 1300) -typedef signed char int8_t; -typedef signed short int16_t; -typedef signed int int32_t; -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -#else -typedef signed __int8 int8_t; -typedef signed __int16 int16_t; -typedef signed __int32 int32_t; -typedef unsigned __int8 uint8_t; -typedef unsigned __int16 uint16_t; -typedef unsigned __int32 uint32_t; -#endif -typedef signed __int64 int64_t; -typedef unsigned __int64 uint64_t; - -// 7.18.1.2 Minimum-width integer types -typedef int8_t int_least8_t; -typedef int16_t int_least16_t; -typedef int32_t int_least32_t; -typedef int64_t int_least64_t; -typedef uint8_t uint_least8_t; -typedef uint16_t uint_least16_t; -typedef uint32_t uint_least32_t; -typedef uint64_t uint_least64_t; - -// 7.18.1.3 Fastest minimum-width integer types -typedef int8_t int_fast8_t; -typedef int16_t int_fast16_t; -typedef int32_t int_fast32_t; -typedef int64_t int_fast64_t; -typedef uint8_t uint_fast8_t; -typedef uint16_t uint_fast16_t; -typedef uint32_t uint_fast32_t; -typedef uint64_t uint_fast64_t; - -// 7.18.1.4 Integer types capable of holding object pointers -#ifdef _WIN64 // [ -typedef signed __int64 intptr_t; -typedef unsigned __int64 uintptr_t; -#else // _WIN64 ][ -typedef _W64 signed int intptr_t; -typedef _W64 unsigned int uintptr_t; -#endif // _WIN64 ] - -// 7.18.1.5 Greatest-width integer types -typedef int64_t intmax_t; -typedef uint64_t uintmax_t; - -// 7.18.2 Limits of specified-width integer types - -#if !defined(__cplusplus) \ - || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259 - -// 7.18.2.1 Limits of exact-width integer types -#define INT8_MIN ((int8_t)_I8_MIN) -#define INT8_MAX _I8_MAX -#define INT16_MIN ((int16_t)_I16_MIN) -#define INT16_MAX _I16_MAX -#define INT32_MIN ((int32_t)_I32_MIN) -#define INT32_MAX _I32_MAX -#define INT64_MIN ((int64_t)_I64_MIN) -#define INT64_MAX _I64_MAX -#define UINT8_MAX _UI8_MAX -#define UINT16_MAX _UI16_MAX -#define UINT32_MAX _UI32_MAX -#define UINT64_MAX _UI64_MAX - -// 7.18.2.2 Limits of minimum-width integer types -#define INT_LEAST8_MIN INT8_MIN -#define INT_LEAST8_MAX INT8_MAX -#define INT_LEAST16_MIN INT16_MIN -#define INT_LEAST16_MAX INT16_MAX -#define INT_LEAST32_MIN INT32_MIN -#define INT_LEAST32_MAX INT32_MAX -#define INT_LEAST64_MIN INT64_MIN -#define INT_LEAST64_MAX INT64_MAX -#define UINT_LEAST8_MAX UINT8_MAX -#define UINT_LEAST16_MAX UINT16_MAX -#define UINT_LEAST32_MAX UINT32_MAX -#define UINT_LEAST64_MAX UINT64_MAX - -// 7.18.2.3 Limits of fastest minimum-width integer types -#define INT_FAST8_MIN INT8_MIN -#define INT_FAST8_MAX INT8_MAX -#define INT_FAST16_MIN INT16_MIN -#define INT_FAST16_MAX INT16_MAX -#define INT_FAST32_MIN INT32_MIN -#define INT_FAST32_MAX INT32_MAX -#define INT_FAST64_MIN INT64_MIN -#define INT_FAST64_MAX INT64_MAX -#define UINT_FAST8_MAX UINT8_MAX -#define UINT_FAST16_MAX UINT16_MAX -#define UINT_FAST32_MAX UINT32_MAX -#define UINT_FAST64_MAX UINT64_MAX - -// 7.18.2.4 Limits of integer types capable of holding object pointers -#ifdef _WIN64 // [ -#define INTPTR_MIN INT64_MIN -#define INTPTR_MAX INT64_MAX -#define UINTPTR_MAX UINT64_MAX -#else // _WIN64 ][ -#define INTPTR_MIN INT32_MIN -#define INTPTR_MAX INT32_MAX -#define UINTPTR_MAX UINT32_MAX -#endif // _WIN64 ] - -// 7.18.2.5 Limits of greatest-width integer types -#define INTMAX_MIN INT64_MIN -#define INTMAX_MAX INT64_MAX -#define UINTMAX_MAX UINT64_MAX - -// 7.18.3 Limits of other integer types - -#ifdef _WIN64 // [ -#define PTRDIFF_MIN _I64_MIN -#define PTRDIFF_MAX _I64_MAX -#else // _WIN64 ][ -#define PTRDIFF_MIN _I32_MIN -#define PTRDIFF_MAX _I32_MAX -#endif // _WIN64 ] - -#define SIG_ATOMIC_MIN INT_MIN -#define SIG_ATOMIC_MAX INT_MAX - -#ifndef SIZE_MAX // [ -#ifdef _WIN64 // [ -#define SIZE_MAX _UI64_MAX -#else // _WIN64 ][ -#define SIZE_MAX _UI32_MAX -#endif // _WIN64 ] -#endif // SIZE_MAX ] - -// WCHAR_MIN and WCHAR_MAX are also defined in -#ifndef WCHAR_MIN // [ -#define WCHAR_MIN 0 -#endif // WCHAR_MIN ] -#ifndef WCHAR_MAX // [ -#define WCHAR_MAX _UI16_MAX -#endif // WCHAR_MAX ] - -#define WINT_MIN 0 -#define WINT_MAX _UI16_MAX - -#endif // __STDC_LIMIT_MACROS ] - -// 7.18.4 Limits of other integer types - -#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260 - -// 7.18.4.1 Macros for minimum-width integer constants - -#define INT8_C(val) val##i8 -#define INT16_C(val) val##i16 -#define INT32_C(val) val##i32 -#define INT64_C(val) val##i64 - -#define UINT8_C(val) val##ui8 -#define UINT16_C(val) val##ui16 -#define UINT32_C(val) val##ui32 -#define UINT64_C(val) val##ui64 - -// 7.18.4.2 Macros for greatest-width integer constants -#define INTMAX_C INT64_C -#define UINTMAX_C UINT64_C - -#endif // __STDC_CONSTANT_MACROS ] - -#endif // _MSC_STDINT_H_ ] diff --git a/src/ext/yuni/src/yuni/core/tribool.h b/src/ext/yuni/src/yuni/core/tribool.h index d4bdb29af6..ac4660aa9a 100644 --- a/src/ext/yuni/src/yuni/core/tribool.h +++ b/src/ext/yuni/src/yuni/core/tribool.h @@ -90,8 +90,8 @@ class Tribool final // The second value is the default one union TriboolValue { - yint8 flags[2]; - yuint16 u16; + int8_t flags[2]; + uint16_t u16; } pValue; }; // class Tribool diff --git a/src/ext/yuni/src/yuni/core/tribool.hxx b/src/ext/yuni/src/yuni/core/tribool.hxx index c9bf8a40ea..a6d94f6ed2 100644 --- a/src/ext/yuni/src/yuni/core/tribool.hxx +++ b/src/ext/yuni/src/yuni/core/tribool.hxx @@ -54,7 +54,7 @@ inline bool Tribool::defaultValue() const inline void Tribool::defaultValue(bool defvalue) { - pValue.flags[1] = static_cast(defvalue); + pValue.flags[1] = static_cast(defvalue); } inline bool Tribool::toBool() const diff --git a/src/ext/yuni/src/yuni/core/unit/define.h b/src/ext/yuni/src/yuni/core/unit/define.h index a55b47d80d..c4b436d2e2 100644 --- a/src/ext/yuni/src/yuni/core/unit/define.h +++ b/src/ext/yuni/src/yuni/core/unit/define.h @@ -42,15 +42,15 @@ { \ } \ /*! Constructor from a fundamental value */ \ - CLASS(const sint16 u) : AbstractType(u) \ + CLASS(const int16_t u) : AbstractType(u) \ { \ } \ /*! Constructor from a fundamental value */ \ - CLASS(const sint32 u) : AbstractType(u) \ + CLASS(const int32_t u) : AbstractType(u) \ { \ } \ /*! Constructor from a fundamental value */ \ - CLASS(const sint64 u) : AbstractType(u) \ + CLASS(const int64_t u) : AbstractType(u) \ { \ } \ /*! Constructor from a fundamental value */ \ @@ -58,11 +58,11 @@ { \ } \ /*! Constructor from a fundamental value */ \ - CLASS(const uint32 u) : AbstractType(u) \ + CLASS(const uint32_t u) : AbstractType(u) \ { \ } \ /*! Constructor from a fundamental value */ \ - CLASS(const uint64 u) : AbstractType(u) \ + CLASS(const uint64_t u) : AbstractType(u) \ { \ } \ /*! Constructor from a fundamental value */ \ @@ -82,15 +82,15 @@ /*! \name Operator `=` */ \ /*@{*/ \ /*! Builtin types */ \ - AbstractType& operator=(const sint16 u) \ + AbstractType& operator=(const int16_t u) \ { \ return AbstractType::operator=(u); \ } \ - AbstractType& operator=(const sint32 u) \ + AbstractType& operator=(const int32_t u) \ { \ return AbstractType::operator=(u); \ } \ - AbstractType& operator=(const sint64 u) \ + AbstractType& operator=(const int64_t u) \ { \ return AbstractType::operator=(u); \ } \ @@ -98,11 +98,11 @@ { \ return AbstractType::operator=(u); \ } \ - AbstractType& operator=(const uint32 u) \ + AbstractType& operator=(const uint32_t u) \ { \ return AbstractType::operator=(u); \ } \ - AbstractType& operator=(const uint64 u) \ + AbstractType& operator=(const uint64_t u) \ { \ return AbstractType::operator=(u); \ } \ diff --git a/src/ext/yuni/src/yuni/core/unit/unit.h b/src/ext/yuni/src/yuni/core/unit/unit.h index 75866287ea..245ae554eb 100644 --- a/src/ext/yuni/src/yuni/core/unit/unit.h +++ b/src/ext/yuni/src/yuni/core/unit/unit.h @@ -156,17 +156,17 @@ class Abstract Abstract(); //! Constructor from a raw value - Abstract(sint16 u); + Abstract(int16_t u); //! Constructor from a raw value - Abstract(sint32 u); + Abstract(int32_t u); //! Constructor from a raw value - Abstract(sint64 u); + Abstract(int64_t u); //! Constructor from a raw value Abstract(uint16 u); //! Constructor from a raw value - Abstract(uint32 u); + Abstract(uint32_t u); //! Constructor from a raw value - Abstract(uint64 u); + Abstract(uint64_t u); //! Constructor from a raw value Abstract(float u); //! Constructor from a raw value @@ -237,12 +237,12 @@ class Abstract //! \name Opertor `=` //@{ // Builtin types - AbstractType& operator=(sint16 u); - AbstractType& operator=(sint32 u); - AbstractType& operator=(sint64 u); + AbstractType& operator=(int16_t u); + AbstractType& operator=(int32_t u); + AbstractType& operator=(int64_t u); AbstractType& operator=(uint16 u); - AbstractType& operator=(uint32 u); - AbstractType& operator=(uint64 u); + AbstractType& operator=(uint32_t u); + AbstractType& operator=(uint64_t u); AbstractType& operator=(float u); AbstractType& operator=(double u); AbstractType& operator=(long double u); @@ -257,12 +257,12 @@ class Abstract //! \name Operators `+=` //@{ // Builtin types - AbstractType& operator+=(sint16 u); - AbstractType& operator+=(sint32 u); - AbstractType& operator+=(sint64 u); + AbstractType& operator+=(int16_t u); + AbstractType& operator+=(int32_t u); + AbstractType& operator+=(int64_t u); AbstractType& operator+=(uint16 u); - AbstractType& operator+=(uint32 u); - AbstractType& operator+=(uint64 u); + AbstractType& operator+=(uint32_t u); + AbstractType& operator+=(uint64_t u); AbstractType& operator+=(float u); AbstractType& operator+=(double u); AbstractType& operator+=(long double u); @@ -277,12 +277,12 @@ class Abstract //! \name Operators `-=` //@{ // Builtin types - AbstractType& operator-=(sint16 u); - AbstractType& operator-=(sint32 u); - AbstractType& operator-=(sint64 u); + AbstractType& operator-=(int16_t u); + AbstractType& operator-=(int32_t u); + AbstractType& operator-=(int64_t u); AbstractType& operator-=(uint16 u); - AbstractType& operator-=(uint32 u); - AbstractType& operator-=(uint64 u); + AbstractType& operator-=(uint32_t u); + AbstractType& operator-=(uint64_t u); AbstractType& operator-=(float u); AbstractType& operator-=(double u); AbstractType& operator-=(long double u); @@ -297,12 +297,12 @@ class Abstract //! \name Operators `*=` //@{ // Builtin types - AbstractType& operator*=(sint16 u); - AbstractType& operator*=(sint32 u); - AbstractType& operator*=(sint64 u); + AbstractType& operator*=(int16_t u); + AbstractType& operator*=(int32_t u); + AbstractType& operator*=(int64_t u); AbstractType& operator*=(uint16 u); - AbstractType& operator*=(uint32 u); - AbstractType& operator*=(uint64 u); + AbstractType& operator*=(uint32_t u); + AbstractType& operator*=(uint64_t u); AbstractType& operator*=(float u); AbstractType& operator*=(double u); AbstractType& operator*=(long double u); @@ -317,12 +317,12 @@ class Abstract //! \name Operators `/=` //@{ // Builtin types - AbstractType& operator/=(sint16 u); - AbstractType& operator/=(sint32 u); - AbstractType& operator/=(sint64 u); + AbstractType& operator/=(int16_t u); + AbstractType& operator/=(int32_t u); + AbstractType& operator/=(int64_t u); AbstractType& operator/=(uint16 u); - AbstractType& operator/=(uint32 u); - AbstractType& operator/=(uint64 u); + AbstractType& operator/=(uint32_t u); + AbstractType& operator/=(uint64_t u); AbstractType& operator/=(float u); AbstractType& operator/=(double u); AbstractType& operator/=(long double u); diff --git a/src/ext/yuni/src/yuni/core/unit/unit.hxx b/src/ext/yuni/src/yuni/core/unit/unit.hxx index 7b883ce67e..ed4229b910 100644 --- a/src/ext/yuni/src/yuni/core/unit/unit.hxx +++ b/src/ext/yuni/src/yuni/core/unit/unit.hxx @@ -25,17 +25,17 @@ inline Abstract::Abstract() : pValue() } template -inline Abstract::Abstract(sint16 u) : pValue((T)u) +inline Abstract::Abstract(int16_t u) : pValue((T)u) { } template -inline Abstract::Abstract(sint32 u) : pValue((T)u) +inline Abstract::Abstract(int32_t u) : pValue((T)u) { } template -inline Abstract::Abstract(sint64 u) : pValue((T)u) +inline Abstract::Abstract(int64_t u) : pValue((T)u) { } @@ -45,12 +45,12 @@ inline Abstract::Abstract(uint16 u) : pValue((T)u) } template -inline Abstract::Abstract(uint32 u) : pValue((T)u) +inline Abstract::Abstract(uint32_t u) : pValue((T)u) { } template -inline Abstract::Abstract(uint64 u) : pValue((T)u) +inline Abstract::Abstract(uint64_t u) : pValue((T)u) { } @@ -371,12 +371,12 @@ inline bool Abstract::operator>(const Abstract(n)); } - virtual void add(sint32 n) override + virtual void add(int32_t n) override { pValue.push_back(new Data(n)); } - virtual void add(uint64 n) override + virtual void add(uint64_t n) override { pValue.push_back(new Data(n)); } - virtual void add(sint64 n) override + virtual void add(int64_t n) override { pValue.push_back(new Data(n)); } @@ -128,16 +128,16 @@ class ArrayData final : public IDataHolder pValue.push_back(new Data(n)); } - virtual void sub(uint32) override + virtual void sub(uint32_t) override { } - virtual void sub(sint32) override + virtual void sub(int32_t) override { } - virtual void sub(uint64) override + virtual void sub(uint64_t) override { } - virtual void sub(sint64) override + virtual void sub(int64_t) override { } virtual void sub(double) override @@ -153,16 +153,16 @@ class ArrayData final : public IDataHolder { } - virtual void mult(uint32) override + virtual void mult(uint32_t) override { } - virtual void mult(sint32) override + virtual void mult(int32_t) override { } - virtual void mult(uint64) override + virtual void mult(uint64_t) override { } - virtual void mult(sint64) override + virtual void mult(int64_t) override { } virtual void mult(double) override @@ -178,16 +178,16 @@ class ArrayData final : public IDataHolder { } - virtual void div(uint32) override + virtual void div(uint32_t) override { } - virtual void div(sint32) override + virtual void div(int32_t) override { } - virtual void div(uint64) override + virtual void div(uint64_t) override { } - virtual void div(sint64) override + virtual void div(int64_t) override { } virtual void div(double) override @@ -203,19 +203,19 @@ class ArrayData final : public IDataHolder { } - virtual bool isEquals(uint32) const override + virtual bool isEquals(uint32_t) const override { return false; } - virtual bool isEquals(sint32) const override + virtual bool isEquals(int32_t) const override { return false; } - virtual bool isEquals(uint64) const override + virtual bool isEquals(uint64_t) const override { return false; } - virtual bool isEquals(sint64) const override + virtual bool isEquals(int64_t) const override { return false; } diff --git a/src/ext/yuni/src/yuni/core/variant/dataholder/dataholder.h b/src/ext/yuni/src/yuni/core/variant/dataholder/dataholder.h index 29888c1e7a..852b48576d 100644 --- a/src/ext/yuni/src/yuni/core/variant/dataholder/dataholder.h +++ b/src/ext/yuni/src/yuni/core/variant/dataholder/dataholder.h @@ -46,7 +46,7 @@ struct InternalType final }; }; template<> -struct InternalType final +struct InternalType final { enum { @@ -54,7 +54,7 @@ struct InternalType final }; }; template<> -struct InternalType final +struct InternalType final { enum { @@ -62,7 +62,7 @@ struct InternalType final }; }; template<> -struct InternalType final +struct InternalType final { enum { @@ -70,7 +70,7 @@ struct InternalType final }; }; template<> -struct InternalType final +struct InternalType final { enum { @@ -147,16 +147,16 @@ class IDataHolder return nullptr; } - //! assign uint32 + //! assign uint32_t virtual void assignList(const IDataHolder::Vector&) = 0; - //! assign uint32 - virtual void assign(uint32 n) = 0; - //! assign sint32 - virtual void assign(sint32 n) = 0; - //! assign uint64 - virtual void assign(uint64 n) = 0; - //! assign sint64 - virtual void assign(sint64 n) = 0; + //! assign uint32_t + virtual void assign(uint32_t n) = 0; + //! assign int32_t + virtual void assign(int32_t n) = 0; + //! assign uint64_t + virtual void assign(uint64_t n) = 0; + //! assign int64_t + virtual void assign(int64_t n) = 0; //! assign double virtual void assign(double n) = 0; //! assign string @@ -166,16 +166,16 @@ class IDataHolder //! assign char virtual void assign(char n) = 0; - //! add uint32 + //! add uint32_t virtual void addList(const IDataHolder::Vector&) = 0; - //! add uint32 - virtual void add(uint32 n) = 0; - //! add sint32 - virtual void add(sint32 n) = 0; - //! add uint64 - virtual void add(uint64 n) = 0; - //! add sint64 - virtual void add(sint64 n) = 0; + //! add uint32_t + virtual void add(uint32_t n) = 0; + //! add int32_t + virtual void add(int32_t n) = 0; + //! add uint64_t + virtual void add(uint64_t n) = 0; + //! add int64_t + virtual void add(int64_t n) = 0; //! add double virtual void add(double n) = 0; //! add string @@ -185,14 +185,14 @@ class IDataHolder //! add char virtual void add(char n) = 0; - //! sub uint32 - virtual void sub(uint32 n) = 0; - //! sub sint32 - virtual void sub(sint32 n) = 0; - //! sub uint64 - virtual void sub(uint64 n) = 0; - //! sub sint64 - virtual void sub(sint64 n) = 0; + //! sub uint32_t + virtual void sub(uint32_t n) = 0; + //! sub int32_t + virtual void sub(int32_t n) = 0; + //! sub uint64_t + virtual void sub(uint64_t n) = 0; + //! sub int64_t + virtual void sub(int64_t n) = 0; //! sub double virtual void sub(double n) = 0; //! sub string @@ -202,14 +202,14 @@ class IDataHolder //! sub char virtual void sub(char n) = 0; - //! mult uint32 - virtual void mult(uint32 n) = 0; - //! mult sint32 - virtual void mult(sint32 n) = 0; - //! mult uint64 - virtual void mult(uint64 n) = 0; - //! mult sint64 - virtual void mult(sint64 n) = 0; + //! mult uint32_t + virtual void mult(uint32_t n) = 0; + //! mult int32_t + virtual void mult(int32_t n) = 0; + //! mult uint64_t + virtual void mult(uint64_t n) = 0; + //! mult int64_t + virtual void mult(int64_t n) = 0; //! mult double virtual void mult(double n) = 0; //! mult bool @@ -219,14 +219,14 @@ class IDataHolder //! mult string virtual void mult(const String& n) = 0; - //! div uint32 - virtual void div(uint32 n) = 0; - //! div sint32 - virtual void div(sint32 n) = 0; - //! div uint64 - virtual void div(uint64 n) = 0; - //! div sint64 - virtual void div(sint64 n) = 0; + //! div uint32_t + virtual void div(uint32_t n) = 0; + //! div int32_t + virtual void div(int32_t n) = 0; + //! div uint64_t + virtual void div(uint64_t n) = 0; + //! div int64_t + virtual void div(int64_t n) = 0; //! div double virtual void div(double n) = 0; //! div bool @@ -236,14 +236,14 @@ class IDataHolder //! div string virtual void div(const String& n) = 0; - //! is equals to uint32 - virtual bool isEquals(uint32 n) const = 0; - //! is equals to sint32 - virtual bool isEquals(sint32 n) const = 0; - //! is equals to uint64 - virtual bool isEquals(uint64 n) const = 0; - //! is equals to sint64 - virtual bool isEquals(sint64 n) const = 0; + //! is equals to uint32_t + virtual bool isEquals(uint32_t n) const = 0; + //! is equals to int32_t + virtual bool isEquals(int32_t n) const = 0; + //! is equals to uint64_t + virtual bool isEquals(uint64_t n) const = 0; + //! is equals to int64_t + virtual bool isEquals(int64_t n) const = 0; //! is equals to double virtual bool isEquals(double n) const = 0; //! is equals to bool @@ -315,10 +315,10 @@ class IDataConverter //@{ virtual bool convertFrom(char v) = 0; virtual bool convertFrom(bool v) = 0; - virtual bool convertFrom(sint32 v) = 0; - virtual bool convertFrom(uint32 v) = 0; - virtual bool convertFrom(sint64 v) = 0; - virtual bool convertFrom(uint64 v) = 0; + virtual bool convertFrom(int32_t v) = 0; + virtual bool convertFrom(uint32_t v) = 0; + virtual bool convertFrom(int64_t v) = 0; + virtual bool convertFrom(uint64_t v) = 0; virtual bool convertFrom(double v) = 0; virtual bool convertFrom(const String& v) = 0; virtual bool convertFrom(const IDataHolder::Vector& v) = 0; @@ -434,24 +434,24 @@ struct DataConverter final : public IDataConverter return Converter::Value(v, result); } - virtual bool convertFrom(sint32 v) override + virtual bool convertFrom(int32_t v) override { - return Converter::Value(v, result); + return Converter::Value(v, result); } - virtual bool convertFrom(uint32 v) override + virtual bool convertFrom(uint32_t v) override { - return Converter::Value(v, result); + return Converter::Value(v, result); } - virtual bool convertFrom(sint64 v) override + virtual bool convertFrom(int64_t v) override { - return Converter::Value(v, result); + return Converter::Value(v, result); } - virtual bool convertFrom(uint64 v) override + virtual bool convertFrom(uint64_t v) override { - return Converter::Value(v, result); + return Converter::Value(v, result); } virtual bool convertFrom(double v) override @@ -537,19 +537,19 @@ class Data final : public IDataHolder virtual void assignList(const IDataHolder::Vector&) override { } - virtual void assign(uint32 n) override + virtual void assign(uint32_t n) override { pValue = (T)n; } - virtual void assign(sint32 n) override + virtual void assign(int32_t n) override { pValue = (T)n; } - virtual void assign(uint64 n) override + virtual void assign(uint64_t n) override { pValue = (T)n; } - virtual void assign(sint64 n) override + virtual void assign(int64_t n) override { pValue = (T)n; } @@ -573,19 +573,19 @@ class Data final : public IDataHolder virtual void addList(const IDataHolder::Vector&) override { } - virtual void add(uint32 n) override + virtual void add(uint32_t n) override { pValue += (T)n; } - virtual void add(sint32 n) override + virtual void add(int32_t n) override { pValue += (T)n; } - virtual void add(uint64 n) override + virtual void add(uint64_t n) override { pValue += (T)n; } - virtual void add(sint64 n) override + virtual void add(int64_t n) override { pValue += (T)n; } @@ -606,19 +606,19 @@ class Data final : public IDataHolder pValue += (T)n; } - virtual void sub(uint32 n) override + virtual void sub(uint32_t n) override { pValue -= (T)n; } - virtual void sub(sint32 n) override + virtual void sub(int32_t n) override { pValue -= (T)n; } - virtual void sub(uint64 n) override + virtual void sub(uint64_t n) override { pValue -= (T)n; } - virtual void sub(sint64 n) override + virtual void sub(int64_t n) override { pValue -= (T)n; } @@ -639,19 +639,19 @@ class Data final : public IDataHolder pValue -= (T)n; } - virtual void mult(uint32 n) override + virtual void mult(uint32_t n) override { pValue *= (T)n; } - virtual void mult(sint32 n) override + virtual void mult(int32_t n) override { pValue *= (T)n; } - virtual void mult(uint64 n) override + virtual void mult(uint64_t n) override { pValue *= (T)n; } - virtual void mult(sint64 n) override + virtual void mult(int64_t n) override { pValue *= (T)n; } @@ -671,19 +671,19 @@ class Data final : public IDataHolder pValue *= n.to(); } - virtual void div(uint32 n) override + virtual void div(uint32_t n) override { pValue /= (T)n; } - virtual void div(sint32 n) override + virtual void div(int32_t n) override { pValue /= (T)n; } - virtual void div(uint64 n) override + virtual void div(uint64_t n) override { pValue /= (T)n; } - virtual void div(sint64 n) override + virtual void div(int64_t n) override { pValue /= (T)n; } @@ -703,19 +703,19 @@ class Data final : public IDataHolder pValue /= n.to(); } - virtual bool isEquals(uint32 n) const override + virtual bool isEquals(uint32_t n) const override { return Math::Equals(pValue, (T)n); } - virtual bool isEquals(sint32 n) const override + virtual bool isEquals(int32_t n) const override { return Math::Equals(pValue, (T)n); } - virtual bool isEquals(uint64 n) const override + virtual bool isEquals(uint64_t n) const override { return Math::Equals(pValue, (T)n); } - virtual bool isEquals(sint64 n) const override + virtual bool isEquals(int64_t n) const override { return Math::Equals(pValue, (T)n); } @@ -811,19 +811,19 @@ class Data final : public IDataHolder virtual void assignList(const IDataHolder::Vector&) override { } - virtual void assign(uint32 n) override + virtual void assign(uint32_t n) override { pValue = (T)n; } - virtual void assign(sint32 n) override + virtual void assign(int32_t n) override { pValue = (T)n; } - virtual void assign(uint64 n) override + virtual void assign(uint64_t n) override { pValue = (T)n; } - virtual void assign(sint64 n) override + virtual void assign(int64_t n) override { pValue = (T)n; } @@ -847,19 +847,19 @@ class Data final : public IDataHolder virtual void addList(const IDataHolder::Vector&) override { } - virtual void add(uint32 n) override + virtual void add(uint32_t n) override { pValue += (T)n; } - virtual void add(sint32 n) override + virtual void add(int32_t n) override { pValue += (T)n; } - virtual void add(uint64 n) override + virtual void add(uint64_t n) override { pValue += (T)n; } - virtual void add(sint64 n) override + virtual void add(int64_t n) override { pValue += (T)n; } @@ -880,19 +880,19 @@ class Data final : public IDataHolder pValue += (T)n; } - virtual void sub(uint32 n) override + virtual void sub(uint32_t n) override { pValue -= (T)n; } - virtual void sub(sint32 n) override + virtual void sub(int32_t n) override { pValue -= (T)n; } - virtual void sub(uint64 n) override + virtual void sub(uint64_t n) override { pValue -= (T)n; } - virtual void sub(sint64 n) override + virtual void sub(int64_t n) override { pValue -= (T)n; } @@ -913,19 +913,19 @@ class Data final : public IDataHolder pValue -= (T)n; } - virtual void mult(uint32 n) override + virtual void mult(uint32_t n) override { pValue *= (T)n; } - virtual void mult(sint32 n) override + virtual void mult(int32_t n) override { pValue *= (T)n; } - virtual void mult(uint64 n) override + virtual void mult(uint64_t n) override { pValue *= (T)n; } - virtual void mult(sint64 n) override + virtual void mult(int64_t n) override { pValue *= (T)n; } @@ -945,19 +945,19 @@ class Data final : public IDataHolder pValue *= n.to(); } - virtual void div(uint32 n) override + virtual void div(uint32_t n) override { pValue /= (T)n; } - virtual void div(sint32 n) override + virtual void div(int32_t n) override { pValue /= (T)n; } - virtual void div(uint64 n) override + virtual void div(uint64_t n) override { pValue /= (T)n; } - virtual void div(sint64 n) override + virtual void div(int64_t n) override { pValue /= (T)n; } @@ -977,19 +977,19 @@ class Data final : public IDataHolder pValue /= n.to(); } - virtual bool isEquals(uint32 n) const override + virtual bool isEquals(uint32_t n) const override { return pValue == (T)n; } - virtual bool isEquals(sint32 n) const override + virtual bool isEquals(int32_t n) const override { return pValue == (T)n; } - virtual bool isEquals(uint64 n) const override + virtual bool isEquals(uint64_t n) const override { return pValue == (T)n; } - virtual bool isEquals(sint64 n) const override + virtual bool isEquals(int64_t n) const override { return pValue == (T)n; } @@ -1085,19 +1085,19 @@ class Data final : public IDataHolder virtual void assignList(const IDataHolder::Vector&) override { } - virtual void assign(sint32 n) override + virtual void assign(int32_t n) override { pValue = (n != 0); } - virtual void assign(uint32 n) override + virtual void assign(uint32_t n) override { pValue = (n != 0); } - virtual void assign(sint64 n) override + virtual void assign(int64_t n) override { pValue = (n != 0); } - virtual void assign(uint64 n) override + virtual void assign(uint64_t n) override { pValue = (n != 0); } @@ -1121,22 +1121,22 @@ class Data final : public IDataHolder virtual void addList(const IDataHolder::Vector&) override { } - virtual void add(sint32 n) override + virtual void add(int32_t n) override { if (n) pValue = true; } - virtual void add(uint32 n) override + virtual void add(uint32_t n) override { if (n) pValue = true; } - virtual void add(sint64 n) override + virtual void add(int64_t n) override { if (n) pValue = true; } - virtual void add(uint64 n) override + virtual void add(uint64_t n) override { if (n) pValue = true; @@ -1162,22 +1162,22 @@ class Data final : public IDataHolder pValue = true; } - virtual void sub(sint32 n) override + virtual void sub(int32_t n) override { if (n) pValue = false; } - virtual void sub(uint32 n) override + virtual void sub(uint32_t n) override { if (n) pValue = false; } - virtual void sub(sint64 n) override + virtual void sub(int64_t n) override { if (n) pValue = false; } - virtual void sub(uint64 n) override + virtual void sub(uint64_t n) override { if (n) pValue = false; @@ -1203,22 +1203,22 @@ class Data final : public IDataHolder pValue = false; } - virtual void mult(uint32 n) override + virtual void mult(uint32_t n) override { if (!n) pValue = false; } - virtual void mult(sint32 n) override + virtual void mult(int32_t n) override { if (!n) pValue = false; } - virtual void mult(uint64 n) override + virtual void mult(uint64_t n) override { if (!n) pValue = false; } - virtual void mult(sint64 n) override + virtual void mult(int64_t n) override { if (!n) pValue = false; @@ -1242,16 +1242,16 @@ class Data final : public IDataHolder pValue = false; } - virtual void div(uint32) override + virtual void div(uint32_t) override { } - virtual void div(sint32) override + virtual void div(int32_t) override { } - virtual void div(uint64) override + virtual void div(uint64_t) override { } - virtual void div(sint64) override + virtual void div(int64_t) override { } virtual void div(double) override @@ -1267,19 +1267,19 @@ class Data final : public IDataHolder { } - virtual bool isEquals(uint32 n) const override + virtual bool isEquals(uint32_t n) const override { return pValue == (n != 0); } - virtual bool isEquals(sint32 n) const override + virtual bool isEquals(int32_t n) const override { return pValue == (n != 0); } - virtual bool isEquals(uint64 n) const override + virtual bool isEquals(uint64_t n) const override { return pValue == (n != 0); } - virtual bool isEquals(sint64 n) const override + virtual bool isEquals(int64_t n) const override { return pValue == (n != 0); } diff --git a/src/ext/yuni/src/yuni/core/variant/dataholder/string.h b/src/ext/yuni/src/yuni/core/variant/dataholder/string.h index d906af8686..7159600f69 100644 --- a/src/ext/yuni/src/yuni/core/variant/dataholder/string.h +++ b/src/ext/yuni/src/yuni/core/variant/dataholder/string.h @@ -66,19 +66,19 @@ class Data final : public IDataHolder virtual void assignList(const IDataHolder::Vector&) override { } - virtual void assign(uint32 n) override + virtual void assign(uint32_t n) override { pValue = n; } - virtual void assign(sint32 n) override + virtual void assign(int32_t n) override { pValue = n; } - virtual void assign(uint64 n) override + virtual void assign(uint64_t n) override { pValue = n; } - virtual void assign(sint64 n) override + virtual void assign(int64_t n) override { pValue = n; } @@ -102,19 +102,19 @@ class Data final : public IDataHolder virtual void addList(const IDataHolder::Vector&) override { } - virtual void add(uint32 n) override + virtual void add(uint32_t n) override { pValue += n; } - virtual void add(sint32 n) override + virtual void add(int32_t n) override { pValue += n; } - virtual void add(uint64 n) override + virtual void add(uint64_t n) override { pValue += n; } - virtual void add(sint64 n) override + virtual void add(int64_t n) override { pValue += n; } @@ -135,16 +135,16 @@ class Data final : public IDataHolder pValue += n; } - virtual void sub(uint32) override + virtual void sub(uint32_t) override { } - virtual void sub(sint32) override + virtual void sub(int32_t) override { } - virtual void sub(uint64) override + virtual void sub(uint64_t) override { } - virtual void sub(sint64) override + virtual void sub(int64_t) override { } virtual void sub(double) override @@ -161,16 +161,16 @@ class Data final : public IDataHolder { } - virtual void mult(uint32) override + virtual void mult(uint32_t) override { } - virtual void mult(sint32) override + virtual void mult(int32_t) override { } - virtual void mult(uint64) override + virtual void mult(uint64_t) override { } - virtual void mult(sint64) override + virtual void mult(int64_t) override { } virtual void mult(double) override @@ -186,16 +186,16 @@ class Data final : public IDataHolder { } - virtual void div(uint32) override + virtual void div(uint32_t) override { } - virtual void div(sint32) override + virtual void div(int32_t) override { } - virtual void div(uint64) override + virtual void div(uint64_t) override { } - virtual void div(sint64) override + virtual void div(int64_t) override { } virtual void div(double) override @@ -211,21 +211,21 @@ class Data final : public IDataHolder { } - virtual bool isEquals(uint32 n) const override + virtual bool isEquals(uint32_t n) const override { - return pValue.to() == n; + return pValue.to() == n; } - virtual bool isEquals(sint32 n) const override + virtual bool isEquals(int32_t n) const override { - return pValue.to() == n; + return pValue.to() == n; } - virtual bool isEquals(uint64 n) const override + virtual bool isEquals(uint64_t n) const override { - return pValue.to() == n; + return pValue.to() == n; } - virtual bool isEquals(sint64 n) const override + virtual bool isEquals(int64_t n) const override { - return pValue.to() == n; + return pValue.to() == n; } virtual bool isEquals(double n) const override { diff --git a/src/ext/yuni/src/yuni/core/variant/types.h b/src/ext/yuni/src/yuni/core/variant/types.h index 7a73b5f5b8..555ed1dc8c 100644 --- a/src/ext/yuni/src/yuni/core/variant/types.h +++ b/src/ext/yuni/src/yuni/core/variant/types.h @@ -21,13 +21,13 @@ enum VariantInnerType variantTBool, //! char variantTChar, - //! sint32 + //! int32_t variantTInt32, - //! sint64 + //! int64_t variantTInt64, - //! uint32 + //! uint32_t variantTUInt32, - //! uint64 + //! uint64_t variantTUInt64, //! string variantTString, diff --git a/src/ext/yuni/src/yuni/core/variant/variant.cpp b/src/ext/yuni/src/yuni/core/variant/variant.cpp index edd0a99059..22635f1a3a 100644 --- a/src/ext/yuni/src/yuni/core/variant/variant.cpp +++ b/src/ext/yuni/src/yuni/core/variant/variant.cpp @@ -26,36 +26,36 @@ VariantInnerType Variant::type() const return (not pData) ? variantTNil : pData->type(); } -void Variant::assign(uint32 rhs) +void Variant::assign(uint32_t rhs) { if (pShareContent and !(!pData)) pData->assign(rhs); else - pData = new Private::Variant::Data(rhs); + pData = new Private::Variant::Data(rhs); } -void Variant::assign(sint32 rhs) +void Variant::assign(int32_t rhs) { if (pShareContent and !(!pData)) pData->assign(rhs); else - pData = new Private::Variant::Data(rhs); + pData = new Private::Variant::Data(rhs); } -void Variant::assign(uint64 rhs) +void Variant::assign(uint64_t rhs) { if (pShareContent and !(!pData)) pData->assign(rhs); else - pData = new Private::Variant::Data(rhs); + pData = new Private::Variant::Data(rhs); } -void Variant::assign(sint64 rhs) +void Variant::assign(int64_t rhs) { if (pShareContent and !(!pData)) pData->assign(rhs); else - pData = new Private::Variant::Data(rhs); + pData = new Private::Variant::Data(rhs); } void Variant::assign(char rhs) diff --git a/src/ext/yuni/src/yuni/core/variant/variant.h b/src/ext/yuni/src/yuni/core/variant/variant.h index 4737b75def..3cdb1b611a 100644 --- a/src/ext/yuni/src/yuni/core/variant/variant.h +++ b/src/ext/yuni/src/yuni/core/variant/variant.h @@ -99,13 +99,13 @@ class YUNI_DECL Variant final Variant(const NullPtr&); //! Constructs a Variant based on an integer. - Variant(sint32 rhs); + Variant(int32_t rhs); //! Constructs a Variant based on an integer. - Variant(sint64 rhs); + Variant(int64_t rhs); //! Constructs a Variant based on an integer. - Variant(uint32 rhs); + Variant(uint32_t rhs); //! Constructs a Variant based on an integer. - Variant(uint64 rhs); + Variant(uint64_t rhs); //! Constructs a Variant based on an integer. Variant(float rhs); //! Constructs a Variant based on an integer. @@ -130,14 +130,14 @@ class YUNI_DECL Variant final //@{ //! Assignment from an existing Variant void assign(const Variant& rhs); - //! Assignment from standard type (uint32) - void assign(uint32 rhs); - //! Assignment from standard type (sint32) - void assign(sint32 rhs); - //! Assignment from standard type (uint64) - void assign(uint64 rhs); - //! Assignment from standard type (sint64) - void assign(sint64 rhs); + //! Assignment from standard type (uint32_t) + void assign(uint32_t rhs); + //! Assignment from standard type (int32_t) + void assign(int32_t rhs); + //! Assignment from standard type (uint64_t) + void assign(uint64_t rhs); + //! Assignment from standard type (int64_t) + void assign(int64_t rhs); //! Assignment from standard type (char) void assign(char rhs); //! Assignment from standard type (bool) diff --git a/src/ext/yuni/src/yuni/core/variant/variant.hxx b/src/ext/yuni/src/yuni/core/variant/variant.hxx index 3ce7aa6b09..c4d28d6738 100644 --- a/src/ext/yuni/src/yuni/core/variant/variant.hxx +++ b/src/ext/yuni/src/yuni/core/variant/variant.hxx @@ -35,10 +35,10 @@ YUNI_VARIANT_DEFINE_SUPPORTED_TYPE(String); YUNI_VARIANT_DEFINE_SUPPORTED_TYPE(float); YUNI_VARIANT_DEFINE_SUPPORTED_TYPE(double); -YUNI_VARIANT_DEFINE_SUPPORTED_TYPE(sint32); -YUNI_VARIANT_DEFINE_SUPPORTED_TYPE(sint64); -YUNI_VARIANT_DEFINE_SUPPORTED_TYPE(uint32); -YUNI_VARIANT_DEFINE_SUPPORTED_TYPE(uint64); +YUNI_VARIANT_DEFINE_SUPPORTED_TYPE(int32_t); +YUNI_VARIANT_DEFINE_SUPPORTED_TYPE(int64_t); +YUNI_VARIANT_DEFINE_SUPPORTED_TYPE(uint32_t); +YUNI_VARIANT_DEFINE_SUPPORTED_TYPE(uint64_t); template inline Variant Variant::New::Instance() @@ -75,24 +75,24 @@ inline Variant Variant::New::Instance() } template<> -inline Variant Variant::New::Instance() +inline Variant Variant::New::Instance() { - return Variant(uint32()); + return Variant(uint32_t()); } template<> -inline Variant Variant::New::Instance() +inline Variant Variant::New::Instance() { - return Variant(uint64()); + return Variant(uint64_t()); } template<> -inline Variant Variant::New::Instance() +inline Variant Variant::New::Instance() { - return Variant(sint32()); + return Variant(int32_t()); } template<> -inline Variant Variant::New::Instance() +inline Variant Variant::New::Instance() { - return Variant(sint64()); + return Variant(int64_t()); } template<> @@ -149,22 +149,22 @@ inline Variant::Variant(char rhs) : pShareContent(false) assign(rhs); } -inline Variant::Variant(sint32 rhs) : pShareContent(false) +inline Variant::Variant(int32_t rhs) : pShareContent(false) { assign(rhs); } -inline Variant::Variant(sint64 rhs) : pShareContent(false) +inline Variant::Variant(int64_t rhs) : pShareContent(false) { assign(rhs); } -inline Variant::Variant(uint32 rhs) : pShareContent(false) +inline Variant::Variant(uint32_t rhs) : pShareContent(false) { assign(rhs); } -inline Variant::Variant(uint64 rhs) : pShareContent(false) +inline Variant::Variant(uint64_t rhs) : pShareContent(false) { assign(rhs); } diff --git a/src/ext/yuni/src/yuni/datetime/timestamp.cpp b/src/ext/yuni/src/yuni/datetime/timestamp.cpp index 0fabfc1b7b..90c1b26496 100644 --- a/src/ext/yuni/src/yuni/datetime/timestamp.cpp +++ b/src/ext/yuni/src/yuni/datetime/timestamp.cpp @@ -20,9 +20,9 @@ namespace DateTime Timestamp Now() { #ifdef YUNI_OS_MSVC - return (sint64)::_time64(nullptr); + return (int64_t)::_time64(nullptr); #else - return (sint64)::time(nullptr); + return (int64_t)::time(nullptr); #endif } @@ -44,7 +44,7 @@ namespace DateTime { namespace // anonymous { -static inline uint FormatString(char* buffer, uint size, const char* format, sint64 timestamp) +static inline uint FormatString(char* buffer, uint size, const char* format, int64_t timestamp) { assert(format != nullptr and '\0' != *format and "invalid format"); @@ -90,16 +90,16 @@ static inline uint FormatString(char* buffer, uint size, const char* format, sin } // anonymous namespace -char* FormatTimestampToString(const AnyString& format, sint64 timestamp) +char* FormatTimestampToString(const AnyString& format, int64_t timestamp) { assert(not format.empty() and "this routine must not be called if the format is empty"); if (timestamp <= 0) { #ifdef YUNI_OS_MSVC - timestamp = (sint64)::_time64(NULL); + timestamp = (int64_t)::_time64(NULL); #else - timestamp = (sint64)::time(NULL); + timestamp = (int64_t)::time(NULL); #endif } diff --git a/src/ext/yuni/src/yuni/datetime/timestamp.h b/src/ext/yuni/src/yuni/datetime/timestamp.h index ec635b4265..aa1fca0069 100644 --- a/src/ext/yuni/src/yuni/datetime/timestamp.h +++ b/src/ext/yuni/src/yuni/datetime/timestamp.h @@ -22,7 +22,7 @@ namespace DateTime ** A timestamp is a time in seconds since 0 hours, 0 minutes, 0 seconds, ** January 1, 1970, Coordinated Universal Time. */ -typedef /*time_t*/ sint64 Timestamp; +typedef /*time_t*/ int64_t Timestamp; /*! ** \brief Get the current timestamp (in seconds since epoch) diff --git a/src/ext/yuni/src/yuni/datetime/timestamp.hxx b/src/ext/yuni/src/yuni/datetime/timestamp.hxx index f5ea4eae34..b706e2f655 100644 --- a/src/ext/yuni/src/yuni/datetime/timestamp.hxx +++ b/src/ext/yuni/src/yuni/datetime/timestamp.hxx @@ -19,7 +19,7 @@ namespace Private namespace DateTime { // forward declaration -char* FormatTimestampToString(const AnyString& format, sint64 timestamp); +char* FormatTimestampToString(const AnyString& format, int64_t timestamp); } // namespace DateTime } // namespace Private diff --git a/src/ext/yuni/src/yuni/doxygen.txt b/src/ext/yuni/src/yuni/doxygen.txt index 1c8451293e..bcf8d829d8 100644 --- a/src/ext/yuni/src/yuni/doxygen.txt +++ b/src/ext/yuni/src/yuni/doxygen.txt @@ -789,9 +789,6 @@ RECURSIVE = YES # Note that relative paths are relative to the directory from which doxygen is # run. -EXCLUDE = private \ - core/system/windows/msinttypes/inttypes.h - # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded # from the input. diff --git a/src/ext/yuni/src/yuni/io/directory/copy.cpp b/src/ext/yuni/src/yuni/io/directory/copy.cpp index e5051a51bd..2bcc493a0f 100644 --- a/src/ext/yuni/src/yuni/io/directory/copy.cpp +++ b/src/ext/yuni/src/yuni/io/directory/copy.cpp @@ -24,7 +24,7 @@ namespace // anonymous struct InfoItem { bool isFile; - uint64 size; + uint64_t size; String filename; }; typedef std::vector List; @@ -57,7 +57,7 @@ bool Copy(const AnyString& src, List list; list.reserve(512); // the total number of bytes to copy - uint64 totalSize = 0; + uint64_t totalSize = 0; // get the complete list of all files to copy and all folders to create { @@ -105,7 +105,7 @@ bool Copy(const AnyString& src, if (YUNI_UNLIKELY(nullptr == buffer)) return false; - uint64 current = 0; + uint64_t current = 0; // A temporary string String tmp; tmp.reserve(1024); @@ -163,7 +163,7 @@ bool Copy(const AnyString& src, if (toFile.open(tmp, IO::OpenMode::write | IO::OpenMode::truncate)) { // reading the whole source file - uint64 numRead; + uint64_t numRead; while ((numRead = fromFile.read(buffer, bufferSize)) > 0) { // progression diff --git a/src/ext/yuni/src/yuni/io/directory/directory.h b/src/ext/yuni/src/yuni/io/directory/directory.h index 5d2f5a7d1a..3578c0391a 100644 --- a/src/ext/yuni/src/yuni/io/directory/directory.h +++ b/src/ext/yuni/src/yuni/io/directory/directory.h @@ -107,7 +107,7 @@ enum CopyState cpsGatheringInformation, cpsCopying }; -typedef Yuni::Bind CopyOnUpdateBind; +typedef Yuni::Bind CopyOnUpdateBind; /*! ** \brief Copy a directory diff --git a/src/ext/yuni/src/yuni/io/directory/directory.hxx b/src/ext/yuni/src/yuni/io/directory/directory.hxx index 2bf33046f6..fd69ce4328 100644 --- a/src/ext/yuni/src/yuni/io/directory/directory.hxx +++ b/src/ext/yuni/src/yuni/io/directory/directory.hxx @@ -29,8 +29,8 @@ namespace Directory inline bool DummyCopyUpdateEvent(Yuni::IO::Directory::CopyState, const String&, const String&, - uint64, - uint64) + uint64_t, + uint64_t) { return true; } diff --git a/src/ext/yuni/src/yuni/io/directory/info/iterator.inc.hpp b/src/ext/yuni/src/yuni/io/directory/info/iterator.inc.hpp index 7f09204cec..bf970be8c3 100644 --- a/src/ext/yuni/src/yuni/io/directory/info/iterator.inc.hpp +++ b/src/ext/yuni/src/yuni/io/directory/info/iterator.inc.hpp @@ -17,9 +17,9 @@ struct Model //! The type of the orignal object typedef String value_type; //! An uintegral type - typedef uint64 uint64ype; + typedef uint64_t uint64_type; //! A signed integral type - typedef sint64 difference_type; + typedef int64_t difference_type; enum { @@ -90,9 +90,9 @@ struct Model //! The type of the orignal object typedef String value_type; //! An uintegral type - typedef uint64 uint64ype; + typedef uint64_t uint64_type; //! A signed integral type - typedef sint64 difference_type; + typedef int64_t difference_type; enum { @@ -124,13 +124,13 @@ struct Model } //! Size in bytes - uint64 size() const + uint64_t size() const { return Private::IO::Directory::IteratorDataSize(pData); } //! Date of the last modification - sint64 modified() const + int64_t modified() const { return Private::IO::Directory::IteratorDataModified(pData); } diff --git a/src/ext/yuni/src/yuni/io/directory/info/platform.cpp b/src/ext/yuni/src/yuni/io/directory/info/platform.cpp index 25166f949d..7a330da911 100644 --- a/src/ext/yuni/src/yuni/io/directory/info/platform.cpp +++ b/src/ext/yuni/src/yuni/io/directory/info/platform.cpp @@ -147,7 +147,7 @@ class DirInfo final : private Yuni::NonCopyable { isFolder = true; size = 0; - modified = (sint64)s.st_mtime; + modified = (int64_t)s.st_mtime; return true; } } @@ -156,8 +156,8 @@ class DirInfo final : private Yuni::NonCopyable if (0 != (flags & Yuni::IO::Directory::Info::itFile)) { isFolder = false; - size = (uint64)s.st_size; - modified = (sint64)s.st_mtime; + size = (uint64_t)s.st_size; + modified = (int64_t)s.st_mtime; return true; } } @@ -207,7 +207,7 @@ class DirInfo final : private Yuni::NonCopyable { isFolder = true; size = 0; - modified = (sint64)data.time_write; + modified = (int64_t)data.time_write; return true; } } @@ -216,8 +216,8 @@ class DirInfo final : private Yuni::NonCopyable if (0 != (flags & Yuni::IO::Directory::Info::itFile)) { isFolder = false; - size = (uint64)data.size; - modified = (sint64)data.time_write; + size = (uint64_t)data.size; + modified = (int64_t)data.time_write; return true; } } @@ -235,9 +235,9 @@ class DirInfo final : private Yuni::NonCopyable //! The complete filename of the current node String filename; //! File size - uint64 size; + uint64_t size; //! Date of the last modification - sint64 modified; + int64_t modified; //! Flag to determine whether the inode is a folder or a file bool isFolder; @@ -381,13 +381,13 @@ const String& IteratorDataName(const IteratorData* data) return data->dirinfo.front().name; } -uint64 IteratorDataSize(const IteratorData* data) +uint64_t IteratorDataSize(const IteratorData* data) { assert(data != NULL); return data->dirinfo.front().size; } -sint64 IteratorDataModified(const IteratorData* data) +int64_t IteratorDataModified(const IteratorData* data) { assert(data != NULL); return data->dirinfo.front().modified; diff --git a/src/ext/yuni/src/yuni/io/directory/info/platform.h b/src/ext/yuni/src/yuni/io/directory/info/platform.h index 1bac7eb50e..c622ed6518 100644 --- a/src/ext/yuni/src/yuni/io/directory/info/platform.h +++ b/src/ext/yuni/src/yuni/io/directory/info/platform.h @@ -38,9 +38,9 @@ const String& IteratorDataParentName(const IteratorData*); const String& IteratorDataName(const IteratorData*); -uint64 IteratorDataSize(const IteratorData*); +uint64_t IteratorDataSize(const IteratorData*); -sint64 IteratorDataModified(const IteratorData*); +int64_t IteratorDataModified(const IteratorData*); bool IteratorDataIsFolder(const IteratorData*); diff --git a/src/ext/yuni/src/yuni/io/directory/iterator/detachedthread.h b/src/ext/yuni/src/yuni/io/directory/iterator/detachedthread.h index 3f8e726b1b..d43b74b260 100644 --- a/src/ext/yuni/src/yuni/io/directory/iterator/detachedthread.h +++ b/src/ext/yuni/src/yuni/io/directory/iterator/detachedthread.h @@ -60,7 +60,7 @@ class Interface virtual Flow onFile(const String& filename, const String& parent, const String& name, - uint64 size) + uint64_t size) = 0; virtual Flow onError(const String& filename) = 0; diff --git a/src/ext/yuni/src/yuni/io/directory/iterator/iterator.cpp b/src/ext/yuni/src/yuni/io/directory/iterator/iterator.cpp index a0a3da9562..2bcbd5743c 100644 --- a/src/ext/yuni/src/yuni/io/directory/iterator/iterator.cpp +++ b/src/ext/yuni/src/yuni/io/directory/iterator/iterator.cpp @@ -118,7 +118,7 @@ Flow TraverseUnixFolder(const String& filename, Options& opts, IDetachedThread* { // The node is a file switch ( - opts.self->onFile(newFilename, filename, newName, static_cast(s.st_size))) + opts.self->onFile(newFilename, filename, newName, static_cast(s.st_size))) { case Yuni::IO::flowContinue: break; @@ -244,7 +244,7 @@ Flow TraverseWindowsFolder(const String& filename, filesize.LowPart = data.nFileSizeLow; filesize.HighPart = data.nFileSizeHigh; switch ( - opts.self->onFile(newFilename, filename, newName, (uint64)(filesize.QuadPart))) + opts.self->onFile(newFilename, filename, newName, (uint64_t)(filesize.QuadPart))) { case Yuni::IO::flowContinue: break; diff --git a/src/ext/yuni/src/yuni/io/directory/iterator/iterator.h b/src/ext/yuni/src/yuni/io/directory/iterator/iterator.h index c75bfd1f4b..0de0176966 100644 --- a/src/ext/yuni/src/yuni/io/directory/iterator/iterator.h +++ b/src/ext/yuni/src/yuni/io/directory/iterator/iterator.h @@ -75,7 +75,7 @@ namespace Directory ** --pCounter; ** } ** -** virtual Flow onFile(const String&, const String&, const String& name, uint64 size) +** virtual Flow onFile(const String&, const String&, const String& name, uint64_t size) ** { ** printSpaces(); ** std::cout << " - " << name << " (" << size << " bytes)" << std::endl; @@ -102,7 +102,7 @@ namespace Directory ** uint pCounter; ** uint pFolderCount; ** uint pFileCount; -** uint64 pTotalSize; +** uint64_t pTotalSize; ** }; ** ** @@ -153,7 +153,7 @@ class IIterator typedef typename Ancestor::ThreadingPolicy ThreadingPolicy; //! Event: file / folder found - typedef Bind + typedef Bind OnNodeEvent; public: @@ -316,7 +316,7 @@ class IIterator virtual Flow onFile(const String& filename, const String& parent, const String& name, - uint64 size) override; + uint64_t size) override; /*! ** \brief Event: It was impossible to open a folder @@ -372,12 +372,12 @@ class IIterator ** Example for iterating through all files and folders: ** \code ** auto walker = IO::Directory::CreateWalker("/tmp/some-folder", -** [](AnyString filename, AnyString parent, AnyString name, uint64 size) -> Flow +** [](AnyString filename, AnyString parent, AnyString name, uint64_t size) -> Flow ** { ** std::cout << " . found file " << filename << " (" << size << " bytes)\n"; ** return IO::flowContinue; ** }, -** [](AnyString pathname, AnyString parent, AnyString name, uint64) -> Flow +** [](AnyString pathname, AnyString parent, AnyString name, uint64_t) -> Flow ** { ** std::cout << " . found folder " << pathname; ** return IO::flowContinue; @@ -393,7 +393,7 @@ class IIterator ** Job::QueueService queueservice; ** auto walker = IO::Directory::CreateWalker("/tmp/some-folder", -** [](const String& filename, const String& parent, const String& name, uint64 size) -> Flow +** [](const String& filename, const String& parent, const String& name, uint64_t size) -> Flow ** { ** if (size > 0) ** { @@ -417,7 +417,7 @@ class IIterator ** } ** return IO::flowContinue; ** }, -** [](const String& filename, const String& parent, const String& name, uint64) -> Flow +** [](const String& filename, const String& parent, const String& name, uint64_t) -> Flow ** { ** std::cout << " . found folder " << pathname; ** return IO::flowContinue; diff --git a/src/ext/yuni/src/yuni/io/directory/iterator/iterator.hxx b/src/ext/yuni/src/yuni/io/directory/iterator/iterator.hxx index b5c73b20e5..1003a53b64 100644 --- a/src/ext/yuni/src/yuni/io/directory/iterator/iterator.hxx +++ b/src/ext/yuni/src/yuni/io/directory/iterator/iterator.hxx @@ -217,7 +217,7 @@ inline void IIterator::onEndFolder(const String&, const String&, cons } template -inline Flow IIterator::onFile(const String&, const String&, const String&, uint64) +inline Flow IIterator::onFile(const String&, const String&, const String&, uint64_t) { return flowContinue; // Do nothing } diff --git a/src/ext/yuni/src/yuni/io/exists.cpp b/src/ext/yuni/src/yuni/io/exists.cpp index 02b0474f28..c5dd1efb76 100644 --- a/src/ext/yuni/src/yuni/io/exists.cpp +++ b/src/ext/yuni/src/yuni/io/exists.cpp @@ -32,8 +32,8 @@ namespace IO namespace // anonymous { static inline NodeType Stat(const AnyString& filename, - yuint64& outSize, - yint64& lastModified, + uint64_t& outSize, + int64_t& lastModified, bool followSymLink) { assert(not filename.empty()); @@ -85,7 +85,7 @@ static inline NodeType Stat(const AnyString& filename, if (0 == ret) { lastModified = s.st_mtime; - outSize = (uint64)s.st_size; + outSize = (uint64_t)s.st_size; if (0 != S_ISREG(s.st_mode)) return Yuni::IO::typeFile; @@ -108,15 +108,15 @@ static inline NodeType Stat(const AnyString& filename, NodeType TypeOf(const AnyString& filename, bool followSymLink) { - yuint64 size; // useless - yint64 lastModified; + uint64_t size; // useless + int64_t lastModified; return (YUNI_LIKELY(not filename.empty())) ? Stat(filename, size, lastModified, followSymLink) : IO::typeUnknown; } NodeType FetchFileStatus(const AnyString& filename, - yuint64& size, - yint64& lastModified, + uint64_t& size, + int64_t& lastModified, bool followSymLink) { size = 0u; diff --git a/src/ext/yuni/src/yuni/io/file/copy.cpp b/src/ext/yuni/src/yuni/io/file/copy.cpp index e6a8bd55bc..ea70c6cf85 100644 --- a/src/ext/yuni/src/yuni/io/file/copy.cpp +++ b/src/ext/yuni/src/yuni/io/file/copy.cpp @@ -72,7 +72,7 @@ Error Copy(const AnyString& from, const AnyString& to, bool overwrite) // Generic implementation char* buffer = new char[size]; - uint64 numRead; + uint64_t numRead; while ((numRead = fromFile.read(buffer, size)) != 0) { if (numRead != toFile.write(buffer, numRead)) diff --git a/src/ext/yuni/src/yuni/io/file/file.cpp b/src/ext/yuni/src/yuni/io/file/file.cpp index 2efa2dea03..efe0dc80f8 100644 --- a/src/ext/yuni/src/yuni/io/file/file.cpp +++ b/src/ext/yuni/src/yuni/io/file/file.cpp @@ -39,7 +39,7 @@ bool CreateEmptyFile(const AnyString& filename) #ifdef YUNI_OS_WINDOWS -bool Size(const AnyString& filename, uint64& value) +bool Size(const AnyString& filename, uint64_t& value) { uint len = filename.size(); if (!len) @@ -84,7 +84,7 @@ bool Size(const AnyString& filename, uint64& value) value = 0u; return false; } - value = (uint64)v.QuadPart; + value = (uint64_t)v.QuadPart; CloseHandle(hndl); return true; @@ -92,12 +92,12 @@ bool Size(const AnyString& filename, uint64& value) #else -bool Size(const AnyString& filename, uint64& value) +bool Size(const AnyString& filename, uint64_t& value) { struct stat results; if (not filename.empty() and stat(filename.c_str(), &results) == 0) { - value = (uint64)results.st_size; + value = (uint64_t)results.st_size; return true; } value = 0u; @@ -167,10 +167,10 @@ bool GetLastWriteTime(HANDLE hFile) #endif -sint64 LastModificationTime(const AnyString& filename) +int64_t LastModificationTime(const AnyString& filename) { - uint64 size; - sint64 lastModified; + uint64_t size; + int64_t lastModified; IO::FetchFileStatus(filename, size, lastModified); return lastModified; } @@ -180,7 +180,7 @@ namespace // anonymous template static inline IO::Error LoadFromFileImpl(StringT& out, const AnyString& filename, - const uint64 hardlimit) + const uint64_t hardlimit) { out.clear(); Yuni::IO::File::Stream f(filename); @@ -189,7 +189,7 @@ static inline IO::Error LoadFromFileImpl(StringT& out, // retrieve the file size in bytes f.seekFromEndOfFile(0); - uint64 filesize = (uint64)f.tell(); + uint64_t filesize = (uint64_t)f.tell(); if (filesize == 0) { @@ -204,11 +204,11 @@ static inline IO::Error LoadFromFileImpl(StringT& out, { smallFragment = 512 * 1024 }; - uint64 offset = 0; + uint64_t offset = 0; do { out.reserve(((typename StringT::size_type)offset) + smallFragment); - uint64 numread = f.read((char*)out.data() + offset, smallFragment); + uint64_t numread = f.read((char*)out.data() + offset, smallFragment); if (numread != smallFragment) { out.resize((typename StringT::size_type)(offset + numread)); @@ -238,7 +238,7 @@ static inline IO::Error LoadFromFileImpl(StringT& out, }; if (filesize < fragment) { - uint64 numread = f.read((char*)out.data(), filesize); + uint64_t numread = f.read((char*)out.data(), filesize); if (numread != filesize) { out.clear(); @@ -247,10 +247,10 @@ static inline IO::Error LoadFromFileImpl(StringT& out, } else { - uint64 offset = 0; + uint64_t offset = 0; while (filesize >= fragment) { - uint64 numread = f.read((char*)out.data() + offset, fragment); + uint64_t numread = f.read((char*)out.data() + offset, fragment); if (numread != fragment) { out.resize((typename StringT::size_type)offset); @@ -261,7 +261,7 @@ static inline IO::Error LoadFromFileImpl(StringT& out, } if (filesize != 0) { - uint64 numread = f.read((char*)out.data() + offset, filesize); + uint64_t numread = f.read((char*)out.data() + offset, filesize); if (numread != filesize) { out.resize((typename StringT::size_type)offset); @@ -275,17 +275,17 @@ static inline IO::Error LoadFromFileImpl(StringT& out, } // anonymous namespace -IO::Error LoadFromFile(std::string& out, const AnyString& filename, uint64 hardlimit) +IO::Error LoadFromFile(std::string& out, const AnyString& filename, uint64_t hardlimit) { return LoadFromFileImpl(out, filename, hardlimit); } -IO::Error LoadFromFile(String& out, const AnyString& filename, uint64 hardlimit) +IO::Error LoadFromFile(String& out, const AnyString& filename, uint64_t hardlimit) { return LoadFromFileImpl(out, filename, hardlimit); } -IO::Error LoadFromFile(Clob& out, const AnyString& filename, uint64 hardlimit) +IO::Error LoadFromFile(Clob& out, const AnyString& filename, uint64_t hardlimit) { return LoadFromFileImpl(out, filename, hardlimit); } diff --git a/src/ext/yuni/src/yuni/io/file/file.h b/src/ext/yuni/src/yuni/io/file/file.h index 044bd3923b..26c5081568 100644 --- a/src/ext/yuni/src/yuni/io/file/file.h +++ b/src/ext/yuni/src/yuni/io/file/file.h @@ -48,7 +48,7 @@ bool Exists(const AnyString& filename); *error has occured ** \return True if the operation succeeded, False otherwise */ -bool Size(const AnyString& filename, uint64& size); +bool Size(const AnyString& filename, uint64_t& size); /*! ** \brief Get the size (in bytes) of a file @@ -62,7 +62,7 @@ bool Size(const AnyString& filename, uint64& size); ** using namespace Yuni; ** int main() ** { -** Unit::Data::Octet::SIBaseUnit size = IO::File::Size("/path/to/my/file"); +** Unit::Data::Octet::SIBaseUnit size = IO::File::Size("/path/to/my/file"); ** std::cout << Unit::Data::Octet::Megaoctet(size) << std::endl; ** return 0; ** } @@ -72,14 +72,14 @@ bool Size(const AnyString& filename, uint64& size); ** \return The size (in bytes) of the file. The returned value is guaranteed to be null is an error *has occured */ -uint64 Size(const AnyString& filename); +uint64_t Size(const AnyString& filename); //! \name Date / Time //@{ /*! ** \brief Get the unix timestamp of the last modification */ -sint64 LastModificationTime(const AnyString& filename); +int64_t LastModificationTime(const AnyString& filename); //@} //! \name Load the content of a file @@ -96,7 +96,7 @@ sint64 LastModificationTime(const AnyString& filename); */ IO::Error LoadFromFile(std::string& out, const AnyString& filename, - uint64 hardlimit = sizeHardLimit); + uint64_t hardlimit = sizeHardLimit); /*! ** \brief Load the entire content of a file into memory ** @@ -107,7 +107,7 @@ IO::Error LoadFromFile(std::string& out, ** \param hardlimit If the size of the file exceeds this limit, it will not be loaded ** \return errNone if successful */ -IO::Error LoadFromFile(String& out, const AnyString& filename, uint64 hardlimit = sizeHardLimit); +IO::Error LoadFromFile(String& out, const AnyString& filename, uint64_t hardlimit = sizeHardLimit); /*! ** \brief Load the entire content of a file into memory ** @@ -118,7 +118,7 @@ IO::Error LoadFromFile(String& out, const AnyString& filename, uint64 hardlimit ** \param hardlimit If the size of the file exceeds this limit, it will not be loaded ** \return errNone if successful */ -IO::Error LoadFromFile(Clob& out, const AnyString& filename, uint64 hardlimit = sizeHardLimit); +IO::Error LoadFromFile(Clob& out, const AnyString& filename, uint64_t hardlimit = sizeHardLimit); /*! ** \brief Save the content of a string into a file diff --git a/src/ext/yuni/src/yuni/io/file/file.hxx b/src/ext/yuni/src/yuni/io/file/file.hxx index f345b7cd06..a73cfe42a6 100644 --- a/src/ext/yuni/src/yuni/io/file/file.hxx +++ b/src/ext/yuni/src/yuni/io/file/file.hxx @@ -20,9 +20,9 @@ namespace IO { namespace File { -inline uint64 Size(const AnyString& filename) +inline uint64_t Size(const AnyString& filename) { - uint64 size; + uint64_t size; return (Size(filename, size)) ? size : 0; } diff --git a/src/ext/yuni/src/yuni/io/file/stream.cpp b/src/ext/yuni/src/yuni/io/file/stream.cpp index c7e9bd7aee..8815990c22 100644 --- a/src/ext/yuni/src/yuni/io/file/stream.cpp +++ b/src/ext/yuni/src/yuni/io/file/stream.cpp @@ -185,23 +185,23 @@ void Stream::unlock() #endif } -uint64 Stream::read(char* buffer, uint64 size) +uint64_t Stream::read(char* buffer, uint64_t size) { // TODO We should not read with block too large (especially on 32bits) // systems. It can make the process/thread interruptible too long - return (uint64)::fread(buffer, 1, (size_t)size, pFd); + return (uint64_t)::fread(buffer, 1, (size_t)size, pFd); } -uint64 Stream::write(const char* buffer, uint64 size) +uint64_t Stream::write(const char* buffer, uint64_t size) { // TODO We should not write with block too large (especially on 32bits) // systems. It can make the process/thread interruptible too long - return (uint64)::fwrite(buffer, 1, (size_t)size, pFd); + return (uint64_t)::fwrite(buffer, 1, (size_t)size, pFd); } #if !defined(YUNI_HAS_POSIX_FALLOCATE) and !defined(YUNI_OS_MAC) -static bool TruncateFileDefault(Stream& file, uint64 size) +static bool TruncateFileDefault(Stream& file, uint64_t size) { // Default implementation @@ -213,12 +213,12 @@ static bool TruncateFileDefault(Stream& file, uint64 size) #ifndef YUNI_OS_MSVC bool result = (0 == ::ftruncate(FILENO(file.nativeHandle()), (off_t)size)); #else - bool result = (0 == _chsize_s(FILENO(file.nativeHandle()), (sint64)size)); + bool result = (0 == _chsize_s(FILENO(file.nativeHandle()), (int64_t)size)); #endif if (result) { // if the file was already bigger than the new size, there is nothing to do - if ((uint64)end >= size) + if ((uint64_t)end >= size) return true; if (not file.seekFromBeginning(end)) @@ -228,7 +228,7 @@ static bool TruncateFileDefault(Stream& file, uint64 size) { bufferSize = 1024 * 1024 }; - size -= (uint64)end; + size -= (uint64_t)end; if (size) { @@ -262,7 +262,7 @@ static bool TruncateFileDefault(Stream& file, uint64 size) #endif -bool Stream::truncate(uint64 size, bool ensureAllocation) +bool Stream::truncate(uint64_t size, bool ensureAllocation) { if (pFd) { @@ -273,7 +273,7 @@ bool Stream::truncate(uint64 size, bool ensureAllocation) #ifndef YUNI_OS_MSVC return (0 == ::ftruncate(fd, (off_t)size)); #else - return (0 == _chsize_s(fd, (sint64)size)); + return (0 == _chsize_s(fd, (int64_t)size)); #endif } else diff --git a/src/ext/yuni/src/yuni/io/file/stream.h b/src/ext/yuni/src/yuni/io/file/stream.h index 893f4523f6..b669d5d395 100644 --- a/src/ext/yuni/src/yuni/io/file/stream.h +++ b/src/ext/yuni/src/yuni/io/file/stream.h @@ -252,7 +252,7 @@ class Stream final : private NonCopyable ** \return The number of bytes that have been read */ template - uint64 read(CString& buffer, uint64 size); + uint64_t read(CString& buffer, uint64_t size); /*! ** \brief Read a buffer @@ -261,7 +261,7 @@ class Stream final : private NonCopyable ** \param size Size (in bytes) of the data to read (and size of the buffer) ** \return The number of bytes that have been read */ - uint64 read(char* buffer, uint64 size); + uint64_t read(char* buffer, uint64_t size); /*! ** \brief Read data into a string buffer @@ -274,7 +274,7 @@ class Stream final : private NonCopyable ** \return The number of bytes that have been read */ template - uint64 chunkRead(CString& buffer); + uint64_t chunkRead(CString& buffer); //@} //! \name Write @@ -291,7 +291,7 @@ class Stream final : private NonCopyable ** \param size Size of the buffer to write ** \return The number of bytes that have been written */ - uint64 write(const char* buffer, uint64 size); + uint64_t write(const char* buffer, uint64_t size); /*! ** \brief Write any arbitrary buffer @@ -300,22 +300,22 @@ class Stream final : private NonCopyable ** \return The number of bytes that have been written */ template - uint64 write(const U& buffer); + uint64_t write(const U& buffer); //! Write an interger uint write(char buffer); //! Write an interger - uint write(sint16 value); + uint write(int16_t value); //! Write an interger - uint write(sint32 value); + uint write(int32_t value); //! Write an interger - uint write(sint64 value); + uint write(int64_t value); //! Write an interger uint write(uint16 value); //! Write an interger - uint write(uint32 value); + uint write(uint32_t value); //! Write an interger - uint write(uint64 value); + uint write(uint64_t value); //! Write a bool uint write(bool value); //! Write a float @@ -331,27 +331,27 @@ class Stream final : private NonCopyable ** \return The number of bytes that have been written */ template - uint64 write(const U& buffer, uint64 maxsize); - uint write(char buffer, uint64 maxsize); + uint64_t write(const U& buffer, uint64_t maxsize); + uint write(char buffer, uint64_t maxsize); //! Write an interger - uint write(sint16 value, uint64 maxsize); + uint write(int16_t value, uint64_t maxsize); //! Write an interger - uint write(sint32 value, uint64 maxsize); + uint write(int32_t value, uint64_t maxsize); //! Write an interger - uint write(sint64 value, uint64 maxsize); + uint write(int64_t value, uint64_t maxsize); //! Write an interger - uint write(uint16 value, uint64 maxsize); + uint write(uint16 value, uint64_t maxsize); //! Write an interger - uint write(uint32 value, uint64 maxsize); + uint write(uint32_t value, uint64_t maxsize); //! Write an interger - uint write(uint64 value, uint64 maxsize); + uint write(uint64_t value, uint64_t maxsize); //! Write a bool - uint write(bool value, uint64 maxsize); + uint write(bool value, uint64_t maxsize); //! Write a float - uint write(float value, uint64 maxsize); + uint write(float value, uint64_t maxsize); //! Write a double - uint write(double value, uint64 maxsize); + uint write(double value, uint64_t maxsize); //@} //! \name Locking @@ -393,7 +393,7 @@ class Stream final : private NonCopyable ** \param ensureAllocation True to make sure that the data are really allocated ** \return True if the file has been resized */ - bool truncate(uint64 size, bool ensureAllocation = false); + bool truncate(uint64_t size, bool ensureAllocation = false); //@} //! \name Native diff --git a/src/ext/yuni/src/yuni/io/file/stream.hxx b/src/ext/yuni/src/yuni/io/file/stream.hxx index d8c9efc512..0e47b4e14e 100644 --- a/src/ext/yuni/src/yuni/io/file/stream.hxx +++ b/src/ext/yuni/src/yuni/io/file/stream.hxx @@ -121,7 +121,7 @@ inline uint Stream::write(bool value) return value ? (uint)::fwrite("true", 4, 1, pFd) : (uint)::fwrite("false", 5, 1, pFd); } -inline uint Stream::write(bool value, uint64 maxsize) +inline uint Stream::write(bool value, uint64_t maxsize) { return value ? (uint)::fwrite("true", (4 < maxsize) ? 4 : static_cast(maxsize), 1, pFd) @@ -139,7 +139,7 @@ inline uint Stream::write(float value) return static_cast(::fwrite(string.c_str(), 1, string.size(), pFd)); } -inline uint Stream::write(float value, uint64 maxsize) +inline uint Stream::write(float value, uint64_t maxsize) { ShortString64 string(value); return static_cast( @@ -155,7 +155,7 @@ inline uint Stream::write(double value) return static_cast(::fwrite(string.c_str(), 1, string.size(), pFd)); } -inline uint Stream::write(double value, uint64 maxsize) +inline uint Stream::write(double value, uint64_t maxsize) { ShortString128 string(value); return (uint)::fwrite(string.c_str(), @@ -164,13 +164,13 @@ inline uint Stream::write(double value, uint64 maxsize) pFd); } -inline uint Stream::write(sint16 value) +inline uint Stream::write(int16_t value) { ShortString32 string(value); return (uint)::fwrite(string.c_str(), 1, string.size(), pFd); } -inline uint Stream::write(sint16 value, uint64 maxsize) +inline uint Stream::write(int16_t value, uint64_t maxsize) { ShortString32 string(value); return (uint)::fwrite(string.c_str(), @@ -179,13 +179,13 @@ inline uint Stream::write(sint16 value, uint64 maxsize) pFd); } -inline uint Stream::write(sint32 value) +inline uint Stream::write(int32_t value) { ShortString32 string(value); return (uint)::fwrite(string.c_str(), 1, string.size(), pFd); } -inline uint Stream::write(sint32 value, uint64 maxsize) +inline uint Stream::write(int32_t value, uint64_t maxsize) { ShortString32 string(value); return (uint)::fwrite(string.c_str(), @@ -194,13 +194,13 @@ inline uint Stream::write(sint32 value, uint64 maxsize) pFd); } -inline uint Stream::write(sint64 value) +inline uint Stream::write(int64_t value) { ShortString32 string(value); return (uint)::fwrite(string.c_str(), 1, string.size(), pFd); } -inline uint Stream::write(sint64 value, uint64 maxsize) +inline uint Stream::write(int64_t value, uint64_t maxsize) { ShortString32 string(value); return (uint)::fwrite(string.c_str(), @@ -215,7 +215,7 @@ inline uint Stream::write(uint16 value) return (uint)::fwrite(string.c_str(), 1, string.size(), pFd); } -inline uint Stream::write(uint16 value, uint64 maxsize) +inline uint Stream::write(uint16 value, uint64_t maxsize) { ShortString32 string(value); return (uint)::fwrite(string.c_str(), @@ -224,13 +224,13 @@ inline uint Stream::write(uint16 value, uint64 maxsize) pFd); } -inline uint Stream::write(uint32 value) +inline uint Stream::write(uint32_t value) { ShortString32 string(value); return (uint)::fwrite(string.c_str(), 1, string.size(), pFd); } -inline uint Stream::write(uint32 value, uint64 maxsize) +inline uint Stream::write(uint32_t value, uint64_t maxsize) { ShortString32 string(value); return (uint)::fwrite(string.c_str(), @@ -239,13 +239,13 @@ inline uint Stream::write(uint32 value, uint64 maxsize) pFd); } -inline uint Stream::write(uint64 value) +inline uint Stream::write(uint64_t value) { ShortString32 string(value); return (uint)::fwrite(string.c_str(), 1, string.size(), pFd); } -inline uint Stream::write(uint64 value, uint64 maxsize) +inline uint Stream::write(uint64_t value, uint64_t maxsize) { ShortString32 string(value); return static_cast( @@ -256,22 +256,22 @@ inline uint Stream::write(uint64 value, uint64 maxsize) } template -inline uint64 Stream::write(const U& buffer) +inline uint64_t Stream::write(const U& buffer) { String string(buffer); - return (uint64)::fwrite(string.c_str(), 1, string.size(), pFd); + return (uint64_t)::fwrite(string.c_str(), 1, string.size(), pFd); } -inline uint Stream::write(char buffer, uint64 maxsize) +inline uint Stream::write(char buffer, uint64_t maxsize) { return (maxsize != 0) ? ((EOF != ::fputc(static_cast(buffer), pFd)) ? 1 : 0) : 0; } template -inline uint64 Stream::write(const U& buffer, uint64 maxsize) +inline uint64_t Stream::write(const U& buffer, uint64_t maxsize) { String string(buffer); - return (uint64)::fwrite(string.c_str(), + return (uint64_t)::fwrite(string.c_str(), 1, string.size() > maxsize ? static_cast(maxsize) : string.size(), pFd); @@ -309,10 +309,10 @@ inline Stream& Stream::operator<<(const U& u) } template -inline uint64 Stream::read(CString& buffer, uint64 size) +inline uint64_t Stream::read(CString& buffer, uint64_t size) { assert(pFd and "File not opened"); - assert(size <= static_cast(2 * 1024) * 1024u * 1024u); + assert(size <= static_cast(2 * 1024) * 1024u * 1024u); if (0 == size) return 0; @@ -342,7 +342,7 @@ inline uint64 Stream::read(CString& buffer, uint64 size) } template -inline uint64 Stream::chunkRead(CString& buffer) +inline uint64_t Stream::chunkRead(CString& buffer) { // Resizing the buffer buffer.reserve(buffer.chunkSize); @@ -353,7 +353,7 @@ inline uint64 Stream::chunkRead(CString& buffer) typedef CString StringType; typedef typename StringType::Char C; // Reading the file - const uint64 result = ::fread(buffer.data(), 1, sizeof(C) * buffer.chunkSize, pFd); + const uint64_t result = ::fread(buffer.data(), 1, sizeof(C) * buffer.chunkSize, pFd); // Setting the good size, because we may have read less than asked if (result < buffer.size()) buffer.truncate(static_cast(result)); diff --git a/src/ext/yuni/src/yuni/io/io.h b/src/ext/yuni/src/yuni/io/io.h index 3cac75a0f5..c07272f3b9 100644 --- a/src/ext/yuni/src/yuni/io/io.h +++ b/src/ext/yuni/src/yuni/io/io.h @@ -48,8 +48,8 @@ NodeType TypeOf(const AnyString& filename, bool followSymLink = true); ** \return True if it exists, false otherwise */ NodeType FetchFileStatus(const AnyString& filename, - yuint64& size, - yint64& lastModified, + uint64_t& size, + int64_t& lastModified, bool followSymLink = true); } // namespace IO diff --git a/src/ext/yuni/src/yuni/job/job.hxx b/src/ext/yuni/src/yuni/job/job.hxx index 771ab2213c..836f26294c 100644 --- a/src/ext/yuni/src/yuni/job/job.hxx +++ b/src/ext/yuni/src/yuni/job/job.hxx @@ -17,7 +17,7 @@ namespace Job { inline enum Job::State IJob::state() const { - return (enum Job::State)((sint32)pState); + return (enum Job::State)((int32_t)pState); } inline bool IJob::idle() const diff --git a/src/ext/yuni/src/yuni/thread/every.cpp b/src/ext/yuni/src/yuni/thread/every.cpp index cb64479325..2ffe00c6bd 100644 --- a/src/ext/yuni/src/yuni/thread/every.cpp +++ b/src/ext/yuni/src/yuni/thread/every.cpp @@ -59,7 +59,7 @@ template class EveryTimerElapsed final : public Thread::Timer { public: - EveryTimerElapsed(uint ms, const Bind& callback) : + EveryTimerElapsed(uint ms, const Bind& callback) : Thread::Timer(ms), pCallback(callback) { pLastTimestamp = DateTime::NowMilliSeconds(); @@ -80,7 +80,7 @@ class EveryTimerElapsed final : public Thread::Timer auto now = DateTime::NowMilliSeconds(); // callback - bool shouldContinue = pCallback((uint64)(now - pLastTimestamp)); + bool shouldContinue = pCallback((uint64_t)(now - pLastTimestamp)); // fetch again the current to avoid taking into consideration // the time spent in the callback @@ -92,7 +92,7 @@ class EveryTimerElapsed final : public Thread::Timer { // current timestamp in ms auto now = DateTime::NowMilliSeconds(); - uint64 elapsed = (uint64)(now - pLastTimestamp); + uint64_t elapsed = (uint64_t)(now - pLastTimestamp); pLastTimestamp = now; return pCallback(elapsed); @@ -100,11 +100,11 @@ class EveryTimerElapsed final : public Thread::Timer } private: - sint64 pLastTimestamp; - Bind pCallback; + int64_t pLastTimestamp; + Bind pCallback; }; -Thread::Timer::Ptr every(uint ms, bool precise, const Bind& callback, bool autostart) +Thread::Timer::Ptr every(uint ms, bool precise, const Bind& callback, bool autostart) { Thread::Timer* timer; diff --git a/src/ext/yuni/src/yuni/thread/id.cpp b/src/ext/yuni/src/yuni/thread/id.cpp index b1e9e2a0b9..a8344a8245 100644 --- a/src/ext/yuni/src/yuni/thread/id.cpp +++ b/src/ext/yuni/src/yuni/thread/id.cpp @@ -34,24 +34,24 @@ namespace Yuni namespace Thread { #ifndef YUNI_NO_THREAD_SAFE -uint64 ID() +uint64_t ID() { #ifdef YUNI_HAS_PTHREAD_GETTHREADID_NP - return (uint64)pthread_getthreadid_np(); + return (uint64_t)pthread_getthreadid_np(); #else #ifdef YUNI_OS_MAC - return (uint64)pthread_self(); + return (uint64_t)pthread_self(); #else #ifndef YUNI_OS_WINDOWS #ifdef YUNI_OS_LINUX - return (uint64)syscall(SYS_gettid); + return (uint64_t)syscall(SYS_gettid); #else // man : The pthread_self() function returns the thread ID of the calling thread - return (uint64)pthread_self(); + return (uint64_t)pthread_self(); #endif #else - return (uint64)GetCurrentThreadId(); + return (uint64_t)GetCurrentThreadId(); #endif #endif @@ -61,7 +61,7 @@ uint64 ID() #else -uint64 ID() +uint64_t ID() { return 0; } diff --git a/src/ext/yuni/src/yuni/thread/id.h b/src/ext/yuni/src/yuni/thread/id.h index 5a2f1b0545..205eeb7f3a 100644 --- a/src/ext/yuni/src/yuni/thread/id.h +++ b/src/ext/yuni/src/yuni/thread/id.h @@ -21,7 +21,7 @@ namespace Thread ** \warning This value should be considered as an arbitrary value ** (see implementation of pthread_self / GetCurrentThreadId) */ -YUNI_DECL uint64 ID(); +YUNI_DECL uint64_t ID(); } // namespace Thread } // namespace Yuni diff --git a/src/ext/yuni/src/yuni/thread/utility.h b/src/ext/yuni/src/yuni/thread/utility.h index ed30800760..77fe679f37 100644 --- a/src/ext/yuni/src/yuni/thread/utility.h +++ b/src/ext/yuni/src/yuni/thread/utility.h @@ -76,7 +76,7 @@ Thread::Timer::Ptr every(uint ms, const Bind& callback, bool autostart = ** ** int main() ** { -** auto timer = every(1000, false, [&] (uint64 elapsed) -> bool { +** auto timer = every(1000, false, [&] (uint64_t elapsed) -> bool { ** std::cout << elapsed << "ms since the last time" << std::endl; ** return true; // continue looping ** }); @@ -94,7 +94,7 @@ Thread::Timer::Ptr every(uint ms, const Bind& callback, bool autostart = */ Thread::Timer::Ptr every(uint ms, bool precise, - const Bind& callback, + const Bind& callback, bool autostart = true); } // namespace Yuni diff --git a/src/ext/yuni/src/yuni/uuid/uuid.h b/src/ext/yuni/src/yuni/uuid/uuid.h index 4b20ba807a..2b61bd8a0b 100644 --- a/src/ext/yuni/src/yuni/uuid/uuid.h +++ b/src/ext/yuni/src/yuni/uuid/uuid.h @@ -169,7 +169,7 @@ class YUNI_DECL UUID final union StorageType { uchar cstring[16]; - uint64 n64[2]; + uint64_t n64[2]; }; private: diff --git a/src/libs/antares/array/antares/array/matrix.h b/src/libs/antares/array/antares/array/matrix.h index ed0f99008e..0ad94e9081 100644 --- a/src/libs/antares/array/antares/array/matrix.h +++ b/src/libs/antares/array/antares/array/matrix.h @@ -430,10 +430,10 @@ class Matrix bool empty() const; //! Get the amount of memory used by the matrix - Yuni::uint64 memoryUsage() const; + uint64_t memoryUsage() const; //! Get the amount of memory used by the matrix - Yuni::uint64 valuesMemoryUsage() const; + uint64_t valuesMemoryUsage() const; //@} /*! diff --git a/src/libs/antares/array/antares/array/matrix.hxx b/src/libs/antares/array/antares/array/matrix.hxx index 9a537ecca3..9e2420624f 100644 --- a/src/libs/antares/array/antares/array/matrix.hxx +++ b/src/libs/antares/array/antares/array/matrix.hxx @@ -508,14 +508,14 @@ inline bool Matrix::empty() const } template -inline Yuni::uint64 Matrix::memoryUsage() const +inline uint64_t Matrix::memoryUsage() const { return sizeof(Matrix) + (sizeof(T) * (width * height)) + ((jit) ? jit->memoryUsage() : 0); } template -inline Yuni::uint64 Matrix::valuesMemoryUsage() const +inline uint64_t Matrix::valuesMemoryUsage() const { return (sizeof(T) * (width * height)); } diff --git a/src/libs/antares/benchmarking/timer.cpp b/src/libs/antares/benchmarking/timer.cpp index 1258b835d3..a76c2fdd91 100644 --- a/src/libs/antares/benchmarking/timer.cpp +++ b/src/libs/antares/benchmarking/timer.cpp @@ -30,7 +30,7 @@ using namespace Yuni; -static inline sint64 MilliSecTimer() +static inline int64_t MilliSecTimer() { Yuni::timeval tv; YUNI_SYSTEM_GETTIMEOFDAY(&tv, nullptr); diff --git a/src/libs/antares/correlation/antares/correlation/correlation.h b/src/libs/antares/correlation/antares/correlation/correlation.h index f69f23bcd7..0db3c21e7b 100644 --- a/src/libs/antares/correlation/antares/correlation/correlation.h +++ b/src/libs/antares/correlation/antares/correlation/correlation.h @@ -140,7 +140,7 @@ class Correlation final /*! ** \brief Get the amount of memory used the correlation matrices */ - Yuni::uint64 memoryUsage() const; + uint64_t memoryUsage() const; /*! ** \brief Invalidate all matrices diff --git a/src/libs/antares/correlation/correlation.cpp b/src/libs/antares/correlation/correlation.cpp index 0714162625..b6673f238b 100644 --- a/src/libs/antares/correlation/correlation.cpp +++ b/src/libs/antares/correlation/correlation.cpp @@ -582,9 +582,9 @@ void Correlation::retrieveMontlyMatrixArray(const Matrix<>* array[12]) const } } -Yuni::uint64 Correlation::memoryUsage() const +uint64_t Correlation::memoryUsage() const { - Yuni::uint64 r = sizeof(Correlation); + uint64_t r = sizeof(Correlation); if (annual) r += annual->memoryUsage(); if (monthly) diff --git a/src/libs/antares/inifile/antares/inifile/inifile.h b/src/libs/antares/inifile/antares/inifile/inifile.h index 9fad64aedd..51e7df3465 100644 --- a/src/libs/antares/inifile/antares/inifile/inifile.h +++ b/src/libs/antares/inifile/antares/inifile/inifile.h @@ -55,7 +55,7 @@ class IniFile final ~Property(); template - void saveToStream(StreamT& file, yuint64& written) const; + void saveToStream(StreamT& file, uint64_t& written) const; public: //! The key @@ -87,7 +87,7 @@ class IniFile final Property* add(const AnyString& key, const std::optional& value); template - void saveToStream(StreamT& file, yuint64& written) const; + void saveToStream(StreamT& file, uint64_t& written) const; Property* find(const AnyString& key); const Property* find(const AnyString& key) const; diff --git a/src/libs/antares/inifile/inifile.cpp b/src/libs/antares/inifile/inifile.cpp index 3559eca996..7c59dcaf7e 100644 --- a/src/libs/antares/inifile/inifile.cpp +++ b/src/libs/antares/inifile/inifile.cpp @@ -39,7 +39,7 @@ static inline IniFile::Section* AnalyzeIniLine(const String& pFilename, IniFile* d, IniFile::Section* section, char* line, - uint64& read) + uint64_t& read) { enum Type { @@ -134,14 +134,14 @@ IniFile::Property::~Property() } template -inline void IniFile::Property::saveToStream(StreamT& file, uint64& written) const +inline void IniFile::Property::saveToStream(StreamT& file, uint64_t& written) const { written += key.size() + value.size() + 4; file << key << " = " << value << '\n'; } template -void IniFile::Section::saveToStream(StreamT& file, uint64& written) const +void IniFile::Section::saveToStream(StreamT& file, uint64_t& written) const { if (!firstProperty) return; @@ -258,7 +258,7 @@ bool IniFile::open(const AnyString& filename, bool warnings) auto* line = new char[lineHardLimit]; IniFile::Section* lastSection = nullptr; - uint64 read = 0; + uint64_t read = 0; // analyzing each line while (file.readline(line, lineHardLimit)) @@ -280,7 +280,7 @@ bool IniFile::open(const AnyString& filename, bool warnings) void IniFile::saveToString(std::string& str) const { - uint64 written = 0; + uint64_t written = 0; std::ostringstream ostream; // save all sections for (auto* section = firstSection; section; section = section->next) @@ -299,7 +299,7 @@ bool IniFile::save(const AnyString& filename) const if (f.openRW(filename)) { pFilename = filename; - uint64 written = 0; + uint64_t written = 0; // save all sections for (auto* section = firstSection; section; section = section->next) diff --git a/src/libs/antares/io/antares/io/statistics.h b/src/libs/antares/io/antares/io/statistics.h index 3d4c96d956..d22c4f3f1b 100644 --- a/src/libs/antares/io/antares/io/statistics.h +++ b/src/libs/antares/io/antares/io/statistics.h @@ -36,62 +36,62 @@ namespace Statistics /*! ** \brief Get the amount of data (in bytes) which have been read from the disk */ -Yuni::uint64 ReadFromDisk(); +uint64_t ReadFromDisk(); /*! ** \brief Get the amount of data (in bytes) which have been written to the disk */ -Yuni::uint64 WrittenToDisk(); +uint64_t WrittenToDisk(); /*! ** \brief Get the amount of data (in bytes) which have been read from the disk since the startup */ -Yuni::uint64 ReadFromDiskSinceStartup(); +uint64_t ReadFromDiskSinceStartup(); /*! ** \brief Get the amount of data (in bytes) which have been written to the disk since the startup */ -Yuni::uint64 WrittenToDiskSinceStartup(); +uint64_t WrittenToDiskSinceStartup(); /*! ** \brief Get the amount of data (in bytes) which have been read from the network */ -Yuni::uint64 ReadFromNetwork(); +uint64_t ReadFromNetwork(); /*! ** \brief Get the amount of data (in bytes) which have been written to the network */ -Yuni::uint64 WrittenToNetwork(); +uint64_t WrittenToNetwork(); /*! ** \brief Get the amount of data (in bytes) which have been read from the network since the startup */ -Yuni::uint64 ReadFromNetworkSinceStartup(); +uint64_t ReadFromNetworkSinceStartup(); /*! ** \brief Get the amount of data (in bytes) which have been written to the network since the startup */ -Yuni::uint64 WrittenToNetworkSinceStartup(); +uint64_t WrittenToNetworkSinceStartup(); /*! ** \brief Notify taht a certain amount of data (in bytes) has been read from disk */ -void HasReadFromDisk(Yuni::uint64 size); +void HasReadFromDisk(uint64_t size); /*! ** \brief Notify taht a certain amount of data (in bytes) has been written to disk */ -void HasWrittenToDisk(Yuni::uint64 size); +void HasWrittenToDisk(uint64_t size); /*! ** \brief Notify taht a certain amount of data (in bytes) has been read from the network */ -void HasReadFromNetwork(Yuni::uint64 size); +void HasReadFromNetwork(uint64_t size); /*! ** \brief Notify taht a certain amount of data (in bytes) has been sent to the network */ -void HasWrittenToNetwork(Yuni::uint64 size); +void HasWrittenToNetwork(uint64_t size); /*! ** \brief Reset the internal counters diff --git a/src/libs/antares/io/statistics.cpp b/src/libs/antares/io/statistics.cpp index 0fe4ebb320..7795abe2f6 100644 --- a/src/libs/antares/io/statistics.cpp +++ b/src/libs/antares/io/statistics.cpp @@ -37,66 +37,66 @@ namespace Statistics { namespace // anonymous namespace { -static uint64 gReadFromDisk; -static uint64 gWrittenToDisk; -static uint64 gReadFromNetwork; -static uint64 gWrittenToNetwork; +static uint64_t gReadFromDisk; +static uint64_t gWrittenToDisk; +static uint64_t gReadFromNetwork; +static uint64_t gWrittenToNetwork; -static uint64 gReadFromDiskSinceStartup; -static uint64 gWrittenToDiskSinceStartup; -static uint64 gReadFromNetworkSinceStartup; -static uint64 gWrittenToNetworkSinceStartup; +static uint64_t gReadFromDiskSinceStartup; +static uint64_t gWrittenToDiskSinceStartup; +static uint64_t gReadFromNetworkSinceStartup; +static uint64_t gWrittenToNetworkSinceStartup; static Yuni::Mutex gMutex; } // anonymous namespace -uint64 ReadFromDisk() +uint64_t ReadFromDisk() { Yuni::MutexLocker locker(gMutex); - return (uint64)gReadFromDisk; + return (uint64_t)gReadFromDisk; } -uint64 WrittenToDisk() +uint64_t WrittenToDisk() { Yuni::MutexLocker locker(gMutex); - return (uint64)gWrittenToDisk; + return (uint64_t)gWrittenToDisk; } -uint64 ReadFromDiskSinceStartup() +uint64_t ReadFromDiskSinceStartup() { Yuni::MutexLocker locker(gMutex); - return (uint64)gReadFromDiskSinceStartup; + return (uint64_t)gReadFromDiskSinceStartup; } -uint64 WrittenToDiskSinceStartup() +uint64_t WrittenToDiskSinceStartup() { Yuni::MutexLocker locker(gMutex); - return (uint64)((sint64)gWrittenToDiskSinceStartup); + return (int64_t)gWrittenToDiskSinceStartup; } -uint64 ReadFromNetwork() +uint64_t ReadFromNetwork() { Yuni::MutexLocker locker(gMutex); - return (uint64)gReadFromNetwork; + return (uint64_t)gReadFromNetwork; } -uint64 WrittenToNetwork() +uint64_t WrittenToNetwork() { Yuni::MutexLocker locker(gMutex); - return (uint64)gWrittenToNetwork; + return (uint64_t)gWrittenToNetwork; } -uint64 ReadFromNetworkSinceStartup() +uint64_t ReadFromNetworkSinceStartup() { Yuni::MutexLocker locker(gMutex); - return (uint64)gReadFromNetworkSinceStartup; + return (uint64_t)gReadFromNetworkSinceStartup; } -uint64 WrittenToNetworkSinceStartup() +uint64_t WrittenToNetworkSinceStartup() { Yuni::MutexLocker locker(gMutex); - return (uint64)gWrittenToNetworkSinceStartup; + return (uint64_t)gWrittenToNetworkSinceStartup; } void Reset() @@ -117,28 +117,28 @@ void DumpToLogs() << " ko, written: " << (gWrittenToNetwork / 1024) << " ko"; } -void HasReadFromDisk(Yuni::uint64 size) +void HasReadFromDisk(uint64_t size) { Yuni::MutexLocker locker(gMutex); gReadFromDisk += size; gReadFromDiskSinceStartup += size; } -void HasWrittenToDisk(Yuni::uint64 size) +void HasWrittenToDisk(uint64_t size) { Yuni::MutexLocker locker(gMutex); gWrittenToDisk += size; gWrittenToDiskSinceStartup += size; } -void HasReadFromNetwork(Yuni::uint64 size) +void HasReadFromNetwork(uint64_t size) { Yuni::MutexLocker locker(gMutex); gReadFromNetwork += size; gReadFromNetworkSinceStartup += size; } -void HasWrittenToNetwork(Yuni::uint64 size) +void HasWrittenToNetwork(uint64_t size) { Yuni::MutexLocker locker(gMutex); gWrittenToNetwork += size; diff --git a/src/libs/antares/jit/antares/jit/jit.h b/src/libs/antares/jit/antares/jit/jit.h index dfdf300629..b8b3a2051a 100644 --- a/src/libs/antares/jit/antares/jit/jit.h +++ b/src/libs/antares/jit/antares/jit/jit.h @@ -134,7 +134,7 @@ class JIT final void markAsModified(); //! Get the amount of memory currently used - yuint64 memoryUsage() const; + uint64_t memoryUsage() const; public: //! Filename/folder to consider if some data should be loaded @@ -167,7 +167,7 @@ class JIT final unsigned estimatedSize[2]; //! Timestamp of the last modification - Yuni::sint64 lastModification; + int64_t lastModification; }; // class Informations diff --git a/src/libs/antares/jit/antares/jit/jit.hxx b/src/libs/antares/jit/antares/jit/jit.hxx index 34170276ad..a987b21a5d 100644 --- a/src/libs/antares/jit/antares/jit/jit.hxx +++ b/src/libs/antares/jit/antares/jit/jit.hxx @@ -36,7 +36,7 @@ inline bool JIT::IsReady(JIT::Informations* j) return (!j or j->alreadyLoaded); } -inline Yuni::uint64 JIT::Informations::memoryUsage() const +inline uint64_t JIT::Informations::memoryUsage() const { return sizeof(JIT::Informations) + sourceFilename.capacity(); } diff --git a/src/libs/antares/memory/include/antares/memory/memory.h b/src/libs/antares/memory/include/antares/memory/memory.h index 91cb90d1a4..2f818b2c66 100644 --- a/src/libs/antares/memory/include/antares/memory/memory.h +++ b/src/libs/antares/memory/include/antares/memory/memory.h @@ -148,14 +148,14 @@ class Memory final : public Yuni::Policy::ObjectLevelLockable /*! ** \brief Get the amount of memory currently used */ - Yuni::uint64 memoryUsage() const; + uint64_t memoryUsage() const; /*! ** \brief Get the process ID of the application ** ** This value is cached and detected at the creation of the instance. */ - Yuni::uint64 processID() const; + uint64_t processID() const; //@} @@ -172,7 +172,7 @@ class Memory final : public Yuni::Policy::ObjectLevelLockable bool pAllowedToChangeCacheFolder; //! The process ID used - Yuni::uint64 pProcessID; + uint64_t pProcessID; //! Avoid multiple initializations bool pAlreadyInitialized = false; diff --git a/src/libs/antares/memory/include/antares/memory/memory.hxx b/src/libs/antares/memory/include/antares/memory/memory.hxx index cc69683e23..0417176fec 100644 --- a/src/libs/antares/memory/include/antares/memory/memory.hxx +++ b/src/libs/antares/memory/include/antares/memory/memory.hxx @@ -29,7 +29,7 @@ namespace Antares { -inline Yuni::uint64 Memory::processID() const +inline uint64_t Memory::processID() const { return pProcessID; } diff --git a/src/libs/antares/mersenne-twister/include/antares/mersenne-twister/mersenne-twister.h b/src/libs/antares/mersenne-twister/include/antares/mersenne-twister/mersenne-twister.h index a9244dec12..949bc8bb0a 100644 --- a/src/libs/antares/mersenne-twister/include/antares/mersenne-twister/mersenne-twister.h +++ b/src/libs/antares/mersenne-twister/include/antares/mersenne-twister/mersenne-twister.h @@ -104,9 +104,9 @@ class MersenneTwister final : public Yuni::Math::Random::ADistribution= periodN) // generate N words at one time diff --git a/src/libs/antares/paths/list.cpp b/src/libs/antares/paths/list.cpp index 7877672557..208d7c300b 100644 --- a/src/libs/antares/paths/list.cpp +++ b/src/libs/antares/paths/list.cpp @@ -155,7 +155,7 @@ class PathListIterator : public IO::Directory::IIterator return IO::flowSkip; } - virtual Flow onFile(const String& filename, const String&, const String&, uint64 size) + virtual Flow onFile(const String& filename, const String&, const String&, uint64_t size) { if (pathListOptNotFound == exclude.find(filename.c_str() + offset)) list.add(filename.c_str() + offset, (size_t)size); diff --git a/src/libs/antares/study/area/area.cpp b/src/libs/antares/study/area/area.cpp index e83491d393..030af80586 100644 --- a/src/libs/antares/study/area/area.cpp +++ b/src/libs/antares/study/area/area.cpp @@ -157,9 +157,9 @@ const AreaLink* Area::findExistingLinkWith(const Area& with) const return nullptr; } -Yuni::uint64 Area::memoryUsage() const +uint64_t Area::memoryUsage() const { - Yuni::uint64 ret = 0; + uint64_t ret = 0; // Misc gen. (previously called Fatal hors hydro) ret += miscGen.valuesMemoryUsage(); diff --git a/src/libs/antares/study/area/area.h b/src/libs/antares/study/area/area.h index 6ba13837fa..d49e3e0309 100644 --- a/src/libs/antares/study/area/area.h +++ b/src/libs/antares/study/area/area.h @@ -188,7 +188,7 @@ class Area final : private Yuni::NonCopyable /*! ** \brief Get the amount of memory currently used by the area */ - Yuni::uint64 memoryUsage() const; + uint64_t memoryUsage() const; /*! ** \brief Try to estimate the amount of memory required by the area for a simulation @@ -667,7 +667,7 @@ class AreaList final : public Yuni::NonCopyable /*! ** \brief Get the amount of memory currently used by the class */ - Yuni::uint64 memoryUsage() const; + uint64_t memoryUsage() const; /*! ** \brief Update the name id set diff --git a/src/libs/antares/study/area/links.cpp b/src/libs/antares/study/area/links.cpp index 11210cfe6b..3241e5fda9 100644 --- a/src/libs/antares/study/area/links.cpp +++ b/src/libs/antares/study/area/links.cpp @@ -42,7 +42,7 @@ namespace // anonymous { struct TSNumbersPredicate { - uint32 operator()(uint32 value) const + uint32_t operator()(uint32_t value) const { return value + 1; } @@ -722,9 +722,9 @@ void AreaLinkRemove(AreaLink* link) delete link; } -Yuni::uint64 AreaLink::memoryUsage() const +uint64_t AreaLink::memoryUsage() const { - Yuni::uint64 to_return = sizeof(AreaLink); + uint64_t to_return = sizeof(AreaLink); to_return += parameters.valuesMemoryUsage(); to_return += directCapacities.valuesMemoryUsage(); to_return += indirectCapacities.valuesMemoryUsage(); diff --git a/src/libs/antares/study/area/links.h b/src/libs/antares/study/area/links.h index c200561d1f..13d8ff9bc1 100644 --- a/src/libs/antares/study/area/links.h +++ b/src/libs/antares/study/area/links.h @@ -114,7 +114,7 @@ class AreaLink final : public Yuni::NonCopyable /*! ** \brief Get the size (bytes) in memory occupied by a `AreaLink` structure */ - Yuni::uint64 memoryUsage() const; + uint64_t memoryUsage() const; bool isVisibleOnLayer(const size_t& layerID) const; @@ -148,7 +148,7 @@ class AreaLink final : public Yuni::NonCopyable Matrix<> indirectCapacities; //! Monte-Carlo - Matrix timeseriesNumbers; + Matrix timeseriesNumbers; //! Flag for using loop flow bool useLoopFlow; diff --git a/src/libs/antares/study/area/list.cpp b/src/libs/antares/study/area/list.cpp index 1e7d617b59..0526108ee0 100644 --- a/src/libs/antares/study/area/list.cpp +++ b/src/libs/antares/study/area/list.cpp @@ -1352,9 +1352,9 @@ void AreaListEnsureDataThermalPrepro(AreaList* l) l->each([&](Data::Area& area) { area.thermal.list.ensureDataPrepro(); }); } -uint64 AreaList::memoryUsage() const +uint64_t AreaList::memoryUsage() const { - Yuni::uint64 ret = sizeof(AreaList) + sizeof(Area**) * areas.size(); + uint64_t ret = sizeof(AreaList) + sizeof(Area**) * areas.size(); each([&](const Data::Area& area) { ret += area.memoryUsage(); }); return ret; } diff --git a/src/libs/antares/study/area/scratchpad.h b/src/libs/antares/study/area/scratchpad.h index 7b596f6e20..01199a7cf8 100644 --- a/src/libs/antares/study/area/scratchpad.h +++ b/src/libs/antares/study/area/scratchpad.h @@ -46,7 +46,7 @@ class AreaScratchpad final { public: //! Matrix used for time-series - using TSMatrix = Matrix; + using TSMatrix = Matrix; //! \name Constructor //@{ diff --git a/src/libs/antares/study/area/store-timeseries-numbers.cpp b/src/libs/antares/study/area/store-timeseries-numbers.cpp index c0b88f5209..4a2a1a0447 100644 --- a/src/libs/antares/study/area/store-timeseries-numbers.cpp +++ b/src/libs/antares/study/area/store-timeseries-numbers.cpp @@ -41,7 +41,7 @@ namespace // anonymous { struct TSNumbersPredicate { - uint32 operator()(uint32 value) const + uint32_t operator()(uint32_t value) const { return value + 1; } @@ -49,7 +49,7 @@ struct TSNumbersPredicate } // anonymous namespace static void genericStoreTimeseriesNumbers(Solver::IResultWriter::Ptr writer, - const Matrix& timeseriesNumbers, + const Matrix& timeseriesNumbers, const String& id, const String& directory) { diff --git a/src/libs/antares/study/area/ui.cpp b/src/libs/antares/study/area/ui.cpp index ab0adf4d89..7717ce1f42 100644 --- a/src/libs/antares/study/area/ui.cpp +++ b/src/libs/antares/study/area/ui.cpp @@ -341,7 +341,7 @@ bool AreaUI::saveToFile(const AnyString& filename, bool force) const return true; } -Yuni::uint64 AreaUI::memoryUsage() const +uint64_t AreaUI::memoryUsage() const { return sizeof(AreaUI); } diff --git a/src/libs/antares/study/area/ui.h b/src/libs/antares/study/area/ui.h index 4f767defcc..b6f88da488 100644 --- a/src/libs/antares/study/area/ui.h +++ b/src/libs/antares/study/area/ui.h @@ -71,7 +71,7 @@ class AreaUI final /*! ** \brief Amount of memory consummed by the instance */ - Yuni::uint64 memoryUsage() const; + uint64_t memoryUsage() const; /*! ** \brief Get if the structure has been modified diff --git a/src/libs/antares/study/binding_constraint/BindingConstraint.cpp b/src/libs/antares/study/binding_constraint/BindingConstraint.cpp index 1422279951..8cf038d78f 100644 --- a/src/libs/antares/study/binding_constraint/BindingConstraint.cpp +++ b/src/libs/antares/study/binding_constraint/BindingConstraint.cpp @@ -436,7 +436,7 @@ void BindingConstraint::buildFormula(String& s) const } } -Yuni::uint64 BindingConstraint::memoryUsage() const +uint64_t BindingConstraint::memoryUsage() const { return sizeof(BindingConstraint) // comments diff --git a/src/libs/antares/study/binding_constraint/BindingConstraint.h b/src/libs/antares/study/binding_constraint/BindingConstraint.h index 7356e9a7d2..98f2b4dc1c 100644 --- a/src/libs/antares/study/binding_constraint/BindingConstraint.h +++ b/src/libs/antares/study/binding_constraint/BindingConstraint.h @@ -340,7 +340,7 @@ class BindingConstraint final : public Yuni::NonCopyable /*! ** \brief Get the memory usage */ - Yuni::uint64 memoryUsage() const; + uint64_t memoryUsage() const; //@} /*! diff --git a/src/libs/antares/study/binding_constraint/BindingConstraintsRepository.cpp b/src/libs/antares/study/binding_constraint/BindingConstraintsRepository.cpp index 13dcb6821e..7be0adec55 100644 --- a/src/libs/antares/study/binding_constraint/BindingConstraintsRepository.cpp +++ b/src/libs/antares/study/binding_constraint/BindingConstraintsRepository.cpp @@ -242,9 +242,9 @@ void BindingConstraintsRepository::reverseWeightSign(const AreaLink* lnk) each([&lnk](BindingConstraint &constraint) { constraint.reverseWeightSign(lnk); }); } -Yuni::uint64 BindingConstraintsRepository::memoryUsage() const +Yuni::uint64_t BindingConstraintsRepository::memoryUsage() const { - Yuni::uint64 m = sizeof(BindingConstraintsRepository); + Yuni::uint64_t m = sizeof(BindingConstraintsRepository); for (const auto & i : constraints_) m += i->memoryUsage(); return m; diff --git a/src/libs/antares/study/binding_constraint/BindingConstraintsRepository.h b/src/libs/antares/study/binding_constraint/BindingConstraintsRepository.h index fe37e6ad53..1a46e1921f 100644 --- a/src/libs/antares/study/binding_constraint/BindingConstraintsRepository.h +++ b/src/libs/antares/study/binding_constraint/BindingConstraintsRepository.h @@ -142,7 +142,7 @@ class BindingConstraintsRepository final : public Yuni::NonCopyableadd("caption", caption); // Date - sect->add("created", (sint64)dateCreated); + sect->add("created", (int64_t)dateCreated); // Last save dateLastSave = ::time(nullptr); - sect->add("lastSave", (sint64)dateLastSave); + sect->add("lastSave", (int64_t)dateLastSave); // The author sect->add("author", author); diff --git a/src/libs/antares/study/output.cpp b/src/libs/antares/study/output.cpp index d604563738..ad35c6519c 100644 --- a/src/libs/antares/study/output.cpp +++ b/src/libs/antares/study/output.cpp @@ -64,7 +64,7 @@ class OutputFolderIterator : public IO::Directory::IIterator virtual Flow onFile(const String& /*filename*/, const String& parent, const String& name, - uint64) + uint64_t) { pExtension.clear(); IO::ExtractExtension(pExtension, name); diff --git a/src/libs/antares/study/output.h b/src/libs/antares/study/output.h index f121ba86da..5b3615c4a1 100644 --- a/src/libs/antares/study/output.h +++ b/src/libs/antares/study/output.h @@ -51,9 +51,9 @@ class Output final using Name = Yuni::CString<128, false>; //! Map of study output info, ordered by their timestamp - using MapByTimestamp = std::map; + using MapByTimestamp = std::map; //! Map of study output info, ordered by their timestamp (desc) - using MapByTimestampDesc = std::map>; + using MapByTimestampDesc = std::map>; public: /*! @@ -89,7 +89,7 @@ class Output final //! Version of the solver used for the simulation uint version; //! Date/time when the simulation has been launched - yint64 timestamp; + int64_t timestamp; //! Mode (economy/adequacy/other) Data::StudyMode mode; //! Tag for storing a wx menu id diff --git a/src/libs/antares/study/parameters.cpp b/src/libs/antares/study/parameters.cpp index eefdb36022..ae739f3e25 100644 --- a/src/libs/antares/study/parameters.cpp +++ b/src/libs/antares/study/parameters.cpp @@ -1162,7 +1162,7 @@ void Parameters::fixBadValues() nbTimeSeriesSolar = 1; } -Yuni::uint64 Parameters::memoryUsage() const +uint64_t Parameters::memoryUsage() const { return sizeof(Parameters) + yearsWeight.size() * sizeof(double) + yearsFilter.size(); // vector of bools, 1 bit per coefficient diff --git a/src/libs/antares/study/parameters.h b/src/libs/antares/study/parameters.h index a31c78a2a0..952d534764 100644 --- a/src/libs/antares/study/parameters.h +++ b/src/libs/antares/study/parameters.h @@ -162,7 +162,7 @@ class Parameters final /*! ** \brief Get the amount of memory used by the general data */ - Yuni::uint64 memoryUsage() const; + uint64_t memoryUsage() const; /*! ** \brief Reset MC year weight to 1 for all years diff --git a/src/libs/antares/study/parts/common/cluster.h b/src/libs/antares/study/parts/common/cluster.h index 221855914e..9cd20ba798 100644 --- a/src/libs/antares/study/parts/common/cluster.h +++ b/src/libs/antares/study/parts/common/cluster.h @@ -66,7 +66,7 @@ class Cluster /*! ** \brief Get the memory consummed by the renewable cluster (in bytes) */ - virtual Yuni::uint64 memoryUsage() const = 0; + virtual uint64_t memoryUsage() const = 0; //@} /*! diff --git a/src/libs/antares/study/parts/common/cluster_list.cpp b/src/libs/antares/study/parts/common/cluster_list.cpp index d40b35ef29..1da5d5eb7a 100644 --- a/src/libs/antares/study/parts/common/cluster_list.cpp +++ b/src/libs/antares/study/parts/common/cluster_list.cpp @@ -8,7 +8,7 @@ namespace // anonymous { struct TSNumbersPredicate { - uint32 operator()(uint32 value) const + uint32_t operator()(uint32_t value) const { return value + 1; } @@ -224,9 +224,9 @@ typename ClusterList::SharedPtr ClusterList::add( } template -Yuni::uint64 ClusterList::memoryUsage() const +uint64_t ClusterList::memoryUsage() const { - uint64 ret = sizeof(ClusterList) + (2 * sizeof(void*)) * this->size(); + uint64_t ret = sizeof(ClusterList) + (2 * sizeof(void*)) * this->size(); each([&](const ClusterT& cluster) { ret += cluster.memoryUsage(); }); return ret; diff --git a/src/libs/antares/study/parts/common/cluster_list.h b/src/libs/antares/study/parts/common/cluster_list.h index 3d295efffb..5ef3c4e84f 100644 --- a/src/libs/antares/study/parts/common/cluster_list.h +++ b/src/libs/antares/study/parts/common/cluster_list.h @@ -216,7 +216,7 @@ class ClusterList ** \brief Get the size (bytes) occupied in memory by a `ClusterList` structure ** \return A size (in bytes) */ - Yuni::uint64 memoryUsage() const; + uint64_t memoryUsage() const; public: //! All clusters by their index diff --git a/src/libs/antares/study/parts/common/series.h b/src/libs/antares/study/parts/common/series.h index 962e69b34c..c5ac2d52f4 100644 --- a/src/libs/antares/study/parts/common/series.h +++ b/src/libs/antares/study/parts/common/series.h @@ -55,7 +55,7 @@ class DataSeriesCommon /*! ** \brief Monte-Carlo */ - Matrix timeseriesNumbers; + Matrix timeseriesNumbers; }; // class DataSeriesCommon } // namespace Data } // namespace Antares diff --git a/src/libs/antares/study/parts/common/series.hxx b/src/libs/antares/study/parts/common/series.hxx index da8a618cdd..b589e56532 100644 --- a/src/libs/antares/study/parts/common/series.hxx +++ b/src/libs/antares/study/parts/common/series.hxx @@ -31,7 +31,7 @@ namespace Antares { namespace Data { -inline Yuni::uint64 DataSeriesMemoryUsage(DataSeriesCommon* t) +inline uint64_t DataSeriesMemoryUsage(DataSeriesCommon* t) { return (t) ? t->timeSeries.memoryUsage() : 0; } diff --git a/src/libs/antares/study/parts/hydro/prepro.cpp b/src/libs/antares/study/parts/hydro/prepro.cpp index 053ac05a2a..42efe5d048 100644 --- a/src/libs/antares/study/parts/hydro/prepro.cpp +++ b/src/libs/antares/study/parts/hydro/prepro.cpp @@ -90,7 +90,7 @@ PreproHydro::PreproHydro() { } -uint64 PreproHydroMemoryUsage(PreproHydro* h) +uint64_t PreproHydroMemoryUsage(PreproHydro* h) { return (h) ? sizeof(double) : 0; } diff --git a/src/libs/antares/study/parts/hydro/prepro.h b/src/libs/antares/study/parts/hydro/prepro.h index b550221564..978a3c1f01 100644 --- a/src/libs/antares/study/parts/hydro/prepro.h +++ b/src/libs/antares/study/parts/hydro/prepro.h @@ -133,7 +133,7 @@ int PreproHydroLoadFromFolder(Study& s, ** \brief Get the size (bytes) occupied in memory by a `PreproHydro` structure ** \ingroup hydroprepro */ -Yuni::uint64 PreproHydroMemoryUsage(PreproHydro* h); +uint64_t PreproHydroMemoryUsage(PreproHydro* h); } // namespace Data } // namespace Antares diff --git a/src/libs/antares/study/parts/hydro/series.cpp b/src/libs/antares/study/parts/hydro/series.cpp index b964080823..3cb60ba865 100644 --- a/src/libs/antares/study/parts/hydro/series.cpp +++ b/src/libs/antares/study/parts/hydro/series.cpp @@ -217,7 +217,7 @@ void DataSeriesHydro::reset() count = 1; } -uint64 DataSeriesHydro::memoryUsage() const +uint64_t DataSeriesHydro::memoryUsage() const { return sizeof(double) + ror.memoryUsage() + storage.memoryUsage() + mingen.memoryUsage(); } diff --git a/src/libs/antares/study/parts/hydro/series.h b/src/libs/antares/study/parts/hydro/series.h index 0882a787a0..5a50ce7d5c 100644 --- a/src/libs/antares/study/parts/hydro/series.h +++ b/src/libs/antares/study/parts/hydro/series.h @@ -93,7 +93,7 @@ class DataSeriesHydro /*! ** \brief Get the size (bytes) in memory occupied by a `DataSeriesHydro` structure */ - Yuni::uint64 memoryUsage() const; + uint64_t memoryUsage() const; /*! ** \brief Try to estimate the amount of memory required for launching a simulation */ @@ -112,7 +112,7 @@ class DataSeriesHydro ** (it was DAYS_PER_YEAR before 3.9) */ - Matrix ror; + Matrix ror; /*! ** \brief Mod (MW) @@ -120,14 +120,14 @@ class DataSeriesHydro ** Merely a matrix of TimeSeriesCount * 365 values ** This matrix is not used in `adequation` mode. */ - Matrix storage; + Matrix storage; /*! ** \brief Minimum Generation (MW) ** ** Merely a matrix of TimeSeriesCount * HOURS_PER_YEAR values */ - Matrix mingen; + Matrix mingen; /*! ** \brief The number of time-series @@ -142,7 +142,7 @@ class DataSeriesHydro /*! ** \brief Monte-Carlo */ - Matrix timeseriesNumbers; + Matrix timeseriesNumbers; }; // class DataSeriesHydro diff --git a/src/libs/antares/study/parts/load/container.cpp b/src/libs/antares/study/parts/load/container.cpp index 9cc909edcd..fcc32a1e8d 100644 --- a/src/libs/antares/study/parts/load/container.cpp +++ b/src/libs/antares/study/parts/load/container.cpp @@ -64,7 +64,7 @@ void Container::markAsModified() const prepro->markAsModified(); } -Yuni::uint64 Container::memoryUsage() const +uint64_t Container::memoryUsage() const { return sizeof(Container) + ((!series) ? 0 : DataSeriesLoadMemoryUsage(series)) + ((!prepro) ? 0 : prepro->memoryUsage()); diff --git a/src/libs/antares/study/parts/load/container.h b/src/libs/antares/study/parts/load/container.h index 076f58bf12..4776e3865c 100644 --- a/src/libs/antares/study/parts/load/container.h +++ b/src/libs/antares/study/parts/load/container.h @@ -69,7 +69,7 @@ class Container final : private Yuni::NonCopyable /*! ** \brief Get the amount of memory currently used by the class */ - Yuni::uint64 memoryUsage() const; + uint64_t memoryUsage() const; public: //! Data for the pre-processor diff --git a/src/libs/antares/study/parts/load/prepro.h b/src/libs/antares/study/parts/load/prepro.h index 54e6d29c56..e72d11a8e8 100644 --- a/src/libs/antares/study/parts/load/prepro.h +++ b/src/libs/antares/study/parts/load/prepro.h @@ -69,7 +69,7 @@ class Prepro /*! ** \brief Get the amount of memory currently used */ - Yuni::uint64 memoryUsage() const; + uint64_t memoryUsage() const; /*! ** \brief Make sure that all data are loaded in memory diff --git a/src/libs/antares/study/parts/load/prepro.hxx b/src/libs/antares/study/parts/load/prepro.hxx index 36b82e2da9..c3ff5220e6 100644 --- a/src/libs/antares/study/parts/load/prepro.hxx +++ b/src/libs/antares/study/parts/load/prepro.hxx @@ -30,7 +30,7 @@ namespace Antares::Data::Load { -inline Yuni::uint64 Prepro::memoryUsage() const +inline uint64_t Prepro::memoryUsage() const { return xcast.memoryUsage(); } diff --git a/src/libs/antares/study/parts/load/series.h b/src/libs/antares/study/parts/load/series.h index 8b995d1664..478a51485c 100644 --- a/src/libs/antares/study/parts/load/series.h +++ b/src/libs/antares/study/parts/load/series.h @@ -55,12 +55,12 @@ class DataSeriesLoad ** ** Merely a matrix of TimeSeriesCount * 8760 values */ - Matrix timeSeries; + Matrix timeSeries; /*! ** \brief Monte-Carlo */ - Matrix timeseriesNumbers; + Matrix timeseriesNumbers; }; /* class DataSeriesLoad */ @@ -92,7 +92,7 @@ int DataSeriesLoadSaveToFolder(DataSeriesLoad* d, const AreaName& areaID, const /*! ** \brief Get the size (bytes) in memory occupied by a `DataSeriesLoad` structure */ -Yuni::uint64 DataSeriesLoadMemoryUsage(DataSeriesLoad* w); +uint64_t DataSeriesLoadMemoryUsage(DataSeriesLoad* w); } // namespace Data } // namespace Antares diff --git a/src/libs/antares/study/parts/load/series.hxx b/src/libs/antares/study/parts/load/series.hxx index fe558e50a5..ddebe31d35 100644 --- a/src/libs/antares/study/parts/load/series.hxx +++ b/src/libs/antares/study/parts/load/series.hxx @@ -31,7 +31,7 @@ namespace Antares { namespace Data { -inline Yuni::uint64 DataSeriesLoadMemoryUsage(DataSeriesLoad* l) +inline uint64_t DataSeriesLoadMemoryUsage(DataSeriesLoad* l) { return (l) ? l->timeSeries.memoryUsage() : 0; } diff --git a/src/libs/antares/study/parts/renewable/cluster.cpp b/src/libs/antares/study/parts/renewable/cluster.cpp index d1b7dc1bd1..584b27dd35 100644 --- a/src/libs/antares/study/parts/renewable/cluster.cpp +++ b/src/libs/antares/study/parts/renewable/cluster.cpp @@ -269,9 +269,9 @@ double RenewableCluster::valueAtTimeStep(uint timeSeriesIndex, uint timeStepInde return 0.; } -uint64 RenewableCluster::memoryUsage() const +uint64_t RenewableCluster::memoryUsage() const { - uint64 amount = sizeof(RenewableCluster); + uint64_t amount = sizeof(RenewableCluster); if (series) amount += DataSeriesMemoryUsage(series); return amount; diff --git a/src/libs/antares/study/parts/renewable/cluster.h b/src/libs/antares/study/parts/renewable/cluster.h index 8405989e08..7147295a13 100644 --- a/src/libs/antares/study/parts/renewable/cluster.h +++ b/src/libs/antares/study/parts/renewable/cluster.h @@ -152,7 +152,7 @@ class RenewableCluster final : public Cluster /*! ** \brief Get the memory consummed by the renewable cluster (in bytes) */ - Yuni::uint64 memoryUsage() const override; + uint64_t memoryUsage() const override; //@} bool setTimeSeriesModeFromString(const YString& value); diff --git a/src/libs/antares/study/parts/solar/container.cpp b/src/libs/antares/study/parts/solar/container.cpp index eedb248e93..35e15319da 100644 --- a/src/libs/antares/study/parts/solar/container.cpp +++ b/src/libs/antares/study/parts/solar/container.cpp @@ -66,7 +66,7 @@ void Container::markAsModified() const prepro->markAsModified(); } -Yuni::uint64 Container::memoryUsage() const +uint64_t Container::memoryUsage() const { return sizeof(Container) + ((!series) ? 0 : DataSeriesSolarMemoryUsage(series)) + ((!prepro) ? 0 : prepro->memoryUsage()); diff --git a/src/libs/antares/study/parts/solar/container.h b/src/libs/antares/study/parts/solar/container.h index 59ded73870..ba37906391 100644 --- a/src/libs/antares/study/parts/solar/container.h +++ b/src/libs/antares/study/parts/solar/container.h @@ -67,7 +67,7 @@ class Container /*! ** \brief Get the amount of memory currently used by the class */ - Yuni::uint64 memoryUsage() const; + uint64_t memoryUsage() const; public: //! Data for the pre-processor diff --git a/src/libs/antares/study/parts/solar/prepro.h b/src/libs/antares/study/parts/solar/prepro.h index 870dd7a32d..836e772f83 100644 --- a/src/libs/antares/study/parts/solar/prepro.h +++ b/src/libs/antares/study/parts/solar/prepro.h @@ -69,7 +69,7 @@ class Prepro /*! ** \brief Get the amount of memory currently used */ - Yuni::uint64 memoryUsage() const; + uint64_t memoryUsage() const; /*! ** \brief Make sure that all data are loaded in memory diff --git a/src/libs/antares/study/parts/solar/prepro.hxx b/src/libs/antares/study/parts/solar/prepro.hxx index 61ddb7dbd2..e0d5c01b7d 100644 --- a/src/libs/antares/study/parts/solar/prepro.hxx +++ b/src/libs/antares/study/parts/solar/prepro.hxx @@ -29,7 +29,7 @@ namespace Antares::Data::Solar { -inline Yuni::uint64 Prepro::memoryUsage() const +inline uint64_t Prepro::memoryUsage() const { return xcast.memoryUsage(); } diff --git a/src/libs/antares/study/parts/solar/series.h b/src/libs/antares/study/parts/solar/series.h index 82abf3d282..4cc59ecfd2 100644 --- a/src/libs/antares/study/parts/solar/series.h +++ b/src/libs/antares/study/parts/solar/series.h @@ -52,12 +52,12 @@ class DataSeriesSolar ** ** Merely a matrix of TimeSeriesCount * 8760 values */ - Matrix timeSeries; + Matrix timeSeries; /*! ** \brief Monte-Carlo */ - Matrix timeseriesNumbers; + Matrix timeseriesNumbers; }; /* class DataSeriesSolar */ @@ -89,7 +89,7 @@ int DataSeriesSolarSaveToFolder(DataSeriesSolar* d, const AreaName& areaID, cons /*! ** \brief Get the size (bytes) in memory occupied by a `DataSeriesSolar` structure */ -Yuni::uint64 DataSeriesSolarMemoryUsage(DataSeriesSolar* w); +uint64_t DataSeriesSolarMemoryUsage(DataSeriesSolar* w); } // namespace Data } // namespace Antares diff --git a/src/libs/antares/study/parts/solar/series.hxx b/src/libs/antares/study/parts/solar/series.hxx index ce06eef7a9..3654163ae0 100644 --- a/src/libs/antares/study/parts/solar/series.hxx +++ b/src/libs/antares/study/parts/solar/series.hxx @@ -31,7 +31,7 @@ namespace Antares { namespace Data { -inline Yuni::uint64 DataSeriesSolarMemoryUsage(DataSeriesSolar* l) +inline uint64_t DataSeriesSolarMemoryUsage(DataSeriesSolar* l) { return (l) ? l->timeSeries.memoryUsage() : 0; } diff --git a/src/libs/antares/study/parts/thermal/cluster.cpp b/src/libs/antares/study/parts/thermal/cluster.cpp index 7d44a25eda..fb261e8bc7 100644 --- a/src/libs/antares/study/parts/thermal/cluster.cpp +++ b/src/libs/antares/study/parts/thermal/cluster.cpp @@ -642,9 +642,9 @@ const char* Data::ThermalCluster::GroupName(enum ThermalDispatchableGroup grp) return ""; } -uint64 ThermalCluster::memoryUsage() const +uint64_t ThermalCluster::memoryUsage() const { - uint64 amount = sizeof(ThermalCluster) + modulation.memoryUsage(); + uint64_t amount = sizeof(ThermalCluster) + modulation.memoryUsage(); if (prepro) amount += prepro->memoryUsage(); if (series) diff --git a/src/libs/antares/study/parts/thermal/cluster.h b/src/libs/antares/study/parts/thermal/cluster.h index 79254de8ac..14120c906b 100644 --- a/src/libs/antares/study/parts/thermal/cluster.h +++ b/src/libs/antares/study/parts/thermal/cluster.h @@ -197,7 +197,7 @@ class ThermalCluster final : public Cluster, public std::enable_shared_from_this /*! ** \brief Get the memory consummed by the thermal cluster (in bytes) */ - Yuni::uint64 memoryUsage() const override; + uint64_t memoryUsage() const override; //@} //! \name validity of Min Stable Power diff --git a/src/libs/antares/study/parts/thermal/cluster_list.cpp b/src/libs/antares/study/parts/thermal/cluster_list.cpp index 6368e167e0..2cd45cfa14 100644 --- a/src/libs/antares/study/parts/thermal/cluster_list.cpp +++ b/src/libs/antares/study/parts/thermal/cluster_list.cpp @@ -6,7 +6,7 @@ namespace // anonymous { struct TSNumbersPredicate { - Yuni::uint32 operator()(Yuni::uint32 value) const + uint32_t operator()(uint32_t value) const { return value + 1; } diff --git a/src/libs/antares/study/parts/thermal/ecoInput.cpp b/src/libs/antares/study/parts/thermal/ecoInput.cpp index 8241f07b77..d8cfc20621 100644 --- a/src/libs/antares/study/parts/thermal/ecoInput.cpp +++ b/src/libs/antares/study/parts/thermal/ecoInput.cpp @@ -111,7 +111,7 @@ void EconomicInputData::reset() co2cost.reset(1, HOURS_PER_YEAR, true); } -Yuni::uint64 EconomicInputData::memoryUsage() const +uint64_t EconomicInputData::memoryUsage() const { return sizeof(EconomicInputData); } diff --git a/src/libs/antares/study/parts/thermal/ecoInput.h b/src/libs/antares/study/parts/thermal/ecoInput.h index 7f91dc5957..b275227200 100644 --- a/src/libs/antares/study/parts/thermal/ecoInput.h +++ b/src/libs/antares/study/parts/thermal/ecoInput.h @@ -82,7 +82,7 @@ class EconomicInputData /*! ** \brief Get the amount of memory used by the class */ - Yuni::uint64 memoryUsage() const; + uint64_t memoryUsage() const; //! All {FO,PO}{Duration,Rate} annual values // max x DAYS_PER_YEAR diff --git a/src/libs/antares/study/parts/thermal/prepro.h b/src/libs/antares/study/parts/thermal/prepro.h index e5e9c953fd..ba38601806 100644 --- a/src/libs/antares/study/parts/thermal/prepro.h +++ b/src/libs/antares/study/parts/thermal/prepro.h @@ -103,7 +103,7 @@ class PreproThermal /*! ** \brief Get the amount of memory used by the class */ - Yuni::uint64 memoryUsage() const; + uint64_t memoryUsage() const; /*! ** \brief Normalize NPO max and check for consistency diff --git a/src/libs/antares/study/parts/thermal/prepro.hxx b/src/libs/antares/study/parts/thermal/prepro.hxx index e4b198f480..973075ee8d 100644 --- a/src/libs/antares/study/parts/thermal/prepro.hxx +++ b/src/libs/antares/study/parts/thermal/prepro.hxx @@ -31,7 +31,7 @@ namespace Antares { namespace Data { -inline Yuni::uint64 PreproThermal::memoryUsage() const +inline uint64_t PreproThermal::memoryUsage() const { return sizeof(PreproThermal); } diff --git a/src/libs/antares/study/parts/wind/container.cpp b/src/libs/antares/study/parts/wind/container.cpp index 5b1960644a..c25ce757d8 100644 --- a/src/libs/antares/study/parts/wind/container.cpp +++ b/src/libs/antares/study/parts/wind/container.cpp @@ -65,7 +65,7 @@ void Container::markAsModified() const prepro->markAsModified(); } -Yuni::uint64 Container::memoryUsage() const +uint64_t Container::memoryUsage() const { return sizeof(Container) + ((!series) ? 0 : DataSeriesWindMemoryUsage(series)) + ((!prepro) ? 0 : prepro->memoryUsage()); diff --git a/src/libs/antares/study/parts/wind/container.h b/src/libs/antares/study/parts/wind/container.h index b7cbe7fa89..05a696f1d4 100644 --- a/src/libs/antares/study/parts/wind/container.h +++ b/src/libs/antares/study/parts/wind/container.h @@ -67,7 +67,7 @@ class Container /*! ** \brief Get the amount of memory currently used by the class */ - Yuni::uint64 memoryUsage() const; + uint64_t memoryUsage() const; public: //! Data for the pre-processor diff --git a/src/libs/antares/study/parts/wind/prepro.h b/src/libs/antares/study/parts/wind/prepro.h index 75ccd1b628..a99ed241b1 100644 --- a/src/libs/antares/study/parts/wind/prepro.h +++ b/src/libs/antares/study/parts/wind/prepro.h @@ -66,7 +66,7 @@ class Prepro /*! ** \brief Get the amount of memory currently used */ - Yuni::uint64 memoryUsage() const; + uint64_t memoryUsage() const; /*! ** \brief Make sure that all data are loaded in memory diff --git a/src/libs/antares/study/parts/wind/prepro.hxx b/src/libs/antares/study/parts/wind/prepro.hxx index 1505988bad..c73fcc7537 100644 --- a/src/libs/antares/study/parts/wind/prepro.hxx +++ b/src/libs/antares/study/parts/wind/prepro.hxx @@ -30,7 +30,7 @@ namespace Antares::Data::Wind { -inline Yuni::uint64 Prepro::memoryUsage() const +inline uint64_t Prepro::memoryUsage() const { return xcast.memoryUsage(); } diff --git a/src/libs/antares/study/parts/wind/series.h b/src/libs/antares/study/parts/wind/series.h index b632474ad3..a144c9b46b 100644 --- a/src/libs/antares/study/parts/wind/series.h +++ b/src/libs/antares/study/parts/wind/series.h @@ -52,12 +52,12 @@ class DataSeriesWind ** ** Merely a matrix of TimeSeriesCount * 8760 values */ - Matrix timeSeries; + Matrix timeSeries; /*! ** \brief Monte-Carlo */ - Matrix timeseriesNumbers; + Matrix timeseriesNumbers; }; /* class DataSeriesWind */ @@ -89,7 +89,7 @@ int DataSeriesWindSaveToFolder(DataSeriesWind* d, const AreaName& areaID, const /*! ** \brief Get the size (bytes) in memory occupied by a `DataSeriesWind` structure */ -Yuni::uint64 DataSeriesWindMemoryUsage(DataSeriesWind* w); +uint64_t DataSeriesWindMemoryUsage(DataSeriesWind* w); } // namespace Data } // namespace Antares diff --git a/src/libs/antares/study/parts/wind/series.hxx b/src/libs/antares/study/parts/wind/series.hxx index 7f2529daec..f714cbc2e4 100644 --- a/src/libs/antares/study/parts/wind/series.hxx +++ b/src/libs/antares/study/parts/wind/series.hxx @@ -31,7 +31,7 @@ namespace Antares { namespace Data { -inline Yuni::uint64 DataSeriesWindMemoryUsage(DataSeriesWind* w) +inline uint64_t DataSeriesWindMemoryUsage(DataSeriesWind* w) { return (w) ? w->timeSeries.memoryUsage() : 0; } diff --git a/src/libs/antares/study/scenario-builder/TSnumberData.h b/src/libs/antares/study/scenario-builder/TSnumberData.h index 5304dfdbde..ca2c1ee583 100644 --- a/src/libs/antares/study/scenario-builder/TSnumberData.h +++ b/src/libs/antares/study/scenario-builder/TSnumberData.h @@ -38,7 +38,7 @@ class TSNumberData : public dataInterface { public: //! Matrix - using MatrixType = Matrix; + using MatrixType = Matrix; public: // We use default constructor and destructor diff --git a/src/libs/antares/study/scenario-builder/applyToMatrix.hxx b/src/libs/antares/study/scenario-builder/applyToMatrix.hxx index 9d6082c6d7..c2990af51d 100644 --- a/src/libs/antares/study/scenario-builder/applyToMatrix.hxx +++ b/src/libs/antares/study/scenario-builder/applyToMatrix.hxx @@ -58,7 +58,7 @@ bool ApplyToMatrix(uint& errors, const uint nbYears = data.timeseriesNumbers.height; // The matrix m has only one column assert(data.timeseriesNumbers.width == 1); - typename Matrix::ColumnType& target = data.timeseriesNumbers[0]; + typename Matrix::ColumnType& target = data.timeseriesNumbers[0]; for (uint y = 0; y != nbYears; ++y) { diff --git a/src/libs/antares/study/simulation.cpp b/src/libs/antares/study/simulation.cpp index 37bf082732..b2722d71b4 100644 --- a/src/libs/antares/study/simulation.cpp +++ b/src/libs/antares/study/simulation.cpp @@ -88,7 +88,7 @@ bool SimulationComments::loadFromFolder(const StudyLoadOptions& options) return true; } -Yuni::uint64 SimulationComments::memoryUsage() const +uint64_t SimulationComments::memoryUsage() const { return name.capacity() + comments.capacity(); } diff --git a/src/libs/antares/study/simulation.h b/src/libs/antares/study/simulation.h index 9bbb8c4727..0f72d9d296 100644 --- a/src/libs/antares/study/simulation.h +++ b/src/libs/antares/study/simulation.h @@ -68,7 +68,7 @@ class SimulationComments final void saveUsingWriter(Solver::IResultWriter::Ptr writer, const AnyString& folder) const; //! Get (in bytes) the amount of memory used by the class - Yuni::uint64 memoryUsage() const; + uint64_t memoryUsage() const; public: //! Comments diff --git a/src/libs/antares/study/study.cpp b/src/libs/antares/study/study.cpp index 450aac1769..a539b9b13a 100644 --- a/src/libs/antares/study/study.cpp +++ b/src/libs/antares/study/study.cpp @@ -192,7 +192,7 @@ void Study::reduceMemoryUsage() ClearAndShrink(bufferLoadingTS); } -uint64 Study::memoryUsage() const +uint64_t Study::memoryUsage() const { return folder.capacity() // Folders paths @@ -625,7 +625,7 @@ YString StudyCreateOutputPath(StudyMode mode, ResultFormat fmt, const YString& outputRoot, const YString& label, - Yuni::sint64 startTime) + int64_t startTime) { auto suffix = getOutputSuffix(fmt); diff --git a/src/libs/antares/study/study.h b/src/libs/antares/study/study.h index 9494775970..621fdd5700 100644 --- a/src/libs/antares/study/study.h +++ b/src/libs/antares/study/study.h @@ -475,7 +475,7 @@ class Study: public Yuni::NonCopyable, public IObject, public LayerData /*! ** \brief Get the amound of memory consummed by the study (in bytes) */ - Yuni::uint64 memoryUsage() const; + uint64_t memoryUsage() const; //! \name Logs //@{ @@ -515,7 +515,7 @@ class Study: public Yuni::NonCopyable, public IObject, public LayerData //! The current Simulation SimulationComments simulationComments; - Yuni::sint64 pStartTime; + int64_t pStartTime; // Used in GUI and solver // ---------------------- // Maximum number of years in a set of parallel years. @@ -718,7 +718,7 @@ YString StudyCreateOutputPath(StudyMode mode, ResultFormat fmt, const YString& folder, const YString& label, - Yuni::sint64 startTime); + int64_t startTime); } // namespace Antares::Data diff --git a/src/libs/antares/study/ui-runtimeinfos.cpp b/src/libs/antares/study/ui-runtimeinfos.cpp index 8e83e8cc15..0ba362f828 100644 --- a/src/libs/antares/study/ui-runtimeinfos.cpp +++ b/src/libs/antares/study/ui-runtimeinfos.cpp @@ -146,7 +146,7 @@ void UIRuntimeInfo::reloadBindingConstraints() } } -uint64 UIRuntimeInfo::memoryUsage() const +uint64_t UIRuntimeInfo::memoryUsage() const { return sizeof(UIRuntimeInfo) + sizeof(AreaLink*) * pLink.size(); } diff --git a/src/libs/antares/study/ui-runtimeinfos.h b/src/libs/antares/study/ui-runtimeinfos.h index 3353b81b62..7a35ddf6bf 100644 --- a/src/libs/antares/study/ui-runtimeinfos.h +++ b/src/libs/antares/study/ui-runtimeinfos.h @@ -133,7 +133,7 @@ class UIRuntimeInfo final uint visibleLinksCount(uint layerID); - Yuni::uint64 memoryUsage() const; + uint64_t memoryUsage() const; public: //! Areas ordered by their name + links ordered by their name diff --git a/src/libs/antares/study/xcast/xcast.h b/src/libs/antares/study/xcast/xcast.h index 38476af617..4124f06798 100644 --- a/src/libs/antares/study/xcast/xcast.h +++ b/src/libs/antares/study/xcast/xcast.h @@ -165,7 +165,7 @@ class XCast final : private Yuni::NonCopyable /*! ** \brief Get the amount of memory currently used by the XCast data */ - Yuni::uint64 memoryUsage() const; + uint64_t memoryUsage() const; /*! ** \brief Estimate the amount of memory required by this class for a simulation @@ -187,7 +187,7 @@ class XCast final : private Yuni::NonCopyable /*! ** \brief Time-series average */ - Matrix translation; + Matrix translation; //! How to use the timeseries average TSTranslationUse useTranslation; diff --git a/src/libs/antares/study/xcast/xcast.hxx b/src/libs/antares/study/xcast/xcast.hxx index e3e711f410..696f411718 100644 --- a/src/libs/antares/study/xcast/xcast.hxx +++ b/src/libs/antares/study/xcast/xcast.hxx @@ -33,7 +33,7 @@ namespace Antares { namespace Data { -inline Yuni::uint64 XCast::memoryUsage() const +inline uint64_t XCast::memoryUsage() const { return sizeof(XCast) + data.memoryUsage() + K.memoryUsage() + translation.memoryUsage() + conversion.memoryUsage(); diff --git a/src/libs/fswalker/filejob.inc.hxx b/src/libs/fswalker/filejob.inc.hxx index 8480d46c34..dc002ce50c 100644 --- a/src/libs/fswalker/filejob.inc.hxx +++ b/src/libs/fswalker/filejob.inc.hxx @@ -47,9 +47,9 @@ public: //! Parent String::Vector parents; //! All associated sizes - std::vector filessize; + std::vector filessize; //! Modification - std::vector modified; + std::vector modified; //! Reference EventsRegistry& events; diff --git a/src/libs/fswalker/fswalker.cpp b/src/libs/fswalker/fswalker.cpp index 78a3ce5746..11fd1affa0 100644 --- a/src/libs/fswalker/fswalker.cpp +++ b/src/libs/fswalker/fswalker.cpp @@ -95,8 +95,8 @@ class WalkerThread final bool triggerFileEvent(const String& filename, const String& parent, - sint64 modified, - uint64 size); + int64_t modified, + uint64_t size); void waitForAllJobs() const; @@ -254,8 +254,8 @@ void WalkerThread::run() bool WalkerThread::triggerFileEvent(const String& filename, const String& parent, - sint64 modified, - uint64 size) + int64_t modified, + uint64_t size) { assert(pFileJob != NULL); diff --git a/src/libs/fswalker/fswalker.h b/src/libs/fswalker/fswalker.h index cea0aeaae4..bbfc433db7 100644 --- a/src/libs/fswalker/fswalker.h +++ b/src/libs/fswalker/fswalker.h @@ -51,8 +51,8 @@ using OnDirectoryEvent = Flow (*)(const YString& path, bool empty, void* user); //! A file has been found using OnFileEvent = void (*)(const YString& filename, const YString& parent, - yint64 modified, - yuint64 size, + int64_t modified, + uint64_t size, void* user); //! Event for dispatching a new job using DispatchJobEvent = Yuni::Bind; diff --git a/src/libs/fswalker/statistics.h b/src/libs/fswalker/statistics.h index e50b4e0792..2325b0ad3c 100644 --- a/src/libs/fswalker/statistics.h +++ b/src/libs/fswalker/statistics.h @@ -48,11 +48,11 @@ class Statistics public: //! The number of file encountered - yuint64 fileCount; + uint64_t fileCount; //! The number of folders encountered - yuint64 folderCount; + uint64_t folderCount; //! The amount of bytes that has been copied - yuint64 bytesCopied; + uint64_t bytesCopied; //! Flag to determine whether the operation has been aborted or not bool aborted; diff --git a/src/solver/hydro/management/daily.cpp b/src/solver/hydro/management/daily.cpp index 3650be78e1..d7f7989f9e 100644 --- a/src/solver/hydro/management/daily.cpp +++ b/src/solver/hydro/management/daily.cpp @@ -82,7 +82,7 @@ enum struct DebugData { using PerArea = HydroManagement::PerArea; - using InflowsType = Matrix::ColumnType; + using InflowsType = Matrix::ColumnType; using MaxPowerType = Matrix::ColumnType; using ReservoirLevelType = Matrix::ColumnType; diff --git a/src/solver/simulation/TimeSeriesNumbersWriter.cpp b/src/solver/simulation/TimeSeriesNumbersWriter.cpp index 035ab751e2..83944ef746 100644 --- a/src/solver/simulation/TimeSeriesNumbersWriter.cpp +++ b/src/solver/simulation/TimeSeriesNumbersWriter.cpp @@ -28,7 +28,7 @@ namespace // anonymous // TODO : remove duplication static void genericStoreTimeseriesNumbers(const Solver::IResultWriter::Ptr& writer, - const Matrix& timeseriesNumbers, + const Matrix& timeseriesNumbers, const std::string& id, const std::string& directory) { diff --git a/src/solver/simulation/common-eco-adq.cpp b/src/solver/simulation/common-eco-adq.cpp index 30a5591f5f..4b60eddeb7 100644 --- a/src/solver/simulation/common-eco-adq.cpp +++ b/src/solver/simulation/common-eco-adq.cpp @@ -347,7 +347,7 @@ void PrepareRandomNumbers(Data::Study& study, int retrieveAverageNTC(const Data::Study& study, const Matrix<>& capacities, - const Matrix& tsNumbers, + const Matrix& tsNumbers, std::vector& avg) { const auto& parameters = study.parameters; @@ -358,21 +358,21 @@ int retrieveAverageNTC(const Data::Study& study, const auto width = capacities.width; avg.assign(HOURS_PER_YEAR, 0); - std::map weightOfTS; + std::map weightOfTS; for (uint y = 0; y < study.parameters.nbYears; y++) { if (!yearsFilter[y]) continue; - Yuni::uint32 tsIndex = (width == 1) ? 0 : tsNumbers[0][y]; + uint32_t tsIndex = (width == 1) ? 0 : tsNumbers[0][y]; weightOfTS[tsIndex] += yearsWeight[y]; } // No need for the year number, only the TS index is required for (const auto& it : weightOfTS) { - const Yuni::uint32 tsIndex = it.first; + const uint32_t tsIndex = it.first; const double weight = it.second; for (uint h = 0; h < HOURS_PER_YEAR; h++) diff --git a/src/solver/simulation/common-eco-adq.h b/src/solver/simulation/common-eco-adq.h index 229288fb16..af5cf17de2 100644 --- a/src/solver/simulation/common-eco-adq.h +++ b/src/solver/simulation/common-eco-adq.h @@ -155,7 +155,7 @@ void updatingAnnualFinalHydroLevel(const Data::AreaList& areas, PROBLEME_HEBDO& */ int retrieveAverageNTC(const Data::Study& study, const Matrix<>& capacities, - const Matrix& tsNumbers, + const Matrix& tsNumbers, std::vector& avg); void finalizeOptimizationStatistics(PROBLEME_HEBDO& problem, diff --git a/src/solver/simulation/timeseries-numbers.cpp b/src/solver/simulation/timeseries-numbers.cpp index 8e02d40490..fa3c64b0dd 100644 --- a/src/solver/simulation/timeseries-numbers.cpp +++ b/src/solver/simulation/timeseries-numbers.cpp @@ -465,7 +465,7 @@ bool checkInterModalConsistencyForArea(Area& area, return true; } -void drawTSnumbersForIntraModal(array& intramodal_draws, +void drawTSnumbersForIntraModal(array& intramodal_draws, const array& isTSintramodal, array& nbTimeseriesByMode, MersenneTwister* mersenneTwisterTable) @@ -484,14 +484,14 @@ void drawTSnumbersForIntraModal(array& intramodal_draws } else { - intramodal_draws[tsKind] = (uint32)(floor( + intramodal_draws[tsKind] = (uint32_t)(floor( mersenneTwisterTable[seedTimeseriesNumbers].next() * nbTimeseriesByMode[tsKind])); } } } } -void storeTSnumbersForIntraModal(const array& intramodal_draws, +void storeTSnumbersForIntraModal(const array& intramodal_draws, const array& isTSintramodal, uint year, AreaList& areas) @@ -598,7 +598,7 @@ void drawAndStoreTSnumbersForNOTintraModal(const array& i uint nbTimeSeries = isTSgenerated[indexTS] ? nbTimeseriesByMode[indexTS] : area.load.series->timeSeries.width; area.load.series->timeseriesNumbers[0][year] - = (uint32)(floor(study.runtime->random[seedTimeseriesNumbers].next() * nbTimeSeries)); + = (uint32_t)(floor(study.runtime->random[seedTimeseriesNumbers].next() * nbTimeSeries)); } // ------------- @@ -611,7 +611,7 @@ void drawAndStoreTSnumbersForNOTintraModal(const array& i uint nbTimeSeries = isTSgenerated[indexTS] ? nbTimeseriesByMode[indexTS] : area.solar.series->timeSeries.width; area.solar.series->timeseriesNumbers[0][year] - = (uint32)(floor(study.runtime->random[seedTimeseriesNumbers].next() * nbTimeSeries)); + = (uint32_t)(floor(study.runtime->random[seedTimeseriesNumbers].next() * nbTimeSeries)); } // ------------- @@ -624,7 +624,7 @@ void drawAndStoreTSnumbersForNOTintraModal(const array& i uint nbTimeSeries = isTSgenerated[indexTS] ? nbTimeseriesByMode[indexTS] : area.wind.series->timeSeries.width; area.wind.series->timeseriesNumbers[0][year] - = (uint32)(floor(study.runtime->random[seedTimeseriesNumbers].next() * nbTimeSeries)); + = (uint32_t)(floor(study.runtime->random[seedTimeseriesNumbers].next() * nbTimeSeries)); } // ------------- @@ -637,7 +637,7 @@ void drawAndStoreTSnumbersForNOTintraModal(const array& i uint nbTimeSeries = isTSgenerated[indexTS] ? nbTimeseriesByMode[indexTS] : area.hydro.series->ror.width; area.hydro.series->timeseriesNumbers[0][year] - = (uint32)(floor(study.runtime->random[seedTimeseriesNumbers].next() * nbTimeSeries)); + = (uint32_t)(floor(study.runtime->random[seedTimeseriesNumbers].next() * nbTimeSeries)); } // ------------- @@ -657,7 +657,7 @@ void drawAndStoreTSnumbersForNOTintraModal(const array& i { uint nbTimeSeries = isTSgenerated[indexTS] ? nbTimeseriesByMode[indexTS] : cluster->series->timeSeries.width; - cluster->series->timeseriesNumbers[0][year] = (uint32)( + cluster->series->timeseriesNumbers[0][year] = (uint32_t)( floor(study.runtime->random[seedTimeseriesNumbers].next() * nbTimeSeries)); } } @@ -680,7 +680,7 @@ void drawAndStoreTSnumbersForNOTintraModal(const array& i { // There is no TS generation for renewable clusters uint nbTimeSeries = cluster->series->timeSeries.width; - cluster->series->timeseriesNumbers[0][year] = (uint32)( + cluster->series->timeseriesNumbers[0][year] = (uint32_t)( floor(study.runtime->random[seedTimeseriesNumbers].next() * nbTimeSeries)); } } @@ -706,7 +706,7 @@ void drawAndStoreTSnumbersForNOTintraModal(const array& i } else { - link.timeseriesNumbers[0][year] = (uint32)( + link.timeseriesNumbers[0][year] = (uint32_t)( floor(study.runtime->random[seedTimeseriesNumbers].next() * nbTimeSeries)); } } @@ -723,16 +723,16 @@ void drawAndStoreTSnumbersForNOTintraModal(const array& i } else { - value = (uint32)(floor(study.runtime->random[seedTimeseriesNumbers].next() * nbTimeSeries)); + value = (uint32_t)(floor(study.runtime->random[seedTimeseriesNumbers].next() * nbTimeSeries)); } } } -Matrix* getFirstTSnumberInterModalMatrixFoundInArea( +Matrix* getFirstTSnumberInterModalMatrixFoundInArea( Area& area, const array& isTSintermodal) { - Matrix* tsNumbersMtx = nullptr; + Matrix* tsNumbersMtx = nullptr; if (isTSintermodal[ts_to_tsIndex.at(timeSeriesLoad)]) tsNumbersMtx = &(area.load.series->timeseriesNumbers); else @@ -755,7 +755,7 @@ Matrix* getFirstTSnumberInterModalMatrixFoundInArea( return tsNumbersMtx; } -void applyMatrixDrawsToInterModalModesInArea(Matrix* tsNumbersMtx, +void applyMatrixDrawsToInterModalModesInArea(Matrix* tsNumbersMtx, Area& area, const array& isTSintermodal, const uint years) @@ -805,7 +805,7 @@ void applyMatrixDrawsToInterModalModesInArea(Matrix* tsNumbersMtx, } // Set tsNumbers to 1 for all years if only one TS is present -static void fixTSNumbersSingleAreaSingleMode(Matrix& tsNumbers, uint width, uint years) +static void fixTSNumbersSingleAreaSingleMode(Matrix& tsNumbers, uint width, uint years) { if (width == 1) { @@ -903,7 +903,7 @@ bool TimeSeriesNumbers::Generate(Study& study) array nbTimeseriesByMode; - array intramodal_draws; + array intramodal_draws; std::fill(intramodal_draws.begin(), intramodal_draws.end(), 0); const array isTSgenerated @@ -960,7 +960,7 @@ bool TimeSeriesNumbers::Generate(Study& study) if (not checkInterModalConsistencyForArea(area, isTSintermodal, isTSgenerated, study)) return false; - Matrix* tsNumbersMtx + Matrix* tsNumbersMtx = getFirstTSnumberInterModalMatrixFoundInArea(area, isTSintermodal); applyMatrixDrawsToInterModalModesInArea(tsNumbersMtx, area, isTSintermodal, years); diff --git a/src/solver/ts-generator/xcast/predicate.hxx b/src/solver/ts-generator/xcast/predicate.hxx index 5797a00b72..6a78b7da1d 100644 --- a/src/solver/ts-generator/xcast/predicate.hxx +++ b/src/solver/ts-generator/xcast/predicate.hxx @@ -59,7 +59,7 @@ public: return !Yuni::Math::Zero(area.wind.prepro->xcast.capacity); } - Matrix& matrix(Data::Area& area) const + Matrix& matrix(Data::Area& area) const { assert(area.wind.series != NULL); return area.wind.series->timeSeries; @@ -102,7 +102,7 @@ public: return !Yuni::Math::Zero(area.load.prepro->xcast.capacity); } - Matrix& matrix(Data::Area& area) const + Matrix& matrix(Data::Area& area) const { assert(area.load.series != NULL); return area.load.series->timeSeries; @@ -145,7 +145,7 @@ public: return !Yuni::Math::Zero(area.solar.prepro->xcast.capacity); } - Matrix& matrix(Data::Area& area) const + Matrix& matrix(Data::Area& area) const { assert(area.solar.series != NULL); return area.solar.series->timeSeries; diff --git a/src/solver/variable/area.h b/src/solver/variable/area.h index f7ec3dbe4a..de4a5315a2 100644 --- a/src/solver/variable/area.h +++ b/src/solver/variable/area.h @@ -169,7 +169,7 @@ class Areas //: public Variable::IVariable, NextT, VCardAllAreas> void beforeYearByYearExport(uint year, uint numSpace); - Yuni::uint64 memoryUsage() const; + uint64_t memoryUsage() const; template static void provideInformations(I& infos); diff --git a/src/solver/variable/area.memory-estimation.inc.hxx b/src/solver/variable/area.memory-estimation.inc.hxx index 02501dcf1b..75614864e6 100644 --- a/src/solver/variable/area.memory-estimation.inc.hxx +++ b/src/solver/variable/area.memory-estimation.inc.hxx @@ -38,9 +38,9 @@ namespace Solver namespace Variable { template<> -uint64 Areas::memoryUsage() const +uint64_t Areas::memoryUsage() const { - Yuni::uint64 result = 0; + uint64_t result = 0; for (unsigned int i = 0; i != pAreaCount; ++i) { result += sizeof(NextType) + sizeof(void*); // overhead vector diff --git a/src/solver/variable/bc.memory-estimation.inc.hxx b/src/solver/variable/bc.memory-estimation.inc.hxx index 52ce11a407..136347c513 100644 --- a/src/solver/variable/bc.memory-estimation.inc.hxx +++ b/src/solver/variable/bc.memory-estimation.inc.hxx @@ -34,9 +34,9 @@ namespace Solver namespace Variable { template<> -uint64 BindingConstraints::memoryUsage() const +uint64_t BindingConstraints::memoryUsage() const { - uint64 result = 0; + uint64_t result = 0; for (unsigned int i = 0; i != pBCcount; ++i) { result += sizeof(NextType) + sizeof(void*); // overhead vector diff --git a/src/solver/variable/bindConstraints.h b/src/solver/variable/bindConstraints.h index d052d31057..c6a21c799c 100644 --- a/src/solver/variable/bindConstraints.h +++ b/src/solver/variable/bindConstraints.h @@ -151,7 +151,7 @@ class BindingConstraints int precision, uint numSpace) const; - Yuni::uint64 memoryUsage() const; + uint64_t memoryUsage() const; template static void provideInformations(I& infos); diff --git a/src/solver/variable/commons/join.h b/src/solver/variable/commons/join.h index 0076450995..8770302bbe 100644 --- a/src/solver/variable/commons/join.h +++ b/src/solver/variable/commons/join.h @@ -345,7 +345,7 @@ class Join : public Variable::IVariable, Yuni::D RightType::template simulationEndSpatialAggregates(allVars); } - Yuni::uint64 memoryUsage() const + uint64_t memoryUsage() const { return LeftType::memoryUsage() + RightType::memoryUsage() + BindConstType::memoryUsage(); } diff --git a/src/solver/variable/commons/links/links.h.inc.hxx b/src/solver/variable/commons/links/links.h.inc.hxx index 94fdbe5437..e9b2c81158 100644 --- a/src/solver/variable/commons/links/links.h.inc.hxx +++ b/src/solver/variable/commons/links/links.h.inc.hxx @@ -176,7 +176,7 @@ public: void beforeYearByYearExport(uint year, uint numSpace); - Yuni::uint64 memoryUsage() const; + uint64_t memoryUsage() const; void buildDigest(SurveyResults& results, int digestLevel, int dataLevel) const; diff --git a/src/solver/variable/commons/links/links.hxx.inc.hxx b/src/solver/variable/commons/links/links.hxx.inc.hxx index 4b7033f03b..44c0405de0 100644 --- a/src/solver/variable/commons/links/links.hxx.inc.hxx +++ b/src/solver/variable/commons/links/links.hxx.inc.hxx @@ -286,9 +286,9 @@ void Links::RetrieveVariableList(PredicateT& predicate) NextType::RetrieveVariableList(predicate); } -inline Yuni::uint64 Links::memoryUsage() const +inline uint64_t Links::memoryUsage() const { - Yuni::uint64 result = 0; + uint64_t result = 0; for (uint i = 0; i != pLinkCount; ++i) { result += sizeof(NextType) + sizeof(void*); diff --git a/src/solver/variable/container.h b/src/solver/variable/container.h index cac37b34db..7e3cc10de2 100644 --- a/src/solver/variable/container.h +++ b/src/solver/variable/container.h @@ -229,7 +229,7 @@ class List : public NextT //! \name Memory management //@{ //! Get the amount of memory currently used by the class - Yuni::uint64 memoryUsage() const; + uint64_t memoryUsage() const; //@} private: diff --git a/src/solver/variable/container.hxx b/src/solver/variable/container.hxx index ddef78449e..79e98c005c 100644 --- a/src/solver/variable/container.hxx +++ b/src/solver/variable/container.hxx @@ -241,7 +241,7 @@ inline void List::retrieveResultsForLink( } template -inline Yuni::uint64 List::memoryUsage() const +inline uint64_t List::memoryUsage() const { return sizeof(ListType) + NextType::memoryUsage(); } diff --git a/src/solver/variable/economy/STStorageInjectionByCluster.h b/src/solver/variable/economy/STStorageInjectionByCluster.h index adb87a745c..31ccb7912a 100644 --- a/src/solver/variable/economy/STStorageInjectionByCluster.h +++ b/src/solver/variable/economy/STStorageInjectionByCluster.h @@ -257,9 +257,9 @@ class STstorageInjectionByCluster : public Variable::IVariable MatrixType; + typedef Matrix MatrixType; const Data::ThermalClusterList::const_iterator end = list.end(); for (Data::ThermalClusterList::const_iterator i = list.begin(); i != end; ++i) diff --git a/src/solver/variable/economy/productionByDispatchablePlant.h b/src/solver/variable/economy/productionByDispatchablePlant.h index 417b40fcaa..a43fbe31bf 100644 --- a/src/solver/variable/economy/productionByDispatchablePlant.h +++ b/src/solver/variable/economy/productionByDispatchablePlant.h @@ -340,9 +340,9 @@ class ProductionByDispatchablePlant return pValuesForTheCurrentYear[numSpace][column].hour; } - inline Yuni::uint64 memoryUsage() const + inline uint64_t memoryUsage() const { - Yuni::uint64 r = (sizeof(IntermediateValues) * pSize + IntermediateValues::MemoryUsage()) + uint64_t r = (sizeof(IntermediateValues) * pSize + IntermediateValues::MemoryUsage()) * pNbYearsParallel; r += sizeof(double) * pSize * maxHoursInAYear * pNbYearsParallel; r += AncestorType::memoryUsage(); diff --git a/src/solver/variable/economy/productionByRenewablePlant.h b/src/solver/variable/economy/productionByRenewablePlant.h index 4728f5b081..84589ea1f2 100644 --- a/src/solver/variable/economy/productionByRenewablePlant.h +++ b/src/solver/variable/economy/productionByRenewablePlant.h @@ -304,9 +304,9 @@ class ProductionByRenewablePlant : public Variable::IVariable } } - static Yuni::uint64 Value(const Type& container) + static uint64_t Value(const Type& container) { - Yuni::uint64 result = 0; + uint64_t result = 0; const typename Type::const_iterator end = container.end(); for (typename Type::const_iterator i = container.begin(); i != end; ++i) result += sizeof(ResultsT) + (*i).memoryUsage(); @@ -562,7 +562,7 @@ struct VariableAccessor container.merge(year, intermediateValues); } - static Yuni::uint64 Value(const Type& container) + static uint64_t Value(const Type& container) { return container.memoryUsage(); } @@ -681,7 +681,7 @@ struct VariableAccessor // Do nothing } - static Yuni::uint64 Value(const Type&) + static uint64_t Value(const Type&) { return 0; } diff --git a/src/solver/variable/setofareas.h b/src/solver/variable/setofareas.h index 18e153e597..79e8ca7e8e 100644 --- a/src/solver/variable/setofareas.h +++ b/src/solver/variable/setofareas.h @@ -166,7 +166,7 @@ class SetsOfAreas void beforeYearByYearExport(uint year, uint numSpace); - Yuni::uint64 memoryUsage() const; + uint64_t memoryUsage() const; template static void provideInformations(I& infos); diff --git a/src/solver/variable/setofareas.hxx b/src/solver/variable/setofareas.hxx index e04bc62a26..2936fa6bfa 100644 --- a/src/solver/variable/setofareas.hxx +++ b/src/solver/variable/setofareas.hxx @@ -264,9 +264,9 @@ void SetsOfAreas::buildDigest(SurveyResults& results, int digestLevel, in } template -inline Yuni::uint64 SetsOfAreas::memoryUsage() const +inline uint64_t SetsOfAreas::memoryUsage() const { - Yuni::uint64 result = sizeof(NextType) * pSetsOfAreas.size(); + uint64_t result = sizeof(NextType) * pSetsOfAreas.size(); for (auto i = pBegin; i != pEnd; ++i) result += (*i)->memoryUsage(); return result; diff --git a/src/solver/variable/storage/average.h b/src/solver/variable/storage/average.h index e0f6b37d94..cc09b72533 100644 --- a/src/solver/variable/storage/average.h +++ b/src/solver/variable/storage/average.h @@ -163,7 +163,7 @@ struct Average : public NextT NextType::template buildDigest(report, digestLevel, dataLevel); } - Yuni::uint64 memoryUsage() const + uint64_t memoryUsage() const { return avgdata.dynamicMemoryUsage() + NextType::memoryUsage(); } diff --git a/src/solver/variable/storage/averagedata.h b/src/solver/variable/storage/averagedata.h index 03f9976c77..8f7d4d4109 100644 --- a/src/solver/variable/storage/averagedata.h +++ b/src/solver/variable/storage/averagedata.h @@ -57,7 +57,7 @@ class AverageData void merge(unsigned int year, const IntermediateValues& rhs); - Yuni::uint64 dynamicMemoryUsage() const + uint64_t dynamicMemoryUsage() const { return sizeof(double) * maxHoursInAYear + sizeof(double) * nbYearsCapacity; } diff --git a/src/solver/variable/storage/empty.h b/src/solver/variable/storage/empty.h index c6bbb570ec..6d5c86973a 100644 --- a/src/solver/variable/storage/empty.h +++ b/src/solver/variable/storage/empty.h @@ -76,7 +76,7 @@ struct Empty // Does nothing } - static Yuni::uint64 memoryUsage() + static uint64_t memoryUsage() { return 0; } diff --git a/src/solver/variable/storage/intermediate.h b/src/solver/variable/storage/intermediate.h index fa2764d2b3..48c24480c6 100644 --- a/src/solver/variable/storage/intermediate.h +++ b/src/solver/variable/storage/intermediate.h @@ -56,7 +56,7 @@ class IntermediateValues final //! Get the dynamic amount of memory consummed by a simulation // \note This method assumes that you've already have gathered the size // of this class - static Yuni::uint64 MemoryUsage(); + static uint64_t MemoryUsage(); //! \name Constructor & Destructor //@{ diff --git a/src/solver/variable/storage/intermediate.hxx b/src/solver/variable/storage/intermediate.hxx index 157a00a353..865b068ef4 100644 --- a/src/solver/variable/storage/intermediate.hxx +++ b/src/solver/variable/storage/intermediate.hxx @@ -57,7 +57,7 @@ inline const IntermediateValues::Type& IntermediateValues::operator[]( return hour[index]; } -inline Yuni::uint64 IntermediateValues::MemoryUsage() +inline uint64_t IntermediateValues::MemoryUsage() { return +sizeof(Type) * maxHoursInAYear; } diff --git a/src/solver/variable/storage/minmax-data.cpp b/src/solver/variable/storage/minmax-data.cpp index ce68d246cb..43ee735ea1 100644 --- a/src/solver/variable/storage/minmax-data.cpp +++ b/src/solver/variable/storage/minmax-data.cpp @@ -47,7 +47,7 @@ struct ArrayInitializer { MinMaxData::Data& data = array[i]; data.value = DBL_MAX; // +inf - data.indice = (Yuni::uint32)(-1); // invalid indice + data.indice = (uint32_t)(-1); // invalid indice } } @@ -57,7 +57,7 @@ struct ArrayInitializer { MinMaxData::Data& data = array[i]; data.value = DBL_MAX; // +inf - data.indice = (Yuni::uint32)(-1); // invalid indice + data.indice = (uint32_t)(-1); // invalid indice } } @@ -75,7 +75,7 @@ struct ArrayInitializer // hold in a double MinMaxData::Data& data = array[i]; data.value = -DBL_MAX; // -inf - data.indice = (Yuni::uint32)(-1); // invalid indice + data.indice = (uint32_t)(-1); // invalid indice } } @@ -88,7 +88,7 @@ struct ArrayInitializer // hold in a double MinMaxData::Data& data = array[i]; data.value = -DBL_MAX; // -inf - data.indice = (Yuni::uint32)(-1); // invalid indice + data.indice = (uint32_t)(-1); // invalid indice } } diff --git a/src/solver/variable/storage/minmax-data.h b/src/solver/variable/storage/minmax-data.h index 96080de2cd..0a1175b6d6 100644 --- a/src/solver/variable/storage/minmax-data.h +++ b/src/solver/variable/storage/minmax-data.h @@ -46,7 +46,7 @@ class MinMaxData struct Data { double value; - Yuni::uint32 indice; + uint32_t indice; }; public: diff --git a/src/solver/variable/storage/minmax.h b/src/solver/variable/storage/minmax.h index 970cdc80bf..20ef4b9051 100644 --- a/src/solver/variable/storage/minmax.h +++ b/src/solver/variable/storage/minmax.h @@ -137,7 +137,7 @@ struct MinMaxBase : public NextT void merge(uint year, const IntermediateValues& rhs); - Yuni::uint64 memoryUsage() const + uint64_t memoryUsage() const { return sizeof(double) * maxHoursInAYear + NextType::memoryUsage(); } diff --git a/src/solver/variable/storage/raw.h b/src/solver/variable/storage/raw.h index b4a2eea04a..39d8bffc25 100644 --- a/src/solver/variable/storage/raw.h +++ b/src/solver/variable/storage/raw.h @@ -160,7 +160,7 @@ struct Raw : public NextT NextType::template buildDigest(report, digestLevel, dataLevel); } - Yuni::uint64 memoryUsage() const + uint64_t memoryUsage() const { return +sizeof(double) * maxHoursInAYear + NextType::memoryUsage(); } diff --git a/src/solver/variable/storage/results.h b/src/solver/variable/storage/results.h index 41efa38bfb..c42674c337 100644 --- a/src/solver/variable/storage/results.h +++ b/src/solver/variable/storage/results.h @@ -95,7 +95,7 @@ class Results : public FirstDecoratorT DecoratorType::template buildDigest(results, digestLevel, dataLevel); } - Yuni::uint64 memoryUsage() const + uint64_t memoryUsage() const { return DecoratorType::memoryUsage(); } diff --git a/src/solver/variable/storage/stdDeviation.h b/src/solver/variable/storage/stdDeviation.h index 283524300a..33129b666b 100644 --- a/src/solver/variable/storage/stdDeviation.h +++ b/src/solver/variable/storage/stdDeviation.h @@ -166,7 +166,7 @@ struct StdDeviation : public NextT report, results, dataLevel, fileLevel, precision); } - Yuni::uint64 memoryUsage() const + uint64_t memoryUsage() const { return sizeof(double) * maxHoursInAYear + NextType::memoryUsage(); } diff --git a/src/solver/variable/surveyresults/surveyresults.cpp b/src/solver/variable/surveyresults/surveyresults.cpp index c70a3f23fd..2ceaf12e3d 100644 --- a/src/solver/variable/surveyresults/surveyresults.cpp +++ b/src/solver/variable/surveyresults/surveyresults.cpp @@ -503,11 +503,6 @@ SurveyResults::SurveyResults(const Data::Study& s, logs.debug() << " (for " << maxVariables << " columns)"; data.initialize(maxVariables); - // logs.debug() << " :: survey results: allocating " - // << (uint64)((data.matrix.memoryUsage() + sizeof(values)) - // + sizeof(double) * maxHoursInAYear * 3 - // + sizeof(PrecisionType) * maxVariables) / 1024 - // << " Ko"; // values typedef double* ValueType; diff --git a/src/solver/variable/variable.h b/src/solver/variable/variable.h index dfd53cb063..56f0f9a69d 100644 --- a/src/solver/variable/variable.h +++ b/src/solver/variable/variable.h @@ -289,7 +289,7 @@ class IVariable : protected NextT /*! ** \brief Get the memory used by this variable and all other in the static list */ - Yuni::uint64 memoryUsage() const; + uint64_t memoryUsage() const; /*! ** \brief "Print" informations about the variable tree diff --git a/src/solver/variable/variable.hxx b/src/solver/variable/variable.hxx index 7628c49ba1..d147707b8b 100644 --- a/src/solver/variable/variable.hxx +++ b/src/solver/variable/variable.hxx @@ -348,9 +348,9 @@ inline void IVariable::beforeYearByYearExport(uint year, } template -inline Yuni::uint64 IVariable::memoryUsage() const +inline uint64_t IVariable::memoryUsage() const { - Yuni::uint64 r = VariableAccessorType::Value(pResults); + uint64_t r = VariableAccessorType::Value(pResults); if ((int)VCardT::columnCount != (int)Category::dynamicColumns) { // Intermediate values diff --git a/src/tests/src/libs/antares/array/fill-matrix.h b/src/tests/src/libs/antares/array/fill-matrix.h index 0f0c10d5d7..79a69b4929 100644 --- a/src/tests/src/libs/antares/array/fill-matrix.h +++ b/src/tests/src/libs/antares/array/fill-matrix.h @@ -13,7 +13,7 @@ namespace Antares { namespace Statistics { -void HasWrittenToDisk(Yuni::uint64 /* size */) +void HasWrittenToDisk(uint64_t /* size */) { } } // namespace Statistics diff --git a/src/tests/src/libs/antares/array/matrix-bypass-load.h b/src/tests/src/libs/antares/array/matrix-bypass-load.h index 7e881b45c2..521b3cb83a 100644 --- a/src/tests/src/libs/antares/array/matrix-bypass-load.h +++ b/src/tests/src/libs/antares/array/matrix-bypass-load.h @@ -26,7 +26,7 @@ namespace Antares { namespace Statistics { -void HasReadFromDisk(Yuni::uint64 /* size */) +void HasReadFromDisk(uint64_t /* size */) { } } // namespace Statistics diff --git a/src/tests/src/libs/antares/array/tests-matrix-save.h b/src/tests/src/libs/antares/array/tests-matrix-save.h index c1d946d342..e8ea710661 100644 --- a/src/tests/src/libs/antares/array/tests-matrix-save.h +++ b/src/tests/src/libs/antares/array/tests-matrix-save.h @@ -12,7 +12,7 @@ using namespace Antares; struct TSNumbersPredicate { - uint32 operator () (uint32 value) const + uint32_t operator () (uint32_t value) const { return value + 1; } diff --git a/src/tests/src/libs/antares/study/output-folder/study.cpp b/src/tests/src/libs/antares/study/output-folder/study.cpp index 553fa21ed9..9f55894126 100644 --- a/src/tests/src/libs/antares/study/output-folder/study.cpp +++ b/src/tests/src/libs/antares/study/output-folder/study.cpp @@ -54,7 +54,7 @@ BOOST_FIXTURE_TEST_CASE(economy_legacyfiles_emptylabel, Fixture) StudyMode mode = stdmEconomy; ResultFormat fmt = legacyFilesDirectories; const YString label = ""; - const Yuni::sint64 startTime = 1; + const int64_t startTime = 1; const YString expectedOutput = (outputRoot / "19700101-0000eco").string(); const YString actualOutput = StudyCreateOutputPath(mode, fmt, outputRoot.string(), label, startTime); @@ -66,7 +66,7 @@ BOOST_FIXTURE_TEST_CASE(economy_legacyfiles_label_now, Fixture) StudyMode mode = stdmEconomy; ResultFormat fmt = legacyFilesDirectories; const YString label = "test"; - const Yuni::sint64 startTime = 1672391667; + const int64_t startTime = 1672391667; const YString expectedOutput = (outputRoot / "20221230-0914eco-test").string(); const YString actualOutput = StudyCreateOutputPath(mode, fmt, outputRoot.string(), label, startTime); @@ -78,7 +78,7 @@ BOOST_FIXTURE_TEST_CASE(adequacy_legacyfiles_label_now, Fixture) StudyMode mode = stdmAdequacy; ResultFormat fmt = legacyFilesDirectories; const YString label = "test"; - const Yuni::sint64 startTime = 1672391667; + const int64_t startTime = 1672391667; const YString expectedOutput = (outputRoot / "20221230-0914adq-test").string(); const YString actualOutput = StudyCreateOutputPath(mode, fmt, outputRoot.string(), label, startTime); @@ -96,7 +96,7 @@ BOOST_FIXTURE_TEST_CASE(adequacy_zip_label_now, Fixture) StudyMode mode = stdmAdequacy; ResultFormat fmt = zipArchive; const YString label = "test"; - const Yuni::sint64 startTime = 1672391667; + const int64_t startTime = 1672391667; const YString expectedOutput = (outputRoot / "20221230-0914adq-test").string(); const YString actualOutput = StudyCreateOutputPath(mode, fmt, outputRoot.string(), label, startTime); diff --git a/src/tests/src/solver/simulation/test-store-timeseries-number.cpp b/src/tests/src/solver/simulation/test-store-timeseries-number.cpp index ce30db1d5f..bfabcd1ba7 100644 --- a/src/tests/src/solver/simulation/test-store-timeseries-number.cpp +++ b/src/tests/src/solver/simulation/test-store-timeseries-number.cpp @@ -99,7 +99,7 @@ BOOST_AUTO_TEST_CASE(BC_timeseries_numbers_store_values) { initializeStudy(*study); TimeSeriesNumbers::Generate(*study); - Matrix series(2, 2); + Matrix series(2, 2); series[0][0] = 0; series[0][1] = 1; series[1][0] = 42; @@ -110,7 +110,7 @@ BOOST_AUTO_TEST_CASE(BC_timeseries_numbers_store_values) { fs::path test1_path = working_tmp_dir / "ts-numbers" / "bindingconstraints" / "test1.txt"; BOOST_CHECK_EQUAL(fs::exists(test1_path), true); - Matrix out; + Matrix out; out.loadFromCSVFile(test1_path.string()); BOOST_CHECK_EQUAL(series[0][0]+1, out[0][0]); BOOST_CHECK_EQUAL(series[0][1]+1, out[0][1]); diff --git a/src/tools/vacuum/antares-study.cpp b/src/tools/vacuum/antares-study.cpp index a6fc0e1e4e..278d77544b 100644 --- a/src/tools/vacuum/antares-study.cpp +++ b/src/tools/vacuum/antares-study.cpp @@ -50,13 +50,13 @@ class UserData : private Yuni::NonCopyable } public: - sint64 dateLimit; + int64_t dateLimit; FSWalker::DispatchJobEvent queue; Mutex mutex; - uint64 bytesDeleted; - uint64 filesDeleted; - uint64 foldersDeleted; + uint64_t bytesDeleted; + uint64_t filesDeleted; + uint64_t foldersDeleted; }; class AntaresStudyAnalyzerJob : public FSWalker::IJob @@ -71,7 +71,7 @@ class AntaresStudyAnalyzerJob : public FSWalker::IJob public: String folder; - sint64 dateLimit; + int64_t dateLimit; UserData* userdata; protected: @@ -208,8 +208,8 @@ class FolderRemover : public FSWalker::IJob logs.info() << " :: starting removal of " << folder; String::Vector foldersToDelete; - uint64 bytesDeleted = 0; - uint64 filesDeleted = 0; + uint64_t bytesDeleted = 0; + uint64_t filesDeleted = 0; IO::Directory::Info info(folder); auto end = info.recursive_end(); @@ -343,7 +343,7 @@ const char* AntaresStudy::caption() const return "antares study"; } -AntaresStudy::AntaresStudy(yint64 dateLimit) : +AntaresStudy::AntaresStudy(int64_t dateLimit) : bytesDeleted(), filesDeleted(), foldersDeleted(), pDateLimit(dateLimit) { } diff --git a/src/tools/vacuum/antares-study.h b/src/tools/vacuum/antares-study.h index fbffcd2cd2..ff27cde76f 100644 --- a/src/tools/vacuum/antares-study.h +++ b/src/tools/vacuum/antares-study.h @@ -33,7 +33,7 @@ class AntaresStudy : public FSWalker::IExtension { public: - AntaresStudy(yint64 dateLimit); + AntaresStudy(int64_t dateLimit); virtual ~AntaresStudy() { } @@ -52,13 +52,13 @@ class AntaresStudy : public FSWalker::IExtension virtual void userdataDestroy(void* userdata); public: - yuint64 bytesDeleted; - yuint64 filesDeleted; - yuint64 foldersDeleted; + uint64_t bytesDeleted; + uint64_t filesDeleted; + uint64_t foldersDeleted; private: Yuni::Mutex pMutex; - yint64 pDateLimit; + int64_t pDateLimit; }; // class AntaresStudy diff --git a/src/tools/vacuum/io.cpp b/src/tools/vacuum/io.cpp index 68aa22a6cd..8a5210fa45 100644 --- a/src/tools/vacuum/io.cpp +++ b/src/tools/vacuum/io.cpp @@ -37,7 +37,7 @@ using namespace Yuni; /*extern*/ std::unordered_set inputFolders; -bool RemoveFile(const String& filename, uint64 size) +bool RemoveFile(const String& filename, uint64_t size) { if (dry || IO::errNone == IO::File::Delete(filename)) { diff --git a/src/tools/vacuum/io.h b/src/tools/vacuum/io.h index dca8c8982d..cf4415105d 100644 --- a/src/tools/vacuum/io.h +++ b/src/tools/vacuum/io.h @@ -54,7 +54,7 @@ extern std::unordered_set inputFolders; ** ** No I/O operations will be performed if in dry mode */ -bool RemoveFile(const YString& filename, yuint64 size); +bool RemoveFile(const YString& filename, uint64_t size); /*! ** \brief Try to remove a folder if empty diff --git a/src/tools/vacuum/main.cpp b/src/tools/vacuum/main.cpp index dcc04d1c2e..c6ffd6bd5f 100644 --- a/src/tools/vacuum/main.cpp +++ b/src/tools/vacuum/main.cpp @@ -52,7 +52,7 @@ static inline double Round2ndPlace(double v) return v / 100.; } -static void NotifyDuration(sint64 duration) +static void NotifyDuration(int64_t duration) { switch (duration) { @@ -67,7 +67,7 @@ static void NotifyDuration(sint64 duration) } } -static void NotifyBytesDeleted(uint64 bytes) +static void NotifyBytesDeleted(uint64_t bytes) { String message; @@ -111,7 +111,7 @@ static void NotifyBytesDeleted(uint64 bytes) logs.info() << message; } -static void NotifyFilesDeleted(uint64 count) +static void NotifyFilesDeleted(uint64_t count) { switch (count) { @@ -126,7 +126,7 @@ static void NotifyFilesDeleted(uint64 count) } } -static void NotifyFoldersDeleted(uint64 count) +static void NotifyFoldersDeleted(uint64_t count) { switch (count) { @@ -143,7 +143,7 @@ static void NotifyFoldersDeleted(uint64 count) static void NotifyStatistics(const String& logprefix, const FSWalker::Statistics& stats, - uint64 duration) + uint64_t duration) { String message; @@ -191,7 +191,7 @@ namespace // anonymous class DirectoryCleanerJob : public Job::IJob { public: - DirectoryCleanerJob(const String& directory, sint64 dateLimit) : + DirectoryCleanerJob(const String& directory, int64_t dateLimit) : directory(directory), dateLimit(dateLimit) { } @@ -203,7 +203,7 @@ class DirectoryCleanerJob : public Job::IJob //! The directory to clean String directory; //! The lower date limit - sint64 dateLimit; + int64_t dateLimit; protected: virtual void onExecute() @@ -359,8 +359,8 @@ int main(int argc, char** argv) logs.info(); NotifyDuration(DateTime::Now() - starttime); NotifyBytesDeleted(IOBytesDeleted); - NotifyFilesDeleted((uint64)IOFilesDeleted); - NotifyFoldersDeleted((uint64)IOFoldersDeleted); + NotifyFilesDeleted((uint64_t)IOFilesDeleted); + NotifyFoldersDeleted((uint64_t)IOFoldersDeleted); logs.info(); logs.info() << "exiting gracefully"; diff --git a/src/tools/vacuum/modified-inode.cpp b/src/tools/vacuum/modified-inode.cpp index ae61b2dd86..2c2f9f5472 100644 --- a/src/tools/vacuum/modified-inode.cpp +++ b/src/tools/vacuum/modified-inode.cpp @@ -56,12 +56,12 @@ class UserData : private Yuni::NonCopyable void pushToLogs(); public: - sint64 dateLimit; + int64_t dateLimit; Mutex mutex; - uint64 bytesDeleted; - uint64 filesDeleted; - uint64 foldersDeleted; + uint64_t bytesDeleted; + uint64_t filesDeleted; + uint64_t foldersDeleted; std::unordered_set pathsToDeleteIfEmpty; //! delayed Entries to push into logs @@ -94,7 +94,7 @@ void UserData::syncBeforeRelease() if (not dry && not pathsToDeleteIfEmpty.empty()) { String folder; - uint64 folderRemovedCount = 0; + uint64_t folderRemovedCount = 0; foreach (auto& path, pathsToDeleteIfEmpty) { if (not RemoveDirectoryIfEmpty(path)) @@ -146,8 +146,8 @@ void UserData::syncBeforeRelease() static void OnFileEvent(const String& filename, const String& parent, - sint64 modified, - uint64 size, + int64_t modified, + uint64_t size, void* user) { if (not(modified < ((UserData*)user)->dateLimit)) @@ -242,7 +242,7 @@ void ModifiedINode::userdataDestroy(void* userdata) } } -ModifiedINode::ModifiedINode(yint64 dateLimit) : +ModifiedINode::ModifiedINode(int64_t dateLimit) : bytesDeleted(), filesDeleted(), foldersDeleted(), pDateLimit(dateLimit), pQueue() { } diff --git a/src/tools/vacuum/modified-inode.h b/src/tools/vacuum/modified-inode.h index 787a277ad5..ec62b93c42 100644 --- a/src/tools/vacuum/modified-inode.h +++ b/src/tools/vacuum/modified-inode.h @@ -33,7 +33,7 @@ class ModifiedINode : public FSWalker::IExtension { public: - ModifiedINode(yint64 dateLimit); + ModifiedINode(int64_t dateLimit); virtual ~ModifiedINode() { } @@ -47,13 +47,13 @@ class ModifiedINode : public FSWalker::IExtension virtual void userdataDestroy(void* userdata); public: - yuint64 bytesDeleted; - yuint64 filesDeleted; - yuint64 foldersDeleted; + uint64_t bytesDeleted; + uint64_t filesDeleted; + uint64_t foldersDeleted; private: Yuni::Mutex pMutex; - yint64 pDateLimit; + int64_t pDateLimit; FSWalker::DispatchJobEvent pQueue; }; // class ModifiedINode diff --git a/src/ui/common/component/spotlight/iitem.h b/src/ui/common/component/spotlight/iitem.h index d72790ec6d..5dafc9b7ee 100644 --- a/src/ui/common/component/spotlight/iitem.h +++ b/src/ui/common/component/spotlight/iitem.h @@ -78,14 +78,14 @@ class IItem { } template - Tag(const StringT& t, Yuni::uint8 r, Yuni::uint8 g, Yuni::uint8 b) : + Tag(const StringT& t, uint8_t r, uint8_t g, uint8_t b) : text(wxStringFromUTF8(t)), color(r, g, b) { } - Tag(const wxChar* t, Yuni::uint8 r, Yuni::uint8 g, Yuni::uint8 b) : text(t), color(r, g, b) + Tag(const wxChar* t, uint8_t r, uint8_t g, uint8_t b) : text(t), color(r, g, b) { } - Tag(const wxString& t, Yuni::uint8 r, Yuni::uint8 g, Yuni::uint8 b) : + Tag(const wxString& t, uint8_t r, uint8_t g, uint8_t b) : text(t), color(r, g, b) { } @@ -171,13 +171,13 @@ class IItem void addTag(const StringT& text); //! Add a new tag template - void addTag(const StringT& text, Yuni::uint8 r, Yuni::uint8 g, Yuni::uint8 b); + void addTag(const StringT& text, uint8_t r, uint8_t g, uint8_t b); //! Add a new tag on the right template void addRightTag(const StringT& text); //! Add a new tag on the right template - void addRightTag(const StringT& text, Yuni::uint8 r, Yuni::uint8 g, Yuni::uint8 b); + void addRightTag(const StringT& text, uint8_t r, uint8_t g, uint8_t b); //! Clear all tags void clearTags(); //@} diff --git a/src/ui/common/component/spotlight/iitem.hxx b/src/ui/common/component/spotlight/iitem.hxx index de79f58b42..893f1af5a2 100644 --- a/src/ui/common/component/spotlight/iitem.hxx +++ b/src/ui/common/component/spotlight/iitem.hxx @@ -125,9 +125,9 @@ inline void Spotlight::IItem::addTag(const StringT& text) template inline void Spotlight::IItem::addTag(const StringT& text, - Yuni::uint8 r, - Yuni::uint8 g, - Yuni::uint8 b) + uint8_t r, + uint8_t g, + uint8_t b) { pLeftTags.push_back(std::make_shared(text, r, g, b)); } @@ -140,9 +140,9 @@ inline void Spotlight::IItem::addRightTag(const StringT& text) template inline void Spotlight::IItem::addRightTag(const StringT& text, - Yuni::uint8 r, - Yuni::uint8 g, - Yuni::uint8 b) + uint8_t r, + uint8_t g, + uint8_t b) { pRightTags.push_back(std::make_shared(text, r, g, b)); } diff --git a/src/ui/simulator/application/main/refresh.cpp b/src/ui/simulator/application/main/refresh.cpp index f3f6b90ed5..fd07e11408 100644 --- a/src/ui/simulator/application/main/refresh.cpp +++ b/src/ui/simulator/application/main/refresh.cpp @@ -51,20 +51,20 @@ struct CompareByStudyMode final struct CompareByTimestamp final { - bool operator()(const sint64 a, const sint64 b) const + bool operator()(const int64_t a, const int64_t b) const { return b < a; } }; template -static inline bool TimestampToString(S& out, sint64 timestamp) +static inline bool TimestampToString(S& out, int64_t timestamp) { return DateTime::TimestampToString(out, "%A,%d %B %Y at %H:%M", timestamp); } template -static inline bool OutputTimestampToString(S& out, sint64 timestamp) +static inline bool OutputTimestampToString(S& out, int64_t timestamp) { if (DateTime::TimestampToString(out, "%d %b %Y (%a) %H:%M", timestamp)) { @@ -118,7 +118,7 @@ void ApplWnd::refreshMenuOutput() // NOTE : in some rare cases, it may happen that two simulations have the // same timestamp using StudyModeT = Data::StudyMode; - using TemporalMap = std::map; + using TemporalMap = std::map; using Map = std::map; // Getting the list of all available outputs diff --git a/src/ui/simulator/application/study.cpp b/src/ui/simulator/application/study.cpp index 9fbf768e4e..bb51370a2b 100644 --- a/src/ui/simulator/application/study.cpp +++ b/src/ui/simulator/application/study.cpp @@ -124,7 +124,7 @@ Data::Output::List ListOfOutputsForTheCurrentStudy; bool gStudyHasBeenModified = true; -volatile uint64 gInMemoryRevisionIncrement = 0; +volatile uint64_t gInMemoryRevisionIncrement = 0; inline static void ResetLastOpenedFilepath() { @@ -415,8 +415,8 @@ class JobSaveStudy final : public Toolbox::Jobs::Job bool onCopyFile(IO::Directory::CopyState state, const String&, const String&, - uint64 count, - uint64 total) + uint64_t count, + uint64_t total) { if (0 == (--pCount)) { @@ -560,7 +560,7 @@ bool CanPerformMemoryFlush() return !gMemoryFlushRefCount; } -uint64 StudyInMemoryRevisionID() +uint64_t StudyInMemoryRevisionID() { return gInMemoryRevisionIncrement; } diff --git a/src/ui/simulator/application/study.h b/src/ui/simulator/application/study.h index 1da84de8ba..a6d408d638 100644 --- a/src/ui/simulator/application/study.h +++ b/src/ui/simulator/application/study.h @@ -168,7 +168,7 @@ bool StudyHasBeenModified(); ** if he study has been modified between two points in time ** if this value is different. */ -Yuni::uint64 StudyInMemoryRevisionID(); +uint64_t StudyInMemoryRevisionID(); /*! ** \brief Refresh the list of all available outputs diff --git a/src/ui/simulator/toolbox/components/datagrid/renderer/area/timeseries.h b/src/ui/simulator/toolbox/components/datagrid/renderer/area/timeseries.h index 74f5439140..b9ed6f3576 100644 --- a/src/ui/simulator/toolbox/components/datagrid/renderer/area/timeseries.h +++ b/src/ui/simulator/toolbox/components/datagrid/renderer/area/timeseries.h @@ -42,10 +42,10 @@ namespace Datagrid { namespace Renderer { -class ATimeSeries : public Renderer::Matrix, public Renderer::ARendererArea +class ATimeSeries : public Renderer::Matrix, public Renderer::ARendererArea { public: - using AncestorType = Renderer::Matrix; + using AncestorType = Renderer::Matrix; public: ATimeSeries(wxWindow* control, Toolbox::InputSelector::Area* notifier); @@ -117,7 +117,7 @@ class ATimeSeries : public Renderer::Matrix, public Render class TimeSeriesLoad final : public ATimeSeries { public: - using AncestorType = Renderer::Matrix; + using AncestorType = Renderer::Matrix; public: TimeSeriesLoad(wxWindow* control, Toolbox::InputSelector::Area* notifier) : @@ -155,7 +155,7 @@ class TimeSeriesLoad final : public ATimeSeries class TimeSeriesSolar final : public ATimeSeries { public: - using AncestorType = Renderer::Matrix; + using AncestorType = Renderer::Matrix; public: TimeSeriesSolar(wxWindow* control, Toolbox::InputSelector::Area* notifier) : @@ -193,7 +193,7 @@ class TimeSeriesSolar final : public ATimeSeries class TimeSeriesWind final : public ATimeSeries { public: - using AncestorType = Renderer::Matrix; + using AncestorType = Renderer::Matrix; public: TimeSeriesWind(wxWindow* control, Toolbox::InputSelector::Area* notifier) : @@ -231,7 +231,7 @@ class TimeSeriesWind final : public ATimeSeries class TimeSeriesHydroFatal final : public ATimeSeries { public: - using AncestorType = Renderer::Matrix; + using AncestorType = Renderer::Matrix; public: TimeSeriesHydroFatal(wxWindow* control, Toolbox::InputSelector::Area* notifier) : @@ -264,7 +264,7 @@ class TimeSeriesHydroFatal final : public ATimeSeries class TimeSeriesHydroMod final : public ATimeSeries { public: - using AncestorType = Renderer::Matrix; + using AncestorType = Renderer::Matrix; public: TimeSeriesHydroMod(wxWindow* control, Toolbox::InputSelector::Area* notifier) : @@ -303,7 +303,7 @@ class TimeSeriesHydroMod final : public ATimeSeries class TimeSeriesHydroMinGen final : public ATimeSeries { public: - using AncestorType = Renderer::Matrix; + using AncestorType = Renderer::Matrix; TimeSeriesHydroMinGen(wxWindow* control, Toolbox::InputSelector::Area* notifier) : ATimeSeries(control, notifier) diff --git a/src/ui/simulator/toolbox/components/datagrid/renderer/area/xcast-translation.h b/src/ui/simulator/toolbox/components/datagrid/renderer/area/xcast-translation.h index d5a412a462..1def9fa485 100644 --- a/src/ui/simulator/toolbox/components/datagrid/renderer/area/xcast-translation.h +++ b/src/ui/simulator/toolbox/components/datagrid/renderer/area/xcast-translation.h @@ -39,11 +39,11 @@ namespace Datagrid namespace Renderer { template -class XCastTranslation final : public Renderer::Matrix, public Renderer::ARendererArea +class XCastTranslation final : public Renderer::Matrix, public Renderer::ARendererArea { public: //! Ancestor - using MatrixAncestorType = Renderer::Matrix; + using MatrixAncestorType = Renderer::Matrix; public: //! \name Constructor & Destructor diff --git a/src/ui/simulator/toolbox/components/datagrid/renderer/area/xcast-translation.hxx b/src/ui/simulator/toolbox/components/datagrid/renderer/area/xcast-translation.hxx index 928557400b..c9f9210a27 100644 --- a/src/ui/simulator/toolbox/components/datagrid/renderer/area/xcast-translation.hxx +++ b/src/ui/simulator/toolbox/components/datagrid/renderer/area/xcast-translation.hxx @@ -121,14 +121,14 @@ wxColour XCastTranslation::horizontalBorderColor(int x, int y) const template void XCastTranslation::onStudyClosed() { - Renderer::Matrix::onStudyClosed(); + Renderer::Matrix::onStudyClosed(); Renderer::ARendererArea::onStudyClosed(); } template void XCastTranslation::onStudyLoaded() { - Renderer::Matrix::onStudyLoaded(); + Renderer::Matrix::onStudyLoaded(); Renderer::ARendererArea::onStudyLoaded(); } diff --git a/src/ui/simulator/toolbox/components/datagrid/renderer/logfile.h b/src/ui/simulator/toolbox/components/datagrid/renderer/logfile.h index 564562e29d..e19b5f0605 100644 --- a/src/ui/simulator/toolbox/components/datagrid/renderer/logfile.h +++ b/src/ui/simulator/toolbox/components/datagrid/renderer/logfile.h @@ -105,7 +105,7 @@ class LogEntryContainer //! The total number of lines uint lines; //! Size - Yuni::uint64 size; + uint64_t size; //! All entries LogEntry::Vector entries; //! The longest line diff --git a/src/ui/simulator/toolbox/components/htmllistbox/item/pathlistitem.cpp b/src/ui/simulator/toolbox/components/htmllistbox/item/pathlistitem.cpp index 44b452d1d3..b867ba86ac 100644 --- a/src/ui/simulator/toolbox/components/htmllistbox/item/pathlistitem.cpp +++ b/src/ui/simulator/toolbox/components/htmllistbox/item/pathlistitem.cpp @@ -48,7 +48,7 @@ bool PathListItem::HtmlContent(wxString& out, wxString name, const wxString& searchString, bool isFolder, - Yuni::uint64 size) + uint64_t size) { wxColour c(220, 220, 250); if (isFolder) diff --git a/src/ui/simulator/toolbox/components/htmllistbox/item/pathlistitem.h b/src/ui/simulator/toolbox/components/htmllistbox/item/pathlistitem.h index 89f5aab571..b50e825998 100644 --- a/src/ui/simulator/toolbox/components/htmllistbox/item/pathlistitem.h +++ b/src/ui/simulator/toolbox/components/htmllistbox/item/pathlistitem.h @@ -54,7 +54,7 @@ class PathListItem : public IItem wxString name, const wxString& searchString, bool isFolder, - Yuni::uint64 size); + uint64_t size); public: //! \name Constructor & Destructor @@ -82,7 +82,7 @@ class PathListItem : public IItem protected: //! Additional text const wxString pText; - Yuni::uint64 pSize; + uint64_t pSize; bool pIsFolder; }; // class PathListItem diff --git a/src/ui/simulator/toolbox/input/area.cpp b/src/ui/simulator/toolbox/input/area.cpp index 243175541a..ff6e3d3dd3 100644 --- a/src/ui/simulator/toolbox/input/area.cpp +++ b/src/ui/simulator/toolbox/input/area.cpp @@ -229,9 +229,9 @@ class SpotlightProviderArea final : public Component::Spotlight::IProvider { CString<32, false> text; text << area->thermal.list.size(); - const Yuni::uint8 R_COLOR = 210; - const Yuni::uint8 G_COLOR = 217; - const Yuni::uint8 B_COLOR = 216; + const uint8_t R_COLOR = 210; + const uint8_t G_COLOR = 217; + const uint8_t B_COLOR = 216; item->addRightTag(text, R_COLOR, G_COLOR, B_COLOR); if (area->thermal.hasForcedTimeseriesGeneration()) item->addRightTag(wxT("G"), R_COLOR, G_COLOR, B_COLOR); diff --git a/src/ui/simulator/toolbox/jobs/job.cpp b/src/ui/simulator/toolbox/jobs/job.cpp index 6d501d1467..7474a24209 100644 --- a/src/ui/simulator/toolbox/jobs/job.cpp +++ b/src/ui/simulator/toolbox/jobs/job.cpp @@ -155,12 +155,12 @@ class PartList final : public Yuni::Policy::ObjectLevelLockableNotRecursive= 100.) pCurrentTaskPercent = 0.; part.value = (uint)((double)part.weight * (value / 100.)); - pGlobalValue += (uint64)part.value; + pGlobalValue += (uint64_t)part.value; // return the percent return (pGlobalValue * 100.) / pMaxValue; @@ -207,7 +207,7 @@ class PartList final : public Yuni::Policy::ObjectLevelLockableNotRecursive= 1024); bool hasW = (w >= 1024); diff --git a/src/ui/simulator/toolbox/system/diskfreespace.hxx b/src/ui/simulator/toolbox/system/diskfreespace.hxx index 002c1dd361..8c68328ce3 100644 --- a/src/ui/simulator/toolbox/system/diskfreespace.hxx +++ b/src/ui/simulator/toolbox/system/diskfreespace.hxx @@ -34,7 +34,7 @@ using namespace Yuni; template -static inline StringT& BytesToStringW(StringT& out, uint64 size) +static inline StringT& BytesToStringW(StringT& out, uint64_t size) { if (0 == size) return out << L"0 byte"; @@ -54,10 +54,10 @@ static inline StringT& BytesToStringW(StringT& out, uint64 size) return out << Math::Round(s, 1) << L" GiB"; } -static inline uint64 DiskFreeSpace(const AnyString& folder) +static inline uint64_t DiskFreeSpace(const AnyString& folder) { if (folder.empty()) - return (yuint64)-1; // error + return (uint64_t)-1; // error #ifdef YUNI_OS_WINDOWS unsigned __int64 i64FreeBytesToCaller; @@ -67,7 +67,7 @@ static inline uint64 DiskFreeSpace(const AnyString& folder) { Yuni::WString wstr(folder); if (wstr.empty()) - return (yuint64)-1; // error + return (uint64_t)-1; // error if (GetDiskFreeSpaceExW(wstr.c_str(), (PULARGE_INTEGER)&i64FreeBytesToCaller, @@ -85,7 +85,7 @@ static inline uint64 DiskFreeSpace(const AnyString& folder) // retrying with the standard path Yuni::WString wstr(folder); if (wstr.empty()) - return (yuint64)-1; // error + return (uint64_t)-1; // error if (GetDiskFreeSpaceExW(wstr.c_str(), (PULARGE_INTEGER)&i64FreeBytesToCaller, @@ -105,5 +105,5 @@ static inline uint64 DiskFreeSpace(const AnyString& folder) #endif (void)folder; - return (yuint64)-1; // obviously an error + return (uint64_t)-1; // obviously an error } diff --git a/src/ui/simulator/windows/analyzer/analyzer.cpp b/src/ui/simulator/windows/analyzer/analyzer.cpp index 339e32b3c2..42bd55d71c 100644 --- a/src/ui/simulator/windows/analyzer/analyzer.cpp +++ b/src/ui/simulator/windows/analyzer/analyzer.cpp @@ -244,7 +244,7 @@ class AnalyzeRelationship final : public Yuni::Thread::IThread, bool errorFound = false; bool gotAtLeastOneReady = false; Matrix<>::BufferType buffer; - Matrix m; + Matrix m; uint size[2] = {(uint)-1, (uint)-1}; for (uint i = 0; i != pRecordCount; ++i) diff --git a/src/ui/simulator/windows/memorystatistics/memorystatistics.cpp b/src/ui/simulator/windows/memorystatistics/memorystatistics.cpp index dca00ae8b5..cf77689f15 100644 --- a/src/ui/simulator/windows/memorystatistics/memorystatistics.cpp +++ b/src/ui/simulator/windows/memorystatistics/memorystatistics.cpp @@ -114,7 +114,7 @@ class ResourcesInfoTimer final : public wxTimer MemoryStatistics& pForm; }; -static inline Yuni::uint64 NormalizeAmountOfMemory(Yuni::uint64 v) +static inline uint64_t NormalizeAmountOfMemory(uint64_t v) { v *= 10u; v /= 1024u * 1024u; @@ -297,7 +297,7 @@ void MemoryStatistics::refreshInformation() // Memory available on the system { - const uint64 memFree = System::Memory::Available() / (1024 * 1024); + const uint64_t memFree = System::Memory::Available() / (1024 * 1024); s.clear(); s << memFree << wxT(" Mo"); pData->stTxtTotal->SetLabel(s); @@ -316,8 +316,8 @@ void MemoryStatistics::refreshInformation() driveletter += study->folder[0]; s << wxStringFromUTF8(driveletter) << wxT(": "); - uint64 diskFree = DiskFreeSpace(study->folder); - if (diskFree == (uint64)-1) + uint64_t diskFree = DiskFreeSpace(study->folder); + if (diskFree == (uint64_t)-1) s << wxT("N/A"); else s << (diskFree / (1024 * 1024)) << wxT(" Mo"); @@ -325,7 +325,7 @@ void MemoryStatistics::refreshInformation() } else { - uint64 diskFree = DiskFreeSpace("C:\\"); + uint64_t diskFree = DiskFreeSpace("C:\\"); s.clear(); s << wxT("C: ") << (diskFree / (1024 * 1024)) << wxT(" Mo"); pData->stTxtDiskFree->SetLabel(s); diff --git a/src/ui/simulator/windows/renewables/panel.cpp b/src/ui/simulator/windows/renewables/panel.cpp index 9935198d17..2103eea79b 100644 --- a/src/ui/simulator/windows/renewables/panel.cpp +++ b/src/ui/simulator/windows/renewables/panel.cpp @@ -51,7 +51,7 @@ Panel::Panel(Component::Notebook* parent) : pNotebookCluster(nullptr), pAreaForCommonData(nullptr), pAreaSelector(nullptr), - pStudyRevisionIncrement((Yuni::uint64)-1) + pStudyRevisionIncrement((uint64_t)-1) { // A sizer for our panel wxSizer* mainsizer = new wxBoxSizer(wxVERTICAL); @@ -142,7 +142,7 @@ void Panel::onPageChanged(Component::Notebook::Page& page) { if (&page == pageRenewableClusterList) { - Yuni::uint64 revID = StudyInMemoryRevisionID(); + uint64_t revID = StudyInMemoryRevisionID(); if (revID != pStudyRevisionIncrement) { Data::Area* area = pAreaForCommonData; diff --git a/src/ui/simulator/windows/renewables/panel.h b/src/ui/simulator/windows/renewables/panel.h index debe32c93c..aec876f3db 100644 --- a/src/ui/simulator/windows/renewables/panel.h +++ b/src/ui/simulator/windows/renewables/panel.h @@ -84,7 +84,7 @@ class Panel : public Component::Panel, public Yuni::IEventObserver Data::Area* pAreaForCommonData; Toolbox::InputSelector::Area* pAreaSelector; //! An internal increment, an ugly hack to avoid unnecessary refreshes - Yuni::uint64 pStudyRevisionIncrement; + uint64_t pStudyRevisionIncrement; /*! ** \brief The splitter window ** diff --git a/src/ui/simulator/windows/studylogs.cpp b/src/ui/simulator/windows/studylogs.cpp index 238a710172..732954e272 100644 --- a/src/ui/simulator/windows/studylogs.cpp +++ b/src/ui/simulator/windows/studylogs.cpp @@ -102,7 +102,7 @@ class LogFile final : public Antares::Component::Spotlight::IItem inline void FindAllLogFiles(MapFileList& filelist, wxRegEx& regex, const AnyString& folder) { filelist.clear(); - uint64 totalSize = 0u; + uint64_t totalSize = 0u; if (not folder.empty()) { @@ -383,7 +383,7 @@ class JobLoadLogFile final : public Yuni::Job::IJob logs.error() << "File not found: " << pFilename; return; } - const uint64 filesize = IO::File::Size(pFilename); + const uint64_t filesize = IO::File::Size(pFilename); bool shouldReopenLogFile = false; // Closing the current log file, to be able to open it diff --git a/src/ui/simulator/windows/thermal/panel.cpp b/src/ui/simulator/windows/thermal/panel.cpp index 6be2802953..9b5eedaeaf 100644 --- a/src/ui/simulator/windows/thermal/panel.cpp +++ b/src/ui/simulator/windows/thermal/panel.cpp @@ -55,7 +55,7 @@ Panel::Panel(Component::Notebook* parent) : pNotebookThermalCluster(nullptr), pAreaForThermalCommonData(nullptr), pAreaSelector(nullptr), - pStudyRevisionIncrement((Yuni::uint64)-1) + pStudyRevisionIncrement((uint64_t)-1) { // A sizer for our panel wxSizer* mainsizer = new wxBoxSizer(wxVERTICAL); @@ -162,7 +162,7 @@ void Panel::onPageChanged(Component::Notebook::Page& page) { if (&page == pageThermalClusterList) { - Yuni::uint64 revID = StudyInMemoryRevisionID(); + uint64_t revID = StudyInMemoryRevisionID(); if (revID != pStudyRevisionIncrement) { Data::Area* area = pAreaForThermalCommonData; diff --git a/src/ui/simulator/windows/thermal/panel.h b/src/ui/simulator/windows/thermal/panel.h index 3cb1e34381..432dbdd40b 100644 --- a/src/ui/simulator/windows/thermal/panel.h +++ b/src/ui/simulator/windows/thermal/panel.h @@ -87,7 +87,7 @@ class Panel : public Component::Panel, public Yuni::IEventObserver Data::Area* pAreaForThermalCommonData; Toolbox::InputSelector::Area* pAreaSelector; //! An internal increment, an ugly hack to avoid unnecessary refreshes - Yuni::uint64 pStudyRevisionIncrement; + uint64_t pStudyRevisionIncrement; /*! ** \brief The splitter window **