From 3263a960c279843c210b9439bce6f7f12dc92172 Mon Sep 17 00:00:00 2001 From: fumiama Date: Wed, 19 May 2021 13:14:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3include?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protobuf.c | 6 +++--- simple_protobuf.h | 1 + test.c | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/protobuf.c b/protobuf.c index 061c6d3..f95122e 100644 --- a/protobuf.c +++ b/protobuf.c @@ -1,7 +1,7 @@ -#include -#include -#include #include +#include +#include +#include #include "simple_protobuf.h" static uint32_t read_num(FILE* fp) { diff --git a/simple_protobuf.h b/simple_protobuf.h index f730b4c..4c0adc1 100644 --- a/simple_protobuf.h +++ b/simple_protobuf.h @@ -1,6 +1,7 @@ #ifndef _SIMPLE_PROTOBUF_H_ #define _SIMPLE_PROTOBUF_H_ +#include #include struct SIMPLE_PB { diff --git a/test.c b/test.c index 13eeeb0..1d5c432 100644 --- a/test.c +++ b/test.c @@ -33,7 +33,7 @@ int main() { if(fp) { SIMPLE_PB* spb = get_pb(fp); memcpy(&t, spb->target, sizeof(struct TEST)); - printf("a:%u\nb:%u\nc:%u\nd:%llu\ne:%s\n", t.a, t.b, t.c, t.d, t.e); + printf("a:%u\nb:%u\nc:%u\nd:%lu\ne:%s\n", t.a, t.b, t.c, t.d, t.e); printf("Struct size: %u, read: %u\n", spb->struct_len, spb->real_len); } else perror("[SPB]"); } else perror("[SPB]");