Skip to content

Commit

Permalink
Fix clang warning about unused functions
Browse files Browse the repository at this point in the history
wsd/ClientRequestDispatcher.cpp:1106:1: error: unused function 'toStringShort' [-Werror,-Wunused-function]
STATE_ENUM(CheckStatus,
^
./common/StateEnum.hpp:63:31: note: expanded from macro 'STATE_ENUM'
    static inline std::string toStringShort(NAME e)                                                \
                              ^
wsd/ClientRequestDispatcher.cpp:1106:1: error: unused function 'toString' [-Werror,-Wunused-function]
./common/StateEnum.hpp:76:31: note: expanded from macro 'STATE_ENUM'
    static inline std::string toString(NAME e)                                                     \
                              ^
wsd/ClientRequestDispatcher.cpp:1106:1: error: unused variable 'CheckStatusMax' [-Werror,-Wunused-const-variable]
./common/StateEnum.hpp:80:25: note: expanded from macro 'STATE_ENUM'
    static const size_t NAME##Max = COUNT_ARGS(__VA_ARGS__);                                       \
                        ^
<scratch space>:107:1: note: expanded from here
CheckStatusMax
^
3 errors generated.

introduced by commit e116ee8
Add an endpoint to check connectivity to WOPI server

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I9bfc67dee4c68563c8c750172ee7caef36fedfa1
  • Loading branch information
eszkadev authored and caolanm committed Dec 21, 2024
1 parent 6e2e2ae commit 9b11d47
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions common/StateEnum.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
return NAME##_names[static_cast<int>(e)]; \
} \
/* Returns the state name only, without the namespace, as a std::string. */ \
static inline std::string toStringShort(NAME e) \
[[maybe_unused]] static inline std::string toStringShort(NAME e) \
{ \
return nameShort(e); \
} \
Expand All @@ -73,11 +73,11 @@
return NAME##_names[static_cast<int>(e)]; \
} \
/* Returns the state name, with the namespace, as a std::string. */ \
static inline std::string toString(NAME e) \
[[maybe_unused]] static inline std::string toString(NAME e) \
{ \
return name(e); \
} \
static const size_t NAME##Max = COUNT_ARGS(__VA_ARGS__); \
[[maybe_unused]] static const size_t NAME##Max = COUNT_ARGS(__VA_ARGS__); \
enum class NAME : char \
{ \
__VA_ARGS__ \
Expand Down

0 comments on commit 9b11d47

Please sign in to comment.