TP 9 exo2: correct some types mismatching.
authorJerome Benoit <jerome.benoit@sap.com>
Fri, 3 Mar 2017 22:58:02 +0000 (23:58 +0100)
committerJerome Benoit <jerome.benoit@sap.com>
Fri, 3 Mar 2017 22:58:02 +0000 (23:58 +0100)
Signed-off-by: Jerome Benoit <jerome.benoit@sap.com>
TP_9/exo2/clist.c
TP_9/exo2/exo2.c

index 4812ab8d724d9d99c6760c86cf786fd9c8b5bb91..1ca2fc55fd945a57371ee0e34d77736fbd077822 100644 (file)
@@ -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) {
index 09855d53fe2250013dbff166af5b9b2399e61bfc..b06d7a4d7bc31a17f32e337c7707bf17d61d40af 100644 (file)
@@ -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);