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:
parent
6292b96ac8
commit
c43cdf06f8
7 changed files with 6 additions and 15 deletions
|
@ -1,5 +1,4 @@
|
|||
#include <curses.h>
|
||||
#include "curspriv.h"
|
||||
#include <termcap.h>
|
||||
|
||||
extern char *bl, *vb;
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#include <curses.h>
|
||||
#include "curspriv.h"
|
||||
|
||||
/****************************************************************/
|
||||
/* Winch(win) returns the character at the current position in */
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#include <curses.h>
|
||||
#include "curspriv.h"
|
||||
#include <termcap.h>
|
||||
|
||||
extern char *vi, *ve, *vs;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#define _FULLWIN 4 /* window fills screen */
|
||||
#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 _DCCHAR 0x08 /* Delete Char char (BS) */
|
||||
#define _DLCHAR 0x1b /* Delete Line char (ESC) */
|
||||
|
|
|
@ -27,14 +27,14 @@ int num_lines, num_columns, begy, begx;
|
|||
|
||||
/* Allocate the minchng and maxchng arrays */
|
||||
if ((win->_minchng = (int *) calloc(num_lines, sizeof(int))) == NULL) {
|
||||
free(win);
|
||||
free(win->_line);
|
||||
free(win);
|
||||
return((WINDOW *) ERR);
|
||||
}
|
||||
if ((win->_maxchng = (int *) calloc(num_lines, sizeof(int))) == NULL) {
|
||||
free(win);
|
||||
free(win->_line);
|
||||
free(win->_minchng);
|
||||
free(win);
|
||||
return((WINDOW *) ERR);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
#include <curses.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/ */
|
||||
/* Delete line capabilities. This is not relevant for the PC */
|
||||
|
|
|
@ -112,13 +112,10 @@ WINDOW *scr;
|
|||
/* Like the corresponding line in _cursvar.tmpwin. */
|
||||
/****************************************************************/
|
||||
|
||||
static void transformline(lineno)
|
||||
register int lineno;
|
||||
static void transformline(register int lineno)
|
||||
{
|
||||
register int *dstp;
|
||||
register int *srcp;
|
||||
register int dstc;
|
||||
register int srcc;
|
||||
int x;
|
||||
int endx;
|
||||
|
||||
|
@ -128,9 +125,9 @@ register int lineno;
|
|||
srcp = twin->_line[lineno] + x;
|
||||
|
||||
while (x <= endx) {
|
||||
if ((*dstp != *srcp) || (dstc != srcc)) {
|
||||
if (*dstp != *srcp) {
|
||||
gotoxy(lineno, x);
|
||||
while (x <= endx && ((*dstp != *srcp) || (dstc != srcc))) {
|
||||
while (x <= endx && (*dstp != *srcp)) {
|
||||
Putchar(*srcp);
|
||||
*dstp++ = *srcp++;
|
||||
x++;
|
||||
|
|
Loading…
Reference in a new issue