mirror of
https://github.com/protobuf-c/protobuf-c.git
synced 2024-12-28 14:48:18 +08:00
protobuf-c: remove UNALIGNED_ALLOC, DO_UNALIGNED_ALLOC macros
This commit is contained in:
parent
b8c5e06de3
commit
871d678738
@ -97,9 +97,6 @@ do { \
|
|||||||
((allocator)->free((allocator)->allocator_data, (ptr)));\
|
((allocator)->free((allocator)->allocator_data, (ptr)));\
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define UNALIGNED_ALLOC(allocator, size) ALLOC(allocator, size)
|
|
||||||
#define DO_UNALIGNED_ALLOC DO_ALLOC
|
|
||||||
|
|
||||||
#define STRUCT_MEMBER_P(struct_p, struct_offset) \
|
#define STRUCT_MEMBER_P(struct_p, struct_offset) \
|
||||||
((void *) ((uint8_t *) (struct_p) + (struct_offset)))
|
((void *) ((uint8_t *) (struct_p) + (struct_offset)))
|
||||||
|
|
||||||
@ -2207,8 +2204,7 @@ parse_member(ScannedMember *scanned_member,
|
|||||||
ufield->tag = scanned_member->tag;
|
ufield->tag = scanned_member->tag;
|
||||||
ufield->wire_type = scanned_member->wire_type;
|
ufield->wire_type = scanned_member->wire_type;
|
||||||
ufield->len = scanned_member->len;
|
ufield->len = scanned_member->len;
|
||||||
DO_UNALIGNED_ALLOC(ufield->data, allocator,
|
DO_ALLOC(ufield->data, allocator, scanned_member->len, return 0);
|
||||||
scanned_member->len, return 0);
|
|
||||||
memcpy(ufield->data, scanned_member->data, ufield->len);
|
memcpy(ufield->data, scanned_member->data, ufield->len);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user