From: Marco Costalba Date: Sat, 16 Oct 2010 11:52:01 +0000 (+0200) Subject: Fixed some warnings when using -Weffc++ gcc option X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=85a7456bd7e8a1a01cdbfa8f4b6fb563d15a37c6;ds=sidebyside Fixed some warnings when using -Weffc++ gcc option Plus some other icc warnings popped up with new and strictier compile options. No functional and speed change. Signed-off-by: Marco Costalba --- diff --git a/src/Makefile b/src/Makefile index 3feaf11b..b08b15f3 100644 --- a/src/Makefile +++ b/src/Makefile @@ -219,14 +219,14 @@ ifeq ($(COMP),icc) endif ### 3.2 General compiler settings -CXXFLAGS = -g -Wall -Wcast-qual -ansi -fno-exceptions -fno-rtti $(EXTRACXXFLAGS) +CXXFLAGS = -g -Wall -Wcast-qual -fno-exceptions -fno-rtti $(EXTRACXXFLAGS) ifeq ($(comp),gcc) - CXXFLAGS += -pedantic -Wno-long-long -Wextra + CXXFLAGS += -ansi -pedantic -Wno-long-long -Wextra endif ifeq ($(comp),icc) - CXXFLAGS += -wd383,869,981,10187,10188,11505,11503 + CXXFLAGS += -wd383,981,10187,10188,11505,11503 -Wcheck -Wabi -Wdeprecated -strict-ansi endif ifeq ($(os),osx) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 0f0034b2..e167bb69 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -241,7 +241,7 @@ namespace { template Score evaluate_passed_pawns(const Position& pos, EvalInfo& ei); - Score apply_weight(Score v, Score weight); + inline Score apply_weight(Score v, Score weight); Value scale_by_game_phase(const Score& v, Phase ph, ScaleFactor sf); Score weight_option(const std::string& mgOpt, const std::string& egOpt, Score internalWeight); void init_safety(); diff --git a/src/material.h b/src/material.h index 48be3494..535c216c 100644 --- a/src/material.h +++ b/src/material.h @@ -75,6 +75,9 @@ class EndgameFunctions; class MaterialInfoTable { + MaterialInfoTable(const MaterialInfoTable&); + MaterialInfoTable& operator=(const MaterialInfoTable&); + public: MaterialInfoTable(); ~MaterialInfoTable(); diff --git a/src/pawns.h b/src/pawns.h index 0e7ca61d..86708488 100644 --- a/src/pawns.h +++ b/src/pawns.h @@ -78,6 +78,9 @@ class PawnInfoTable { enum SideType { KingSide, QueenSide }; + PawnInfoTable(const PawnInfoTable&); + PawnInfoTable& operator=(const PawnInfoTable&); + public: PawnInfoTable(); ~PawnInfoTable(); diff --git a/src/tt.h b/src/tt.h index 8cba4c87..9babce8c 100644 --- a/src/tt.h +++ b/src/tt.h @@ -102,6 +102,9 @@ struct TTCluster { class TranspositionTable { + TranspositionTable(const TranspositionTable&); + TranspositionTable& operator=(const TranspositionTable&); + public: TranspositionTable(); ~TranspositionTable(); diff --git a/src/types.h b/src/types.h index a85aa7f7..f6d993d0 100644 --- a/src/types.h +++ b/src/types.h @@ -150,10 +150,10 @@ template inline T operator- (const T d) { OK(T); return T(-int(d)); } template -inline void operator++ (T& d, int) { OK(T); d = T(int(d) + 1); } +inline T operator++ (T& d, int) { OK(T); d = T(int(d) + 1); return d; } template -inline void operator-- (T& d, int) { OK(T); d = T(int(d) - 1); } +inline T operator-- (T& d, int) { OK(T); d = T(int(d) - 1); return d; } template inline void operator+= (T& d1, const T d2) { OK(T); d1 = d1 + d2; }