Mercurial > hg > svcore
comparison base/Event.h @ 1803:6eb3a76c74f7
Make static to avoid multiple definitions
author | Chris Cannam |
---|---|
date | Thu, 10 Oct 2019 10:03:31 +0100 |
parents | c48548a85622 |
children | c546429d4c2f |
comparison
equal
deleted
inserted
replaced
1802:c48548a85622 | 1803:6eb3a76c74f7 |
---|---|
25 #include <stdexcept> | 25 #include <stdexcept> |
26 | 26 |
27 #include <QString> | 27 #include <QString> |
28 | 28 |
29 #if (QT_VERSION < QT_VERSION_CHECK(5, 3, 0)) | 29 #if (QT_VERSION < QT_VERSION_CHECK(5, 3, 0)) |
30 uint qHash(float key, uint seed = 0) { | 30 #ifdef __GNUC__ |
31 #pragma GCC diagnostic ignored "-Wunused-function" | |
32 #endif | |
33 static uint qHash(float key, uint seed = 0) { | |
31 uint h = seed; | 34 uint h = seed; |
32 const uchar *p = reinterpret_cast<const uchar *>(&key); | 35 const uchar *p = reinterpret_cast<const uchar *>(&key); |
33 for (size_t i = 0; i < sizeof(key); ++i) { | 36 for (size_t i = 0; i < sizeof(key); ++i) { |
34 h = 31 * h + p[i]; | 37 h = 31 * h + p[i]; |
35 } | 38 } |