summaryrefslogtreecommitdiff
path: root/editors/uemacs
diff options
context:
space:
mode:
authordholland <dholland>2012-05-10 20:53:30 +0000
committerdholland <dholland>2012-05-10 20:53:30 +0000
commitacde6b683bf31ffdfab5453ca060ba787f1458dd (patch)
tree979ae08520f7990d5a8e7a6307923591237f24c9 /editors/uemacs
parentd89207908055b81f775f7378744e838a391b2dbe (diff)
downloadpkgsrc-acde6b683bf31ffdfab5453ca060ba787f1458dd.tar.gz
Pass -Wall. Fix a number of minor bugs and possibly some major ones.
Should also fix clang build. PKGREVISION++
Diffstat (limited to 'editors/uemacs')
-rw-r--r--editors/uemacs/Makefile4
-rw-r--r--editors/uemacs/distinfo38
-rw-r--r--editors/uemacs/patches/patch-ab14
-rw-r--r--editors/uemacs/patches/patch-ac228
-rw-r--r--editors/uemacs/patches/patch-ad62
-rw-r--r--editors/uemacs/patches/patch-ag91
-rw-r--r--editors/uemacs/patches/patch-h_ebind_h507
-rw-r--r--editors/uemacs/patches/patch-h_eproto_h303
-rw-r--r--editors/uemacs/patches/patch-h_evar_h113
-rw-r--r--editors/uemacs/patches/patch-src_abbrev_c24
-rw-r--r--editors/uemacs/patches/patch-src_basic_c159
-rw-r--r--editors/uemacs/patches/patch-src_buffer_c114
-rw-r--r--editors/uemacs/patches/patch-src_crypt_c15
-rw-r--r--editors/uemacs/patches/patch-src_display_c78
-rw-r--r--editors/uemacs/patches/patch-src_dolock_c15
-rw-r--r--editors/uemacs/patches/patch-src_eval_c125
-rw-r--r--editors/uemacs/patches/patch-src_exec_c147
-rw-r--r--editors/uemacs/patches/patch-src_file_c179
-rw-r--r--editors/uemacs/patches/patch-src_fileio_c58
-rw-r--r--editors/uemacs/patches/patch-src_input_c115
-rw-r--r--editors/uemacs/patches/patch-src_isearch_c49
-rw-r--r--editors/uemacs/patches/patch-src_keyboard_c47
-rw-r--r--editors/uemacs/patches/patch-src_line_c101
-rw-r--r--editors/uemacs/patches/patch-src_main_c173
-rw-r--r--editors/uemacs/patches/patch-src_mouse_c88
-rw-r--r--editors/uemacs/patches/patch-src_random_c318
-rw-r--r--editors/uemacs/patches/patch-src_region_c97
-rw-r--r--editors/uemacs/patches/patch-src_replace_c38
-rw-r--r--editors/uemacs/patches/patch-src_screen_c70
-rw-r--r--editors/uemacs/patches/patch-src_search_c62
-rw-r--r--editors/uemacs/patches/patch-src_tags_c70
-rw-r--r--editors/uemacs/patches/patch-src_undo_c33
-rw-r--r--editors/uemacs/patches/patch-src_window_c194
-rw-r--r--editors/uemacs/patches/patch-src_word_c124
34 files changed, 3810 insertions, 43 deletions
diff --git a/editors/uemacs/Makefile b/editors/uemacs/Makefile
index c42228b7028..a1670200fe8 100644
--- a/editors/uemacs/Makefile
+++ b/editors/uemacs/Makefile
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.12 2010/01/29 19:59:12 joerg Exp $
+# $NetBSD: Makefile,v 1.13 2012/05/10 20:53:30 dholland Exp $
DISTNAME= ue400dev
PKGNAME= uemacs-4.0
-PKGREVISION= 1
+PKGREVISION= 2
CATEGORIES= editors
MASTER_SITES= ftp://aquest.com/pub/uemacs400/disk2/
EXTRACT_SUFX= .zip
diff --git a/editors/uemacs/distinfo b/editors/uemacs/distinfo
index 91c1dc9476d..08c1fc7ddb9 100644
--- a/editors/uemacs/distinfo
+++ b/editors/uemacs/distinfo
@@ -1,12 +1,40 @@
-$NetBSD: distinfo,v 1.6 2010/01/29 19:59:12 joerg Exp $
+$NetBSD: distinfo,v 1.7 2012/05/10 20:53:30 dholland Exp $
SHA1 (ue400dev.zip) = edbb0261cdaa1803d9f7dc7debfd4a9df3a668eb
RMD160 (ue400dev.zip) = 75bc1b1e11035ed24d33ec4c6afad43880d5985f
Size (ue400dev.zip) = 1179949 bytes
SHA1 (patch-aa) = 2e81eaf2d4b09baf8a54daa675d85d9bae68fb4b
-SHA1 (patch-ab) = 996e5f094b26991ba111f635a9a02d05188628aa
-SHA1 (patch-ac) = f7aaa2514f74987a68da726a397d58089fc2d82e
-SHA1 (patch-ad) = 977e0ca09cc53ba4bb90936dd5e34a460d0ea4e8
+SHA1 (patch-ab) = bef63275aa8a88b12ce47fd568059360e1e972c8
+SHA1 (patch-ac) = beeba5d9686f6009248437f3eb0fd10e8b72057b
+SHA1 (patch-ad) = 493eb3bf0c24d91d55f532029a0aa5d2ad5abe44
SHA1 (patch-ae) = 40998fe8f82a65cbfdabc849ee68a04aac9ef821
SHA1 (patch-af) = 80050d29e3f3e43116f86ea9a4d93c68d9500556
-SHA1 (patch-ag) = c584a8c41f5d7bccd3ef7b3bcf07d202938ae54e
+SHA1 (patch-ag) = 2f6e1bd24888f02083fba88d73bdcc5672cb3aab
+SHA1 (patch-h_ebind_h) = fd262c8559f86a923c4ca4d6ee237229c21e15c3
+SHA1 (patch-h_eproto_h) = 20abd7755c63292cc87197a4de31d69491f973a8
+SHA1 (patch-h_evar_h) = 3491307028a9249a159abb3d92394dbdb475c289
+SHA1 (patch-src_abbrev_c) = 9252165a1a60f4984ba7e68ace5ab1e3b9aba5ff
+SHA1 (patch-src_basic_c) = 9c46f2526102342c2c0b13f7febfb04913245a58
+SHA1 (patch-src_buffer_c) = a2589f58e8adf6a227be33a3c97560b01a0f6af6
+SHA1 (patch-src_crypt_c) = 5e76bada1614497596675026465a448fe2ea7779
+SHA1 (patch-src_display_c) = aad3a3e1e08eb60faf8fddda248b5d5e81cc3c96
+SHA1 (patch-src_dolock_c) = 76065c2713b521d4e82f1ee9c261ff392e254428
+SHA1 (patch-src_eval_c) = fe624ff82f021eee53de21f4682bd28872703a37
+SHA1 (patch-src_exec_c) = 27238fd0b2948cbaff2ee83d2cc1547d7554d3c2
+SHA1 (patch-src_file_c) = f62c778b710e2bd61e762514bbc3136ff8f7b201
+SHA1 (patch-src_fileio_c) = ee5034687a031a5d69e31ef6126fe7e34adcf8a3
+SHA1 (patch-src_input_c) = 53e4c06eaef9dfcdb2bbe52c54338fbaa2fa0de9
+SHA1 (patch-src_isearch_c) = 23405d0dd9a82d874df41714fdfa1c79bff90e24
+SHA1 (patch-src_keyboard_c) = 607aecf64f0ed212f642e25671c995f83373bc88
+SHA1 (patch-src_line_c) = 50943baedce5c4cb41a4d155cf2713cd33f4734d
+SHA1 (patch-src_main_c) = 7f6ad81de9646e0d358739fdaf58005927687b06
+SHA1 (patch-src_mouse_c) = 49c0d8ff5da8f171d2e784ba9a38951a2d95ef3c
+SHA1 (patch-src_random_c) = 76bedf9bafbf17fa47608ffc0a2ecb301580ef36
+SHA1 (patch-src_region_c) = 0290a4f2146bfb21eef233f91347f98e24b5d309
+SHA1 (patch-src_replace_c) = 373766f5fed7086a3bb3da4ae660575a501f591c
+SHA1 (patch-src_screen_c) = c41c79986005d1f6318f9f3fc0a7493477224038
+SHA1 (patch-src_search_c) = de8b5f5f9728d5d7ec93dffd4bedf05e9011de2f
+SHA1 (patch-src_tags_c) = 9651f05b94f293af2ad7490cca7667ce91f5cce2
+SHA1 (patch-src_undo_c) = fb8a3aae42e5c820178333f635edce21c91a5064
+SHA1 (patch-src_window_c) = 438b0007009d5dcb423d7627d77cc41a7288a715
+SHA1 (patch-src_word_c) = 462e5e6c053a1f7f97627c6e273403dd7876f546
diff --git a/editors/uemacs/patches/patch-ab b/editors/uemacs/patches/patch-ab
index 3cdb6fef337..978765c5268 100644
--- a/editors/uemacs/patches/patch-ab
+++ b/editors/uemacs/patches/patch-ab
@@ -1,7 +1,9 @@
-$NetBSD: patch-ab,v 1.4 2004/02/13 23:49:12 snj Exp $
+$NetBSD: patch-ab,v 1.5 2012/05/10 20:53:30 dholland Exp $
---- netbsd/estruct.h.orig Wed Mar 25 14:21:05 1998
-+++ netbsd/estruct.h Wed Mar 25 14:25:34 1998
+Configure for pkgsrc. Fix some of the conditionals for a C89+ world.
+
+--- netbsd/estruct.h.orig 2012-05-10 18:13:41.000000000 +0000
++++ netbsd/estruct.h
@@ -0,0 +1,1254 @@
+/* ESTRUCT: Structure and preprocesser defined for
+ MicroEMACS 4.00
@@ -169,7 +171,7 @@ $NetBSD: patch-ab,v 1.4 2004/02/13 23:49:12 snj Exp $
+#define NOISY 1 /* Use a fancy BELL if it exists */
+#define CTAGS 1 /* include vi-like tagging? */
+#define SPEECH 0 /* spoken EMACS, for the sight impared [not ready] */
-+#define VARARG 0 /* use varargs.h for mlwrite() */
++#define VARARG 1 /* use stdarg.h for mlwrite() */
+
+#if XVT
+#undef COLOR
@@ -237,7 +239,7 @@ $NetBSD: patch-ab,v 1.4 2004/02/13 23:49:12 snj Exp $
+
+/* Prototypes in use? */
+
-+#if MSC || TURBO || IC || VMS || GCC || ZTC
++#if __STDC__ || MSC || TURBO || IC || VMS || GCC || ZTC
+#define PROTO 1
+#else
+#define PROTO 0
@@ -496,7 +498,7 @@ $NetBSD: patch-ab,v 1.4 2004/02/13 23:49:12 snj Exp $
+#endif
+
+#if VARARG
-+#if (GCC == 0) && (USG || AIX || AUX || BSD || FREEBSD || SUN || XENIX || HPUX8 || HPUX9 || AVIION || MPE)
++#if (GCC == 0) && (__STDC__ == 0) && (USG || AIX || AUX || BSD || FREEBSD || SUN || XENIX || HPUX8 || HPUX9 || AVIION || MPE)
+#define VARG 1
+#define SARG 0
+#include <varargs.h>
diff --git a/editors/uemacs/patches/patch-ac b/editors/uemacs/patches/patch-ac
index 35c95896958..1fa1258300a 100644
--- a/editors/uemacs/patches/patch-ac
+++ b/editors/uemacs/patches/patch-ac
@@ -1,18 +1,178 @@
-$NetBSD: patch-ac,v 1.2 2000/03/23 22:08:52 tron Exp $
+$NetBSD: patch-ac,v 1.3 2012/05/10 20:53:30 dholland Exp $
---- src/bind.c.orig Sun Nov 19 03:09:20 1995
-+++ src/bind.c Wed Mar 25 15:00:37 1998
-@@ -634,7 +634,8 @@
- register char *sp; /* pointer into path spec */
+- use standard headers
+- avoid implicit int
+- look in $PREFIX/share/uemacs for data files
+- const correctness required by existing const declarations
+- suppress false initialization warning seen with gcc 4.1
+
+--- src/bind.c.orig 1995-11-19 08:09:20.000000000 +0000
++++ src/bind.c
+@@ -5,13 +5,14 @@
+ */
+
+ #include <stdio.h>
++#include <string.h>
+ #include "estruct.h"
+ #include "eproto.h"
+ #include "edef.h"
+ #include "elang.h"
+ #include "epath.h"
+
+-PASCAL NEAR help(f, n) /* give me some help!!!!
++PASCAL NEAR int help(f, n) /* give me some help!!!!
+ bring up a fake buffer and read the help file
+ into it with view mode */
+
+@@ -19,7 +20,10 @@ int f,n; /* prefix flag and argument */
+
+ {
+ register BUFFER *bp; /* buffer pointer to help */
+- char *fname; /* file name of help file */
++ CONST char *fname; /* file name of help file */
++
++ /* required by gcc 4.1 */
++ fname = NULL;
+
+ /* first check if we are already here */
+ bp = bfind("emacs.hlp", FALSE, BFINVS);
+@@ -51,7 +55,7 @@ int f,n; /* prefix flag and argument */
+ return(TRUE);
+ }
+
+-PASCAL NEAR deskey(f, n) /* describe the command for a certain key */
++PASCAL NEAR int deskey(f, n) /* describe the command for a certain key */
+
+ int f,n; /* prefix flag and argument */
+
+@@ -81,7 +85,7 @@ int f,n; /* prefix flag and argument */
+
+ /* bindtokey: add a new key to the key binding table */
+
+-PASCAL NEAR bindtokey(f, n)
++PASCAL NEAR int bindtokey(f, n)
+
+ int f, n; /* command arguments [IGNORED] */
+
+@@ -180,7 +184,7 @@ int f, n; /* command arguments [IGNORED]
+
+ /* macrotokey: Bind a key to a macro in the key binding table */
+
+-PASCAL NEAR macrotokey(f, n)
++PASCAL NEAR int macrotokey(f, n)
+
+ int f, n; /* command arguments [IGNORED] */
+
+@@ -258,7 +262,7 @@ int f, n; /* command arguments [IGNORED]
+
+ /* unbindkey: delete a key from the key binding table */
+
+-PASCAL NEAR unbindkey(f, n)
++PASCAL NEAR int unbindkey(f, n)
+
+ int f, n; /* command arguments [IGNORED] */
+
+@@ -286,7 +290,7 @@ int f, n; /* command arguments [IGNORED]
+ return(TRUE);
+ }
+
+-PASCAL NEAR unbindchar(c)
++PASCAL NEAR int unbindchar(c)
+
+ int c; /* command key to unbind */
+
+@@ -359,7 +363,7 @@ BUFFER *bp; /* buffer to unbind all keys
+ into it with view mode
+ */
+
+-PASCAL NEAR desbind(f, n)
++PASCAL NEAR int desbind(f, n)
+
+ int f,n; /* prefix flag and argument */
+
+@@ -367,7 +371,7 @@ int f,n; /* prefix flag and argument */
+ return(buildlist(TRUE, ""));
+ }
+
+-PASCAL NEAR apro(f, n) /* Apropos (List functions that match a substring) */
++PASCAL NEAR int apro(f, n) /* Apropos (List functions that match a substring) */
+
+ int f,n; /* prefix flag and argument */
+
+@@ -383,7 +387,7 @@ int f,n; /* prefix flag and argument */
+ return(buildlist(FALSE, mstring));
+ }
+
+-PASCAL NEAR buildlist(type, mstring) /* build a binding list (limited or full) */
++PASCAL NEAR int buildlist(type, mstring) /* build a binding list (limited or full) */
+
+ int type; /* true = full list, false = partial list */
+ char *mstring; /* match string if a partial list */
+@@ -519,7 +523,7 @@ bfail: /* and on to the next buffer */
+ return(TRUE);
+ }
+
+-PASCAL NEAR strinc(source, sub) /* does source include sub? */
++PASCAL NEAR int strinc(source, sub) /* does source include sub? */
+
+ char *source; /* string to search in */
+ char *sub; /* substring to look for */
+@@ -579,12 +583,12 @@ int mflag; /* going for a meta sequence?
+
+ /* execute the startup file */
+
+-PASCAL NEAR startup(sfname)
++PASCAL NEAR int startup(sfname)
+
+ char *sfname; /* name of startup file (null if default) */
+
+ {
+- char *fname; /* resulting file name to execute */
++ CONST char *fname; /* resulting file name to execute */
+ char name[NSTRING]; /* name with extention */
+
+ /* look up the startup file */
+@@ -623,29 +627,31 @@ char *sfname; /* name of startup file (n
+ directories in table from EPATH.H
+ */
+
+-char *PASCAL NEAR flook(fname, hflag)
++CONST char *PASCAL NEAR flook(fname, hflag)
+
+-char *fname; /* base file name to search for */
++CONST char *fname; /* base file name to search for */
+ int hflag; /* Look in the HOME environment variable first? */
+
+ {
+ register char *home; /* path to home directory */
+ register char *path; /* environmental PATH variable */
+- register char *sp; /* pointer into path spec */
++ register CONST char *sp1; /* pointer into path spec */
++ register char *sp2; /* pointer into path spec */
register int i; /* index */
static char fspec[NFILEN]; /* full path spec to search */
-
+ char patha[NFILEN];
+
/* if we have an absolute path.. check only there! */
- sp = fname;
- while (*sp) {
-@@ -689,9 +690,11 @@
+- sp = fname;
+- while (*sp) {
+- if (*sp == ':' || *sp == '\\' || *sp == '/') {
++ sp1 = fname;
++ while (*sp1) {
++ if (*sp1 == ':' || *sp1 == '\\' || *sp1 == '/') {
+ if (ffropen(fname) == FIOSUC) {
+ ffclose();
+ return(fname);
+ } else
+ return(NULL);
+ }
+- ++sp;
++ ++sp1;
+ }
+
+ #if ENVFUNC
+@@ -689,25 +695,27 @@ int hflag; /* Look in the HOME environme
#if OS2
path = getenv("DPATH");
#else
@@ -25,3 +185,55 @@ $NetBSD: patch-ac,v 1.2 2000/03/23 22:08:52 tron Exp $
if (path != NULL)
while (*path) {
+ /* build next possible file spec */
+- sp = fspec;
++ sp2 = fspec;
+ #if TOS
+ while (*path && (*path != PATHCHR) && (*path != ','))
+ #else
+ while (*path && (*path != PATHCHR))
+ #endif
+- *sp++ = *path++;
++ *sp2++ = *path++;
+
+ /* add a terminating dir separator if we need it */
+- if ((sp != fspec) && (*(sp-1) != DIRSEPCHAR))
+- *sp++ = DIRSEPCHAR;
+- *sp = 0;
++ if ((sp2 != fspec) && (*(sp2-1) != DIRSEPCHAR))
++ *sp2++ = DIRSEPCHAR;
++ *sp2 = 0;
+ strcat(fspec, fname);
+
+ /* and try it out */
+@@ -918,12 +926,13 @@ int index; /* index of name to fetch out
+ the ^A form.
+ */
+
+-unsigned int PASCAL NEAR stock(keyname)
++unsigned int PASCAL NEAR stock(keyname_c)
+
+-unsigned char *keyname; /* name of key to translate to Command key form */
++char *keyname_c; /* name of key to translate to Command key form */
+
+ {
+ register unsigned int c; /* key sequence to return */
++ unsigned char *keyname = (unsigned char *)keyname_c;
+
+ /* parse it up */
+ c = 0;
+@@ -990,12 +999,12 @@ unsigned char *keyname; /* name of key t
+ return(c);
+ }
+
+-char *PASCAL NEAR transbind(skey) /* string key name to binding name.... */
++CONST char *PASCAL NEAR transbind(skey) /* string key name to binding name.... */
+
+ char *skey; /* name of key to get binding for */
+
+ {
+- char *bindname;
++ CONST char *bindname;
+
+ bindname = getfname(getbind(stock(skey)));
+ if (bindname == NULL)
diff --git a/editors/uemacs/patches/patch-ad b/editors/uemacs/patches/patch-ad
index 1608e7caf56..ed73acc922d 100644
--- a/editors/uemacs/patches/patch-ad
+++ b/editors/uemacs/patches/patch-ad
@@ -1,22 +1,52 @@
-$NetBSD: patch-ad,v 1.2 2000/03/23 22:08:52 tron Exp $
+$NetBSD: patch-ad,v 1.3 2012/05/10 20:53:30 dholland Exp $
---- src/lock.c.orig Sun Nov 19 03:09:22 1995
-+++ src/lock.c Wed Mar 25 13:56:13 1998
-@@ -10,10 +10,17 @@
+- use standard includes
+- don't use sys_errlist
+- declare void functions void
+
+--- src/lock.c.orig 1995-11-19 08:09:22.000000000 +0000
++++ src/lock.c
+@@ -10,17 +10,9 @@
#if FILOCK
-+#if BSD
-+#undef BSD
-+#include <sys/param.h>
-+#endif
+-#if BSD || FREEBSD || WMCS || SUN || XENIX || HPUX8 || HPUX9 || AVIION || USG || AIX || AUX
+-#include <sys/errno.h>
+-extern int sys_nerr; /* number of system error messages defined */
+-extern char *sys_errlist[]; /* list of message texts */
+-#endif
+-
+-#if MSC
++#include <string.h>
+ #include <errno.h>
+-#else
+-extern int errno; /* current error */
+-#endif
+
- #if BSD || FREEBSD || WMCS || SUN || XENIX || HPUX8 || HPUX9 || AVIION || USG || AIX || AUX
- #include <sys/errno.h>
-+#if !(defined(BSD) && (BSD >= 199103))
- extern int sys_nerr; /* number of system error messages defined */
- extern char *sys_errlist[]; /* list of message texts */
-+#endif
- #endif
- #if MSC
+ char *lname[NLOCKS]; /* names of all locked files */
+ int numlocks; /* # of current locks active */
+@@ -158,21 +150,12 @@ char *errstr; /* lock error string to p
+
+ strcpy(obuf, errstr);
+ strcat(obuf, " - ");
+-#if BSD || FREEBSD || WMCS || SUN || XENIX || HPUX8 || HPUX9 || AVIION || USG || AIX || AUX
+- if (errno < sys_nerr)
+- strcat(obuf, sys_errlist[errno]);
+- else
+- strcat(obuf, TEXT178);
+-/* "[can not get system error message]" */
+-#else
+- strcat(obuf, "Error # ");
+- strcat(obuf, int_asc(errno));
+-#endif
++ strcat(obuf, strerror(errno));
+ mlwrite(obuf);
+ update(TRUE);
+ }
+ #else
+-lckhello() /* dummy function */
++VOID lckhello() /* dummy function */
+ {
+ }
+ #endif
diff --git a/editors/uemacs/patches/patch-ag b/editors/uemacs/patches/patch-ag
index e149d38fc9f..6d8b1428bb2 100644
--- a/editors/uemacs/patches/patch-ag
+++ b/editors/uemacs/patches/patch-ag
@@ -1,8 +1,26 @@
-$NetBSD: patch-ag,v 1.2 2000/03/23 22:08:52 tron Exp $
+$NetBSD: patch-ag,v 1.3 2012/05/10 20:53:30 dholland Exp $
---- src/unix.c.orig Sat Nov 13 14:57:12 1999
-+++ src/unix.c Sat Nov 13 15:04:45 1999
-@@ -816,9 +816,19 @@
+- needs term.h for termcap
+- get terminal size from termcap only if LINES and COLUMNS aren't set
+ in the environment
+- return values from non-void functions
+ (arguably these should be made void but it causes complications)
+- don't use implicit int
+- add missing conditionals around conditionally-used declaration
+- remove unused variables
+- use correct type signature for signal handler
+
+--- src/unix.c.orig 1995-11-18 21:36:58.000000000 +0000
++++ src/unix.c
+@@ -123,6 +123,7 @@ int scnothing()
+ #include <curses.h> /* Curses screen output */
+ #undef WINDOW /* Oh no! */
+ #endif /* CURSES */
++#include <term.h>
+
+ /** Completion include files **/
+ /** Directory accessing: Try and figure this out... if you can! **/
+@@ -816,9 +817,19 @@ int scopen()
exit(1);
}
@@ -13,15 +31,76 @@ $NetBSD: patch-ag,v 1.2 2000/03/23 22:08:52 tron Exp $
+ * If LINES and/or COLUMNS are set in the environment then use those
+ * values, otherwise get them from termcap.
+ */
-+ if ((cp = getenv("LINES")) == NULL || sscanf(cp, "%d",
++ if ((cp = getenv("LINES")) == NULL || sscanf(cp, "%hd",
+ &term.t_nrow) != 1)
+ term.t_nrow = tgetnum("li");
+ term.t_nrow -= 1;
+
-+ if ((cp = getenv("COLUMNS")) == NULL || sscanf(cp, "%d",
++ if ((cp = getenv("COLUMNS")) == NULL || sscanf(cp, "%hd",
+ &term.t_ncol) != 1)
+ term.t_ncol = tgetnum("co");
+
if (term.t_nrow < 3 || term.t_ncol < 3) {
puts("Screen size is too small!");
exit(1);
+@@ -956,6 +967,7 @@ int sckopen()
+ dis_ufk();
+ #endif
+ #endif
++ return 0;
+ }
+
+ /* close keyboard -hm */
+@@ -968,6 +980,7 @@ int sckclose()
+ dis_sfk();
+ #endif
+ #endif
++ return 0;
+ }
+
+ /** Move cursor **/
+@@ -1063,7 +1076,7 @@ int state; /* New state */
+ }
+
+ /** Beep **/
+-scbeep()
++int scbeep()
+ {
+ #if TERMCAP || TERMIOS
+ #if !NOISY
+@@ -1085,7 +1098,9 @@ scbeep()
+ }
+
+ #if COLOR
++#if USG || AUX
+ static char cmap[8] = { 0, 4, 2, 6, 1, 5, 3, 7 };
++#endif
+
+ /** Set foreground color **/
+ int scfcol(color)
+@@ -1553,7 +1568,6 @@ char *fspec; /* Filename specificatio
+ /** Get next filename from pattern **/
+ char *getnfile()
+ {
+- int index;
+ struct DIRENTRY * dp;
+ struct stat fstat;
+
+@@ -1706,15 +1720,15 @@ char *name; /* name of directory to dele
+ /*
+ * Window size changes handled via signals.
+ */
+-void winch_changed()
++void winch_changed(int sig)
+ {
++ (void)sig;
+ signal(SIGWINCH,winch_changed);
+ winch_flag = 1;
+ }
+
+ void winch_new_size()
+ {
+- EWINDOW *wp;
+ struct winsize win;
+
+ winch_flag=0;
diff --git a/editors/uemacs/patches/patch-h_ebind_h b/editors/uemacs/patches/patch-h_ebind_h
new file mode 100644
index 00000000000..742d2b65002
--- /dev/null
+++ b/editors/uemacs/patches/patch-h_ebind_h
@@ -0,0 +1,507 @@
+$NetBSD: patch-h_ebind_h,v 1.1 2012/05/10 20:53:30 dholland Exp $
+
+Use correct initializers.
+
+--- h/ebind.h~ 2012-05-10 19:25:36.000000000 +0000
++++ h/ebind.h
+@@ -12,191 +12,191 @@
+ NOSHARE KEYTAB keytab[NBINDS] = {
+
+ #if MOUSE
+- {MOUS|'m', BINDFNC, mmove},
+- {MOUS|CTRL|'m', BINDFNC, mmove},
+- {MOUS|SHFT|'m', BINDFNC, mmove},
+- {MOUS|CTRL|SHFT|'m', BINDFNC, mmove},
+- {MOUS|'a', BINDFNC, movemd},
+- {MOUS|'b', BINDFNC, movemu},
+- {MOUS|'e', BINDFNC, mregdown},
+- {MOUS|'f', BINDFNC, mregup},
+- {MOUS|'1', BINDFNC, resizm},
++ {MOUS|'m', BINDFNC, {mmove}},
++ {MOUS|CTRL|'m', BINDFNC, {mmove}},
++ {MOUS|SHFT|'m', BINDFNC, {mmove}},
++ {MOUS|CTRL|SHFT|'m', BINDFNC, {mmove}},
++ {MOUS|'a', BINDFNC, {movemd}},
++ {MOUS|'b', BINDFNC, {movemu}},
++ {MOUS|'e', BINDFNC, {mregdown}},
++ {MOUS|'f', BINDFNC, {mregup}},
++ {MOUS|'1', BINDFNC, {resizm}},
+ #endif
+
+- {CTRL|'A', BINDFNC, gotobol},
+- {CTRL|'B', BINDFNC, backchar},
+- {CTRL|'C', BINDFNC, insspace},
+- {CTRL|'D', BINDFNC, forwdel},
+- {CTRL|'E', BINDFNC, gotoeol},
+- {CTRL|'F', BINDFNC, forwchar},
+- {CTRL|'G', BINDFNC, ctrlg},
+- {CTRL|'H', BINDFNC, backdel},
+- {CTRL|'I', BINDFNC, tab},
+- {CTRL|'J', BINDFNC, indent},
+- {CTRL|'K', BINDFNC, killtext},
+- {CTRL|'L', BINDFNC, refresh},
+- {CTRL|'M', BINDFNC, newline},
+- {CTRL|'N', BINDFNC, forwline},
+- {CTRL|'O', BINDFNC, openline},
+- {CTRL|'P', BINDFNC, backline},
+- {CTRL|'Q', BINDFNC, quote},
+- {CTRL|'R', BINDFNC, backsearch},
+- {CTRL|'S', BINDFNC, forwsearch},
+- {CTRL|'T', BINDFNC, twiddle},
+- {CTRL|'U', BINDFNC, unarg},
+- {CTRL|'V', BINDFNC, forwpage},
+- {CTRL|'W', BINDFNC, killregion},
+- {CTRL|'X', BINDFNC, cex},
+- {CTRL|'Y', BINDFNC, yank},
+- {CTRL|'Z', BINDFNC, backpage},
+- {CTRL|'[', BINDFNC, meta},
+- {CTRL|'\\', BINDFNC, forwsearch},
+- {CTRL|'^', BINDFNC, quote},
+- {CTRL|'_', BINDFNC, undo},
+- {CTLX|CTRL|'A', BINDFNC, fileapp},
+- {CTLX|CTRL|'B', BINDFNC, listbuffers},
+- {CTLX|CTRL|'C', BINDFNC, quit},
+- {CTLX|CTRL|'D', BINDFNC, detab},
+- {CTLX|CTRL|'E', BINDFNC, entab},
+- {CTLX|CTRL|'F', BINDFNC, filefind},
+- {CTLX|CTRL|'I', BINDFNC, insfile},
+- {CTLX|CTRL|'K', BINDFNC, macrotokey},
+- {CTLX|CTRL|'L', BINDFNC, lowerregion},
+- {CTLX|CTRL|'M', BINDFNC, delmode},
+- {CTLX|CTRL|'N', BINDFNC, mvdnwind},
+- {CTLX|CTRL|'O', BINDFNC, deblank},
+- {CTLX|CTRL|'P', BINDFNC, mvupwind},
+- {CTLX|CTRL|'R', BINDFNC, fileread},
+- {CTLX|CTRL|'S', BINDFNC, filesave},
+- {CTLX|CTRL|'T', BINDFNC, trim},
+- {CTLX|CTRL|'U', BINDFNC, upperregion},
+- {CTLX|CTRL|'V', BINDFNC, viewfile},
+- {CTLX|CTRL|'W', BINDFNC, filewrite},
+- {CTLX|CTRL|'X', BINDFNC, swapmark},
+- {CTLX|CTRL|'Z', BINDFNC, shrinkwind},
+- {CTLX|CTRL|'\\', BINDFNC, filesave},
+- {CTLX|'?', BINDFNC, deskey},
+- {CTLX|'!', BINDFNC, spawn},
+- {CTLX|'@', BINDFNC, pipecmd},
+- {CTLX|'#', BINDFNC, filter},
+- {CTLX|'$', BINDFNC, execprg},
+- {CTLX|'=', BINDFNC, showcpos},
+- {CTLX|'(', BINDFNC, ctlxlp},
+- {CTLX|')', BINDFNC, ctlxrp},
+- {CTLX|'<', BINDFNC, narrow},
+- {CTLX|'>', BINDFNC, widen},
+- {CTLX|'^', BINDFNC, enlargewind},
+- {CTLX|' ', BINDFNC, remmark},
+- {CTLX|'0', BINDFNC, delwind},
+- {CTLX|'1', BINDFNC, onlywind},
+- {CTLX|'2', BINDFNC, splitwind},
+- {CTLX|'A', BINDFNC, setvar},
+- {CTLX|'B', BINDFNC, usebuffer},
+- {CTLX|'C', BINDFNC, spawncli},
++ {CTRL|'A', BINDFNC, {gotobol}},
++ {CTRL|'B', BINDFNC, {backchar}},
++ {CTRL|'C', BINDFNC, {insspace}},
++ {CTRL|'D', BINDFNC, {forwdel}},
++ {CTRL|'E', BINDFNC, {gotoeol}},
++ {CTRL|'F', BINDFNC, {forwchar}},
++ {CTRL|'G', BINDFNC, {ctrlg}},
++ {CTRL|'H', BINDFNC, {backdel}},
++ {CTRL|'I', BINDFNC, {tab}},
++ {CTRL|'J', BINDFNC, {indent}},
++ {CTRL|'K', BINDFNC, {killtext}},
++ {CTRL|'L', BINDFNC, {refresh}},
++ {CTRL|'M', BINDFNC, {newline}},
++ {CTRL|'N', BINDFNC, {forwline}},
++ {CTRL|'O', BINDFNC, {openline}},
++ {CTRL|'P', BINDFNC, {backline}},
++ {CTRL|'Q', BINDFNC, {quote}},
++ {CTRL|'R', BINDFNC, {backsearch}},
++ {CTRL|'S', BINDFNC, {forwsearch}},
++ {CTRL|'T', BINDFNC, {twiddle}},
++ {CTRL|'U', BINDFNC, {unarg}},
++ {CTRL|'V', BINDFNC, {forwpage}},
++ {CTRL|'W', BINDFNC, {killregion}},
++ {CTRL|'X', BINDFNC, {cex}},
++ {CTRL|'Y', BINDFNC, {yank}},
++ {CTRL|'Z', BINDFNC, {backpage}},
++ {CTRL|'[', BINDFNC, {meta}},
++ {CTRL|'\\', BINDFNC, {forwsearch}},
++ {CTRL|'^', BINDFNC, {quote}},
++ {CTRL|'_', BINDFNC, {undo}},
++ {CTLX|CTRL|'A', BINDFNC, {fileapp}},
++ {CTLX|CTRL|'B', BINDFNC, {listbuffers}},
++ {CTLX|CTRL|'C', BINDFNC, {quit}},
++ {CTLX|CTRL|'D', BINDFNC, {detab}},
++ {CTLX|CTRL|'E', BINDFNC, {entab}},
++ {CTLX|CTRL|'F', BINDFNC, {filefind}},
++ {CTLX|CTRL|'I', BINDFNC, {insfile}},
++ {CTLX|CTRL|'K', BINDFNC, {macrotokey}},
++ {CTLX|CTRL|'L', BINDFNC, {lowerregion}},
++ {CTLX|CTRL|'M', BINDFNC, {delmode}},
++ {CTLX|CTRL|'N', BINDFNC, {mvdnwind}},
++ {CTLX|CTRL|'O', BINDFNC, {deblank}},
++ {CTLX|CTRL|'P', BINDFNC, {mvupwind}},
++ {CTLX|CTRL|'R', BINDFNC, {fileread}},
++ {CTLX|CTRL|'S', BINDFNC, {filesave}},
++ {CTLX|CTRL|'T', BINDFNC, {trim}},
++ {CTLX|CTRL|'U', BINDFNC, {upperregion}},
++ {CTLX|CTRL|'V', BINDFNC, {viewfile}},
++ {CTLX|CTRL|'W', BINDFNC, {filewrite}},
++ {CTLX|CTRL|'X', BINDFNC, {swapmark}},
++ {CTLX|CTRL|'Z', BINDFNC, {shrinkwind}},
++ {CTLX|CTRL|'\\', BINDFNC, {filesave}},
++ {CTLX|'?', BINDFNC, {deskey}},
++ {CTLX|'!', BINDFNC, {spawn}},
++ {CTLX|'@', BINDFNC, {pipecmd}},
++ {CTLX|'#', BINDFNC, {filter}},
++ {CTLX|'$', BINDFNC, {execprg}},
++ {CTLX|'=', BINDFNC, {showcpos}},
++ {CTLX|'(', BINDFNC, {ctlxlp}},
++ {CTLX|')', BINDFNC, {ctlxrp}},
++ {CTLX|'<', BINDFNC, {narrow}},
++ {CTLX|'>', BINDFNC, {widen}},
++ {CTLX|'^', BINDFNC, {enlargewind}},
++ {CTLX|' ', BINDFNC, {remmark}},
++ {CTLX|'0', BINDFNC, {delwind}},
++ {CTLX|'1', BINDFNC, {onlywind}},
++ {CTLX|'2', BINDFNC, {splitwind}},
++ {CTLX|'A', BINDFNC, {setvar}},
++ {CTLX|'B', BINDFNC, {usebuffer}},
++ {CTLX|'C', BINDFNC, {spawncli}},
+ #if BSD || FREEBSD || VMS || SUN || HPUX8 || HPUX9 || AVIION
+- {CTLX|'D', BINDFNC, bktoshell},
++ {CTLX|'D', BINDFNC, {bktoshell}},
+ #endif
+- {CTLX|'E', BINDFNC, ctlxe},
+- {CTLX|'G', BINDFNC, dispvar},
+- {CTLX|'K', BINDFNC, killbuffer},
+- {CTLX|'M', BINDFNC, setmod},
+- {CTLX|'N', BINDFNC, filename},
+- {CTLX|'O', BINDFNC, nextwind},
+- {CTLX|'P', BINDFNC, prevwind},
++ {CTLX|'E', BINDFNC, {ctlxe}},
++ {CTLX|'G', BINDFNC, {dispvar}},
++ {CTLX|'K', BINDFNC, {killbuffer}},
++ {CTLX|'M', BINDFNC, {setmod}},
++ {CTLX|'N', BINDFNC, {filename}},
++ {CTLX|'O', BINDFNC, {nextwind}},
++ {CTLX|'P', BINDFNC, {prevwind}},
+ #if ISRCH
+- {CTLX|'R', BINDFNC, risearch},
+- {CTLX|'S', BINDFNC, fisearch},
++ {CTLX|'R', BINDFNC, {risearch}},
++ {CTLX|'S', BINDFNC, {fisearch}},
+ #endif
+- {CTLX|'U', BINDFNC, undo_list},
+- {CTLX|'W', BINDFNC, resize},
+- {CTLX|'X', BINDFNC, nextbuffer},
+- {CTLX|'Y', BINDFNC, cycle_ring},
+- {CTLX|'Z', BINDFNC, enlargewind},
+- {META|CTRL|'C', BINDFNC, wordcount},
+- {META|CTRL|'E', BINDFNC, execproc},
+- {META|CTRL|'F', BINDFNC, getfence},
+- {META|CTRL|'G', BINDFNC, gotomark},
+- {META|CTRL|'H', BINDFNC, delbword},
+- {META|CTRL|'K', BINDFNC, unbindkey},
+- {META|CTRL|'L', BINDFNC, reposition},
+- {META|CTRL|'M', BINDFNC, delgmode},
+- {META|CTRL|'N', BINDFNC, namebuffer},
+- {META|CTRL|'R', BINDFNC, qreplace},
+- {META|CTRL|'S', BINDFNC, execfile},
+- {META|CTRL|'V', BINDFNC, nextdown},
+- {META|CTRL|'U', BINDFNC, undo_delete},
+- {META|CTRL|'W', BINDFNC, killpara},
+- {META|CTRL|'X', BINDFNC, execcmd},
+- {META|CTRL|'Y', BINDFNC, clear_ring},
+- {META|CTRL|'Z', BINDFNC, nextup},
+- {META|CTRL|'\\', BINDFNC, execfile},
+- {META|' ', BINDFNC, setmark},
+- {META|'?', BINDFNC, help},
+- {META|'!', BINDFNC, reposition},
+- {META|')', BINDFNC, indent_region},
+- {META|'(', BINDFNC, undent_region},
+- {META|'.', BINDFNC, setmark},
+- {META|'>', BINDFNC, gotoeob},
+- {META|'<', BINDFNC, gotobob},
+- {META|'~', BINDFNC, unmark},
+- {META|'A', BINDFNC, apro},
+- {META|'B', BINDFNC, backword},
+- {META|'C', BINDFNC, capword},
+- {META|'D', BINDFNC, delfword},
++ {CTLX|'U', BINDFNC, {undo_list}},
++ {CTLX|'W', BINDFNC, {resize}},
++ {CTLX|'X', BINDFNC, {nextbuffer}},
++ {CTLX|'Y', BINDFNC, {cycle_ring}},
++ {CTLX|'Z', BINDFNC, {enlargewind}},
++ {META|CTRL|'C', BINDFNC, {wordcount}},
++ {META|CTRL|'E', BINDFNC, {execproc}},
++ {META|CTRL|'F', BINDFNC, {getfence}},
++ {META|CTRL|'G', BINDFNC, {gotomark}},
++ {META|CTRL|'H', BINDFNC, {delbword}},
++ {META|CTRL|'K', BINDFNC, {unbindkey}},
++ {META|CTRL|'L', BINDFNC, {reposition}},
++ {META|CTRL|'M', BINDFNC, {delgmode}},
++ {META|CTRL|'N', BINDFNC, {namebuffer}},
++ {META|CTRL|'R', BINDFNC, {qreplace}},
++ {META|CTRL|'S', BINDFNC, {execfile}},
++ {META|CTRL|'V', BINDFNC, {nextdown}},
++ {META|CTRL|'U', BINDFNC, {undo_delete}},
++ {META|CTRL|'W', BINDFNC, {killpara}},
++ {META|CTRL|'X', BINDFNC, {execcmd}},
++ {META|CTRL|'Y', BINDFNC, {clear_ring}},
++ {META|CTRL|'Z', BINDFNC, {nextup}},
++ {META|CTRL|'\\', BINDFNC, {execfile}},
++ {META|' ', BINDFNC, {setmark}},
++ {META|'?', BINDFNC, {help}},
++ {META|'!', BINDFNC, {reposition}},
++ {META|')', BINDFNC, {indent_region}},
++ {META|'(', BINDFNC, {undent_region}},
++ {META|'.', BINDFNC, {setmark}},
++ {META|'>', BINDFNC, {gotoeob}},
++ {META|'<', BINDFNC, {gotobob}},
++ {META|'~', BINDFNC, {unmark}},
++ {META|'A', BINDFNC, {apro}},
++ {META|'B', BINDFNC, {backword}},
++ {META|'C', BINDFNC, {capword}},
++ {META|'D', BINDFNC, {delfword}},
+ #if CRYPT
+- {META|'E', BINDFNC, setekey},
++ {META|'E', BINDFNC, {setekey}},
+ #endif
+- {META|'F', BINDFNC, forwword},
+- {META|'G', BINDFNC, gotoline},
+- {META|'K', BINDFNC, bindtokey},
+- {META|'L', BINDFNC, lowerword},
+- {META|'M', BINDFNC, setgmode},
+- {META|'N', BINDFNC, gotoeop},
+- {META|'P', BINDFNC, gotobop},
+- {META|'Q', BINDFNC, fillpara},
+- {META|'R', BINDFNC, sreplace},
++ {META|'F', BINDFNC, {forwword}},
++ {META|'G', BINDFNC, {gotoline}},
++ {META|'K', BINDFNC, {bindtokey}},
++ {META|'L', BINDFNC, {lowerword}},
++ {META|'M', BINDFNC, {setgmode}},
++ {META|'N', BINDFNC, {gotoeop}},
++ {META|'P', BINDFNC, {gotobop}},
++ {META|'Q', BINDFNC, {fillpara}},
++ {META|'R', BINDFNC, {sreplace}},
+ #if BSD || FREEBSD || HPUX8 || HPUX9 || VMS || SUN || AVIION
+- {META|'S', BINDFNC, bktoshell},
++ {META|'S', BINDFNC, {bktoshell}},
+ #endif
+- {META|'U', BINDFNC, upperword},
+- {META|'V', BINDFNC, backpage},
+- {META|'W', BINDFNC, copyregion},
+- {META|'X', BINDFNC, namedcmd},
+- {META|'Y', BINDFNC, yank_pop},
+- {META|'Z', BINDFNC, quickexit},
+-/* {META|CTRL|'?', BINDFNC, delbword}, ??? */
+-
+- {ALTD|'B', BINDFNC, list_screens},
+- {ALTD|'C', BINDFNC, cycle_screens},
+- {ALTD|'D', BINDFNC, delete_screen},
+- {ALTD|'F', BINDFNC, find_screen},
+- {ALTD|'N', BINDFNC, rename_screen},
+- {ALTD|'R', BINDFNC, backhunt},
+- {ALTD|'S', BINDFNC, forwhunt},
+-
+- {SPEC|'<', BINDFNC, gotobob}, /* Home */
+- {SPEC|'P', BINDFNC, backline}, /* up */
+- {SPEC|'Z', BINDFNC, backpage}, /* PgUp */
+- {SPEC|'B', BINDFNC, backchar}, /* left */
+-
+- {SPEC|'L', BINDFNC, reposition}, /* NP5 */
+-
+- {SPEC|'F', BINDFNC, forwchar}, /* right */
+- {SPEC|'>', BINDFNC, gotoeob}, /* End */
+- {SPEC|'N', BINDFNC, forwline}, /* down */
+- {SPEC|'V', BINDFNC, forwpage}, /* PgDn */
+- {SPEC|'C', BINDFNC, insspace}, /* Ins */
+- {SPEC|'D', BINDFNC, forwdel}, /* Del */
+-
+- {SPEC|CTRL|'B', BINDFNC, backword}, /* ctrl left */
+- {SPEC|CTRL|'F', BINDFNC, forwword}, /* ctrl right */
+- {SPEC|CTRL|'Z', BINDFNC, gotobop}, /* ctrl PgUp */
+- {SPEC|CTRL|'V', BINDFNC, gotoeop}, /* ctrl PgDn */
++ {META|'U', BINDFNC, {upperword}},
++ {META|'V', BINDFNC, {backpage}},
++ {META|'W', BINDFNC, {copyregion}},
++ {META|'X', BINDFNC, {namedcmd}},
++ {META|'Y', BINDFNC, {yank_pop}},
++ {META|'Z', BINDFNC, {quickexit}},
++/* {META|CTRL|'?', BINDFNC, {delbword}}, ??? */
++
++ {ALTD|'B', BINDFNC, {list_screens}},
++ {ALTD|'C', BINDFNC, {cycle_screens}},
++ {ALTD|'D', BINDFNC, {delete_screen}},
++ {ALTD|'F', BINDFNC, {find_screen}},
++ {ALTD|'N', BINDFNC, {rename_screen}},
++ {ALTD|'R', BINDFNC, {backhunt}},
++ {ALTD|'S', BINDFNC, {forwhunt}},
++
++ {SPEC|'<', BINDFNC, {gotobob}}, /* Home */
++ {SPEC|'P', BINDFNC, {backline}}, /* up */
++ {SPEC|'Z', BINDFNC, {backpage}}, /* PgUp */
++ {SPEC|'B', BINDFNC, {backchar}}, /* left */
++
++ {SPEC|'L', BINDFNC, {reposition}}, /* NP5 */
++
++ {SPEC|'F', BINDFNC, {forwchar}}, /* right */
++ {SPEC|'>', BINDFNC, {gotoeob}}, /* End */
++ {SPEC|'N', BINDFNC, {forwline}}, /* down */
++ {SPEC|'V', BINDFNC, {forwpage}}, /* PgDn */
++ {SPEC|'C', BINDFNC, {insspace}}, /* Ins */
++ {SPEC|'D', BINDFNC, {forwdel}}, /* Del */
++
++ {SPEC|CTRL|'B', BINDFNC, {backword}}, /* ctrl left */
++ {SPEC|CTRL|'F', BINDFNC, {forwword}}, /* ctrl right */
++ {SPEC|CTRL|'Z', BINDFNC, {gotobop}}, /* ctrl PgUp */
++ {SPEC|CTRL|'V', BINDFNC, {gotoeop}}, /* ctrl PgDn */
+
+ #if WINDOW_MSWIN /* IBM-CUA clipboard bindings */
+- {SPEC|CTRL|'C', BINDFNC, clipregion}, /* ctrl Ins */
+- {SPEC|SHFT|'C', BINDFNC, insertclip}, /* shift Ins */
+- {SPEC|SHFT|'D', BINDFNC, cutregion}, /* shift Del */
++ {SPEC|CTRL|'C', BINDFNC, {clipregion}}, /* ctrl Ins */
++ {SPEC|SHFT|'C', BINDFNC, {insertclip}}, /* shift Ins */
++ {SPEC|SHFT|'D', BINDFNC, {cutregion}}, /* shift Del */
+ #endif
+
+ #if ATKBD | OS2
+@@ -208,72 +208,72 @@ NOSHARE KEYTAB keytab[NBINDS] = {
+
+ See keyboard.c for a full list of available keys.
+ */
+- {SPEC|'a', BINDFNC, gotobob}, /* grey Home */
+- {SPEC|'b', BINDFNC, backline}, /* grey up */
+- {SPEC|'c', BINDFNC, backpage}, /* grey PgUp */
+- {SPEC|'d', BINDFNC, backchar}, /* grey left */
+- {SPEC|'e', BINDFNC, reposition}, /* grey center */
+- {SPEC|'f', BINDFNC, forwchar}, /* grey right */
+- {SPEC|'g', BINDFNC, gotoeob}, /* grey End */
+- {SPEC|'h', BINDFNC, forwline}, /* grey down */
+- {SPEC|'i', BINDFNC, forwpage}, /* grey PgDn */
+- {SPEC|'j', BINDFNC, insspace}, /* grey Ins */
+- {SPEC|'k', BINDFNC, forwdel}, /* grey Del */
+- {SPEC|':', BINDFNC, execcmd}, /* pause */
+-
+- {SPEC|CTRL|'c', BINDFNC, gotobop}, /* ctrl grey PgUp */
+- {SPEC|CTRL|'d', BINDFNC, backword}, /* ctrl grey left */
+- {SPEC|CTRL|'f', BINDFNC, forwword}, /* ctrl grey right */
+- {SPEC|CTRL|'i', BINDFNC, gotoeop}, /* ctrl grey PgDn */
++ {SPEC|'a', BINDFNC, {gotobob}}, /* grey Home */
++ {SPEC|'b', BINDFNC, {backline}}, /* grey up */
++ {SPEC|'c', BINDFNC, {backpage}}, /* grey PgUp */
++ {SPEC|'d', BINDFNC, {backchar}}, /* grey left */
++ {SPEC|'e', BINDFNC, {reposition}}, /* grey center */
++ {SPEC|'f', BINDFNC, {forwchar}}, /* grey right */
++ {SPEC|'g', BINDFNC, {gotoeob}}, /* grey End */
++ {SPEC|'h', BINDFNC, {forwline}}, /* grey down */
++ {SPEC|'i', BINDFNC, {forwpage}}, /* grey PgDn */
++ {SPEC|'j', BINDFNC, {insspace}}, /* grey Ins */
++ {SPEC|'k', BINDFNC, {forwdel}}, /* grey Del */
++ {SPEC|':', BINDFNC, {execcmd}}, /* pause */
++
++ {SPEC|CTRL|'c', BINDFNC, {gotobop}}, /* ctrl grey PgUp */
++ {SPEC|CTRL|'d', BINDFNC, {backword}}, /* ctrl grey left */
++ {SPEC|CTRL|'f', BINDFNC, {forwword}}, /* ctrl grey right */
++ {SPEC|CTRL|'i', BINDFNC, {gotoeop}}, /* ctrl grey PgDn */
+
+ #endif
+
+ #if HP150
+- {SPEC|32, BINDFNC, backline},
+- {SPEC|33, BINDFNC, forwline},
+- {SPEC|35, BINDFNC, backchar},
+- {SPEC|34, BINDFNC, forwchar},
+- {SPEC|44, BINDFNC, gotobob},
+- {SPEC|46, BINDFNC, forwpage},
+- {SPEC|47, BINDFNC, backpage},
+- {SPEC|82, BINDFNC, nextwind},
+- {SPEC|68, BINDFNC, openline},
+- {SPEC|69, BINDFNC, killtext},
+- {SPEC|65, BINDFNC, forwdel},
+- {SPEC|64, BINDFNC, ctlxe},
+- {SPEC|67, BINDFNC, refresh},
+- {SPEC|66, BINDFNC, reposition},
+- {SPEC|83, BINDFNC, help},
+- {SPEC|81, BINDFNC, deskey},
++ {SPEC|32, BINDFNC, {backline}},
++ {SPEC|33, BINDFNC, {forwline}},
++ {SPEC|35, BINDFNC, {backchar}},
++ {SPEC|34, BINDFNC, {forwchar}},
++ {SPEC|44, BINDFNC, {gotobob}},
++ {SPEC|46, BINDFNC, {forwpage}},
++ {SPEC|47, BINDFNC, {backpage}},
++ {SPEC|82, BINDFNC, {nextwind}},
++ {SPEC|68, BINDFNC, {openline}},
++ {SPEC|69, BINDFNC, {killtext}},
++ {SPEC|65, BINDFNC, {forwdel}},
++ {SPEC|64, BINDFNC, {ctlxe}},
++ {SPEC|67, BINDFNC, {refresh}},
++ {SPEC|66, BINDFNC, {reposition}},
++ {SPEC|83, BINDFNC, {help}},
++ {SPEC|81, BINDFNC, {deskey}},
+ #endif
+
+ #if HP110
+- {SPEC|0x4b, BINDFNC, backchar},
+- {SPEC|0x4d, BINDFNC, forwchar},
+- {SPEC|0x48, BINDFNC, backline},
+- {SPEC|0x50, BINDFNC, forwline},
+- {SPEC|0x43, BINDFNC, help},
+- {SPEC|0x73, BINDFNC, backword},
+- {SPEC|0x74, BINDFNC, forwword},
+- {SPEC|0x49, BINDFNC, backpage},
+- {SPEC|0x51, BINDFNC, forwpage},
++ {SPEC|0x4b, BINDFNC, {backchar}},
++ {SPEC|0x4d, BINDFNC, {forwchar}},
++ {SPEC|0x48, BINDFNC, {backline}},
++ {SPEC|0x50, BINDFNC, {forwline}},
++ {SPEC|0x43, BINDFNC, {help}},
++ {SPEC|0x73, BINDFNC, {backword}},
++ {SPEC|0x74, BINDFNC, {forwword}},
++ {SPEC|0x49, BINDFNC, {backpage}},
++ {SPEC|0x51, BINDFNC, {forwpage}},
+ #endif
+
+ #if AMIGA
+- {SPEC|'?', BINDFNC, help},
+- {SPEC|'A', BINDFNC, backline},
+- {SPEC|'B', BINDFNC, forwline},
+- {SPEC|'C', BINDFNC, forwchar},
+- {SPEC|'D', BINDFNC, backchar},
+- {SPEC|'T', BINDFNC, backpage},
+- {SPEC|'S', BINDFNC, forwpage},
+- {SPEC|'a', BINDFNC, backword},
+- {SPEC|'`', BINDFNC, forwword},
+- {127, BINDFNC, forwdel},
++ {SPEC|'?', BINDFNC, {help}},
++ {SPEC|'A', BINDFNC, {backline}},
++ {SPEC|'B', BINDFNC, {forwline}},
++ {SPEC|'C', BINDFNC, {forwchar}},
++ {SPEC|'D', BINDFNC, {backchar}},
++ {SPEC|'T', BINDFNC, {backpage}},
++ {SPEC|'S', BINDFNC, {forwpage}},
++ {SPEC|'a', BINDFNC, {backword}},
++ {SPEC|'`', BINDFNC, {forwword}},
++ {127, BINDFNC, {forwdel}},
+ #endif
+
+ #if TOS
+- {SPEC|CTRL|'5', BINDFNC, help},
++ {SPEC|CTRL|'5', BINDFNC, {help}},
+ #endif
+
+ #if WANGPC
+@@ -341,7 +341,7 @@ NOSHARE KEYTAB keytab[NBINDS] = {
+ SPEC|0x9F, BINDFNC, usebuffer, /* ^GoTo */
+ #endif
+
+- {CTRL|'?', BINDFNC, backdel},
++ {CTRL|'?', BINDFNC, {backdel}},
+
+- {0, BINDNUL, NULL}
++ {0, BINDNUL, {NULL}}
+ };
diff --git a/editors/uemacs/patches/patch-h_eproto_h b/editors/uemacs/patches/patch-h_eproto_h
new file mode 100644
index 00000000000..5d8edd84d35
--- /dev/null
+++ b/editors/uemacs/patches/patch-h_eproto_h
@@ -0,0 +1,303 @@
+$NetBSD: patch-h_eproto_h,v 1.1 2012/05/10 20:53:30 dholland Exp $
+
+- add some missing prototypes
+- declare void functions void
+- const correctness required by existing const declarations
+- use standard headers
+- don't try to declare standard functions
+
+--- h/eproto.h.orig 1996-01-03 02:51:18.000000000 +0000
++++ h/eproto.h
+@@ -41,8 +41,9 @@ extern int emacs(int argc, char *argv[])
+ #endif
+
+ #if HANDLE_WINCH
+-extern VOID winch_changed(VOID);
++extern VOID winch_changed(int);
+ extern VOID winch_new_size(VOID);
++extern VOID winch_vtresize(int rows, int cols);
+ #endif
+
+ #if DEBUG_SEARCH
+@@ -75,41 +76,41 @@ extern SCREEN *PASCAL NEAR index_screen(
+ extern int PASCAL NEAR screen_index(SCREEN *sp);
+ extern int PASCAL NEAR insert_screen(SCREEN *sp);
+ extern int PASCAL NEAR select_screen(SCREEN *sp, int announce);
+-extern int PASCAL NEAR free_screen(SCREEN *sp);
++extern VOID PASCAL NEAR free_screen(SCREEN *sp);
+ extern char *allocate(unsigned nbytes);
+ extern char *dolock(char *fname);
+ extern char *getpath(char *filespec);
+ extern char *gtname(char *filespec);
+-extern char *PASCAL NEAR bytecopy(char *dst, char *src, int maxlen);
++extern char *PASCAL NEAR bytecopy(char *dst, CONST char *src, int maxlen);
+ extern char *PASCAL NEAR cmdstr(int c, char *seq);
+ extern char *PASCAL NEAR copystr(char *);
+ extern char *PASCAL NEAR complete(char *prompt, char *defval, int type, int maxlen);
+ extern char *PASCAL NEAR envval(int i);
+-extern char *PASCAL NEAR fixnull(char *s);
+-extern char *PASCAL NEAR flook(char *fname, int hflag);
++extern CONST char *PASCAL NEAR fixnull(CONST char *s);
++extern CONST char *PASCAL NEAR flook(CONST char *fname, int hflag);
+ extern char *PASCAL NEAR funval(int i);
+ extern char *PASCAL NEAR getctext(char *rline);
+ extern char *PASCAL NEAR getffile(char *fspec);
+ extern char *PASCAL NEAR getfname(KEYTAB *key);
+ extern char *PASCAL NEAR getkill(VOID);
+ extern char *PASCAL NEAR getnfile(VOID);
+-extern char *PASCAL NEAR getreg(char *value);
+-extern char *PASCAL NEAR getval(char *token);
++extern CONST char *PASCAL NEAR getreg(char *value);
++extern CONST char *PASCAL NEAR getval(char *token);
+ extern char *PASCAL NEAR getwlist(char *buf);
+-extern char *PASCAL NEAR gtenv(char *vname);
++extern CONST char *PASCAL NEAR gtenv(char *vname);
+ extern char *PASCAL NEAR gtfilename(char *prompt);
+-extern char *PASCAL NEAR gtfun(char *fname);
+-extern char *PASCAL NEAR gtusr(char *vname);
++extern CONST char *PASCAL NEAR gtfun(char *fname);
++extern CONST char *PASCAL NEAR gtusr(char *vname);
+ extern char *PASCAL NEAR int_asc(int i);
+ extern char *PASCAL NEAR long_asc(long num);
+-extern char *PASCAL NEAR ltos(int val);
+-extern char *PASCAL NEAR makename(char *bname, char *fname);
++extern CONST char *PASCAL NEAR ltos(int val);
++extern CONST char *PASCAL NEAR makename(char *bname, CONST char *fname);
+ extern char *PASCAL NEAR mklower(char *str);
+ extern char *PASCAL NEAR mkupper(char *str);
+ extern char *PASCAL NEAR namval(int index);
+ extern char *PASCAL NEAR timeset(VOID);
+ extern char *PASCAL NEAR token(char *src, char *tok, int size);
+-extern char *PASCAL NEAR transbind(char *skey);
++extern CONST char *PASCAL NEAR transbind(char *skey);
+ extern char *PASCAL NEAR trimstr(char *s);
+ extern char *PASCAL NEAR xlat(char *source, char *lookup, char *trans);
+ extern char *undolock(char *fname);
+@@ -125,10 +126,10 @@ extern int (PASCAL NEAR *PASCAL NEAR fnc
+ extern int (PASCAL NEAR *PASCAL NEAR getname(char *prompt))(VOID);
+ #endif
+ extern int PASCAL NEAR asc_int(char *st);
+-extern int dolhello(VOID);
++extern VOID dolhello(VOID);
+ extern int dspram(VOID);
+ extern int lckerror(char *errstr);
+-extern int lckhello(VOID);
++extern VOID lckhello(VOID);
+ extern int xlock(char *fname);
+ extern int lockchk(char *fname);
+ extern int lockrel(VOID);
+@@ -169,7 +170,7 @@ extern int PASCAL NEAR forwhunt(int f, i
+ extern int PASCAL NEAR forwsearch(int f, int n);
+ extern int PASCAL NEAR getcwnum(VOID);
+ extern int PASCAL NEAR getgoal(LINE *dlp);
+-extern int PASCAL NEAR getstring(unsigned char *buf, int nbuf, int eolchar);
++extern int PASCAL NEAR getstring(char *buf, int nbuf, int eolchar);
+ extern int PASCAL NEAR gettwnum(VOID);
+ extern int PASCAL NEAR gettyp(char *token);
+ extern int PASCAL NEAR getkey(VOID);
+@@ -186,7 +187,7 @@ extern int PASCAL NEAR isearch(int dir);
+ extern int PASCAL NEAR is_upper(char ch);
+ extern int PASCAL NEAR kinsert(int back, char c);
+ extern int PASCAL NEAR ldelnewline(VOID);
+-extern int PASCAL NEAR linstr(char *instr);
++extern int PASCAL NEAR linstr(CONST char *instr);
+ extern int PASCAL NEAR liteq(LINE **curline, int *curpos, int direct, char *lstring);
+ extern int PASCAL NEAR litmake(char **ppatptr, MC *mcptr);
+ extern int PASCAL NEAR lnewline(VOID);
+@@ -230,7 +231,7 @@ extern int PASCAL NEAR stopforw(VOID);
+ extern int PASCAL NEAR svar(VDESC *var, char *value);
+ extern int PASCAL NEAR tgetc(VOID);
+ extern int PASCAL NEAR uneat(VOID);
+-extern int PASCAL NEAR unlist_screen(SCREEN *sp);
++extern VOID PASCAL NEAR unlist_screen(SCREEN *sp);
+ extern int PASCAL NEAR upscreen(int f, int n);
+ extern int PASCAL NEAR vtinit(VOID);
+ extern int PASCAL NEAR yank(int f, int n);
+@@ -242,7 +243,7 @@ extern KEYTAB *getbind(int c);
+ extern LINE *PASCAL NEAR lalloc(int used);
+ extern LINE *PASCAL NEAR mouseline(EWINDOW *wp, int row);
+ extern long PASCAL NEAR getlinenum(BUFFER *bp, LINE *sline);
+-extern int PASCAL NEAR addkey(unsigned char * seq, int fn);
++extern int PASCAL NEAR addkey(char * seq, int fn);
+ extern int PASCAL NEAR addkeymap(int f, int n);
+ extern int PASCAL NEAR adjustmode(int kind, int global);
+ extern int PASCAL NEAR anycb(VOID);
+@@ -284,7 +285,7 @@ extern int PASCAL NEAR desvars(int f, in
+ extern int PASCAL NEAR detab(int f, int n);
+ extern int PASCAL NEAR dobuf(BUFFER *bp);
+ extern int PASCAL NEAR docmd(char *cline);
+-extern int PASCAL NEAR dofile(char *fname);
++extern int PASCAL NEAR dofile(CONST char *fname);
+ extern int PASCAL NEAR ectoc(int c);
+ extern VOID PASCAL NEAR edinit(char bname[]);
+ extern int PASCAL NEAR editloop(VOID);
+@@ -300,8 +301,8 @@ extern int PASCAL NEAR execute(int c, in
+ extern int PASCAL NEAR ffclose(VOID);
+ extern int PASCAL NEAR ffgetline(int *nbytes);
+ extern int PASCAL NEAR ffputline(char buf[], int nbuf);
+-extern int PASCAL NEAR ffropen(char *fn);
+-extern int PASCAL NEAR ffwopen(char *fn, char *mode);
++extern int PASCAL NEAR ffropen(CONST char *fn);
++extern int PASCAL NEAR ffwopen(CONST char *fn, CONST char *mode);
+ extern int PASCAL NEAR fileapp(int f, int n);
+ extern int PASCAL NEAR find_screen(int f, int n);
+ extern int PASCAL NEAR filefind(int f, int n);
+@@ -321,7 +322,7 @@ extern int PASCAL NEAR forwword(int f, i
+ extern int PASCAL NEAR getccol(int bflg);
+ extern int PASCAL NEAR getcmd(VOID);
+ extern int PASCAL NEAR getfence(int f, int n);
+-extern int PASCAL NEAR getfile(char fname[], int lockfl);
++extern int PASCAL NEAR getfile(CONST char fname[], int lockfl);
+ extern int PASCAL NEAR get_key(VOID);
+ extern int PASCAL NEAR getregion(REGION *rp);
+ extern int PASCAL NEAR gotobob(int f, int n);
+@@ -332,6 +333,8 @@ extern int PASCAL NEAR gotoeol(int f, in
+ extern int PASCAL NEAR gotoeop(int f, int n);
+ extern int PASCAL NEAR gotoline(int f, int n);
+ extern int PASCAL NEAR gotomark(int f, int n);
++extern unsigned char PASCAL NEAR grabwait(void);
++extern unsigned char PASCAL NEAR grabnowait(void);
+ extern int PASCAL NEAR help(int f, int n);
+ extern int PASCAL NEAR ifile(char fname[]);
+ extern int PASCAL NEAR indent(int f, int n);
+@@ -348,9 +351,9 @@ extern int PASCAL NEAR killbuffer(int f,
+ extern int PASCAL NEAR killpara(int f, int n);
+ extern int PASCAL NEAR killregion(int f, int n);
+ extern int PASCAL NEAR killtext(int f, int n);
+-extern int PASCAL NEAR lchange(register int flag);
++extern VOID PASCAL NEAR lchange(register int flag);
+ extern int PASCAL NEAR ldelete(long n, int kflag);
+-extern int PASCAL NEAR lfree(LINE *lp);
++extern VOID PASCAL NEAR lfree(LINE *lp);
+ extern int PASCAL NEAR linsert(int n, char c);
+ extern int PASCAL NEAR listbuffers(int f, int n);
+ extern int PASCAL NEAR list_screens(int f, int n);
+@@ -362,7 +365,7 @@ extern int PASCAL NEAR macrotokey(int f,
+ extern int PASCAL NEAR makelist(int iflag);
+ extern int PASCAL NEAR movelocalpoint();
+ extern int PASCAL NEAR undolist();
+-extern int PASCAL NEAR mouse_screen(VOID);
++extern VOID PASCAL NEAR mouse_screen(VOID);
+ extern int PASCAL NEAR screenlist(int iflag);
+ extern int PASCAL NEAR meexit(int status);
+ extern int PASCAL NEAR meta(int f, int n);
+@@ -392,8 +395,8 @@ extern int PASCAL NEAR nextwind(int f, i
+ extern int PASCAL NEAR nullproc(int f, int n);
+ extern int PASCAL NEAR onlywind(int f, int n);
+ extern int PASCAL NEAR openline(int f, int n);
+-extern int PASCAL NEAR ostring(char *s);
+-extern int PASCAL NEAR outstring(char *s);
++extern VOID PASCAL NEAR ostring(char *s);
++extern VOID PASCAL NEAR outstring(char *s);
+ extern int PASCAL NEAR ovstring(int f, int n);
+ extern int PASCAL NEAR pipecmd(int f, int n);
+ extern int PASCAL NEAR popbuffer(int f, int n);
+@@ -404,7 +407,7 @@ extern int PASCAL NEAR quickexit(int f,
+ extern int PASCAL NEAR quit(int f, int n);
+ extern int PASCAL NEAR quote(int f, int n);
+ extern int PASCAL NEAR rdonly(VOID);
+-extern int PASCAL NEAR readin(char fname[], int lockfl);
++extern int PASCAL NEAR readin(const char fname[], int lockfl);
+ extern int PASCAL NEAR refresh(int f, int n);
+ extern int PASCAL NEAR remmark(int f, int n);
+ extern int PASCAL NEAR reposition(int f, int n);
+@@ -422,7 +425,7 @@ extern int PASCAL NEAR setfillcol(int f,
+ extern int PASCAL NEAR setgmode(int f, int n);
+ extern int PASCAL NEAR setmark(int f, int n);
+ extern int PASCAL NEAR setmod(int f, int n);
+-extern int PASCAL NEAR setwlist(char *wclist);
++extern VOID PASCAL NEAR setwlist(char *wclist);
+ extern int PASCAL NEAR shellprog(char *cmd);
+ extern int PASCAL NEAR showcpos(int f, int n);
+ extern int PASCAL NEAR showfiles(int f, int n);
+@@ -455,10 +458,10 @@ extern int PASCAL NEAR upperregion(int f
+ extern int PASCAL NEAR upperword(int f, int n);
+ extern int PASCAL NEAR usebuffer(int f, int n);
+ extern int PASCAL NEAR viewfile(int f, int n);
+-extern int PASCAL NEAR vteeol(VOID);
+-extern int PASCAL NEAR vtmove(int row, int col);
+-extern int PASCAL NEAR vtputc(int c);
+-extern int PASCAL NEAR vttidy(VOID);
++extern VOID PASCAL NEAR vteeol(VOID);
++extern VOID PASCAL NEAR vtmove(int row, int col);
++extern VOID PASCAL NEAR vtputc(int c);
++extern VOID PASCAL NEAR vttidy(VOID);
+ extern int PASCAL NEAR widen(int f, int n);
+ extern int PASCAL NEAR wordcount(int f, int n);
+ extern int PASCAL NEAR wrapword(int f, int n);
+@@ -467,7 +470,7 @@ extern int PASCAL NEAR writeout(char *fn
+ extern int PASCAL NEAR zotbuf(BUFFER *bp);
+ extern unsigned int PASCAL NEAR chcase(register unsigned int ch);
+ extern unsigned int PASCAL NEAR getckey(int mflag);
+-extern unsigned int PASCAL NEAR stock(unsigned char *keyname);
++extern unsigned int PASCAL NEAR stock(char *keyname);
+ #if VARARG && VARG
+ #if GCC
+ extern VOID CDECL NEAR mlwrite(va_alist);
+@@ -552,7 +555,7 @@ extern int PASCAL NEAR backtagword(int f
+
+ char *strrev(char *);
+
+-#if WINNT || WINDOW_MSWIN || (MSDOS && IC) || GCC || VMS
++#if __STDC__ || WINNT || WINDOW_MSWIN || (MSDOS && IC) || GCC || VMS
+ #include <stdlib.h>
+ #include <string.h>
+ #else
+@@ -615,7 +618,7 @@ extern SCREEN *PASCAL NEAR index_screen(
+ extern int PASCAL NEAR screen_index();
+ extern int PASCAL NEAR insert_screen();
+ extern int PASCAL NEAR select_screen();
+-extern int PASCAL NEAR free_screen();
++extern VOID PASCAL NEAR free_screen();
+ extern char *allocate();
+ extern char *dolock();
+ extern char *getpath();
+@@ -659,10 +662,10 @@ extern int PASCAL NEAR upperc();
+ extern int (PASCAL NEAR *PASCAL NEAR fncmatch())();
+ extern int (PASCAL NEAR *PASCAL NEAR getname())();
+ extern int PASCAL NEAR asc_int();
+-extern int dolhello();
++extern VOID dolhello();
+ extern int dspram();
+ extern int lckerror();
+-extern int lckhello();
++extern VOID lckhello();
+ extern int xlock();
+ extern int lockchk();
+ extern int lockrel();
+@@ -764,7 +767,7 @@ extern int PASCAL NEAR stopforw();
+ extern int PASCAL NEAR svar();
+ extern int PASCAL NEAR tgetc();
+ extern int PASCAL NEAR uneat();
+-extern int PASCAL NEAR unlist_screen();
++extern VOID PASCAL NEAR unlist_screen();
+ extern int PASCAL NEAR upscreen();
+ extern int PASCAL NEAR vtinit();
+ extern int PASCAL NEAR yank();
+@@ -893,7 +896,7 @@ extern int PASCAL NEAR macarg();
+ extern int PASCAL NEAR macrotokey();
+ extern int PASCAL NEAR makelist();
+ extern int PASCAL NEAR undolist();
+-extern int PASCAL NEAR mouse_screen();
++extern VOID PASCAL NEAR mouse_screen();
+ extern int PASCAL NEAR screenlist();
+ extern int PASCAL NEAR meexit();
+ extern int PASCAL NEAR meta();
+@@ -1070,17 +1073,6 @@ extern int PASCAL NEAR backtagword(); /*
+
+ /* some library redefinitions */
+
+-char *getenv();
+-char *strcat();
+-char *strcpy();
+ char *strrev();
+-#if XVT == 0 || XVTDRIVER == 0
+-int strlen();
+-#if RAMSIZE == 0
+-char *malloc();
+-VOID free();
+-#endif
+-char *realloc();
+-#endif
+
+ #endif
diff --git a/editors/uemacs/patches/patch-h_evar_h b/editors/uemacs/patches/patch-h_evar_h
new file mode 100644
index 00000000000..e5fa5e1de2c
--- /dev/null
+++ b/editors/uemacs/patches/patch-h_evar_h
@@ -0,0 +1,113 @@
+$NetBSD: patch-h_evar_h,v 1.1 2012/05/10 20:53:30 dholland Exp $
+
+- use correct initializers
+
+--- h/evar.h~ 2012-05-10 19:25:36.000000000 +0000
++++ h/evar.h
+@@ -213,56 +213,56 @@ typedef struct UFUNC {
+ #define TRINAMIC 3
+
+ NOSHARE UFUNC funcs[] = {
+- "abbrev", MONAMIC, /* look up abbreviation */
+- "abs", MONAMIC, /* absolute value of a number */
+- "add", DYNAMIC, /* add two numbers together */
+- "and", DYNAMIC, /* logical and */
+- "ascii", MONAMIC, /* char to integer conversion */
+- "band", DYNAMIC, /* bitwise and 9-10-87 jwm */
+- "bind", MONAMIC, /* loopup what function name is bound to a key */
+- "bnot", MONAMIC, /* bitwise not */
+- "bor", DYNAMIC, /* bitwise or 9-10-87 jwm */
+- "bxor", DYNAMIC, /* bitwise xor 9-10-87 jwm */
+- "call", MONAMIC, /* call a procedure */
+- "cat", DYNAMIC, /* concatenate string */
+- "chr", MONAMIC, /* integer to char conversion */
+- "divide", DYNAMIC, /* division */
+- "env", MONAMIC, /* retrieve a system environment var */
+- "equal", DYNAMIC, /* logical equality check */
+- "exist", MONAMIC, /* check if a file exists */
+- "find", MONAMIC, /* look for a file on the path... */
+- "greater", DYNAMIC, /* logical greater than */
+- "group", MONAMIC, /* return group match in MAGIC mode */
+- "gtc", NILNAMIC, /* get 1 emacs command */
+- "gtk", NILNAMIC, /* get 1 charater */
+- "indirect", MONAMIC, /* evaluate indirect value */
+- "isnum", MONAMIC, /* is the arg a number? */
+- "left", DYNAMIC, /* left string(string, len) */
+- "length", MONAMIC, /* string length */
+- "less", DYNAMIC, /* logical less than */
+- "lower", MONAMIC, /* lower case string */
+- "mid", TRINAMIC, /* mid string(string, pos, len) */
+- "mkcol", MONAMIC, /* column position of a mark */
+- "mkline", MONAMIC, /* line number of a mark */
+- "modulo", DYNAMIC, /* mod */
+- "negate", MONAMIC, /* negate */
+- "not", MONAMIC, /* logical not */
+- "or", DYNAMIC, /* logical or */
+- "reverse", MONAMIC, /* reverse */
+- "right", DYNAMIC, /* right string(string, pos) */
+- "rnd", MONAMIC, /* get a random number */
+- "sequal", DYNAMIC, /* string logical equality check */
+- "sgreater", DYNAMIC, /* string logical greater than */
+- "sindex", DYNAMIC, /* find the index of one string in another */
+- "sless", DYNAMIC, /* string logical less than */
+- "slower", DYNAMIC, /* set lower to upper char translation */
+- "subtract", DYNAMIC, /* subtraction */
+- "supper", DYNAMIC, /* set upper to lower char translation */
+- "times", DYNAMIC, /* multiplication */
+- "trim", MONAMIC, /* trim whitespace off the end of a string */
+- "true", MONAMIC, /* Truth of the universe logical test */
+- "upper", MONAMIC, /* uppercase string */
+- "xlate", TRINAMIC /* XLATE character string translation */
++ { "abbrev", MONAMIC }, /* look up abbreviation */
++ { "abs", MONAMIC }, /* absolute value of a number */
++ { "add", DYNAMIC }, /* add two numbers together */
++ { "and", DYNAMIC }, /* logical and */
++ { "ascii", MONAMIC }, /* char to integer conversion */
++ { "band", DYNAMIC }, /* bitwise and 9-10-87 jwm */
++ { "bind", MONAMIC }, /* loopup what function name is bound to a key */
++ { "bnot", MONAMIC }, /* bitwise not */
++ { "bor", DYNAMIC }, /* bitwise or 9-10-87 jwm */
++ { "bxor", DYNAMIC }, /* bitwise xor 9-10-87 jwm */
++ { "call", MONAMIC }, /* call a procedure */
++ { "cat", DYNAMIC }, /* concatenate string */
++ { "chr", MONAMIC }, /* integer to char conversion */
++ { "divide", DYNAMIC }, /* division */
++ { "env", MONAMIC }, /* retrieve a system environment var */
++ { "equal", DYNAMIC }, /* logical equality check */
++ { "exist", MONAMIC }, /* check if a file exists */
++ { "find", MONAMIC }, /* look for a file on the path... */
++ { "greater", DYNAMIC }, /* logical greater than */
++ { "group", MONAMIC }, /* return group match in MAGIC mode */
++ { "gtc", NILNAMIC }, /* get 1 emacs command */
++ { "gtk", NILNAMIC }, /* get 1 charater */
++ { "indirect", MONAMIC },/* evaluate indirect value */
++ { "isnum", MONAMIC }, /* is the arg a number? */
++ { "left", DYNAMIC }, /* left string(string, len) */
++ { "length", MONAMIC }, /* string length */
++ { "less", DYNAMIC }, /* logical less than */
++ { "lower", MONAMIC }, /* lower case string */
++ { "mid", TRINAMIC }, /* mid string(string, pos, len) */
++ { "mkcol", MONAMIC }, /* column position of a mark */
++ { "mkline", MONAMIC }, /* line number of a mark */
++ { "modulo", DYNAMIC }, /* mod */
++ { "negate", MONAMIC }, /* negate */
++ { "not", MONAMIC }, /* logical not */
++ { "or", DYNAMIC }, /* logical or */
++ { "reverse", MONAMIC }, /* reverse */
++ { "right", DYNAMIC }, /* right string(string, pos) */
++ { "rnd", MONAMIC }, /* get a random number */
++ { "sequal", DYNAMIC }, /* string logical equality check */
++ { "sgreater", DYNAMIC },/* string logical greater than */
++ { "sindex", DYNAMIC }, /* find the index of one string in another */
++ { "sless", DYNAMIC }, /* string logical less than */
++ { "slower", DYNAMIC }, /* set lower to upper char translation */
++ { "subtract", DYNAMIC },/* subtraction */
++ { "supper", DYNAMIC }, /* set upper to lower char translation */
++ { "times", DYNAMIC }, /* multiplication */
++ { "trim", MONAMIC }, /* trim whitespace off the end of a string */
++ { "true", MONAMIC }, /* Truth of the universe logical test */
++ { "upper", MONAMIC }, /* uppercase string */
++ { "xlate", TRINAMIC }, /* XLATE character string translation */
+ };
+
+ #define NFUNCS sizeof(funcs) / sizeof(UFUNC)
diff --git a/editors/uemacs/patches/patch-src_abbrev_c b/editors/uemacs/patches/patch-src_abbrev_c
new file mode 100644
index 00000000000..2308a17ffde
--- /dev/null
+++ b/editors/uemacs/patches/patch-src_abbrev_c
@@ -0,0 +1,24 @@
+$NetBSD: patch-src_abbrev_c,v 1.1 2012/05/10 20:53:30 dholland Exp $
+
+- don't use implicit int
+- return values from non-void functions
+
+--- src/abbrev.c.orig 1995-05-31 17:49:36.000000000 +0000
++++ src/abbrev.c
+@@ -224,7 +224,7 @@ int f,n; /* prefix flag and argument */
+ {
+ register BUFFER *bp; /* ptr to buffer to dump */
+ register LINE *lp; /* ptr to current line in our buffer */
+- register llength; /* length of the current line being examined */
++ register int llength; /* length of the current line being examined */
+ char cur_sym[MAXSYM+1]; /* current symbol being defined */
+ char cur_exp[NSTRING]; /* current expansion */
+
+@@ -264,6 +264,7 @@ int f,n; /* prefix flag and argument */
+ /* on to the next pair */
+ lp = lforw(lp);
+ }
++ return TRUE;
+ }
+
+ VOID PASCAL NEAR ab_init()
diff --git a/editors/uemacs/patches/patch-src_basic_c b/editors/uemacs/patches/patch-src_basic_c
new file mode 100644
index 00000000000..5637076c8f0
--- /dev/null
+++ b/editors/uemacs/patches/patch-src_basic_c
@@ -0,0 +1,159 @@
+$NetBSD: patch-src_basic_c,v 1.1 2012/05/10 20:53:30 dholland Exp $
+
+- don't use implicit int
+
+--- src/basic.c~ 2012-05-10 18:57:11.000000000 +0000
++++ src/basic.c
+@@ -19,7 +19,7 @@
+ * beginning of the current line.
+ * Trivial.
+ */
+-PASCAL NEAR gotobol(f, n)
++int PASCAL NEAR gotobol(f, n)
+
+ int f,n; /* argument flag and num */
+
+@@ -34,7 +34,7 @@ int f,n; /* argument flag and num */
+ * location. Error if you try and move out of the buffer. Set the flag if the
+ * line pointer for dot changes.
+ */
+-PASCAL NEAR backchar(f, n)
++int PASCAL NEAR backchar(f, n)
+
+ int f,n; /* prefix flag and argument */
+
+@@ -63,7 +63,7 @@ int f,n; /* prefix flag and argument */
+ /*
+ * Move the cursor to the end of the current line. Trivial. No errors.
+ */
+-PASCAL NEAR gotoeol(f, n)
++int PASCAL NEAR gotoeol(f, n)
+
+ int f,n; /* argument flag and num */
+
+@@ -78,7 +78,7 @@ int f,n; /* argument flag and num */
+ * location, and move ".". Error if you try and move off the end of the
+ * buffer. Set the flag if the line pointer for dot changes.
+ */
+-PASCAL NEAR forwchar(f, n)
++int PASCAL NEAR forwchar(f, n)
+
+ int f,n; /* prefix flag and argument */
+
+@@ -102,7 +102,7 @@ int f,n; /* prefix flag and argument */
+ #endif
+ }
+
+-PASCAL NEAR gotoline(f, n) /* move to a particular line.
++int PASCAL NEAR gotoline(f, n) /* move to a particular line.
+ argument (n) must be a positive integer for
+ this to actually do anything */
+
+@@ -137,7 +137,7 @@ int f,n; /* prefix flag and argument */
+ * considered to be hard motion; it really isn't if the original value of dot
+ * is the same as the new value of dot. Normally bound to "M-<".
+ */
+-PASCAL NEAR gotobob(f, n)
++int PASCAL NEAR gotobob(f, n)
+
+ int f,n; /* argument flag and num */
+
+@@ -153,7 +153,7 @@ int f,n; /* argument flag and num */
+ * (ZJ). The standard screen code does most of the hard parts of update.
+ * Bound to "M->".
+ */
+-PASCAL NEAR gotoeob(f, n)
++int PASCAL NEAR gotoeob(f, n)
+
+ int f,n; /* argument flag and num */
+
+@@ -170,7 +170,7 @@ int f,n; /* argument flag and num */
+ * controls how the goal column is set. Bound to "C-N". No errors are
+ * possible.
+ */
+-PASCAL NEAR forwline(f, n)
++int PASCAL NEAR forwline(f, n)
+
+ int f,n; /* argument flag and num */
+
+@@ -214,7 +214,7 @@ int f,n; /* argument flag and num */
+ * alternate. Figure out the new line and call "movedot" to perform the
+ * motion. No errors are possible. Bound to "C-P".
+ */
+-PASCAL NEAR backline(f, n)
++int PASCAL NEAR backline(f, n)
+
+ int f,n; /* argument flag and num */
+
+@@ -253,7 +253,7 @@ int f,n; /* argument flag and num */
+ #endif
+ }
+
+-PASCAL NEAR gotobop(f, n) /* go back to the beginning of the current paragraph
++int PASCAL NEAR gotobop(f, n) /* go back to the beginning of the current paragraph
+ here we look for a blank line or a character from
+ $paralead to delimit the beginning of a paragraph or
+ $fmtlead to delimit a line before the paragraph */
+@@ -319,7 +319,7 @@ int f, n; /* default Flag & Numeric argu
+ return(TRUE);
+ }
+
+-PASCAL NEAR gotoeop(f, n) /* go forword to the end of the current paragraph
++int PASCAL NEAR gotoeop(f, n) /* go forword to the end of the current paragraph
+ looking for a member of $paralead or $fmtlead
+ or a blank line to delimit the start of the
+ next paragraph
+@@ -433,7 +433,7 @@ register LINE *dlp;
+ * is overlap between screens. This defaults to overlap value in ITS EMACS.
+ * Because this zaps the top line in the window, we have to do a hard update.
+ */
+-PASCAL NEAR forwpage(f, n)
++int PASCAL NEAR forwpage(f, n)
+
+ int f,n; /* prefix flag and argument */
+
+@@ -466,7 +466,7 @@ int f,n; /* prefix flag and argument */
+ * EMACS manual. Bound to "M-V". We do a hard update for exactly the same
+ * reason.
+ */
+-PASCAL NEAR backpage(f, n)
++int PASCAL NEAR backpage(f, n)
+
+ register int f;
+ register int n;
+@@ -498,7 +498,7 @@ register int n;
+ * Set the mark in the current window to the value of "." in the window. No
+ * errors are possible. Bound to "M-.".
+ */
+-PASCAL NEAR setmark(f, n)
++int PASCAL NEAR setmark(f, n)
+
+ int f,n; /* argument flag and num */
+
+@@ -519,7 +519,7 @@ int f,n; /* argument flag and num */
+ * Remove the mark in the current window.
+ * Bound to ^X <space>
+ */
+-PASCAL NEAR remmark(f, n)
++int PASCAL NEAR remmark(f, n)
+
+ int f,n; /* argument flag and num */
+
+@@ -542,7 +542,7 @@ int f,n; /* argument flag and num */
+ * that moves the mark about. The only possible error is "no mark". Bound to
+ * "C-X C-X".
+ */
+-PASCAL NEAR swapmark(f, n)
++int PASCAL NEAR swapmark(f, n)
+
+ int f,n; /* argument flag and num */
+
+@@ -575,7 +575,7 @@ int f,n; /* argument flag and num */
+ * the hard work gets done by the standard routine that moves the mark
+ * about. The only possible error is "no mark". Bound to "M-^G".
+ */
+-PASCAL NEAR gotomark(f, n)
++int PASCAL NEAR gotomark(f, n)
+
+ int f, n; /* default and numeric args */
+
diff --git a/editors/uemacs/patches/patch-src_buffer_c b/editors/uemacs/patches/patch-src_buffer_c
new file mode 100644
index 00000000000..813e72a816a
--- /dev/null
+++ b/editors/uemacs/patches/patch-src_buffer_c
@@ -0,0 +1,114 @@
+$NetBSD: patch-src_buffer_c,v 1.1 2012/05/10 20:53:30 dholland Exp $
+
+- don't use implicit int
+
+--- src/buffer.c~ 2012-05-10 19:12:43.000000000 +0000
++++ src/buffer.c
+@@ -19,7 +19,7 @@
+ * if the use count is 0. Otherwise, they come
+ * from some other window.
+ */
+-PASCAL NEAR usebuffer(f, n)
++int PASCAL NEAR usebuffer(f, n)
+
+ int f,n; /* prefix flag and argument */
+
+@@ -41,7 +41,7 @@ int f,n; /* prefix flag and argument */
+ return(swbuffer(bp));
+ }
+
+-PASCAL NEAR nextbuffer(f, n) /* switch to the next buffer in the buffer list */
++int PASCAL NEAR nextbuffer(f, n) /* switch to the next buffer in the buffer list */
+
+ int f, n; /* default flag, numeric argument */
+ {
+@@ -66,7 +66,7 @@ int f, n; /* default flag, numeric argum
+ return(status);
+ }
+
+-PASCAL NEAR swbuffer(bp) /* make buffer BP current */
++int PASCAL NEAR swbuffer(bp) /* make buffer BP current */
+
+ BUFFER *bp;
+
+@@ -151,7 +151,7 @@ BUFFER *bp;
+ * if the buffer has been changed). Then free the header
+ * line and the buffer header. Bound to "C-X K".
+ */
+-PASCAL NEAR killbuffer(f, n)
++int PASCAL NEAR killbuffer(f, n)
+
+ int f,n; /* prefix flag and argument */
+
+@@ -170,7 +170,7 @@ int f,n; /* prefix flag and argument */
+
+ /* Allow the user to pop up a buffer, like we do.... */
+
+-PASCAL NEAR popbuffer(f, n)
++int PASCAL NEAR popbuffer(f, n)
+
+ int f, n; /* default and numeric arguments */
+
+@@ -215,7 +215,7 @@ BUFFER *PASCAL NEAR getdefb() /* get the
+ return(bp);
+ }
+
+-PASCAL NEAR zotbuf(bp) /* kill the buffer pointed to by bp */
++int PASCAL NEAR zotbuf(bp) /* kill the buffer pointed to by bp */
+
+ register BUFFER *bp;
+
+@@ -271,7 +271,7 @@ register BUFFER *bp;
+ return(TRUE);
+ }
+
+-PASCAL NEAR namebuffer(f,n) /* Rename the current buffer */
++int PASCAL NEAR namebuffer(f,n) /* Rename the current buffer */
+
+ int f, n; /* default Flag & Numeric arg */
+
+@@ -306,7 +306,7 @@ ask: if (mlreply(TEXT29, bufn, NBUFN) !=
+ invisible buffers as well.
+ */
+
+-PASCAL NEAR listbuffers(f, n)
++int PASCAL NEAR listbuffers(f, n)
+
+ int f,n; /* prefix flag and argument */
+
+@@ -327,7 +327,7 @@ int f,n; /* prefix flag and argument */
+ * is an error (if there is no memory). Iflag
+ * indicates whether to list hidden buffers.
+ */
+-PASCAL NEAR makelist(iflag)
++int PASCAL NEAR makelist(iflag)
+
+ int iflag; /* list hidden buffer flag */
+
+@@ -488,7 +488,7 @@ long num;
+ * Return FALSE if no buffers
+ * have been changed.
+ */
+-PASCAL NEAR anycb()
++int PASCAL NEAR anycb()
+ {
+ register BUFFER *bp;
+
+@@ -598,7 +598,7 @@ int bflag; /* bit settings for a new bu
+ * that are required. Return TRUE if everything
+ * looks good.
+ */
+-PASCAL NEAR bclear(bp)
++int PASCAL NEAR bclear(bp)
+ register BUFFER *bp;
+ {
+ register LINE *lp;
+@@ -624,7 +624,7 @@ register BUFFER *bp;
+ return(TRUE);
+ }
+
+-PASCAL NEAR unmark(f, n) /* unmark the current buffers change flag */
++int PASCAL NEAR unmark(f, n) /* unmark the current buffers change flag */
+
+ int f, n; /* unused command arguments */
+
diff --git a/editors/uemacs/patches/patch-src_crypt_c b/editors/uemacs/patches/patch-src_crypt_c
new file mode 100644
index 00000000000..7aae245e6ab
--- /dev/null
+++ b/editors/uemacs/patches/patch-src_crypt_c
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_crypt_c,v 1.1 2012/05/10 20:53:30 dholland Exp $
+
+- don't use implicit int
+
+--- src/crypt.c~ 2012-05-10 19:12:43.000000000 +0000
++++ src/crypt.c
+@@ -16,7 +16,7 @@ static int PASCAL NEAR mod95(int);
+ static int PASCAL NEAR mod95();
+ #endif
+
+-PASCAL NEAR setekey(f, n) /* reset encryption key of current buffer */
++int PASCAL NEAR setekey(f, n) /* reset encryption key of current buffer */
+
+ int f; /* default flag */
+ int n; /* numeric argument */
diff --git a/editors/uemacs/patches/patch-src_display_c b/editors/uemacs/patches/patch-src_display_c
new file mode 100644
index 00000000000..17b8f9e2bf7
--- /dev/null
+++ b/editors/uemacs/patches/patch-src_display_c
@@ -0,0 +1,78 @@
+$NetBSD: patch-src_display_c,v 1.1 2012/05/10 20:53:30 dholland Exp $
+
+- don't use implicit int
+- fix braces warning from gcc
+- fix false initialization warning seen with gcc 4.1
+
+--- src/display.c~ 2012-05-10 19:12:43.000000000 +0000
++++ src/display.c
+@@ -250,7 +250,7 @@ int PASCAL NEAR vtsizescr(SCREEN *sp, in
+ * system prompt will be written in the line). Shut down the channel to the
+ * terminal.
+ */
+-PASCAL NEAR vttidy()
++VOID PASCAL NEAR vttidy()
+ {
+ mlerase();
+ movecursor(term.t_nrow, 0);
+@@ -264,7 +264,7 @@ PASCAL NEAR vttidy()
+ * screen. There is no checking for nonsense values; this might be a good
+ * idea during the early stages.
+ */
+-PASCAL NEAR vtmove(row, col)
++VOID PASCAL NEAR vtmove(row, col)
+
+ int row, col;
+
+@@ -280,7 +280,7 @@ int row, col;
+ terminal buffers. Only column overflow is checked.
+ */
+
+-PASCAL NEAR vtputc(c)
++VOID PASCAL NEAR vtputc(c)
+
+ int c;
+
+@@ -338,7 +338,7 @@ int c;
+ * Erase from the end of the software cursor to the end of the line on which
+ * the software cursor is located.
+ */
+-PASCAL NEAR vteeol()
++VOID PASCAL NEAR vteeol()
+ {
+ register VIDEO *vp;
+
+@@ -480,11 +480,12 @@ int force; /* force update past type ahe
+ upddex();
+
+ /* if screen is garbage, re-plot it */
+- if (sgarbf != FALSE)
++ if (sgarbf != FALSE) {
+ if (gflags & GFSDRAW)
+ sgarbf = FALSE;
+ else
+ updgar();
++ }
+
+ /* update the virtual screen to the physical screen */
+ updupd(force);
+@@ -633,6 +634,10 @@ VOID PASCAL NEAR update_hilite()
+ if (hilite > NMARKS)
+ return;
+
++ /* required by gcc 4.1 */
++ first_line = -1;
++ last_line = -1;
++
+ /* Both marks must be set to define a highlighted region */
+ first_mark = curwp->w_markp[hilite];
+ last_mark = curwp->w_markp[hilite+1];
+@@ -2162,7 +2167,7 @@ int s; /* scaled integer to output */
+ }
+
+ #if HANDLE_WINCH
+-winch_vtresize(rows, cols)
++VOID winch_vtresize(rows, cols)
+ int rows, cols;
+ {
+ int i;
diff --git a/editors/uemacs/patches/patch-src_dolock_c b/editors/uemacs/patches/patch-src_dolock_c
new file mode 100644
index 00000000000..8842006ae65
--- /dev/null
+++ b/editors/uemacs/patches/patch-src_dolock_c
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_dolock_c,v 1.1 2012/05/10 20:53:30 dholland Exp $
+
+- declare void functions void
+
+--- src/dolock.c~ 2012-05-10 19:12:43.000000000 +0000
++++ src/dolock.c
+@@ -455,7 +455,7 @@ char *filespec; /* filespec to unlock *
+ }
+
+ #else
+-dolhello()
++VOID dolhello()
+ {
+ }
+ #endif
diff --git a/editors/uemacs/patches/patch-src_eval_c b/editors/uemacs/patches/patch-src_eval_c
new file mode 100644
index 00000000000..556bc7da92f
--- /dev/null
+++ b/editors/uemacs/patches/patch-src_eval_c
@@ -0,0 +1,125 @@
+$NetBSD: patch-src_eval_c,v 1.1 2012/05/10 20:53:30 dholland Exp $
+
+- don't use implicit int
+- const correctness required by existing const declarations
+- return NULL on some unreachable paths
+- fix uninitialized variable bug caught by gcc
+- silence gcc 4.1 parenthesis warning
+
+--- src/eval.c~ 2012-05-10 19:25:36.000000000 +0000
++++ src/eval.c
+@@ -68,7 +68,7 @@ UTABLE *ut; /* table to clear */
+ free(ut);
+ }
+
+-char *PASCAL NEAR gtfun(fname) /* evaluate a function */
++CONST char *PASCAL NEAR gtfun(fname) /* evaluate a function */
+
+ char *fname; /* name of function to evaluate */
+
+@@ -237,9 +237,10 @@ char *fname; /* name of function to eva
+ }
+
+ meexit(-11); /* never should get here */
++ return NULL;
+ }
+
+-char *PASCAL NEAR gtusr(vname) /* look up a user var's value */
++CONST char *PASCAL NEAR gtusr(vname) /* look up a user var's value */
+
+ char *vname; /* name of user variable to fetch */
+
+@@ -299,7 +300,7 @@ int i;
+ return(envars[i]);
+ }
+
+-PASCAL NEAR binary(key, tval, tlength, klength)
++int PASCAL NEAR binary(key, tval, tlength, klength)
+
+ char *key; /* key string to look for */
+ char *(PASCAL NEAR *tval)(); /* ptr to function to fetch table value with */
+@@ -331,7 +332,7 @@ int klength; /* maximum length of strin
+ return(-1);
+ }
+
+-char *PASCAL NEAR gtenv(vname)
++CONST char *PASCAL NEAR gtenv(vname)
+
+ char *vname; /* name of environment variable to retrieve */
+
+@@ -451,11 +452,12 @@ char *vname; /* name of environment var
+ case EVYPOS: return(int_asc(ypos));
+ }
+ meexit(-12); /* again, we should never get here */
++ return NULL;
+ }
+
+-char *PASCAL NEAR fixnull(s) /* Don't return NULL pointers! */
++CONST char *PASCAL NEAR fixnull(s) /* Don't return NULL pointers! */
+
+-char *s;
++CONST char *s;
+
+ {
+ if (s == NULL)
+@@ -753,6 +755,7 @@ int scope; /* intended scope of any crea
+
+ fvar: vtype = -1;
+ vut = uv_head;
++ vnum = -1;
+
+ switch (var[0]) {
+
+@@ -1245,7 +1248,7 @@ char *token; /* token to analyze */
+ }
+ }
+
+-char *PASCAL NEAR getval(token) /* find the value of a token */
++CONST char *PASCAL NEAR getval(token) /* find the value of a token */
+
+ char *token; /* token to evaluate */
+
+@@ -1316,6 +1319,7 @@ char *token; /* token to evaluate */
+ case TKSTR: return(token+1);
+ case TKCMD: return(token);
+ }
++ return NULL;
+ }
+
+ int PASCAL NEAR stol(val) /* convert a string to a numeric logical */
+@@ -1333,7 +1337,7 @@ char *val; /* value to check for stol */
+ return((asc_int(val) != 0));
+ }
+
+-char *PASCAL NEAR ltos(val) /* numeric logical to string logical */
++CONST char *PASCAL NEAR ltos(val) /* numeric logical to string logical */
+
+ int val; /* value to translate */
+
+@@ -1470,7 +1474,7 @@ xnext: ++sp;
+ /* setwlist: Set an alternative list of character to be
+ considered "in a word */
+
+-PASCAL NEAR setwlist(wclist)
++VOID PASCAL NEAR setwlist(wclist)
+
+ char *wclist; /* list of characters to consider "in a word" */
+
+@@ -1539,7 +1543,7 @@ char *st;
+
+ /* scan digits */
+ period_flag = FALSE;
+- while ((*st >= '0') && (*st <= '9') ||
++ while ((*st >= '0' && *st <= '9') ||
+ (*st == '.' && period_flag == FALSE)) {
+ if (*st == '.')
+ period_flag = TRUE;
+@@ -1605,7 +1609,7 @@ int n; /* numeric arg (can overide prom
+ of all the environment variables
+ */
+
+-PASCAL NEAR desvars(f, n)
++int PASCAL NEAR desvars(f, n)
+
+ int f,n; /* prefix flag and argument */
+
diff --git a/editors/uemacs/patches/patch-src_exec_c b/editors/uemacs/patches/patch-src_exec_c
new file mode 100644
index 00000000000..8f308949a22
--- /dev/null
+++ b/editors/uemacs/patches/patch-src_exec_c
@@ -0,0 +1,147 @@
+$NetBSD: patch-src_exec_c,v 1.1 2012/05/10 20:53:30 dholland Exp $
+
+- don't use implicit int
+- const correctness required by existing const declarations
+- fix uninitialized variable bug on error path, caught by gcc
+
+--- src/exec.c~ 2012-05-10 19:25:36.000000000 +0000
++++ src/exec.c
+@@ -11,7 +11,7 @@
+
+ /* namedcmd: execute a named command even if it is not bound */
+
+-PASCAL NEAR namedcmd(f, n)
++int PASCAL NEAR namedcmd(f, n)
+
+ int f, n; /* command arguments [passed through to command executed] */
+
+@@ -61,7 +61,7 @@ int f, n; /* command arguments [passed t
+ /* execcmd: Execute a command line command to be typed in
+ by the user */
+
+-PASCAL NEAR execcmd(f, n)
++int PASCAL NEAR execcmd(f, n)
+
+ int f, n; /* default Flag and Numeric argument */
+
+@@ -88,7 +88,7 @@ int f, n; /* default Flag and Numeric ar
+
+ */
+
+-PASCAL NEAR docmd(cline)
++int PASCAL NEAR docmd(cline)
+
+ char *cline; /* command line to execute */
+
+@@ -238,7 +238,7 @@ int size; /* maximum size of token */
+ return(src);
+ }
+
+-PASCAL NEAR macarg(tok) /* get a macro line argument */
++int PASCAL NEAR macarg(tok) /* get a macro line argument */
+
+ char *tok; /* buffer to place argument */
+
+@@ -255,7 +255,7 @@ char *tok; /* buffer to place argument *
+
+ /* nextarg: get the next argument */
+
+-PASCAL NEAR nextarg(prompt, buffer, size, terminator)
++int PASCAL NEAR nextarg(prompt, buffer, size, terminator)
+
+ char *prompt; /* prompt to use if we must be interactive */
+ char *buffer; /* buffer to put token into */
+@@ -263,7 +263,7 @@ int size; /* size of the buffer */
+ int terminator; /* terminating char to be used on interactive fetch */
+
+ {
+- register char *sp; /* return pointer from getval() */
++ register CONST char *sp; /* return pointer from getval() */
+
+ /* if we are interactive, go get it! */
+ if (clexec == FALSE) {
+@@ -290,7 +290,7 @@ int terminator; /* terminating char to
+ /* storeproc: Set up a procedure buffer and flag to store all
+ executed command lines there */
+
+-PASCAL NEAR storeproc(f, n)
++int PASCAL NEAR storeproc(f, n)
+
+ int f; /* default flag */
+ int n; /* macro number to use */
+@@ -361,7 +361,7 @@ int n; /* macro number to use */
+
+ /* execproc: Execute a procedure */
+
+-PASCAL NEAR execproc(f, n)
++int PASCAL NEAR execproc(f, n)
+
+ int f, n; /* default flag and numeric arg */
+
+@@ -395,7 +395,7 @@ int f, n; /* default flag and numeric ar
+
+ /* execbuf: Execute the contents of a buffer of commands */
+
+-PASCAL NEAR execbuf(f, n)
++int PASCAL NEAR execbuf(f, n)
+
+ int f, n; /* default flag and numeric arg */
+
+@@ -436,7 +436,7 @@ int f, n; /* default flag and numeric ar
+ *LBL01
+ */
+
+-PASCAL NEAR dobuf(bp)
++int PASCAL NEAR dobuf(bp)
+
+ BUFFER *bp; /* buffer to execute */
+
+@@ -468,6 +468,10 @@ BUFFER *bp; /* buffer to execute */
+ VDESC vd; /* variable num/type */
+ char value[NSTRING]; /* evaluated argument */
+
++ /* there's an error path where these are used but not set otherwise */
++ ut = NULL;
++ einit = NULL;
++
+ /* clear IF level flags/while ptr */
+ execlevel = 0;
+ whlist = NULL;
+@@ -971,7 +975,7 @@ LINE *lp; /* line " */
+ if $debug == TRUE, The interactive debugger is invoked
+ commands are listed out with the ? key */
+
+-PASCAL NEAR debug(bp, eline, skipflag)
++int PASCAL NEAR debug(bp, eline, skipflag)
+
+ BUFFER *bp; /* buffer to execute */
+ char *eline; /* text of line to debug */
+@@ -1110,14 +1114,14 @@ WHBLOCK *wp; /* head of structure to fre
+ }
+ }
+
+-PASCAL NEAR execfile(f, n) /* execute a series of commands in a file */
++int PASCAL NEAR execfile(f, n) /* execute a series of commands in a file */
+
+ int f, n; /* default flag and numeric arg to pass on to file */
+
+ {
+ register int status; /* return status of name query */
+ char fname[NSTRING]; /* name of file to execute */
+- char *fspec; /* full file spec */
++ CONST char *fspec; /* full file spec */
+
+ #if WINDOW_MSWIN
+ /* special case: we want filenamedlg to refrain from stuffing a
+@@ -1161,9 +1165,9 @@ exec1: /* otherwise, execute it */
+ /* dofile: yank a file into a buffer and execute it
+ if there are no errors, delete the buffer on exit */
+
+-PASCAL NEAR dofile(fname)
++int PASCAL NEAR dofile(fname)
+
+-char *fname; /* file name to execute */
++CONST char *fname; /* file name to execute */
+
+ {
+ register BUFFER *bp; /* buffer to place file to exeute */
diff --git a/editors/uemacs/patches/patch-src_file_c b/editors/uemacs/patches/patch-src_file_c
new file mode 100644
index 00000000000..56464500e73
--- /dev/null
+++ b/editors/uemacs/patches/patch-src_file_c
@@ -0,0 +1,179 @@
+$NetBSD: patch-src_file_c,v 1.1 2012/05/10 20:53:30 dholland Exp $
+
+- use standard headers
+- don't use implicit int
+- const correctness required by existing const declarations
+- silence initialize warning seen with gcc 4.1
+
+--- src/file.c~ 2012-05-10 19:25:36.000000000 +0000
++++ src/file.c
+@@ -7,6 +7,7 @@
+ */
+
+ #include <stdio.h>
++#include <unistd.h>
+ #include "estruct.h"
+ #include "eproto.h"
+ #include "edef.h"
+@@ -23,7 +24,7 @@
+ * "read a file into the current buffer" code.
+ * Bound to "C-X C-R".
+ */
+-PASCAL NEAR fileread(f, n)
++int PASCAL NEAR fileread(f, n)
+
+ int f, n; /* defualt and numeric arguments (unused) */
+
+@@ -46,7 +47,7 @@ int f, n; /* defualt and numeric argumen
+ * "insert a file into the current buffer" code.
+ * Bound to "C-X C-I".
+ */
+-PASCAL NEAR insfile(f, n)
++int PASCAL NEAR insfile(f, n)
+
+ int f,n; /* prefix flag and argument */
+
+@@ -55,6 +56,9 @@ int f,n; /* prefix flag and argument */
+ char *fname; /* file name */
+ LINE *curline;
+
++ /* required by gcc 4.1 */
++ curline = NULL;
++
+ if (restflag) /* don't allow this command if restricted */
+ return(resterr());
+ if (curbp->b_mode&MDVIEW) /* don't allow this command if */
+@@ -89,7 +93,7 @@ int f,n; /* prefix flag and argument */
+ * text, and switch to the new buffer.
+ * Bound to C-X C-F.
+ */
+-PASCAL NEAR filefind(f, n)
++int PASCAL NEAR filefind(f, n)
+
+ int f,n; /* prefix flag and argument */
+
+@@ -105,7 +109,7 @@ int f,n; /* prefix flag and argument */
+ return(getfile(fname, TRUE));
+ }
+
+-PASCAL NEAR viewfile(f, n) /* visit a file in VIEW mode */
++int PASCAL NEAR viewfile(f, n) /* visit a file in VIEW mode */
+
+ int f,n; /* prefix flag and argument */
+
+@@ -128,7 +132,7 @@ int f,n; /* prefix flag and argument */
+ }
+
+ #if CRYPT
+-PASCAL NEAR resetkey() /* reset the encryption key if needed */
++int PASCAL NEAR resetkey() /* reset the encryption key if needed */
+
+ {
+ register int s; /* return status */
+@@ -161,9 +165,9 @@ PASCAL NEAR resetkey() /* reset the encr
+ }
+ #endif
+
+-PASCAL NEAR getfile(fname, lockfl)
++int PASCAL NEAR getfile(fname, lockfl)
+
+-char fname[]; /* file name to find */
++CONST char fname[]; /* file name to find */
+ int lockfl; /* check the file for locks? */
+
+ {
+@@ -252,9 +256,9 @@ int lockfl; /* check the file for locks
+ and before it is read.
+ */
+
+-PASCAL NEAR readin(fname, lockfl)
++int PASCAL NEAR readin(fname, lockfl)
+
+-char fname[]; /* name of file to read */
++CONST char fname[]; /* name of file to read */
+ int lockfl; /* check for file locks? */
+
+ {
+@@ -386,15 +390,15 @@ out:
+ * Returns a pointer into fname indicating the end of the file path; i.e.,
+ * 1 character BEYOND the path name.
+ */
+-char *PASCAL NEAR makename(bname, fname)
++CONST char *PASCAL NEAR makename(bname, fname)
+
+ char *bname;
+-char *fname;
++CONST char *fname;
+
+ {
+- register char *cp1;
++ register CONST char *cp1;
+ register char *cp2;
+- register char *pathp;
++ register CONST char *pathp;
+
+ #if AOSVS | MV_UX
+ resolve_full_pathname(fname, fname);
+@@ -480,7 +484,7 @@ char *name; /* name to check on */
+ * and ^X^A for appending.
+ */
+
+-PASCAL NEAR filewrite(f, n)
++int PASCAL NEAR filewrite(f, n)
+
+ int f, n; /* emacs arguments */
+
+@@ -503,7 +507,7 @@ int f, n; /* emacs arguments */
+ return(s);
+ }
+
+-PASCAL NEAR fileapp(f, n) /* append file */
++int PASCAL NEAR fileapp(f, n) /* append file */
+
+ int f, n; /* emacs arguments */
+
+@@ -532,7 +536,7 @@ int f, n; /* emacs arguments */
+ * name for the buffer. Bound to "C-X C-S". May
+ * get called by "C-Z".
+ */
+-PASCAL NEAR filesave(f, n)
++int PASCAL NEAR filesave(f, n)
+
+ int f,n; /* prefix flag and argument */
+
+@@ -588,7 +592,7 @@ int f,n; /* prefix flag and argument */
+ * a user specifyable routine (in $writehook) can be run.
+ */
+
+-PASCAL NEAR writeout(fn, mode)
++int PASCAL NEAR writeout(fn, mode)
+
+ char *fn; /* name of file to write current buffer to */
+ char *mode; /* mode to open file (w = write a = append) */
+@@ -719,7 +723,7 @@ char *mode; /* mode to open file (w = wr
+ * prompt if you wish.
+ */
+
+-PASCAL NEAR filename(f, n)
++int PASCAL NEAR filename(f, n)
+
+ int f,n; /* prefix flag and argument */
+
+@@ -747,7 +751,7 @@ int f,n; /* prefix flag and argument */
+ * buffer, Called by insert file command. Return the final
+ * status of the read.
+ */
+-PASCAL NEAR ifile(fname)
++int PASCAL NEAR ifile(fname)
+ char fname[];
+ {
+ register LINE *lp0;
+@@ -859,7 +863,7 @@ out:
+ names of all the files in a given directory
+ */
+
+-PASCAL NEAR showfiles(f, n)
++int PASCAL NEAR showfiles(f, n)
+
+ int f,n; /* prefix flag and argument */
+
diff --git a/editors/uemacs/patches/patch-src_fileio_c b/editors/uemacs/patches/patch-src_fileio_c
new file mode 100644
index 00000000000..ef3ef94afa5
--- /dev/null
+++ b/editors/uemacs/patches/patch-src_fileio_c
@@ -0,0 +1,58 @@
+$NetBSD: patch-src_fileio_c,v 1.1 2012/05/10 20:53:30 dholland Exp $
+
+- don't use implicit int
+- const correctness required by existing const declarations
+
+--- src/fileio.c~ 2012-05-10 19:25:36.000000000 +0000
++++ src/fileio.c
+@@ -28,8 +28,8 @@ char file_buffer[FILE_BUFSIZE];
+ */
+ #if !(VMS & RMSIO) /* if using RMS under VMS, the code */
+ /* is in VMS.C */
+-PASCAL NEAR ffropen(fn)
+-char *fn;
++int PASCAL NEAR ffropen(fn)
++CONST char *fn;
+ {
+ if ((ffp=fopen(fn, "r")) == NULL)
+ return(FIOFNF);
+@@ -51,9 +51,9 @@ char *fn;
+ * (cannot create).
+ */
+ #if AOSVS == 0
+-PASCAL NEAR ffwopen(fn, mode)
+-char *fn;
+-char *mode; /* mode to open file for */
++int PASCAL NEAR ffwopen(fn, mode)
++CONST char *fn;
++CONST char *mode; /* mode to open file for */
+ {
+ char xmode[6]; /* extended file open mode */
+
+@@ -91,7 +91,7 @@ char *mode; /* mode to open file for */
+ /*
+ * Close a file. Should look at the status in all systems.
+ */
+-PASCAL NEAR ffclose()
++int PASCAL NEAR ffclose()
+ {
+ /* free this since we do not need it anymore */
+ if (fline) {
+@@ -124,7 +124,7 @@ PASCAL NEAR ffclose()
+ * and the "nbuf" is its length, less the free newline. Return the status.
+ * Check only at the newline.
+ */
+-PASCAL NEAR ffputline(buf, nbuf)
++int PASCAL NEAR ffputline(buf, nbuf)
+
+ char buf[];
+ int nbuf;
+@@ -183,7 +183,7 @@ int nbuf;
+ * at the end of the file that don't have a newline present. Check for I/O
+ * errors too. Return status.
+ */
+-PASCAL NEAR ffgetline(nbytes)
++int PASCAL NEAR ffgetline(nbytes)
+
+ int *nbytes;
+
diff --git a/editors/uemacs/patches/patch-src_input_c b/editors/uemacs/patches/patch-src_input_c
new file mode 100644
index 00000000000..8d84fa9838a
--- /dev/null
+++ b/editors/uemacs/patches/patch-src_input_c
@@ -0,0 +1,115 @@
+$NetBSD: patch-src_input_c,v 1.1 2012/05/10 20:53:30 dholland Exp $
+
+- don't use implicit int
+- silence gcc braces warning
+- silence initialization warning seen with gcc 4.1
+- fix signed/unsigned pointer conversions
+
+--- src/input.c~ 2012-05-10 19:25:36.000000000 +0000
++++ src/input.c
+@@ -59,7 +59,7 @@ extern struct passwd *getpwnam();
+ */
+
+ #if !WINDOW_MSWIN /* for MS Windows, mlyesno is defined in mswsys.c */
+-PASCAL NEAR mlyesno(prompt)
++int PASCAL NEAR mlyesno(prompt)
+
+ char *prompt;
+
+@@ -106,7 +106,7 @@ char *prompt;
+ * return. Handle erase, kill, and abort keys.
+ */
+
+-PASCAL NEAR mlreply(prompt, buf, nbuf)
++int PASCAL NEAR mlreply(prompt, buf, nbuf)
+
+ char *prompt;
+ char *buf;
+@@ -119,7 +119,7 @@ int nbuf;
+ /* ectoc: expanded character to character
+ collapse the CTRL and SPEC flags back into an ascii code */
+
+-PASCAL NEAR ectoc(c)
++int PASCAL NEAR ectoc(c)
+
+ int c;
+
+@@ -136,7 +136,7 @@ int c;
+ /* ctoec: character to extended character
+ pull out the CTRL and SPEC prefixes (if possible) */
+
+-PASCAL NEAR ctoec(c)
++int PASCAL NEAR ctoec(c)
+
+ int c;
+
+@@ -259,13 +259,14 @@ int maxlen; /* maximum length of input
+ cpos = 0;
+
+ /* if it exists, prompt the user for a buffer name */
+- if (prompt)
++ if (prompt) {
+ if (type == CMP_COMMAND)
+ mlwrite("%s", prompt);
+ else if (defval)
+ mlwrite("%s[%s]: ", prompt, defval);
+ else
+ mlwrite("%s: ", prompt);
++ }
+
+ /* build a name string from the keyboard */
+ while (TRUE) {
+@@ -737,6 +738,9 @@ int *cpos; /* ptr to position of next ch
+ char longestmatch[NSTRING]; /* temp buffer for longest match */
+ int longestlen; /* length of longest match (always > *cpos) */
+
++ /* required by gcc 4.1 */
++ longestlen = 0;
++
+ /* everything (or nothing) matches an empty string */
+ if (*cpos == 0)
+ return;
+@@ -986,13 +990,14 @@ int PASCAL NEAR getcmd()
+ to specify the proper terminator. If the terminator is not
+ a return('\r'), return will echo as "<NL>"
+ */
+-int PASCAL NEAR getstring(buf, nbuf, eolchar)
++int PASCAL NEAR getstring(buf_c, nbuf, eolchar)
+
+-unsigned char *buf;
++char *buf_c;
+ int nbuf;
+ int eolchar;
+
+ {
++ unsigned char *buf;
+ register int cpos; /* current character position in string */
+ register int c; /* current input character */
+ register int ec; /* extended current input character */
+@@ -1000,6 +1005,8 @@ int eolchar;
+ char *kp; /* pointer into key_name */
+ char key_name[10]; /* name of a quoted key */
+
++ buf = (unsigned char *)buf_c;
++
+ cpos = 0;
+ quotef = FALSE;
+
+@@ -1136,7 +1143,7 @@ int eolchar;
+ }
+ }
+
+-PASCAL NEAR outstring(s) /* output a string of input characters */
++VOID PASCAL NEAR outstring(s) /* output a string of input characters */
+
+ char *s; /* string to output */
+
+@@ -1146,7 +1153,7 @@ char *s; /* string to output */
+ mlout(*s++);
+ }
+
+-PASCAL NEAR ostring(s) /* output a string of output characters */
++VOID PASCAL NEAR ostring(s) /* output a string of output characters */
+
+ char *s; /* string to output */
+
diff --git a/editors/uemacs/patches/patch-src_isearch_c b/editors/uemacs/patches/patch-src_isearch_c
new file mode 100644
index 00000000000..93c70dd5f1c
--- /dev/null
+++ b/editors/uemacs/patches/patch-src_isearch_c
@@ -0,0 +1,49 @@
+$NetBSD: patch-src_isearch_c,v 1.1 2012/05/10 20:53:30 dholland Exp $
+
+- silence some gcc warnings
+- fix uninitialized variable bug caught by gcc
+
+--- src/isearch.c~ 2012-05-10 19:25:36.000000000 +0000
++++ src/isearch.c
+@@ -64,7 +64,7 @@ int f, n; /* prefix flag and argument
+ */
+ backchar(TRUE, 1);
+
+- if (status = isearch(REVERSE))
++ if ((status = isearch(REVERSE)) != 0)
+ mlerase(); /* If happy, just erase the cmd line */
+ else
+ mlwrite(TEXT164);
+@@ -79,7 +79,7 @@ int f, n;
+ {
+ register int status;
+
+- if (status = isearch(FORWARD))
++ if ((status = isearch(FORWARD)) != 0)
+ mlerase(); /* If happy, just erase the cmd line */
+ else
+ mlwrite(TEXT164);
+@@ -357,6 +357,8 @@ int dir; /* Search direction */
+ register char *patrn; /* The entire search string (incl chr) */
+ register int sts; /* how well things go */
+
++ sts = FALSE;
++
+ /* setup the local scan pointer to current "." */
+
+ curline = curwp->w_dotp; /* Get the current line structure */
+@@ -364,12 +366,12 @@ int dir; /* Search direction */
+
+ if (dir == FORWARD)
+ { /* If searching forward */
+- if (sts = !boundry(curline, curoff, FORWARD))
++ if ((sts = !boundry(curline, curoff, FORWARD)) != 0)
+ {
+ /* If it's what we're looking for, set the point
+ * and say that we've moved.
+ */
+- if (sts = eq(nextch(&curline, &curoff, FORWARD), chr))
++ if ((sts = eq(nextch(&curline, &curoff, FORWARD), chr)) != 0)
+ {
+ curwp->w_dotp = curline;
+ curwp->w_doto = curoff;
diff --git a/editors/uemacs/patches/patch-src_keyboard_c b/editors/uemacs/patches/patch-src_keyboard_c
new file mode 100644
index 00000000000..eba85a95fce
--- /dev/null
+++ b/editors/uemacs/patches/patch-src_keyboard_c
@@ -0,0 +1,47 @@
+$NetBSD: patch-src_keyboard_c,v 1.1 2012/05/10 20:53:30 dholland Exp $
+
+- don't mix signed and unsigned char pointers
+- silence initialization warning seen with gcc 4.1
+
+--- src/keyboard.c~ 2012-05-10 19:25:36.000000000 +0000
++++ src/keyboard.c
+@@ -393,16 +393,19 @@ KEYENT *node;
+ * fn - Resulting keycode
+ */
+ #if PROTO
+-int PASCAL NEAR addkey(unsigned char * seq, int fn)
++int PASCAL NEAR addkey(char * seq, int fn)
+ #else
+ int PASCAL NEAR addkey( seq, fn)
+-unsigned char * seq;
++char * seq;
+ int fn;
+ #endif
+ {
+ int first;
+ KEYENT *cur, *nxtcur;
+
++ /* required by gcc 4.1 */
++ cur = NULL;
++
+ /* Skip on null sequences or single character sequences. */
+ if (seq == NULL || strlen(seq) < 2)
+ return FALSE;
+@@ -419,7 +422,7 @@ int fn;
+ while (*seq) {
+
+ /* Do we match current character */
+- if (*seq == cur->ch) {
++ if ((unsigned char)*seq == cur->ch) {
+
+ /* Advance to next level */
+ seq++;
+@@ -447,7 +450,7 @@ int fn;
+
+ /* If first character in sequence is inserted, add to prefix table */
+ if (first)
+- keyseq[*seq] = 1;
++ keyseq[(unsigned char)*seq] = 1;
+
+ /* If characters are left over, insert them into list */
+ for (first = 1; *seq; first = 0) {
diff --git a/editors/uemacs/patches/patch-src_line_c b/editors/uemacs/patches/patch-src_line_c
new file mode 100644
index 00000000000..32d08799631
--- /dev/null
+++ b/editors/uemacs/patches/patch-src_line_c
@@ -0,0 +1,101 @@
+$NetBSD: patch-src_line_c,v 1.1 2012/05/10 20:53:30 dholland Exp $
+
+- don't use implicit int
+- declare void functions void
+- silence bogus initialization seen with gcc 4.1
+
+--- src/line.c~ 2012-05-10 19:25:36.000000000 +0000
++++ src/line.c
+@@ -60,7 +60,7 @@ register int used;
+ * might be in. Release the memory. The buffers are updated too; the magic
+ * conditions described in the above comments don't hold here.
+ */
+-PASCAL NEAR lfree(lp)
++VOID PASCAL NEAR lfree(lp)
+ register LINE *lp;
+ {
+ register BUFFER *bp;
+@@ -129,7 +129,7 @@ register LINE *lp;
+ * displayed in more than 1 window we change EDIT t HARD. Set MODE if the
+ * mode line needs to be updated (the "*" has to be set).
+ */
+-PASCAL NEAR lchange(flag)
++VOID PASCAL NEAR lchange(flag)
+ register int flag;
+ {
+ register EWINDOW *wp;
+@@ -158,7 +158,7 @@ register int flag;
+ }
+ }
+
+-PASCAL NEAR insspace(f, n) /* insert spaces forward into text */
++int PASCAL NEAR insspace(f, n) /* insert spaces forward into text */
+
+ int f, n; /* default flag and numeric argument */
+
+@@ -175,10 +175,10 @@ int f, n; /* default flag and numeric ar
+ */
+
+ #if PROTO
+-int PASCAL NEAR linstr(char *instr)
++int PASCAL NEAR linstr(CONST char *instr)
+ #else
+ int PASCAL NEAR linstr( instr)
+-char *instr;
++CONST char *instr;
+ #endif
+ {
+ register int status;
+@@ -220,9 +220,9 @@ char *instr;
+ */
+
+ #if PROTO
+-PASCAL NEAR linsert(int n, char c)
++int PASCAL NEAR linsert(int n, char c)
+ #else
+-PASCAL NEAR linsert(n, c)
++int PASCAL NEAR linsert(n, c)
+
+ int n;
+ char c;
+@@ -341,9 +341,9 @@ char c;
+ */
+
+ #if PROTO
+-PASCAL NEAR lowrite(char c)
++int PASCAL NEAR lowrite(char c)
+ #else
+-PASCAL NEAR lowrite(c)
++int PASCAL NEAR lowrite(c)
+
+ char c; /* character to overwrite on current position */
+ #endif
+@@ -470,7 +470,7 @@ should be put in the kill buffer.
+
+ */
+
+-PASCAL NEAR ldelete(n, kflag)
++int PASCAL NEAR ldelete(n, kflag)
+
+ long n; /* # of chars to delete */
+ int kflag; /* put killed text in kill buffer flag */
+@@ -728,7 +728,7 @@ char *rline;
+
+ /* putctext: replace the current line with the passed in text */
+
+-PASCAL NEAR putctext(iline)
++int PASCAL NEAR putctext(iline)
+
+ char *iline; /* contents of new line */
+
+@@ -1066,6 +1066,10 @@ int f,n; /* prefix flag and argument */
+ LINE *curline;
+ KILL *kptr; /* pointer into kill buffer */
+
++ /* required by gcc 4.1 */
++ curoff = 0;
++ curline = NULL;
++
+ if (curbp->b_mode&MDVIEW) /* don't allow this command if */
+ return(rdonly()); /* we are in read only mode */
+ if (n < 0)
diff --git a/editors/uemacs/patches/patch-src_main_c b/editors/uemacs/patches/patch-src_main_c
new file mode 100644
index 00000000000..f0f4c244032
--- /dev/null
+++ b/editors/uemacs/patches/patch-src_main_c
@@ -0,0 +1,173 @@
+$NetBSD: patch-src_main_c,v 1.1 2012/05/10 20:53:30 dholland Exp $
+
+- don't use implicit int
+- remove unused extern declaration
+- silence initialization warning seen with gcc 4.1
+- silence gcc parenthesization warning
+
+--- src/main.c~ 2012-05-10 19:25:36.000000000 +0000
++++ src/main.c
+@@ -88,9 +88,9 @@ extern unsigned int _stklen = 10000;
+ int emacs(argc, argv)
+ #else
+ #if XVT
+-called_main(argc, argv)
++int called_main(argc, argv)
+ #else
+-main(argc, argv)
++int main(argc, argv)
+ #endif
+ #endif
+
+@@ -98,7 +98,7 @@ int argc; /* # of arguments */
+ char *argv[]; /* argument strings */
+
+ {
+- register int status;
++ register int status = EXIT_FAILURE;
+
+ #if HANDLE_WINCH
+ signal(SIGWINCH,winch_changed);
+@@ -244,7 +244,6 @@ int firstflag; /* is this the first ti
+ int cryptflag; /* encrypting on the way in? */
+ char ekey[NPAT]; /* startup encryption key */
+ #endif
+- NOSHARE CONST extern char *pathname[]; /* startup file path/name array */
+
+ viewflag = FALSE; /* view mode defaults off in command line */
+ gotoflag = FALSE; /* set to off to begin with */
+@@ -461,7 +460,7 @@ static int PASCAL NEAR getbasekey()
+ invented the "recursive-edit" function.
+ */
+
+-PASCAL NEAR editloop()
++int PASCAL NEAR editloop()
+
+ {
+ register int c; /* command character */
+@@ -596,7 +595,7 @@ loop:
+ n = 4; /* with argument of 4 */
+ mflag = 0; /* that can be discarded. */
+ mlwrite("Arg: 4");
+- while ((c = GETBASEKEY()) >= '0' && c <= '9' ||
++ while (((c = GETBASEKEY()) >= '0' && c <= '9') ||
+ c == reptc || c == '-') {
+ if (c == reptc)
+ if ((n > 0) == ((n * 4) > 0))
+@@ -710,7 +709,7 @@ char bname[]; /* name of buffer to ini
+ * look at it. Return the status of command.
+ */
+
+-PASCAL NEAR execute(c, f, n)
++int PASCAL NEAR execute(c, f, n)
+
+ int c; /* key to execute */
+ int f; /* prefix argument flag */
+@@ -876,7 +875,7 @@ has changed do a write on that buffer an
+ exit.
+ */
+
+-PASCAL NEAR quickexit(f, n)
++int PASCAL NEAR quickexit(f, n)
+
+ int f, n; /* prefix flag and argument */
+
+@@ -915,7 +914,7 @@ int f, n; /* prefix flag and argument
+ * has been changed and not written out. Normally bound to "C-X C-C".
+ */
+
+-PASCAL NEAR quit(f, n)
++int PASCAL NEAR quit(f, n)
+
+ int f, n; /* prefix flag and argument */
+ {
+@@ -943,7 +942,7 @@ int f, n; /* prefix flag and argument
+ return(status);
+ }
+
+-PASCAL NEAR meexit(status)
++int PASCAL NEAR meexit(status)
+ int status; /* return status of emacs */
+ {
+ eexitflag = TRUE; /* flag a program exit */
+@@ -960,7 +959,7 @@ int status; /* return status of emacs
+ * return.
+ */
+
+-PASCAL NEAR ctlxlp(f, n)
++int PASCAL NEAR ctlxlp(f, n)
+
+ int f, n; /* prefix flag and argument */
+
+@@ -983,7 +982,7 @@ int f, n; /* prefix flag and argument
+ * routine. Set up the variables and return to the caller.
+ */
+
+-PASCAL NEAR ctlxrp(f, n)
++int PASCAL NEAR ctlxrp(f, n)
+
+ int f, n; /* prefix flag and argument */
+
+@@ -1007,7 +1006,7 @@ int f, n; /* prefix flag and argument
+ * command gets an error. Return TRUE if all ok, else FALSE.
+ */
+
+-PASCAL NEAR ctlxe(f, n)
++int PASCAL NEAR ctlxe(f, n)
+
+ int f, n; /* prefix flag and argument */
+
+@@ -1031,7 +1030,7 @@ int f, n; /* prefix flag and argument
+ * Sometimes called as a routine, to do general aborting of stuff.
+ */
+
+-PASCAL NEAR ctrlg(f, n)
++int PASCAL NEAR ctrlg(f, n)
+
+ int f, n; /* prefix flag and argument */
+
+@@ -1046,7 +1045,7 @@ int f, n; /* prefix flag and argument
+ /* tell the user that this command is illegal while we are in
+ VIEW (read-only) mode */
+
+-PASCAL NEAR rdonly()
++int PASCAL NEAR rdonly()
+
+ {
+ TTbeep();
+@@ -1055,7 +1054,7 @@ PASCAL NEAR rdonly()
+ return(FALSE);
+ }
+
+-PASCAL NEAR resterr()
++int PASCAL NEAR resterr()
+
+ {
+ TTbeep();
+@@ -1072,7 +1071,7 @@ int n, f; /* yes, these are default and
+ return(TRUE);
+ }
+
+-PASCAL NEAR meta(f, n) /* set META prefixing pending */
++int PASCAL NEAR meta(f, n) /* set META prefixing pending */
+
+ int f, n; /* prefix flag and argument */
+
+@@ -1083,7 +1082,7 @@ int f, n; /* prefix flag and argument
+ return(TRUE);
+ }
+
+-PASCAL NEAR cex(f, n) /* set ^X prefixing pending */
++int PASCAL NEAR cex(f, n) /* set ^X prefixing pending */
+
+ int f, n; /* prefix flag and argument */
+
+@@ -1106,7 +1105,7 @@ int PASCAL NEAR unarg() /* dummy functio
+ char *PASCAL NEAR bytecopy(dst, src, maxlen)
+
+ char *dst; /* destination of copied string */
+-char *src; /* source */
++CONST char *src; /* source */
+ int maxlen; /* maximum length */
+
+ {
diff --git a/editors/uemacs/patches/patch-src_mouse_c b/editors/uemacs/patches/patch-src_mouse_c
new file mode 100644
index 00000000000..b2e70fa7d5b
--- /dev/null
+++ b/editors/uemacs/patches/patch-src_mouse_c
@@ -0,0 +1,88 @@
+$NetBSD: patch-src_mouse_c,v 1.1 2012/05/10 20:53:30 dholland Exp $
+
+- don't use implicit int
+- declare void functions void
+
+--- src/mouse.c~ 2012-05-10 19:25:36.000000000 +0000
++++ src/mouse.c
+@@ -29,7 +29,7 @@ NOSHARE int lastmcmd = MNONE; /* Last mo
+ * of the text). If the mouse points at text then dot is
+ * moved to that location.
+ */
+-PASCAL NEAR movemd(f, n)
++int PASCAL NEAR movemd(f, n)
+
+ int f,n; /* prefix flag and argument */
+
+@@ -86,7 +86,7 @@ int f,n; /* prefix flag and argument */
+ only if we are holding down the proper button
+ */
+
+-PASCAL NEAR mmove(f, n)
++int PASCAL NEAR mmove(f, n)
+
+ int f,n; /* prefix flag and argument */
+
+@@ -146,7 +146,7 @@ int f,n; /* prefix flag and argument */
+ kill-region
+ */
+
+-PASCAL NEAR mregdown(f, n)
++int PASCAL NEAR mregdown(f, n)
+
+ int f,n; /* prefix flag and argument */
+
+@@ -254,7 +254,7 @@ int f,n; /* prefix flag and argument */
+ 3: reset nclicks to 0
+ */
+
+-PASCAL NEAR mregup(f, n)
++int PASCAL NEAR mregup(f, n)
+
+ int f,n; /* prefix flag and argument */
+
+@@ -372,7 +372,7 @@ int f,n; /* prefix flag and argument */
+ * window scrolls. The code in this function is just
+ * too complex!
+ */
+-PASCAL NEAR movemu(f, n)
++int PASCAL NEAR movemu(f, n)
+
+ int f,n; /* prefix flag and argument */
+
+@@ -568,7 +568,7 @@ register int row;
+ * LINE structure is pointed to by "lp".
+ */
+
+-PASCAL NEAR mouseoffset(wp, lp, col)
++int PASCAL NEAR mouseoffset(wp, lp, col)
+
+ register EWINDOW *wp;
+ register LINE *lp;
+@@ -604,7 +604,7 @@ register int col;
+ return(offset);
+ }
+
+-PASCAL NEAR mouse_screen()
++VOID PASCAL NEAR mouse_screen()
+
+ {
+ register SCREEN *screen_ptr; /* screen to test mouse in */
+@@ -637,7 +637,7 @@ PASCAL NEAR mouse_screen()
+ }
+ }
+
+-PASCAL NEAR ismodeline(wp, row)
++int PASCAL NEAR ismodeline(wp, row)
+
+ EWINDOW *wp;
+ int row;
+@@ -659,7 +659,7 @@ int row;
+ let emacs know about the newsize, and have him force a re-draw
+ */
+
+-PASCAL NEAR resizm(f, n)
++int PASCAL NEAR resizm(f, n)
+
+ int f, n; /* these are ignored... we get the new size info from
+ the mouse driver */
diff --git a/editors/uemacs/patches/patch-src_random_c b/editors/uemacs/patches/patch-src_random_c
new file mode 100644
index 00000000000..7b00c079aca
--- /dev/null
+++ b/editors/uemacs/patches/patch-src_random_c
@@ -0,0 +1,318 @@
+$NetBSD: patch-src_random_c,v 1.1 2012/05/10 20:53:30 dholland Exp $
+
+- don't use implicit int
+- fix uninitialized variable usage caught by gcc
+- silence gcc braces warnings
+
+--- src/random.c~ 2012-05-10 19:25:36.000000000 +0000
++++ src/random.c
+@@ -17,7 +17,7 @@
+ * Normally this is bound to "C-X =".
+ */
+
+-PASCAL NEAR showcpos(f, n)
++int PASCAL NEAR showcpos(f, n)
+
+ int f, n; /* prefix flag and argument */
+
+@@ -37,6 +37,9 @@ int f, n; /* prefix flag and argument
+ lp = lforw(curbp->b_linep);
+ curchar = '\r';
+
++ predlines = 0;
++ predchars = 0;
++
+ /* start counting chars and lines */
+ numchars = 0;
+ numlines = 0L;
+@@ -124,7 +127,7 @@ LINE *sline; /* line to search for */
+ * Return current column. Stop at first non-blank given TRUE argument.
+ */
+
+-PASCAL NEAR getccol(bflg)
++int PASCAL NEAR getccol(bflg)
+ int bflg;
+
+ {
+@@ -182,7 +185,7 @@ int pos; /* character offset */
+ * Set current column.
+ */
+
+-PASCAL NEAR setccol(pos)
++int PASCAL NEAR setccol(pos)
+
+ int pos; /* position to set cursor */
+ {
+@@ -232,7 +235,7 @@ int pos; /* position to set cursor */
+ * to keep this working as it always has.
+ */
+
+-PASCAL NEAR twiddle(f, n)
++int PASCAL NEAR twiddle(f, n)
+
+ int f, n; /* prefix flag and argument */
+
+@@ -287,7 +290,7 @@ int f, n; /* prefix flag and argument
+ * function key is pressed, its symbolic MicroEMACS name gets inserted!
+ */
+
+-PASCAL NEAR quote(f, n)
++int PASCAL NEAR quote(f, n)
+
+ int f, n; /* prefix flag and argument */
+ {
+@@ -334,7 +337,7 @@ int f, n; /* prefix flag and argument
+ * into "C-I" (in 10 bit code) already. Bound to "C-I".
+ */
+
+-PASCAL NEAR tab(f, n)
++int PASCAL NEAR tab(f, n)
+
+ int f, n; /* prefix flag and argument */
+ {
+@@ -350,7 +353,7 @@ int f, n; /* prefix flag and argument
+ return(linsert(stabsize - (getccol(FALSE) % stabsize), ' '));
+ }
+
+-PASCAL NEAR detab(f, n) /* change tabs to spaces */
++int PASCAL NEAR detab(f, n) /* change tabs to spaces */
+
+ int f, n; /* default flag and numeric repeat count */
+ {
+@@ -395,7 +398,7 @@ int f, n; /* default flag and numeric
+ }
+
+
+-PASCAL NEAR entab(f, n) /* change spaces to tabs where posible */
++int PASCAL NEAR entab(f, n) /* change spaces to tabs where posible */
+
+ int f, n; /* default flag and numeric repeat count */
+ {
+@@ -425,7 +428,7 @@ int f, n; /* default flag and numeric
+ while (curwp->w_doto < lused(curwp->w_dotp))
+ {
+ /* see if it is time to compress */
+- if ((fspace >= 0) && (nextab(fspace) <= ccol))
++ if ((fspace >= 0) && (nextab(fspace) <= ccol)) {
+ if (ccol - fspace < 2)
+ fspace = -1;
+ else {
+@@ -434,6 +437,7 @@ int f, n; /* default flag and numeric
+ linsert(1, '\t');
+ fspace = -1;
+ }
++ }
+
+ /* get the current character */
+ cchar = lgetc(curwp->w_dotp, curwp->w_doto);
+@@ -472,7 +476,7 @@ int f, n; /* default flag and numeric
+ with no arguments, it trims the current region
+ */
+
+-PASCAL NEAR trim(f, n)
++int PASCAL NEAR trim(f, n)
+
+ int f, n; /* default flag and numeric repeat count */
+ {
+@@ -520,7 +524,7 @@ int f, n; /* default flag and numeric
+ * procerssors. They even handle the looping. Normally this is bound to "C-O".
+ */
+
+-PASCAL NEAR openline(f, n)
++int PASCAL NEAR openline(f, n)
+
+ int f, n; /* prefix flag and argument */
+ {
+@@ -548,7 +552,7 @@ int f, n; /* prefix flag and argument
+ * indentation as specified.
+ */
+
+-PASCAL NEAR newline(f, n)
++int PASCAL NEAR newline(f, n)
+
+ int f, n; /* prefix flag and argument */
+ {
+@@ -583,7 +587,7 @@ int f, n; /* prefix flag and argument
+ return(TRUE);
+ }
+
+-PASCAL NEAR cinsert() /* insert a newline and indentation for C */
++int PASCAL NEAR cinsert() /* insert a newline and indentation for C */
+
+ {
+ register char *cptr; /* string pointer into text to copy */
+@@ -645,7 +649,7 @@ PASCAL NEAR cinsert() /* insert a newlin
+ return(TRUE);
+ }
+
+-PASCAL NEAR insbrace(n, c) /* insert a brace into the text here...we are in CMODE */
++int PASCAL NEAR insbrace(n, c) /* insert a brace into the text here...we are in CMODE */
+
+ int n; /* repeat count */
+ int c; /* brace to insert (always } for now) */
+@@ -741,7 +745,7 @@ int c; /* brace to insert (always }
+ return(linsert(n, c));
+ }
+
+-PASCAL NEAR inspound() /* insert a # into the text here...we are in CMODE */
++int PASCAL NEAR inspound() /* insert a # into the text here...we are in CMODE */
+
+ {
+ register int ch; /* last character before input */
+@@ -776,7 +780,7 @@ PASCAL NEAR inspound() /* insert a # int
+ * ignored.
+ */
+
+-PASCAL NEAR deblank(f, n)
++int PASCAL NEAR deblank(f, n)
+
+ int f, n; /* prefix flag and argument */
+ {
+@@ -809,7 +813,7 @@ int f, n; /* prefix flag and argument
+ * subcomands failed. Normally bound to "C-J".
+ */
+
+-PASCAL NEAR indent(f, n)
++int PASCAL NEAR indent(f, n)
+
+ int f, n; /* prefix flag and argument */
+ {
+@@ -829,11 +833,12 @@ int f, n; /* prefix flag and argument
+ c = lgetc(curwp->w_dotp, i);
+ if (c != ' ' && c != '\t')
+ break;
+- if (c == '\t')
++ if (c == '\t') {
+ if (tabsize > 0)
+ nicol += -(nicol % tabsize) + (tabsize - 1);
+ else
+ break;
++ }
+ ++nicol;
+ }
+ if (lnewline() == FALSE)
+@@ -857,7 +862,7 @@ int f, n; /* prefix flag and argument
+ * of text if typed with a big argument. Normally bound to "C-D".
+ */
+
+-PASCAL NEAR forwdel(f, n)
++int PASCAL NEAR forwdel(f, n)
+
+ int f, n; /* prefix flag and argument */
+
+@@ -886,7 +891,7 @@ int f, n; /* prefix flag and argument
+ * both "RUBOUT" and "C-H".
+ */
+
+-PASCAL NEAR backdel(f, n)
++int PASCAL NEAR backdel(f, n)
+
+ int f, n; /* prefix flag and argument */
+
+@@ -926,7 +931,7 @@ int f, n; /* prefix flag and argument */
+ * that number of newlines. Normally bound to "C-K".
+ */
+
+-PASCAL NEAR killtext(f, n)
++int PASCAL NEAR killtext(f, n)
+
+ int f, n; /* prefix flag and argument */
+
+@@ -974,35 +979,35 @@ int f, n; /* prefix flag and argument */
+ return(ldelete(chunk, TRUE));
+ }
+
+-PASCAL NEAR setmod(f, n) /* prompt and set an editor mode */
++int PASCAL NEAR setmod(f, n) /* prompt and set an editor mode */
+
+ int f, n; /* default and argument */
+ {
+ return(adjustmode(TRUE, FALSE));
+ }
+
+-PASCAL NEAR delmode(f, n) /* prompt and delete an editor mode */
++int PASCAL NEAR delmode(f, n) /* prompt and delete an editor mode */
+
+ int f, n; /* default and argument */
+ {
+ return(adjustmode(FALSE, FALSE));
+ }
+
+-PASCAL NEAR setgmode(f, n) /* prompt and set a global editor mode */
++int PASCAL NEAR setgmode(f, n) /* prompt and set a global editor mode */
+
+ int f, n; /* default and argument */
+ {
+ return(adjustmode(TRUE, TRUE));
+ }
+
+-PASCAL NEAR delgmode(f, n) /* prompt and delete a global editor mode */
++int PASCAL NEAR delgmode(f, n) /* prompt and delete a global editor mode */
+
+ int f, n; /* default and argument */
+ {
+ return(adjustmode(FALSE, TRUE));
+ }
+
+-PASCAL NEAR adjustmode(kind, global) /* change the editor mode status */
++int PASCAL NEAR adjustmode(kind, global) /* change the editor mode status */
+
+ int kind; /* true = set, false = delete */
+ int global; /* true = global flag, false = current buffer flag */
+@@ -1118,7 +1123,7 @@ int global; /* true = global flag, fa
+ /* This function simply clears the message line,
+ mainly for macro usage */
+
+-PASCAL NEAR clrmes(f, n)
++int PASCAL NEAR clrmes(f, n)
+
+ int f, n; /* arguments ignored */
+ {
+@@ -1129,7 +1134,7 @@ int f, n; /* arguments ignored */
+ /* This function writes a string on the message line
+ mainly for macro usage */
+
+-PASCAL NEAR writemsg(f, n)
++int PASCAL NEAR writemsg(f, n)
+
+ int f, n; /* arguments ignored */
+ {
+@@ -1147,7 +1152,7 @@ int f, n; /* arguments ignored */
+
+ /* the cursor is moved to a matching fence */
+
+-PASCAL NEAR getfence(f, n)
++int PASCAL NEAR getfence(f, n)
+
+ int f, n; /* not used */
+ {
+@@ -1242,9 +1247,9 @@ int f, n; /* not used */
+ on screen the cursor briefly lights there */
+
+ #if PROTO
+-PASCAL NEAR fmatch(char ch)
++int PASCAL NEAR fmatch(char ch)
+ #else
+-PASCAL NEAR fmatch(ch)
++int PASCAL NEAR fmatch(ch)
+
+ char ch; /* fence type to match against */
+ #endif
+@@ -1318,7 +1323,7 @@ char ch; /* fence type to match against
+ /* ask for and insert a string into the current
+ buffer at the current point */
+
+-PASCAL NEAR istring(f, n)
++int PASCAL NEAR istring(f, n)
+
+ int f, n; /* ignored arguments */
+
+@@ -1344,7 +1349,7 @@ int f, n; /* ignored arguments */
+ return(status);
+ }
+
+-PASCAL NEAR ovstring(f, n) /* ask for and overwite a string into the current
++int PASCAL NEAR ovstring(f, n) /* ask for and overwite a string into the current
+ buffer at the current point */
+
+ int f, n; /* ignored arguments */
diff --git a/editors/uemacs/patches/patch-src_region_c b/editors/uemacs/patches/patch-src_region_c
new file mode 100644
index 00000000000..4e69f985c3a
--- /dev/null
+++ b/editors/uemacs/patches/patch-src_region_c
@@ -0,0 +1,97 @@
+$NetBSD: patch-src_region_c,v 1.1 2012/05/10 20:53:30 dholland Exp $
+
+- don't use implicit int
+- const correctness required by existing const declarations
+
+--- src/region.c~ 2012-05-10 19:25:36.000000000 +0000
++++ src/region.c
+@@ -51,7 +51,7 @@ int PASCAL NEAR reglines()
+ * Move "." to the start, and kill the characters.
+ * Bound to "C-W".
+ */
+-PASCAL NEAR killregion(f, n)
++int PASCAL NEAR killregion(f, n)
+
+ int f,n; /* prefix flag and argument */
+
+@@ -87,7 +87,7 @@ int f,n; /* prefix flag and argument */
+ * at all. This is a bit like a kill region followed
+ * by a yank. Bound to "M-W".
+ */
+-PASCAL NEAR copyregion(f, n)
++int PASCAL NEAR copyregion(f, n)
+
+ int f,n; /* prefix flag and argument */
+
+@@ -129,7 +129,7 @@ int f,n; /* prefix flag and argument */
+ * redisplay is done in all buffers. Bound to
+ * "C-X C-L".
+ */
+-PASCAL NEAR lowerregion(f, n)
++int PASCAL NEAR lowerregion(f, n)
+
+ int f,n; /* prefix flag and argument */
+
+@@ -194,7 +194,7 @@ int f,n; /* prefix flag and argument */
+ * redisplay is done in all buffers. Bound to
+ * "C-X C-L".
+ */
+-PASCAL NEAR upperregion(f, n)
++int PASCAL NEAR upperregion(f, n)
+
+ int f,n; /* prefix flag and argument */
+
+@@ -255,7 +255,7 @@ int f,n; /* prefix flag and argument */
+ the current buffer invisable and unchangable
+ */
+
+-PASCAL NEAR narrow(f, n)
++int PASCAL NEAR narrow(f, n)
+
+ int f,n; /* prefix flag and argument */
+
+@@ -345,7 +345,7 @@ int f,n; /* prefix flag and argument */
+
+ /* widen-from-region (^X->) restores a narrowed region */
+
+-PASCAL NEAR widen(f, n)
++int PASCAL NEAR widen(f, n)
+
+ int f,n; /* prefix flag and argument */
+
+@@ -438,7 +438,7 @@ int f,n; /* prefix flag and argument */
+ * "ABORT" status; we might make this have the confirm thing later.
+ */
+
+-PASCAL NEAR getregion(rp)
++int PASCAL NEAR getregion(rp)
+
+ register REGION *rp;
+
+@@ -530,7 +530,7 @@ REGION *region;
+ return buf;
+ }
+
+-char *PASCAL NEAR getreg(value) /* return some of the contents of the current region */
++CONST char *PASCAL NEAR getreg(value) /* return some of the contents of the current region */
+
+ char *value;
+
+@@ -548,7 +548,7 @@ char *value;
+ }
+
+
+-PASCAL NEAR indent_region(f, n) /* indent a region n tab-stops */
++int PASCAL NEAR indent_region(f, n) /* indent a region n tab-stops */
+
+ int f,n; /* default flag and numeric repeat count */
+
+@@ -587,7 +587,7 @@ int f,n; /* default flag and numeric rep
+ return(TRUE);
+ }
+
+-PASCAL NEAR undent_region(f, n) /* undent a region n tab-stops */
++int PASCAL NEAR undent_region(f, n) /* undent a region n tab-stops */
+
+ int f,n; /* default flag and numeric repeat count */
+
diff --git a/editors/uemacs/patches/patch-src_replace_c b/editors/uemacs/patches/patch-src_replace_c
new file mode 100644
index 00000000000..21e0ead00db
--- /dev/null
+++ b/editors/uemacs/patches/patch-src_replace_c
@@ -0,0 +1,38 @@
+$NetBSD: patch-src_replace_c,v 1.1 2012/05/10 20:53:30 dholland Exp $
+
+- silence initialization warning seen with gcc 4.1
+- fix mixing of signed and unsigned char pointers
+- const correctness required by existing const declarations
+
+--- src/replace.c~ 2012-05-10 19:25:36.000000000 +0000
++++ src/replace.c
+@@ -55,6 +55,11 @@ int n; /* # of repetitions wanted */
+ int lastoff; /* offset (for 'u' query option) */
+ int oldmatchlen; /* Closure may alter the match length.*/
+
++ /* required by gcc 4.1 */
++ c = 0;
++ lastoff = 0;
++ oldmatchlen = 0;
++
+ /*
+ * Don't allow this command if we are
+ * in read only mode.
+@@ -83,7 +88,7 @@ int n; /* # of repetitions wanted */
+ /* Set up flags so we can make sure not to do a recursive
+ * replace on the last line.
+ */
+- nlflag = (pat[strlen(pat) - 1] == '\r');
++ nlflag = (pat[strlen((char *)pat) - 1] == '\r');
+ nlrepl = FALSE;
+
+ /* Save original . position, reset the number of matches and
+@@ -340,7 +345,7 @@ char *instr;
+ int use_rmc;
+ {
+ register int status;
+- register char *rstr;
++ register CONST char *rstr;
+ #if MAGIC
+ register RMC *rmcptr;
+ #endif
diff --git a/editors/uemacs/patches/patch-src_screen_c b/editors/uemacs/patches/patch-src_screen_c
new file mode 100644
index 00000000000..d17252d2179
--- /dev/null
+++ b/editors/uemacs/patches/patch-src_screen_c
@@ -0,0 +1,70 @@
+$NetBSD: patch-src_screen_c,v 1.1 2012/05/10 20:53:30 dholland Exp $
+
+- don't use implicit int
+- declare void functions void
+
+--- src/screen.c~ 2012-05-10 19:25:36.000000000 +0000
++++ src/screen.c
+@@ -66,7 +66,7 @@ SCREEN *sp; /* screen image to refresh *
+ to A-N on machines with an ALT key
+ */
+
+-PASCAL NEAR cycle_screens(f, n)
++int PASCAL NEAR cycle_screens(f, n)
+
+ int f,n; /* prefix flag and argument */
+
+@@ -82,7 +82,7 @@ int f,n; /* prefix flag and argument */
+ return(select_screen(sp, TRUE));
+ }
+
+-PASCAL NEAR find_screen(f, n)
++int PASCAL NEAR find_screen(f, n)
+
+ int f,n; /* prefix flag and argument */
+
+@@ -113,7 +113,7 @@ int f,n; /* prefix flag and argument */
+ return(select_screen(sp, TRUE));
+ }
+
+-PASCAL NEAR free_screen(sp) /* free all resouces associated with a screen */
++VOID PASCAL NEAR free_screen(sp) /* free all resouces associated with a screen */
+
+ SCREEN *sp; /* screen to dump */
+
+@@ -149,7 +149,7 @@ SCREEN *sp; /* screen to dump */
+ free((char *) sp);
+ }
+
+-int PASCAL NEAR unlist_screen(sp)
++VOID PASCAL NEAR unlist_screen(sp)
+
+ SCREEN *sp; /* screen to remove from the list */
+ {
+@@ -164,7 +164,7 @@ SCREEN *sp; /* screen to remove
+ last_scr->s_next_screen = sp->s_next_screen;
+ }
+
+-PASCAL NEAR delete_screen(f, n)
++int PASCAL NEAR delete_screen(f, n)
+
+ int f,n; /* prefix flag and argument */
+
+@@ -396,7 +396,7 @@ int announce; /* announce the selection?
+ Bound to "A-B".
+ */
+
+-PASCAL NEAR list_screens(f, n)
++int PASCAL NEAR list_screens(f, n)
+
+ int f,n; /* prefix flag and argument */
+
+@@ -418,7 +418,7 @@ int f,n; /* prefix flag and argument */
+ * is an error (if there is no memory). Iflag
+ * indicates whether to list hidden screens.
+ */
+-PASCAL NEAR screenlist(iflag)
++int PASCAL NEAR screenlist(iflag)
+
+ int iflag; /* list hidden screen flag */
+
diff --git a/editors/uemacs/patches/patch-src_search_c b/editors/uemacs/patches/patch-src_search_c
new file mode 100644
index 00000000000..fe1ab64e6f1
--- /dev/null
+++ b/editors/uemacs/patches/patch-src_search_c
@@ -0,0 +1,62 @@
+$NetBSD: patch-src_search_c,v 1.1 2012/05/10 20:53:30 dholland Exp $
+
+- silence initialization warning seen with gcc 4.1
+- fix mixing of signed and unsigned char pointers
+- silence gcc braces and parentheses warnings
+
+--- src/search.c~ 2012-05-10 19:25:36.000000000 +0000
++++ src/search.c
+@@ -255,6 +255,10 @@ int repeats;
+ int patlenadd;
+ int jump;
+
++ /* required by gcc 4.1 */
++ patlenadd = 0;
++ jump = 0;
++
+ /* If we are going in reverse, then the 'end' is actually
+ * the beginning of the pattern. Toggle it.
+ */
+@@ -410,7 +414,7 @@ int *pcwoff;
+ /* Is the current meta-character modified
+ * by a closure?
+ */
+- if (cl_type = (mcptr->mc_type & ALLCLOS)) {
++ if ((cl_type = (mcptr->mc_type & ALLCLOS)) != 0) {
+
+ /* Minimum number of characters that may
+ * match is 0 or 1.
+@@ -807,7 +811,7 @@ DELTA *tbl;
+ */
+ VOID PASCAL NEAR setjtable()
+ {
+- make_delta(pat, &deltapat);
++ make_delta((char *)pat, &deltapat);
+ make_delta(strrev(strcpy((char *)tap, (char *)pat)), &tapatled);
+ }
+
+@@ -876,13 +880,14 @@ int srch;
+ /* Only make the meta-pattern if in magic mode, since the
+ * pattern in question might have an invalid meta combination.
+ */
+- if (status == TRUE)
++ if (status == TRUE) {
+ if ((curwp->w_bufp->b_mode & MDMAGIC) == 0) {
+ mcclear();
+ rmcclear();
+ }
+ else
+ status = srch? mcstr(): rmcstr();
++ }
+ #endif
+ return (status);
+ }
+@@ -1500,7 +1505,7 @@ MC *mcptr;
+ * Now loop through the pattern, collecting characters until
+ * we run into a meta-character.
+ */
+- while (pchr = *++patptr)
++ while ((pchr = *++patptr) != 0)
+ {
+ /*
+ * If the current character is a closure character,
diff --git a/editors/uemacs/patches/patch-src_tags_c b/editors/uemacs/patches/patch-src_tags_c
new file mode 100644
index 00000000000..f731e3147f3
--- /dev/null
+++ b/editors/uemacs/patches/patch-src_tags_c
@@ -0,0 +1,70 @@
+$NetBSD: patch-src_tags_c,v 1.1 2012/05/10 20:53:30 dholland Exp $
+
+- remove useless sccs id
+- don't use implicit int
+
+--- src/tags.c~ 2012-05-10 19:25:36.000000000 +0000
++++ src/tags.c
+@@ -29,7 +29,7 @@
+ #include "edef.h"
+ #include "elang.h"
+
+-static char SVER[] = "@(#) %M% %I% %H%";
++/*static char SVER[] = "@(#) %M% %I% %H%";*/
+
+ #ifdef min
+ #undef min
+@@ -67,7 +67,7 @@ static TAG *curtp = NULL; /* Currently i
+ * return with TRUE only if we are succesfull.
+ */
+
+-newtags(path)
++int newtags(path)
+ char path[NFILEN];
+ {
+ register TAG *tnewp;
+@@ -105,7 +105,7 @@ char path[NFILEN];
+ * try it the hard way. If we find the file we return TRUE.
+ */
+
+-lookup()
++int lookup()
+ {
+ TAG *tmp = curtp; /* Remember current 'tags' */
+ char cpath[NFILEN]; /* Path of current file */
+@@ -176,7 +176,7 @@ VOID fix_index()
+ * str (but maximum lmax characters). '.' is preserved.
+ */
+
+-restword(str, lmax)
++int restword(str, lmax)
+ char *str;
+ int lmax;
+ {
+@@ -207,7 +207,7 @@ int lmax;
+ * results from this code (I did).
+ */
+
+-backupword(f, n)
++int backupword(f, n)
+
+ int f, n;
+
+@@ -232,7 +232,7 @@ int f, n;
+ * and search direction characters (? or /)
+ */
+
+-alterpattern(pattern)
++int alterpattern(pattern)
+ register char pattern[];
+ {
+ register int i = 0; /* EMACS pattern index */
+@@ -298,7 +298,7 @@ char *filename;
+ * so as to prevent loosing the return information.
+ */
+
+-tagger(errmsg, retag)
++int tagger(errmsg, retag)
+ char *errmsg;
+ int retag;
+ {
diff --git a/editors/uemacs/patches/patch-src_undo_c b/editors/uemacs/patches/patch-src_undo_c
new file mode 100644
index 00000000000..6df11eed3fd
--- /dev/null
+++ b/editors/uemacs/patches/patch-src_undo_c
@@ -0,0 +1,33 @@
+$NetBSD: patch-src_undo_c,v 1.1 2012/05/10 20:53:30 dholland Exp $
+
+- don't use implicit int
+- return values from non-void functions on unreachable paths
+
+--- src/undo.c~ 2012-05-10 19:25:36.000000000 +0000
++++ src/undo.c
+@@ -263,7 +263,7 @@ int f,n; /* prefix flag and argument */
+ return(wpopup(ulistp));
+ }
+
+-PASCAL NEAR undolist()
++int PASCAL NEAR undolist()
+
+ {
+ register char *cp1; /* scanning pointer into line to build */
+@@ -448,6 +448,8 @@ nextbuf: bp = getoldb();
+ lp->next = (UNDO_OBJ *)NULL;
+ bp->undo_count--;
+ }
++ /* notreached */
++ return NULL;
+ }
+
+ /* RE-ROOM: Allocate memory using realloc()
+@@ -511,5 +513,7 @@ nxtbuf: bp = getoldb();
+ lp->next = (UNDO_OBJ *)NULL;
+ bp->undo_count--;
+ }
++ /* notreached */
++ return NULL;
+ }
+
diff --git a/editors/uemacs/patches/patch-src_window_c b/editors/uemacs/patches/patch-src_window_c
new file mode 100644
index 00000000000..f264b5d5a53
--- /dev/null
+++ b/editors/uemacs/patches/patch-src_window_c
@@ -0,0 +1,194 @@
+$NetBSD: patch-src_window_c,v 1.1 2012/05/10 20:53:30 dholland Exp $
+
+- don't use implicit int
+- return values from non-void functions
+ (arguably these should be made void, but that causes complications)
+
+--- src/window.c~ 2012-05-10 19:25:36.000000000 +0000
++++ src/window.c
+@@ -15,7 +15,7 @@
+ * bottom. If it is 0 the window is centered (this is what the standard
+ * redisplay code does). With no argument it defaults to 0. Bound to M-!.
+ */
+-PASCAL NEAR reposition(f, n)
++int PASCAL NEAR reposition(f, n)
+
+ int f, n; /* prefix flag and argument */
+
+@@ -31,7 +31,7 @@ int f, n; /* prefix flag and argument */
+ * Refresh the screen. With no argument, it just does the refresh. With an
+ * argument it recenters "." in the current window. Bound to "C-L".
+ */
+-PASCAL NEAR refresh(f, n)
++int PASCAL NEAR refresh(f, n)
+
+ int f, n; /* prefix flag and argument */
+
+@@ -54,7 +54,7 @@ int f, n; /* prefix flag and argument */
+ * with an argument this command finds the <n>th window from the top
+ *
+ */
+-PASCAL NEAR nextwind(f, n)
++int PASCAL NEAR nextwind(f, n)
+
+ int f, n; /* default flag and numeric argument */
+
+@@ -101,7 +101,7 @@ int f, n; /* default flag and numeric ar
+ * current window. There arn't any errors, although the command does not do a
+ * lot if there is 1 window.
+ */
+-PASCAL NEAR prevwind(f, n)
++int PASCAL NEAR prevwind(f, n)
+
+ int f,n; /* prefix flag and argument */
+
+@@ -135,7 +135,7 @@ int f,n; /* prefix flag and argument */
+ * a new dot. We share the code by having "move down" just be an interface to
+ * "move up". Magic. Bound to "C-X C-N".
+ */
+-PASCAL NEAR mvdnwind(f, n)
++int PASCAL NEAR mvdnwind(f, n)
+
+ int f, n; /* prefix flag and argument */
+
+@@ -150,7 +150,7 @@ int f, n; /* prefix flag and argument */
+ * (this command does not really move "."; it moves the frame). Bound to
+ * "C-X C-P".
+ */
+-PASCAL NEAR mvupwind(f, n)
++int PASCAL NEAR mvupwind(f, n)
+
+ int f, n; /* prefix flag and argument */
+
+@@ -197,7 +197,7 @@ int f, n; /* prefix flag and argument */
+ * the buffer structures right if the distruction of a window makes a buffer
+ * become undisplayed.
+ */
+-PASCAL NEAR onlywind(f, n)
++int PASCAL NEAR onlywind(f, n)
+
+ int f,n; /* prefix flag and argument */
+
+@@ -253,7 +253,7 @@ int f,n; /* prefix flag and argument */
+ * or, if it is the top window, the window below. Bound to C-X 0.
+ */
+
+-PASCAL NEAR delwind(f,n)
++int PASCAL NEAR delwind(f,n)
+
+ int f, n; /* arguments are ignored for this command */
+
+@@ -340,7 +340,7 @@ window. Bound to "C-X 2".
+
+ */
+
+-PASCAL NEAR splitwind(f, n)
++int PASCAL NEAR splitwind(f, n)
+
+ int f, n; /* default flag and numeric argument */
+
+@@ -432,7 +432,7 @@ int f, n; /* default flag and numeric ar
+ * all the hard work. You don't just set "force reframe" because dot would
+ * move. Bound to "C-X Z".
+ */
+-PASCAL NEAR enlargewind(f, n)
++int PASCAL NEAR enlargewind(f, n)
+
+ int f,n; /* prefix flag and argument */
+
+@@ -483,7 +483,7 @@ int f,n; /* prefix flag and argument */
+ * window descriptions. Ask the redisplay to do all the hard work. Bound to
+ * "C-X C-Z".
+ */
+-PASCAL NEAR shrinkwind(f, n)
++int PASCAL NEAR shrinkwind(f, n)
+
+ int f,n; /* prefix flag and argument */
+
+@@ -531,7 +531,7 @@ int f,n; /* prefix flag and argument */
+
+ /* Resize the current window to the requested size */
+
+-PASCAL NEAR resize(f, n)
++int PASCAL NEAR resize(f, n)
+
+ int f, n; /* default flag and numeric argument */
+
+@@ -617,7 +617,7 @@ setwin: wp = wheadp;
+ return(TRUE);
+ }
+
+-PASCAL NEAR nextup(f, n) /* scroll the next window up (back) a page */
++int PASCAL NEAR nextup(f, n) /* scroll the next window up (back) a page */
+
+ int f, n; /* prefix flag and argument */
+
+@@ -625,9 +625,10 @@ int f, n; /* prefix flag and argument */
+ nextwind(FALSE, 1);
+ backpage(f, n);
+ prevwind(FALSE, 1);
++ return 0;
+ }
+
+-PASCAL NEAR nextdown(f, n) /* scroll the next window down (forward) a page */
++int PASCAL NEAR nextdown(f, n) /* scroll the next window down (forward) a page */
+
+ int f, n; /* prefix flag and argument */
+
+@@ -635,9 +636,10 @@ int f, n; /* prefix flag and argument */
+ nextwind(FALSE, 1);
+ forwpage(f, n);
+ prevwind(FALSE, 1);
++ return 0;
+ }
+
+-PASCAL NEAR savewnd(f, n) /* save ptr to current window */
++int PASCAL NEAR savewnd(f, n) /* save ptr to current window */
+
+ int f, n; /* prefix flag and argument */
+
+@@ -646,7 +648,7 @@ int f, n; /* prefix flag and argument */
+ return(TRUE);
+ }
+
+-PASCAL NEAR restwnd(f, n) /* restore the saved screen */
++int PASCAL NEAR restwnd(f, n) /* restore the saved screen */
+
+ int f, n; /* prefix flag and argument */
+
+@@ -670,7 +672,7 @@ int f, n; /* prefix flag and argument */
+ return(FALSE);
+ }
+
+-PASCAL NEAR newsize(f, n) /* resize the screen, re-writing the screen */
++int PASCAL NEAR newsize(f, n) /* resize the screen, re-writing the screen */
+
+ int f; /* default flag */
+ int n; /* numeric argument */
+@@ -772,7 +774,7 @@ int n; /* numeric argument */
+ return(TRUE);
+ }
+
+-PASCAL NEAR newwidth(f, n) /* resize the screen, re-writing the screen */
++int PASCAL NEAR newwidth(f, n) /* resize the screen, re-writing the screen */
+
+ int f; /* default flag */
+ int n; /* numeric argument */
+@@ -811,7 +813,7 @@ int n; /* numeric argument */
+ return(TRUE);
+ }
+
+-PASCAL NEAR new_col_org(f, n) /* reposition the screen, re-writing the screen */
++int PASCAL NEAR new_col_org(f, n) /* reposition the screen, re-writing the screen */
+
+ int f; /* default flag */
+ int n; /* numeric argument */
+@@ -838,7 +840,7 @@ int n; /* numeric argument */
+ return(TRUE);
+ }
+
+-PASCAL NEAR new_row_org(f, n) /* reposition the screen, re-writing the screen */
++int PASCAL NEAR new_row_org(f, n) /* reposition the screen, re-writing the screen */
+
+ int f; /* default flag */
+ int n; /* numeric argument */
diff --git a/editors/uemacs/patches/patch-src_word_c b/editors/uemacs/patches/patch-src_word_c
new file mode 100644
index 00000000000..37678c5ef40
--- /dev/null
+++ b/editors/uemacs/patches/patch-src_word_c
@@ -0,0 +1,124 @@
+$NetBSD: patch-src_word_c,v 1.1 2012/05/10 20:53:30 dholland Exp $
+
+- don't use implicit int
+- don't index arrays with signed char
+
+--- src/word.c~ 2012-05-10 19:25:36.000000000 +0000
++++ src/word.c
+@@ -18,7 +18,7 @@
+ * left edge of the current window
+ * Returns TRUE on success, FALSE on errors.
+ */
+-PASCAL NEAR wrapword(f, n)
++int PASCAL NEAR wrapword(f, n)
+
+ int f; /* default flag */
+ int n; /* numeric argument */
+@@ -74,7 +74,7 @@ int n; /* numeric argument */
+ * performed by the "backchar" and "forwchar" routines. Error if you try to
+ * move beyond the buffers.
+ */
+-PASCAL NEAR backword(f, n)
++int PASCAL NEAR backword(f, n)
+
+ int f,n; /* prefix flag and argument */
+
+@@ -100,7 +100,7 @@ int f,n; /* prefix flag and argument */
+ * Move the cursor forward by the specified number of words. All of the motion
+ * is done by "forwchar". Error if you try and move beyond the buffer's end.
+ */
+-PASCAL NEAR forwword(f, n)
++int PASCAL NEAR forwword(f, n)
+
+ int f,n; /* prefix flag and argument */
+
+@@ -127,7 +127,7 @@ int f,n; /* prefix flag and argument */
+ * Move forward to the end of the nth next word. Error if you move past
+ * the end of the buffer.
+ */
+-PASCAL NEAR endword(f, n)
++int PASCAL NEAR endword(f, n)
+
+ int f,n; /* prefix flag and argument */
+
+@@ -155,7 +155,7 @@ int f,n; /* prefix flag and argument */
+ * convert any characters to upper case. Error if you try and move beyond the
+ * end of the buffer. Bound to "M-U".
+ */
+-PASCAL NEAR upperword(f, n)
++int PASCAL NEAR upperword(f, n)
+
+ int f,n; /* prefix flag and argument */
+
+@@ -192,7 +192,7 @@ int f,n; /* prefix flag and argument */
+ * convert characters to lower case. Error if you try and move over the end of
+ * the buffer. Bound to "M-L".
+ */
+-PASCAL NEAR lowerword(f, n)
++int PASCAL NEAR lowerword(f, n)
+
+ int f,n; /* prefix flag and argument */
+
+@@ -230,7 +230,7 @@ int f,n; /* prefix flag and argument */
+ * characters to lower case. Error if you try and move past the end of the
+ * buffer. Bound to "M-C".
+ */
+-PASCAL NEAR capword(f, n)
++int PASCAL NEAR capword(f, n)
+
+ int f,n; /* prefix flag and argument */
+
+@@ -280,7 +280,7 @@ int f,n; /* prefix flag and argument */
+ * command for the right number of characters. With a zero argument, just
+ * kill one word and no whitespace. Bound to "M-D".
+ */
+-PASCAL NEAR delfword(f, n)
++int PASCAL NEAR delfword(f, n)
+
+ int f,n; /* prefix flag and argument */
+
+@@ -372,7 +372,7 @@ int f,n; /* prefix flag and argument */
+ * counting the characters. When dot is finally moved to its resting place,
+ * fire off the kill command. Bound to "M-Rubout" and to "M-Backspace".
+ */
+-PASCAL NEAR delbword(f, n)
++int PASCAL NEAR delbword(f, n)
+
+ int f,n; /* prefix flag and argument */
+
+@@ -442,7 +442,7 @@ char c;
+ {
+ /* if we are using the table.... */
+ if (wlflag)
+- return(wordlist[c]);
++ return(wordlist[(unsigned char)c]);
+
+ /* else use the default hard coded check */
+ if (is_letter(c))
+@@ -454,7 +454,7 @@ char c;
+ return(FALSE);
+ }
+
+-PASCAL NEAR fillpara(f, n) /* Fill the current paragraph according to the
++int PASCAL NEAR fillpara(f, n) /* Fill the current paragraph according to the
+ current fill column */
+
+ int f, n; /* Default flag and Numeric argument */
+@@ -600,7 +600,7 @@ char *para; /* string buffer containing
+ }
+ }
+
+-PASCAL NEAR killpara(f, n) /* delete n paragraphs starting with the current one */
++int PASCAL NEAR killpara(f, n) /* delete n paragraphs starting with the current one */
+
+ int f; /* default flag */
+ int n; /* # of paras to delete */
+@@ -635,7 +635,7 @@ int n; /* # of paras to delete */
+ along with average word sizes, # of chars, etc,
+ and report on them. */
+
+-PASCAL NEAR wordcount(f, n)
++int PASCAL NEAR wordcount(f, n)
+
+ int f, n; /* ignored numeric arguments */
+