Skip to content

Commit

Permalink
Fix some errors I made by confusing fmt::format and fmt::printf
Browse files Browse the repository at this point in the history
  • Loading branch information
scamille committed Mar 25, 2018
1 parent e56d2c3 commit 19c6fe5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion engine/interfaces/sc_wowhead.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ bool wowhead::download_item_data( item_t& item,
assert( n_sockets <= static_cast< int >( sizeof_array( item.parsed.data.socket_color ) ) );
for ( int i = 0; i < n_sockets; i++ )
{
std::string socket_str = fmt::format( "socket%d", i + 1 );
std::string socket_str = fmt::format( "socket{:d}", i + 1 );
if ( jsonequip.HasMember( socket_str.c_str() ) )
item.parsed.data.socket_color[ i ] = jsonequip[ socket_str.c_str() ].GetUint();
}
Expand Down
2 changes: 1 addition & 1 deletion engine/report/sc_gear_weights.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ std::array<std::string, SCALE_METRIC_MAX> gear_weights::wowhead(
}
first = false;

id_string += fmt::format( "%d", id );
id_string += fmt::format( "{:d}", id );
value_string += fmt::format( "{:.{}f}", value, p.sim->report_precision );
}
}
Expand Down
2 changes: 1 addition & 1 deletion engine/sim/sc_expressions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,7 @@ void print_tokens( std::vector<expr_token_t>& tokens, sim_t* sim )
for ( size_t i = 0; i < tokens.size(); i++ )
{
expr_token_t& t = tokens[ i ];
auto labels = fmt::format("%2d '%s'", t.type, t.label.c_str() );
auto labels = fmt::format("{:2d} '{}'", t.type, t.label );
str += labels;
if ( i < tokens.size() - 1 )
str += " | ";
Expand Down

0 comments on commit 19c6fe5

Please sign in to comment.