XBoard: split printing of the features line for clarity.
[gnushogi.git] / gnushogi / main.c
index 2dd78b8..d9fae21 100644 (file)
@@ -4,6 +4,7 @@
  * ----------------------------------------------------------------------
  * Copyright (c) 1993, 1994, 1995 Matthias Mutz
  * Copyright (c) 1999 Michael Vanier and the Free Software Foundation
+ * Copyright (c) 2008, 2013, 2014 Yann Dirson and the Free Software Foundation
  *
  * GNU SHOGI is based on GNU CHESS
  *
@@ -80,17 +81,14 @@ main (int argc, char **argv)
                 binbookfile = NULL;
 #endif
             }
-
             break;
 
 #ifdef BINBOOK
         case 'B':
             argc--;
             argv++;
-
             if (argc > 0)
                 binbookfile = argv[0];
-
             break;
 #endif
 
@@ -98,7 +96,7 @@ main (int argc, char **argv)
         case 'C':
             /* Curses interface. */
             display_type = DISPLAY_CURSES;
-
+            dsp = &curses_display;
             break;
 #endif
 
@@ -107,17 +105,14 @@ main (int argc, char **argv)
             hash = ((argv[0][0] == '-') ? false : true);
             break;
 
-
         case 'l':
             argc--;
             argv++;
 
             if (argc > 0)
                 Lang = argv[0];
-
             break;
 
-
         case 'L':
             argc--;
             argv++;
@@ -126,34 +121,28 @@ main (int argc, char **argv)
                 strcpy(listfile, argv[0]);
             break;
 
-
         case 's':
             argc--;
             argv++;
 
             if (argc > 0)
                 strcpy(savefile, argv[0]);
-
             break;
 
-
         case 'P':
             argc--;
             argv++;
 
             if (argc > 0)
                 bookmaxply = atoi(argv[0]);
-
             break;
 
-
         case 'R':
             /* Raw text interface. */
             display_type = DISPLAY_RAW;
-
+            dsp = &raw_display;
             break;
 
-
         case 'S':
             argc--;
             argv++;
@@ -169,23 +158,18 @@ main (int argc, char **argv)
 
             if (argc > 0)
                 rehash = atoi(argv[0]);
-
             if (rehash > MAXrehash)
                 rehash = MAXrehash;
-
             break;
 
-
         case 'T':
             argc--;
             argv++;
 
             if (argc > 0)
                 ttblsize = atoi(argv[0]);
-
-            if ((ttblsize <= MINTTABLE))
+            if (ttblsize <= MINTTABLE)
                 ttblsize = (MINTTABLE) + 1;
-
             break;
 
 #ifdef HASHFILE
@@ -229,7 +213,6 @@ main (int argc, char **argv)
 
             return 0;
 
-
         case 't':   /* Create or test persistent transposition table. */
             hashfile = fopen(HASHFILE, RWA_ACC);
 
@@ -271,7 +254,7 @@ main (int argc, char **argv)
                     }
                 }
 
-                printf("The file contains %d entries out of max %d\n", nr[0], i);
+                printf("The file contains %d entries out of max %ld\n", nr[0], i);
 
                 for (j = 1; j < MAXDEPTH; j++)
                     printf("%d ", nr[j]);
@@ -281,7 +264,6 @@ main (int argc, char **argv)
 
             return 0;
 
-
 #endif /* HASHFILE */
 #endif /* ttblsz */
 
@@ -293,20 +275,17 @@ main (int argc, char **argv)
         case 'X':
             /* X interface. */
             display_type = DISPLAY_X;
-
+            dsp = &raw_display;
             break;
 
-
         case 'x':
             argc--;
             argv++;
 
             if (argc > 0)
                 xwin = argv[0];
-
             break;
 
-
         default:
             fputs("Usage: gnushogi [-a] [-t] [-c size] [-s savefile][-l listfile] [-x xwndw]\n", stderr);
             exit(1);