about summary refs log tree commit diff stats
path: root/WWW/Library/Implementation
diff options
context:
space:
mode:
Diffstat (limited to 'WWW/Library/Implementation')
-rw-r--r--WWW/Library/Implementation/HTAAProt.c7
-rw-r--r--WWW/Library/Implementation/HTAnchor.c8
-rw-r--r--WWW/Library/Implementation/HTFTP.c14
-rw-r--r--WWW/Library/Implementation/HTFile.c16
-rw-r--r--WWW/Library/Implementation/HTFinger.c4
-rw-r--r--WWW/Library/Implementation/HTFormat.c10
-rw-r--r--WWW/Library/Implementation/HTGopher.c14
-rw-r--r--WWW/Library/Implementation/HTGroup.c2
-rw-r--r--WWW/Library/Implementation/HTLex.c2
-rw-r--r--WWW/Library/Implementation/HTMIME.c14
-rw-r--r--WWW/Library/Implementation/HTMLDTD.c14
-rw-r--r--WWW/Library/Implementation/HTNews.c38
-rw-r--r--WWW/Library/Implementation/HTParse.c11
-rw-r--r--WWW/Library/Implementation/HTPlain.c4
-rw-r--r--WWW/Library/Implementation/HTRules.c8
-rw-r--r--WWW/Library/Implementation/HTString.c12
-rw-r--r--WWW/Library/Implementation/HTTCP.c39
-rw-r--r--WWW/Library/Implementation/HTTCP.h8
-rw-r--r--WWW/Library/Implementation/HTTP.c14
-rw-r--r--WWW/Library/Implementation/HTUtils.h17
-rw-r--r--WWW/Library/Implementation/HTWSRC.c4
-rw-r--r--WWW/Library/Implementation/SGML.c92
-rw-r--r--WWW/Library/Implementation/UCDefs.h3
-rw-r--r--WWW/Library/Implementation/crypt_util.c32
-rw-r--r--WWW/Library/Implementation/www_tcp.h14
25 files changed, 241 insertions, 160 deletions
diff --git a/WWW/Library/Implementation/HTAAProt.c b/WWW/Library/Implementation/HTAAProt.c
index cddfa1c4..4f231974 100644
--- a/WWW/Library/Implementation/HTAAProt.c
+++ b/WWW/Library/Implementation/HTAAProt.c
@@ -50,7 +50,7 @@ PRIVATE HTAAProt *current_prot	= NULL;	/* Current protection mode	*/
                                         /* from the rule system when	*/
                                         /* a "protect" rule is matched.	*/
 
-
+#ifndef NOUSERS
 /* PRIVATE							isNumber()
 **		DOES A CHARACTER STRING REPRESENT A NUMBER
 */
@@ -70,6 +70,7 @@ PRIVATE BOOL isNumber ARGS1(CONST char *, s)
     }
     return YES;
 }
+#endif /* !NOUSERS */
 
 
 #if defined (NOUSERS)
@@ -599,6 +600,7 @@ PRIVATE void clear_uidgid_cache NOARGS
 }
 #endif /* LY_FIND_LEAKS */
 
+#ifndef NOUSERS
 PRIVATE void save_gid_info ARGS2(char *, name, int, user)
 {
     USER_DATA *data = (USER_DATA *)calloc(1, sizeof(USER_DATA));
@@ -617,7 +619,9 @@ PRIVATE void save_gid_info ARGS2(char *, name, int, user)
     data->user = user;
     HTList_addObject (known_grp, data);
 }
+#endif /* NOUSERS */
 
+#ifndef NOUSERS
 PRIVATE void save_uid_info ARGS2(char *, name, int, user)
 {
     USER_DATA *data = (USER_DATA *)calloc(1, sizeof(USER_DATA));
@@ -636,6 +640,7 @@ PRIVATE void save_uid_info ARGS2(char *, name, int, user)
     data->user = user;
     HTList_addObject (known_pwd, data);
 }
+#endif /* !NOUSERS */
 
 /* PUBLIC                                                       HTAA_UidToName
 **              GET THE USER NAME
diff --git a/WWW/Library/Implementation/HTAnchor.c b/WWW/Library/Implementation/HTAnchor.c
index b2a911ed..8e9d0c61 100644
--- a/WWW/Library/Implementation/HTAnchor.c
+++ b/WWW/Library/Implementation/HTAnchor.c
@@ -165,9 +165,9 @@ PRIVATE BOOL HTIdentical ARGS2(
 		return(NO);
 	    }
 	}
-	return(*s == *t);
+	return (BOOL) (*s == *t);
     } else {
-	return(s == t); 	/* Two NULLs are identical, aren't they ? */
+	return (BOOL) (s == t);  /* Two NULLs are identical, aren't they ? */
     }
 }
 #endif /* CASE_INSENSITIVE_ANCHORS */
@@ -896,7 +896,7 @@ PUBLIC BOOL HTAnchor_isISMAPScript ARGS1(
 PUBLIC BOOL HTAnchor_hasChildren ARGS1(
 	HTParentAnchor *,	me)
 {
-    return( me ? ! HTList_isEmpty(me->children) : NO);
+    return (BOOL) ( me ? ! HTList_isEmpty(me->children) : NO);
 }
 
 #if defined(USE_HASH)
@@ -1086,7 +1086,7 @@ PUBLIC CONST char * HTAnchor_server ARGS1(
 PUBLIC BOOL HTAnchor_safe ARGS1(
 	HTParentAnchor *,	me)
 {
-    return( me ? me->safe : FALSE);
+    return (BOOL) ( me ? me->safe : FALSE);
 }
 
 /*	Content-Base header handling. - FM
diff --git a/WWW/Library/Implementation/HTFTP.c b/WWW/Library/Implementation/HTFTP.c
index 32349c8a..dbe05151 100644
--- a/WWW/Library/Implementation/HTFTP.c
+++ b/WWW/Library/Implementation/HTFTP.c
@@ -445,7 +445,7 @@ PRIVATE int response ARGS1(
 	char *p = response_text;
 	for (;;) {
 	    int ich = NEXT_CHAR;
-	    if (((*p++ = ich) == LF)
+	    if (((*p++ = (char) ich) == LF)
 			|| (p == &response_text[LINE_LENGTH])) {
 
 		char continuation;
@@ -1029,7 +1029,7 @@ PRIVATE int close_master_socket NOARGS
     int status;
 
     if (master_socket != -1)
-	FD_CLR(master_socket, &open_sockets);
+	FD_CLR( (unsigned) master_socket, &open_sockets);
     status = NETCLOSE(master_socket);
     CTRACE(tfp, "HTFTP: Closed master socket %d\n", master_socket);
     master_socket = -1;
@@ -1207,7 +1207,7 @@ PRIVATE int get_listen_socket NOARGS
     }
   }
     CTRACE(tfp, "TCP: Master socket(), bind() and listen() all OK\n");
-    FD_SET(master_socket, &open_sockets);
+    FD_SET( (unsigned) master_socket, &open_sockets);
     if ((master_socket+1) > num_sockets)
 	num_sockets = master_socket+1;
 
@@ -1416,7 +1416,7 @@ PRIVATE void parse_ls_line ARGS2(
 	char *,		line,
 	EntryInfo *,	entry_info)
 {
-    short  i, j;
+    int    i, j;
     int    base=1;
     int    size_num=0;
 
@@ -1629,8 +1629,8 @@ PRIVATE void parse_vms_dir_entry ARGS2(
 
 	/** Month **/
 	*(cpd+4) = '\0';
-	*(cpd+2) = TOLOWER(*(cpd+2));
-	*(cpd+3) = TOLOWER(*(cpd+3));
+	*(cpd+2) = (char) TOLOWER(*(cpd+2));
+	*(cpd+3) = (char) TOLOWER(*(cpd+3));
 	sprintf(date, "%s ", cpd+1);
 	*(cpd+4) = '-';
 
@@ -3038,7 +3038,7 @@ PUBLIC int HTFTPLoad ARGS4(
 	    format = HTFileFormat(filename, &encoding, NULL);
 	}
 	format = HTCharsetFormat(format, anchor, -1);
-	binary = (encoding != HTAtom_for("8bit") &&
+	binary = (BOOL) (encoding != HTAtom_for("8bit") &&
 		  encoding != HTAtom_for("7bit"));
 	if (!binary &&
 	    /*
diff --git a/WWW/Library/Implementation/HTFile.c b/WWW/Library/Implementation/HTFile.c
index 575e9e7f..0dfe68f3 100644
--- a/WWW/Library/Implementation/HTFile.c
+++ b/WWW/Library/Implementation/HTFile.c
@@ -199,10 +199,14 @@ PRIVATE void LYListFmtParse ARGS5(
 	char *buf = NULL;
 	char tmp[LY_MAXPATH];
 	char type;
+#ifndef _WINDOWS
 	char *name;
+#endif
 	time_t now;
 	char *datestr;
+#ifdef S_IFLNK
 	int len;
+#endif
 #define SEC_PER_YEAR	(60 * 60 * 24 * 365)
 
 #ifdef _WINDOWS	/* 1998/01/06 (Tue) 21:20:53 */
@@ -460,7 +464,7 @@ PUBLIC void HTSetSuffix5 ARGS5(
 	float,		value)
 {
     HTSuffix * suff;
-    BOOL trivial_enc = IsUnityEncStr(encoding);
+    BOOL trivial_enc = (BOOL) IsUnityEncStr(encoding);
 
     if (strcmp(suffix, "*") == 0)
 	suff = &no_suffix;
@@ -767,7 +771,7 @@ PUBLIC CONST char * HTFileSuffix ARGS2(
 	HTFileInit();
 #endif /* !NO_INIT */
 
-    trivial_enc = IsUnityEncStr(enc);
+    trivial_enc = (BOOL) IsUnityEncStr(enc);
     n = HTList_count(HTSuffixes);
     for (i = 0; i < n; i++) {
 	suff = (HTSuffix *)HTList_objectAt(HTSuffixes, i);
@@ -1024,15 +1028,15 @@ PUBLIC HTFormat HTCharsetFormat ARGS3(
 	    **  of match.
 	    */
 	    BOOL given_is_8859
-		= (!strncmp(cp4, "iso-8859-", 9) &&
+		= (BOOL) (!strncmp(cp4, "iso-8859-", 9) &&
 		   isdigit((unsigned char)cp4[9]));
 	    BOOL given_is_8859like
-		= (given_is_8859 ||
+		= (BOOL) (given_is_8859 ||
 		   !strncmp(cp4, "windows-", 8) ||
 		   !strncmp(cp4, "cp12", 4) ||
 		   !strncmp(cp4, "cp-12", 5));
 	    BOOL given_and_display_8859like
-		= (given_is_8859like &&
+		= (BOOL) (given_is_8859like &&
 		   (strstr(LYchar_set_names[current_char_set],
 			   "ISO-8859") ||
 		    strstr(LYchar_set_names[current_char_set],
@@ -1589,7 +1593,7 @@ PRIVATE int print_local_dir ARGS5(
 
     { int i;
 	   for (i = 0; i < HTML_A_ATTRIBUTES; i++)
-		   present[i] = (i == HTML_A_HREF);
+		   present[i] = (BOOL) (i == HTML_A_HREF);
     }
 
     /*
diff --git a/WWW/Library/Implementation/HTFinger.c b/WWW/Library/Implementation/HTFinger.c
index 08f9763e..e6e9699b 100644
--- a/WWW/Library/Implementation/HTFinger.c
+++ b/WWW/Library/Implementation/HTFinger.c
@@ -86,7 +86,7 @@ PRIVATE void start_anchor ARGS1(CONST char *,  href)
     {
 	int i;
 	for(i=0; i<HTML_A_ATTRIBUTES; i++)
-	    present[i] = (i==HTML_A_HREF);
+	    present[i] = (BOOL) (i==HTML_A_HREF);
     }
     ((CONST char **)value)[HTML_A_HREF] = href;
     (*targetClass.start_element)(target, HTML_A, present,
@@ -191,7 +191,7 @@ PRIVATE int response ARGS5(
 	}
 
 	if (ch != LF) {
-	    *p = ch;		/* Put character in line */
+	    *p = (char) ch;      /* Put character in line */
 	    if (p < &line[BIG-1]) {
 		p++;
 	    }
diff --git a/WWW/Library/Implementation/HTFormat.c b/WWW/Library/Implementation/HTFormat.c
index f44bd543..72b7838f 100644
--- a/WWW/Library/Implementation/HTFormat.c
+++ b/WWW/Library/Implementation/HTFormat.c
@@ -599,7 +599,7 @@ PUBLIC int HTCopy ARGS4(
 #ifdef _WINDOWS	/* 1997/11/11 (Tue) 15:18:16 */
     long file_length;
     extern int bytes_already_read;
-    
+
     file_length = anchor->content_length;
 #endif
 
@@ -647,7 +647,7 @@ PUBLIC int HTCopy ARGS4(
 		goto finished;
 	    } else if (SOCKET_ERRNO == ENOTCONN ||
 #ifdef _WINDOWS	/* 1997/11/10 (Mon) 16:57:18 */
-		       SOCKET_ERRNO == ETIMEDOUT || 
+		       SOCKET_ERRNO == ETIMEDOUT ||
 #endif
 		       SOCKET_ERRNO == ECONNRESET ||
 		       SOCKET_ERRNO == EPIPE) {
@@ -965,7 +965,7 @@ PUBLIC void HTCopyNoCR ARGS3(
 	HTStream*,		sink)
 {
     HTStreamClass targetClass;
-    char character;
+    int character;
 
     /*	Push the data, ignoring CRLF, down the stream
     */
@@ -979,7 +979,7 @@ PUBLIC void HTCopyNoCR ARGS3(
     HTInitInput(file_number);
     for (;;) {
 	character = HTGetCharacter();
-	if (character == (char)EOF)
+	if (character == EOF)
 	    break;
 	(*targetClass.put_character)(sink, character);
     }
@@ -1289,7 +1289,7 @@ PRIVATE void NetToText_put_character ARGS2(HTStream *, me, char, net_char)
 	    me->sink->isa->put_character(me->sink, CR); /* leftover */
 	}
     }
-    me->had_cr = (c == CR);
+    me->had_cr = (BOOL) (c == CR);
     if (!me->had_cr)
 	me->sink->isa->put_character(me->sink, c);		/* normal */
 }
diff --git a/WWW/Library/Implementation/HTGopher.c b/WWW/Library/Implementation/HTGopher.c
index 02a83057..42c0760c 100644
--- a/WWW/Library/Implementation/HTGopher.c
+++ b/WWW/Library/Implementation/HTGopher.c
@@ -158,10 +158,10 @@ PRIVATE CONST char hex[17] = "0123456789abcdef";
 
 PRIVATE char from_hex ARGS1(char, c)
 {
-    return		  (c>='0')&&(c<='9') ? c-'0'
+    return (char) (       (c>='0')&&(c<='9') ? c-'0'
 			: (c>='A')&&(c<='F') ? c-'A'+10
 			: (c>='a')&&(c<='f') ? c-'a'+10
-			:		       0;
+			:		       0);
 }
 
 /*	Paste in an Anchor
@@ -256,7 +256,7 @@ PRIVATE void parse_menu ARGS2(
 	}
 
 	if ((char)ich != LF) {
-	    *p = ich;		/* Put character in line */
+	    *p = (char) ich;    /* Put character in line */
 	    if (p< &line[BIG-1]) p++;
 
 	} else {
@@ -497,7 +497,7 @@ PRIVATE void parse_cso ARGS2(
 	{
 	    if ((char)ich != LF)
 		{
-		    *p = ich;		/* Put character in line */
+		    *p = (char) ich;    /* Put character in line */
 		    if (p< &line[BIG-1]) p++;
 		}
 	    else
@@ -708,7 +708,7 @@ PRIVATE void de_escape ARGS2(char *, command, CONST char *, selector)
 	    b =   from_hex(c);
 	    c = *p++;
 	    if (!c) break;	/* Odd number of chars! */
-	    *q++ = FROMASCII((b<<4) + from_hex(c));
+	    *q++ = (char) FROMASCII((b<<4) + from_hex(c));
 	} else {
 	    *q++ = *p++;	/* Record */
 	}
@@ -947,7 +947,7 @@ PRIVATE int parse_cso_fields ARGS2(
 	}
 
 	if ((char)ich != LF) {
-	    *p = ich;		/* Put character in buffer */
+	    *p = (char) ich;    /* Put character in buffer */
 	    if (p < &buf[size-1]) {
 		p++;
 	    }
@@ -1243,7 +1243,7 @@ PRIVATE int generate_cso_report ARGS1(
 	}
 
 	if ((char)ich != LF) {
-	    *p = ich;		/* Put character in line */
+	    *p = (char) ich;    /* Put character in line */
 	    if (p < &line[BIG-1]) {
 		p++;
 	    }
diff --git a/WWW/Library/Implementation/HTGroup.c b/WWW/Library/Implementation/HTGroup.c
index 490699d3..b3a30861 100644
--- a/WWW/Library/Implementation/HTGroup.c
+++ b/WWW/Library/Implementation/HTGroup.c
@@ -78,7 +78,7 @@ PRIVATE void syntax_error ARGS3(FILE *,	 fp,
     int ch;
 
     while ((ch = getc(fp)) != EOF  &&  ch != '\n')
-	if (cnt < 40) buffer[cnt++] = ch;
+	if (cnt < 40) buffer[cnt++] = (char) ch;
     buffer[cnt] = (char)0;
 
     CTRACE(tfp, "%s %d before: '%s'\nHTGroup.c: %s (got %s)\n",
diff --git a/WWW/Library/Implementation/HTLex.c b/WWW/Library/Implementation/HTLex.c
index 59901fb3..64b113d8 100644
--- a/WWW/Library/Implementation/HTLex.c
+++ b/WWW/Library/Implementation/HTLex.c
@@ -89,7 +89,7 @@ PUBLIC LexItem lex ARGS1(FILE *, fp)
 	    }
 	    break;
 	  default:
-	    HTlex_buffer[lex_cnt++] = ch;
+	    HTlex_buffer[lex_cnt++] = (char) ch;
 	    HTlex_buffer[lex_cnt] = '\0';
 	    if ('*' == ch) lex_template = YES;
 	} /* switch ch */
diff --git a/WWW/Library/Implementation/HTMIME.c b/WWW/Library/Implementation/HTMIME.c
index 24b42194..f21ae35e 100644
--- a/WWW/Library/Implementation/HTMIME.c
+++ b/WWW/Library/Implementation/HTMIME.c
@@ -435,15 +435,15 @@ PRIVATE void HTMIME_put_character ARGS2(
 				**  of match.
 				*/
 				BOOL given_is_8859
-				    = (!strncmp(cp4, "iso-8859-", 9) &&
+				    = (BOOL) (!strncmp(cp4, "iso-8859-", 9) &&
 				       isdigit((unsigned char)cp4[9]));
 				BOOL given_is_8859like
-				    = (given_is_8859 ||
+				    = (BOOL) (given_is_8859 ||
 				       !strncmp(cp4, "windows-", 8) ||
 				       !strncmp(cp4, "cp12", 4) ||
 				       !strncmp(cp4, "cp-12", 5));
 				BOOL given_and_display_8859like
-				    = (given_is_8859like &&
+				    = (BOOL) (given_is_8859like &&
 				       (strstr(LYchar_set_names[current_char_set],
 					       "ISO-8859") ||
 					strstr(LYchar_set_names[current_char_set],
@@ -1451,7 +1451,7 @@ PRIVATE void HTMIME_put_character ARGS2(
 		*/
 		for (i = 0, j = 0; me->value[i]; i++) {
 		    if (me->value[i] != ' ' && me->value[i] != '\"') {
-			me->value[j++] = TOLOWER(me->value[i]);
+			me->value[j++] = (char) TOLOWER(me->value[i]);
 		    }
 		}
 		me->value[j] = '\0';
@@ -1918,7 +1918,7 @@ PUBLIC void HTmmdec_base64 ARGS2(
 		val += d;
 	}
 	for (j = 2; j >= 0; j--) {
-		nw[j] = val & 255;
+		nw[j] = (char) (val & 255);
 		val >>= 8;
 	}
 	if (count--)
@@ -1942,14 +1942,14 @@ PUBLIC void HTmmdec_quote ARGS2(
 	if (*s == '=') {
 	    cval = 0;
 	    if (s[1] && (p = strchr(HTmmquote, s[1]))) {
-		cval += (p - HTmmquote);
+		cval += (char) (p - HTmmquote);
 	    } else {
 		*bp++ = *s++;
 		continue;
 	    }
 	    if (s[2] && (p = strchr(HTmmquote, s[2]))) {
 		cval <<= 4;
-		cval += (p - HTmmquote);
+		cval += (char) (p - HTmmquote);
 		*bp++ = cval;
 		s += 3;
 	    } else {
diff --git a/WWW/Library/Implementation/HTMLDTD.c b/WWW/Library/Implementation/HTMLDTD.c
index 878c573e..698c765f 100644
--- a/WWW/Library/Implementation/HTMLDTD.c
+++ b/WWW/Library/Implementation/HTMLDTD.c
@@ -1212,17 +1212,17 @@ static attr ulist_attr[] = {			/* UL attributes */
  /* { "FRAMESET", frameset_attr,HTML_FRAMESET_ATTRIBUTES, SGML_MIXED }, */
 #define T_FRAMESET	0x10000,0x90000,0x90000,0x90000,0x93000,0x9FFFF,0x00000
  /* { "H1"	, h_attr,	HTML_H_ATTRIBUTES,	SGML_MIXED }, */
-#define T_H1		0x0100, 0x0B04F,0x0B05F,0x36680,0x37FAF,0x80317,0x00000
+#define T_H1		0x0100, 0x0B04F,0x0B05F,0x36680,0x37FAF,0x80117,0x00000
  /* { "H2"	, h_attr,	HTML_H_ATTRIBUTES,	SGML_MIXED }, */
-#define T_H2		0x0100, 0x0B04F,0x0B05F,0x36680,0x37FAF,0x80317,0x00000
+#define T_H2		0x0100, 0x0B04F,0x0B05F,0x36680,0x37FAF,0x80117,0x00000
  /* { "H3"	, h_attr,	HTML_H_ATTRIBUTES,	SGML_MIXED }, */
-#define T_H3		0x0100, 0x0B04F,0x0B05F,0x36680,0x37FAF,0x80317,0x00000
+#define T_H3		0x0100, 0x0B04F,0x0B05F,0x36680,0x37FAF,0x80117,0x00000
  /* { "H4"	, h_attr,	HTML_H_ATTRIBUTES,	SGML_MIXED }, */
-#define T_H4		0x0100, 0x0B04F,0x0B05F,0x36680,0x37FAF,0x80317,0x00000
+#define T_H4		0x0100, 0x0B04F,0x0B05F,0x36680,0x37FAF,0x80117,0x00000
  /* { "H5"	, h_attr,	HTML_H_ATTRIBUTES,	SGML_MIXED }, */
-#define T_H5		0x0100, 0x0B04F,0x0B05F,0x36680,0x37FAF,0x80317,0x00000
+#define T_H5		0x0100, 0x0B04F,0x0B05F,0x36680,0x37FAF,0x80117,0x00000
  /* { "H6"	, h_attr,	HTML_H_ATTRIBUTES,	SGML_MIXED }, */
-#define T_H6		0x0100, 0x0B04F,0x0B05F,0x36680,0x37FAF,0x80317,0x00000
+#define T_H6		0x0100, 0x0B04F,0x0B05F,0x36680,0x37FAF,0x80117,0x00000
  /* { "HEAD"	, gen_attr,	HTML_GEN_ATTRIBUTES,	SGML_MIXED }, */
 #define T_HEAD		0x40000,0x4F000,0x47000,0x10000,0x10000,0x9FF7F,0x00006
  /* { "HR"	, hr_attr,	HTML_HR_ATTRIBUTES,	SGML_EMPTY }, */
@@ -1493,7 +1493,7 @@ static CONST HTTag tags_old[HTML_ELEMENTS] = {
  { P("TFOOT")	, tr_attr,	HTML_TR_ATTRIBUTES,	SGML_EMPTY,T_TFOOT},
  { P("TH")	, td_attr,	HTML_TD_ATTRIBUTES,	SGML_EMPTY,T_TH},
  { P("THEAD")	, tr_attr,	HTML_TR_ATTRIBUTES,	SGML_EMPTY,T_THEAD},
- { P("TITLE"),	  gen_attr,	HTML_GEN_ATTRIBUTES,	SGML_RCDATA,T_TITLE},
+ { P("TITLE")	, gen_attr,	HTML_GEN_ATTRIBUTES,	SGML_RCDATA,T_TITLE},
  { P("TR")	, tr_attr,	HTML_TR_ATTRIBUTES,	SGML_EMPTY,T_TR},
  { P("TT")	, gen_attr,	HTML_GEN_ATTRIBUTES,	SGML_EMPTY,T_TT},
  { P("U")	, gen_attr,	HTML_GEN_ATTRIBUTES,	SGML_EMPTY,T_U},
diff --git a/WWW/Library/Implementation/HTNews.c b/WWW/Library/Implementation/HTNews.c
index 3719d2ff..d00435b9 100644
--- a/WWW/Library/Implementation/HTNews.c
+++ b/WWW/Library/Implementation/HTNews.c
@@ -262,7 +262,7 @@ PRIVATE int response ARGS1(CONST char *,command)
 
     for (;;) {
 	ich = NEXT_CHAR;
-	if (((*p++ = ich) == LF) ||
+	if (((*p++ = (char) ich) == LF) ||
 	    (p == &response_text[LINE_LENGTH])) {
 	    *--p = '\0';			/* Terminate the string */
 	    CTRACE(tfp, "NNTP Response: %s\n", response_text);
@@ -653,7 +653,7 @@ PRIVATE void start_anchor ARGS1(CONST char *,  href)
     {
 	int i;
 	for(i=0; i < HTML_A_ATTRIBUTES; i++)
-	    present[i] = (i == HTML_A_HREF);
+	    present[i] = (BOOL) (i == HTML_A_HREF);
     }
     ((CONST char **)value)[HTML_A_HREF] = href;
     (*targetClass.start_element)(target, HTML_A , present,
@@ -671,7 +671,7 @@ PRIVATE void start_link ARGS2(CONST char *,  href, CONST char *, rev)
     {
 	int i;
 	for(i=0; i < HTML_LINK_ATTRIBUTES; i++)
-	    present[i] = (i == HTML_LINK_HREF || i == HTML_LINK_REV);
+	    present[i] = (BOOL) (i == HTML_LINK_HREF || i == HTML_LINK_REV);
     }
     ((CONST char **)value)[HTML_LINK_HREF] = href;
     ((CONST char **)value)[HTML_LINK_REV]  = rev;
@@ -690,7 +690,7 @@ PRIVATE void start_list ARGS1(int, seqnum)
     int i;
 
     for (i = 0; i < HTML_OL_ATTRIBUTES; i++)
-	present[i] = (i == HTML_OL_SEQNUM || i == HTML_OL_START);
+	present[i] = (BOOL) (i == HTML_OL_SEQNUM || i == HTML_OL_START);
     sprintf(SeqNum, "%d", seqnum);
     ((CONST char **)value)[HTML_OL_SEQNUM] = SeqNum;
     ((CONST char **)value)[HTML_OL_START]  = SeqNum;
@@ -958,7 +958,7 @@ void debug_print(unsigned char *p)
 	   printf("[ESC]");
 	else if (*p == '\n')
 	   printf("[NL]");
-	else if (*p < ' ' || *p >= 0x80) 
+	else if (*p < ' ' || *p >= 0x80)
 	   printf("(%02x)", *p);
 	else
 	   putchar(*p);
@@ -1061,7 +1061,7 @@ PRIVATE int read_article ARGS1(
     if (!diagnostic && !rawtext) {
 	while (!done) {
 	    int ich = NEXT_CHAR;
-	    *p++ = ich;
+	    *p++ = (char) ich;
 	    if (ich == EOF) {
 		if (interrupted_in_htgetcharacter) {
 		    interrupted_in_htgetcharacter = 0;
@@ -1391,7 +1391,7 @@ PRIVATE int read_article ARGS1(
     p = line;
     while (!done) {
 	int ich = NEXT_CHAR;
-	*p++ = ich;
+	*p++ = (char) ich;
 	if (ich == EOF) {
 	    if (interrupted_in_htgetcharacter) {
 		interrupted_in_htgetcharacter = 0;
@@ -1599,7 +1599,7 @@ PRIVATE int read_list ARGS1(char *, arg)
     PUTC('\n');
     while (!done) {
 	int ich = NEXT_CHAR;
-	char ch = ich;
+	char ch = (char) ich;
 	if (ich == EOF) {
 	    if (interrupted_in_htgetcharacter) {
 		interrupted_in_htgetcharacter = 0;
@@ -1929,7 +1929,7 @@ PRIVATE int read_group ARGS3(
 		done = NO;
 		while( !done ) {
 		    int ich = NEXT_CHAR;
-		    *p++ = ich;
+		    *p++ = (char) ich;
 		    if (ich == EOF) {
 			if (interrupted_in_htgetcharacter) {
 			    interrupted_in_htgetcharacter = 0;
@@ -1954,7 +1954,7 @@ PRIVATE int read_group ARGS3(
 			    /*
 			    **	End of article?
 			    */
-			    done = ((unsigned char)line[1] < ' ');
+			    done = (BOOL) ((unsigned char)line[1] < ' ');
 			    break;
 
 			case 'S':
@@ -2181,21 +2181,21 @@ PRIVATE int HTLoadNews ARGS4(
 	**	xxxxx			News group (no "@")
 	**	group/n1-n2		Articles n1 to n2 in group
 	*/
-	spost_wanted = (strstr(arg, "snewspost:") != NULL);
-	sreply_wanted = (!(spost_wanted) &&
+	spost_wanted = (BOOL) (strstr(arg, "snewspost:") != NULL);
+	sreply_wanted = (BOOL) (!(spost_wanted) &&
 			 strstr(arg, "snewsreply:") != NULL);
-	post_wanted = (!(spost_wanted || sreply_wanted) &&
+	post_wanted = (BOOL) (!(spost_wanted || sreply_wanted) &&
 			strstr(arg, "newspost:") != NULL);
-	reply_wanted = (!(spost_wanted || sreply_wanted ||
+	reply_wanted = (BOOL) (!(spost_wanted || sreply_wanted ||
 			  post_wanted) &&
 			strstr(arg, "newsreply:") != NULL);
-	group_wanted = (!(spost_wanted || sreply_wanted ||
+	group_wanted = (BOOL) ((!(spost_wanted || sreply_wanted ||
 			  post_wanted || reply_wanted) &&
-			strchr(arg, '@') == NULL) && (strchr(arg, '*') == NULL);
-	list_wanted  = (!(spost_wanted || sreply_wanted ||
+			strchr(arg, '@') == NULL) && (strchr(arg, '*') == NULL));
+	list_wanted  = (BOOL) ((!(spost_wanted || sreply_wanted ||
 			  post_wanted || reply_wanted ||
 			  group_wanted) &&
-			strchr(arg, '@') == NULL) && (strchr(arg, '*') != NULL);
+			strchr(arg, '@') == NULL) && (strchr(arg, '*') != NULL));
 
 	if (!strncasecomp(arg, "snewspost:", 10) ||
 	    !strncasecomp(arg, "snewsreply:", 11)) {
@@ -2457,7 +2457,7 @@ PRIVATE int HTLoadNews ARGS4(
 		if ((*cp = *(cp + 3)) == '\0')
 		    break;
 	}
-	rawtext = (head_wanted || keep_mime_headers);
+	rawtext = (BOOL) (head_wanted || keep_mime_headers);
     }
     if (rawtext) {
 	node_anchor = anAnchor;
diff --git a/WWW/Library/Implementation/HTParse.c b/WWW/Library/Implementation/HTParse.c
index 1122d3a1..e4d6496b 100644
--- a/WWW/Library/Implementation/HTParse.c
+++ b/WWW/Library/Implementation/HTParse.c
@@ -777,9 +777,9 @@ PUBLIC char * HTEscapeSP ARGS2(
 PRIVATE char from_hex ARGS1(
 	char,		c)
 {
-    return  c >= '0' && c <= '9' ?  c - '0'
+    return (char) ( c >= '0' && c <= '9' ?  c - '0'
 	    : c >= 'A' && c <= 'F'? c - 'A' + 10
-	    : c - 'a' + 10;	/* accept small letters just in case */
+	    : c - 'a' + 10);     /* accept small letters just in case */
 }
 
 PUBLIC char * HTUnEscape ARGS1(
@@ -804,12 +804,12 @@ PUBLIC char * HTUnEscape ARGS1(
 	      } else {
 		p++;
 		if (*p)
-		    *q = from_hex(*p++) * 16;
+		    *q = (char) (from_hex(*p++) * 16);
 		if (*p) {
 		    /*
 		    ** Careful! FROMASCII() may evaluate its arg more than once!
 		    */  /* S/390 -- gil -- 0221 */
-		    *q = *q + from_hex(*p++) ;
+		    *q = (char) (*q + from_hex(*p++));
 		}
 		*q = FROMASCII(*q);
 		q++;
@@ -850,7 +850,8 @@ PUBLIC char * HTUnEscapeSome ARGS2(
 	    p[1] && p[2] &&	/* tests shouldn't be needed, but.. */
 	    isxdigit((unsigned char)p[1]) &&
 	    isxdigit((unsigned char)p[2]) &&
-	    (testcode = FROMASCII(from_hex(p[1])*16 + from_hex(p[2]))) && /* %00 no good*/
+	    (testcode = (char) FROMASCII(from_hex(p[1])*16 +
+		from_hex(p[2]))) && /* %00 no good*/
 	    strchr(do_trans, testcode)) { /* it's one of the ones we want */
 	    *q++ = testcode;
 	    p += 3;
diff --git a/WWW/Library/Implementation/HTPlain.c b/WWW/Library/Implementation/HTPlain.c
index a1a8a136..26d11f4c 100644
--- a/WWW/Library/Implementation/HTPlain.c
+++ b/WWW/Library/Implementation/HTPlain.c
@@ -478,7 +478,7 @@ PRIVATE void HTPlain_write ARGS3(HTStream *, me, CONST char*, s, int, l)
 /******************************************************************
  *   I. LATIN-1 OR UCS2  TO  DISPLAY CHARSET
  ******************************************************************/
-	} else if ((chk = (me->T.trans_from_uni && code >= 160)) &&
+	} else if ((chk = (BOOL) (me->T.trans_from_uni && code >= 160)) &&
 		   (uck = UCTransUniChar(code,
 					 me->outUCLYhndl)) >= ' ' &&  /* S/390 -- gil -- 0464 */
 		   uck < 256) {
@@ -542,7 +542,7 @@ PRIVATE void HTPlain_write ARGS3(HTStream *, me, CONST char*, s, int, l)
 	    **	seek a translation for that.  Otherwise, or if the
 	    **	translation fails, use UHHH notation. - FM
 	    */
-	    if ((chk = (me->outUCLYhndl !=
+	    if ((chk = (BOOL) (me->outUCLYhndl !=
 			UCGetLYhndl_byMIME("us-ascii"))) &&
 		   (uck = UCTransUniChar(code,
 					 UCGetLYhndl_byMIME("us-ascii")))
diff --git a/WWW/Library/Implementation/HTRules.c b/WWW/Library/Implementation/HTRules.c
index 53945fe0..828d9f67 100644
--- a/WWW/Library/Implementation/HTRules.c
+++ b/WWW/Library/Implementation/HTRules.c
@@ -177,7 +177,7 @@ PRIVATE BOOL rule_cond_ok ARGS1(
 	return NO;
     }
     if (!strcmp(r->condition, "redirected"))
-	result = (redirection_attempts > 0);
+	result = (BOOL) (redirection_attempts > 0);
     else if (!strcmp(r->condition, "userspec"))
 	result = LYUserSpecifiedURL;
     else {
@@ -188,7 +188,7 @@ PRIVATE BOOL rule_cond_ok ARGS1(
     if (!strcmp(r->condition_op, "if"))
 	return result;
     else
-	return (!result);
+	return (BOOL) (!result);
 
 }
 /*	Translate by rules					HTTranslate()
@@ -369,14 +369,14 @@ char * HTTranslate ARGS1(
 		    CTRACE(tfp, "HTRule: ...and redirect to `%s'\n",
 				current);
 		    redirecting_url = current;
-		    HTPermitRedir = (permitredir_flag == 1);
+		    HTPermitRedir = (BOOL) (permitredir_flag == 1);
 		    return (char *)0;
 		} else if (r->op == HT_RedirectPerm) {
 		    CTRACE(tfp, "HTRule: ...and redirect like 301 to `%s'\n",
 				current);
 		    redirecting_url = current;
 		    permanent_redirection = TRUE;
-		    HTPermitRedir = (permitredir_flag == 1);
+		    HTPermitRedir = (BOOL) (permitredir_flag == 1);
 		    return (char *)0;
 		}
 		break;
diff --git a/WWW/Library/Implementation/HTString.c b/WWW/Library/Implementation/HTString.c
index aecebf34..89412e39 100644
--- a/WWW/Library/Implementation/HTString.c
+++ b/WWW/Library/Implementation/HTString.c
@@ -390,9 +390,9 @@ PUBLIC char * HTNextTok ARGS4(
     if (!delims) delims = " ;,=" ;
     if (!bracks) bracks = "<\"" ;
 
-    get_blanks = (!strchr(delims,' ') && !strchr(bracks,' '));
-    get_comments = (strchr(bracks,'(') != NULL);
-    skip_comments = (!get_comments && !strchr(delims,'(') && !get_blanks);
+    get_blanks = (BOOL) (!strchr(delims,' ') && !strchr(bracks,' '));
+    get_comments = (BOOL) (strchr(bracks,'(') != NULL);
+    skip_comments = (BOOL) (!get_comments && !strchr(delims,'(') && !get_blanks);
 #define skipWHITE(c) (!get_blanks && WHITE(c))
 
     while (*p && skipWHITE(*p))
@@ -430,7 +430,7 @@ PUBLIC char * HTNextTok ARGS4(
 		if (!*p || (!strchr(bracks,*p) && strchr(delims,*p))) {
 		    break;
 		} else
-		    get_closing_char_too = (strchr(bracks,*p) != NULL);
+		    get_closing_char_too = (BOOL) (strchr(bracks,*p) != NULL);
 	    }
 	} else if (strchr(bracks,*p)) {        /* quoted or bracketted field */
 	    switch (*p) {
@@ -448,7 +448,7 @@ PUBLIC char * HTNextTok ARGS4(
 		if (!*p || (!strchr(bracks,*p) && strchr(delims,*p))) {
 		    break;
 		} else
-		    get_closing_char_too = (strchr(bracks,*p) != NULL);
+		    get_closing_char_too = (BOOL) (strchr(bracks,*p) != NULL);
 	    } else
 	    break;			    /* kr95-10-9: needs to stop here */
 #if 0
@@ -922,7 +922,9 @@ PUBLIC void HTAddParam ARGS4(
     if (number > 0) {
 	CONST char *last = HTAfterCommandArg(command, number - 1);
 	CONST char *next = last;
+#if USE_QUOTED_PARAMETER
 	char *quoted;
+#endif
 
 	if (number <= 1) {
 	    FREE(*result);
diff --git a/WWW/Library/Implementation/HTTCP.c b/WWW/Library/Implementation/HTTCP.c
index 46c85034..db1dd375 100644
--- a/WWW/Library/Implementation/HTTCP.c
+++ b/WWW/Library/Implementation/HTTCP.c
@@ -32,6 +32,10 @@
 #include <resolv.h>
 #endif
 
+#if defined(__DJGPP__) && defined (WATT32)
+#include <netdb.h>
+#endif /* __DJGPP__ */
+
 #define OK_HOST(p) ((p) != 0 && ((p)->h_length) != 0)
 
 #ifdef SVR4_BSDSELECT
@@ -359,7 +363,7 @@ PUBLIC BOOL valid_hostname ARGS1(
 	    return NO;
 	}
     }
-    return (*cp == '\0' || (*cp == '.' && iseg != 0 && cp[1] == '\0'));
+    return (BOOL) (*cp == '\0' || (*cp == '.' && iseg != 0 && cp[1] == '\0'));
 }
 
 #ifdef NSL_FORK
@@ -377,7 +381,7 @@ PRIVATE void quench ARGS1(
 
 PUBLIC int lynx_nsl_status = HT_OK;
 
-#ifndef DJGPP			/* much excluded! */
+#if !( defined(__DJGPP__) && !defined(WATT32) )    /* much excluded! */
 
 #define DEBUG_HOSTENT		/* disable in case of problems */
 #define DEBUG_HOSTENT_CHILD  /* for NSL_FORK, may screw up trace file */
@@ -1074,11 +1078,6 @@ PUBLIC struct hostent * LYGetHostByName ARGS1(
 
 #ifdef _WINDOWS_NSL
     {
-	char buff[256];
-	LPSTR szIPAddr;	/* IP address as a dotted decimal string */
-	IN_ADDR addr;
-	IN_ADDR *p;
-
 	HANDLE hThread, dwThreadID;
 
 	if (!system_is_NT) {	/* for Windows9x */
@@ -1151,7 +1150,7 @@ failed:
     return NULL;
 }
 
-#endif /* from here on DJGPP joins us again. */
+#endif /* from here on DJGPP without WATT32 joins us again. */
 
 
 /*	Parse a network node address and port
@@ -1248,7 +1247,7 @@ PUBLIC int HTParseInet ARGS2(
     */
     if (dotcount_ip == 3) {   /* Numeric node address: */
 
-#ifdef DJGPP
+#if defined(__DJGPP__) && !defined(WATT32)
 	soc_in->sin_addr.s_addr = htonl(aton(host));
 #else
 #ifdef DGUX_OLD
@@ -1270,7 +1269,7 @@ PUBLIC int HTParseInet ARGS2(
 #endif /* HAVE_INET_ATON */
 #endif /* GUSI */
 #endif /* DGUX_OLD */
-#endif /* DJGPP */
+#endif /* __DJGPP__ && !WATT32 */
 #ifndef _WINDOWS_NSL
 	FREE(host);
 #endif /* _WINDOWS_NSL */
@@ -1280,7 +1279,7 @@ PUBLIC int HTParseInet ARGS2(
 	CTRACE(tfp, "HTParseInet: Calling LYGetHostByName(%s)\n", host);
 #endif /* MVS */
 
-#ifdef DJGPP
+#if defined(__DJGPP__) && !defined(WATT32)
 	if (!valid_hostname(host)) {
 	    FREE(host);
 	    return HT_NOT_ACCEPTABLE; /* only HTDoConnect checks this. */
@@ -1289,12 +1288,12 @@ PUBLIC int HTParseInet ARGS2(
 	if (soc_in->sin_addr.s_addr == 0) {
 	    goto failed;
 	}
-#else /* !DJGPP: */
+#else /* !(__DJGPP__ && !WATT32) */
 #ifdef _WINDOWS_NSL
 	phost = LYGetHostByName(host);	/* See above */
 	if (!phost) goto failed;
 	memcpy((void *)&soc_in->sin_addr, phost->h_addr, phost->h_length);
-#else /* !DJGPP, !_WINDOWS_NSL: */
+#else /* !(__DJGPP__ && !WATT32) && !_WINDOWS_NSL */
 	{
 	    struct hostent  *phost;
 	    phost = LYGetHostByName(host);	/* See above */
@@ -1318,8 +1317,8 @@ PUBLIC int HTParseInet ARGS2(
 	    memcpy((void *)&soc_in->sin_addr, phost->h_addr, phost->h_length);
 #endif /* VMS && CMU_TCP */
 	}
-#endif /* !DJGPP, !_WINDOWS_NSL */
-#endif /* !DJGPP */
+#endif /* _WINDOWS_NSL */
+#endif /* __DJGPP__ && !WATT32 */
 #ifndef _WINDOWS_NSL
 	FREE(host);
 #endif /* _WINDOWS_NSL */
@@ -1432,7 +1431,7 @@ PUBLIC CONST char * HTHostName NOARGS
 #endif  /* UCX && VAXC */
 #endif /* MULTINET */
 /*
-**  Interruptable connect as implemented for Mosaic by Marc Andreesen
+**  Interruptible connect as implemented for Mosaic by Marc Andreesen
 **  and hacked in for Lynx years ago by Lou Montulli, and further
 **  modified over the years by numerous Lynx lovers. - FM
 */
@@ -1544,7 +1543,7 @@ PUBLIC int HTDoConnect ARGS4(
     } else
 #endif /* SOCKS */
     status = connect(*s, (struct sockaddr*)&soc_address, sizeof(soc_address));
-#ifndef DJGPP
+#ifndef __DJGPP__
     /*
     **	According to the Sun man page for connect:
     **	   EINPROGRESS	       The socket is non-blocking and the  con-
@@ -1595,7 +1594,7 @@ PUBLIC int HTDoConnect ARGS4(
 #endif /* _WINDOWS_NSL */
 	    timeout.tv_usec = 100000;
 	    FD_ZERO(&writefds);
-	    FD_SET(*s, &writefds);
+	    FD_SET((unsigned) *s, &writefds);
 #ifdef SOCKS
 	    if (socks_flag)
 		ret = Rselect(FD_SETSIZE, NULL,
@@ -1735,7 +1734,7 @@ PUBLIC int HTDoConnect ARGS4(
 	    errno = saved_errno;	/* I don't trust HTInetStatus */
     }
 #endif /* SOCKET_DEBUG_TRACE */
-#endif /* !DJGPP */
+#endif /* !__DJGPP__ */
     if (status < 0) {
 	/*
 	**  The connect attempt failed or was interrupted,
@@ -1847,7 +1846,7 @@ PUBLIC int HTDoRead ARGS3(
 	    timeout.tv_sec = 0;
 	    timeout.tv_usec = 100000;
 	    FD_ZERO(&readfds);
-	    FD_SET(fildes, &readfds);
+	    FD_SET((unsigned)fildes, &readfds);
 #ifdef SOCKS
 	    if (socks_flag)
 		ret = Rselect(FD_SETSIZE,
diff --git a/WWW/Library/Implementation/HTTCP.h b/WWW/Library/Implementation/HTTCP.h
index d22cac8d..589e16ef 100644
--- a/WWW/Library/Implementation/HTTCP.h
+++ b/WWW/Library/Implementation/HTTCP.h
@@ -10,7 +10,7 @@
 #ifndef HTUTILS_H
 #include <HTUtils.h>
 #endif
- 
+
 /*      Produce a string for an internet address
 **      ---------------------------------------
 **
@@ -86,10 +86,12 @@ extern BOOL valid_hostname PARAMS((CONST char * name));
 */
 extern int lynx_nsl_status;
 
-#ifndef DJGPP
+#if defined(__DJGPP__) && !defined(WATT32)
+#define LYGetHostByName(host) resolv(host) /* we'll use it the same way */
+#else
 extern struct hostent * LYGetHostByName PARAMS((
 	CONST char *	str));
-#endif /* DJGPP */
+#endif
 
 
 /*      Parse an internet node address and port
diff --git a/WWW/Library/Implementation/HTTP.c b/WWW/Library/Implementation/HTTP.c
index 8c162fe2..57937767 100644
--- a/WWW/Library/Implementation/HTTP.c
+++ b/WWW/Library/Implementation/HTTP.c
@@ -7,7 +7,7 @@
 */
 
 #include <HTUtils.h>
-#if defined(__DJGPP__) && defined (WATT32) 
+#if defined(__DJGPP__) && defined (WATT32)
 #include <tcp.h>
 #endif /* __DJGPP__ */
 #include <HTTP.h>
@@ -94,7 +94,7 @@ PUBLIC char * str_speed(void)
     static char buff[32];
 
     if (ws_read_per_sec > 1000)
-	sprintf(buff, "%d.%03dkB", ws_read_per_sec / 1000, 
+	sprintf(buff, "%d.%03dkB", ws_read_per_sec / 1000,
 			(ws_read_per_sec % 1000) );
     else
 	sprintf(buff, "%3d", ws_read_per_sec);
@@ -227,7 +227,7 @@ PUBLIC int ws_netread(int fd, char *buf, int len)
 
 	    g_total_times += process_time;
 	    g_total_bytes += exitcode;
-	    
+
 	    if (g_total_bytes > 2000000) {
 		ws_read_per_sec = g_total_bytes / (g_total_times/1000);
 	    } else {
@@ -577,7 +577,7 @@ try_again:
 	char *colon;
 	int portnumber;
 	char *auth, *cookie = NULL;
-	BOOL secure = (strncmp(anAnchor->address, "https", 5) ?
+	BOOL secure = (BOOL) (strncmp(anAnchor->address, "https", 5) ?
 							FALSE : TRUE);
 
 	abspath = HTParse(arg, "", PARSE_PATH|PARSE_PUNCTUATION);
@@ -772,9 +772,9 @@ try_again:
 	if (!anAnchor->post_data)
 	  content_length = 0;
 	else
-/* 
- * Ack!  This assumes non-binary data!  Icky!  
- * 
+/*
+ * Ack!  This assumes non-binary data!  Icky!
+ *
  */
 	  content_length = strlen (anAnchor->post_data);
 	sprintf (line, "Content-length: %d%c%c",
diff --git a/WWW/Library/Implementation/HTUtils.h b/WWW/Library/Implementation/HTUtils.h
index 06df62c6..cc75c29d 100644
--- a/WWW/Library/Implementation/HTUtils.h
+++ b/WWW/Library/Implementation/HTUtils.h
@@ -102,6 +102,11 @@
 #define	GCC_UNUSED /* nothing */
 #endif
 
+/* FIXME: need a configure-test */
+#if defined(__STDC__) || defined(__DECC) || defined(_WINDOWS) || _WIN_CC
+#define ANSI_PREPRO 1
+#endif
+
 #if defined(__CYGWIN__)			/* 1998/12/31 (Thu) 16:13:46 */
 #include <windows.h>		/* #include "windef.h" */
 #define BOOLEAN_DEFINED
@@ -279,6 +284,18 @@ Macros for declarations
 #define NULL ((void *)0)
 #endif
 
+/* array/table size */
+#define	TABLESIZE(v)	(sizeof(v)/sizeof(v[0]))
+
+/* Quiet compiler warnings on places where we're being blamed incorrectly,
+ * e.g., for casting away const, or for alignment problems.  It's always
+ * legal to cast a pointer to long w/o loss of precision.
+ */
+#define TYPECAST(type,ptr) (type*)((long)(ptr))
+
+#define	typecalloc(cast)		(cast *)calloc(sizeof(cast),1)
+#define	typecallocn(cast,ntypes)	(cast *)calloc(sizeof(cast),ntypes)
+
 /*
 
 OFTEN USED INTEGER MACROS
diff --git a/WWW/Library/Implementation/HTWSRC.c b/WWW/Library/Implementation/HTWSRC.c
index 3388b100..4fa761d6 100644
--- a/WWW/Library/Implementation/HTWSRC.c
+++ b/WWW/Library/Implementation/HTWSRC.c
@@ -110,10 +110,10 @@ PUBLIC CONST char * hex = "0123456789ABCDEF";
 
 PUBLIC char from_hex ARGS1(char, c)
 {
-    return		  (c>='0')&&(c<='9') ? c-'0'
+    return  (char) (      (c>='0')&&(c<='9') ? c-'0'
 			: (c>='A')&&(c<='F') ? c-'A'+10
 			: (c>='a')&&(c<='f') ? c-'a'+10
-			:		       0;
+			:		       0);
 }
 
 
diff --git a/WWW/Library/Implementation/SGML.c b/WWW/Library/Implementation/SGML.c
index 7d5b450e..bbf446c2 100644
--- a/WWW/Library/Implementation/SGML.c
+++ b/WWW/Library/Implementation/SGML.c
@@ -189,7 +189,7 @@ struct _HTStream {
     char *			url;
     char *			csi;
     int				csi_index;
-} ;
+};
 
 #ifdef USE_PSRC
 static BOOL seen_letter_in_junk_tag;
@@ -228,7 +228,7 @@ PRIVATE void HTMLSRC_apply_markup ARGS3(
     }
 }
 
-#if defined(__STDC__) || _WIN_CC
+#if ANSI_PREPRO
 #  define PSRCSTART(x)	HTMLSRC_apply_markup(context,HTL_##x,START)
 #  define PSRCSTOP(x)  HTMLSRC_apply_markup(context,HTL_##x,STOP)
 #else
@@ -416,8 +416,8 @@ PRIVATE void handle_attribute_name ARGS2(
 
 #ifdef USE_PSRC
 	    } else {
-		 cur_attr_is_name = (attributes[i].type == HTMLA_ANAME);
-		 cur_attr_is_href = (attributes[i].type == HTMLA_HREF);
+		 cur_attr_is_name = (BOOL) (attributes[i].type == HTMLA_ANAME);
+		 cur_attr_is_href = (BOOL) (attributes[i].type == HTMLA_HREF);
 	    }
 #endif
 	    return;
@@ -631,7 +631,7 @@ PRIVATE void handle_entity ARGS2(
 #else
 	if (context->T.output_utf8 && (psrc_view ?
 	      (UCPutUtf8_charstring((HTStream *)context->target,
-	      (putc_func_t*)(&fake_put_character), code)): PUTUTF8(code) ) ) {
+	      (putc_func_t*)(fake_put_character), code)): PUTUTF8(code) ) ) {
 
 	    if (psrc_view) {
 		HTMLSRC_apply_markup(context,HTL_entity,START);
@@ -844,10 +844,10 @@ PRIVATE BOOL element_valid_within ARGS3(
     usecontains = (direct ? stacked_tag->contains : stacked_tag->icontains);
     usecontained = (direct ? new_tag->contained : new_tag->icontained);
     if (new_tag == stacked_tag)
-	return ((Tgc_same & usecontains) &&
+	return (BOOL) ((Tgc_same & usecontains) &&
 		(Tgc_same & usecontained));
     else
-	return ((new_tag->tagclass & usecontains) &&
+	return (BOOL) ((new_tag->tagclass & usecontains) &&
 		(stacked_tag->tagclass & usecontained));
 }
 
@@ -1700,6 +1700,12 @@ top1:
 			context->element_stack->tag->contents == SGML_LITTERAL)
 					 ?
 			      S_litteral : S_tag;
+#ifdef USE_PSRC
+	    if (psrc_view) /*there is nothing useful in the element_stack*/
+		if (context->current_tag &&
+			context->current_tag->contents == SGML_LITTERAL)
+		    context->state = S_litteral;
+#endif
 #define PASS8859SPECL context->T.pass_160_173_raw
 	/*
 	**  Convert 160 (nbsp) to Lynx special character if
@@ -1730,7 +1736,7 @@ top1:
 /******************************************************************
  *   I. LATIN-1 OR UCS2	 TO  DISPLAY CHARSET
  ******************************************************************/
-	} else if ((chk = (context->T.trans_from_uni && TOASCII(unsign_c) >= 160)) &&  /* S/390 -- gil -- 0968 */
+	} else if ((chk = (BOOL) (context->T.trans_from_uni && TOASCII(unsign_c) >= 160)) &&  /* S/390 -- gil -- 0968 */
 		   (uck = UCTransUniChar(unsign_c,
 					 context->outUCLYhndl)) >= ' ' &&
 		   uck < 256) {
@@ -1901,12 +1907,45 @@ top1:
 	HTChunkPutc(string, c);
 	if (TOUPPER(c) != ((string->size == 1) ?
 					   '/' :
+#ifdef USE_PSRC
+			psrc_view ? context->current_tag->name[string->size-2]:
+#endif
 			context->element_stack->tag->name[string->size-2])) {
 	    int i;
 
 	    /*
 	    **	If complete match, end litteral.
 	    */
+#ifdef USE_PSRC
+	    if (psrc_view) {
+		if ((c == '>') && context->current_tag && !context->current_tag->name[string->size-2]) {
+		    PSRCSTART(abracket);PUTC('<');PUTC('/');PSRCSTOP(abracket);
+		    PSRCSTART(tag);
+		    strcpy(string->data,context->current_tag->name);
+		    if (tagname_transform != 1) {
+			if (tagname_transform == 0)
+			    LYLowerCase(string->data);
+			else
+			    LYUpperCase(string->data);
+		    }
+		    PUTS(string->data);
+		    PSRCSTOP(tag);
+		    PSRCSTART(abracket);PUTC('>');PSRCSTOP(abracket);
+
+		    context->current_tag = NULL;
+		    string->size = 0;
+		    context->current_attribute_number = INVALID;
+		    context->state = S_text;
+		    break;
+		}
+		PUTC('<');
+		for (i = 0; i < string->size-1; i++)  /* recover, except last c */
+	    	    PUTC(string->data[i]);
+		string->size = 0;
+		context->state = S_text;
+		goto top1;		/* to recover last c */
+	    } else
+#endif
 	    if ((c == '>') &&
 		(!context->element_stack->tag->name[string->size-2])) {
 		end_element(context, context->element_stack->tag);
@@ -3535,7 +3574,7 @@ top1:
 	    } else if (psrc_view) {
 #endif
 	    } else {
-		BOOL tag_OK = (c == '>' || WHITE(c));
+		BOOL tag_OK = (BOOL) (c == '>' || WHITE(c));
 #if OPT
 		HTMLElement e = context->current_tag - context->dtd->tags;
 		int branch = 2; /* it can be 0,1,2*/
@@ -4058,6 +4097,7 @@ PUBLIC HTStream* SGML_new  ARGS3(
 #ifdef USE_PSRC
     if (psrc_view) {
 	psrc_view = FALSE;
+	mark_htext_as_source = TRUE;
 	SGML_string(context,
 		    "<HTML><HEAD><TITLE>source</TITLE></HEAD><BODY><PRE>");
 	psrc_view = TRUE;
@@ -4201,15 +4241,15 @@ PUBLIC unsigned char * SJIS_TO_JIS1 ARGS3(
 	register unsigned char,		LO,
 	register unsigned char *,	JCODE)
 {
-    HI -= (HI <= 0x9F) ? 0x71 : 0xB1;
-    HI = (HI << 1) + 1;
+    HI -= (unsigned char) ((HI <= 0x9F) ? 0x71 : 0xB1);
+    HI = (unsigned char) ((HI << 1) + 1);
     if (0x7F < LO)
 	LO--;
     if (0x9E <= LO) {
-	LO -= 0x7D;
+	LO -= (unsigned char) 0x7D;
 	HI++;
     } else {
-	LO -= 0x1F;
+	LO -= (unsigned char) 0x1F;
     }
     JCODE[0] = HI;
     JCODE[1] = LO;
@@ -4222,15 +4262,15 @@ PUBLIC unsigned char * JIS_TO_SJIS1 ARGS3(
 	register unsigned char *,	SJCODE)
 {
     if (HI & 1)
-	LO += 0x1F;
+	LO += (unsigned char) 0x1F;
     else
-	LO += 0x7D;
+	LO += (unsigned char) 0x7D;
     if (0x7F <= LO)
 	LO++;
 
-    HI = ((HI - 0x21) >> 1) + 0x81;
+    HI = (unsigned char) (((HI - 0x21) >> 1) + 0x81);
     if (0x9F < HI)
-	HI += 0x40;
+	HI += (unsigned char) 0x40;
     SJCODE[0] = HI;
     SJCODE[1] = LO;
     return SJCODE;
@@ -4243,7 +4283,7 @@ PUBLIC unsigned char * EUC_TO_SJIS1 ARGS3(
 {
     if (HI == 0x8E)
 	JISx0201TO0208_EUC(HI, LO, &HI, &LO);
-    JIS_TO_SJIS1(HI & 0x7F, LO & 0x7F, SJCODE);
+    JIS_TO_SJIS1((unsigned char) (HI & 0x7F), (unsigned char) (LO & 0x7F), SJCODE);
     return SJCODE;
 }
 
@@ -4255,7 +4295,7 @@ PUBLIC void JISx0201TO0208_SJIS ARGS3(
     unsigned char SJCODE[2];
 
     JISx0201TO0208_EUC(0x8E, I, OHI, OLO);
-    JIS_TO_SJIS1(*OHI & 0x7F, *OLO & 0x7F, SJCODE);
+    JIS_TO_SJIS1((unsigned char)(*OHI & 0x7F), (unsigned char)(*OLO & 0x7F), SJCODE);
     *OHI = SJCODE[0];
     *OLO = SJCODE[1];
 }
@@ -4303,7 +4343,7 @@ PUBLIC unsigned char * EUC_TO_SJIS ARGS2(
     for (sp = src, dp = dst; *sp;) {
 	if (*sp & 0x80) {
 	    if (sp[1] && (sp[1] & 0x80)) {
-		JIS_TO_SJIS1(sp[0] & 0x7F, sp[1] & 0x7F, dp);
+		JIS_TO_SJIS1((unsigned char)(sp[0] & 0x7F), (unsigned char)(sp[1] & 0x7F), dp);
 		dp += 2;
 		sp += 2;
 	    } else {
@@ -4341,16 +4381,16 @@ PUBLIC unsigned char *EUC_TO_JIS ARGS4(
 		continue;
 	    }
 	    if (!kana_mode) {
-		kana_mode = ~kana_mode;
+		kana_mode = (unsigned char) ~kana_mode;
 		dp = Strcpy(dp, toK);
 	    }
 	    if (*sp & 0x80) {
-		*dp++ = cch & ~0x80;
-		*dp++ = *sp++ & ~0x80;
+		*dp++ = (unsigned char) (cch & ~0x80);
+		*dp++ = (unsigned char) (*sp++ & ~0x80);
 	    }
 	} else {
 	    if (kana_mode) {
-		kana_mode = ~kana_mode;
+		kana_mode = (unsigned char) ~kana_mode;
 		dp = Strcpy(dp, toA);
 	    }
 	    *dp++ = cch;
@@ -4389,8 +4429,8 @@ PRIVATE CONST unsigned char *repairJIStoEUC ARGS2(
 	if (!IS_JIS7(ch1, ch2))
 	    return 0;
 
-	*d++ = 0x80 | ch1;
-	*d++ = 0x80 | ch2;
+	*d++ = (unsigned char) (0x80 | ch1);
+	*d++ = (unsigned char) (0x80 | ch2);
     }
     return 0;
 }
diff --git a/WWW/Library/Implementation/UCDefs.h b/WWW/Library/Implementation/UCDefs.h
index 53c3a807..19007f75 100644
--- a/WWW/Library/Implementation/UCDefs.h
+++ b/WWW/Library/Implementation/UCDefs.h
@@ -12,7 +12,8 @@ typedef struct _LYUCcharset {
 
     CONST char * MIMEname;
     int enc;
-    int codepage;	/* IBM OS/2 specific number */
+    int codepage;	/* if positive, an IBM OS/2 specific number;
+			   if negative, flag for no table translation */
 
     /* parameters below are not used by chartrans mechanism, */
     /* they describe some relationships against built-in Latin1 charset...*/
diff --git a/WWW/Library/Implementation/crypt_util.c b/WWW/Library/Implementation/crypt_util.c
index b81264c3..a9bda17a 100644
--- a/WWW/Library/Implementation/crypt_util.c
+++ b/WWW/Library/Implementation/crypt_util.c
@@ -278,12 +278,13 @@ static ufc_long longmask[32] = {
 
 #ifdef DEBUG
 
-pr_bits(a, n)
-  ufc_long *a;
-  int n;
-  { ufc_long i, j, t, tmp;
+pr_bits ARGS2(
+	ufc_long *,	a,
+	int,		n)
+{
+    ufc_long i, j, t, tmp;
     n /= 8;
-    for(i = 0; i < n; i++) {
+    for(i = 0; i < (ufc_long) n; i++) {
       tmp=0;
       for(j = 0; j < 8; j++) {
 	t=8*i+j;
@@ -292,18 +293,19 @@ pr_bits(a, n)
       (void)printf("%02x ",tmp);
     }
     printf(" ");
-  }
+}
 
-static set_bits(v, b)
-  ufc_long v;
-  ufc_long *b;
-  { ufc_long i;
+static set_bits ARGS(
+	ufc_long,	v,
+	ufc_long *,	b)
+{
+    ufc_long i;
     *b = 0;
     for(i = 0; i < 24; i++) {
       if(v & longmask[8 + i])
 	*b |= BITMASK(i);
     }
-  }
+}
 
 #endif
 
@@ -702,7 +704,7 @@ STATIC char *output_conversion(v1, v2, salt)
 
     for(i = 0; i < 5; i++) {
       shf = (26 - 6 * i); /* to cope with MSC compiler bug */
-      outbuf[i + 2] = bin_to_ascii((v1 >> shf) & 0x3f);
+      outbuf[i + 2] = (char) bin_to_ascii((v1 >> shf) & 0x3f);
     }
 
     s  = (v2 & 0xf) << 2;
@@ -710,10 +712,10 @@ STATIC char *output_conversion(v1, v2, salt)
 
     for(i = 5; i < 10; i++) {
       shf = (56 - 6 * i);
-      outbuf[i + 2] = bin_to_ascii((v2 >> shf) & 0x3f);
+      outbuf[i + 2] = (char) bin_to_ascii((v2 >> shf) & 0x3f);
     }
 
-    outbuf[12] = bin_to_ascii(s);
+    outbuf[12] = (char) bin_to_ascii(s);
     outbuf[13] = 0;
 
     return outbuf;
@@ -872,7 +874,7 @@ void setkey(key)
 
     for(i = 0; i < 8; i++) {
       for(j = 0, c = 0; j < 8; j++)
-	c = c << 1 | *key++;
+	c = (c << 1) | *key++;
       ktab[i] = c >> 1;
     }
 
diff --git a/WWW/Library/Implementation/www_tcp.h b/WWW/Library/Implementation/www_tcp.h
index b9e3bbf5..8be165b8 100644
--- a/WWW/Library/Implementation/www_tcp.h
+++ b/WWW/Library/Implementation/www_tcp.h
@@ -496,7 +496,7 @@ struct timeval {
 #define GLOBALREF extern
 #endif /* !GLOBALREF */
 
-#ifdef DJGPP
+#ifdef __DJGPP__
 #undef SELECT
 #define TCP_INCLUDES_DONE
 #define NO_IOCTL
@@ -504,6 +504,14 @@ struct timeval {
 #include <errno.h>
 #include <sys/types.h>
 #include <socket.h>
+#include <io.h>
+#ifdef WATT32
+#include <arpa/inet.h>
+#include <tcp.h>
+#ifdef word
+#undef word
+#endif /* word */
+#endif /* WATT32 */
 
 #undef NETWRITE
 #define NETWRITE write_s
@@ -513,7 +521,7 @@ struct timeval {
 #define NETCLOSE close_s
 #ifndef WATT32
 #define getsockname getsockname_s
-#endif /* WATT32 */
+#endif /* !WATT32 */
 #ifdef HAVE_GETTEXT
 #define gettext gettext__
 #endif
@@ -656,7 +664,7 @@ Defaults
 #endif /* !NO_IOCTL */
 #include <sys/socket.h>
 #include <netinet/in.h>
-#ifndef __hpux /* this may or may not be good -marc */
+#if !defined( __hpux) && !defined(__BEOS__) /* this may or may not be good -marc */
 #include <arpa/inet.h>      /* Must be after netinet/in.h */
 #endif /* !__hpux */
 #include <netdb.h>