Skip to content

Commit

Permalink
Fix implicit cast in C++ land
Browse files Browse the repository at this point in the history
  • Loading branch information
mcm001 committed Oct 1, 2023
1 parent 45e9734 commit 64b424c
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ Packet& operator<<(Packet& packet, const MultiTargetPnpResult& target) {
packet << target.result;

size_t i;
for (i = 0; i < target.fiducialIdsUsed.size(); i++) {
packet << target.fiducialIdsUsed[i];
}
for (; i < target.fiducialIdsUsed.capacity(); i++) {
packet << -128;
for (i = 0; i < target.fiducialIdsUsed.capacity(); i++) {
if (i < target.fiducialIdsUsed.size()) {
packet << static_cast<int8_t>(target.fiducialIdsUsed[i]);
} else {
packet << static_cast<int8_t>(-128);
}
}

return packet;
Expand Down Expand Up @@ -100,6 +101,7 @@ Packet& operator<<(Packet& packet, PNPResults const& result) {

return packet;
}

Packet& operator>>(Packet& packet, PNPResults& result) {
packet >> result.isValid >> result.best >> result.alt >>
result.bestReprojectionErr >> result.altReprojectionErr >>
Expand Down

0 comments on commit 64b424c

Please sign in to comment.