From 15abb2aa2ba7de06a86e05511f81633616e17d87 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 18 Jun 2020 22:09:22 +0000 Subject: Revert the `enum struct` change Not a regular git revert as there have been many merges and things. --- src/libutil/hash.hh | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'src/libutil/hash.hh') diff --git a/src/libutil/hash.hh b/src/libutil/hash.hh index 8f9364440..0d9916508 100644 --- a/src/libutil/hash.hh +++ b/src/libutil/hash.hh @@ -10,12 +10,7 @@ namespace nix { MakeError(BadHash, Error); -enum struct HashType : char { - MD5, - SHA1, - SHA256, - SHA512, -}; +enum HashType : char { htMD5, htSHA1, htSHA256, htSHA512 }; const int md5HashSize = 16; @@ -25,12 +20,7 @@ const int sha512HashSize = 64; extern const string base32Chars; -enum struct Base { - Base64, - Base32, - Base16, - SRI, -}; +enum Base : int { Base64, Base32, Base16, SRI }; struct Hash @@ -97,14 +87,14 @@ struct Hash std::string gitRev() const { - assert(type == HashType::SHA1); - return to_string(Base::Base16, false); + assert(type == htSHA1); + return to_string(Base16, false); } std::string gitShortRev() const { - assert(type == HashType::SHA1); - return std::string(to_string(Base::Base16, false), 0, 7); + assert(type == htSHA1); + return std::string(to_string(Base16, false), 0, 7); } }; -- cgit v1.2.3