mirror of
https://github.com/espressif/openthread.git
synced 2026-07-28 22:57:47 +00:00
[posix-app] fix warnings on macOS (#3158)
This commit is contained in:
@@ -360,7 +360,7 @@ static int OpenFile(const char *aFile, const char *aConfig)
|
||||
switch (cstopb)
|
||||
{
|
||||
case 1:
|
||||
tios.c_cflag &= ~CSTOPB;
|
||||
tios.c_cflag &= static_cast<unsigned long>(~CSTOPB);
|
||||
break;
|
||||
case 2:
|
||||
tios.c_cflag |= CSTOPB;
|
||||
@@ -459,7 +459,7 @@ static int OpenFile(const char *aFile, const char *aConfig)
|
||||
break;
|
||||
}
|
||||
|
||||
VerifyOrExit((rval = cfsetspeed(&tios, speed)) == 0, perror("cfsetspeed"));
|
||||
VerifyOrExit((rval = cfsetspeed(&tios, static_cast<speed_t>(speed))) == 0, perror("cfsetspeed"));
|
||||
VerifyOrExit((rval = tcsetattr(fd, TCSANOW, &tios)) == 0, perror("tcsetattr"));
|
||||
VerifyOrExit((rval = tcflush(fd, TCIOFLUSH)) == 0);
|
||||
}
|
||||
@@ -1937,7 +1937,7 @@ void otPlatDiagProcess(otInstance *aInstance, int argc, char *argv[], char *aOut
|
||||
|
||||
for (int index = 0; index < argc; index++)
|
||||
{
|
||||
cur += snprintf(cur, end - cur, "%s ", argv[index]);
|
||||
cur += snprintf(cur, static_cast<size_t>(end - cur), "%s ", argv[index]);
|
||||
}
|
||||
|
||||
sRadioSpinel.PlatDiagProcess(cmd, aOutput, aOutputMaxLen);
|
||||
|
||||
@@ -247,7 +247,7 @@ otError otPlatSettingsAdd(otInstance *aInstance, uint16_t aKey, const uint8_t *a
|
||||
if (size > 0)
|
||||
{
|
||||
VerifyOrDie(0 == lseek(sSettingsFd, 0, SEEK_SET));
|
||||
swapWrite(swapFd, size);
|
||||
swapWrite(swapFd, static_cast<uint16_t>(size));
|
||||
}
|
||||
|
||||
VerifyOrDie(write(swapFd, &aKey, sizeof(aKey)) == sizeof(aKey) &&
|
||||
@@ -290,7 +290,7 @@ otError otPlatSettingsDelete(otInstance *aInstance, uint16_t aKey, int aIndex)
|
||||
if (aIndex == 0)
|
||||
{
|
||||
VerifyOrExit(offset == lseek(sSettingsFd, length, SEEK_CUR), error = OT_ERROR_PARSE);
|
||||
swapWrite(swapFd, size - offset);
|
||||
swapWrite(swapFd, static_cast<uint16_t>(size - offset));
|
||||
error = OT_ERROR_NONE;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user