MCPcopy Create free account
hub / github.com/Snapchat/Valdi / getSInt64

Method getSInt64

valdi_protobuf/src/valdi_protobuf/Field.cpp:462–475  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

460}
461
462int64_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
477void Field::setSInt64(int64_t v) {
478 setVarint(WireFormat::ZigZagEncode64(v));

Callers 3

TESTFunction · 0.80

Calls

no outgoing calls

Tested by 2

TESTFunction · 0.64