lucasart wrote:
thanks!
i'll compile it and run it in my open source bullet rating list
=> results available tomorrow in the tournament forum
I couldn't compile it on Linux with g++. Here are all the warnings and errors, with solutions
Code: Select all
./eval/eval_pieces.c:110:20: warning: "/*" within comment [-Wcomment]
self explanatory
Code: Select all
./parser.c: In member function ‘void sParser::UciLoop()’:
./parser.c:58:27: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./parser.c: In member function ‘void sParser::ParsePosition(sPosition*, char*)’:
./parser.c:180:29: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
The ISO C++ standard declares the char * cast of an std::string as deprecated. It may compile now, but it will not compile in ISO C++ 2011. The correct way to do it is to use .c_str() instead of an implicit cast.
Code: Select all
./timer.c: In member function ‘void sTimer::Waste(int)’:
./timer.c:118:24: error: ‘nanosleep’ was not declared in this scope
I'm not sure why you need a sleep function in your program. Anyway nanosleep is indeed a POSIX function, but it's in <time.h>, not <sys/time.h>
Also the argument is not an int but a struct. Have a look here on how to use nanosleep (basically you need to specify a struct with seconds and nanoseconds)
http://linux.die.net/man/2/nanosleep
Code: Select all
./search/report.c:23:21: fatal error: windows.h: No such file or directory
compilation terminated.
Obviously this can only work under Windows. I'm not sure what windows.h is need for in search.c, but if you can do without, just protect this section with a
Code: Select all
#if defined(_WIN32) || defined(_WIN64)
the same way you did in timer.c
Code: Select all
./search/quiescence.c: In member function ‘int sSearcher::Quiesce(sPosition*, int, int, int, int, int*)’:
./search/quiescence.c:64:39: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
./search/search.c: In member function ‘int sSearcher::Search(sPosition*, int, int, int, int, int, int, int, int*)’:
./search/search.c:242:63: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
./search/search.c: In member function ‘int sSearcher::CountLegalMoves(sPosition*, int)’:
./search/search.c:442:50: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
self explanatory
With these fixes, your code should be compilable on Linux, MacOSX and Android, for example. So it would be nice to include them, unless you're not interested in portability and prefer to focus on Windows only, which is a shame of course