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, ...);