Selaa lähdekoodia

[hash.h] Converting type byte to byte_t

Vinicius Teshima 2 vuotta sitten
vanhempi
sitoutus
bbc0f935f6
1 muutettua tiedostoa jossa 4 lisäystä ja 4 poistoa
  1. 4 4
      include/toolbox/hash.h

+ 4 - 4
include/toolbox/hash.h

@@ -4,14 +4,14 @@
 #include <stdint.h>
 #include <stdlib.h>
 
-typedef char byte;
+typedef char byte_t;
 
 __attribute__((access (read_only, 1), nonnull, pure))
-uint64_t hash(const byte* data, size_t size);
+uint64_t hash(const byte_t* data, size_t size);
 
 #if defined(CSTRING_IMP) || defined(IMPLEMENTATIONS)
 
-uint64_t hash(const byte* data, size_t size) {
+uint64_t hash(const byte_t* data, size_t size) {
 	static uint8_t _primes_list[] = {
 		3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59,
 		61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127,
@@ -22,7 +22,7 @@ uint64_t hash(const byte* data, size_t size) {
 	uint64_t ret = 1;
 	uint8_t p = 0;
 	size_t i = 0;
-	byte b = 0;
+	byte_t b = 0;
 
 	for ( i = 0; i < size; ++i ) {
 		b = data[i];