diff options
author | Paul Yang <TeBoring@users.noreply.github.com> | 2017-08-31 10:35:31 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-31 10:35:31 -0700 |
commit | b70e0fdf09506fcf53af951d64a3ae47309fa245 (patch) | |
tree | 5daf2049946d001b8868f3a8c6e94c2c9cb9acd3 /php/ext/google/protobuf/storage.c | |
parent | c7457ef65a7a8584b1e3bd396c401ccf8e275ffa (diff) | |
download | protobuf-b70e0fdf09506fcf53af951d64a3ae47309fa245.tar.gz protobuf-b70e0fdf09506fcf53af951d64a3ae47309fa245.tar.bz2 protobuf-b70e0fdf09506fcf53af951d64a3ae47309fa245.zip |
Add php support for Timestamp. (#3575)
* Add php support for Timestamp.
* Fix comments
Diffstat (limited to 'php/ext/google/protobuf/storage.c')
-rw-r--r-- | php/ext/google/protobuf/storage.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/php/ext/google/protobuf/storage.c b/php/ext/google/protobuf/storage.c index 4830e15f..cc34dcf6 100644 --- a/php/ext/google/protobuf/storage.c +++ b/php/ext/google/protobuf/storage.c @@ -560,11 +560,6 @@ static size_t align_up_to(size_t offset, size_t granularity) { return (offset + granularity - 1) & ~(granularity - 1); } -static void* slot_memory(MessageLayout* layout, const void* storage, - const upb_fielddef* field) { - return ((uint8_t*)storage) + layout->fields[upb_fielddef_index(field)].offset; -} - static uint32_t* slot_oneof_case(MessageLayout* layout, const void* storage, const upb_fielddef* field) { return (uint32_t*)(((uint8_t*)storage) + @@ -576,6 +571,11 @@ static int slot_property_cache(MessageLayout* layout, const void* storage, return layout->fields[upb_fielddef_index(field)].cache_index; } +void* slot_memory(MessageLayout* layout, const void* storage, + const upb_fielddef* field) { + return ((uint8_t*)storage) + layout->fields[upb_fielddef_index(field)].offset; +} + MessageLayout* create_layout(const upb_msgdef* msgdef) { MessageLayout* layout = ALLOC(MessageLayout); int nfields = upb_msgdef_numfields(msgdef); |