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

Method getFloat

valdi_protobuf/src/valdi_protobuf/Field.cpp:585–598  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

583}
584
585float Field::getFloat() const {
586 switch (_type) {
587 case InternalType::Varint:
588 return static_cast<float>(WireFormat::DecodeDouble(_data.varint));
589 case InternalType::Fixed64:
590 return static_cast<float>(WireFormat::DecodeDouble(_data.fixed64));
591 case InternalType::Fixed32:
592 return WireFormat::DecodeFloat(_data.fixed32);
593 case InternalType::Unset:
594 case InternalType::Raw:
595 case InternalType::Ref:
596 return 0;
597 }
598}
599
600void Field::setFloat(float v) {
601 setFixed32(WireFormat::EncodeFloat(v));

Callers 3

TESTFunction · 0.45
TESTFunction · 0.45

Calls

no outgoing calls

Tested by 3

TESTFunction · 0.36
TESTFunction · 0.36