diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-02 10:47:47 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-03 11:58:08 +0200 |
commit | c82f73666d87549e5884ddcd253ec3561d840b9b (patch) | |
tree | 96eff624e0add180490d014abce92fccf9542f5b /src/corelib/io/qfilesystemengine_unix.cpp | |
parent | 889d40ebe2d9d0e92caea2749608720f7c088173 (diff) |
Replace Q_DECL_UNUSED with [[maybe_unused]]
Use C++17 attribute directly
Change-Id: Id853e7a5117065e4adb549f81303c1820fe198ce
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qfilesystemengine_unix.cpp')
-rw-r--r-- | src/corelib/io/qfilesystemengine_unix.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp index 1aa5179ee3..167b21f8b1 100644 --- a/src/corelib/io/qfilesystemengine_unix.cpp +++ b/src/corelib/io/qfilesystemengine_unix.cpp @@ -233,51 +233,51 @@ qint64 timespecToMSecs(const timespec &spec) } // fallback set -Q_DECL_UNUSED qint64 atime(const QT_STATBUF &statBuffer, ulong) { return qint64(statBuffer.st_atime) * 1000; } -Q_DECL_UNUSED qint64 birthtime(const QT_STATBUF &, ulong) { return Q_INT64_C(0); } -Q_DECL_UNUSED qint64 ctime(const QT_STATBUF &statBuffer, ulong) { return qint64(statBuffer.st_ctime) * 1000; } -Q_DECL_UNUSED qint64 mtime(const QT_STATBUF &statBuffer, ulong) { return qint64(statBuffer.st_mtime) * 1000; } +[[maybe_unused]] qint64 atime(const QT_STATBUF &statBuffer, ulong) { return qint64(statBuffer.st_atime) * 1000; } +[[maybe_unused]] qint64 birthtime(const QT_STATBUF &, ulong) { return Q_INT64_C(0); } +[[maybe_unused]] qint64 ctime(const QT_STATBUF &statBuffer, ulong) { return qint64(statBuffer.st_ctime) * 1000; } +[[maybe_unused]] qint64 mtime(const QT_STATBUF &statBuffer, ulong) { return qint64(statBuffer.st_mtime) * 1000; } // Xtim, POSIX.1-2008 template <typename T> -Q_DECL_UNUSED static typename std::enable_if<(&T::st_atim, true), qint64>::type +[[maybe_unused]] static typename std::enable_if<(&T::st_atim, true), qint64>::type atime(const T &statBuffer, int) { return timespecToMSecs(statBuffer.st_atim); } template <typename T> -Q_DECL_UNUSED static typename std::enable_if<(&T::st_birthtim, true), qint64>::type +[[maybe_unused]] static typename std::enable_if<(&T::st_birthtim, true), qint64>::type birthtime(const T &statBuffer, int) { return timespecToMSecs(statBuffer.st_birthtim); } template <typename T> -Q_DECL_UNUSED static typename std::enable_if<(&T::st_ctim, true), qint64>::type +[[maybe_unused]] static typename std::enable_if<(&T::st_ctim, true), qint64>::type ctime(const T &statBuffer, int) { return timespecToMSecs(statBuffer.st_ctim); } template <typename T> -Q_DECL_UNUSED static typename std::enable_if<(&T::st_mtim, true), qint64>::type +[[maybe_unused]] static typename std::enable_if<(&T::st_mtim, true), qint64>::type mtime(const T &statBuffer, int) { return timespecToMSecs(statBuffer.st_mtim); } #ifndef st_mtimespec // Xtimespec template <typename T> -Q_DECL_UNUSED static typename std::enable_if<(&T::st_atimespec, true), qint64>::type +[[maybe_unused]] static typename std::enable_if<(&T::st_atimespec, true), qint64>::type atime(const T &statBuffer, int) { return timespecToMSecs(statBuffer.st_atimespec); } template <typename T> -Q_DECL_UNUSED static typename std::enable_if<(&T::st_birthtimespec, true), qint64>::type +[[maybe_unused]] static typename std::enable_if<(&T::st_birthtimespec, true), qint64>::type birthtime(const T &statBuffer, int) { return timespecToMSecs(statBuffer.st_birthtimespec); } template <typename T> -Q_DECL_UNUSED static typename std::enable_if<(&T::st_ctimespec, true), qint64>::type +[[maybe_unused]] static typename std::enable_if<(&T::st_ctimespec, true), qint64>::type ctime(const T &statBuffer, int) { return timespecToMSecs(statBuffer.st_ctimespec); } template <typename T> -Q_DECL_UNUSED static typename std::enable_if<(&T::st_mtimespec, true), qint64>::type +[[maybe_unused]] static typename std::enable_if<(&T::st_mtimespec, true), qint64>::type mtime(const T &statBuffer, int) { return timespecToMSecs(statBuffer.st_mtimespec); } #endif @@ -285,22 +285,22 @@ mtime(const T &statBuffer, int) #if !defined(st_mtimensec) && !defined(__alpha__) // Xtimensec template <typename T> -Q_DECL_UNUSED static typename std::enable_if<(&T::st_atimensec, true), qint64>::type +[[maybe_unused]] static typename std::enable_if<(&T::st_atimensec, true), qint64>::type atime(const T &statBuffer, int) { return statBuffer.st_atime * Q_INT64_C(1000) + statBuffer.st_atimensec / 1000000; } template <typename T> -Q_DECL_UNUSED static typename std::enable_if<(&T::st_birthtimensec, true), qint64>::type +[[maybe_unused]] static typename std::enable_if<(&T::st_birthtimensec, true), qint64>::type birthtime(const T &statBuffer, int) { return statBuffer.st_birthtime * Q_INT64_C(1000) + statBuffer.st_birthtimensec / 1000000; } template <typename T> -Q_DECL_UNUSED static typename std::enable_if<(&T::st_ctimensec, true), qint64>::type +[[maybe_unused]] static typename std::enable_if<(&T::st_ctimensec, true), qint64>::type ctime(const T &statBuffer, int) { return statBuffer.st_ctime * Q_INT64_C(1000) + statBuffer.st_ctimensec / 1000000; } template <typename T> -Q_DECL_UNUSED static typename std::enable_if<(&T::st_mtimensec, true), qint64>::type +[[maybe_unused]] static typename std::enable_if<(&T::st_mtimensec, true), qint64>::type mtime(const T &statBuffer, int) { return statBuffer.st_mtime * Q_INT64_C(1000) + statBuffer.st_mtimensec / 1000000; } #endif |