Skip to content

Commit

Permalink
Use C++-style cast - static_cast replacement
Browse files Browse the repository at this point in the history
  • Loading branch information
ATmobica committed Aug 2, 2021
1 parent fbde789 commit 5a6ecb3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/messaging/tests/TestReliableMessageProtocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class MockSessionEstablishmentDelegate : public ExchangeDelegate

void test_os_sleep_ms(uint64_t millisecs)
{
usleep((useconds_t)(millisecs * 1000));
usleep(static_cast<useconds_t>(millisecs * 1000));
}

void CheckAddClearRetrans(nlTestSuite * inSuite, void * inContext)
Expand Down
2 changes: 1 addition & 1 deletion src/platform/tests/TestPlatformMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ static bool sleepRan;

static void SleepSome(intptr_t)
{
usleep((useconds_t)(1 * 1000 * 1000));
usleep(static_cast<useconds_t>(1 * 1000 * 1000));
sleepRan = true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/platform/tests/TestPlatformTime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ static const struct time_test_vector test_vector_system_time_us[] = {

void test_os_sleep_us(uint64_t microsecs)
{
usleep(microsecs);
usleep(static_cast<useconds_t>(microsecs));
}

void test_os_sleep_ms(uint64_t millisecs)
Expand Down
2 changes: 1 addition & 1 deletion src/protocols/secure_channel/tests/TestPASESession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ using TestContext = chip::Test::MessagingContext;

static void test_os_sleep_ms(uint64_t millisecs)
{
usleep((useconds_t) millisecs * 1000);
usleep(static_cast<useconds_t>(millisecs * 1000));
}

class PASETestLoopbackTransport : public Test::LoopbackTransport
Expand Down

0 comments on commit 5a6ecb3

Please sign in to comment.