From 7de4458d33ecc6e275ad0f0442e123f358b3e1dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Thu, 11 Jun 2020 14:48:33 +0300 Subject: MDEV-22865 compilation failure on win32-debug ut_filename_hash(): Add better casts to please the compiler: warning C4307: '*': integral constant overflow This regression was introduced in commit dd77f072f9338f784d052ae6f46a04c55eabe3fd (MDEV-22841). --- storage/innobase/include/ut0new.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'storage/innobase/include/ut0new.h') diff --git a/storage/innobase/include/ut0new.h b/storage/innobase/include/ut0new.h index 354e6a485f7..e878ef5ee9c 100644 --- a/storage/innobase/include/ut0new.h +++ b/storage/innobase/include/ut0new.h @@ -820,10 +820,10 @@ static constexpr const char* ut_basename(const char *filename) } /** Compute djb2 hash for a string. Stop at '.' , or '\0' */ -constexpr uint32_t ut_filename_hash(const char* s, uint32_t h = 5381) +constexpr uint32_t ut_filename_hash(const char *s, uint32_t h= 5381) { return *s == 0 || *s == '.' ? h : - ut_filename_hash(s + 1, 33 * h + (uint8_t)*s); + ut_filename_hash(s + 1, static_cast(uint64_t{33} * h + *s)); } /* Force constexpr to be evaluated at compile time.*/ -- cgit v1.2.1