From 163fe69ecfa0261b79a049cf8a888defcbccaa64 Mon Sep 17 00:00:00 2001 From: Kevin Granade Date: Fri, 6 Dec 2024 11:43:02 -0800 Subject: [PATCH] Silence some clang-tidy warnings --- src/scores_ui.cpp | 2 +- src/worldfactory.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/scores_ui.cpp b/src/scores_ui.cpp index 6078f427ce948..965354bd14241 100644 --- a/src/scores_ui.cpp +++ b/src/scores_ui.cpp @@ -166,7 +166,7 @@ void scores_ui_impl::init_data() const std::string &symbol = m.sym; nc_color color = m.color; const std::string &name = m.nname(); - monster_kills_data.emplace_back( std::make_tuple( num_kills, symbol, color, name ) ); + monster_kills_data.emplace_back( num_kills, symbol, color, name ); } auto sort_by_count_then_name = []( auto & a, auto & b ) { return diff --git a/src/worldfactory.cpp b/src/worldfactory.cpp index 0a69bcedd1fbe..08df8b2ad2f46 100644 --- a/src/worldfactory.cpp +++ b/src/worldfactory.cpp @@ -307,7 +307,7 @@ bool WORLD::save( const bool is_conversion ) const } if( !is_conversion ) { - const auto savefile = folder_path() / PATH_INFO::worldoptions(); + const cata_path savefile = folder_path() / PATH_INFO::worldoptions(); const bool saved = write_to_file( savefile, [&]( std::ostream & fout ) { JsonOut jout( fout ); @@ -423,7 +423,7 @@ void worldfactory::init() if( newworld->save( true ) ) { const cata_path origin_path = old_world.folder_path(); // move files from origin_path into new world path - for( auto &origin_file : get_files_from_path( ".", origin_path, false ) ) { + for( cata_path &origin_file : get_files_from_path( ".", origin_path, false ) ) { std::string filename = origin_file.get_relative_path().filename().generic_u8string(); if( rename_file( origin_file, ( newworld->folder_path() / filename ) ) ) { @@ -2153,15 +2153,15 @@ void worldfactory::delete_world( const std::string &worldname, const bool delete auto end = std::remove_if( file_paths.begin(), file_paths.end(), isForbidden ); file_paths.erase( end, file_paths.end() ); - for( auto &file_path : file_paths ) { + for( cata_path &file_path : file_paths ) { fs::path folder_path = file_path.get_unrelative_path().parent_path(); - while( folder_path.filename() != worldname ) { + while( folder_path.filename() != fs::u8path( worldname ) ) { directory_paths.insert( folder_path ); folder_path = folder_path.parent_path(); } } - for( auto &file : file_paths ) { + for( cata_path &file : file_paths ) { remove_file( file ); }