| 414 | } |
| 415 | |
| 416 | int32_t Field::getInt32() const { |
| 417 | switch (_type) { |
| 418 | case InternalType::Varint: |
| 419 | return static_cast<int32_t>(_data.varint); |
| 420 | case InternalType::Fixed64: |
| 421 | return static_cast<int32_t>(_data.fixed64); |
| 422 | case InternalType::Fixed32: |
| 423 | return static_cast<int32_t>(_data.fixed32); |
| 424 | case InternalType::Unset: |
| 425 | case InternalType::Raw: |
| 426 | case InternalType::Ref: |
| 427 | return 0; |
| 428 | } |
| 429 | } |
| 430 | |
| 431 | void Field::setInt32(int32_t v) { |
| 432 | setVarint(static_cast<uint64_t>(v)); |
no outgoing calls