diff --git a/cmake/Downloads/CMakeLists.txt b/cmake/Downloads/CMakeLists.txt index 415c6e7a7e..333284c34e 100644 --- a/cmake/Downloads/CMakeLists.txt +++ b/cmake/Downloads/CMakeLists.txt @@ -43,7 +43,7 @@ GIT_CLONE(stdex https://github.com/irov/stdex.git) GIT_CLONE(libmovie https://github.com/irov/libmovie.git) GIT_CLONE(json https://github.com/irov/json.git) GIT_CLONE(utf8 https://github.com/nemtrif/utfcpp.git "v4.0.5") -GIT_CLONE(lz4 https://github.com/lz4/lz4.git "v1.9.4") +GIT_CLONE(lz4 https://github.com/lz4/lz4.git "v1.10.0") GIT_CLONE(poly2tri https://github.com/jhasse/poly2tri.git) GIT_CLONE(tinyini https://github.com/irov/tinyini.git) GIT_CLONE(libfe https://github.com/frankinshtein/font-effects-lib.git) diff --git a/src/Environment/Windows/Win32Helper.cpp b/src/Environment/Windows/Win32Helper.cpp index 7a88a9fb96..67a0812e61 100644 --- a/src/Environment/Windows/Win32Helper.cpp +++ b/src/Environment/Windows/Win32Helper.cpp @@ -92,7 +92,7 @@ namespace Mengine , (DWORD)_id , MAKELANGID( LANG_ENGLISH, SUBLANG_ENGLISH_US ) , (LPSTR)_message - , _capacity + , (DWORD)_capacity , NULL ) == 0 ) { DWORD lastError = ::GetLastError(); @@ -111,7 +111,7 @@ namespace Mengine , (DWORD)_id , MAKELANGID( LANG_ENGLISH, SUBLANG_ENGLISH_US ) , (LPWSTR)_message - , _capacity + , (DWORD)_capacity , NULL ) == 0 ) { DWORD lastError = ::GetLastError(); diff --git a/src/Kernel/SHA1.cpp b/src/Kernel/SHA1.cpp index d4d4e85107..787c60b3ce 100644 --- a/src/Kernel/SHA1.cpp +++ b/src/Kernel/SHA1.cpp @@ -30,12 +30,12 @@ namespace Mengine uint8_t buffer[64]; }; ////////////////////////////////////////////////////////////////////////// - static uint32_t SHA1_rotl32( uint32_t var, uint32_t hops ) + MENGINE_CONSTEXPR uint32_t SHA1_rotl32( uint32_t var, uint32_t hops ) { return (var << hops) | (var >> (32 - hops)); } ////////////////////////////////////////////////////////////////////////// - static void SHA1_Transform( uint32_t state[5], const uint8_t buffer[64] ) + MENGINE_CONSTEXPR void SHA1_Transform( uint32_t state[5], const uint8_t buffer[64] ) { typedef union { @@ -79,7 +79,7 @@ namespace Mengine state[4] += e; } ////////////////////////////////////////////////////////////////////////// - static void SHA1_Init( SHA1_CTX * context ) + MENGINE_INLINE void SHA1_Init( SHA1_CTX * context ) { context->state[0] = 0x67452301; context->state[1] = 0xEFCDAB89; @@ -90,7 +90,7 @@ namespace Mengine context->count[1] = 0; } ////////////////////////////////////////////////////////////////////////// - static void SHA1_Update( SHA1_CTX * context, const uint8_t * data, size_t len ) + MENGINE_INLINE void SHA1_Update( SHA1_CTX * context, const uint8_t * data, size_t len ) { size_t j = (context->count[0] >> 3) & 63; @@ -124,7 +124,7 @@ namespace Mengine StdString::memcpy( &context->buffer[j], &data[i], (len - i) * sizeof( uint8_t ) ); } ////////////////////////////////////////////////////////////////////////// - static void SHA1_Final( SHA1_CTX * context, uint8_t * const digest, size_t _size ) + MENGINE_INLINE void SHA1_Final( SHA1_CTX * context, uint8_t * const digest, size_t _size ) { uint8_t finalcount[8]; diff --git a/src/Platforms/Win32Platform/Win32PlatformService.cpp b/src/Platforms/Win32Platform/Win32PlatformService.cpp index d448552c05..816f846062 100644 --- a/src/Platforms/Win32Platform/Win32PlatformService.cpp +++ b/src/Platforms/Win32Platform/Win32PlatformService.cpp @@ -350,6 +350,8 @@ namespace Mengine uint32_t deviceSeed = Helper::generateRandomDeviceSeed(); + MENGINE_UNUSED( deviceSeed ); + LOGGER_INFO_PROTECTED( "platform", "device seed: %u" , deviceSeed ); diff --git a/src/Plugins/ImageCodecPlugin/ImageDecoderHTF.cpp b/src/Plugins/ImageCodecPlugin/ImageDecoderHTF.cpp index 7c5d4001fd..7f10d19454 100644 --- a/src/Plugins/ImageCodecPlugin/ImageDecoderHTF.cpp +++ b/src/Plugins/ImageCodecPlugin/ImageDecoderHTF.cpp @@ -27,7 +27,8 @@ namespace Mengine } return PF_UNKNOWN; - }; + } + /////////////////////////////////////////////////////////////////////// } ////////////////////////////////////////////////////////////////////////// ImageDecoderHTF::ImageDecoderHTF() diff --git a/src/Tools/AstralaxCompiler/AstralaxCompiler.cpp b/src/Tools/AstralaxCompiler/AstralaxCompiler.cpp index 4802700fb8..b05dd8c854 100644 --- a/src/Tools/AstralaxCompiler/AstralaxCompiler.cpp +++ b/src/Tools/AstralaxCompiler/AstralaxCompiler.cpp @@ -339,8 +339,7 @@ int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdL int lz_size = ::LZ4_compressBound( f_size ); - std::vector lz4_buffer( lz_size ); - char * lz4_memory = &lz4_buffer[0]; + char * lz4_memory = new char[lz_size]; char * dst_buffer = (char *)lz4_memory; const char * src_buffer = (const char *)mf_buffer; @@ -362,6 +361,8 @@ int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdL fwrite( dst_buffer, compressSize, 1, fz ); fclose( fz ); + delete [] lz4_memory; + _wremove( outCanonicalize ); } diff --git a/src/Tools/DazzleCompiler/DazzleCompiler.cpp b/src/Tools/DazzleCompiler/DazzleCompiler.cpp index 74a31503a8..0155f9c9cd 100644 --- a/src/Tools/DazzleCompiler/DazzleCompiler.cpp +++ b/src/Tools/DazzleCompiler/DazzleCompiler.cpp @@ -100,8 +100,7 @@ static bool writeCompress( const std::wstring & _filepath, const std::vector lz4_buffer( lz_size ); - char * lz4_memory = &lz4_buffer[0]; + char * lz4_memory = new char[lz_size]; char * dst_buffer = (char *)lz4_memory; const char * src_buffer = (const char *)&_buffer[0]; @@ -125,6 +124,8 @@ static bool writeCompress( const std::wstring & _filepath, const std::vector