From 0898723a7387f8e5d3086dd9511d88561ccc2593 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=20=EA=A6=AB=EA=A6=B6=20=EA=A6=8F=EA=A7=80?= =?UTF-8?q?=EA=A6=A6=EA=A6=BF=20=EA=A6=A7=20=EA=A6=AE=20=EA=A6=91=20?= =?UTF-8?q?=EA=A6=A9=20=EA=A6=AD=EA=A7=80?= Date: Fri, 20 Sep 2019 10:25:17 +0800 Subject: Change ticket list length type to size_t and might as well isolate recursive header inclusions --- client.c | 1 + main.c | 5 ++++- rtclient/client.h | 3 --- rtclient/ticket.h | 2 +- rtclient/user.h | 2 -- user.c | 1 + 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/client.c b/client.c index 2972167..f6fdc4a 100644 --- a/client.c +++ b/client.c @@ -1,4 +1,5 @@ #include +#include #include "request.h" #include "rtclient/client.h" diff --git a/main.c b/main.c index adf3dfb..03dc2e3 100644 --- a/main.c +++ b/main.c @@ -1,7 +1,10 @@ #include #include #include +#include #include +#include +#include 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 - enum rtclient_lang { RTCLIENT_LANG_NONE = 0 , RTCLIENT_LANG_ar diff --git a/user.c b/user.c index 9bfdf96..3e1db94 100644 --- a/user.c +++ b/user.c @@ -1,4 +1,5 @@ #include +#include #include "post.h" #include "rtclient/user.h" -- cgit v1.2.3