From: Jerome Benoit Date: Fri, 3 Mar 2017 22:58:02 +0000 (+0100) Subject: TP 9 exo2: correct some types mismatching. X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=65544a820bed85dd28908966d9b25bb3a934f114;p=TD_C.git TP 9 exo2: correct some types mismatching. Signed-off-by: Jerome Benoit --- diff --git a/TP_9/exo2/clist.c b/TP_9/exo2/clist.c index 4812ab8..1ca2fc5 100644 --- a/TP_9/exo2/clist.c +++ b/TP_9/exo2/clist.c @@ -119,7 +119,7 @@ link_t* list_sort(link_t* head) { } unsigned list_count(link_t* head) { - int count = 0; + unsigned count = 0; while (head != NULL) { ++count; @@ -163,7 +163,7 @@ void list_clear(link_t* head) { } void list_display_values(link_t* head) { - int i = 0; + unsigned i = 0; printf("------Begin------\n"); while (head != NULL) { diff --git a/TP_9/exo2/exo2.c b/TP_9/exo2/exo2.c index 09855d5..b06d7a4 100644 --- a/TP_9/exo2/exo2.c +++ b/TP_9/exo2/exo2.c @@ -35,6 +35,8 @@ int main() { list_display_values(head2); head = list_concat(head1, head2); list_display_values(head); + head = list_sort(head); + list_display_values(head); //list_clear(head1); //list_clear(head2); list_clear(head);