Code: Select all
void post_stat_thinking(void)
{
/* post our thinking output: */
long int elapsed;
elapsed = rdifftime (rtime (), start_time);
printf ("stat01: %ld %ld %d 0 0\n", elapsed, nodes, i_depth);
Moderator: Ras
Code: Select all
void post_stat_thinking(void)
{
/* post our thinking output: */
long int elapsed;
elapsed = rdifftime (rtime (), start_time);
printf ("stat01: %ld %ld %d 0 0\n", elapsed, nodes, i_depth);
Code: Select all
762 int interrupt(void)
763 {
764 int c;
765
766 #ifndef ANSI
767
768 #ifndef WIN32
769
770 int bioskey (void) {
771
772 fd_set readfds;
773
774 FD_ZERO (&readfds);
775 FD_SET (fileno (stdin), &readfds);
776 tv.tv_sec=0; tv.tv_usec=0;
777 select (16, &readfds, 0, 0, &tv);
778 if (FD_ISSET (fileno (stdin), &readfds));
779 {
780 c = getc(stdin);
781
782 if (c == '?') /*Move now*/
783 {
784 return 1;
785 }
786 else if (c == '.') /* Stat request */
787 {
788 getc(stdin);
789 post_stat_thinking();
790 return 0;
791 }
792
793 ungetc(c, stdin);
794
795 if (!is_pondering) return 0;
796
797 return 1;
798 }
799 else return 0;
800#else
801#undef frame
802#include <windows.h>
803#define frame 0
804
805 int bioskey (void) {
806
807 static int init = 0, pipe;
808 static HANDLE inh;
809 DWORD dw;
810 if(xb_mode) { // winboard interrupt code taken from crafty
811 if (!init) {
812 init = 1;
813 inh = GetStdHandle(STD_INPUT_HANDLE);
814 pipe = !GetConsoleMode(inh, &dw);
815 if (!pipe) {
816 SetConsoleMode(inh, dw & ~(ENABLE_MOUSE_INPUT|ENABLE_WINDOW_INPUT));
817 FlushConsoleInputBuffer(inh);
818 FlushConsoleInputBuffer(inh);
819 }
820 }
821 if(pipe) {
822 if(!PeekNamedPipe(inh, NULL, 0, NULL, &dw, NULL))
823 {
824 c = getc(stdin);
825
826 if (c == '?') /*Move now*/
827 {
828 return 1;
829 }
830 else if (c == '.') /* Stat request */
831 {
832 getc(stdin);
833 post_stat_thinking();
834 return 0;
835 }
836
837 ungetc(c, stdin);
838
839 if (!is_pondering) return 0;
840
841 return 1;
842 }
843 if (dw)
844 {
845 c = getc(stdin);
846
847 if (c == '?') /*Move now*/
848 {
849 return 1;
850 }
851 else if (c == '.') /* Stat request */
852 {
853 getc(stdin);
854 post_stat_thinking();
855 return 0;
856 }
857
858 ungetc(c, stdin);
859
860 if (!is_pondering) return 0;
861
862 return 1;
863 }
864 else return 0;
865 } else {
866 GetNumberOfConsoleInputEvents(inh, &dw);
867 if (dw <= 1)
868 {
869 return 0;
870 }
871 else
872 {
873 c = getc(stdin);
874
875 if (c == '?') /*Move now*/
876 {
877 return 1;
878 }
879 else if (c == '.') /* Stat request */
880 {
881 getc(stdin);
882 post_stat_thinking();
883 return 0;
884 }
885
886 ungetc(c, stdin);
887
888 if (!is_pondering) return 0;
889
890 return 1;
891 };
892 }
893 }
894#else
895#endif
896#endif
897
898 return 0;
899}
900
Line 778 has an extraneous semicolonoutAtime wrote:I really dont know where to find that. Im surprised it even worked to 3 ply the first time, actually. Ive been trying to update with some different code, but Im getting parse errors and stuff when I try to compile it.Compiler says: In function 'bioskey':Code: Select all
762 int interrupt(void) 763 { 764 int c; 765 766 #ifndef ANSI 767 768 #ifndef WIN32 769 770 int bioskey (void) { 771 772 fd_set readfds; 773 774 FD_ZERO (&readfds); 775 FD_SET (fileno (stdin), &readfds); 776 tv.tv_sec=0; tv.tv_usec=0; 777 select (16, &readfds, 0, 0, &tv); 778 if (FD_ISSET (fileno (stdin), &readfds)); 779 { 780 c = getc(stdin); 781 782 if (c == '?') /*Move now*/ 783 { 784 return 1; 785 } 786 else if (c == '.') /* Stat request */ 787 { 788 getc(stdin); 789 post_stat_thinking(); 790 return 0; 791 } 792 793 ungetc(c, stdin); 794 795 if (!is_pondering) return 0; 796 797 return 1; 798 } 799 else return 0; 800#else 801#undef frame 802#include <windows.h> 803#define frame 0 804 805 int bioskey (void) { 806 807 static int init = 0, pipe; 808 static HANDLE inh; 809 DWORD dw; 810 if(xb_mode) { // winboard interrupt code taken from crafty 811 if (!init) { 812 init = 1; 813 inh = GetStdHandle(STD_INPUT_HANDLE); 814 pipe = !GetConsoleMode(inh, &dw); 815 if (!pipe) { 816 SetConsoleMode(inh, dw & ~(ENABLE_MOUSE_INPUT|ENABLE_WINDOW_INPUT)); 817 FlushConsoleInputBuffer(inh); 818 FlushConsoleInputBuffer(inh); 819 } 820 } 821 if(pipe) { 822 if(!PeekNamedPipe(inh, NULL, 0, NULL, &dw, NULL)) 823 { 824 c = getc(stdin); 825 826 if (c == '?') /*Move now*/ 827 { 828 return 1; 829 } 830 else if (c == '.') /* Stat request */ 831 { 832 getc(stdin); 833 post_stat_thinking(); 834 return 0; 835 } 836 837 ungetc(c, stdin); 838 839 if (!is_pondering) return 0; 840 841 return 1; 842 } 843 if (dw) 844 { 845 c = getc(stdin); 846 847 if (c == '?') /*Move now*/ 848 { 849 return 1; 850 } 851 else if (c == '.') /* Stat request */ 852 { 853 getc(stdin); 854 post_stat_thinking(); 855 return 0; 856 } 857 858 ungetc(c, stdin); 859 860 if (!is_pondering) return 0; 861 862 return 1; 863 } 864 else return 0; 865 } else { 866 GetNumberOfConsoleInputEvents(inh, &dw); 867 if (dw <= 1) 868 { 869 return 0; 870 } 871 else 872 { 873 c = getc(stdin); 874 875 if (c == '?') /*Move now*/ 876 { 877 return 1; 878 } 879 else if (c == '.') /* Stat request */ 880 { 881 getc(stdin); 882 post_stat_thinking(); 883 return 0; 884 } 885 886 ungetc(c, stdin); 887 888 if (!is_pondering) return 0; 889 890 return 1; 891 }; 892 } 893 } 894#else 895#endif 896#endif 897 898 return 0; 899} 900
799: error: parse error before 'else'
894:2: #else after #else
768:1: the conditional began here
In function 'interrupt':
899: parse error at end of input
It was doing 3 ply and then stopping the search before, now Im not sure what to do next, except to try and debug the code a bit. I could use any advice about where these parse errors, etc.. might be caused.
Dang, had to put in the line numbers!