Skip to content

Commit

Permalink
Enable readability-redundant-string-init
Browse files Browse the repository at this point in the history
Enable this clang-tidy check and fix existing warnings related to it.
  • Loading branch information
jbytheway committed Aug 4, 2019
1 parent becab72 commit 8080527
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ readability-*,\
-readability-redundant-control-flow,\
-readability-redundant-declaration,\
-readability-redundant-preprocessor,\
-readability-redundant-string-init,\
"
WarningsAsErrors: '*'
HeaderFilterRegex: '(src|test).*'
Expand Down
2 changes: 1 addition & 1 deletion src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3500,7 +3500,7 @@ int Character::get_shout_volume() const
void Character::shout( std::string msg, bool order )
{
int base = 10;
std::string shout = "";
std::string shout;

// You can't shout without your face
if( has_trait( trait_PROF_FOODP ) && !( is_wearing( itype_id( "foodperson_mask" ) ) ||
Expand Down
4 changes: 2 additions & 2 deletions src/magic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1393,7 +1393,7 @@ void spellcasting_callback::draw_spell_info( const spell &sp, const uilist *menu

line++;

std::string targets = "";
std::string targets;
if( sp.is_valid_target( target_none ) ) {
targets = "self";
} else {
Expand All @@ -1420,7 +1420,7 @@ void spellcasting_callback::draw_spell_info( const spell &sp, const uilist *menu
}
if( sp.aoe() > 0 ) {
std::string aoe_string_temp = "Spell Radius";
std::string degree_string = "";
std::string degree_string;
if( fx == "cone_attack" ) {
aoe_string_temp = "Cone Arc";
degree_string = "degrees";
Expand Down
2 changes: 1 addition & 1 deletion src/ranged.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1376,7 +1376,7 @@ std::vector<tripoint> target_handler::target_ui( player &pc, target_mode mode,
}
if( mode == TARGET_MODE_FIRE || mode == TARGET_MODE_TURRET_MANUAL ) {
auto m = relevant->gun_current_mode();
std::string str = "";
std::string str;
nc_color col = c_light_gray;
if( relevant != m.target ) {
str = string_format( _( "Firing mode: <color_cyan>%s %s (%d)</color>" ),
Expand Down

0 comments on commit 8080527

Please sign in to comment.