From: simon Date: Thu, 3 May 2001 10:10:53 +0000 (+0000) Subject: Remove diagnostics and attempt to work around VC compiler bug :-( X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/commitdiff_plain/cdd6c58608ec6ba0f2e0246d45b54e2d77b5abab Remove diagnostics and attempt to work around VC compiler bug :-( git-svn-id: svn://svn.tartarus.org/sgt/putty@1096 cda61777-01e9-0310-a592-d414129be87e --- diff --git a/Makefile b/Makefile index c2952396..8380c5cf 100644 --- a/Makefile +++ b/Makefile @@ -50,12 +50,12 @@ ##-- # Enable debug and incremental linking and compiling -CFLAGS = /W3 /YX /Yd /O1 /Gi /D_WINDOWS /DDEBUG -LFLAGS = /debug +# CFLAGS = /nologo /W3 /YX /Yd /O1 /Gi /D_WINDOWS /DDEBUG +# LFLAGS = /debug # Disable debug and incremental linking and compiling -#CFLAGS = /nologo /W3 /O1 /D_WINDOWS -#LFLAGS = /incremental:no /fixed +CFLAGS = /nologo /W3 /O1 /D_WINDOWS +LFLAGS = /incremental:no /fixed # Use MSVC DLL # CFLAGS = /nologo /W3 /O1 /MD /D_WINDOWS diff --git a/terminal.c b/terminal.c index 0d5398e3..b5b79e91 100644 --- a/terminal.c +++ b/terminal.c @@ -350,9 +350,6 @@ void term_size(int newrows, int newcols, int newsavelines) { alt_t = marg_t = 0; alt_b = marg_b = newrows - 1; - debug(("term_size, old r,c,s (%d,%d,%d), new rcs (%d,%d,%d)\n", - rows, cols, savelines, newrows, newcols, newsavelines)); - if (rows == -1) { scrollback = newtree234(NULL); screen = newtree234(NULL); @@ -380,32 +377,22 @@ void term_size(int newrows, int newcols, int newsavelines) { * away. */ sblen = count234(scrollback); - debug(("newrows=%d rows=%d sblen=%d\n", newrows, rows, sblen)); - if (newrows > rows) { - for (i = rows; i < newrows; i++) { - debug(("increase screen: i=%d\n", i)); - if (sblen > 0) { - debug(("sblen=%d so use line from scrollback\n", sblen)); - line = delpos234(scrollback, --sblen); - } else { - debug(("sblen=%d so make up a new line\n", sblen)); - line = smalloc(TSIZE * (newcols+2)); - line[0] = newcols; - for (j = 0; j <= newcols; j++) - line[j+1] = ERASE_CHAR; - } - debug(("got new screen line %p\n", line)); - addpos234(screen, line, 0); - } - } else if (newrows < rows) { - for (i = newrows; i < rows; i++) { - debug(("decrease screen: i=%d\n", i)); - line = delpos234(screen, 0); - debug(("taken out line %p, count is now %d\n", - line, count234(screen))); - addpos234(scrollback, line, sblen++); - debug(("added to scrollback, sblen is now %d\n", sblen)); - } + /* Do this loop to expand the screen if newrows > rows */ + for (i = rows; i < newrows; i++) { + if (sblen > 0) { + line = delpos234(scrollback, --sblen); + } else { + line = smalloc(TSIZE * (newcols+2)); + line[0] = newcols; + for (j = 0; j <= newcols; j++) + line[j+1] = ERASE_CHAR; + } + addpos234(screen, line, 0); + } + /* Do this loop to shrink the screen if newrows < rows */ + for (i = newrows; i < rows; i++) { + line = delpos234(screen, 0); + addpos234(scrollback, line, sblen++); } assert(count234(screen) == newrows); while (sblen > newsavelines) { diff --git a/tree234.c b/tree234.c index 017a12a2..9d1d7b04 100644 --- a/tree234.c +++ b/tree234.c @@ -39,8 +39,7 @@ #ifdef TEST #define LOG(x) (printf x) #else -// FIXME -#define LOG(x) (dprintf x) +#define LOG(x) #endif typedef struct node234_Tag node234;