]> git.sesse.net Git - stockfish/commitdiff
Fixed some warnings when using -Weffc++ gcc option
authorMarco Costalba <mcostalba@gmail.com>
Sat, 16 Oct 2010 11:52:01 +0000 (13:52 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 16 Oct 2010 14:00:20 +0000 (15:00 +0100)
Plus some other icc warnings popped up with new and strictier
compile options.

No functional and speed change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/Makefile
src/evaluate.cpp
src/material.h
src/pawns.h
src/tt.h
src/types.h

index 3feaf11b7b730a406fa2aad14ad174cbdaf82f7f..b08b15f3272a60fe3168c7d6d121775f0e2dfd7d 100644 (file)
@@ -219,14 +219,14 @@ ifeq ($(COMP),icc)
 endif
 
 ### 3.2 General compiler settings
 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)
 
 ifeq ($(comp),gcc)
-       CXXFLAGS += -pedantic -Wno-long-long -Wextra
+       CXXFLAGS += -ansi -pedantic -Wno-long-long -Wextra
 endif
 
 ifeq ($(comp),icc)
 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)
 endif
 
 ifeq ($(os),osx)
index 0f0034b2101eedd36a546dbb01d7a99be64c745e..e167bb6994f788ec4a81ae12b236d34b78d371c8 100644 (file)
@@ -241,7 +241,7 @@ namespace {
   template<Color Us>
   Score evaluate_passed_pawns(const Position& pos, EvalInfo& ei);
 
   template<Color Us>
   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();
   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();
index 48be349498668af2f4d8e8e63f65f95e16289921..535c216c0742053ecaa852923be264f4d9068e19 100644 (file)
@@ -75,6 +75,9 @@ class EndgameFunctions;
 
 class MaterialInfoTable {
 
 
 class MaterialInfoTable {
 
+  MaterialInfoTable(const MaterialInfoTable&);
+  MaterialInfoTable& operator=(const MaterialInfoTable&);
+
 public:
   MaterialInfoTable();
   ~MaterialInfoTable();
 public:
   MaterialInfoTable();
   ~MaterialInfoTable();
index 0e7ca61d49fbc7de10397608bbe944baf2b1a08f..86708488cb276f6c13ce40d768d7bda7991d3485 100644 (file)
@@ -78,6 +78,9 @@ class PawnInfoTable {
 
   enum SideType { KingSide, QueenSide };
 
 
   enum SideType { KingSide, QueenSide };
 
+  PawnInfoTable(const PawnInfoTable&);
+  PawnInfoTable& operator=(const PawnInfoTable&);
+
 public:
   PawnInfoTable();
   ~PawnInfoTable();
 public:
   PawnInfoTable();
   ~PawnInfoTable();
index 8cba4c87cb5202d4db205dd9d04925cd3685d05f..9babce8cdc9f10e14500c1f9c4e5cdc6a071d033 100644 (file)
--- a/src/tt.h
+++ b/src/tt.h
@@ -102,6 +102,9 @@ struct TTCluster {
 
 class TranspositionTable {
 
 
 class TranspositionTable {
 
+  TranspositionTable(const TranspositionTable&);
+  TranspositionTable& operator=(const TranspositionTable&);
+
 public:
   TranspositionTable();
   ~TranspositionTable();
 public:
   TranspositionTable();
   ~TranspositionTable();
index a85aa7f7292bea9417f8daecf0634f676bab61b1..f6d993d07cf56be595331b9ce3ed5f892559a63b 100644 (file)
@@ -150,10 +150,10 @@ template<typename T>
 inline T operator- (const T d) { OK(T); return T(-int(d)); }
 
 template<typename T>
 inline T operator- (const T d) { OK(T); return T(-int(d)); }
 
 template<typename T>
-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<typename T>
 
 template<typename T>
-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<typename T>
 inline void operator+= (T& d1, const T d2) { OK(T); d1 = d1 + d2; }
 
 template<typename T>
 inline void operator+= (T& d1, const T d2) { OK(T); d1 = d1 + d2; }