diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-06-11 14:48:33 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-06-11 14:53:07 +0300 |
commit | 7de4458d33ecc6e275ad0f0442e123f358b3e1dd (patch) | |
tree | 323a026366cc0c0f94608d00ec135b714db1363f /storage/innobase/include/ut0new.h | |
parent | d6af055c556a8b2f068c84e73d11fe461b3ad3f3 (diff) | |
download | mariadb-git-7de4458d33ecc6e275ad0f0442e123f358b3e1dd.tar.gz |
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).
Diffstat (limited to 'storage/innobase/include/ut0new.h')
-rw-r--r-- | storage/innobase/include/ut0new.h | 4 |
1 files changed, 2 insertions, 2 deletions
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<uint32_t>(uint64_t{33} * h + *s)); } /* Force constexpr to be evaluated at compile time.*/ |