diff options
author | Mitya Selivanov <automainint@guattari.tech> | 2024-11-17 05:24:04 +0100 |
---|---|---|
committer | Mitya Selivanov <automainint@guattari.tech> | 2024-11-17 05:24:04 +0100 |
commit | d5a727a062e4d727491f4e7f047269d60a93a8cf (patch) | |
tree | 565aec155ab056f1bef8ddc7dc78d52e65aa76b7 /kit/array_ref.c | |
parent | 4ba961dcbf60f7c12f53f46baa261757e15d5931 (diff) | |
download | saw-d5a727a062e4d727491f4e7f047269d60a93a8cf.zip |
Remove lots of dependencies
Diffstat (limited to 'kit/array_ref.c')
-rw-r--r-- | kit/array_ref.c | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/kit/array_ref.c b/kit/array_ref.c deleted file mode 100644 index a9df2c4..0000000 --- a/kit/array_ref.c +++ /dev/null @@ -1,41 +0,0 @@ -#include "array_ref.h" - -#include <string.h> - -i8 kit_ar_equal_bytes(i64 left_element_size, i64 left_size, - void *left_data, i64 right_element_size, - i64 right_size, void *right_data) { - i64 i; - if (left_element_size != right_element_size) - return 0; - if (left_size != right_size) - return 0; - for (i = 0; i < left_size; i++) - if (memcmp((u8 *) left_data + i * left_element_size, - (u8 *) right_data + i * left_element_size, - left_element_size) != 0) - return 0; - return 1; -} - -i8 kit_ar_compare(i64 left_element_size, i64 left_size, - void *left_data, i64 right_element_size, - i64 right_size, void *right_data, - kit_ar_compare_fn compare) { - i64 i; - if (left_element_size < right_element_size) - return -1; - if (left_element_size > right_element_size) - return 1; - for (i = 0; i < left_size && i < right_size; i++) { - i8 c = compare((u8 *) left_data + i * left_element_size, - (u8 *) right_data + i * left_element_size); - if (c != 0) - return c; - } - if (left_size < right_size) - return -1; - if (left_size > right_size) - return 1; - return 0; -} |