mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 00:33:09 +00:00
Fix MinGW warnings
I finally got SF to compile under MinGW (after adding pthread libraries) and here are the fixed warnings. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
19cf779629
commit
d607febb38
3 changed files with 12 additions and 9 deletions
|
@ -325,8 +325,8 @@ const string line_to_san(const Position& pos, Move line[], int startColumn, bool
|
||||||
const string pretty_pv(const Position& pos, int time, int depth,
|
const string pretty_pv(const Position& pos, int time, int depth,
|
||||||
Value score, ValueType type, Move pv[]) {
|
Value score, ValueType type, Move pv[]) {
|
||||||
|
|
||||||
const uint64_t K = 1000;
|
const int64_t K = 1000;
|
||||||
const uint64_t M = 1000000;
|
const int64_t M = 1000000;
|
||||||
|
|
||||||
std::stringstream s;
|
std::stringstream s;
|
||||||
|
|
||||||
|
|
|
@ -310,7 +310,7 @@ namespace {
|
||||||
void extract_pv_from_tt(const Position& pos, Move bestMove, Move pv[]);
|
void extract_pv_from_tt(const Position& pos, Move bestMove, Move pv[]);
|
||||||
|
|
||||||
#if !defined(_MSC_VER)
|
#if !defined(_MSC_VER)
|
||||||
void *init_thread(void *threadID);
|
void* init_thread(void* threadID);
|
||||||
#else
|
#else
|
||||||
DWORD WINAPI init_thread(LPVOID threadID);
|
DWORD WINAPI init_thread(LPVOID threadID);
|
||||||
#endif
|
#endif
|
||||||
|
@ -2144,7 +2144,7 @@ split_point_start: // At split points actual search starts from here
|
||||||
|
|
||||||
#if !defined(_MSC_VER)
|
#if !defined(_MSC_VER)
|
||||||
|
|
||||||
void* init_thread(void *threadID) {
|
void* init_thread(void* threadID) {
|
||||||
|
|
||||||
ThreadsMgr.idle_loop(*(int*)threadID, NULL);
|
ThreadsMgr.idle_loop(*(int*)threadID, NULL);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -2264,7 +2264,7 @@ split_point_start: // At split points actual search starts from here
|
||||||
|
|
||||||
void ThreadsManager::init_threads() {
|
void ThreadsManager::init_threads() {
|
||||||
|
|
||||||
volatile int i;
|
int i, arg[MAX_THREADS];
|
||||||
bool ok;
|
bool ok;
|
||||||
|
|
||||||
// Initialize global locks
|
// Initialize global locks
|
||||||
|
@ -2292,15 +2292,15 @@ split_point_start: // At split points actual search starts from here
|
||||||
// Launch the helper threads
|
// Launch the helper threads
|
||||||
for (i = 1; i < MAX_THREADS; i++)
|
for (i = 1; i < MAX_THREADS; i++)
|
||||||
{
|
{
|
||||||
|
arg[i] = i;
|
||||||
|
|
||||||
#if !defined(_MSC_VER)
|
#if !defined(_MSC_VER)
|
||||||
pthread_t pthread[1];
|
pthread_t pthread[1];
|
||||||
ok = (pthread_create(pthread, NULL, init_thread, (void*)(&i)) == 0);
|
ok = (pthread_create(pthread, NULL, init_thread, (void*)(&arg[i])) == 0);
|
||||||
pthread_detach(pthread[0]);
|
pthread_detach(pthread[0]);
|
||||||
#else
|
#else
|
||||||
ok = (CreateThread(NULL, 0, init_thread, (LPVOID)(&i), 0, NULL) != NULL);
|
ok = (CreateThread(NULL, 0, init_thread, (LPVOID)(&arg[i]), 0, NULL) != NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!ok)
|
if (!ok)
|
||||||
{
|
{
|
||||||
cout << "Failed to create thread number " << i << endl;
|
cout << "Failed to create thread number " << i << endl;
|
||||||
|
|
|
@ -138,7 +138,10 @@ namespace {
|
||||||
else if (token == "d")
|
else if (token == "d")
|
||||||
pos.print();
|
pos.print();
|
||||||
else if (token == "flip")
|
else if (token == "flip")
|
||||||
pos.flipped_copy(Position(pos, pos.thread()));
|
{
|
||||||
|
Position p(pos, pos.thread());
|
||||||
|
pos.flipped_copy(p);
|
||||||
|
}
|
||||||
else if (token == "eval")
|
else if (token == "eval")
|
||||||
{
|
{
|
||||||
Value evalMargin;
|
Value evalMargin;
|
||||||
|
|
Loading…
Add table
Reference in a new issue