diff -urP OpenProofPower-2.8.1/CHANGES OpenProofPower-2.8.1p1/CHANGES
--- OpenProofPower-2.8.1/CHANGES	2009-08-28 15:27:58.000000000 +0100
+++ OpenProofPower-2.8.1p1/CHANGES	2009-09-09 17:40:40.000000000 +0100
@@ -1,8 +1,23 @@
 ================================================================================
-/home/rda/opp/RCS/CHANGES,v 1.157 2009/08/15 12:35:29 rda Exp
+/home/rda/opp/RCS/CHANGES,v 1.158 2009/09/06 16:10:07 rda Exp
 
 ProofPower Changes History
 ================================================================================
+2.8.1pN
+
+PPXpp:
+
+1) xpp now works with 64 bit implementations of X Windows and Motif
+(and the code has been tidied up to make it more portable generally).
+
+2) Bugs in the working of the options tool have been fixed.
+
+PPHol:
+
+1) With some interim versions of Poly/ML the build would loop because
+of a problem with printing circular data structures. The make file has been
+changed so that this no longer happens.
+
 2.8.1
 
 General: ProofPower now builds on Poly/ML version 5.2 or later.
diff -urP OpenProofPower-2.8.1/README OpenProofPower-2.8.1p1/README
--- OpenProofPower-2.8.1/README	2009-08-28 15:27:58.000000000 +0100
+++ OpenProofPower-2.8.1p1/README	2009-09-09 17:40:40.000000000 +0100
@@ -1,7 +1,7 @@
 ================================================================================
-$Header: /home/rda/opp/RCS/README.opp.src,v 1.42 2009/08/27 15:24:40 rda Exp $
+/home/rda/opp/RCS/README.opp.src,v 1.42 2009/08/27 15:24:40 rda Exp
 
-This is the README file for the Open ProofPower product suite, version 2.8.1
+This is the README file for the Open ProofPower product suite, version 2.8.1p1
 The open source suite comprises the following five packages:
 
  PPTex - The ProofPower documentation preparation system
@@ -45,12 +45,12 @@
 
 WHAT YOU DO:
 
-A) Unpack the tarball OpenProofPower-2.8.1.tgz working in an empty directory
+A) Unpack the tarball OpenProofPower-2.8.1p1.tgz working in an empty directory
 of your choice. E.g., 
 
         mkdir $HOME/pp_bld
         cd $HOME/pp_bld
-        gunzip -c </tmp/OpenProofPower-2.8.1.tgz | tar xvf -
+        gunzip -c </tmp/OpenProofPower-2.8.1p1.tgz | tar xvf -
 
 B) Run the "configure" script:
 
@@ -241,7 +241,7 @@
 The "configure" script inspects the environment and various aspects of your
 system and uses these to generate a script "install" which actually builds and
 installs the software. The scripts are run in the build directory
-OpenProofPower-2.8.1 created when you unpack the OpenProofPower tarball.
+OpenProofPower-2.8.1p1 created when you unpack the OpenProofPower tarball.
 
 To run these scripts you need write access to the build directory and to the
 directory selected as the ProofPower home directory (see below).  The scripts
@@ -254,16 +254,16 @@
 call "./configure".  For example, you can set the parameter PPHOME to specify
 your choice for the ProofPower home directory (i.e. the directory where the
 ProofPower software is installed) and you can set PPCOMPILER to specify which
-Standard ML compiler to use.  Thus to tell "configure" to use /opt/pp-2.8.1
+Standard ML compiler to use.  Thus to tell "configure" to use /opt/pp-2.8.1p1
 for the ProofPower home directory and to compile using Standard ML of New
 Jersey, you would use the following:
 
-        PPHOME=/opt/pp-2.8.1 PPCOMPILER=SMLNJ ./configure
+        PPHOME=/opt/pp-2.8.1p1 PPCOMPILER=SMLNJ ./configure
 
 The above example is for the Bourne shell or similar. If you are
 using the C shell, the above example would read:
 
-        setenv PPHOME /opt/pp-2.8.1
+        setenv PPHOME /opt/pp-2.8.1p1
         setenv PPCOMPILER SMLNJ
         ./configure
 
diff -urP OpenProofPower-2.8.1/configure OpenProofPower-2.8.1p1/configure
--- OpenProofPower-2.8.1/configure	2009-08-28 15:27:58.000000000 +0100
+++ OpenProofPower-2.8.1p1/configure	2009-09-09 17:40:40.000000000 +0100
@@ -9,7 +9,7 @@
 #
 # Contact: Rob Arthan < rda@lemma-one.com >
 #
-# $Id: configure.sh,v 1.49 2009/08/26 16:52:05 rda Exp $
+# configure.sh,v 1.50 2009/09/09 16:39:57 rda Exp
 #
 # Environment variables may be used to force various decisions:
 #
@@ -60,6 +60,13 @@
 #                    (default: the lib subdirectory of the Poly/ML
 #                    installation directory on the local system).
 #
+# PPPOLYLINKFLAGS  - any extra flags needed to link poly programs.
+#                    e.g., '-arch i386' to get a 32-bit executable if
+#                    64-bit is the default. Or '-segprot POLY rwx rwx'
+#                    to work around a permissions problem on Mac OS X 10.6
+#                    with 64-bit executables (default is '-segprot POLY rwx rwx'
+#                    on MacOS X, empty string otherwise).
+#
 # If any of these is an empty string, it is treated as if it were unset.
 #
 # PPTARGETDIR is for developers who may want to test this script while
@@ -244,6 +251,10 @@
 		if	[ ! -f "$PPPOLYHOME"/lib/libpolymain.a ]
 		then	give_up "The file \"$PPPOLYHOME/lib/libpolymain.a\" does not exist"
 		fi
+		if	uname -a | grep -i darwin >/dev/null
+		then	POLYLINKFLAGS="${PPPOLYLINKFLAGS:--segprot POLY rwx rwx}"
+		else	POLYLINKFLAGS="${PPPOLYLINKFLAGS:-}"
+		fi
 		echo "Using Poly/ML from $PPPOLYHOME"
 	elif	[ "$PPCOMPILER" = SMLNJ ]
 	then	if	! find_in_path .arch-n-opsys >/dev/null 2>&1
@@ -304,10 +315,8 @@
 	elif	[ -d /sw/include/Xm ]
 	then	PPMOTIFHOME=/sw
 	fi
-	if	[ "${PPMOTIFHOME:-}" != "" ]
-	then	USERCFLAGS="-I\"$PPMOTIFHOME\"/include $USERCFLAGS"
-		USERCLIBS="-L\"$PPMOTIFHOME\"/lib $USERCLIBS"
-	else	warn 'Motif installation not found'
+	if	[ "${PPMOTIFHOME:-}" == "" ]
+	then	warn 'Motif installation not found'
 	fi
 fi
 #
@@ -395,6 +404,7 @@
 	out 'LD_LIBRARY_PATH="$PPPOLYHOME/lib"'
 	out 'export LD_LIBRARY_PATH'
 fi
+declare_quoted POLYLINKFLAGS
 out 'PATH="$PPBUILDDIR/src:$PATH"'
 out 'PPHOME="$PPTARGETDIR"'
 out 'PPDATABASEPATH="$PPBUILDDIR/src"'
@@ -404,7 +414,7 @@
 out 'BSTINPUTS=".:$PPTARGETDIR/tex:$PPTARGETDIR/doc:$BSTINPUTS:"'
 out 'export LC_ALL PPCACHESIZE PPCOMPILER PPMOTIFLINKING PPTARGETDIR'
 out 'export PPHOME PATH PPDATABASEPATH PPETCPATH PPPOLYHOME'
-out 'export TEXINPUTS BIBINPUTS BSTINPUTS'
+out 'export POLYLINKFLAGS TEXINPUTS BIBINPUTS BSTINPUTS USERCFLAGS USERCLIBS'
 out 'give_up(){'
 out '	echo "install: installation failed; see $1 for more details"'
 out '	exit 1'
diff -urP OpenProofPower-2.8.1/patches/patch-2.8.1.rda.090909.txt OpenProofPower-2.8.1p1/patches/patch-2.8.1.rda.090909.txt
--- OpenProofPower-2.8.1/patches/patch-2.8.1.rda.090909.txt	1970-01-01 01:00:00.000000000 +0100
+++ OpenProofPower-2.8.1p1/patches/patch-2.8.1.rda.090909.txt	2009-09-10 16:26:40.000000000 +0100
@@ -0,0 +1,20 @@
+
+Date: 9th September 2009
+Source: Rob Arthan rda@lemma-one.com
+Purpose: Makes ProofPower version 2.8.1 work with 64-bit architectures
+Description:
+This patch makes the ProofPower packages compatible with developer kits
+such as the Xcode tools supplied with Mac OS X 10.6 that default to
+64-bit compilation.
+
+To apply, patch the source as usual, e.g.,:
+
+        cd $HOME/bld/OpenProofPower-2.8.1
+        gunzip -c /tmp/patch-2.8.1.rda.090909.gz | patch -p1 -b -B orig/
+
+Then follow the usual instructions for installation in the README file.
+
+Alternatively a patched version of the source is supplied on the ProofPower
+website for download. See:
+
+http://www.lemma-one.com/ProofPower/getting/versions/OpenProofPower-2.8.1p1.tgz
diff -urP OpenProofPower-2.8.1/src/CHANGES OpenProofPower-2.8.1p1/src/CHANGES
--- OpenProofPower-2.8.1/src/CHANGES	2009-08-28 15:27:54.000000000 +0100
+++ OpenProofPower-2.8.1p1/src/CHANGES	2009-09-09 17:40:38.000000000 +0100
@@ -1,8 +1,23 @@
 ================================================================================
-/home/rda/opp/bld/RCS/CHANGES,v 1.157 2009/08/15 12:35:29 rda Exp
+/home/rda/opp/bld/RCS/CHANGES,v 1.158 2009/09/06 16:10:07 rda Exp
 
 ProofPower Changes History
 ================================================================================
+2.8.1pN
+
+PPXpp:
+
+1) xpp now works with 64 bit implementations of X Windows and Motif
+(and the code has been tidied up to make it more portable generally).
+
+2) Bugs in the working of the options tool have been fixed.
+
+PPHol:
+
+1) With some interim versions of Poly/ML the build would loop because
+of a problem with printing circular data structures. The make file has been
+changed so that this no longer happens.
+
 2.8.1
 
 General: ProofPower now builds on Poly/ML version 5.2 or later.
diff -urP OpenProofPower-2.8.1/src/cmdline.c OpenProofPower-2.8.1p1/src/cmdline.c
--- OpenProofPower-2.8.1/src/cmdline.c	2009-08-28 15:27:58.000000000 +0100
+++ OpenProofPower-2.8.1p1/src/cmdline.c	2009-09-09 17:40:40.000000000 +0100
@@ -1,6 +1,6 @@
 
 /* **** **** **** **** **** **** **** **** **** **** **** ****
- * cmdline.c,v 2.36 2009/06/20 14:35:30 rda Exp
+ * cmdline.c,v 2.37 2009/09/06 14:50:50 rda Exp
  *
  * cmdline.c -  single line command window for the X/Motif
  *		ProofPower Interface
@@ -41,7 +41,6 @@
 	cmd_modify_cb(CALLBACK_ARGS),
 	add_cb(CALLBACK_ARGS),
 	delete_cb(CALLBACK_ARGS),
-	focus_cb(CALLBACK_ARGS),
 	cmd_set_cb(CALLBACK_ARGS),
 	empty_cmd_cb(CALLBACK_ARGS);
 
@@ -131,9 +130,6 @@
 	Arg args[12];
 	int i, j;
 
-	XmFontList fontlist;
-
-
 	if((cmd_line_data.shell_w) != NULL) {
 		XtManageChild(cmd_line_data.manager_w);
 		XtPopup(cmd_line_data.shell_w, XtGrabNone);
diff -urP OpenProofPower-2.8.1/src/dev.mkf OpenProofPower-2.8.1p1/src/dev.mkf
--- OpenProofPower-2.8.1/src/dev.mkf	2009-08-28 15:27:51.000000000 +0100
+++ OpenProofPower-2.8.1p1/src/dev.mkf	2009-09-09 17:40:36.000000000 +0100
@@ -1,6 +1,6 @@
 ######################################################################
 #
-#	dev.mkf from $Header: /home/rda/opp/bld/RCS/dev.mkf,v 1.51 2009/04/21 10:14:19 rda Exp $
+#	dev.mkf from $Header: /home/rda/opp/bld/RCS/dev.mkf,v 1.53 2009/09/09 16:39:57 rda Exp $
 #
 #	makefile for the for the ProofPower development tools
 #
@@ -66,7 +66,7 @@
 SLRPSTARTCMD= \
  	{	{ echo "$(SLRPSTARTMLCMD)" | poly ; } && \
 		LD_RUN_PATH=$(LD_RUN_PATH) \
-			cc -o slrp-ml pp-ml.o \
+			c++ $(POLYLINKFLAGS) -o slrp-ml pp-ml.o \
 				-L$(POLYLIBDIR) -lpolymain -lpolyml && \
 		{ echo "$(SLRPMAKEDBCMD)" | slrp-ml ; }	}
 # Command to run ML
diff -urP OpenProofPower-2.8.1/src/files.c OpenProofPower-2.8.1p1/src/files.c
--- OpenProofPower-2.8.1/src/files.c	2009-08-28 15:27:58.000000000 +0100
+++ OpenProofPower-2.8.1p1/src/files.c	2009-09-09 17:40:40.000000000 +0100
@@ -1,6 +1,6 @@
 
 /* **** **** **** **** **** **** **** **** **** **** **** ****
- * files.c,v 2.43 2009/06/28 10:50:18 rda Exp
+ * files.c,v 2.46 2009/09/06 14:50:50 rda Exp
  *
  * files.c -  file operations for the X/Motif ProofPower Interface
  *
@@ -23,6 +23,7 @@
  * **** **** **** **** **** **** **** **** **** **** **** **** */
 
 #include <string.h>
+#include <stdlib.h>
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -293,7 +294,7 @@
 	FileType	*file_type_return)
 {
 	struct stat status;
-	NAT siz;
+	Cardinal siz;
 	FILE *fp;
 	char *buf, *p;
 	int whatgot;
@@ -541,6 +542,7 @@
 			file_type = MSDOS;
 			break;
 		case FT_BINARY:
+		default:
 			file_type = UNIX;
 			if(binary) {
 				*binary = True;
@@ -577,7 +579,7 @@
 	char	**backup_name)
 {
 	struct stat status, bu_status;
-	NAT siz;
+	Cardinal siz;
 	FILE *fp, *backup_fp;
 	const char *suffix = ".xpp.backup";
 
@@ -620,7 +622,7 @@
 	} else {
 		char buf[BUFSIZ];
 		size_t bytes_read;
-		while(bytes_read = fread(buf, 1, BUFSIZ, fp)) {
+		while((bytes_read = fread(buf, 1, BUFSIZ, fp))) {
 			if(fwrite(buf, 1, bytes_read, backup_fp)
 					!= bytes_read) {
 				Boolean reply;
@@ -679,7 +681,7 @@
 	p = buf;
 	while(*p && !ferror(fp)) {
 		if(*p == '\n') {
-			fprintf(fp, eoln);
+			fprintf(fp, "%s", eoln);
 		} else {
 			putc(*p, fp);
 		}
@@ -708,7 +710,6 @@
 
 FileStatus check_file_status(char *name)
 {
-	char *buf;
 	struct stat new_status;
 	if(name == NULL) {
 		return FS_OK;
@@ -1078,7 +1079,7 @@
 	static char *name = panic_save_name + 5; /* skip "/tmp/" */
 	static int fd;
 	static FILE *fp;
-	static NAT bytes_written, success, i;
+	static Cardinal bytes_written, success, i;
 	if(!*name) { /* set_panic_save_name has not been called */
 		strcpy(panic_save_name, "/tmp/xpp.panic.XXXXXX");
 	}
@@ -1088,7 +1089,7 @@
 		name = panic_save_name;
 		strcpy(name + strlen(name) - 6, "XXXXXX");
 		if((fd = mkstemp(name)) < 0 ) {
-			fprintf(stderr, panic_file_cant_be_opened);
+			fprintf(stderr, "%s", panic_file_cant_be_opened);
 			return;
 		}
 	}
diff -urP OpenProofPower-2.8.1/src/hol.mkf OpenProofPower-2.8.1p1/src/hol.mkf
--- OpenProofPower-2.8.1/src/hol.mkf	2009-08-28 15:27:55.000000000 +0100
+++ OpenProofPower-2.8.1p1/src/hol.mkf	2009-09-09 17:40:38.000000000 +0100
@@ -1,6 +1,6 @@
 ######################################################################
 #
-#	hol.mkf from $Header: /home/rda/opp/bld/RCS/hol.mkf,v 1.82 2009/04/21 10:13:54 rda Exp $
+#	hol.mkf from $Header: /home/rda/opp/bld/RCS/hol.mkf,v 1.86 2009/09/09 16:39:57 rda Exp $
 #
 #	makefile for the HOL database for ProofPower
 #
@@ -67,7 +67,7 @@
 HOLSTARTCMD= \
 	{	{ echo "$(HOLSTARTMLCMD)" | poly ; } && \
 		LD_RUN_PATH=$(LD_RUN_PATH) \
-			cc -o pp-ml pp-ml.o \
+			c++ $(POLYLINKFLAGS) -o pp-ml pp-ml.o \
 				-L$(POLYLIBDIR) -lpolymain -lpolyml && \
 		{ echo "$(HOLMAKEDBCMD)" | pp-ml ; } }
 # Command to run ML
@@ -1357,7 +1357,7 @@
 dtd016.ldd: imp014.ldd
 dtd022.ldd: imp016.ldd
 dtd023.ldd: imp022.ldd
-dtd024.ldd: imp023.ldd
+dtd024.ldd: imp022.ldd
 dtd031.ldd: imp024.ldd
 dtd032.ldd: imp031.ldd
 dtd025.ldd: imp032.ldd
@@ -1416,7 +1416,7 @@
 imp014.ldd: dtd014.ldd
 imp016.ldd: dtd016.ldd
 imp022.ldd: dtd022.ldd
-imp023.ldd: dtd023.ldd
+imp023.ldd: dtd023.ldd imp025.ldd
 imp024.ldd: dtd024.ldd
 imp031.ldd: dtd031.ldd
 imp032.ldd: dtd032.ldd
diff -urP OpenProofPower-2.8.1/src/imp096.doc OpenProofPower-2.8.1p1/src/imp096.doc
--- OpenProofPower-2.8.1/src/imp096.doc	2009-08-28 15:27:58.000000000 +0100
+++ OpenProofPower-2.8.1p1/src/imp096.doc	2009-09-09 17:40:40.000000000 +0100
@@ -7,15 +7,15 @@
 
 Contact: Rob Arthan < rda@lemma-one.com >
 *******************************************************************************/
-/* $Id: imp096.doc,v 1.27 2004/01/26 12:09:45 rda Exp $
+/* $Id: imp096.doc,v 1.29 2009/09/06 14:50:50 rda Exp $
 
 =TEX
-% $Id: imp096.doc,v 1.27 2004/01/26 12:09:45 rda Exp $
+% $Id: imp096.doc,v 1.29 2009/09/06 14:50:50 rda Exp $
 \documentstyle[11pt,TQ,hol1]{article}
 
 \TPPtitle{Sieve and Findfile Utilities}
 \TPPref{DS/FMU/IED/IMP096}
-\def\SCCSissue{$Revision: 1.27 $
+\def\SCCSissue{$Revision: 1.29 $
 }
 
 =IGNORE
@@ -136,6 +136,7 @@
 it would be nicer, later, to make more use of it rather than less.
 \item[Issues 1.25, 1.26] Now uses PPETCPATH rather than PATH as the environment variable to find steering files.
 \item[Issue 1.27] Other than when used with the -r option, findfile now looks for regular files only.
+\item[Issue 1.27] Addressed all warnings form {\tt gcc} for {\tt x86\_64}.
 \end{description}
 
 %********************************************************************
@@ -425,7 +426,7 @@
 =SIEVE_PROG
 */
 char *program_name = "sieve";
-char *coprlemma1 = "$Id: imp096.doc,v 1.27 2004/01/26 12:09:45 rda Exp $" " Copyright Lemma 1 Ltd. 2003";
+char *coprlemma1 = "$Id: imp096.doc,v 1.29 2009/09/06 14:50:50 rda Exp $" " Copyright Lemma 1 Ltd. 2003";
 /*
 =TEX
 
@@ -695,7 +696,7 @@
 error1(char *msg)
 {
 	error_top();
-	FPRINTF(stderr, msg);
+	FPRINTF(stderr, "%s", msg);
 	PUTC('\n', stderr);
 }
 
@@ -1116,7 +1117,7 @@
 	}
 
 	if(kwty == NULL) PRINTF("?(%d)", kind);
-	else PRINTF(kwty);
+	else PRINTF("%s", kwty);
 }
 /*
 =TEX
@@ -1136,7 +1137,7 @@
 		show_kw_kind(ki->orig_kind);
 		PUTC(')', stdout);
 	}
-	PRINTF("  name=(%d)",		strlen(ki->name));
+	PRINTF("  name=(%ld)",		(long)strlen(ki->name));
 	PRINTF("'%s'",			ki->name);
 	PRINTF("  macro='%s'\n",	ki->macro ? ki->macro : "(None)");
 }
@@ -1867,7 +1868,7 @@
 	int i;
 	int j;
 
-	(void)printf("  %d actions available\n", NUM_ACTIONS);
+	(void)printf("  %ld actions available\n", (long) NUM_ACTIONS);
 	for(i=0; i<NUM_ACTIONS; i++) {
 		(void)printf("%5d %10s %2d %2d %4d = %s",
 			i,
@@ -4661,8 +4662,8 @@
 			di->cat, di->num_dl_args);
 
 		for(i=0; i<=di->num_dl_args; i++) {
-			(void)printf("    %d %4d '", i,
-				strlen(di->dl_words[i]));
+			(void)printf("    %d %4ld '", i,
+				(long)strlen(di->dl_words[i]));
 			for(j=0; (ch = (di->dl_words[i][j]) & 0xFF) != '\0'; j++) {
 				if((isascii(ch) && isprint(ch)) || ch > 127)
 					PUTC(ch, stdout);
@@ -5115,7 +5116,7 @@
 =FIND_FILE_FUN
 */
 #ifndef SIEVE_PROG
-char *coprlemma1 = "$Id: imp096.doc,v 1.27 2004/01/26 12:09:45 rda Exp $" " Copyright Lemma 1 Ltd. 2003";
+char *coprlemma1 = "$Id: imp096.doc,v 1.29 2009/09/06 14:50:50 rda Exp $" " Copyright Lemma 1 Ltd. 2003";
 #endif
 #include <pwd.h>
 #include <stdio.h>
@@ -5124,6 +5125,7 @@
 #include <sys/types.h>
 #include <sys/param.h>
 #include <sys/stat.h>
+#include <fcntl.h>
 #include <unistd.h>
 
 #define VoidStrcpy(a,b) { if(a != NULL) (void)strcpy(a, b); }
@@ -5345,8 +5347,8 @@
 {
 	int name_len, dir_len;
 	if (name == NULL) {
-		*dir == NULL;
-		*base == NULL;
+		*dir = NULL;
+		*base = NULL;
 		return;
 	}
 	name_len = strlen(name);
@@ -5415,7 +5417,6 @@
 char *
 get_real_name (char * name)
 {
-	struct stat st;
 	char *dir, *base, *cur_name, *res, buf[MAX_FILE_NAME_LEN+2];
 	int orig_cwd;
 	int loops;
@@ -5519,7 +5520,7 @@
 
 
 #ifndef NO_FINDFILE_MAIN
-char *coprlemma1_ff = "$Id: imp096.doc,v 1.27 2004/01/26 12:09:45 rda Exp $" " Copyright Lemma 1 Ltd. 2003";
+char *coprlemma1_ff = "$Id: imp096.doc,v 1.29 2009/09/06 14:50:50 rda Exp $" " Copyright Lemma 1 Ltd. 2003";
 extern char *find_file(char *name, char *dirs, int is_reg);
 #include<stdio.h>
 void	exit(int status);
diff -urP OpenProofPower-2.8.1/src/imp100.doc OpenProofPower-2.8.1p1/src/imp100.doc
--- OpenProofPower-2.8.1/src/imp100.doc	2009-08-28 15:27:56.000000000 +0100
+++ OpenProofPower-2.8.1p1/src/imp100.doc	2009-09-09 17:40:39.000000000 +0100
@@ -8,10 +8,10 @@
 
 Contact: Rob Arthan < rda@lemma-one.com >
 ********************************************************************************
-% imp100.doc  $Id: imp100.doc,v 1.25 2009/08/28 14:24:54 rda Exp $
+% imp100.doc  $Id: imp100.doc,v 1.25 2009/09/06 13:02:41 rda Exp $
 
 =TEX
-% imp100.doc  $Id: imp100.doc,v 1.25 2009/08/28 14:24:54 rda Exp $
+% imp100.doc  $Id: imp100.doc,v 1.25 2009/09/06 13:02:41 rda Exp $
 \documentstyle[11pt,TQ,hol1]{article}
 
 \TPPtitle{Implementation of Document Handling Commands for Solaris 2}
@@ -30,7 +30,7 @@
 =TEX
 
 \TPPissue{\SCCSissue}
-\TPPdate{\FormatDate{$Date: 2009/08/28 14:24:54 $%
+\TPPdate{\FormatDate{$Date: 2009/09/06 13:02:41 $%
 }}
 \TPPproject{FST}
 
@@ -97,6 +97,7 @@
 \item[Issues 0.19--1.22] Made scripts handle file names with spaces.
 \item[Issue 1.23] {\tt pptexenv} now uses {\tt eval} rather than {\tt sh -c} to make it work with {\tt pdflatex}.
 \item[Issue 1.24] Fixed {\tt doctex -e}.
+\item{Issue 1.25} Fixed problem with spaces in directory names.
 \end{description}
 
 %********************************************************************
@@ -235,7 +236,7 @@
 
 =DUMP doctex
 #! /bin/sh
-#	doctex   From: $Id: imp100.doc,v 1.25 2009/08/28 14:24:54 rda Exp $
+#	doctex   From: $Id: imp100.doc,v 1.25 2009/09/06 13:02:41 rda Exp $
 #
 # Shell script to strip ".doc" files creating ".tex" files.
 
@@ -338,7 +339,7 @@
 
 =DUMP docsml
 #! /bin/sh
-#	docsml   From: $Id: imp100.doc,v 1.25 2009/08/28 14:24:54 rda Exp $
+#	docsml   From: $Id: imp100.doc,v 1.25 2009/09/06 13:02:41 rda Exp $
 
 PROGNAME=`basename "$0"`
 USAGE="$PROGNAME [-v] [-f view_file] [-K] [-k keyword_file] <file> ..."
@@ -433,7 +434,7 @@
 
 =DUMP doctch
 #! /bin/sh
-#	doctch   From: $Id: imp100.doc,v 1.25 2009/08/28 14:24:54 rda Exp $
+#	doctch   From: $Id: imp100.doc,v 1.25 2009/09/06 13:02:41 rda Exp $
 
 PROGNAME=`basename "$0"`
 USAGE="$PROGNAME [-v] [-f view_file] [-K] [-k keyword_file] <file> ..."
@@ -521,7 +522,7 @@
 
 =DUMP doctds
 #! /bin/sh
-#	doctds   From: $Id: imp100.doc,v 1.25 2009/08/28 14:24:54 rda Exp $
+#	doctds   From: $Id: imp100.doc,v 1.25 2009/09/06 13:02:41 rda Exp $
 
 PROGNAME=`basename $0`
 USAGE="$PROGNAME [-v] [-f view_file] [-K] [-k keyword_file] <file> ..."
@@ -615,7 +616,7 @@
 
 =DUMP texdvi
 #! /bin/sh
-#	texdvi   From: $Id: imp100.doc,v 1.25 2009/08/28 14:24:54 rda Exp $
+#	texdvi   From: $Id: imp100.doc,v 1.25 2009/09/06 13:02:41 rda Exp $
 
 PROGNAME=`basename "$0"`
 USAGE="$PROGNAME [-v] [-p TeX_program] <file> ..."
@@ -720,7 +721,7 @@
 
 =DUMP docdvi
 #! /bin/sh
-#	docdvi   From: $Id: imp100.doc,v 1.25 2009/08/28 14:24:54 rda Exp $
+#	docdvi   From: $Id: imp100.doc,v 1.25 2009/09/06 13:02:41 rda Exp $
 
 PROGNAME=`basename "$0"`
 USAGE="$PROGNAME [-v] [-e edit_script] [-f view_file] [-K] [-k keyword_file]"
@@ -817,7 +818,7 @@
 {\hfuzz 2.2pt
 =DUMP docpr
 #! /bin/sh
-#	docpr   From: $Id: imp100.doc,v 1.25 2009/08/28 14:24:54 rda Exp $
+#	docpr   From: $Id: imp100.doc,v 1.25 2009/09/06 13:02:41 rda Exp $
 
 PROGNAME=`basename "$0"`
 USAGE="$PROGNAME [-n] [-p] [-s] [-v] [-w width] <filename> ..."
@@ -939,7 +940,7 @@
 
 =DUMP conv_temp
 #! /bin/sh
-#	conv_ascii/conv_extended   From: $Id: imp100.doc,v 1.25 2009/08/28 14:24:54 rda Exp $
+#	conv_ascii/conv_extended   From: $Id: imp100.doc,v 1.25 2009/09/06 13:02:41 rda Exp $
 
 PROGNAME=`basename "$0"`
 USAGE="$PROGNAME [-v] [-K] [-k keyword_file] <file> ..."
@@ -1042,7 +1043,7 @@
 
 =DUMP pptexenv
 #! /bin/sh
-#	pptexenv   From: $Id: imp100.doc,v 1.25 2009/08/28 14:24:54 rda Exp $
+#	pptexenv   From: $Id: imp100.doc,v 1.25 2009/09/06 13:02:41 rda Exp $
 
 PROGNAME=`basename "$0"`
 USAGE="$PROGNAME [-v] command [options]"
diff -urP OpenProofPower-2.8.1/src/lineno.c OpenProofPower-2.8.1p1/src/lineno.c
--- OpenProofPower-2.8.1/src/lineno.c	2009-08-28 15:27:58.000000000 +0100
+++ OpenProofPower-2.8.1p1/src/lineno.c	2009-09-09 17:40:40.000000000 +0100
@@ -115,7 +115,6 @@
 
 Boolean add_line_no_tool(Widget text_w)
 {
-	NAT cbdata;
 	Widget shell, 
 		paned,
 		top_form,
@@ -124,10 +123,7 @@
 		line_no_text,
 		dismiss_btn,
 		help_btn;
-
-	char	*pattern;
 	int	i, j;
-
 	XmString s;
 	XmTextPosition last_pos;
 
@@ -340,7 +336,7 @@
 /* **** **** **** **** **** **** **** **** **** **** **** ****
  * go to line number callback.
  * **** **** **** **** **** **** **** **** **** **** **** **** */
-static void line_no_to_offset(Widget,NAT,long int*,long int*);
+static void line_no_to_offset(Widget,Cardinal,long int*,long int*);
 static void goto_line_no_cb(
 	Widget		w,
 	XtPointer	cbd,
@@ -427,7 +423,7 @@
  * **** **** **** **** **** **** **** **** **** **** **** **** */
 static void line_no_to_offset(
 	Widget		text_w,
-	NAT		line_no,
+	Cardinal	line_no,
 	long int	*first,
 	long int	*last)
 {
diff -urP OpenProofPower-2.8.1/src/mainw.c OpenProofPower-2.8.1p1/src/mainw.c
--- OpenProofPower-2.8.1/src/mainw.c	2009-08-28 15:27:58.000000000 +0100
+++ OpenProofPower-2.8.1p1/src/mainw.c	2009-09-09 17:40:40.000000000 +0100
@@ -27,6 +27,8 @@
  * **** **** **** **** **** **** **** **** **** **** **** **** */
 
 #include <stdio.h>
+#include <stdint.h>
+#include <stdlib.h>
 #include <string.h>
 
 #include "xpp.h"
@@ -55,8 +57,6 @@
 static char *want_to_continue =
 "Do you want to continue?";
 
-static char *confirm_save = "Confirm Save";
-
 static char *confirm_save_as = "Confirm Save As";
 
 static char *confirm_open = "Confirm Open";
@@ -136,7 +136,7 @@
 	journal;	/* global because needed in pterm.c */
 
 static Widget
-	frame, infobar, filelabel, filename, infolabel, newfile,
+	frame, infobar, filelabel, filename, infolabel,
 	namestring, logo, linenumber, lnpopup,
 	mainpanes, scriptpanes,
 	menubar, filemenu, toolsmenu, popupeditmenu, editmenu, winmenu,
@@ -428,7 +428,7 @@
 	scroll_pending = False;
 }
 
-void scroll_out(char *buf, NAT ct, Boolean ignored)
+void scroll_out(char *buf, Cardinal ct, Boolean ignored)
 {
 
 	XmTextPosition ins_pos, last_pos;
@@ -664,7 +664,7 @@
 	char	*file_name)
 {
 	Arg args[12];
-	NAT i;
+	Cardinal i;
 	XmString s1;
 	Atom WM_DELETE_WINDOW;
 	Widget *wp;
@@ -816,7 +816,7 @@
 	if( !global_options.edit_only ) {
 		Boolean editable;
 		Widget *children;
-		NAT num_children;
+		Cardinal num_children;
 
 		i = 0;
 		XtSetArg(args[i], XmNeditMode,	 		XmMULTI_LINE_EDIT); ++i;
@@ -934,7 +934,7 @@
 
 	{
 		Widget *btns;
-		NAT num_btns;
+		Cardinal num_btns;
 		XtVaGetValues(menubar,
 			XmNchildren, &btns,
 			XmNnumChildren, &num_btns, NULL);
@@ -1280,7 +1280,7 @@
 		XtPointer	cbd,
 		XtPointer	cbs)
 {
-	file_menu_op( (int) cbd, 0 );
+	file_menu_op( (int) (uintptr_t) cbd, 0 );
 }
 
 /*
@@ -1315,7 +1315,7 @@
 		set_menu_item_sensitivity(filemenu, FILE_MENU_REOPEN, False);
 		for(i = 0; i < MAX_REOPEN_MENU_ITEMS; i += 1) {
 			reopen_menu_items[i] = item_template;
-			reopen_menu_items[i].callback_data = (XtPointer) i;
+			reopen_menu_items[i].callback_data = (XtPointer) (uintptr_t) i;
 		}
 		return;
 	} /* else ... */
@@ -1358,7 +1358,7 @@
 {
 	char *old_fname, *fname;
 	Boolean old_named;
-	NAT i = (NAT) cbd;
+	Cardinal i = (uintptr_t) cbd;
 	old_fname = get_file_name();
 	fname = reopen_menu_items[i].label;
 	strcpy(fname,reopen_menu_items[i].label);
@@ -1538,7 +1538,7 @@
 		XtPointer	cbd,
 		XtPointer	cbs)
 {
-	NAT i = (NAT) cbd;
+	Cardinal i = (uintptr_t) cbd;
 	
 	if(!application_alive() && i != CMD_MENU_RESTART) {
 		ok_dialog(root, not_running_message);
@@ -1585,7 +1585,7 @@
 		XtPointer	cbd,
 		XtPointer	cbs)
 {
-	NAT i = (NAT)cbd;
+	Cardinal i = (uintptr_t) cbd;
 	switch(i) {
 	case HELP_MENU_ABOUT_XPP:
 		help_dialog(root, Help_About_Xpp);
@@ -1891,8 +1891,6 @@
 static void execute_command(void)
 {
 	char *cmd;
-	NAT len;
-	XmTextPosition dontcare;
 	if(global_options.edit_only) {
 		return;
 	}
diff -urP OpenProofPower-2.8.1/src/menus.c OpenProofPower-2.8.1p1/src/menus.c
--- OpenProofPower-2.8.1/src/menus.c	2009-08-28 15:27:58.000000000 +0100
+++ OpenProofPower-2.8.1p1/src/menus.c	2009-09-09 17:40:40.000000000 +0100
@@ -1,7 +1,7 @@
 
 
 /* **** **** **** **** **** **** **** **** **** **** **** ****
- * menus.c,v 2.13 2003/06/26 13:45:00 rda Exp
+ * menus.c,v 2.16 2009/09/06 14:50:50 rda Exp
  *
  * menus.c -  creation of menus for the X/Motif ProofPower
  * Interface
@@ -25,6 +25,7 @@
  * **** **** **** **** **** **** **** **** **** **** **** **** */
 
 #include "xpp.h"
+#include "ctype.h"
 
 static Widget setup_menu_aux(
 	Widget	parent,
@@ -150,7 +151,7 @@
 			menu_name, xmCascadeButtonGadgetClass, parent,
 			XmNsubMenuId,	menu,
 			XmNlabelString,	lab,
-			XmNmnemonic,	menu_mnemonic,
+			XmNmnemonic,	(KeySym)menu_mnemonic,
 			NULL);
 		XmStringFree(lab);
 	}
@@ -173,7 +174,6 @@
 	Boolean tear_off_enabled,
 	MenuItem        *items)
 {
-	Widget  cascade, menu;
 	if(type == XmMENU_POPUP) {
 		return 
 			setup_menu_aux(
@@ -198,8 +198,7 @@
 	MenuItem	*items)
 {
 	Widget *btns;
-	NAT num_btns;
-	Bool sens;
+	Cardinal num_btns;
 	int i;
 
 	XtVaGetValues(menu, XmNchildren, &btns,
diff -urP OpenProofPower-2.8.1/src/msg.c OpenProofPower-2.8.1p1/src/msg.c
--- OpenProofPower-2.8.1/src/msg.c	2009-08-28 15:27:58.000000000 +0100
+++ OpenProofPower-2.8.1p1/src/msg.c	2009-09-09 17:40:40.000000000 +0100
@@ -1,6 +1,6 @@
 
 /* **** **** **** **** **** **** **** **** **** **** **** ****
- * %Z% 2009/06/20 14:35:30 2.54 msg.c,v
+ * %Z% 2009/09/06 14:50:50 2.57 msg.c,v
  *
  * msg.c - support for message dialogues for the X/Motif ProofPower Interface
  *
@@ -25,6 +25,7 @@
  * include files: 
  * **** **** **** **** **** **** **** **** **** **** **** **** */
 #include <stdio.h>
+#include <stdlib.h>
 #include <ctype.h>
 #include "xpp.h"
 
@@ -37,12 +38,12 @@
  * at appropriate places to fit in lines of length line-len.
  * buf should be at least as long as msg
  * **** **** **** **** **** **** **** **** **** **** **** **** */
-static void c_format_msg(char *buf, char *msg, NAT line_len)
+static void c_format_msg(char *buf, char *msg, Cardinal line_len)
 {
 	char *p1, *p2, *pm;
 	unsigned cursor;
 	for(	p1 = buf, p2 = buf, pm = msg, cursor=0;
-		*p2 = *pm;
+		(*p2 = *pm);
 		++p2, ++pm ) {
 		if(*p2 == '\n') {
 			cursor = 0;
@@ -62,11 +63,9 @@
 	}
 }
 
-XmString format_msg(char *msg, NAT line_len)
+XmString format_msg(char *msg, Cardinal line_len)
 {
 	char *buf;
-	char *p1, *p2, *pm;
-	unsigned cursor;
 	XmString str;
 	if((buf = XtMalloc(strlen(msg) + 1)) == NULL) {
 		return(XmStringCreateLtoR(buf, XmFONTLIST_DEFAULT_TAG));
@@ -84,7 +83,6 @@
 {
 	Widget form, widget;
 	static Widget dialog, pane, help_text;
-	Atom WM_DELETE_WINDOW;
 	Dimension h;
 	Arg args[12];
 	int i;
@@ -98,8 +96,10 @@
 #endif
 		common_dialog_setup(dialog, popdown_cb, dialog);
 		pane = XtVaCreateWidget("pane", XMPANEDCLASS, dialog,
-			XmNsashWidth,  1, /* Motif won't let us set these to 0! */
-			XmNsashHeight, 1, /* Make small so user doesn't try to resize */
+				/* Motif won't let us set these to 0! */
+				/* Make small so user can't try to resize */
+			XmNsashWidth,  (Dimension) 1,
+			XmNsashHeight, (Dimension) 1,
 			NULL);
 		i = 0;
 		XtSetArg(args[i], XmNscrollVertical,        True); ++i;
@@ -124,8 +124,8 @@
 			XmNleftPosition,         2,
 			XmNrightAttachment,      XmATTACH_POSITION,
 			XmNrightPosition,        3,
-			XmNshowAsDefault,        True,
-			XmNdefaultButtonShadowThickness, 1,
+			XmNshowAsDefault,        (Dimension) XmEXTERNAL_HIGHLIGHT, /* sic! */
+			XmNdefaultButtonShadowThickness, (Dimension) XmEXTERNAL_HIGHLIGHT,
 			NULL);
 		XtAddCallback(widget, XmNactivateCallback, popdown_cb, dialog);
 		XtManageChild(form);
@@ -367,7 +367,7 @@
 	XtPointer	cbd,
 	XtPointer	cbs)
 {
-	NAT *reply = cbd;
+	Cardinal *reply = cbd;
 	XmAnyCallbackStruct *acbs = cbs;
 	switch (acbs->reason) {
 		case XmCR_OK:
@@ -386,7 +386,7 @@
 	XtPointer	cbd,
 	XtPointer	cbs)
 {
-	NAT *reply = cbd;
+	Cardinal *reply = cbd;
 	*reply = NO;
 }
 
@@ -395,7 +395,7 @@
 	XtPointer	cbd,
 	XtPointer	cbs)
 {
-	NAT *reply = cbd;
+	Cardinal *reply = cbd;
 	*reply = YES;
 }
 
@@ -404,7 +404,7 @@
 	XtPointer	cbd,
 	XtPointer	cbs)
 {
-	NAT *reply = cbd;
+	Cardinal *reply = cbd;
 	*reply = NO;
 }
 
@@ -413,7 +413,7 @@
 	XtPointer	cbd,
 	XtPointer	cbs)
 {
-	NAT *reply = cbd;
+	Cardinal *reply = cbd;
 	*reply = CANCEL;
 }
 
@@ -822,9 +822,9 @@
 			XmNtopAttachment,		XmATTACH_WIDGET,
 			XmNtopWidget,			cmd_label,
 			XmNbottomAttachment,		XmATTACH_FORM,
-			XmNleftAttachment,			XmATTACH_FORM,
+			XmNleftAttachment,		XmATTACH_FORM,
 			XmNrightAttachment,		XmATTACH_FORM,
-			XmNcolumns,			30,
+			XmNcolumns,			(short) 30,
 			NULL);
 
 		XtAddCallback(cmd_text, XmNactivateCallback, file_ok_cb, &reply);
@@ -906,7 +906,7 @@
 	XtPointer	cbd,
 	XtPointer	cbs)
 {
-	NAT *reply = cbd;
+	Cardinal *reply = cbd;
 	*reply = YES;
 }
 
@@ -915,7 +915,7 @@
 	XtPointer	cbd,
 	XtPointer	cbs)
 {
-	NAT *reply = cbd;
+	Cardinal *reply = cbd;
 	*reply = NO;
 }
 static void file_help_cb(
diff -urP OpenProofPower-2.8.1/src/options.c OpenProofPower-2.8.1p1/src/options.c
--- OpenProofPower-2.8.1/src/options.c	2009-08-28 15:27:58.000000000 +0100
+++ OpenProofPower-2.8.1p1/src/options.c	2009-09-09 17:40:40.000000000 +0100
@@ -1,6 +1,6 @@
 
 /* **** **** **** **** **** **** **** **** **** **** **** ****
- * options.c,v 2.32 2006/08/07 16:38:20 rda Exp
+ * options.c,v 2.36 2009/09/06 15:54:05 rda Exp
  *
  * options.c -  tools for setting up global option variables
  *
@@ -24,6 +24,7 @@
 
 
 #include <stdio.h>
+#include <stdint.h>
 #include <ctype.h>
 
 #include "xpp.h"
@@ -95,8 +96,8 @@
 			button_form,
 				apply_btn, current_btn, original_btn, dismiss_btn, help_btn;
 
-static char add_new_line_mode_mirror; /* mirrors value of the radio buttons */
-static char file_type_mirror; /* mirrors value of the file type menu  */
+static AddNewLineMode add_new_line_mode_mirror; /* mirrors value of the radio buttons */
+static FileType file_type_mirror; /* mirrors value of the file type menu  */
 
 static char *confirm_restart = "Confirm Restart";
 
@@ -233,7 +234,7 @@
 		XmNleftAttachment,		XmATTACH_POSITION,
 		XmNrightAttachment,		XmATTACH_FORM,
 		XmNleftPosition,		3,
-		XmNcolumns,			30,
+		XmNcolumns,			(short) 30,
 		NULL);
 
 	attach_rw_edit_popup(command_text);
@@ -264,7 +265,7 @@
 		XmNleftAttachment,		XmATTACH_POSITION,
 		XmNrightAttachment,		XmATTACH_FORM,
 		XmNleftPosition,		3,
-		XmNcolumns,			30,
+		XmNcolumns,			(short) 30,
 		NULL);
 
 	attach_rw_edit_popup(journal_max_text);
@@ -412,16 +413,19 @@
 			global_options.command_line);
 
 /* **** **** **** **** **** **** **** **** **** **** **** ****
- * use callbacks  as a handy way to store the values in the widgets
- * and initialize add_new_line_mode and file type
+ * use callback  as a handy way to store the values in the widgets
  * **** **** **** **** **** **** **** **** **** **** **** **** */
 
 	reset_cb(NULL, (XtPointer)&orig_global_options, NULL);
 
-	add_new_line_cb(NULL, NULL, NULL);
+/* **** **** **** **** **** **** **** **** **** **** **** ****
+ * initialize add new line mode mirror variable and set file type
+ * option to default of UNIX in original, current and mirror variables
+ * by calling set_file_type.
+ * **** **** **** **** **** **** **** **** **** **** **** **** */
 
+	add_new_line_mode_mirror = orig_global_options.add_new_line_mode;
 	set_file_type(UNIX);
-
 }
 
 /* **** **** **** **** **** **** **** **** **** **** **** ****
@@ -520,10 +524,13 @@
 }
 /* **** **** **** **** **** **** **** **** **** **** **** ****
  * set the file type:
+ * note that setting the history does not invoke the activate callbacks
+ * so we have to set the mirror variable.
  * **** **** **** **** **** **** **** **** **** **** **** **** */
 void set_file_type(FileType file_type)
 {
-	global_options.file_type = file_type;
+	orig_global_options.file_type = global_options.file_type = 
+				file_type_mirror = file_type;
 	XtVaSetValues(file_type_menu, XmNmenuHistory, file_type_buttons[file_type], NULL);
 }
 /* **** **** **** **** **** **** **** **** **** **** **** ****
@@ -598,6 +605,7 @@
 	XmToggleButtonSetState(read_only_toggle,
 		options->read_only, False);
 
+	file_type_mirror = options->file_type;
 	XtVaSetValues(file_type_menu, XmNmenuHistory, file_type_buttons[options->file_type], NULL);
 
 	if(command_text) {
@@ -621,6 +629,7 @@
 	}
 
 	if(add_new_line_radio_buttons) {
+		add_new_line_mode_mirror = options->add_new_line_mode;
 		XtVaGetValues(add_new_line_radio_buttons,
 			XmNchildren,		&btns, NULL);
 		XmToggleButtonSetState(
@@ -637,7 +646,7 @@
 	XtPointer	cbd,
 	XtPointer	cbs)
 {
-	add_new_line_mode_mirror = (int) cbd;
+	add_new_line_mode_mirror = (AddNewLineMode) (uintptr_t) cbd;
 }
 /* **** **** **** **** **** **** **** **** **** **** **** ****
  * File type callback.
@@ -647,5 +656,5 @@
 		XtPointer	cbd,
 		XtPointer	cbs)
 {
-	file_type_mirror = (int)cbd;
+	file_type_mirror = (FileType) (uintptr_t) cbd;
 }
diff -urP OpenProofPower-2.8.1/src/palette.c OpenProofPower-2.8.1p1/src/palette.c
--- OpenProofPower-2.8.1/src/palette.c	2009-08-28 15:27:58.000000000 +0100
+++ OpenProofPower-2.8.1p1/src/palette.c	2009-09-09 17:40:40.000000000 +0100
@@ -22,6 +22,7 @@
  * include files: 
  * **** **** **** **** **** **** **** **** **** **** **** **** */
 #include <stdio.h>
+#include <stdint.h>
 #include <ctype.h>
 #include <Xm/DialogS.h>
 #include <Xm/MainW.h>
@@ -215,7 +216,8 @@
 		lab = XmStringCreateSimple(no_config_msg);
 		top_form = XtVaCreateWidget("message",
 			xmLabelWidgetClass, paned,
-			XmNlabelString, lab);
+			XmNlabelString, lab,
+			NULL);
 		XmStringFree(lab);
 	} else {
 
@@ -256,7 +258,7 @@
 				XmStringFree(lab);
 				cbdata = pretty_char;
 				XtAddCallback(button, XmNactivateCallback, type_char_cb,
-					(XtPointer) cbdata);
+					(XtPointer) (uintptr_t) cbdata);
 			}
 		}
 		XtFree((void*)palette_config);
@@ -344,7 +346,7 @@
 	XtPointer	cbd,
 	XtPointer	cbs)
 {
-	NAT cbdata = (NAT) cbd;
+	Cardinal cbdata = (uintptr_t) cbd;
 	char buf[2];
 	XmTextPosition start, end;
 	Widget text_w = palette_info.text_w;
diff -urP OpenProofPower-2.8.1/src/pterm.c OpenProofPower-2.8.1p1/src/pterm.c
--- OpenProofPower-2.8.1/src/pterm.c	2009-08-28 15:27:58.000000000 +0100
+++ OpenProofPower-2.8.1p1/src/pterm.c	2009-09-09 17:40:40.000000000 +0100
@@ -1,5 +1,5 @@
 /* **** **** **** **** **** **** **** **** **** **** **** ****
- * pterm.c,v 2.56 2008/09/12 15:20:52 rda Exp
+ * pterm.c,v 2.59 2009/09/06 14:50:50 rda Exp
  *
  * pterm.c -  pseudo-terminal operations for the X/Motif ProofPower
  * Interface
@@ -184,6 +184,7 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <stdio.h>
+#include <stdint.h>
 #include <string.h>
 #include <sys/ioctl.h>
 #include <signal.h>
@@ -198,14 +199,15 @@
 
 
 /* **** **** **** **** **** **** **** **** **** **** **** ****
- * OS dependencies:
+ * OS dependencies (macros calculated here based on LINUX/MACOSX/SOLARIS
+ * etc. unless otherwise specified):
  *
  * How to do ioctls and to get/set termio attributes:
  *	USE_STREAMS - Solaris style STREAMS
  *	USE_POSIX_TERMIO - use POSIX tcgetattr/tcsetattr
  *	else ioctls direct on the file descriptor
  * How to get a pseudo-terminal:
- *	USE_GRANTPT - SUSv3 grantpt/unlockpt
+ *	USE_GRANTPT - SUSv3 grantpt/unlockpt (calculated in make file xpp.mkf)
  *	USE_OPENPTY - BSD openpty
  *	else hunt in /dev
  * When to set termio attributes:
@@ -255,7 +257,6 @@
 #ifdef MACOSX
 #define XTABS (OXTABS)
 #define OLCUC (0)
-#define OCRNL (0)
 	#ifndef USE_GRANTPT
 		#define USE_OPENPTY
 	#endif
@@ -386,10 +387,6 @@
 static char* send_error_message = 
 "A system error occurred writing to the application.";
 
-static char* carry_on_waiting_message = 
-"The application does not seem to have responded to the interrupt."
-" Do you want to continue waiting for a response?";
-
 /*
  * The following data types are used to define our disposition of the various signals in a table.
  */
@@ -521,14 +518,15 @@
 
 void get_pty(void)
 {
-	char c;
 	int one = 1;
 	int slave_fd;
-	char *slavename, line[32];
+	char *slavename;
 	char *ptsname(int);
-	int i;
 	short line_length;
 #ifdef USE_GRANTPT
+/* I can't persuade stdlib.h to yield up the prototypes: */
+	int grantpt(int);
+	int unlockpt(int);
 /* When available, e.g., on SVR4, we use the grantpt/lockpt interfaces */
 	if ((control_fd = open("/dev/ptmx", O_RDWR)) < 0) {
 		msg("system error", "no pseudo-terminal devices available");
@@ -552,7 +550,10 @@
 	}
 #else
 /* we have to look for a pseudo-terminal ourselves */
+	char c;
+	char line[32];
 	for(control_fd = -1, c = 'p'; control_fd < 0 && c <= 'z'; c++) {
+		int i;
 		for(i = 0; control_fd < 0 && i < 16; i++) {
 			sprintf(line, "/dev/pty%c%x", c, i );
 	      		control_fd = open(line, O_RDWR);
@@ -846,7 +847,7 @@
 	if(ct == XFER_SIZE) { /* Probably more to do */
 		return False;	/* arrange to be called again */ 
 	} else	{
-		switch((int)continue_flag) {
+		switch((int) (uintptr_t) continue_flag) {
 			case CONTINUE_LISTENING:
 				listening_state(LISTEN);
 				break;
@@ -872,7 +873,7 @@
  * **** **** **** **** **** **** **** **** **** **** **** **** */
 static Boolean dequeue(void)
 {
-	long int bytes_written, line_len, i, top;
+	long int bytes_written, line_len, i;
 	Boolean sent_something = False;
 	Boolean sys_error = False;
 
@@ -935,9 +936,8 @@
  * The queue always has one more byte than q_size actually says it does
  * to allow for scroll_out null-terminating a string right at the end.
  * **** **** **** **** **** ***. **** **** **** **** **** **** */
-static Boolean enqueue(char *buf, NAT siz)
+static Boolean enqueue(char *buf, Cardinal siz)
 {
-	NAT buf_i, q_i;
 /* start the queue off if it's empty: */
 	if(queue == 0) {
 		queue = XtMalloc(INIT_Q_LEN+1);
@@ -1039,9 +1039,7 @@
  * Send commands to the application via the queue
  * **** **** **** **** **** **** **** **** **** **** **** **** */
 
-void send_to_application (buf, siz)
-char *buf;
-NAT siz;
+void send_to_application (char *buf, Cardinal siz)
 {
 
 /* Check there's something to talk to: */
@@ -1150,13 +1148,13 @@
 }
 
 /* **** **** **** **** **** **** **** **** **** **** **** ****
- * sig_panic_handler:
- * use panic_exit to save the editor text if the widget's there then bomb out.
+ * panic_exit:
+ * save the editor text if the widget's there then bomb out.
  * This does no X windows work, so the Xt signal handling functions
  * does not need to be used (and we trust that the panic_save function
  * and the Motif functions it calls don't do anything silly).
  * **** **** **** **** **** **** **** **** **** **** **** **** */
-static void panic_exit(char * m, NAT code)
+static int panic_exit(char * m, Cardinal code)
 {
 	static Boolean recursive = False;
 	if(recursive) {
@@ -1179,14 +1177,18 @@
 		msg(m, initialisation_error_message);
 	}
 	exit(code);
+	return -1; /* C library broken! */
 }
 
-
+/* **** **** **** **** **** **** **** **** **** **** **** ****
+ * sig_panic_handler: handle an unmasked signal by exiting with
+ * an error message identifying the signal.
+ * **** **** **** **** **** **** **** **** **** **** **** **** */
 static void sig_panic_handler(int sig)
 {
 	char msg_buf[80];
 	sprintf(msg_buf, signal_handled_message, sig, sig_desc(sig)); 
-	panic_exit(msg_buf, 15);
+	(void) panic_exit(msg_buf, 15);
 }
 
 /* **** **** **** **** **** **** **** **** **** **** **** ****
@@ -1195,7 +1197,7 @@
 static void xt_error_handler(char * m)
 {
 	msg(xt_error_handled_message, m);
-	panic_exit("exiting", 16);
+	(void) panic_exit("exiting", 16);
 }
 /* **** **** **** **** **** **** **** **** **** **** **** ****
  * as does x_error_handler ...
@@ -1205,7 +1207,7 @@
 	char error_text[100];
 	XGetErrorText(d, ev->error_code, error_text, 100);
 	msg(x_error_handled_message, error_text);
-	panic_exit("exiting", 17);
+	return panic_exit("exiting", 17);
 }
 /* **** **** **** **** **** **** **** **** **** **** **** ****
  * and x_io_error_handler ...
@@ -1213,7 +1215,7 @@
 static int x_io_error_handler(Display *d)
 {
 	msg(x_error_handled_message, x_io_error_message);
-	panic_exit("exiting", 17);
+	return panic_exit("exiting", 17);
 }
 /* **** **** **** **** **** **** **** **** **** **** **** ****
  * handle signals and Xt errors: the derivation of the following list
@@ -1359,10 +1361,11 @@
 			if(WIFEXITED(status)) {
 				return(WEXITSTATUS(status));
 			} else {
-				return(255);
+				return 255;
 			}
 		}
 	}
+	return 255; /* something is desperately wrong if we get here */
 }
 
 /* **** **** **** **** **** **** **** **** **** **** **** ****
diff -urP OpenProofPower-2.8.1/src/search.c OpenProofPower-2.8.1p1/src/search.c
--- OpenProofPower-2.8.1/src/search.c	2009-08-28 15:27:58.000000000 +0100
+++ OpenProofPower-2.8.1p1/src/search.c	2009-09-09 17:40:40.000000000 +0100
@@ -148,8 +148,6 @@
 		replace_search_forwards_cb(CALLBACK_ARGS),
 		submatch_status_cb(CALLBACK_ARGS);
 
-static void line_no_set(SearchData*);
-
 /*
  * Popup menu for the search, replace and line number text widgets:
  */
@@ -213,7 +211,6 @@
 
 Boolean add_search_tool(Widget text_w)
 {
-	NAT cbdata;
 	Widget shell,
 		paned,
 		search_form,
@@ -233,8 +230,6 @@
 			dismiss_btn,
 			help_btn;
 
-	char	*pattern;
-
 	XmString s;
 	int	i, j;
 #ifdef USEPANED
@@ -244,8 +239,8 @@
  * replacement text pane is added. This then allows us to remove the unwanted
  * sash underneath the replacement text.
  */
-	Widget	*children_before, *children;
-	int	num_children_before, num_children;
+	Widget *children_before, *children;
+	Cardinal num_children_before, num_children;
 #endif
 	if((search_data.shell_w) != NULL) {
 		XmTextPosition last_pos;
@@ -641,7 +636,7 @@
 /* **** **** **** **** **** **** **** **** **** **** **** ****
  * search forwards callback.
  * **** **** **** **** **** **** **** **** **** **** **** **** */
-static Boolean search_and_show(Widget, SearchData*, NAT);
+static Boolean search_and_show(Widget, SearchData*, Cardinal);
 static void search_forwards_cb(
 	Widget		w,
 	XtPointer	cbd,
@@ -667,15 +662,15 @@
 /* **** **** **** **** **** **** **** **** **** **** **** ****
  * Support for search callbacks.
  * **** **** **** **** **** **** **** **** **** **** **** **** */
-static Substring search_cyclic(char*, char*, long int, NAT, SearchData*);
+static Substring search_cyclic(char*, char*, long int, Cardinal, SearchData*);
 static Boolean report_re_error(Widget);
 static Boolean search_and_show(
 	Widget				w,
 	SearchData			*cbdata,
-	NAT				dir)
+	Cardinal			dir)
 {
 	Substring ss;
-	NAT start_point;
+	Cardinal start_point;
 	char *pattern, *text_buf;
 	Boolean result;
 	XmTextPosition pl, pr;
@@ -810,7 +805,7 @@
 /* **** **** **** **** **** **** **** **** **** **** **** ****
  * replace all callback.
  * **** **** **** **** **** **** **** **** **** **** **** **** */
-static void replace_all(char*, char*, char*, char**, NAT*, SearchData*);
+static void replace_all(char*, char*, char*, char**, Cardinal*, SearchData*);
 static void replace_all_cb(
 	Widget		w,
 	XtPointer	cbd,
@@ -818,7 +813,7 @@
 {
 	SearchData *cbdata = cbd;
 	Substring ss;
-	NAT start_point;
+	Cardinal start_point;
 	char *pattern, *text_buf, *replacement, *all_replaced;
 	CHECK_MAP_STATE(cbdata)
 	pattern = XmTextGetString(cbdata->search_w);
@@ -1373,7 +1368,7 @@
 	char		*pattern,
 	char		*text_buf,
 	long int 	start_point,
-	NAT		direction,
+	Cardinal	direction,
 	SearchData	*cbdata)
 {
 	Substring ss;
@@ -1419,7 +1414,7 @@
 	char		*text_buf,
 	char		*rep_pattern,
 	char		**result,
-	NAT		*start_point,
+	Cardinal	*start_point,
 	SearchData 	*cbdata)
 {
 	long int text_buf_len, rep_pattern_len, rep_len, extra;
diff -urP OpenProofPower-2.8.1/src/templates.c OpenProofPower-2.8.1p1/src/templates.c
--- OpenProofPower-2.8.1/src/templates.c	2009-08-28 15:27:58.000000000 +0100
+++ OpenProofPower-2.8.1p1/src/templates.c	2009-09-09 17:40:40.000000000 +0100
@@ -61,8 +61,8 @@
 #define MAX_TEMPLATES 100
 
 static TemplateEntry template_table[MAX_TEMPLATES];
-static NAT template_table_size;
-static NAT template_table_bitmaps_size;
+static int template_table_size;
+static int template_table_bitmaps_size;
 
 /* **** **** **** **** **** **** **** **** **** **** **** ****
  * the static Widgets for the template tool
@@ -72,7 +72,6 @@
 		paned,
 		top_form,
 		bottom_form,
-		other_btn_area,
 		dismiss_btn,
 		help_btn,
 		text_w;
@@ -100,7 +99,7 @@
 static void get_templates_data(void)
 {
 	char *ptr = templates;
-	NAT i;
+	Cardinal i;
 
 	while (*ptr != '/' && *ptr != '\0') ptr++;
 	template_table_size = 0;
@@ -238,7 +237,7 @@
 
 Boolean init_templates_tool(Widget w)
 {
-	NAT i, x, y, fbase;
+	int i, x, y, fbase;
 	Widget template_btn;
 
 	if(!templates || !*templates) {
@@ -440,10 +439,10 @@
 	common_dialog_setup(shell, popdown_cb, shell);
 	help_pane = XtVaCreateWidget("help-pane",
 		XMPANEDCLASS,	shell,
-		XmNsashWidth,			1,
 			/* Motif won't let us set these to 0! */
-		XmNsashHeight,			1,
-			/* Make small so user doesn't try to resize */
+			/* Make small so user can't try to resize */
+		XmNsashWidth,	(Dimension) 1,
+		XmNsashHeight,	(Dimension) 1,
 		NULL);
 
 	introduction = XtVaCreateManagedWidget("introduction",
diff -urP OpenProofPower-2.8.1/src/undo.c OpenProofPower-2.8.1p1/src/undo.c
--- OpenProofPower-2.8.1/src/undo.c	2009-08-28 15:27:58.000000000 +0100
+++ OpenProofPower-2.8.1p1/src/undo.c	2009-09-09 17:40:40.000000000 +0100
@@ -1,5 +1,5 @@
 /* **** **** **** **** **** **** **** **** **** **** **** ****
- * undo.c,v 2.24 2009/08/11 16:59:09 rda Exp
+ * undo.c,v 2.26 2009/09/06 14:50:50 rda Exp
  *
  * undo.c -  text window undo facility for the X/Motif ProofPower
  * Interface
@@ -37,16 +37,16 @@
 				 "and edit the text?";
 
 /* The following is used to implement undo/redo in the edit menu */
-static NAT next_debug_no = 0;
+static Cardinal next_debug_no = 0;
 typedef struct undo_node {
-	NAT debug_no;           /* only for debugging */
+	Cardinal debug_no;      /* only for debugging */
 	Boolean in_business;    /* true if first & last are valid */
 	Boolean changes_saved;  /* true if changes have been saved */
 	Boolean moved_away;     /* true if the change is complete */
-	NAT first,              /* position in text of chars to */
-	    last;               /* be replaced by an undo */
-	char *old_text;          /* deleted characters to put in */
-	NAT   old_text_size;      /* current amount of space in the old_text buffer */
+	Cardinal first,         /* position in text of chars to */
+	         last;          /* be replaced by an undo */
+	char *old_text;         /* deleted characters to put in */
+	Cardinal old_text_size; /* current amount of space in the old_text buffer */
     Boolean was_null;
 	struct undo_node *next,
 	                 *prev;
@@ -56,8 +56,8 @@
 typedef struct undo_details {
 	Widget text_w;
 	Widget *menu_ws;
-	NAT undo_menu_entry_offset;
-	NAT redo_menu_entry_offset;
+	Cardinal undo_menu_entry_offset;
+	Cardinal redo_menu_entry_offset;
 	Boolean can_undo;               /* true iff. can do an undo */
 	Boolean can_redo;               /* true iff. can do a redo */
 	Boolean undoing;                /* true while undo in progress */
@@ -154,7 +154,7 @@
 	 * be a realloc.  If it isn't the old value will be freed then.    */
 }
 
-static Boolean grow_old_text_to(UndoBuffer *ub, NAT len, Boolean *answer)
+static Boolean grow_old_text_to(UndoBuffer *ub, Cardinal len, Boolean *answer)
 {
 	/* Make the old_text buffer (at least) len+1 big */
 	char *ptr;
@@ -191,7 +191,7 @@
 static Boolean grow_old_text(UndoBuffer *ub, Boolean *answer)
 {
 	/* Make the old_text buffer (at least) one character bigger */
-	NAT len,
+	Cardinal len,
 	    new_size;
 	char *ptr;
 
@@ -399,14 +399,14 @@
 	}
 }
 
-static NAT first(UndoBuffer *ub)
+static Cardinal first(UndoBuffer *ub)
 {
 	if(ub->active == (UndoNode *) NULL) {
 		return 0;
 	}
 	return ub->active->first;
 }
-static void setFirst(UndoBuffer *ub, NAT value)
+static void setFirst(UndoBuffer *ub, Cardinal value)
 {
 	if(ub->active == (UndoNode *) NULL) {
 		return;
@@ -414,14 +414,14 @@
 	ub->active->first = value;
 }
 
-static NAT last(UndoBuffer *ub)
+static Cardinal last(UndoBuffer *ub)
 {
 	if(ub->active == (UndoNode *) NULL) {
 		return 0;
 	}
 	return ub->active->last;
 }
-static void setLast(UndoBuffer *ub, NAT value)	
+static void setLast(UndoBuffer *ub, Cardinal value)	
 {
 	if(ub->active == (UndoNode *) NULL) {
 		return;
@@ -679,8 +679,8 @@
 XtPointer add_undo(
 		Widget	text_w,
 		Widget *menu_ws,
-		NAT undo_menu_entry_offset,
-		NAT redo_menu_entry_offset)
+		Cardinal undo_menu_entry_offset,
+		Cardinal redo_menu_entry_offset)
 {
 	UndoBuffer *ub;
 	/* NB this Malloc must not use the local one and ... */
@@ -764,8 +764,7 @@
 	XmTextVerifyCallbackStruct	*cbs,
 	Boolean    *noMA)
 {
-	NAT len, lst = last(ub);
-	Widget *wp;
+	Cardinal len, lst = last(ub);
 
 	if(!cbs->text->length &&
 	   !ub->undoing &&
@@ -794,7 +793,6 @@
 						return False;
 					}
 				} else {
-					char *newptr;
 					setUndo(ub, True);
 					setMoved_away(ub, False);
 					setFirst(ub,      cbs->startPos);
@@ -817,7 +815,6 @@
 					return False;
 				}
 			} else {
-				char *newptr;
 				setUndo(ub, True);
 				setMoved_away(ub, False);
 				setLast(ub,       cbs->startPos);
@@ -827,7 +824,6 @@
 			}
 		}
 	} else if(cbs->startPos < cbs->endPos) {
-		char *cut_chars;
 		/* deleted something else */
 		len = cbs->endPos - cbs->startPos;
 
@@ -977,7 +973,7 @@
     	Boolean     amUndoing)
 {
 	XmTextPosition fst, lst;
-	NAT len;
+	Cardinal len;
 
 	if(changes_saved(ub) &&
 	   amUndoing &&
diff -urP OpenProofPower-2.8.1/src/usr032a.eps OpenProofPower-2.8.1p1/src/usr032a.eps
--- OpenProofPower-2.8.1/src/usr032a.eps	2009-08-28 15:27:51.000000000 +0100
+++ OpenProofPower-2.8.1p1/src/usr032a.eps	2009-09-09 17:40:36.000000000 +0100
@@ -1,7 +1,7 @@
 %!PS-Adobe-2.0 EPSF-2.0
 %%Title: usr032a.fig
 %%Creator: fig2dev Version 3.2 Patchlevel 4
-%%CreationDate: Fri Aug 28 15:27:51 2009
+%%CreationDate: Wed Sep  9 17:40:36 2009
 %%For: rda@tychonov (Rob Arthan)
 %%BoundingBox: 0 0 285 169
 %%Magnification: 0.7500
diff -urP OpenProofPower-2.8.1/src/version OpenProofPower-2.8.1p1/src/version
--- OpenProofPower-2.8.1/src/version	2009-08-28 15:27:58.000000000 +0100
+++ OpenProofPower-2.8.1p1/src/version	2009-09-09 17:40:40.000000000 +0100
@@ -1 +1 @@
-2.8.1
+2.8.1p1
diff -urP OpenProofPower-2.8.1/src/xmisc.c OpenProofPower-2.8.1p1/src/xmisc.c
--- OpenProofPower-2.8.1/src/xmisc.c	2009-08-28 15:27:58.000000000 +0100
+++ OpenProofPower-2.8.1p1/src/xmisc.c	2009-09-09 17:40:40.000000000 +0100
@@ -94,10 +94,10 @@
  * toggle_menu_item_sensitivity: given a menu w toggle the
  * sensitivity of the i-th item in the menu.
  * **** **** **** **** **** **** **** **** **** **** **** **** */
-void toggle_menu_item_sensitivity(Widget w, NAT i)
+void toggle_menu_item_sensitivity(Widget w, Cardinal i)
 {
 	Widget *btns;
-	NAT num_btns;
+	Cardinal num_btns;
 
 	XtVaGetValues(w, XmNchildren, &btns,
 		XmNnumChildren, &num_btns, NULL);
@@ -110,10 +110,10 @@
  * set_menu_item_sensitivity: given a menu w set the
  * sensitivity of the i-th item in the menu to a given value.
  * **** **** **** **** **** **** **** **** **** **** **** **** */
-void set_menu_item_sensitivity(Widget w, NAT i, Boolean b)
+void set_menu_item_sensitivity(Widget w, Cardinal i, Boolean b)
 {
 	Widget *btns;
-	NAT num_btns;
+	Cardinal num_btns;
 
 	XtVaGetValues(w, XmNchildren, &btns,
 		XmNnumChildren, &num_btns, NULL);
@@ -125,10 +125,10 @@
  * set_menu_item_label: given a menu w change the
  * label of the i-th item in the menu.
  * **** **** **** **** **** **** **** **** **** **** **** **** */
-void set_menu_item_label(Widget w, NAT i, char *lab)
+void set_menu_item_label(Widget w, Cardinal i, char *lab)
 {
 	Widget *btns;
-	NAT num_btns;
+	Cardinal num_btns;
 	XmString str;
 
 	XtVaGetValues(w, XmNchildren, &btns,
@@ -150,10 +150,10 @@
  * done without deleting more than 10%. Expects to be called *after*
  * the new text has been inserted.
  * **** **** **** **** **** **** **** **** **** **** **** **** */
-void check_text_window_limit(Widget w, NAT max)
+void check_text_window_limit(Widget w, Cardinal max)
 {
 	XmTextPosition siz;
-	NAT bytes_to_go;
+	Cardinal bytes_to_go;
 
 	char *text, *p;
 	const char *fmt =
@@ -248,7 +248,7 @@
 		xtp);
 	return True;
 }
-Boolean flash_widget(Widget w)
+void flash_widget(Widget w)
 {
 	XtAppAddWorkProc(app, flash_widget_work_proc, w);
 }
@@ -404,8 +404,7 @@
 {
 	XmTextPosition ins_pos, left, right, prev_pos, cur_pos, last_pos;
 	int len;
-	char data[BUFSIZ + 1], *p, *res;
-	Boolean done = False;
+	char data[BUFSIZ + 1], *res;
 	ins_pos = XmTextGetInsertionPosition(text_w);
 	last_pos = XmTextGetLastPosition(text_w);
 	right = last_pos;
@@ -479,7 +478,7 @@
 	Modifiers modifiers;
 	XKeyPressedEvent *kpe;
 	cancel_info *info = x;
-	char *str;
+
 	if(evp->type != KeyRelease) {
 		return;
 	} /* else */
@@ -497,7 +496,7 @@
 static void add_cancel_handlers(Widget w, XtPointer cbd)
 {
 	Widget *children;
-	int i, num_children;
+	Cardinal i, num_children;
 	if(XtIsComposite(w)) {
 		XtVaGetValues(w,
 			XmNchildren,		&children,
@@ -678,8 +677,8 @@
 	for(i = 0; i < num_children; ++i) {
 		if(!strcmp(XtName(children[i]), "Sash")) {
 			XtVaSetValues(children[i],
-				XmNheight,	1,
-				XmNwidth,	1,
+				XmNheight,	(Dimension) 1,
+				XmNwidth,	(Dimension) 1,
 				XmNsensitive,	False,
 				NULL);
 		}
@@ -766,7 +765,6 @@
 	attach_edit_popup(text_w, ro_edit_menu_items);
 }
 /* **** **** **** **** **** **** **** **** **** **** **** ****
-/* **** **** **** **** **** **** **** **** **** **** **** ****
  * Callback routines for the edit menus:
  * **** **** **** **** **** **** **** **** **** **** **** **** */
 void edit_cut_cb(
@@ -890,7 +888,6 @@
 }
 static char *get_remote_selection(Boolean *timed_out)
 {
-	Boolean timeout_proc_registered;
 	sel_req_info.data = NULL;
 	sel_req_info.failed = False;
 	XtGetSelectionValue(root,
@@ -949,7 +946,7 @@
 	fprintf(stderr, "\n");
 	if(XtIsComposite(w)) {
 		Widget *children;
-		int i, num_children;
+		Cardinal i, num_children;
 		XtVaGetValues(w,
 			XmNchildren,		&children,
 			XmNnumChildren,		&num_children,
diff -urP OpenProofPower-2.8.1/src/xpp.c OpenProofPower-2.8.1p1/src/xpp.c
--- OpenProofPower-2.8.1/src/xpp.c	2009-08-28 15:27:58.000000000 +0100
+++ OpenProofPower-2.8.1p1/src/xpp.c	2009-09-09 17:40:40.000000000 +0100
@@ -236,7 +236,7 @@
  * **** **** **** **** **** **** **** **** **** **** **** **** */
 void set_pp_home(void)
 {
-	char *env_val, *dir, *base, *real_name, *find_file_path, *env_entry, *unix_path, *x_search_path;
+	char *env_val, *dir, *base, *real_name, *env_entry, *unix_path, *x_search_path;
 /*
  * The first part of this is closely based on what the shell scripts like pp do.
  * If the environment variable PPENVDEBUG is set and non-empty, we output diagnostics about all this.
@@ -579,7 +579,7 @@
 int main(int argc, char **argv)
 {
 	char **retry_argv;
-	int i, orig_argc, num_x_args;
+	int orig_argc, num_x_args;
 	Boolean use_default_command;
 	char *cmd_line;
 	int x_fd;
diff -urP OpenProofPower-2.8.1/src/xpp.h OpenProofPower-2.8.1p1/src/xpp.h
--- OpenProofPower-2.8.1/src/xpp.h	2009-08-28 15:27:58.000000000 +0100
+++ OpenProofPower-2.8.1p1/src/xpp.h	2009-09-09 17:40:40.000000000 +0100
@@ -21,8 +21,6 @@
 /* **** **** **** **** **** **** **** **** **** **** **** ****
  * MACROS
  * **** **** **** **** **** **** **** **** **** **** **** **** */
-#define NAT Cardinal
-#define INT long int
 
 #include <X11/Intrinsic.h>
 #include <Xm/XmAll.h>
@@ -54,7 +52,19 @@
  * TYPE DEFS
  * **** **** **** **** **** **** **** **** **** **** **** **** */
 /* Note the following are used as indices into the array file_type_names */
-typedef enum {UNIX = 0, MSDOS = 1, MACINTOSH = 2} FileType;
+typedef enum {
+		UNIX = 0,
+		MSDOS,
+		MACINTOSH} FileType;
+/*
+ * The following are the values of execute_new_line_mode:
+ * (they are in the order that the buttons appear in the
+ * radio box in the options tool and are also used as indices).
+ */
+typedef enum {
+	EXECUTE_ADD_NEW_LINES = 0,
+	EXECUTE_PROMPT_NEW_LINES,
+	EXECUTE_IGNORE_NEW_LINES} AddNewLineMode;
 typedef struct {
 /* session type: */
 	Boolean			edit_only;
@@ -64,19 +74,11 @@
 	Boolean			read_only;
 	FileType		file_type;
 /* journal option: */
-	NAT			journal_max;
+	Cardinal		journal_max;
 /* command menu options: */
-	char			add_new_line_mode;
+	AddNewLineMode		add_new_line_mode;
 	String			command_line;}
 		GlobalOptions;	
-/*
- * The following are the values of execute_new_line_mode:
- * (they are in the order that the buttons appear in the
- * radio box in the options tool).
- */
-#define EXECUTE_ADD_NEW_LINES 0
-#define EXECUTE_PROMPT_NEW_LINES 1
-#define EXECUTE_IGNORE_NEW_LINES 2
 
 /*
  * The following is based on the ideas in Heller's
@@ -168,16 +170,20 @@
 /* Module: findfile (generated from imp096.doc during build); only list interfaces actually used here */
 	extern char *get_real_name (
 		char * name);
-	extern voidsplit_file_name(
+	extern void split_file_name(
 		char *name,
 		char **dir,
 		char **base);
-	char * find_file(
+	extern char  *find_file(
 		char *name,
 		char *dirs,
 		int is_reg);
-/* Module: help.c (automatically generated during build) */
+	extern int is_dir(char *name);
+/* Module: help (automatically generated during build) */
 	#include "help.h"
+/* Module: lineno */
+	extern Boolean add_line_no_tool(
+		Widget text_w);
 /* Module: mainw */
 	extern void main_window_go(
 		char	*file_name);
@@ -186,10 +192,10 @@
 	extern Widget script;
 	extern Widget journal;
 	extern void check_quit_cb(CALLBACK_ARGS);
-	extern void scroll_out(char *buf, NAT ct, Boolean ignored);
+	extern void scroll_out(char *buf, Cardinal ct, Boolean ignored);
 	extern void show_modified(Boolean force);
 	extern void show_unmodified(void);
-	extern Boolean get_unmodified(void);
+	extern Boolean get_modified(void);
 	extern void show_file_info(void);
 	extern char *not_running_message;
 /* Module: menus */
@@ -206,8 +212,8 @@
 		MenuItem	*items);
 /* Module: msg */
 	extern XmString format_msg(
-		char *msg,
-		NAT line_len);
+		char 		*msg,
+		Cardinal	line_len);
 	extern void help_dialog(
 		Widget	w,
 		char	*msg);
@@ -232,6 +238,9 @@
 		char	*button_label,
 		char	*title,
 		Boolean	reset);
+	extern Boolean quit_new_dialog(
+		Widget w,
+		char *question);
 	extern void startup_dialog(
 		Widget	w,
 		char	**cmd_line,
@@ -265,8 +274,8 @@
 	extern void restart_application(void);
 	extern void send_nl(void);
 	extern void send_to_application(
-		char	*buf,
-		NAT	siz);
+		char		*buf,
+		Cardinal	siz);
 	extern int new_session(char *argv[], Boolean async);
 	extern void new_editor_session(void);
 	extern void new_command_session(void);
@@ -289,10 +298,10 @@
 		XtPointer undo_ptr);
 	extern void notify_save(XtPointer xtp);
 	extern XtPointer add_undo(
-		Widget	text_w,
-		Widget	*menu_w,
-		NAT	undo_menu_entry_offset,
-		NAT	redo_menu_entry_offset);
+		Widget		text_w,
+		Widget		*menu_w,
+		Cardinal	undo_menu_entry_offset,
+		Cardinal	redo_menu_entry_offset);
 	extern void undo_modify_cb(CALLBACK_ARGS);
 	extern void undo(XtPointer undo_ptr);
 	extern void redo(XtPointer undo_ptr);
@@ -301,19 +310,19 @@
 	extern int get_map_state(Widget w); /* From XGetWindowAttributes */
 	Widget get_top_shell(Widget w);
 	extern void set_menu_item_sensitivity(
-		Widget	w,	/* menu widget */
-		NAT	i,	/* i-th menu entry */
+		Widget		w,	/* menu widget */
+		Cardinal	i,	/* i-th menu entry */
 		Boolean	b	/* true => sensitise */);
 	extern void toggle_menu_item_sensitivity(
-		Widget	w,	/* menu widget */
-		NAT	i	/* i-th menu entry */);
+		Widget		w,	/* menu widget */
+		Cardinal	i	/* i-th menu entry */);
 	extern void set_menu_item_label(
-		Widget	w,	/* menu widget */
-		NAT	i,	/* i-th menu entry */
+		Widget		w,	/* menu widget */
+		Cardinal	i,	/* i-th menu entry */
 		char	*lab);
 	extern void check_text_window_limit(
-		Widget	w,
-		NAT	max);
+		Widget		w,
+		Cardinal	max);
 	extern void copy_font_list(
 		Widget	to_w,
 		Widget	from_w);
@@ -324,7 +333,7 @@
 			Widget child_w,
 			Widget scale_w);
 	extern void remove_sashes(Widget paned_w);
-	extern Boolean flash_widget(Widget w);
+	extern void flash_widget(Widget w);
 	extern void idle(unsigned long interval);
 	extern void number_verify_cb(CALLBACK_ARGS);
 	extern void text_verify_cb(CALLBACK_ARGS);
diff -urP OpenProofPower-2.8.1/src/xpp.mkf OpenProofPower-2.8.1p1/src/xpp.mkf
--- OpenProofPower-2.8.1/src/xpp.mkf	2009-08-28 15:27:58.000000000 +0100
+++ OpenProofPower-2.8.1p1/src/xpp.mkf	2009-09-09 17:40:40.000000000 +0100
@@ -1,5 +1,5 @@
 ######################################################################
-# xpp.mkf $Revision: 1.80 $ $Date: 2009/08/27 15:26:17 $ 
+# xpp.mkf $Revision: 1.81 $ $Date: 2009/09/06 14:50:36 $ 
 #
 # makefile for the X/Motif ProofPower Interface
 # 
@@ -58,7 +58,7 @@
 ifeq ($(OS), linux)
 # Linux:
 	CFLAGS = -g -DLINUX -DGETOPTDONE=-1 $(DGRANTPT) $(DUSEPANED) \
-		-DSLOWREGEXEC $(USERCFLAGS) -I/usr/X11R6/include
+		-DSLOWREGEXEC $(USERCFLAGS) -Wall -I/usr/X11R6/include
 	CLIBS = $(USERCLIBS) -L/usr/X11R6/lib \
 		-Wl,-B$(MOTIFLINKING) -lXm -Wl,-Bdynamic \
 		-lXp -lXmu -lXt -lSM -lICE -lXext -lX11
@@ -66,13 +66,14 @@
 ifeq ($(OS), darwin)
 # Mac OS X:
 	CFLAGS = -g -DMACOSX -DGETOPTDONE=-1 $(DUSEPANED) \
-		-DSLOWREGEXEC $(USERCFLAGS) -I/usr/X11R6/include
+		-DSLOWREGEXEC $(USERCFLAGS) -Wall -I/usr/X11R6/include
 	CLIBS = $(USERCLIBS) -L/usr/X11R6/lib \
 		-lXm -lXext -lXp -lXt -lSM -lICE -lX11
 else
 # Solaris is the only other system supported just now:
 	CC = gcc
-	CFLAGS = -g -DSOLARIS -DGETOPTDONE=EOF $(USERCFLAGS) $(DUSEPANED)
+	CFLAGS = -g -DSOLARIS -DGETOPTDONE=EOF $(USERCFLAGS) \
+		-Wall $(DUSEPANED)
 	CLIBS =  $(USERCLIBS) -L/usr/openwin/lib -lXm -lXmu -lXt  -lX11
 endif
 endif
