From e23ac9b6c0ad5d18097fc5f64e48cf55dfddef1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Fri, 6 May 2022 12:30:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=A3=B0=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protobuf.c | 2 +- simple_protobuf.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/protobuf.c b/protobuf.c index d6f70b1..c73c697 100644 --- a/protobuf.c +++ b/protobuf.c @@ -86,7 +86,7 @@ SIMPLE_PB* read_pb_into(FILE* fp, SIMPLE_PB* spb) { return spb; } -int set_pb(FILE* fp, uint32_t* items_len, uint32_t struct_len, void* target) { +int set_pb(FILE* fp, const uint32_t* items_len, uint32_t struct_len, const void* target) { uint32_t offset = 0; uint32_t i = 0; char* p = (char*)target; diff --git a/simple_protobuf.h b/simple_protobuf.h index 8fa23c7..de3bb02 100644 --- a/simple_protobuf.h +++ b/simple_protobuf.h @@ -16,7 +16,7 @@ uint32_t get_pb_len(FILE* fp); SIMPLE_PB* read_pb_into(FILE* fp, SIMPLE_PB* spb); -int set_pb(FILE* fp, uint32_t* items_len, uint32_t struct_len, void* target); +int set_pb(FILE* fp, const uint32_t* items_len, uint32_t struct_len, const void* target); // items_len = align_struct(uint32_t struct_size, uint32_t items_cnt, void* item_addr1, void* item_addr2...) uint32_t* align_struct(uint32_t struct_size, uint32_t items_cnt, ...);