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 4256ae3 commit c63e4a5
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 @@ -179,7 +179,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 c63e4a5

Please sign in to comment.