Index: lib700/bitrev.c
===================================================================
--- lib700/bitrev.c	(revision 05806159f2593192d6ed2fca28358480a2383c67)
+++ lib700/bitrev.c	(revision 7848656beb2903f579b69a9e8ae840577e026a94)
@@ -6,5 +6,5 @@
 */
 
-static int bitmask[] = {
+static int16_t bitmask[] = {
 
 	0x0001, 0x0002, 0x0004, 0x0008,
@@ -22,7 +22,7 @@
 */
 
-int bitrev(int bitsin, int nbits)
+int16_t bitrev(int16_t bitsin, int16_t nbits)
 {
-	int	m, n;
+	int16_t	m, n;
 
 	n = 0;
Index: lib700/ctype.c
===================================================================
--- lib700/ctype.c	(revision 05806159f2593192d6ed2fca28358480a2383c67)
+++ lib700/ctype.c	(revision 7848656beb2903f579b69a9e8ae840577e026a94)
@@ -37,5 +37,5 @@
 }
 
-char __atab[] = {	/* EOF won't work properly with this table */
+int8_t __atab[] = {	/* EOF won't work properly with this table */
 #endif
 
Index: lib700/ispow2.c
===================================================================
--- lib700/ispow2.c	(revision 05806159f2593192d6ed2fca28358480a2383c67)
+++ lib700/ispow2.c	(revision 7848656beb2903f579b69a9e8ae840577e026a94)
@@ -13,8 +13,8 @@
 #include "stddefs.h"
 
-short ispow2(long x)
+int16_t ispow2(int32_t x)
 {
-	register short i;
-	register long k;
+	register int16_t i;
+	register int32_t k;
 
 	k = 0x00000001L;		/* setup the bit mask in k */
Index: lib700/mangle.c
===================================================================
--- lib700/mangle.c	(revision 05806159f2593192d6ed2fca28358480a2383c67)
+++ lib700/mangle.c	(revision 7848656beb2903f579b69a9e8ae840577e026a94)
@@ -20,9 +20,9 @@
 */
 
-long mangle(long *bitmap, short nb, long ib)
+int32_t mangle(int32_t *bitmap, int16_t nb, int32_t ib)
 {
-	register long	bm;			/* scan mask */
-	register long	rv;			/* result value */
-	register short	bn;			/* bit number (bitmap index) */
+	register int32_t	bm;			/* scan mask */
+	register int32_t	rv;			/* result value */
+	register int16_t	bn;			/* bit number (bitmap index) */
 
 	bm = 0x00000001L;			/* setup scan mask */
Index: lib700/micons.c
===================================================================
--- lib700/micons.c	(revision 05806159f2593192d6ed2fca28358480a2383c67)
+++ lib700/micons.c	(revision 7848656beb2903f579b69a9e8ae840577e026a94)
@@ -35,7 +35,7 @@
 */
 
-short micons(short wi)
+int16_t micons(int16_t wi)
 {
-	return((short)( ((wi << 8) & 0xFF00) | ((wi >> 8) & 0x00FF) ) );
+	return((int16_t)( ((wi << 8) & 0xFF00) | ((wi >> 8) & 0x00FF) ) );
 }
 
@@ -46,7 +46,7 @@
 */
 
-int miconi(int wi)
+int16_t miconi(int16_t wi)
 {
-	if (sizeof (int) == 4)
+	if (sizeof (int16_t) == 4)
 		return( ((wi << 24) & 0xFF000000L) | ((wi << 8) & 0x00FF0000L) |
 			((wi >> 8) & 0x0000FF00L) | ((wi >> 24) & 0x000000FFL) );
@@ -61,5 +61,5 @@
 */
 
-long miconl(long wi)
+int32_t miconl(int32_t wi)
 {
 	return( ((wi << 24) & 0xFF000000L) | ((wi << 8) & 0x00FF0000L) |
Index: lib700/tolower.c
===================================================================
--- lib700/tolower.c	(revision 05806159f2593192d6ed2fca28358480a2383c67)
+++ lib700/tolower.c	(revision 7848656beb2903f579b69a9e8ae840577e026a94)
@@ -14,7 +14,7 @@
 */
 
-int tolower(int c)
+int16_t tolower(int16_t c)
 {
-	int	x;
+	int16_t	x;
 
 	if (isascii(c)) {
Index: lib700/toupper.c
===================================================================
--- lib700/toupper.c	(revision 05806159f2593192d6ed2fca28358480a2383c67)
+++ lib700/toupper.c	(revision 7848656beb2903f579b69a9e8ae840577e026a94)
@@ -14,7 +14,7 @@
 */
 
-int toupper(int c)
+int16_t toupper(int16_t c)
 {
-	int	x;
+	int16_t	x;
 
 	if (isascii(c)) {
