# ------------------------------------------------------------------------------
 #  button.c       |   17 +++++++++--------
 #  charproc.c     |    2 +-
 #  configure      |    8 ++++++++
 #  configure.in   |    8 ++++++++
 #  ptydata.c      |    2 +-
 #  util.c         |    4 ++--
 #  version.h      |    4 ++--
 #  xterm.h        |    4 ++--
 #  xterm.log.html |   11 +++++++++++
 #  xtermcfg.hin   |    2 +-
 #  10 files changed, 45 insertions, 17 deletions
 # ------------------------------------------------------------------------------
 Index: button.c
--- xterm/button.c      Sun May 16 15:55:44 1999
 +++ xterm-104/button.c  Sat May 29 13:01:58 1999
 @@ -104,7 +104,7 @@
  /* Send emacs escape code when done selecting or extending? */
 static int replyToEmacs;
 
-static char *SaveText (TScreen *screen, int row, int scol, int ecol, char *lp, int *eol);
 +static Char *SaveText (TScreen *screen, int row, int scol, int ecol, Char *lp, int *eol);
  static int Length (TScreen *screen, int row, int scol, int ecol);
 static void ComputeSelect (int startRow, int startCol, int endRow, int endCol, Bool extend);
 static void EditorButton (XButtonEvent *event);
@@ -979,7 +979,7 @@
 #if OPT_WIDE_CHARS
 static int class_of(TScreen *screen, int row, int col)
 {
-    int value;
+    unsigned value;
  #if OPT_DEC_CHRSET
     if (CSET_DOUBLE(SCRN_BUF_CSETS(screen, row + screen->topline)[0])) {
        col /= 2;
@@ -1215,7 +1215,8 @@
     register TScreen *screen = &term->screen;
     register int i, j = 0;
     int eol;
-    char *line, *lp;
+    char *line;
 +    Char *lp;
 
     if (crow == row && ccol > col) {
        int tmp = ccol;
@@ -1256,7 +1257,7 @@
        return;
 
     line[j] = '\0';            /* make sure it is null terminated */
-    lp = line;                 /* lp points to where to save the text */
 +    lp = (Char *)line;         /* lp points to where to save the text */
      if ( row == crow ) {
        lp = SaveText(screen, row, ccol, col, lp, &eol);
     } else {
@@ -1274,7 +1275,7 @@
     *lp = '\0';                        /* make sure we have end marked */
 
     TRACE(("Salted TEXT:%.*s\n", lp - line, line))
-    screen->selection_length = (lp - line);
 +    screen->selection_length = ((char *)lp - line);
      _OwnSelection(term, params, num_params);
 }
 
@@ -1536,17 +1537,17 @@
 }
 
 /* copies text into line, preallocated */
-static char *
+static Char *
 SaveText(
     TScreen *screen,
     int row,
     int scol,
     int ecol,
-    register char *lp,         /* pointer to where to put the text */
 +    register Char *lp,         /* pointer to where to put the text */
      int *eol)
 {
     int i = 0;
-    int c;
+    unsigned c;
  
     i = Length(screen, row, scol, ecol);
     ecol = scol + i;
Index: charproc.c
--- xterm/charproc.c    Sun May 16 15:55:44 1999
 +++ xterm-104/charproc.c        Sat May 29 12:51:24 1999
 @@ -2298,7 +2298,7 @@
         int c = len;
 
        if (v_bufstr == NULL  &&  len > 0) {
-               v_buffer = XtMalloc(len);
 +               v_buffer = (Char *) XtMalloc(len);
                 v_bufstr = v_buffer;
                v_bufptr = v_buffer;
                v_bufend = v_buffer + len;
Index: configure
--- xterm/configure     Sun May 16 15:55:44 1999
 +++ xterm-104/configure Sun May 30 07:58:50 1999
 @@ -5020,6 +5020,14 @@
  
 
 
+###    remove from IMAKE_CFLAGS the optional features we define in xtermcfg.h
 +for cf_def in \
+       SCROLLBAR_RIGHT \
 +       OPT_WIDE_CHARS
 +do
+       IMAKE_CFLAGS=`echo "$IMAKE_CFLAGS" | sed -e s/-D$cf_def//`
 +done
+
 ###    output Makefile and xtermcfg.h
 trap '' 1 2 15
 cat > confcache <<\EOF
Index: configure.in
--- xterm/configure.in  Sun May 16 15:55:44 1999
 +++ xterm-104/configure.in      Sun May 30 07:58:46 1999
 @@ -408,5 +408,13 @@
  AC_SUBST(EXTRASRCS)
 AC_SUBST(EXTRAOBJS)
 
+###    remove from IMAKE_CFLAGS the optional features we define in xtermcfg.h
 +for cf_def in \
+       SCROLLBAR_RIGHT \
 +       OPT_WIDE_CHARS
 +do
+       IMAKE_CFLAGS=`echo "$IMAKE_CFLAGS" | sed -e s/-D$cf_def//`
 +done
+
 ###    output Makefile and xtermcfg.h
 AC_OUTPUT(Makefile)
Index: ptydata.c
--- xterm/ptydata.c     Sun May 16 15:55:44 1999
 +++ xterm-104/ptydata.c Sat May 29 13:00:10 1999
 @@ -194,7 +194,7 @@
  }
 
 #if OPT_WIDE_CHARS
-Char * convertToUTF8(Char *lp, int c)
 +Char * convertToUTF8(Char *lp, unsigned c)
  {
     if (c < 0x80) {            /*  0*******  */
        *lp++ = (c);
Index: util.c
--- xterm/util.c        Sun May  9 16:47:58 1999
 +++ xterm-104/util.c    Sat May 29 13:12:34 1999
 @@ -1807,9 +1807,9 @@
  /*
  * Returns a single 8/16-bit number for the given cell
  */
-int getXtermCell (TScreen *screen, int row, int col)
 +unsigned getXtermCell (TScreen *screen, int row, int col)
  {
-    int ch = SCRN_BUF_CHARS(screen, row)[col];
 +    unsigned ch = SCRN_BUF_CHARS(screen, row)[col];
      if_OPT_WIDE_CHARS(screen,{
        ch |= (SCRN_BUF_WIDEC(screen, row)[col] << 8);
     })
Index: version.h
--- xterm/version.h     Sun May 16 15:55:44 1999
 +++ xterm-104/version.h Sun May 30 07:45:53 1999
 @@ -6,5 +6,5 @@
   * XFree86 to which this version of xterm has been built.  The number in
  * parentheses is my patch number (T.Dickey).
  */
-#define XTERM_PATCH   103
-#define XFREE86_VERSION "XFree86 3.9Pm"
 +#define XTERM_PATCH   104
+#define XFREE86_VERSION "XFree86 3.9Pn"
 Index: xterm.h
--- xterm/xterm.h       Sun May 16 15:55:44 1999
 +++ xterm-104/xterm.h   Sat May 29 13:00:20 1999
 @@ -329,7 +329,7 @@
  extern void initPtyData (PtyData *data);
 
 #if OPT_WIDE_CHARS
-extern Char * convertToUTF8(Char *lp, int c);
 +extern Char * convertToUTF8(Char *lp, unsigned c);
  extern void writePtyData(int f, IChar *d, unsigned len);
 #else
 #define writePtyData(f,d,len) v_write(f,d,len)
@@ -436,7 +436,7 @@
 #endif
 
 #if OPT_WIDE_CHARS
-extern int getXtermCell (TScreen *screen, int row, int col);
 +extern unsigned getXtermCell (TScreen *screen, int row, int col);
  extern void putXtermCell (TScreen *screen, int row, int col, int ch);
 #else
 #define getXtermCell(screen,row,col) SCRN_BUF_CHARS(screen, row)[col]
Index: xterm.log.html
--- xterm/xterm.log.html        Sun May 16 15:55:44 1999
 +++ xterm-104/xterm.log.html    Sun May 30 08:01:20 1999
 @@ -41,6 +41,7 @@
  xc/programs/Xserver/hw/xfree86).
 
 <UL>
+<LI><A HREF="#xterm_104">Patch #104 - 1999/5/30 - XFree86 3.9Pn</A>
  <LI><A HREF="#xterm_103">Patch #103 - 1999/5/14 - XFree86 3.9Pm</A>
 <LI><A HREF="#xterm_102">Patch #102 - 1999/5/12 - XFree86 3.9Pm</A>
 <LI><A HREF="#xterm_101">Patch #101 - 1999/5/10 - XFree86 3.9Pm</A>
@@ -146,6 +147,16 @@
 <LI><A HREF="#xterm_02">Patch #2 - 1996/1/7</A>
 <LI><A HREF="#xterm_01">Patch #1 - 1996/1/6</A>
 </UL>
+
+<H1><A NAME="xterm_104">Patch #104 - 1999/5/30 - XFree86 3.9Pn</A></H1>
 +This is a resync patch against XFree86 3.9Pn, reflecting changes which were
 +submitted by Branden Robinson, who worked with 
 +Wichert Akkerman <wichert@cs.leidenuniv.nl>
 +to set up ifdef's to handle GNU libc 2.1
 +<p>
+I have also added a few fixes for signed/unsigned mismatches, and corrected
 +a problem in the configure script (the UTF-8 code was always configured since
 +the Imakefile defines this).
 
 <H1><A NAME="xterm_103">Patch #103 - 1999/5/14 - XFree86 3.9Pm</A></H1>
 <ul>
Index: xtermcfg.hin
--- xterm/xtermcfg.hin  Sun Apr 11 16:38:14 1999
 +++ xterm-104/xtermcfg.hin      Sun May 30 07:47:54 1999
 @@ -67,7 +67,7 @@
  #undef OPT_TEK4014     /* CF_ARG_DISABLE(tek4014) */
 #undef OPT_TRACE       /* CF_ARG_ENABLE(trace) */
 #undef OPT_VT52_MODE   /* CF_ARG_DISABLE(vt52) */
-#undef OPT_WIDE_CHARS  /* CF_ARG_ENSABLE(wide-chars) */
 +#undef OPT_WIDE_CHARS  /* CF_ARG_ENABLE(wide-chars) */
  #undef OPT_XMC_GLITCH  /* CF_ARG_ENABLE(xmc-glitch) */
 #undef OWN_TERMINFO_DIR        /* AC_ARG_WITH(own-terminfo) */
 #undef SCROLLBAR_RIGHT /* CF_ARG_ENABLE(rightbar) */