From 74e95bc3261011ec65bd635ee6545733e85270ba Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Tue, 10 Jan 2023 17:39:49 +0100 Subject: Changed value type name of csort algo. --- misc/examples/sort.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'misc/examples') diff --git a/misc/examples/sort.c b/misc/examples/sort.c index 711ba7a6..af74ff51 100644 --- a/misc/examples/sort.c +++ b/misc/examples/sort.c @@ -3,24 +3,25 @@ #include #include -typedef long long Elem; -#define fmt_Elem "%lld" #ifdef __cplusplus #include + typedef long long csort_elm_value; #else - #define i_val Elem + #define i_tag elm + #define i_val long long #include #endif +#define fmt_Elem "%lld" -int testsort(Elem *a, size_t size, const char *desc) { +int testsort(csort_elm_value *a, size_t size, const char *desc) { clock_t t = clock(); #ifdef __cplusplus printf("std::sort: "); std::sort(a, a + size); #else printf("csort: "); - csort_Elem(a, size); + csort_elm(a, size); #endif t = clock() - t; @@ -31,7 +32,7 @@ int testsort(Elem *a, size_t size, const char *desc) { int main(int argc, char *argv[]) { size_t i, size = argc > 1 ? strtoull(argv[1], NULL, 0) : 10000000; - Elem *a = (Elem*)malloc(sizeof(*a) * size); + csort_elm_value *a = (csort_elm_value*)malloc(sizeof(*a) * size); if (a == NULL) return -1; for (i = 0; i < size; i++) -- cgit v1.2.3