repositories
/
TD_C.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
TP 13 exo1: Give more explicits name to callbacks
[TD_C.git]
/
TP_13
/
exo1
/
lib
/
sort.c
diff --git
a/TP_13/exo1/lib/sort.c
b/TP_13/exo1/lib/sort.c
index 01a742f7966d557ff7724409bbfa2f9e4fa48ce2..78625b652f804270487b101ecc07b024dbddc55e 100644
(file)
--- a/
TP_13/exo1/lib/sort.c
+++ b/
TP_13/exo1/lib/sort.c
@@
-19,10
+19,10
@@
bool ascending_and_odd(int a, int b) {
|| ((a % 2 != 0) && (b % 2 != 0) && ascending(a, b)));
}
|| ((a % 2 != 0) && (b % 2 != 0) && ascending(a, b)));
}
-static bool sort_first(int* array, unsigned length,
criteria_cb
criteria) {
+static bool sort_first(int* array, unsigned length,
s_criteria_cb sort_
criteria) {
bool rt = false;
for (unsigned i = 0; i < length-1; i++) {
bool rt = false;
for (unsigned i = 0; i < length-1; i++) {
- if (criteria(array[i], array[i+1])) {
+ if (
sort_
criteria(array[i], array[i+1])) {
swap_int(&array[i], &array[i+1]);
rt = true;
}
swap_int(&array[i], &array[i+1]);
rt = true;
}
@@
-31,9
+31,9
@@
static bool sort_first(int* array, unsigned length, criteria_cb criteria) {
}
/* the feature of this function is awaited in the array.c file */
}
/* the feature of this function is awaited in the array.c file */
-void sort_bubble_array(int* array, unsigned length,
criteria_cb
criteria) {
+void sort_bubble_array(int* array, unsigned length,
s_criteria_cb sort_
criteria) {
bool rt;
do {
bool rt;
do {
- rt = sort_first(array, length, criteria);
+ rt = sort_first(array, length,
sort_
criteria);
} while (rt);
}
} while (rt);
}