diff options
| -rw-r--r-- | example/hash_crc32_example/example.cpp | 12 | ||||
| -rw-r--r-- | include/ocl/crc_hash.hpp | 6 |
2 files changed, 11 insertions, 7 deletions
diff --git a/example/hash_crc32_example/example.cpp b/example/hash_crc32_example/example.cpp index d2f045e..95a3077 100644 --- a/example/hash_crc32_example/example.cpp +++ b/example/hash_crc32_example/example.cpp @@ -9,12 +9,16 @@ int main(int argc, char** argv) { - if (argc != 2) return 1; + if (argc != 2) + { + ocl::io::print("Hello, World!\n"_crc32); + return EXIT_SUCCESS; + } - std::hash<ocl::crc_hash_trait> hash{}; + std::hash<ocl::crc_hash_trait> hash{}; - ocl::io::enable_stdio_sync(false); + ocl::io::enable_stdio_sync(false); ocl::io::print(hash.operator()<true, false>(argv[1])); - return 0; + return EXIT_SUCCESS; } diff --git a/include/ocl/crc_hash.hpp b/include/ocl/crc_hash.hpp index 4fe1582..a3da6ba 100644 --- a/include/ocl/crc_hash.hpp +++ b/include/ocl/crc_hash.hpp @@ -92,10 +92,10 @@ namespace ocl } // namespace ocl -inline void -operator""_crc(const char* in, std::size_t len) noexcept +inline std::uint32_t +operator""_crc32(const char* in, std::size_t len) noexcept { - ocl::crc_hash_trait::crc<std::uint32_t>(reinterpret_cast<const char*>(in), strlen(in)); + return ocl::crc_hash_trait::crc<std::uint32_t>(static_cast<const char*>(in), strlen(in)); } namespace std |
