diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2020-06-18 22:09:22 +0000 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2020-06-18 22:11:26 +0000 |
commit | 15abb2aa2ba7de06a86e05511f81633616e17d87 (patch) | |
tree | 077cb0b6fe627e04aee10c93ed45f402996ebe70 /src/libutil/hash.hh | |
parent | bbbf3602a323538b8da38f1a2c7ce136a20f74c6 (diff) |
Revert the `enum struct` change
Not a regular git revert as there have been many merges and things.
Diffstat (limited to 'src/libutil/hash.hh')
-rw-r--r-- | src/libutil/hash.hh | 22 |
1 files changed, 6 insertions, 16 deletions
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); } }; |