diff --git a/src/servers/Server_Common/Crypt/base64.cpp b/src/servers/Server_Common/Crypt/base64.cpp index c6c23efc..8037dec4 100644 --- a/src/servers/Server_Common/Crypt/base64.cpp +++ b/src/servers/Server_Common/Crypt/base64.cpp @@ -93,7 +93,7 @@ std::string Core::Util::base64_decode( std::string const& encoded_string ) { char_array_4[i++] = encoded_string[in_]; in_++; if( i == 4 ) { for( i = 0; i < 4; i++ ) - char_array_4[i] = static_cast( base64_chars.find( char_array_4[i] ) ); + char_array_4[i] = static_cast< uint8_t >( base64_chars.find( char_array_4[i] ) ); char_array_3[0] = ( char_array_4[0] << 2 ) + ( ( char_array_4[1] & 0x30 ) >> 4 ); char_array_3[1] = ( ( char_array_4[1] & 0xf ) << 4 ) + ( ( char_array_4[2] & 0x3c ) >> 2 ); @@ -110,7 +110,7 @@ std::string Core::Util::base64_decode( std::string const& encoded_string ) { char_array_4[j] = 0; for( j = 0; j < 4; j++ ) - char_array_4[j] = static_cast( base64_chars.find( char_array_4[j] ) ); + char_array_4[j] = static_cast< uint8_t >( base64_chars.find( char_array_4[j] ) ); char_array_3[0] = ( char_array_4[0] << 2 ) + ( ( char_array_4[1] & 0x30 ) >> 4 ); char_array_3[1] = ( ( char_array_4[1] & 0xf ) << 4 ) + ( ( char_array_4[2] & 0x3c ) >> 2 ); diff --git a/src/servers/Server_Lobby/client_http.hpp b/src/servers/Server_Lobby/client_http.hpp index b099c74f..656b8d01 100644 --- a/src/servers/Server_Lobby/client_http.hpp +++ b/src/servers/Server_Lobby/client_http.hpp @@ -266,7 +266,7 @@ namespace SimpleWeb { if( content_length>num_additional_bytes ) { auto timer = get_timeout_timer(); boost::asio::async_read( *socket, response->content_buffer, - boost::asio::transfer_exactly( static_cast( content_length - num_additional_bytes ) ), + boost::asio::transfer_exactly( static_cast< size_t >( content_length - num_additional_bytes ) ), [this, timer]( const boost::system::error_code& ec, size_t /*bytes_transferred*/ ) { if( timer ) timer->cancel(); @@ -332,7 +332,7 @@ namespace SimpleWeb { if( ( 2 + length )>num_additional_bytes ) { auto timer = get_timeout_timer(); boost::asio::async_read( *socket, response->content_buffer, - boost::asio::transfer_exactly( static_cast( 2 + length - num_additional_bytes ) ), + boost::asio::transfer_exactly( static_cast< size_t >( 2 + length - num_additional_bytes ) ), [this, post_process, timer]( const boost::system::error_code& ec, size_t /*bytes_transferred*/ ) { if( timer ) timer->cancel(); diff --git a/src/servers/Server_REST/main.cpp b/src/servers/Server_REST/main.cpp index b509e9cf..28f7c16d 100644 --- a/src/servers/Server_REST/main.cpp +++ b/src/servers/Server_REST/main.cpp @@ -149,7 +149,7 @@ bool loadSettings( int32_t argc, char* argv[] ) params.port = m_pConfig->getValue< uint16_t >( "Settings.General.Mysql.Port", 3306 ); params.username = m_pConfig->getValue< std::string >( "Settings.General.Mysql.Username", "root" ); - server.config.port = static_cast( std::stoul( m_pConfig->getValue( "Settings.General.HttpPort", "80" ) ) ); + server.config.port = static_cast< unsigned short >( std::stoul( m_pConfig->getValue( "Settings.General.HttpPort", "80" ) ) ); if( !g_database.initialize( params ) ) { diff --git a/src/servers/Server_REST/server_http.hpp b/src/servers/Server_REST/server_http.hpp index 64f10234..e946afe2 100644 --- a/src/servers/Server_REST/server_http.hpp +++ b/src/servers/Server_REST/server_http.hpp @@ -282,7 +282,7 @@ namespace SimpleWeb { //Set timeout on the following boost::asio::async-read or write function auto timer=this->get_timeout_timer(socket, config.timeout_content); boost::asio::async_read(*socket, request->streambuf, - boost::asio::transfer_exactly(static_cast(content_length-num_additional_bytes)), + boost::asio::transfer_exactly(static_cast< size_t >(content_length-num_additional_bytes)), [this, socket, request, timer] (const boost::system::error_code& ec, size_t /*bytes_transferred*/) { if(timer) diff --git a/src/servers/Server_Zone/Actor/BattleNpc.cpp b/src/servers/Server_Zone/Actor/BattleNpc.cpp index d9d62e36..6e64015a 100644 --- a/src/servers/Server_Zone/Actor/BattleNpc.cpp +++ b/src/servers/Server_Zone/Actor/BattleNpc.cpp @@ -451,7 +451,7 @@ void Core::Entity::BattleNpc::onDeath() // todo: this is actually retarded, we need real rand() - srand( static_cast( time( NULL ) ) ); + srand( static_cast< unsigned int> ( time( NULL ) ) ); auto pPlayer = pHateEntry->m_pActor->getAsPlayer(); pPlayer->gainExp( exp ); diff --git a/src/servers/Server_Zone/Actor/CalcBattle.cpp b/src/servers/Server_Zone/Actor/CalcBattle.cpp index 9687b02a..ce2e3a84 100644 --- a/src/servers/Server_Zone/Actor/CalcBattle.cpp +++ b/src/servers/Server_Zone/Actor/CalcBattle.cpp @@ -38,7 +38,7 @@ float CalcBattle::calculateBaseStat( PlayerPtr pPlayer ) // SB Base Stat Formula (Aligned) if ( level > 60 ) { - base = static_cast( ( ( ( level == 61 ) ? 224 : 220 ) + ( level - 61 ) * 8) ); + base = static_cast< float >( ( ( ( level == 61 ) ? 224 : 220 ) + ( level - 61 ) * 8) ); } // HW Base Stat Formula (Aligned) else if ( level > 50 ) @@ -77,7 +77,7 @@ uint32_t CalcBattle::calculateMaxHp( PlayerPtr pPlayer ) // These values are not precise. if ( level >= 60 ) - approxBaseHp = static_cast( 2600 + ( level - 60 ) * 100 ); + approxBaseHp = static_cast< float >( 2600 + ( level - 60 ) * 100 ); else if ( level >= 50 ) approxBaseHp = 1700 + ( ( level - 50 ) * ( 1700 * 1.04325f ) ); else diff --git a/src/servers/Server_Zone/Network/Handlers/ActionHandler.cpp b/src/servers/Server_Zone/Network/Handlers/ActionHandler.cpp index df033f74..0f53871d 100644 --- a/src/servers/Server_Zone/Network/Handlers/ActionHandler.cpp +++ b/src/servers/Server_Zone/Network/Handlers/ActionHandler.cpp @@ -216,7 +216,7 @@ void Core::Network::GameConnection::actionHandler( const Packets::GamePacket& in auto fromAetheryte = g_exdData.getAetheryteInfo( g_exdData.m_zoneInfoMap[pPlayer->getZoneId()].aetheryte_index ); // calculate cost - does not apply for favorite points or homepoints neither checks for aether tickets - auto cost = static_cast ( ( sqrt( pow( fromAetheryte->map_coord_x - targetAetheryte->map_coord_x, 2 ) + + auto cost = static_cast< uint16_t > ( ( sqrt( pow( fromAetheryte->map_coord_x - targetAetheryte->map_coord_x, 2 ) + pow( fromAetheryte->map_coord_y - targetAetheryte->map_coord_y, 2 ) ) / 2 ) + 100 ); // cap at 999 gil