Put prototypes for the functions exported by wcwidth.c in putty.h, and remove
[u/mdw/putty] / terminal.c
index 5950072..3fcff47 100644 (file)
@@ -62,6 +62,8 @@ const wchar_t sel_nl[] = SEL_NL;
 /*
  * Internal prototypes.
  */
+static unsigned long *resizeline(unsigned long *, int);
+static unsigned long *lineptr(Terminal *, int, int);
 static void do_paint(Terminal *, Context, int);
 static void erase_lots(Terminal *, int, int, int);
 static void swap_screen(Terminal *, int, int, int);
@@ -75,7 +77,7 @@ static void scroll_display(Terminal *, int, int, int);
 /*
  * Resize a line to make it `cols' columns wide.
  */
-unsigned long *resizeline(unsigned long *line, int cols)
+static unsigned long *resizeline(unsigned long *line, int cols)
 {
     int i, oldlen;
     unsigned long lineattrs;
@@ -102,7 +104,7 @@ unsigned long *resizeline(unsigned long *line, int cols)
  * whether the y coordinate is non-negative or negative
  * (respectively).
  */
-unsigned long *lineptr(Terminal *term, int y, int lineno)
+static unsigned long *lineptr(Terminal *term, int y, int lineno)
 {
     unsigned long *line, *newline;
     tree234 *whichtree;
@@ -1540,7 +1542,6 @@ void term_out(Terminal *term)
                    term->logctx)
                    logtraffic(term->logctx, (unsigned char) c, LGTYP_ASCII);
                {
-                   extern int wcwidth(wchar_t ucs);
                    int width = 0;
                    if (DIRECT_CHAR(c))
                        width = 1;
@@ -3309,7 +3310,7 @@ static void clipme(Terminal *term, pos top, pos bottom, int rect)
                    int rv;
                    if (is_dbcs_leadbyte(font_codepage, (BYTE) c)) {
                        buf[0] = c;
-                       buf[1] = ldata[top.x + 1];
+                       buf[1] = (char) (0xFF & ldata[top.x + 1]);
                        rv = mb_to_wc(font_codepage, 0, buf, 2, wbuf, 4);
                        top.x++;
                    } else {