Skip to content

Commit

Permalink
Enable -Wconversion in openiotsdk platform code. (#25410)
Browse files Browse the repository at this point in the history
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Jan 11, 2024
1 parent be531f7 commit 803ddb0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/platform/openiotsdk/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,6 @@ static_library("openiotsdk") {
"KVBlockDeviceStore.h",
]
}

cflags = [ "-Wconversion" ]
}
2 changes: 1 addition & 1 deletion src/platform/openiotsdk/KVBlockDeviceStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ KVBlockDeviceStoreKeyBuilder::KVBlockDeviceStoreKeyBuilder(const char * key)
if (illegal_ptr)
{
*out++ = '!';
*out++ = 'A' + (int) (illegal_ptr - illegalCharacters);
*out++ = static_cast<char>('A' + (int) (illegal_ptr - illegalCharacters));
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions src/platform/openiotsdk/KVPsaPsStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ void KVPsaPsStoreKeyBuilder::AddKey()
return;
}

uint32_t keyIndex = CONVERT_KEY_TO_INDEX(keyValue);
auto keyIndex = CONVERT_KEY_TO_INDEX(keyValue);
memset(mKvsStoredKeyString[keyIndex], 0, sizeof(mKvsStoredKeyString[keyIndex]));
Platform::CopyString(mKvsStoredKeyString[keyIndex], buffer);
KVPsaPsStore::ScheduleKVSKeyMapUpdate();
Expand All @@ -614,7 +614,7 @@ void KVPsaPsStoreKeyBuilder::RemoveKey()
return;
}

uint32_t keyIndex = CONVERT_KEY_TO_INDEX(keyValue);
auto keyIndex = CONVERT_KEY_TO_INDEX(keyValue);
memset(mKvsStoredKeyString[keyIndex], 0, sizeof(mKvsStoredKeyString[keyIndex]));
KVPsaPsStore::ScheduleKVSKeyMapUpdate();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ NetworkIterator * OpenIoTSDKEthernetDriver::GetNetworks()
char buf[NETIF_NAMESIZE];
char * ifname = netif_index_to_name(0, buf);

ret->interfaceNameLen = strlen(ifname);
ret->interfaceNameLen = static_cast<uint8_t>(strlen(ifname));
memcpy(ret->interfaceName, ifname, ret->interfaceNameLen);

return ret;
Expand Down

0 comments on commit 803ddb0

Please sign in to comment.