mirror of
https://github.com/fumiama/simple-protobuf.git
synced 2026-06-12 04:43:22 +08:00
优化代码结构
This commit is contained in:
2
test.c
2
test.c
@@ -33,7 +33,7 @@ int main() {
|
|||||||
if(fp) {
|
if(fp) {
|
||||||
SIMPLE_PB* spb = get_pb(fp);
|
SIMPLE_PB* spb = get_pb(fp);
|
||||||
memcpy(&t, spb->target, sizeof(struct TEST));
|
memcpy(&t, spb->target, sizeof(struct TEST));
|
||||||
printf("a:%u\nb:%u\nc:%u\nd:%lu\ne:%s\n", t.a, t.b, t.c, t.d, t.e);
|
printf("a:%u\nb:%u\nc:%u\nd:%llu\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);
|
printf("Struct size: %u, read: %u\n", spb->struct_len, spb->real_len);
|
||||||
} else perror("[SPB]");
|
} else perror("[SPB]");
|
||||||
} else perror("[SPB]");
|
} else perror("[SPB]");
|
||||||
|
|||||||
Reference in New Issue
Block a user