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

Method getInt32

valdi_protobuf/src/valdi_protobuf/Field.cpp:416–429  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

414}
415
416int32_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
431void Field::setInt32(int32_t v) {
432 setVarint(static_cast<uint64_t>(v));

Callers 4

TESTFunction · 0.80
TESTFunction · 0.80

Calls

no outgoing calls

Tested by 3

TESTFunction · 0.64
TESTFunction · 0.64