1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-07-11 19:49:14 +00:00

Move Min() and Max() macros to types.h

As usual a bit of cleanup while there...

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba 2011-01-15 10:47:11 +01:00
parent 3bb1ab34e4
commit 13a42284b6
2 changed files with 12 additions and 34 deletions

View file

@ -17,32 +17,13 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#if !defined(MISC_H_INCLUDED)
#define MISC_H_INCLUDED
////
//// Includes
////
#include <fstream>
#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();
@ -51,14 +32,9 @@ extern int input_available();
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 void dbg_hit_on(bool b);
extern void dbg_hit_on_c(bool c, bool b);
extern void dbg_before();

View file

@ -20,16 +20,15 @@
#if !defined(TYPES_H_INCLUDED)
#define TYPES_H_INCLUDED
#if !defined(_MSC_VER)
#include <cstdlib>
#include <inttypes.h>
#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
// MSVC does not support <inttypes.h>
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;
#endif // !defined(_MSC_VER)
#else
// Hash keys
#include <inttypes.h>
#endif
// Our hash key and bitboard types
typedef uint64_t Key;
// Bitboard type
typedef uint64_t Bitboard;
#include <cstdlib>
#define Min(x, y) (((x) < (y)) ? (x) : (y))
#define Max(x, y) (((x) < (y)) ? (y) : (x))
////
//// Configuration