diff --git a/Makefile b/Makefile index 92e28a9..24a8624 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -CXXFLAGS=-g -std=c++11 +CXXFLAGS=-g -std=c++11 -Wall -O4 SRCS = v6502.cpp trans.cpp SegmentCache.cpp TransNetwork.cpp Trace.cpp Circuit.cpp StateCalculator.cpp Cpu6502.cpp OBJS = $(SRCS:.cpp=.o) diff --git a/SegmentCache.h b/SegmentCache.h index 83c1f0d..c004a40 100644 --- a/SegmentCache.h +++ b/SegmentCache.h @@ -17,10 +17,11 @@ class SegmentCache { public: - SegmentCache() { + SegmentCache() : c(nullptr) { } virtual ~SegmentCache() { + delete this->c; } Segment* getOrAdd(const std::string& id); @@ -162,11 +163,11 @@ public: P0(P0), P1(P1), P2(P2), P3(P3), P4(P4), /* no P5 */ P6(P6), P7(P7), S0(S0), S1(S1), S2(S2), S3(S3), S4(S4), S5(S5), S6(S6), S7(S7) { } - ~Common(); + ~Common() {} private: - Common(const Common&); - Common& operator=(const Common&); + Common(const Common&) = delete; + Common& operator=(const Common&) = delete; }; void initCommon(); @@ -186,8 +187,8 @@ public: private: std::map > cache; - SegmentCache(const SegmentCache&); - SegmentCache& operator=(const SegmentCache&); + SegmentCache(const SegmentCache&) = delete; + SegmentCache& operator=(const SegmentCache&) = delete; }; #endif /* SEGMENTCACHE_H */ diff --git a/trans.h b/trans.h index 8d1c4c2..c7238a0 100644 --- a/trans.h +++ b/trans.h @@ -19,9 +19,9 @@ public: std::set gates; std::set c1c2s; - bool pullup; - bool pulldown; bool on; + bool pulldown; + bool pullup; bool vss; bool vcc; @@ -48,7 +48,7 @@ public: public: - Trans(Segment* c1, Segment* gate, Segment* c2) : on(false), c1(c1), gate(gate), c2(c2) { + Trans(Segment* c1, Segment* gate, Segment* c2) : c1(c1), gate(gate), c2(c2), on(false) { c1->c1c2s.insert(this); gate->gates.insert(this); c2->c1c2s.insert(this);