From 5b68f01e62f4e2167982ad7acf3e1364e1ec6ec4 Mon Sep 17 00:00:00 2001 From: Aleksey Lobanov Date: Sat, 13 Jun 2015 08:29:32 +0300 Subject: [PATCH] srand() moved from crossgen.hpp to wxCrossGen/main.cpp --- CrossGen.workspace | 4 ++-- Makefile | 8 ++++---- src/crossgen.hpp | 1 - wxCrossGen/main.cpp | 1 + wxCrossGen/wxCrossGen.mk | 20 ++++++++++---------- wxCrossGen/wxCrossGen.txt | 2 +- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/CrossGen.workspace b/CrossGen.workspace index 18ecac8..7998249 100644 --- a/CrossGen.workspace +++ b/CrossGen.workspace @@ -1,7 +1,7 @@ - - + + diff --git a/Makefile b/Makefile index 73e2032..c1fa320 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ .PHONY: clean All All: - @echo "----------Building project:[ CrossBench - Debug ]----------" - @cd "CrossBench" && $(MAKE) -f "CrossBench.mk" + @echo "----------Building project:[ wxCrossGen - Release ]----------" + @cd "wxCrossGen" && $(MAKE) -f "wxCrossGen.mk" clean: - @echo "----------Cleaning project:[ CrossBench - Debug ]----------" - @cd "CrossBench" && $(MAKE) -f "CrossBench.mk" clean + @echo "----------Cleaning project:[ wxCrossGen - Release ]----------" + @cd "wxCrossGen" && $(MAKE) -f "wxCrossGen.mk" clean diff --git a/src/crossgen.hpp b/src/crossgen.hpp index 15eb03d..27d4074 100644 --- a/src/crossgen.hpp +++ b/src/crossgen.hpp @@ -187,7 +187,6 @@ void generateCross(GridType &grid, const DictType &dict, std::vector & winfos.at(i).x,winfos.at(i).y,winfos.at(i).len, winfos.at(i).ind, int(winfos.at(i).direct)); UsedWords t_used; - srand(time(NULL)); procCross(t_used, words, grid, winfos, 0, words_out); std::reverse(words_out.begin(), words_out.end()); } diff --git a/wxCrossGen/main.cpp b/wxCrossGen/main.cpp index a076c10..8083fe5 100644 --- a/wxCrossGen/main.cpp +++ b/wxCrossGen/main.cpp @@ -29,6 +29,7 @@ MainFrame::MainFrame(wxWindow* parent, int id, const wxString& title, const wxPo do_layout(); _isDictLoaded = false; + srand(time(NULL)); } diff --git a/wxCrossGen/wxCrossGen.mk b/wxCrossGen/wxCrossGen.mk index 3ee55b8..88353a4 100644 --- a/wxCrossGen/wxCrossGen.mk +++ b/wxCrossGen/wxCrossGen.mk @@ -2,18 +2,18 @@ ## Auto Generated makefile by CodeLite IDE ## any manual changes will be erased ## -## Debug +## Release ProjectName :=wxCrossGen -ConfigurationName :=Debug +ConfigurationName :=Release WorkspacePath := "/data/Sync/SyncProjects/CrossGen" ProjectPath := "/data/Sync/SyncProjects/CrossGen/wxCrossGen" -IntermediateDirectory :=./Debug +IntermediateDirectory :=../Release OutDir := $(IntermediateDirectory) CurrentFileName := CurrentFilePath := CurrentFileFullPath := User :=Aleksey Lobanov -Date :=12/06/15 +Date :=13/06/15 CodeLitePath :="/home/alex/.codelite" LinkerName :=/usr/bin/g++-4.8 SharedObjectLinkerName :=/usr/bin/g++-4.8 -shared -fPIC @@ -28,14 +28,14 @@ LibraryPathSwitch :=-L PreprocessorSwitch :=-D SourceSwitch :=-c OutputFile :=$(IntermediateDirectory)/$(ProjectName).out -Preprocessors := +Preprocessors :=$(PreprocessorSwitch)NDEBUG ObjectSwitch :=-o ArchiveOutputSwitch := PreprocessOnlySwitch :=-E ObjectsFileList :="wxCrossGen.txt" PCHCompileFlags := MakeDirCommand :=mkdir -p -LinkOptions := $(shell wx-config --debug=yes --libs --unicode=yes) +LinkOptions := -s $(shell wx-config --debug=no --libs --unicode=yes) IncludePath := $(IncludeSwitch). $(IncludeSwitch)../src IncludePCH := RcIncludePath := @@ -50,8 +50,8 @@ LibPath := $(LibraryPathSwitch). AR := /usr/bin/ar rcu CXX := /usr/bin/g++-4.8 CC := /usr/bin/gcc-4.8 -CXXFLAGS := -std=c++11 -g -O0 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=yes) $(Preprocessors) -CFLAGS := -g -O0 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=yes) $(Preprocessors) +CXXFLAGS := -std=c++11 -O2 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=no) $(Preprocessors) +CFLAGS := -O2 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=no) $(Preprocessors) ASFLAGS := AS := /usr/bin/as @@ -79,7 +79,7 @@ $(OutputFile): $(IntermediateDirectory)/.d $(Objects) $(LinkerName) $(OutputSwitch)$(OutputFile) @$(ObjectsFileList) $(LibPath) $(Libs) $(LinkOptions) $(IntermediateDirectory)/.d: - @test -d ./Debug || $(MakeDirCommand) ./Debug + @test -d ../Release || $(MakeDirCommand) ../Release PreBuild: @@ -101,6 +101,6 @@ $(IntermediateDirectory)/main.cpp$(PreprocessSuffix): main.cpp ## Clean ## clean: - $(RM) -r ./Debug/ + $(RM) -r ../Release/ diff --git a/wxCrossGen/wxCrossGen.txt b/wxCrossGen/wxCrossGen.txt index 6716386..b7e8d8a 100644 --- a/wxCrossGen/wxCrossGen.txt +++ b/wxCrossGen/wxCrossGen.txt @@ -1 +1 @@ -./Debug/main.cpp.o +../Release/main.cpp.o