From 8883f44d9f765e9a9093668b46712500815753ae Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 Date: Sat, 17 Sep 2022 22:13:46 +0200 Subject: [PATCH] New compiler new printf chars --- src/FreeRTOS.cpp | 2 +- src/NimBLEClient.cpp | 2 +- src/NimBLEEddystoneTLM.cpp | 12 ++++++------ src/NimBLEScan.cpp | 2 +- src/NimBLEServer.cpp | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/FreeRTOS.cpp b/src/FreeRTOS.cpp index 2c56e96..1a37cbf 100644 --- a/src/FreeRTOS.cpp +++ b/src/FreeRTOS.cpp @@ -243,7 +243,7 @@ bool FreeRTOS::Semaphore::take(uint32_t timeoutMs, std::string owner) { std::string FreeRTOS::Semaphore::toString() { char hex[9]; std::string res = "name: " + m_name + " (0x"; - snprintf(hex, sizeof(hex), "%08x", (uint32_t)m_semaphore); + snprintf(hex, sizeof(hex), "%08lx", (uint32_t)m_semaphore); res += hex; res += "), owner: " + m_owner; return res; diff --git a/src/NimBLEClient.cpp b/src/NimBLEClient.cpp index a171b8c..2eeff8f 100644 --- a/src/NimBLEClient.cpp +++ b/src/NimBLEClient.cpp @@ -1034,7 +1034,7 @@ uint16_t NimBLEClient::getMTU() { NIMBLE_LOGD(LOG_TAG, "ble_sm_inject_io result: %d", rc); } else if (event->passkey.params.action == BLE_SM_IOACT_NUMCMP) { - NIMBLE_LOGD(LOG_TAG, "Passkey on device's display: %d", event->passkey.params.numcmp); + NIMBLE_LOGD(LOG_TAG, "Passkey on device's display: %lu", event->passkey.params.numcmp); pkey.action = event->passkey.params.action; // Compatibility only - Do not use, should be removed the in future if(NimBLEDevice::m_securityCallbacks != nullptr) { diff --git a/src/NimBLEEddystoneTLM.cpp b/src/NimBLEEddystoneTLM.cpp index 538d3da..7228850 100644 --- a/src/NimBLEEddystoneTLM.cpp +++ b/src/NimBLEEddystoneTLM.cpp @@ -124,30 +124,30 @@ std::string NimBLEEddystoneTLM::toString() { out += " C\n"; out += "Adv. Count "; - snprintf(val, sizeof(val), "%d", ENDIAN_CHANGE_U32(m_eddystoneData.advCount)); + snprintf(val, sizeof(val), "%lu", ENDIAN_CHANGE_U32(m_eddystoneData.advCount)); out += val; out += "\n"; out += "Time in seconds "; - snprintf(val, sizeof(val), "%d", rawsec/10); + snprintf(val, sizeof(val), "%lu", rawsec/10); out += val; out += "\n"; out += "Time "; - snprintf(val, sizeof(val), "%04d", rawsec / 864000); + snprintf(val, sizeof(val), "%04lu", rawsec / 864000); out += val; out += "."; - snprintf(val, sizeof(val), "%02d", (rawsec / 36000) % 24); + snprintf(val, sizeof(val), "%02lu", (rawsec / 36000) % 24); out += val; out += ":"; - snprintf(val, sizeof(val), "%02d", (rawsec / 600) % 60); + snprintf(val, sizeof(val), "%02lu", (rawsec / 600) % 60); out += val; out += ":"; - snprintf(val, sizeof(val), "%02d", (rawsec / 10) % 60); + snprintf(val, sizeof(val), "%02lu", (rawsec / 10) % 60); out += val; out += "\n"; diff --git a/src/NimBLEScan.cpp b/src/NimBLEScan.cpp index bc08896..f622036 100644 --- a/src/NimBLEScan.cpp +++ b/src/NimBLEScan.cpp @@ -284,7 +284,7 @@ bool NimBLEScan::isScanning() { * @return True if scan started or false if there was an error. */ bool NimBLEScan::start(uint32_t duration, void (*scanCompleteCB)(NimBLEScanResults), bool is_continue) { - NIMBLE_LOGD(LOG_TAG, ">> start(duration=%d)", duration); + NIMBLE_LOGD(LOG_TAG, ">> start(duration=%lu)", duration); // Save the callback to be invoked when the scan completes. m_scanCompleteCB = scanCompleteCB; diff --git a/src/NimBLEServer.cpp b/src/NimBLEServer.cpp index 718e3ac..a0bf0a6 100644 --- a/src/NimBLEServer.cpp +++ b/src/NimBLEServer.cpp @@ -524,7 +524,7 @@ NimBLEConnInfo NimBLEServer::getPeerIDInfo(uint16_t id) { NIMBLE_LOGD(LOG_TAG, "BLE_SM_IOACT_DISP; ble_sm_inject_io result: %d", rc); } else if (event->passkey.params.action == BLE_SM_IOACT_NUMCMP) { - NIMBLE_LOGD(LOG_TAG, "Passkey on device's display: %d", event->passkey.params.numcmp); + NIMBLE_LOGD(LOG_TAG, "Passkey on device's display: %lu", event->passkey.params.numcmp); pkey.action = event->passkey.params.action; // Compatibility only - Do not use, should be removed the in future if(NimBLEDevice::m_securityCallbacks != nullptr) {