diff options
author | ꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id> | 2019-09-20 10:25:17 +0800 |
---|---|---|
committer | ꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id> | 2019-09-20 10:25:17 +0800 |
commit | 0898723a7387f8e5d3086dd9511d88561ccc2593 (patch) | |
tree | a60b88a83885a97e890ab4cbdfc53bece222068c | |
parent | c6d5739028f2337bd0418084a319705bd5b89840 (diff) |
Change ticket list length type to size_t
and might as well isolate recursive header inclusions
-rw-r--r-- | client.c | 1 | ||||
-rw-r--r-- | main.c | 5 | ||||
-rw-r--r-- | rtclient/client.h | 3 | ||||
-rw-r--r-- | rtclient/ticket.h | 2 | ||||
-rw-r--r-- | rtclient/user.h | 2 | ||||
-rw-r--r-- | user.c | 1 |
6 files changed, 7 insertions, 7 deletions
@@ -1,4 +1,5 @@ #include <stdlib.h> +#include <stdbool.h> #include "request.h" #include "rtclient/client.h" @@ -1,7 +1,10 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <stdbool.h> #include <rtclient/client.h> +#include <rtclient/user.h> +#include <rtclient/ticket.h> int main(void) { @@ -66,7 +69,7 @@ int main(void) sprintf(query, "%s%s'", prefix, name); rtclient_ticket_search(&list, query); if (list) { - for (unsigned short i = 0; i < list->length; i++) { + for (size_t i = 0; i < list->length; i++) { char *ticket = list->tickets[i]; printf("Ticket %d: %s\n", i, ticket); } diff --git a/rtclient/client.h b/rtclient/client.h index b132564..4f74536 100644 --- a/rtclient/client.h +++ b/rtclient/client.h @@ -1,9 +1,6 @@ #ifndef RTCLIENT_CLIENT_H #define RTCLIENT_CLIENT_H -#include "user.h" -#include "ticket.h" - #ifdef __cplusplus extern "C" { #endif diff --git a/rtclient/ticket.h b/rtclient/ticket.h index 74db994..87e7496 100644 --- a/rtclient/ticket.h +++ b/rtclient/ticket.h @@ -2,7 +2,7 @@ #define RTCLIENT_TICKET_H struct rtclient_ticketlist { - unsigned int length; + size_t length; char *tickets[]; }; diff --git a/rtclient/user.h b/rtclient/user.h index e9768a6..5c57cb7 100644 --- a/rtclient/user.h +++ b/rtclient/user.h @@ -1,8 +1,6 @@ #ifndef RTCLIENT_USER_H #define RTCLIENT_USER_H -#include <stdbool.h> - enum rtclient_lang { RTCLIENT_LANG_NONE = 0 , RTCLIENT_LANG_ar @@ -1,4 +1,5 @@ #include <stdlib.h> +#include <stdbool.h> #include "post.h" #include "rtclient/user.h" |