6c7e7ed
--- 2nash.c.orig	2018-07-02 22:31:59.000000000 -0600
6c7e7ed
+++ 2nash.c	2018-10-31 14:50:29.603725443 -0600
6c7e7ed
@@ -9,6 +9,7 @@
6c7e7ed
 #include <unistd.h>
6c7e7ed
 #include <stdio.h>
6c7e7ed
 #include <signal.h>
6c7e7ed
+#include <fcntl.h>
cedfb60
 
cedfb60
        int main(int argc, char *argv[])
cedfb60
 	       {
6c7e7ed
@@ -28,14 +29,16 @@
cedfb60
 		      if(cpid[l-1] == 0) {
cedfb60
 			 //forked threads
cedfb60
 			// n= sprintf(buffer, "lrs %s > out%i", argv[l], l);
36fd7e5
+			 sprintf(buffer, "out%i", l);
cedfb60
+			 int fd = creat(buffer, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
Jerry James 09e7566
+			 dup2(fd, 1);
cedfb60
                          if(l==1) {
cdd8664
-                              int n= sprintf(buffer, "lrsnash %s %s > out%i", argv[1], argv[2], l);
cdd8664
+                              execlp("lrsnash", "lrsnash", argv[1], argv[2], NULL);
cedfb60
                          }
cedfb60
                          else     {
cdd8664
-                              int n= sprintf(buffer, "lrsnash %s %s > out%i", argv[2], argv[1], l);
cdd8664
+                              execlp("lrsnash", "lrsnash", argv[2], argv[1], NULL);
cedfb60
                          }
cedfb60
 
cedfb60
-			 int i=system(buffer);
cedfb60
                           _exit(0);
cedfb60
 		      }
cedfb60
 		  }
6c7e7ed
@@ -50,18 +53,18 @@
cdd8664
 			      printf("lrsnash %s %s   finished first\n", argv[2], argv[1]);
cedfb60
 			      printf("player numbers will be reversed in output\n");
cedfb60
                                }
cdd8664
+			   sprintf(buffer, "out%i", j);
cedfb60
                            if(argc == 4) {
cedfb60
 			       printf("output file: %s\n", argv[3]);
cedfb60
-			       int n = sprintf(buffer, "/bin/mv -f out%i %s", j, argv[3]);
cdd8664
+			       rename(buffer, argv[3]);
cedfb60
                            }
cedfb60
                            else  {
6c7e7ed
 			        printf("output file: out\n");
cedfb60
-			        int n = sprintf(buffer, "/bin/mv -f out%i out", j);
6c7e7ed
+				rename(buffer, "out");
cedfb60
                            }
cedfb60
-			  int i = system(buffer);
cedfb60
 		      } else {
cedfb60
-			  int n = sprintf(buffer, "/bin/rm -f out%i", j);
cedfb60
-			  int i = system(buffer);
36fd7e5
+			  sprintf(buffer, "out%i", j);
Jerry James 09e7566
+			  unlink(buffer);
cedfb60
 		      }
cedfb60
 		  }
Jerry James 09e7566
 		  printf("the other process will be ");   /*...will be killed */
6c7e7ed
--- fourier.c.orig	2018-04-30 00:41:08.000000000 -0600
6c7e7ed
+++ fourier.c	2018-10-31 14:44:27.227701068 -0600
6c7e7ed
@@ -407,7 +407,6 @@ long compute_redundancy(long *redineq, l
36fd7e5
 {
36fd7e5
   long ineq;
36fd7e5
   long d, m;
36fd7e5
-  long nlinearity;
36fd7e5
   long lastdv, index;
36fd7e5
   lrs_mp_matrix Lin;
36fd7e5
   
6c7e7ed
@@ -420,7 +419,6 @@ long compute_redundancy(long *redineq, l
36fd7e5
     }
36fd7e5
   m = P->m_A;
36fd7e5
   d = P->d;
36fd7e5
-  nlinearity = Q->nlinearity;
36fd7e5
   lastdv = Q->lastdv;
36fd7e5
   for(index = lastdv +1;index <= m+d; index++)
36fd7e5
     {
6c7e7ed
@@ -709,7 +707,7 @@ void full_fel(lrs_dic *iP, lrs_dat *iQ,
cdd8664
   long *Dep;        /*Dep[0] not used, Dep[i] = 1 if eqn lin. dep., else 0 */
cdd8664
   long nlinearity;
cdd8664
   long eqn;
cdd8664
-  long last=0;       /* =1 if equation used to remove var. =2 if FME used */
cdd8664
+  /* long last=0; */  /* =1 if equation used to remove var. =2 if FME used */
cdd8664
   /* could do with less of these  monsters */ 
cdd8664
   lrs_mp Temp, Temp1, div1;
cdd8664
  
6c7e7ed
@@ -769,7 +767,7 @@ void full_fel(lrs_dic *iP, lrs_dat *iQ,
cdd8664
 	      } 
cdd8664
 	  if (eqn > 0)
cdd8664
 	    {
cdd8664
-	      last = 1;
cdd8664
+	      /* last = 1; */
cdd8664
 	      for(l=eqn-1;l
cdd8664
 		{
cdd8664
 		  Q1->linearity[l] = Q1->linearity[l+1] -1;
6c7e7ed
@@ -831,7 +829,7 @@ void full_fel(lrs_dic *iP, lrs_dat *iQ,
cdd8664
 	    }
cdd8664
 	  else
cdd8664
 	    {
cdd8664
-	      last = 2;
cdd8664
+	      /* last = 2; */
cdd8664
 	      if( (Q2 = lrs_alloc_dat("LRS GLOBALS")) == NULL)
cdd8664
 		fel_abort("ERROR>Can't allocate memory for structures");
cdd8664
 	      
6c7e7ed
--- lrsgmp.c.orig	2018-06-25 04:30:25.000000000 -0600
6c7e7ed
+++ lrsgmp.c	2018-10-31 14:59:17.189999312 -0600
6c7e7ed
@@ -261,7 +261,7 @@ readrat (lrs_mp Na, lrs_mp Da)	/* read a
Jerry James 09e7566
 }
Jerry James 09e7566
 
Jerry James 09e7566
 #ifdef PLRS
6c7e7ed
-string sprat (char name[], lrs_mp Nin, lrs_mp Din)	/*reduce and print Nin/Din  */
6c7e7ed
+string sprat (const char *name, lrs_mp Nin, lrs_mp Din)	/*reduce and print Nin/Din  */
Jerry James 09e7566
 {
Jerry James 09e7566
 
Jerry James 09e7566
 	//create stream to collect output
6c7e7ed
@@ -296,7 +296,7 @@ string sprat (char name[], lrs_mp Nin, l
e328c2e
 	return str;
Jerry James 09e7566
 }
Jerry James 09e7566
 
e328c2e
-char *cprat (char name[], lrs_mp Nin, lrs_mp Din) 
e328c2e
+char *cprat (const char *name, lrs_mp Nin, lrs_mp Din) 
e328c2e
 {
e328c2e
 	char *ret;
e328c2e
 	unsigned long len;
6c7e7ed
@@ -323,7 +323,7 @@ char *cprat (char name[], lrs_mp Nin, lr
e328c2e
 	return ret;
e328c2e
 }
Jerry James 09e7566
 
6c7e7ed
-string spmp (char name[], lrs_mp Nt)	/*print the long precision integer a */
6c7e7ed
+string spmp (const char *name, lrs_mp Nt)	/*print the long precision integer a */
Jerry James 09e7566
 {
Jerry James 09e7566
 	
Jerry James 09e7566
 	//create stream to collect output
6c7e7ed
@@ -345,7 +345,7 @@ string spmp (char name[], lrs_mp Nt)	/*p
6c7e7ed
 #endif
Jerry James 09e7566
 
Jerry James 09e7566
 void
Jerry James 09e7566
-pmp (char name[], lrs_mp Nt)
Jerry James 09e7566
+pmp (const char *name, lrs_mp Nt)
Jerry James 09e7566
 {
6c7e7ed
   lrs_printf (lrs_ofp, "%s", name);
Jerry James 09e7566
   if (sign (Nt) != NEG)
6c7e7ed
@@ -356,7 +356,7 @@ pmp (char name[], lrs_mp Nt)
Jerry James 09e7566
 }
Jerry James 09e7566
 
Jerry James 09e7566
 void 
Jerry James 09e7566
-prat (char name[], lrs_mp Nin, lrs_mp Din)
Jerry James 09e7566
+prat (const char *name, lrs_mp Nin, lrs_mp Din)
Jerry James 09e7566
      /*print the long precision rational Nt/Dt  */
Jerry James 09e7566
 {
Jerry James 09e7566
 	lrs_mp temp1, temp2;
6c7e7ed
@@ -470,7 +470,7 @@ lrs_getdigits (long *a, long *b)
Jerry James 09e7566
 }
Jerry James 09e7566
 
Jerry James 09e7566
 void *
Jerry James 09e7566
-xcalloc (long n, long s, long l, char *f)
Jerry James 09e7566
+xcalloc (long n, long s, long l, const char *f)
Jerry James 09e7566
 {
Jerry James 09e7566
   void *tmp;
Jerry James 09e7566
 
6c7e7ed
@@ -501,7 +501,7 @@ lrs_mp_init (long dec_digits, FILE * fpi
Jerry James 09e7566
 
Jerry James 09e7566
 
Jerry James 09e7566
 void 
Jerry James 09e7566
-notimpl (char s[])
Jerry James 09e7566
+notimpl (const char *s)
Jerry James 09e7566
 {
Jerry James 09e7566
   fflush (stdout);
Jerry James 09e7566
   fprintf (stderr, "\nAbnormal Termination  %s\n", s);
6c7e7ed
--- lrsgmp.h.orig	2018-06-25 04:30:26.000000000 -0600
6c7e7ed
+++ lrsgmp.h	2018-10-31 15:02:36.915695889 -0600
6c7e7ed
@@ -248,13 +248,13 @@ void atomp (const char s[], lrs_mp a);	/
Jerry James 09e7566
 long compare (lrs_mp a, lrs_mp b);	/* a ? b and returns -1,0,1 for <,=,>             */
Jerry James 09e7566
 void linint (lrs_mp a, long ka, lrs_mp b, long kb);     /* compute a*ka+b*kb --> a        */
Jerry James 09e7566
 #ifdef PLRS
6c7e7ed
-string spmp (char name[], lrs_mp a);	/* print the long precision integer a             */
6c7e7ed
-string sprat (char name[], lrs_mp Nt, lrs_mp Dt);	/* reduce and print  Nt/Dt                        */
e328c2e
-char *cprat(char name[], lrs_mp Nt, lrs_mp Dt); /* C version of prat */
6c7e7ed
+string spmp (const char *name, lrs_mp a);	/* print the long precision integer a             */
6c7e7ed
+string sprat (const char *name, lrs_mp Nt, lrs_mp Dt);	/* reduce and print  Nt/Dt                        */
e328c2e
+char *cprat(const char *name, lrs_mp Nt, lrs_mp Dt); /* C version of prat */
Jerry James 09e7566
 long plrs_readrat (lrs_mp Na, lrs_mp Da, const char * rat);	/* take a rational number and convert to lrs_mp   */
6c7e7ed
 #endif
Jerry James 09e7566
-void pmp (char name[], lrs_mp a);	/* print the long precision integer a             */
Jerry James 09e7566
-void prat (char name[], lrs_mp Nt, lrs_mp Dt);	/* reduce and print  Nt/Dt                        */
Jerry James 09e7566
+void pmp (const char *name, lrs_mp a);	/* print the long precision integer a             */
Jerry James 09e7566
+void prat (const char *name, lrs_mp Nt, lrs_mp Dt);	/* reduce and print  Nt/Dt                        */
Jerry James 09e7566
 void readmp (lrs_mp a);		/* read an integer and convert to lrs_mp          */
Jerry James 09e7566
 long readrat (lrs_mp Na, lrs_mp Da);	/* read a rational or int and convert to lrs_mp   */
6c7e7ed
 void reduce (lrs_mp Na, lrs_mp Da);	/* reduces Na Da by gcd(Na,Da)                    */
6c7e7ed
@@ -274,7 +274,7 @@ void lcm (lrs_mp a, lrs_mp b);	/* a = le
Jerry James 09e7566
 void mulrat (lrs_mp Na, lrs_mp Da, lrs_mp Nb, lrs_mp Db, lrs_mp Nc, lrs_mp Dc);
Jerry James 09e7566
 						       /* computes Nc/Dc=(Na/Da)*(Nb/Db) and reduce      */
Jerry James 09e7566
 long myrandom (long num, long nrange);	/* return a random number in range 0..nrange-1    */
Jerry James 09e7566
-void notimpl (char s[]);	/* bail out - help!                               */
Jerry James 09e7566
+void notimpl (const char *s);	/* bail out - help!                               */
Jerry James 09e7566
 void rattodouble (lrs_mp a, lrs_mp b, double *x);	/* convert lrs_mp rational to double              */
Jerry James 09e7566
 void reduceint (lrs_mp Na, lrs_mp Da);	/* divide Na by Da and return it                  */
Jerry James 09e7566
 void reducearray (lrs_mp_vector p, long n);	/* find gcd of p[0]..p[n-1] and divide through by */
6c7e7ed
@@ -293,7 +293,7 @@ void *calloc ();
Jerry James 09e7566
 void *malloc ();
Jerry James 09e7566
 #endif
Jerry James 09e7566
 
Jerry James 09e7566
-void *xcalloc (long n, long s, long l, char *f);
Jerry James 09e7566
+void *xcalloc (long n, long s, long l, const char *f);
Jerry James 09e7566
 
Jerry James 09e7566
 void lrs_default_digits_overflow ();
6c7e7ed
 void lrs_exit(int i); 
6c7e7ed
--- lrslib.c.orig	2018-10-23 00:22:44.000000000 -0600
6c7e7ed
+++ lrslib.c	2018-10-31 15:31:15.462419933 -0600
6c7e7ed
@@ -62,8 +62,8 @@ static void lrs_dump_state ();
cdd8664
 static void pushQ (lrs_dat * global, long m, long d, long m_A);
cdd8664
 
6c7e7ed
 #ifndef TIMES
cdd8664
-static void ptimes ();
cdd8664
-static double get_time();
cdd8664
+static void ptimes (void);
cdd8664
+static double get_time(void);
cdd8664
 #endif
cdd8664
 
cdd8664
 
6c7e7ed
@@ -71,10 +71,10 @@ static double get_time();
Jerry James a0e3c5a
 /* signals handling            */
Jerry James a0e3c5a
 /*******************************/
6c7e7ed
 #ifndef SIGNALS
Jerry James a0e3c5a
-static void checkpoint ();
Jerry James a0e3c5a
-static void die_gracefully ();
cdd8664
-static void setup_signals ();
cdd8664
-static void timecheck ();
Jerry James a0e3c5a
+static void checkpoint (int signum);
Jerry James a0e3c5a
+static void die_gracefully (int signum);
cdd8664
+static void setup_signals (void);
Jerry James a0e3c5a
+static void timecheck (int signum);
Jerry James a0e3c5a
 #endif
Jerry James a0e3c5a
 
Jerry James a0e3c5a
 /*******************************/
6c7e7ed
@@ -426,7 +426,7 @@ if (Q->countonly)
36fd7e5
 
36fd7e5
 #ifdef PLRS
36fd7e5
 	//Make new output node
36fd7e5
-	char *type=NULL;
36fd7e5
+	const char *type=NULL;
36fd7e5
 	
36fd7e5
 	//Make stream to collect prat / pmp data
36fd7e5
 	stringstream ss;
6c7e7ed
@@ -551,7 +551,7 @@ if(Q->verbose)
Jerry James 09e7566
 /* end of lrs_lpoutput */
Jerry James 09e7566
 /***********************/
Jerry James 09e7566
 void 
Jerry James 09e7566
-lrs_printrow (char name[], lrs_dat * Q, lrs_mp_vector output, long rowd)
Jerry James 09e7566
+lrs_printrow (const char *name, lrs_dat * Q, lrs_mp_vector output, long rowd)
Jerry James 09e7566
 /* print a row of A matrix in output in "original" form  */
Jerry James 09e7566
 /* rowd+1 is the dimension of output vector                */
Jerry James 09e7566
 /* if input is H-rep. output[0] contains the RHS      */
6c7e7ed
@@ -650,7 +650,7 @@ lrs_getsolution (lrs_dic * P, lrs_dat *
6c7e7ed
 }				/* end of lrs_getsolution */
Jerry James 09e7566
 
6c7e7ed
 void
6c7e7ed
-lrs_print_header(char *name)
6c7e7ed
+lrs_print_header(const char *name)
6c7e7ed
 {
6c7e7ed
   if(lrs_ofp == NULL)
6c7e7ed
     lrs_ofp=stdout;
6c7e7ed
@@ -683,7 +683,7 @@ fprintf (lrs_ofp,",hybrid arithmetic");
6c7e7ed
 }
Jerry James 09e7566
 
Jerry James 09e7566
 long
Jerry James 09e7566
-lrs_init (char *name)       /* returns TRUE if successful, else FALSE */
Jerry James 09e7566
+lrs_init (const char *name)       /* returns TRUE if successful, else FALSE */
Jerry James 09e7566
 {
6c7e7ed
 #ifndef PLRS
6c7e7ed
  if(overflow!=2)
6c7e7ed
@@ -702,7 +702,7 @@ lrs_init (char *name)       /* returns T
Jerry James 09e7566
 }
Jerry James 09e7566
 
Jerry James 09e7566
 void 
Jerry James 09e7566
-lrs_close (char *name)
Jerry James 09e7566
+lrs_close (const char *name)
Jerry James 09e7566
 {
Jerry James 09e7566
 
6c7e7ed
 #ifndef PLRS
6c7e7ed
@@ -1699,8 +1699,8 @@ lrs_getfirstbasis (lrs_dic ** D_p, lrs_d
36fd7e5
 	#ifndef PLRS
6c7e7ed
 	  fprintf (lrs_ofp, "\n*Voronoi Diagram: Voronoi vertices and rays are output");
6c7e7ed
         #else
36fd7e5
-	char *type = "header";
36fd7e5
-	char *data = "*Voronoi Diagram: Voronoi vertices and rays are output";
36fd7e5
+	const char *type = "header";
36fd7e5
+	const char *data = "*Voronoi Diagram: Voronoi vertices and rays are output";
36fd7e5
 	//post output in a nonblocking manner (a consumer thread will manage output)
36fd7e5
 	post_output(type,data);
36fd7e5
 	#endif
6c7e7ed
@@ -1709,8 +1709,8 @@ lrs_getfirstbasis (lrs_dic ** D_p, lrs_d
36fd7e5
 	#ifndef PLRS
36fd7e5
 	fprintf (lrs_ofp, "\nH-representation");
36fd7e5
 	#else
36fd7e5
-	char *type = "header";
36fd7e5
-	char *data = "H-representation";
36fd7e5
+	const char *type = "header";
36fd7e5
+	const char *data = "H-representation";
36fd7e5
 	//post output in a nonblocking manner (a consumer thread will manage output)
36fd7e5
 	post_output(type, data);
36fd7e5
 	#endif
6c7e7ed
@@ -1719,8 +1719,8 @@ lrs_getfirstbasis (lrs_dic ** D_p, lrs_d
36fd7e5
 	#ifndef PLRS
36fd7e5
 	fprintf (lrs_ofp, "\nV-representation");
36fd7e5
 	#else
36fd7e5
-	char *type = "header";
36fd7e5
-	char *data = "V-representation";
36fd7e5
+	const char *type = "header";
36fd7e5
+	const char *data = "V-representation";
36fd7e5
 	//post output in a nonblocking manner (a consumer thread will manage output)
36fd7e5
 	post_output(type,data);
36fd7e5
 	#endif
6c7e7ed
@@ -1741,7 +1741,7 @@ lrs_getfirstbasis (lrs_dic ** D_p, lrs_d
36fd7e5
 	  	fprintf (lrs_ofp, "\nlinearity %ld ", nredundcol - k);	/*adjust nredundcol for homog. */
36fd7e5
 		#else
36fd7e5
 		stringstream ss;
36fd7e5
-		char *type = "header";
36fd7e5
+		const char *type = "header";
36fd7e5
 		ss<<"linearity "<<(nredundcol -k);
36fd7e5
 		#endif
36fd7e5
 	  	for (i = 1; i <= nredundcol - k; i++){
6c7e7ed
@@ -1761,7 +1761,7 @@ lrs_getfirstbasis (lrs_dic ** D_p, lrs_d
36fd7e5
       	fprintf (lrs_ofp, "\nbegin");
36fd7e5
       	fprintf (lrs_ofp, "\n***** %ld rational", Q->n);
36fd7e5
 	#else
36fd7e5
-	char *type = "header";
36fd7e5
+	const char *type = "header";
36fd7e5
 	stringstream ss;
36fd7e5
 	ss<<"begin"<<endl<<"***** "<<Q->n<<" rational";
36fd7e5
 	post_output(type, ss.str().c_str());
6c7e7ed
@@ -4370,7 +4370,7 @@ printA (lrs_dic * P, lrs_dat * Q)	/* pri
Jerry James 09e7566
 
Jerry James 09e7566
 
Jerry James 09e7566
 void 
Jerry James 09e7566
-pimat (lrs_dic * P, long r, long s, lrs_mp Nt, char name[])
Jerry James 09e7566
+pimat (lrs_dic * P, long r, long s, lrs_mp Nt, const char *name)
Jerry James 09e7566
  /*print the long precision integer in row r col s of matrix A */
Jerry James 09e7566
 {
Jerry James 09e7566
   long *B = P->B;
6c7e7ed
@@ -5015,7 +5015,7 @@ setup_signals ()
Jerry James 09e7566
 }
Jerry James 09e7566
 
Jerry James a0e3c5a
 static void
Jerry James 09e7566
-timecheck ()
Jerry James 09e7566
+timecheck (int signum __attribute__((unused)))
Jerry James 09e7566
 {
Jerry James 09e7566
   lrs_dump_state ();
Jerry James 09e7566
   errcheck ("signal", signal (SIGALRM, timecheck));
6c7e7ed
@@ -5023,14 +5023,14 @@ timecheck ()
Jerry James 09e7566
 }
Jerry James 09e7566
 
Jerry James a0e3c5a
 static void
Jerry James 09e7566
-checkpoint ()
Jerry James 09e7566
+checkpoint (int signum __attribute__((unused)))
Jerry James 09e7566
 {
Jerry James 09e7566
   lrs_dump_state ();
Jerry James 09e7566
   errcheck ("signal", signal (SIGUSR1, checkpoint));
Jerry James 09e7566
 }
Jerry James 09e7566
 
Jerry James a0e3c5a
 static void
Jerry James 09e7566
-die_gracefully ()
Jerry James 09e7566
+die_gracefully (int signum __attribute__((unused)))
Jerry James 09e7566
 {
Jerry James 09e7566
   lrs_dump_state ();
Jerry James 09e7566
 
6c7e7ed
--- lrslib.h.orig	2018-07-02 22:31:59.000000000 -0600
6c7e7ed
+++ lrslib.h	2018-10-31 15:11:45.643225658 -0600
6c7e7ed
@@ -350,13 +350,13 @@ long lrs_getnextbasis (lrs_dic ** dict_p
Jerry James 09e7566
 long lrs_getsolution (lrs_dic * P, lrs_dat * Q, lrs_mp_vector output, long col);
Jerry James 09e7566
 long lrs_getray (lrs_dic * P, lrs_dat * Q, long col, long comment, lrs_mp_vector output);
Jerry James 09e7566
 long lrs_getvertex (lrs_dic * P, lrs_dat * Q, lrs_mp_vector output);
Jerry James 09e7566
-void lrs_close (char *name);	/* close lrs lib program "name"                 */
Jerry James 09e7566
-long lrs_init (char *name);	/* initialize lrslib and arithmetic package for prog "name" */
Jerry James 09e7566
+void lrs_close (const char *name);	/* close lrs lib program "name"                 */
Jerry James 09e7566
+long lrs_init (const char *name);	/* initialize lrslib and arithmetic package for prog "name" */
Jerry James 09e7566
 void lrs_lpoutput(lrs_dic * P,lrs_dat * Q, lrs_mp_vector output); /* print LP primal and dual solutions */
Jerry James 09e7566
 void lrs_printcobasis (lrs_dic * P, lrs_dat * Q, long col); /* print cobasis for column col(verted or ray)  */
6c7e7ed
-void lrs_print_header(char *name);
6c7e7ed
+void lrs_print_header(const char *name);
Jerry James 09e7566
 void lrs_printoutput (lrs_dat * Q, lrs_mp_vector output); /* print output array                           */
Jerry James 09e7566
-void lrs_printrow (char name[], lrs_dat * Q, lrs_mp_vector output, long rowd); /*print row of A matrix in output[0..rowd]      */
Jerry James 09e7566
+void lrs_printrow (const char *name, lrs_dat * Q, lrs_mp_vector output, long rowd); /*print row of A matrix in output[0..rowd]      */
Jerry James 09e7566
 void lrs_printsol (lrs_dic * P, lrs_dat * Q, long col, long comment);	/* print out solution from col, comment= 0=normal,-1=geometric ray,1..inputd=linearity */
Jerry James 09e7566
 void lrs_printtotals (lrs_dic * P, lrs_dat * Q);/* print final totals for lrs                   */
Jerry James 09e7566
 long lrs_set_digits (long dec_digits );  /* set lrsmp digits to equiv. of decimal dec_digits */
6c7e7ed
@@ -398,7 +398,7 @@ void updatevolume (lrs_dic * P, lrs_dat
Jerry James 09e7566
 long lrs_degenerate (lrs_dic * P, lrs_dat * Q);	/* TRUE if the dictionary is primal degenerate    */
Jerry James 09e7566
 void print_basis (FILE * fp, lrs_dat * Q);
Jerry James 09e7566
 void printA (lrs_dic * P, lrs_dat * Q);	/* raw print of dictionary, bases for debugging   */
Jerry James 09e7566
-void pimat (lrs_dic * P, long r, long s, lrs_mp Nt, char name[]); /* print the row r col s of A                     */
Jerry James 09e7566
+void pimat (lrs_dic * P, long r, long s, lrs_mp Nt, const char *name); /* print the row r col s of A                     */
Jerry James 09e7566
 long readfacets (lrs_dat * Q, long facet[]);	/* read and check facet list                      */
Jerry James 09e7566
 long readlinearity (lrs_dat * Q);	/* read and check linearity list                  */
Jerry James 09e7566
 void rescaledet (lrs_dic * P, lrs_dat * Q, lrs_mp Vnum, lrs_mp Vden);	/* rescale determinant to get its volume */
6c7e7ed
--- lrslong.c.orig	2018-06-25 04:30:34.000000000 -0600
6c7e7ed
+++ lrslong.c	2018-10-31 15:13:18.209669977 -0600
6c7e7ed
@@ -333,7 +333,7 @@ string sprat (char name[], lrs_mp Nin, l
Jerry James 09e7566
 	return str;
Jerry James 09e7566
 }
Jerry James 09e7566
 
e328c2e
-char *cprat (char name[], lrs_mp Nin, lrs_mp Din)
e328c2e
+char *cprat (const char *name, lrs_mp Nin, lrs_mp Din)
e328c2e
 {
e328c2e
         char *ret;
e328c2e
         unsigned long len;
6c7e7ed
@@ -360,7 +360,7 @@ char *cprat (char name[], lrs_mp Nin, lr
e328c2e
         return ret;
e328c2e
 }
e328c2e
 
6c7e7ed
-string spmp (char name[], lrs_mp Nt)	/*print the long precision integer a */
6c7e7ed
+string spmp (const char *name, lrs_mp Nt)	/*print the long precision integer a */
Jerry James 09e7566
 {
Jerry James 09e7566
 	//create stream to collect output
6c7e7ed
 	stringstream ss;
6c7e7ed
@@ -395,7 +395,7 @@ string spmp (char name[], lrs_mp Nt)	/*p
Jerry James 09e7566
 }
6c7e7ed
 #endif
Jerry James 09e7566
 void 
Jerry James 09e7566
-pmp (char name[], lrs_mp Nt)
Jerry James 09e7566
+pmp (const char *name, lrs_mp Nt)
Jerry James 09e7566
 {
6c7e7ed
   lrs_printf (lrs_ofp, "%s", name);
Jerry James 09e7566
   if (sign (Nt) != NEG)
6c7e7ed
@@ -417,7 +417,7 @@ pmp (char name[], lrs_mp Nt)
Jerry James 09e7566
 }
Jerry James 09e7566
 
Jerry James 09e7566
 void 
Jerry James 09e7566
-prat (char name[], lrs_mp Nin, lrs_mp Din)
Jerry James 09e7566
+prat (const char *name, lrs_mp Nin, lrs_mp Din)
Jerry James 09e7566
      /*print the long precision rational Nt/Dt  */
Jerry James 09e7566
 {
Jerry James 09e7566
   lrs_mp Nt, Dt;
6c7e7ed
@@ -547,7 +547,7 @@ lrs_getdigits (long *a, long *b)
Jerry James 09e7566
 }
Jerry James 09e7566
 
Jerry James 09e7566
 void *
Jerry James 09e7566
-xcalloc (long n, long s, long l, char *f)
Jerry James 09e7566
+xcalloc (long n, long s, long l, const char *f)
Jerry James 09e7566
 {
Jerry James 09e7566
   void *tmp;
Jerry James 09e7566
 
6c7e7ed
@@ -578,7 +578,7 @@ lrs_mp_init (long dec_digits, FILE * fpi
Jerry James 09e7566
 }
Jerry James 09e7566
 
Jerry James 09e7566
 void 
Jerry James 09e7566
-notimpl (char s[])
Jerry James 09e7566
+notimpl (const char *s)
Jerry James 09e7566
 {
Jerry James 09e7566
   fflush (stdout);
Jerry James 09e7566
   fprintf (stderr, "\nAbnormal Termination  %s\n", s);
6c7e7ed
--- lrslong.h.orig	2018-10-31 14:44:27.247700740 -0600
6c7e7ed
+++ lrslong.h	2018-10-31 15:19:17.781626864 -0600
6c7e7ed
@@ -282,11 +282,11 @@ long mptoi (lrs_mp a);		/* convert lrs_m
6c7e7ed
 #ifdef PLRS
6c7e7ed
 string spmp (char name[], lrs_mp a);	/* print the long precision integer a             */
6c7e7ed
 string sprat (char name[], lrs_mp Nt, lrs_mp Dt);	/* reduce and print  Nt/Dt                        */
6c7e7ed
-char *cprat(char name[], lrs_mp Nt, lrs_mp Dt); /* C version of prat */
6c7e7ed
+char *cprat(const char *name, lrs_mp Nt, lrs_mp Dt); /* C version of prat */
6c7e7ed
 long plrs_readrat (lrs_mp Na, lrs_mp Da, const char * rat);	/* take a rational number and convert to lrs_mp   */
6c7e7ed
 #endif
6c7e7ed
-void pmp (char name[], lrs_mp a);	/* print the long precision integer a             */
6c7e7ed
-void prat (char name[], lrs_mp Nt, lrs_mp Dt);	/* reduce and print  Nt/Dt                        */
6c7e7ed
+void pmp (const char *name, lrs_mp a);	/* print the long precision integer a             */
6c7e7ed
+void prat (const char *name, lrs_mp Nt, lrs_mp Dt);	/* reduce and print  Nt/Dt                        */
6c7e7ed
 void readmp (lrs_mp a);		/* read an integer and convert to lrs_mp          */
6c7e7ed
 long readrat (lrs_mp Na, lrs_mp Da);	/* read a rational or int and convert to lrs_mp   */
6c7e7ed
 void reduce (lrs_mp Na, lrs_mp Da);	/* reduces Na Da by gcd(Na,Da)                    */
6c7e7ed
@@ -307,7 +307,7 @@ void lcm (lrs_mp a, lrs_mp b);	/* a = le
6c7e7ed
 void mulrat (lrs_mp Na, lrs_mp Da, lrs_mp Nb, lrs_mp Db, lrs_mp Nc, lrs_mp Dc);
6c7e7ed
 						       /* computes Nc/Dc=(Na/Da)*(Nb/Db) and reduce      */
6c7e7ed
 long myrandom (long num, long nrange);	/* return a random number in range 0..nrange-1    */
6c7e7ed
-void notimpl (char s[]);	/* bail out - help!                               */
6c7e7ed
+void notimpl (const char *s);	/* bail out - help!                               */
6c7e7ed
 void rattodouble (lrs_mp a, lrs_mp b, double *x);	/* convert lrs_mp rational to double              */
6c7e7ed
 void reduceint (lrs_mp Na, lrs_mp Da);	/* divide Na by Da and return it                  */
6c7e7ed
 void reducearray (lrs_mp_vector p, long n);	/* find gcd of p[0]..p[n-1] and divide through by */
6c7e7ed
@@ -338,7 +338,7 @@ void stringcpy (char *s, char *t);	/* co
6c7e7ed
 
6c7e7ed
 void *calloc ();
6c7e7ed
 void *malloc ();
6c7e7ed
-void *xcalloc (long n, long s, long l, char *f);
6c7e7ed
+void *xcalloc (long n, long s, long l, const char *f);
6c7e7ed
 
6c7e7ed
 void lrs_default_digits_overflow ();
6c7e7ed
 void lrs_exit(int i);   
6c7e7ed
--- lrsmp.c.orig	2018-06-25 04:30:25.000000000 -0600
6c7e7ed
+++ lrsmp.c	2018-10-31 14:44:27.248700724 -0600
6c7e7ed
@@ -623,7 +623,7 @@ mptoi (lrs_mp a)		/* convert lrs_mp to l
Jerry James 09e7566
 
Jerry James 09e7566
 
Jerry James 09e7566
 #ifdef PLRS
Jerry James 09e7566
-string prat (char name[], lrs_mp Nin, lrs_mp Din)	/*reduce and print Nin/Din  */
Jerry James 09e7566
+string prat (const char *name, lrs_mp Nin, lrs_mp Din)	/*reduce and print Nin/Din  */
Jerry James 09e7566
 {
Jerry James 09e7566
 
Jerry James 09e7566
 	
6c7e7ed
@@ -662,7 +662,7 @@ string prat (char name[], lrs_mp Nin, lr
e328c2e
 	return str;
Jerry James 09e7566
 }
Jerry James 09e7566
 
e328c2e
-char *cprat (char name[], lrs_mp Nin, lrs_mp Din)
e328c2e
+char *cprat (const char *name, lrs_mp Nin, lrs_mp Din)
e328c2e
 {
e328c2e
         char *ret;
e328c2e
         unsigned long len;
6c7e7ed
@@ -689,7 +689,7 @@ char *cprat (char name[], lrs_mp Nin, lr
e328c2e
         return ret;
e328c2e
 }
Jerry James 09e7566
 
Jerry James 09e7566
-string pmp (char name[], lrs_mp a)	/*print the long precision integer a */
Jerry James 09e7566
+string pmp (const char *name, lrs_mp a)	/*print the long precision integer a */
Jerry James 09e7566
 {
Jerry James 09e7566
 	
Jerry James 09e7566
   	long i;
6c7e7ed
@@ -714,7 +714,7 @@ string pmp (char name[], lrs_mp a)	/*pri
Jerry James 09e7566
 	return str;
Jerry James 09e7566
 }
Jerry James 09e7566
 #else
Jerry James 09e7566
-void prat (char name[], lrs_mp Nin, lrs_mp Din)	/*reduce and print Nin/Din  */
Jerry James 09e7566
+void prat (const char *name, lrs_mp Nin, lrs_mp Din)	/*reduce and print Nin/Din  */
Jerry James 09e7566
 {
Jerry James 09e7566
 	 lrs_mp Nt, Dt;
Jerry James 09e7566
 	long i;
6c7e7ed
@@ -742,7 +742,7 @@ void prat (char name[], lrs_mp Nin, lrs_
Jerry James 09e7566
 	
Jerry James 09e7566
 }
Jerry James 09e7566
 
Jerry James 09e7566
-void pmp (char name[], lrs_mp a)	/*print the long precision integer a */
Jerry James 09e7566
+void pmp (const char *name, lrs_mp a)	/*print the long precision integer a */
Jerry James 09e7566
 {
Jerry James 09e7566
 
Jerry James 09e7566
 	long i;
6c7e7ed
@@ -987,7 +987,7 @@ comprod (lrs_mp Na, lrs_mp Nb, lrs_mp Nc
Jerry James 09e7566
 
Jerry James 09e7566
 
Jerry James 09e7566
 void 
Jerry James 09e7566
-notimpl (char s[])
Jerry James 09e7566
+notimpl (const char *s)
Jerry James 09e7566
 {
Jerry James 09e7566
   fflush (stdout);
Jerry James 09e7566
   fprintf (stderr, "\nAbnormal Termination  %s\n", s);
6c7e7ed
@@ -1062,7 +1062,7 @@ mulrat (lrs_mp Na, lrs_mp Da, lrs_mp Nb,
Jerry James 09e7566
 
Jerry James 09e7566
 
Jerry James 09e7566
 void *
Jerry James 09e7566
-xcalloc (long n, long s, long l, char *f)
Jerry James 09e7566
+xcalloc (long n, long s, long l, const char *f)
Jerry James 09e7566
 {
Jerry James 09e7566
   void *tmp;
Jerry James 09e7566
 
6c7e7ed
--- lrsmp.h.orig	2018-06-25 04:30:25.000000000 -0600
6c7e7ed
+++ lrsmp.h	2018-10-31 14:44:27.250700691 -0600
6c7e7ed
@@ -167,13 +167,13 @@ long mptoi (lrs_mp a);		/* convert lrs_m
Jerry James 09e7566
 void mulint (lrs_mp a, lrs_mp b, lrs_mp c);	/* multiply two integers a*b --> c                */
Jerry James 09e7566
 void normalize (lrs_mp a);	/* normalize lrs_mp after computation             */
Jerry James 09e7566
 #ifdef PLRS
Jerry James 09e7566
-string pmp (char name[], lrs_mp a);	/* print the long precision integer a             */
Jerry James 09e7566
-string prat (char name[], lrs_mp Nt, lrs_mp Dt);	/* reduce and print  Nt/Dt                        */
e328c2e
-char *cprat(char name[], lrs_mp Nt, lrs_mp Dt); /* C version of prat */
Jerry James 09e7566
+string pmp (const char *name, lrs_mp a);	/* print the long precision integer a             */
Jerry James 09e7566
+string prat (const char *name, lrs_mp Nt, lrs_mp Dt);	/* reduce and print  Nt/Dt                        */
e328c2e
+char *cprat(const char *name, lrs_mp Nt, lrs_mp Dt); /* C version of prat */
Jerry James 09e7566
 long plrs_readrat (lrs_mp Na, lrs_mp Da, const char * rat);	/* take a rational number and convert to lrs_mp   */
Jerry James 09e7566
 #else
Jerry James 09e7566
-void pmp (char name[], lrs_mp a);	/* print the long precision integer a             */
Jerry James 09e7566
-void prat (char name[], lrs_mp Nt, lrs_mp Dt);	/* reduce and print  Nt/Dt                        */
Jerry James 09e7566
+void pmp (const char *name, lrs_mp a);	/* print the long precision integer a             */
Jerry James 09e7566
+void prat (const char *name, lrs_mp Nt, lrs_mp Dt);	/* reduce and print  Nt/Dt                        */
Jerry James 09e7566
 #endif
Jerry James 09e7566
 long readrat (lrs_mp Na, lrs_mp Da);	/* read a rational or int and convert to lrs_mp   */
Jerry James 09e7566
 void reduce (lrs_mp Na, lrs_mp Da);	/* reduces Na Da by gcd(Na,Da)                    */
6c7e7ed
@@ -197,7 +197,7 @@ void lcm (lrs_mp a, lrs_mp b);	/* a = le
Jerry James 09e7566
 void mulrat (lrs_mp Na, lrs_mp Da, lrs_mp Nb, lrs_mp Db, lrs_mp Nc, lrs_mp Dc);
Jerry James 09e7566
 						       /* computes Nc/Dc=(Na/Da)*(Nb/Db) and reduce      */
Jerry James 09e7566
 long myrandom (long num, long nrange);	/* return a random number in range 0..nrange-1    */
Jerry James 09e7566
-void notimpl (char s[]);	/* bail out - help!                               */
Jerry James 09e7566
+void notimpl (const char *s);	/* bail out - help!                               */
Jerry James 09e7566
 void rattodouble (lrs_mp a, lrs_mp b, double *x);	/* convert lrs_mp rational to double              */
Jerry James 09e7566
 void reduceint (lrs_mp Na, lrs_mp Da);	/* divide Na by Da and return it                  */
Jerry James 09e7566
 void reducearray (lrs_mp_vector p, long n);	/* find gcd of p[0]..p[n-1] and divide through by */
6c7e7ed
@@ -214,7 +214,7 @@ void lrs_getdigits (long *a, long *b);	/
Jerry James 09e7566
 
Jerry James 09e7566
 void stringcpy (char *s, char *t);	/* copy t to s pointer version                            */
Jerry James 09e7566
 
Jerry James 09e7566
-void *xcalloc (long n, long s, long l, char *f);
Jerry James 09e7566
+void *xcalloc (long n, long s, long l, const char *f);
Jerry James 09e7566
 
Jerry James 09e7566
 void lrs_default_digits_overflow ();
Jerry James 09e7566
 void digits_overflow ();
6c7e7ed
--- lrsnash.c.orig	2018-04-30 00:41:10.000000000 -0600
6c7e7ed
+++ lrsnash.c	2018-10-31 14:44:27.251700675 -0600
6c7e7ed
@@ -116,7 +116,7 @@ int tl_readrat(long *num, long *den, cha
Jerry James ef75dda
 
Jerry James ef75dda
 
cdd8664
 //----------------------------------------------------------------------------------------//
cdd8664
-int readGame(game * g, char *filename)
cdd8664
+int readGame(game * g, const char *filename)
Jerry James ef75dda
 {
cdd8664
 	FILE *IN;
cdd8664
   long pos, s, t, nr, nc;
6c7e7ed
@@ -160,11 +160,11 @@ int readGame(game * g, char *filename)
cdd8664
 static long Print_game_flag;
cdd8664
 static long Standard_input_flag;
Jerry James ef75dda
 
cdd8664
-void printUsage(char *progname) {
cdd8664
+void printUsage(const char *progname) {
cdd8664
 	fprintf(stderr, Usage, progname, progname, progname);
cdd8664
 }
Jerry James ef75dda
 
cdd8664
-void printInfo(char *progname) {
cdd8664
+void printInfo(const char *progname) {
cdd8664
 	fprintf(stderr, Helptext, progname, progname);
cdd8664
 }
Jerry James ef75dda
 
6c7e7ed
@@ -250,7 +250,7 @@ int getArgs(int argc, char **argv)
cdd8664
 
cdd8664
 //----------------------------------------------------------------------------------------//
cdd8664
 // Checks if an input file is legacy (contains letters)
cdd8664
-int isLegacy(char *filename) {
cdd8664
+int isLegacy(const char *filename) {
cdd8664
 	FILE *fp;
cdd8664
 	int i, n, foundLetter = FALSE;
cdd8664
 	char buf[100];
6c7e7ed
--- lrsnashlib.c.orig	2018-04-30 00:41:10.000000000 -0600
6c7e7ed
+++ lrsnashlib.c	2018-10-31 14:44:27.251700675 -0600
cdd8664
@@ -25,7 +25,7 @@
cdd8664
 //========================================================================
cdd8664
 int lrs_solve_nash(game * g)
cdd8664
 {
cdd8664
-  lrs_dic *P1, *P2;             /* structure for holding current dictionary and indices */
cdd8664
+  lrs_dic *P1;                  /* structure for holding current dictionary and indices */
cdd8664
   lrs_dat *Q1, *Q2;             /* structure for holding static problem data            */
cdd8664
 
cdd8664
   lrs_mp_vector output1;        /* holds one line of output; ray,vertex,facet,linearity */
cdd8664
@@ -325,14 +325,12 @@ lrs_getfirstbasis2(lrs_dic ** D_p, lrs_d
36fd7e5
 /* assign local variables to structures */
36fd7e5
 
36fd7e5
   lrs_mp_matrix A;
36fd7e5
-  long *B, *C, *Row, *Col;
36fd7e5
+  long *B, *C, *Col;
36fd7e5
   long *inequality;
36fd7e5
   long *linearity;
36fd7e5
   long hull = Q->hull;
36fd7e5
   long m, d, lastdv, nlinearity, nredundcol;
36fd7e5
 
cdd8664
-  static long ocount = 0;
36fd7e5
-
36fd7e5
   m = D->m;
36fd7e5
   d = D->d;
cdd8664
   lastdv = Q->lastdv;
cdd8664
@@ -344,7 +342,6 @@ lrs_getfirstbasis2(lrs_dic ** D_p, lrs_d
36fd7e5
   A = D->A;
36fd7e5
   B = D->B;
36fd7e5
   C = D->C;
36fd7e5
-  Row = D->Row;
36fd7e5
   Col = D->Col;
36fd7e5
   inequality = Q->inequality;
36fd7e5
 
cdd8664
@@ -459,7 +456,6 @@ lrs_getfirstbasis2(lrs_dic ** D_p, lrs_d
cdd8664
 
cdd8664
   if (Q->verbose) {
cdd8664
     fprintf(lrs_ofp, "\nNumber of pivots for starting dictionary: %ld", Q->count[3]);
cdd8664
-    ocount = Q->count[3];
cdd8664
   }
36fd7e5
 
36fd7e5
 /* Do dual pivots to get primal feasibility */
cdd8664
@@ -467,14 +463,12 @@ lrs_getfirstbasis2(lrs_dic ** D_p, lrs_d
cdd8664
     if (Q->verbose) {
cdd8664
       fprintf(lrs_ofp, "\nNumber of pivots for feasible solution: %ld", Q->count[3]);
cdd8664
       fprintf(lrs_ofp, " - No feasible solution");
cdd8664
-      ocount = Q->count[3];
36fd7e5
     }
cdd8664
     return FALSE;
cdd8664
   }
cdd8664
 
cdd8664
   if (Q->verbose) {
cdd8664
     fprintf(lrs_ofp, "\nNumber of pivots for feasible solution: %ld", Q->count[3]);
cdd8664
-    ocount = Q->count[3];
cdd8664
   }
cdd8664
 
cdd8664
 /* Now solve LP if objective function was given */
cdd8664
@@ -768,7 +762,7 @@ long lrs_nashoutput(lrs_dat * Q, lrs_mp_
cdd8664
 int lrs_solve_nash_legacy (int argc, char *argv[])
cdd8664
 // Handles legacy input files
cdd8664
 {
cdd8664
-  lrs_dic *P1,*P2;		/* structure for holding current dictionary and indices */
cdd8664
+  lrs_dic *P1;			/* structure for holding current dictionary and indices */
cdd8664
   lrs_dat *Q1,*Q2;		/* structure for holding static problem data            */
cdd8664
 
cdd8664
   lrs_mp_vector output1;	/* holds one line of output; ray,vertex,facet,linearity */