"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/main.cc" between
gnuchess-6.2.5.tar.gz and gnuchess-6.2.6.tar.gz

About: GNU Chess is a chess-playing program.

main.cc  (gnuchess-6.2.5):main.cc  (gnuchess-6.2.6)
/* GNU Chess 6 - main.cc - entry point /* GNU Chess 6 - main.cc - entry point
Copyright (c) 2001-2017 Free Software Foundation, Inc. Copyright (c) 2001-2020 Free Software Foundation, Inc.
GNU Chess is based on the two research programs GNU Chess is based on the two research programs
Cobalt by Chua Kong-Sian and Gazebo by Stuart Cracraft. Cobalt by Chua Kong-Sian and Gazebo by Stuart Cracraft.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
skipping to change at line 221 skipping to change at line 221
0x0F, 0x1F, 0x3F, 0x7F, 0xFF, 0x7F, 0x3F, 0x1F, 0x0F, 0x1F, 0x3F, 0x7F, 0xFF, 0x7F, 0x3F, 0x1F,
0x1F, 0x3F, 0x7F, 0xFF, 0x7F, 0x3F, 0x1F, 0x0F, 0x1F, 0x3F, 0x7F, 0xFF, 0x7F, 0x3F, 0x1F, 0x0F,
0x3F, 0x7F, 0xFF, 0x7F, 0x3F, 0x1F, 0x0F, 0x07, 0x3F, 0x7F, 0xFF, 0x7F, 0x3F, 0x1F, 0x0F, 0x07,
0x7F, 0xFF, 0x7F, 0x3F, 0x1F, 0x0F, 0x07, 0x03, 0x7F, 0xFF, 0x7F, 0x3F, 0x1F, 0x0F, 0x07, 0x03,
0xFF, 0x7F, 0x3F, 0x1F, 0x0F, 0x07, 0x03, 0x01 }; 0xFF, 0x7F, 0x3F, 0x1F, 0x0F, 0x07, 0x03, 0x01 };
extern char userinputbuf[]; extern char userinputbuf[];
void EndProg( int sig __attribute__ ((unused)) ) void EndProg( int sig __attribute__ ((unused)) )
{ {
system( "stty sane" ); int r = system( "stty sane" ); // TODO Handle return value
exit(0); exit(0);
} }
int main (int argc, char *argv[]) int main (int argc, char *argv[])
{ {
int i; int i;
/* Set locale via LC_ALL. */ /* Set locale via LC_ALL. */
setlocale (LC_ALL, ""); setlocale (LC_ALL, "");
skipping to change at line 324 skipping to change at line 324
opt_manual = 1; opt_manual = 1;
break; break;
case 'M': case 'M':
if ( optarg == NULL ){ /* we have error such as two -M */ if ( optarg == NULL ){ /* we have error such as two -M */
opt_help = 1; opt_help = 1;
break; break;
} }
errno = 0; /* zero error indicator */ errno = 0; /* zero error indicator */
opt_memory = strtol (optarg, &endptr, 10); opt_memory = strtol (optarg, &endptr, 10);
if ( errno != 0 || *endptr != '\0' ){ if ( errno != 0 || *endptr != '\0' ){
printf(_("Memory out of Range or Invalid\n")); printf(_("Memory out of range or invalid.\n"));
return(1); return(1);
} }
break; break;
case '?': /* On error give help - getopt does a basic message. */ case '?': /* On error give help - getopt does a basic message. */
opt_help = 1; opt_help = 1;
break; break;
case 'u': case 'u':
opt_uci = 1; opt_uci = 1;
break; break;
case 'a': case 'a':
if ( optarg == NULL ){ /* we have error such as two -a */ if ( optarg == NULL ){ /* we have error such as two -a */
opt_help = 1; opt_help = 1;
break; break;
} }
errno = 0; /* zero error indicator */ errno = 0; /* zero error indicator */
if ( strlen( optarg ) > MAXSTR ) { if ( strlen( optarg ) > MAXSTR ) {
printf( _("File name is too long (max = %d)\n"), MAXSTR ); printf( _("File name is too long (max = %d).\n"), MAXSTR );
return(1); return(1);
} }
strcpy( opt_addbook, optarg ); strcpy( opt_addbook, optarg );
break; break;
default: default:
puts (_("Option Processing Failed\n")); puts (_("Option processing failed.\n"));
abort(); abort();
} }
} /* end of getopt_long style parsing */ } /* end of getopt_long style parsing */
/* Initialize random number generator */ /* Initialize random number generator */
srand((unsigned int) time(NULL)); srand((unsigned int) time(NULL));
/* initialize control flags */ /* initialize control flags */
flags = ULL(0); flags = ULL(0);
skipping to change at line 393 skipping to change at line 393
if (opt_version == 1) if (opt_version == 1)
return(0); return(0);
/* Startup output */ /* Startup output */
if ( !( flags & XBOARD ) && ( !opt_quiet ) && ( !opt_uci) ) { if ( !( flags & XBOARD ) && ( !opt_quiet ) && ( !opt_uci) ) {
printf ( _("\ printf ( _("\
Copyright (C) %s Free Software Foundation, Inc.\n\ Copyright (C) %s Free Software Foundation, Inc.\n\
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\n\ License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\n\
This is free software: you are free to change and redistribute it.\n\ This is free software: you are free to change and redistribute it.\n\
There is NO WARRANTY, to the extent permitted by law.\n"), There is NO WARRANTY, to the extent permitted by law.\n"),
"2017" ); "2020" );
} }
/* If a usage statement is required output it here */ /* If a usage statement is required output it here */
if (opt_help == 1){ if (opt_help == 1){
cmd_usage(); cmd_usage();
return (1); /* Maybe an error if due to bad arguments. */ return (1); /* Maybe an error if due to bad arguments. */
} }
dbg_open(NULL); dbg_open(NULL);
if ( opt_memory != 0 ) if ( opt_memory != 0 )
; /* TODO: to be removed - this is handled by the adapter */ ; /* TODO: to be removed - this is handled by the adapter */
/* Catch SIGINT to exit. */ /* Catch SIGINT to exit. */
struct sigaction action; struct sigaction action;
memset( &action, 0, sizeof(struct sigaction) ); memset( &action, 0, sizeof(struct sigaction) );
action.sa_handler = EndProg; action.sa_handler = EndProg;
sigaction( SIGINT, &action, NULL ); sigaction( SIGINT, &action, NULL );
Initialize (); Initialize ();
InitFrontend();
if ( ! (flags & UCI ) ) { if ( ! (flags & UCI ) ) {
/* Initialize the frontend */
InitFrontend();
/* Initialize the adapter, which in turn initializes the engine */ /* Initialize the adapter, which in turn initializes the engine */
InitAdapter(); InitAdapter();
} else { } else {
/* Initialize the engine only; no adapter */ /* Initialize the engine only; no adapter */
InitEngine(); InitEngine();
} }
/* Compile book if the addbook option was specified. Ignore any other options. */ /* Compile book if the addbook option was specified. Ignore any other options. */
if ( strlen( opt_addbook ) > 0 ) { if ( strlen( opt_addbook ) > 0 ) {
char data[9+MAXSTR+1+4]=""; char data[9+MAXSTR+1+4]="";
 End of changes. 8 change blocks. 
7 lines changed or deleted 8 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)