Removed some uses of uninitialized variables in update.c, presumably remnands of old color support.

Fixed a few cases where free-ed memory blocks were subsequently read.
Removed some unused variables, #includes, other small cleanup.
This commit is contained in:
Kees van Reeuwijk 2010-01-21 22:36:15 +00:00
parent 6292b96ac8
commit c43cdf06f8
7 changed files with 6 additions and 15 deletions

View file

@ -1,5 +1,4 @@
#include <curses.h> #include <curses.h>
#include "curspriv.h"
#include <termcap.h> #include <termcap.h>
extern char *bl, *vb; extern char *bl, *vb;

View file

@ -1,5 +1,4 @@
#include <curses.h> #include <curses.h>
#include "curspriv.h"
/****************************************************************/ /****************************************************************/
/* Winch(win) returns the character at the current position in */ /* Winch(win) returns the character at the current position in */

View file

@ -1,5 +1,4 @@
#include <curses.h> #include <curses.h>
#include "curspriv.h"
#include <termcap.h> #include <termcap.h>
extern char *vi, *ve, *vs; extern char *vi, *ve, *vs;

View file

@ -4,7 +4,7 @@
#define _FULLWIN 4 /* window fills screen */ #define _FULLWIN 4 /* window fills screen */
#define _SCROLLWIN 8 /* window lwr rgt is screen lwr rgt */ #define _SCROLLWIN 8 /* window lwr rgt is screen lwr rgt */
#define _NO_CHANGE -1 /* flags line edge unchanged */ #define _NO_CHANGE (-1) /* flags line edge unchanged */
#define _BREAKCHAR 0x03 /* ^C character */ #define _BREAKCHAR 0x03 /* ^C character */
#define _DCCHAR 0x08 /* Delete Char char (BS) */ #define _DCCHAR 0x08 /* Delete Char char (BS) */
#define _DLCHAR 0x1b /* Delete Line char (ESC) */ #define _DLCHAR 0x1b /* Delete Line char (ESC) */

View file

@ -27,14 +27,14 @@ int num_lines, num_columns, begy, begx;
/* Allocate the minchng and maxchng arrays */ /* Allocate the minchng and maxchng arrays */
if ((win->_minchng = (int *) calloc(num_lines, sizeof(int))) == NULL) { if ((win->_minchng = (int *) calloc(num_lines, sizeof(int))) == NULL) {
free(win);
free(win->_line); free(win->_line);
free(win);
return((WINDOW *) ERR); return((WINDOW *) ERR);
} }
if ((win->_maxchng = (int *) calloc(num_lines, sizeof(int))) == NULL) { if ((win->_maxchng = (int *) calloc(num_lines, sizeof(int))) == NULL) {
free(win);
free(win->_line); free(win->_line);
free(win->_minchng); free(win->_minchng);
free(win);
return((WINDOW *) ERR); return((WINDOW *) ERR);
} }

View file

@ -1,9 +1,6 @@
#include <curses.h> #include <curses.h>
#include "curspriv.h" #include "curspriv.h"
static bool hasold = FALSE; /* for remembering old cursor type */
static int oldmode;
/****************************************************************/ /****************************************************************/
/* Idlok() is used to set flag for using the terminal insert/ */ /* Idlok() is used to set flag for using the terminal insert/ */
/* Delete line capabilities. This is not relevant for the PC */ /* Delete line capabilities. This is not relevant for the PC */

View file

@ -112,13 +112,10 @@ WINDOW *scr;
/* Like the corresponding line in _cursvar.tmpwin. */ /* Like the corresponding line in _cursvar.tmpwin. */
/****************************************************************/ /****************************************************************/
static void transformline(lineno) static void transformline(register int lineno)
register int lineno;
{ {
register int *dstp; register int *dstp;
register int *srcp; register int *srcp;
register int dstc;
register int srcc;
int x; int x;
int endx; int endx;
@ -128,9 +125,9 @@ register int lineno;
srcp = twin->_line[lineno] + x; srcp = twin->_line[lineno] + x;
while (x <= endx) { while (x <= endx) {
if ((*dstp != *srcp) || (dstc != srcc)) { if (*dstp != *srcp) {
gotoxy(lineno, x); gotoxy(lineno, x);
while (x <= endx && ((*dstp != *srcp) || (dstc != srcc))) { while (x <= endx && (*dstp != *srcp)) {
Putchar(*srcp); Putchar(*srcp);
*dstp++ = *srcp++; *dstp++ = *srcp++;
x++; x++;