From c1eb60d5c3d32ffd7c1db8228b30ed6411a95705 Mon Sep 17 00:00:00 2001 From: Aleksey Lobanov Date: Tue, 23 Jun 2015 10:39:31 +0300 Subject: [PATCH] Improvements by Cppcheck --- Makefile | 8 -------- src/crossexport.cpp | 2 +- src/crossexport.hpp | 2 +- src/crossgen.cpp | 4 ++-- src/crossgen.hpp | 4 ++-- wxCrossGen/wxCrossGen.txt | 2 +- 6 files changed, 7 insertions(+), 15 deletions(-) delete mode 100644 Makefile diff --git a/Makefile b/Makefile deleted file mode 100644 index c1fa320..0000000 --- a/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -.PHONY: clean All - -All: - @echo "----------Building project:[ wxCrossGen - Release ]----------" - @cd "wxCrossGen" && $(MAKE) -f "wxCrossGen.mk" -clean: - @echo "----------Cleaning project:[ wxCrossGen - Release ]----------" - @cd "wxCrossGen" && $(MAKE) -f "wxCrossGen.mk" clean diff --git a/src/crossexport.cpp b/src/crossexport.cpp index d058b0a..215b666 100644 --- a/src/crossexport.cpp +++ b/src/crossexport.cpp @@ -63,7 +63,7 @@ void exportToString(const FilledCrossword &cross, wxString &str_out, wxChar spac str_out += getGridString(cross, space) + getQuesString(cross); } -bool exportToFile(const FilledCrossword &cross, const wxString path){ +bool exportToFile(const FilledCrossword &cross, const wxString &path){ wxTextFile f(path); if ( f.Exists() ) return false; diff --git a/src/crossexport.hpp b/src/crossexport.hpp index 667f4fb..2412842 100644 --- a/src/crossexport.hpp +++ b/src/crossexport.hpp @@ -15,6 +15,6 @@ wxString getQuesString(const FilledCrossword &cross); void exportToString(const FilledCrossword &cross, wxString &str_out, wxChar space); -bool exportToFile(const FilledCrossword &cross, const wxString path); +bool exportToFile(const FilledCrossword &cross, const wxString &path); #endif // CROSSEXPORT_HPP diff --git a/src/crossgen.cpp b/src/crossgen.cpp index a1f110d..b62c5f5 100644 --- a/src/crossgen.cpp +++ b/src/crossgen.cpp @@ -7,7 +7,7 @@ const TransedChar TRANS_CLEAR = 0; const TransedChar TRANS_BORDER = 1; const uint32_t MAX_WORD_COUNT = 262144; // =2^18 -void readDict(const wxString path, DictType &dict_out){ +void readDict(const wxString &path, DictType &dict_out){ wxTextFile f; f.Open(path); for (wxString str = f.GetFirstLine(); !f.Eof(); str = f.GetNextLine()) { @@ -19,7 +19,7 @@ void readDict(const wxString path, DictType &dict_out){ f.Close(); }; -void readGrid(const wxString path, GridType &grid){ +void readGrid(const wxString &path, GridType &grid){ wxTextFile f; f.Open(path); wxString str = f.GetFirstLine(); diff --git a/src/crossgen.hpp b/src/crossgen.hpp index 0af6d1d..6353c9c 100644 --- a/src/crossgen.hpp +++ b/src/crossgen.hpp @@ -17,9 +17,9 @@ extern const TransedChar TRANS_CLEAR ; extern const TransedChar TRANS_BORDER ; extern const uint32_t MAX_WORD_COUNT ; -void readDict(const wxString path, DictType &dict_out); +void readDict(const wxString &path, DictType &dict_out); -void readGrid(const wxString path, GridType &grid); +void readGrid(const wxString &path, GridType &grid); wxString getFromTransed(const TransedWord &tw, const BackedCharsTransType &bchar_trans); diff --git a/wxCrossGen/wxCrossGen.txt b/wxCrossGen/wxCrossGen.txt index 0208c0b..37eff4d 100644 --- a/wxCrossGen/wxCrossGen.txt +++ b/wxCrossGen/wxCrossGen.txt @@ -1 +1 @@ -../Release/main.cpp.o ../Release/fmain.cpp.o ../Release/fsettings.cpp.o ../Release/src_crossexport.cpp.o ../Release/src_crossgen.cpp.o ../Release/fbgui_fbgui.cpp.o +./Debug/main.cpp.o ./Debug/fmain.cpp.o ./Debug/fsettings.cpp.o ./Debug/src_crossexport.cpp.o ./Debug/src_crossgen.cpp.o ./Debug/fbgui_fbgui.cpp.o