From f382c09502138c1e6cb560d684472ceb6575ee50 Mon Sep 17 00:00:00 2001 From: John Bytheway Date: Fri, 9 Aug 2019 15:51:19 -0400 Subject: [PATCH] Enable bugprone-string-integer-assignment Enable this clang-tidy check and fix related issues. --- .clang-tidy | 1 - src/computer.cpp | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 1c411b33381d9..44cc1538e9aa9 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -19,7 +19,6 @@ performance-*,\ readability-*,\ -bugprone-misplaced-widening-cast,\ -bugprone-narrowing-conversions,\ --bugprone-string-integer-assignment,\ -bugprone-too-small-loop-variable,\ -bugprone-undefined-memory-manipulation,\ -bugprone-unused-return-value,\ diff --git a/src/computer.cpp b/src/computer.cpp index ee45863a2d01f..c1da78ffffdb7 100644 --- a/src/computer.cpp +++ b/src/computer.cpp @@ -1809,15 +1809,15 @@ void computer::print_gibberish_line() for( int i = 0; i < length; i++ ) { switch( rng( 0, 4 ) ) { case 0: - gibberish += '0' + rng( 0, 9 ); + gibberish += static_cast( '0' + rng( 0, 9 ) ); break; case 1: case 2: - gibberish += 'a' + rng( 0, 25 ); + gibberish += static_cast( 'a' + rng( 0, 25 ) ); break; case 3: case 4: - gibberish += 'A' + rng( 0, 25 ); + gibberish += static_cast( 'A' + rng( 0, 25 ) ); break; } }