r164: *** empty log message ***
[ctsim.git] / libctgraphics / ezpol.cpp
index 54932f38f96185ff3758b3a0eff7a11fdee62c63..d93e0063e1fb86f0ec7b3fb45253b8d0dc68d33d 100644 (file)
@@ -1,8 +1,12 @@
 /*****************************************************************************
+** FILE IDENTIFICATION
+**
+**   POL - Problem Oriented Language                   
+**
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: ezpol.cpp,v 1.1 2000/06/19 18:05:03 kevin Exp $
+**  $Id: ezpol.cpp,v 1.3 2000/07/13 07:03:21 kevin Exp $
 **
 **  This program is free software; you can redistribute it and/or modify
 **  it under the terms of the GNU General Public License (version 2) as
 **  along with this program; if not, write to the Free Software
 **  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 ******************************************************************************/
-/*----------------------------------------------------------------------*/
-/*                     POL - Problem Oriented Language                 */
 /*                                                                     */
 /*----------------------------------------------------------------------*/
 
 #include <math.h>
-#include "ascii.h"
-#include "stdio.h"
-#include "kstddef.h"
-#include "ctype.h"
+#include <stdio.h>
+#include <ctype.h>
+#include "ctsupport.h"
 #include "pol.h"
 
-#define HASHSIZE 20
 
-/* Tables words stored with install() & found with lookup() */
+static const int HASHSIZE=20;
 
+
+/* Tables words stored with install() & found with lookup() */
 static SYMBOL *skiptable[HASHSIZE];            /* words to ignore and skip */
 static SYMBOL *cmdtable[HASHSIZE];             /* pol parameter commands */
 static SYMBOL *usertable[HASHSIZE];            /* user defined symbols */
@@ -103,8 +105,6 @@ static struct key cmdlist[] = {
 
 #define NUMCMD (sizeof(cmdlist) / sizeof (struct key))
 
-static int ignorecase = TRUE;
-
 static int skiptok(char term[]);
 static int pol_tok(struct token_st *token);
 static void dumptok(struct token_st *token);
@@ -136,8 +136,6 @@ static void ungets(char *s);
 
 void pol_init (void)
 {
-       int i;
-
        meta.eoc    = SEMICOL;
        meta.str    = DQUOTE;
        meta.com    = SHARP;
@@ -155,7 +153,7 @@ void pol_init (void)
        inittable (usertable);
        inittable (skiptable);
 
-       for (i = 0; i < NUMCMD; i++)
+       for (unsigned int i = 0; i < NUMCMD; i++)
            install (cmdtable, cmdlist[i].keyword, cmdlist[i].code);
 
        token.ready = FALSE;            /* no token read yet */
@@ -1093,16 +1091,16 @@ int pol_lookchar(void)
 
 int pol_inchar(void)
 {
-       int c;
+  int c = 0;
 
-       if (currentf < 0)
-           return (EOF);
+  if (currentf < 0)
+    return (EOF);
 
-       while (currentf >= 0 && (c = pol_getch(filep[currentf])) == EOF && filep[currentf] != NULL) {
-          pol_closefile ();
-       }
+  while (currentf >= 0 && (c = pol_getch(filep[currentf])) == EOF && filep[currentf] != NULL) {
+    pol_closefile ();
+  }
 
-       return (c);
+  return (c);
 }
 
 /*--------------------------------------------------------------*/