| 460 | } |
| 461 | |
| 462 | int64_t Field::getSInt64() const { |
| 463 | switch (_type) { |
| 464 | case InternalType::Varint: |
| 465 | return WireFormat::ZigZagDecode64(_data.varint); |
| 466 | case InternalType::Fixed64: |
| 467 | return static_cast<int64_t>(_data.fixed64); |
| 468 | case InternalType::Fixed32: |
| 469 | return static_cast<int64_t>(_data.fixed32); |
| 470 | case InternalType::Unset: |
| 471 | case InternalType::Raw: |
| 472 | case InternalType::Ref: |
| 473 | return 0; |
| 474 | } |
| 475 | } |
| 476 | |
| 477 | void Field::setSInt64(int64_t v) { |
| 478 | setVarint(WireFormat::ZigZagEncode64(v)); |
no outgoing calls