Silence compiler warnings

This commit is contained in:
h2zero 2024-12-13 12:25:15 -07:00 committed by Ryan Powell
parent 62de1b23fa
commit af1872623e
2 changed files with 4 additions and 4 deletions

View file

@ -223,7 +223,7 @@ bool NimBLEAdvertisementData::removeServiceUUID(const NimBLEUUID& serviceUUID) {
}
int uuidLoc = -1;
for (int i = dataLoc + 2; i < m_payload.size(); i += bytes) {
for (size_t i = dataLoc + 2; i < m_payload.size(); i += bytes) {
if (memcmp(&m_payload[i], serviceUUID.getValue(), bytes) == 0) {
uuidLoc = i;
break;
@ -519,7 +519,7 @@ bool NimBLEAdvertisementData::setServiceData(const NimBLEUUID& uuid, const std::
* @return -1 if the data is not found, otherwise the index of the data in the payload.
*/
int NimBLEAdvertisementData::getDataLocation(uint8_t type) const {
int index = 0;
size_t index = 0;
while (index < m_payload.size()) {
if (m_payload[index + 1] == type) {
return index;

View file

@ -765,7 +765,7 @@ bool NimBLEExtAdvertisement::removeServiceUUID(const NimBLEUUID& serviceUUID) {
}
int uuidLoc = -1;
for (int i = dataLoc + 2; i < m_payload.size(); i += bytes) {
for (size_t i = dataLoc + 2; i < m_payload.size(); i += bytes) {
if (memcmp(&m_payload[i], serviceUUID.getValue(), bytes) == 0) {
uuidLoc = i;
break;
@ -1019,7 +1019,7 @@ void NimBLEExtAdvertisement::addTxPower() {
* @return -1 if the data is not found, otherwise the index of the data in the payload.
*/
int NimBLEExtAdvertisement::getDataLocation(uint8_t type) const {
int index = 0;
size_t index = 0;
while (index < m_payload.size()) {
if (m_payload[index + 1] == type) {
return index;