mail[Wesnoth-commits] r43858 - in /trunk/src/serialization: preprocessor.cpp preprocessor.hpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by koraq on July 03, 2010 - 12:59:
Author: mordante
Date: Sat Jul  3 12:59:05 2010
New Revision: 43858

URL: http://svn.gna.org/viewcvs/wesnoth?rev=43858&view=rev
Log:
Pass parameter by const ref instead of const value.

Issue found by cppcheck.

Modified:
    trunk/src/serialization/preprocessor.cpp
    trunk/src/serialization/preprocessor.hpp

Modified: trunk/src/serialization/preprocessor.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/serialization/preprocessor.cpp?rev=43858&r1=43857&r2=43858&view=diff
==============================================================================
--- trunk/src/serialization/preprocessor.cpp (original)
+++ trunk/src/serialization/preprocessor.cpp Sat Jul  3 12:59:05 2010
@@ -1003,7 +1003,7 @@
        return new preprocessor_deleter(buf, owned_defines);
 }
 
-void preprocess_resource(const std::string res_name, preproc_map 
*defines_map,
+void preprocess_resource(const std::string& res_name, preproc_map 
*defines_map,
                         bool write_cfg, bool write_plain_cfg,std::string 
target_directory)
 {
        if (is_directory(res_name))
@@ -1013,14 +1013,14 @@
                get_files_in_dir(res_name, &files, &dirs, ENTIRE_FILE_PATH, 
SKIP_MEDIA_DIR, DO_REORDER);
 
                // subdirectories
-               foreach(const std::string dir, dirs)
+               foreach(const std::string& dir, dirs)
                {
                        LOG_PREPROC<<"processing sub-dir: "<<dir<<'\n';
                        
preprocess_resource(dir,defines_map,write_cfg,write_plain_cfg,target_directory);
                }
 
                // files in current directory
-               foreach(const std::string file, files)
+               foreach(const std::string& file, files)
                {
                        
preprocess_resource(file,defines_map,write_cfg,write_plain_cfg,target_directory);
                }

Modified: trunk/src/serialization/preprocessor.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/serialization/preprocessor.hpp?rev=43858&r1=43857&r2=43858&view=diff
==============================================================================
--- trunk/src/serialization/preprocessor.hpp (original)
+++ trunk/src/serialization/preprocessor.hpp Sat Jul  3 12:59:05 2010
@@ -75,7 +75,7 @@
 std::istream *preprocess_file(std::string const &fname,
                               preproc_map *defines = NULL, std::string 
*error_log=NULL);
 
-void preprocess_resource(const std::string res_name, preproc_map 
*defines_map,
+void preprocess_resource(const std::string& res_name, preproc_map 
*defines_map,
                        bool write_cfg=false, bool write_plain_cfg=false, 
std::string target_directory="");
 
 #endif




Related Messages


Powered by MHonArc, Updated Sat Jul 03 13:00:06 2010