mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-08 06:32:35 +02:00
cast max uint16_t to float for angle unpack
This commit is contained in:
parent
484ab53764
commit
4340f127e1
2 changed files with 2 additions and 2 deletions
|
@ -25,7 +25,7 @@ int packFloatAngleToTwoByte(unsigned char* buffer, float angle) {
|
|||
}
|
||||
|
||||
int unpackFloatAngleFromTwoByte(uint16_t* byteAnglePointer, float* destinationPointer) {
|
||||
*destinationPointer = (*byteAnglePointer / std::numeric_limits<uint16_t>::max()) * 360.0 - 180;
|
||||
*destinationPointer = (*byteAnglePointer / (float) std::numeric_limits<uint16_t>::max()) * 360.0 - 180;
|
||||
return sizeof(uint16_t);
|
||||
}
|
||||
|
||||
|
|
|
@ -107,7 +107,7 @@ void AgentList::processBulkAgentData(sockaddr *senderAddress, unsigned char *pac
|
|||
bulkSendAgent->setLastRecvTimeUsecs(usecTimestampNow());
|
||||
}
|
||||
|
||||
unsigned char *startPosition = (unsigned char *)packetData;
|
||||
unsigned char *startPosition = packetData;
|
||||
unsigned char *currentPosition = startPosition + 1;
|
||||
unsigned char packetHolder[numBytesPerAgent + 1];
|
||||
|
||||
|
|
Loading…
Reference in a new issue