Skip to content

Commit

Permalink
Silence compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
h2zero committed Dec 13, 2024
1 parent 62de1b2 commit af18726
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/NimBLEAdvertisementData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/NimBLEExtAdvertising.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit af18726

Please sign in to comment.