diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-12-30 10:06:04 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-12-30 10:06:04 +0100 |
| commit | 7c899dbb66486630804a8f048a8aa4f2385389f3 (patch) | |
| tree | 9cf8d1239938348ffdc2aff9e8ffd14596075265 | |
| parent | 8c976ce60d3232471efd079adab9ec52c08ea275 (diff) | |
feat: preping release of OCL.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
| -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 |
