@@ -348,9 +348,12 @@ void StringUtilsTest::testIntToHexString() {
348348
349349 OLA_ASSERT_EQ (string (" 0x01" ), IntToHexString ((uint8_t )1 ));
350350 OLA_ASSERT_EQ (string (" 0x42" ), IntToHexString ((uint8_t )0x42 ));
351- OLA_ASSERT_EQ (string (" 0x0001" ), IntToHexString ((uint16_t )0x0001 ));
352- OLA_ASSERT_EQ (string (" 0xabcd" ), IntToHexString ((uint16_t )0xABCD ));
353- OLA_ASSERT_EQ (string (" 0xdeadbeef" ), IntToHexString ((uint32_t )0xDEADBEEF ));
351+ OLA_ASSERT_EQ (string (" 0x0001" ),
352+ IntToHexString (static_cast <uint16_t >(0x0001 )));
353+ OLA_ASSERT_EQ (string (" 0xabcd" ),
354+ IntToHexString (static_cast <uint16_t >(0xABCD )));
355+ OLA_ASSERT_EQ (string (" 0xdeadbeef" ),
356+ IntToHexString (static_cast <uint32_t >(0xDEADBEEF )));
354357 // Deliberately no IntToHexString(uint64_t) or test as its deprecated
355358
356359 unsigned int i = 0x42 ;
@@ -370,19 +373,19 @@ void StringUtilsTest::testIntToHexString() {
370373 OLA_ASSERT_EQ (string (" 0x42" ), str.str ());
371374 str.str (" " );
372375
373- str << ToHex (( uint16_t ) 0x0001 );
376+ str << ToHex (static_cast < uint16_t >( 0x0001 ) );
374377 OLA_ASSERT_EQ (string (" 0x0001" ), str.str ());
375378 str.str (" " );
376379
377- str << ToHex (( uint16_t ) 0xABCD );
380+ str << ToHex (static_cast < uint16_t >( 0xABCD ) );
378381 OLA_ASSERT_EQ (string (" 0xabcd" ), str.str ());
379382 str.str (" " );
380383
381- str << ToHex (( uint32_t ) 0xDEADBEEF );
384+ str << ToHex (static_cast < uint32_t >( 0xDEADBEEF ) );
382385 OLA_ASSERT_EQ (string (" 0xdeadbeef" ), str.str ());
383386 str.str (" " );
384387
385- str << ToHex (( uint64_t ) 0xDEADBEEFFEEDFACE );
388+ str << ToHex (static_cast < uint64_t >( 0xDEADBEEFFEEDFACE ) );
386389 OLA_ASSERT_EQ (string (" 0xdeadbeeffeedface" ), str.str ());
387390 str.str (" " );
388391
@@ -395,7 +398,7 @@ void StringUtilsTest::testIntToHexString() {
395398 OLA_ASSERT_EQ (string (" 42" ), str.str ());
396399 str.str (" " );
397400
398- str << ToHex (( uint16_t ) 0xABCD , false );
401+ str << ToHex (static_cast < uint16_t >( 0xABCD ) , false );
399402 OLA_ASSERT_EQ (string (" abcd" ), str.str ());
400403 str.str (" " );
401404}
@@ -578,8 +581,9 @@ void StringUtilsTest::testStringToUIntOrDefault() {
578581 OLA_ASSERT_EQ (1u , StringToIntOrDefault (" 1" , 42u ));
579582 OLA_ASSERT_EQ (65537u , StringToIntOrDefault (" 65537" , 42u ));
580583 OLA_ASSERT_EQ (4294967295U , StringToIntOrDefault (" 4294967295" , 42U ));
581- OLA_ASSERT_EQ ((uint64_t ) 77000000000 ,
582- StringToIntOrDefault (" 77000000000" , (uint64_t ) 42 ));
584+ OLA_ASSERT_EQ (
585+ static_cast <uint64_t >(77000000000 ),
586+ StringToIntOrDefault (" 77000000000" , static_cast <uint64_t >(42 )));
583587 OLA_ASSERT_EQ (42u , StringToIntOrDefault (" 4294967296" , 42u ));
584588 OLA_ASSERT_EQ (42u , StringToIntOrDefault (" foo" , 42u ));
585589
0 commit comments