I would guess that there is some kind of mismatch in your protobuf
generated code. This kind of thing might happen if perhaps you added a new
field and updated the pb.cc file but not the pb.h file (or vice versa).

On Sat, Jun 12, 2021 at 1:27 PM Bill Leisge <billyray2...@gmail.com> wrote:

> Looking back on my post, I need to add additional context.  The message of
> containing the variable in question is...
>
> message GeneratorStatus {
>     optional int32 command = 1;
>     optional bool is_generator_on = 2;
>     optional bool is_generator_busy = 3;
>     optional float current = 4;
> }
>
> The following encode the GeneratorStatus message...
>     pGeneratorStatus->set_current(4.5);
>     if (pGeneratorStatus->has_current())
>         float CurrentReadback = pGeneratorStatus->current();
>
> CurrentReadback is a very small number, certainly not 4.5.
>
> Tracing into the Protec .h file the disassembled function
> _internal_set_current() the AX register is set to the instance of
> pGeneratorStatus (this pointer)  and stores the argument at AX+16h.
> Similarly the getter function _internal_current() set AX to the this
> pointer and sets the destination register to AX+18h.  The GeneratorStatus
> object member _current is a float and the generated code leading up to
> setting _current is correct, it is only the operand references that are not
> correct.
>
> I have changed the scalar to double and uint32 to no avail.
>
> It is obvious not a proto/Protec issue in that the generated C++ code is
> correct, but VS 2015 code generation anomaly.
>
> I am hoping a group member has experienced this issue and might have a
> solution. Thank you.
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to protobuf+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/protobuf/6c41448b-4659-4c6e-ac8b-c2bf30830047n%40googlegroups.com
> <https://groups.google.com/d/msgid/protobuf/6c41448b-4659-4c6e-ac8b-c2bf30830047n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/CADqAXr7RsBNX-tUZVgcPzPi_%2BT2Vy%2BYGR-c7VQ2eezst9OCc1A%40mail.gmail.com.

Reply via email to