1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-26 06:27:45 +00:00

Fixing spacing issues for casts

This commit is contained in:
ShelbyZ 2017-10-20 14:12:24 -07:00
parent a73721764f
commit 279563b90f
7 changed files with 10 additions and 10 deletions

View file

@ -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<uint8_t>( 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<uint8_t>( 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 );

View file

@ -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<size_t>( 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<size_t>( 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();

View file

@ -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<unsigned short>( std::stoul( m_pConfig->getValue<std::string>( "Settings.General.HttpPort", "80" ) ) );
server.config.port = static_cast< unsigned short >( std::stoul( m_pConfig->getValue<std::string>( "Settings.General.HttpPort", "80" ) ) );
if( !g_database.initialize( params ) )
{

View file

@ -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<size_t>(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)

View file

@ -451,7 +451,7 @@ void Core::Entity::BattleNpc::onDeath()
// todo: this is actually retarded, we need real rand()
srand( static_cast<unsigned int>( time( NULL ) ) );
srand( static_cast< unsigned int> ( time( NULL ) ) );
auto pPlayer = pHateEntry->m_pActor->getAsPlayer();
pPlayer->gainExp( exp );

View file

@ -38,7 +38,7 @@ float CalcBattle::calculateBaseStat( PlayerPtr pPlayer )
// SB Base Stat Formula (Aligned)
if ( level > 60 )
{
base = static_cast<float>( ( ( ( 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<float>( 2600 + ( level - 60 ) * 100 );
approxBaseHp = static_cast< float >( 2600 + ( level - 60 ) * 100 );
else if ( level >= 50 )
approxBaseHp = 1700 + ( ( level - 50 ) * ( 1700 * 1.04325f ) );
else

View file

@ -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<uint16_t> ( ( 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