summaryrefslogtreecommitdiffhomepage
path: root/include/stc/algo/sort.h
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-06-06 11:42:18 +0200
committerTyge Løvset <[email protected]>2023-06-06 11:42:18 +0200
commit8e6e1d2b266e46e3920edf7cc6eaad33c1312880 (patch)
tree0dae1efe2342f8ad9d8bf1a968050d24068dfd44 /include/stc/algo/sort.h
parentf2d90c87590133547e474da4ea9d5dd1b834043e (diff)
downloadSTC-modified-8e6e1d2b266e46e3920edf7cc6eaad33c1312880.tar.gz
STC-modified-8e6e1d2b266e46e3920edf7cc6eaad33c1312880.zip
Warning fixes and docs update.
Diffstat (limited to 'include/stc/algo/sort.h')
-rw-r--r--include/stc/algo/sort.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/stc/algo/sort.h b/include/stc/algo/sort.h
index 20b7e1b3..bbd58427 100644
--- a/include/stc/algo/sort.h
+++ b/include/stc/algo/sort.h
@@ -24,7 +24,7 @@
template params:
#define i_val - value type [required]
#define i_less - less function. default: *x < *y
-#define i_tag name - define namearray_qsort(). i_tag defaults {i_val}
+#define i_type name - define {{name}}_sort_n(), else {{i_val}}array_sort_n().
// test:
#include <stdio.h>
@@ -32,12 +32,12 @@ template params:
#include <stc/algo/sort.h>
int main() {
- int arr[] = {23, 321, 5434, 25, 245, 1, 654, 33, 543, 21};
+ int nums[] = {23, 321, 5434, 25, 245, 1, 654, 33, 543, 21};
- intarray_qsort(arr, c_arraylen(arr));
+ intarray_sort_n(nums, c_arraylen(arr));
- for (int i = 0; i < c_arraylen(arr); i++)
- printf(" %d", arr[i]);
+ for (int i = 0; i < c_arraylen(nums); i++)
+ printf(" %d", nums[i]);
puts("");
}
*/