diff options
author | Tor Egge <Tor.Egge@broadpark.no> | 2020-04-16 09:34:05 +0200 |
---|---|---|
committer | Tor Egge <Tor.Egge@broadpark.no> | 2020-04-16 09:34:05 +0200 |
commit | f2b5605c0e2701e90e1139c3e6b947754f0149a0 (patch) | |
tree | 88d3acc3f4fa8d35156627eaf1060c8751032301 /vespalog/src | |
parent | bdb570a9e21410108bbb56f183bad1603c45c1fc (diff) |
Use functor with overloaded methods instead of overloaded functions to
avoid warning about unused function.
Diffstat (limited to 'vespalog/src')
-rw-r--r-- | vespalog/src/vespa/log/log.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/vespalog/src/vespa/log/log.cpp b/vespalog/src/vespa/log/log.cpp index 2e19dda504c..47f7377ac4d 100644 --- a/vespalog/src/vespa/log/log.cpp +++ b/vespalog/src/vespa/log/log.cpp @@ -39,12 +39,20 @@ char Logger::_hostname[1024] = { '\0'}; char Logger::_serviceName[1024] = {'\0' }; ControlFile *Logger::_controlFile = 0; -static inline unsigned long gettid(const void *tid) { - return reinterpret_cast<uint64_t>(tid) >> 3; -} +namespace { + +class GetTid { +public: + unsigned long operator()(const void *tid) const { + return reinterpret_cast<uint64_t>(tid) >> 3; + } + unsigned long operator()(unsigned long tid) const { + return tid; + } +}; + +GetTid gettid; -static inline unsigned long gettid(unsigned long tid) { - return tid; } void |