From a0a277b80d87c4e87fd6f51efc1c9083fd52a0d7 Mon Sep 17 00:00:00 2001 From: cscherr Date: Fri, 18 Jul 2025 09:16:08 +0200 Subject: [PATCH] refactor(algc): use uint8_t* for data pointers --- crates/algorithms/algorithms-c/src/crc/crc32.c | 4 ++-- crates/algorithms/algorithms-c/src/crc/crc32.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/algorithms/algorithms-c/src/crc/crc32.c b/crates/algorithms/algorithms-c/src/crc/crc32.c index 9deb710..cfcd686 100755 --- a/crates/algorithms/algorithms-c/src/crc/crc32.c +++ b/crates/algorithms/algorithms-c/src/crc/crc32.c @@ -52,7 +52,7 @@ Crc32 crc32_new() { crc32.buf = 0; return crc32; } -void crc32_process(const char *data, size_t len, Crc32 *crc32) { +void crc32_process(const uint8_t *data, size_t len, Crc32 *crc32) { #define chksum crc32->buf chksum = CRC32_INIT; for (uint32_t i = 0; i < len; i++) { @@ -63,7 +63,7 @@ void crc32_process(const char *data, size_t len, Crc32 *crc32) { return; } -ChecksumCrc32 crc32_checksum(const void *data, uint32_t len) { +ChecksumCrc32 crc32_checksum(const uint8_t *data, uint32_t len) { Crc32 crc32 = crc32_new(); crc32_process(data, len, &crc32); return crc32.buf; diff --git a/crates/algorithms/algorithms-c/src/crc/crc32.h b/crates/algorithms/algorithms-c/src/crc/crc32.h index e3dc719..ecc60ae 100755 --- a/crates/algorithms/algorithms-c/src/crc/crc32.h +++ b/crates/algorithms/algorithms-c/src/crc/crc32.h @@ -16,8 +16,8 @@ typedef struct Crc32 { } Crc32; Crc32 crc32_new(); -void crc32_process(const char *data, size_t len, Crc32 *crc32); +void crc32_process(const uint8_t *data, size_t len, Crc32 *crc32); -ChecksumCrc32 crc32_checksum(const void *data, uint32_t len); +ChecksumCrc32 crc32_checksum(const uint8_t *data, uint32_t len); #endif // CRC32_H