1
0
mirror of https://github.com/fumiama/simple-protobuf.git synced 2026-06-05 00:10:24 +08:00

优化声明

This commit is contained in:
源文雨
2022-05-06 12:30:01 +08:00
parent aa17725d9f
commit e23ac9b6c0
2 changed files with 2 additions and 2 deletions

View File

@@ -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;

View File

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