Skip to content

Commit b3b426b

Browse files
committed
Silence compiler warnings
1 parent 80acb4b commit b3b426b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/NimBLEAdvertisementData.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ bool NimBLEAdvertisementData::removeServiceUUID(const NimBLEUUID& serviceUUID) {
223223
}
224224

225225
int uuidLoc = -1;
226-
for (int i = dataLoc + 2; i < m_payload.size(); i += bytes) {
226+
for (size_t i = dataLoc + 2; i < m_payload.size(); i += bytes) {
227227
if (memcmp(&m_payload[i], serviceUUID.getValue(), bytes) == 0) {
228228
uuidLoc = i;
229229
break;
@@ -519,7 +519,7 @@ bool NimBLEAdvertisementData::setServiceData(const NimBLEUUID& uuid, const std::
519519
* @return -1 if the data is not found, otherwise the index of the data in the payload.
520520
*/
521521
int NimBLEAdvertisementData::getDataLocation(uint8_t type) const {
522-
int index = 0;
522+
size_t index = 0;
523523
while (index < m_payload.size()) {
524524
if (m_payload[index + 1] == type) {
525525
return index;

src/NimBLEExtAdvertising.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ bool NimBLEExtAdvertisement::removeServiceUUID(const NimBLEUUID& serviceUUID) {
765765
}
766766

767767
int uuidLoc = -1;
768-
for (int i = dataLoc + 2; i < m_payload.size(); i += bytes) {
768+
for (size_t i = dataLoc + 2; i < m_payload.size(); i += bytes) {
769769
if (memcmp(&m_payload[i], serviceUUID.getValue(), bytes) == 0) {
770770
uuidLoc = i;
771771
break;
@@ -1019,7 +1019,7 @@ void NimBLEExtAdvertisement::addTxPower() {
10191019
* @return -1 if the data is not found, otherwise the index of the data in the payload.
10201020
*/
10211021
int NimBLEExtAdvertisement::getDataLocation(uint8_t type) const {
1022-
int index = 0;
1022+
size_t index = 0;
10231023
while (index < m_payload.size()) {
10241024
if (m_payload[index + 1] == type) {
10251025
return index;

0 commit comments

Comments
 (0)