]> git.sesse.net Git - stockfish/commitdiff
Move Min() and Max() macros to types.h
authorMarco Costalba <mcostalba@gmail.com>
Sat, 15 Jan 2011 09:47:11 +0000 (10:47 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 15 Jan 2011 10:00:00 +0000 (11:00 +0100)
As usual a bit of cleanup while there...

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/misc.h
src/types.h

index 7cee869cbeeb5978388b1a2ffc630dcfccc86007..55f4afdea244e5069f3d5f180e542982599c6ff2 100644 (file)
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-
 #if !defined(MISC_H_INCLUDED)
 #define MISC_H_INCLUDED
 
 #if !defined(MISC_H_INCLUDED)
 #define MISC_H_INCLUDED
 
-
-////
-//// Includes
-////
-
-#include <fstream>
 #include <string>
 
 #include "types.h"
 
 #include <string>
 
 #include "types.h"
 
-////
-//// Macros
-////
-
-#define Min(x, y) (((x) < (y))? (x) : (y))
-#define Max(x, y) (((x) < (y))? (y) : (x))
-
-
-////
-//// Prototypes
-////
-
 extern const std::string engine_name();
 extern const std::string engine_author();
 extern int get_system_time();
 extern const std::string engine_name();
 extern const std::string engine_author();
 extern int get_system_time();
@@ -51,14 +32,9 @@ extern int input_available();
 extern void prefetch(char* addr);
 extern void prefetchPawn(Key, int);
 
 extern void prefetch(char* addr);
 extern void prefetchPawn(Key, int);
 
-
-////
-//// Debug
-////
-
+// Debug functions
 extern bool dbg_show_mean;
 extern bool dbg_show_hit_rate;
 extern bool dbg_show_mean;
 extern bool dbg_show_hit_rate;
-
 extern void dbg_hit_on(bool b);
 extern void dbg_hit_on_c(bool c, bool b);
 extern void dbg_before();
 extern void dbg_hit_on(bool b);
 extern void dbg_hit_on_c(bool c, bool b);
 extern void dbg_before();
index 29934e9d3b43d3a61939ffd96c853f1996e5f1fa..67e40fffd2c53ba54164c8910f99fd407cdd0a98 100644 (file)
 #if !defined(TYPES_H_INCLUDED)
 #define TYPES_H_INCLUDED
 
 #if !defined(TYPES_H_INCLUDED)
 #define TYPES_H_INCLUDED
 
-#if !defined(_MSC_VER)
-
-#include <inttypes.h>
+#include <cstdlib>
 
 
-#else
+#if defined(_MSC_VER)
 
 // Disable some silly and noisy warning from MSVC compiler
 #pragma warning(disable: 4800) // Forcing value to bool 'true' or 'false'
 #pragma warning(disable: 4127) // Conditional expression is constant
 
 
 // Disable some silly and noisy warning from MSVC compiler
 #pragma warning(disable: 4800) // Forcing value to bool 'true' or 'false'
 #pragma warning(disable: 4127) // Conditional expression is constant
 
+// MSVC does not support <inttypes.h>
 typedef   signed __int8    int8_t;
 typedef unsigned __int8   uint8_t;
 typedef   signed __int16  int16_t;
 typedef   signed __int8    int8_t;
 typedef unsigned __int8   uint8_t;
 typedef   signed __int16  int16_t;
@@ -39,15 +38,18 @@ typedef unsigned __int32 uint32_t;
 typedef   signed __int64  int64_t;
 typedef unsigned __int64 uint64_t;
 
 typedef   signed __int64  int64_t;
 typedef unsigned __int64 uint64_t;
 
-#endif // !defined(_MSC_VER)
+#else
+
+#include <inttypes.h>
 
 
-// Hash keys
-typedef uint64_t Key;
+#endif
 
 
-// Bitboard type
+// Our hash key and bitboard types
+typedef uint64_t Key;
 typedef uint64_t Bitboard;
 
 typedef uint64_t Bitboard;
 
-#include <cstdlib>
+#define Min(x, y) (((x) < (y)) ? (x) : (y))
+#define Max(x, y) (((x) < (y)) ? (y) : (x))
 
 ////
 //// Configuration
 
 ////
 //// Configuration