Made "regs" a local in each function where it's used.

This commit is contained in:
William McBrine
2006-08-13 02:11:36 +00:00
parent 262b6d86ab
commit 72bf06393d
6 changed files with 34 additions and 13 deletions

View File

@@ -19,7 +19,7 @@
#include <string.h>
RCSID("$Id: pdcdisp.c,v 1.50 2006/08/12 02:44:08 wmcbrine Exp $");
RCSID("$Id: pdcdisp.c,v 1.51 2006/08/13 02:11:36 wmcbrine Exp $");
#ifdef __PACIFIC__
void movedata(unsigned sseg, unsigned soff, unsigned dseg,
@@ -51,6 +51,8 @@ void movedata(unsigned sseg, unsigned soff, unsigned dseg,
void PDC_gotoyx(int row, int col)
{
union REGS regs;
PDC_LOG(("PDC_gotoyx() - called: row %d col %d\n", row, col));
regs.h.ah = 0x02;
@@ -76,6 +78,8 @@ void PDC_gotoyx(int row, int col)
static void PDC_putc(chtype ch, unsigned short count)
{
union REGS regs;
PDC_LOG(("PDC_putc() - called\n"));
regs.h.ah = 0x09; /* Avoid screen wrap. Don't advance cursor. */
@@ -109,6 +113,8 @@ static void PDC_putc(chtype ch, unsigned short count)
void PDC_putctty(chtype ch)
{
union REGS regs;
PDC_LOG(("PDC_putctty() - called\n"));
regs.h.ah = 0x0e; /* Write in TTY fashion, advance cursor. */

View File

@@ -15,7 +15,7 @@
* See the file maintain.er for details of the current maintainer. *
************************************************************************/
/* $Id: pdcdos.h,v 1.11 2006/08/12 20:11:36 wmcbrine Exp $ */
/* $Id: pdcdos.h,v 1.12 2006/08/13 02:11:36 wmcbrine Exp $ */
#define CURSES_LIBRARY 1
#include <curses.h>
@@ -53,8 +53,6 @@
#include <dos.h>
extern union REGS regs;
extern int pdc_adapter;
extern int pdc_scrnmode;
extern int pdc_font;

View File

@@ -19,7 +19,7 @@
#include <stdlib.h>
RCSID("$Id: pdcgetsc.c,v 1.30 2006/08/12 02:44:08 wmcbrine Exp $");
RCSID("$Id: pdcgetsc.c,v 1.31 2006/08/13 02:11:36 wmcbrine Exp $");
/*man-start**************************************************************
@@ -46,6 +46,8 @@ RCSID("$Id: pdcgetsc.c,v 1.30 2006/08/12 02:44:08 wmcbrine Exp $");
int PDC_get_cursor_pos(int *row, int *col)
{
union REGS regs;
PDC_LOG(("PDC_get_cursor_pos() - called\n"));
regs.h.ah = 0x03;
@@ -80,8 +82,9 @@ int PDC_get_cursor_pos(int *row, int *col)
int PDC_get_columns(void)
{
union REGS regs;
int cols;
char *env_cols;
const char *env_cols;
PDC_LOG(("PDC_get_columns() - called\n"));
@@ -91,9 +94,10 @@ int PDC_get_columns(void)
regs.h.ah = 0x0f;
int86(0x10, &regs, &regs);
cols = (int)regs.h.ah;
env_cols = (char *)getenv("COLS");
if (env_cols != (char *)NULL)
env_cols = getenv("COLS");
if (env_cols)
cols = min(atoi(env_cols), cols);
PDC_LOG(("PDC_get_columns() - returned: cols %d\n", cols));
@@ -263,6 +267,8 @@ int PDC_get_rows(void)
int PDC_get_scrn_mode(void)
{
union REGS regs;
PDC_LOG(("PDC_get_scrn_mode() - called\n"));
regs.h.ah = 0x0f;
@@ -371,6 +377,7 @@ static int PDC_sanity_check(int adapter)
int PDC_query_adapter_type(void)
{
union REGS regs;
int equip;
int retval = _NONE;

View File

@@ -23,7 +23,7 @@
#include "pdcdos.h"
RCSID("$Id: pdckbd.c,v 1.34 2006/08/12 22:22:05 wmcbrine Exp $");
RCSID("$Id: pdckbd.c,v 1.35 2006/08/13 02:11:36 wmcbrine Exp $");
/************************************************************************
* Table for key code translation of function keys in keypad mode *
@@ -190,6 +190,7 @@ bool PDC_check_bios_key(void)
int PDC_get_bios_key(void)
{
union REGS regs;
int ascii, scan;
static unsigned char keyboard_function = 0xFF;
@@ -317,6 +318,8 @@ int PDC_get_bios_key(void)
bool PDC_get_ctrl_break(void)
{
union REGS regs;
PDC_LOG(("PDC_get_ctrl_break() - called\n"));
regs.h.ah = 0x33;
@@ -347,6 +350,8 @@ bool PDC_get_ctrl_break(void)
int PDC_set_ctrl_break(bool setting)
{
union REGS regs;
PDC_LOG(("PDC_set_ctrl_break() - called\n"));
#ifdef __DJGPP__

View File

@@ -24,9 +24,7 @@
# include <sys/movedata.h>
#endif
RCSID("$Id: pdcscrn.c,v 1.48 2006/08/12 22:22:05 wmcbrine Exp $");
union REGS regs; /* used in various other modules */
RCSID("$Id: pdcscrn.c,v 1.49 2006/08/13 02:11:36 wmcbrine Exp $");
int pdc_adapter; /* screen type */
int pdc_scrnmode; /* default screen mode */

View File

@@ -17,7 +17,7 @@
#include "pdcdos.h"
RCSID("$Id: pdcsetsc.c,v 1.24 2006/08/12 20:11:36 wmcbrine Exp $");
RCSID("$Id: pdcsetsc.c,v 1.25 2006/08/13 02:11:36 wmcbrine Exp $");
/*man-start**************************************************************
@@ -38,6 +38,8 @@ RCSID("$Id: pdcsetsc.c,v 1.24 2006/08/12 20:11:36 wmcbrine Exp $");
int PDC_set_80x25(void)
{
union REGS regs;
PDC_LOG(("PDC_set_80x25() - called\n"));
switch (pdc_adapter)
@@ -88,6 +90,8 @@ int PDC_set_80x25(void)
int PDC_set_font(int size)
{
union REGS regs;
PDC_LOG(("PDC_set_font() - called\n"));
if (pdc_bogus_adapter)
@@ -175,6 +179,8 @@ int PDC_set_font(int size)
int PDC_set_scrn_mode(int new_mode)
{
union REGS regs;
PDC_LOG(("PDC_set_scrn_mode() - called\n"));
if (PDC_get_scrn_mode() != new_mode)
@@ -194,6 +200,7 @@ int PDC_set_scrn_mode(int new_mode)
int PDC_curs_set(int visibility)
{
union REGS regs;
int ret_vis, start, end = 7;
PDC_LOG(("PDC_curs_set() - called: visibility=%d\n", visibility));