@@ -800,10 +800,10 @@ static int l_SetViewport(lua_State* L)
800800 for (int i = 1 ; i <= 4 ; i++) {
801801 ui->LAssert (L, lua_isnumber (L, i), " SetViewport() argument %d: expected number, got %s" , i, luaL_typename (L, i));
802802 }
803- int vpX = ( int ) std::lround (lua_tonumber (L, 1 ) * dpiScale);
804- int vpY = ( int ) std::lround (lua_tonumber (L, 2 ) * dpiScale);
805- int vpWidth = ( int ) std::ceil (lua_tonumber (L, 3 ) * dpiScale);
806- int vpHeight = ( int ) std::ceil (lua_tonumber (L, 4 ) * dpiScale);
803+ int vpX = static_cast < int >( std::lround (lua_tonumber (L, 1 ) * dpiScale) );
804+ int vpY = static_cast < int >( std::lround (lua_tonumber (L, 2 ) * dpiScale) );
805+ int vpWidth = static_cast < int >( std::ceil (lua_tonumber (L, 3 ) * dpiScale) );
806+ int vpHeight = static_cast < int >( std::ceil (lua_tonumber (L, 4 ) * dpiScale) );
807807 ui->renderer ->SetViewport (vpX, vpY, vpWidth, vpHeight);
808808 }
809809 else {
@@ -1105,7 +1105,7 @@ static int l_DrawStringWidth(lua_State* L)
11051105 static const char * fontMap[4 ] = { " FIXED" , " VAR" , " VAR BOLD" , NULL };
11061106 const float dpiScale = ui->renderer ->VirtualScreenScaleFactor ();
11071107 const lua_Number logicalHeight = lua_tonumber (L, 1 );
1108- int scaledHeight = ( int ) std::lround (logicalHeight * dpiScale);
1108+ int scaledHeight = static_cast < int >( std::lround (logicalHeight * dpiScale) );
11091109 if (scaledHeight <= 1 ) {
11101110 scaledHeight = std::max (1 , scaledHeight);
11111111 }
@@ -1136,20 +1136,20 @@ static int l_DrawStringCursorIndex(lua_State* L)
11361136 const lua_Number logicalHeight = lua_tonumber (L, 1 );
11371137 const lua_Number logicalCursorX = lua_tonumber (L, 4 );
11381138 const lua_Number logicalCursorY = lua_tonumber (L, 5 );
1139- int scaledHeight = ( int ) std::lround (logicalHeight * dpiScale);
1139+ int scaledHeight = static_cast < int >( std::lround (logicalHeight * dpiScale) );
11401140 if (scaledHeight <= 1 ) {
11411141 scaledHeight = std::max (1 , scaledHeight);
11421142 }
11431143 else {
11441144 scaledHeight = (scaledHeight + 1 ) & ~1 ;
11451145 }
1146- const int scaledCursorX = ( int ) std::lround (logicalCursorX * dpiScale);
1147- const int scaledCursorY = ( int ) std::lround (logicalCursorY * dpiScale);
1148- lua_pushinteger (L, ui->renderer ->DrawStringCursorIndex (
1146+ const int scaledCursorX = static_cast < int >( std::lround (logicalCursorX * dpiScale) );
1147+ const int scaledCursorY = static_cast < int >( std::lround (logicalCursorY * dpiScale) );
1148+ lua_pushinteger (L, static_cast <lua_Integer>( ui->renderer ->DrawStringCursorIndex (
11491149 scaledHeight,
11501150 luaL_checkoption (L, 2 , " FIXED" , fontMap),
11511151 lua_tostring (L, 3 ),
1152- scaledCursorX, scaledCursorY) + 1 );
1152+ scaledCursorX, scaledCursorY) + 1 )) ;
11531153 return 1 ;
11541154}
11551155
0 commit comments