From 83fef08a04c7a949b2023e0da66536caa05b0d0d Mon Sep 17 00:00:00 2001 From: Florent Rougon Date: Sun, 19 Nov 2017 08:21:03 +0100 Subject: [PATCH] Use common definition of simgear::enumValue() from This avoids code duplication. --- src/EmbeddedResources/fgrcc.cxx | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/EmbeddedResources/fgrcc.cxx b/src/EmbeddedResources/fgrcc.cxx index 2a8364d93..cfd5c0f53 100644 --- a/src/EmbeddedResources/fgrcc.cxx +++ b/src/EmbeddedResources/fgrcc.cxx @@ -40,13 +40,14 @@ #include // Z_BEST_COMPRESSION +#include +#include #include #include #include -#include +#include #include #include -#include #include "fgrcc.hxx" @@ -54,6 +55,7 @@ using std::string; using std::vector; using std::cout; using std::cerr; +using simgear::enumValue; // The name is still hard-coded essentially in the text for --help // (cf. showUsage()), because the formatting there depends on how long the @@ -63,12 +65,6 @@ static const string PROGNAME = "fgrcc"; // 'stuff' should insert UTF-8-encoded text into the stream #define LOG(stuff) do { cerr << PROGNAME << ": " << stuff << "\n"; } while(0) -// Cast an enum value to its underlying type -template -static constexpr typename std::underlying_type::type enumValue(T e) { - return static_cast::type>(e); -} - static string prettyPrintNbOfBytes(std::size_t nbBytes) { std::ostringstream oss;