Article View: net.sources.bugs
Article #853Re: TGRAPH (2 bugs fixed herein)
From: bruce
Date: Thu, 06 Nov 1986 18:49
Date: Thu, 06 Nov 1986 18:49
121 lines
2950 bytes
2950 bytes
----------------------------------
There are two bugs in the tgraph routines for SysVr2 curses,
which were distributed in net.sources a few days ago, and context
diff patches for both are below.
The first is that the character storage in the structure
__g__ch_ is a char sized variable, which is insufficient, as it
must have 16 bits to hold the 7-bit character and 9-bit video
enhancements. This is found in both tgraph.h and tgload.c. No
doubt the previous version works by accident on some machines due
to word alignment considerations; it did not work here (HP9000 s500).
The second is that the upper/lower right corner characters
are reversed at one point in tgload.c.
Both bugs are fixed below, if your machine has at least 16
bits in a "short". If not, change to "int".
-Bruce Townsend (bnr-vpa!bruce)
*** tgraph.h.old Thu Nov 6 13:25:48 1986
--- tgraph.h Thu Nov 6 13:31:42 1986
***************
*** 15,21
extern struct __g__ch_ {
char g_name[6];
! char g_graph;
} __graph[];
#define ACS_HLINE (__graph[0].g_graph)
--- 15,21 -----
extern struct __g__ch_ {
char g_name[6];
! short g_graph;
} __graph[];
#define ACS_HLINE (__graph[0].g_graph)
*** tgload.c.old Thu Nov 6 13:25:47 1986
--- tgload.c Thu Nov 6 13:31:47 1986
***************
*** 27,33
struct graph {
char g_name[6];
! char g_graph;
} __graph[] = {
"hor", '-',
"vert", '|',
--- 27,33 -----
struct graph {
char g_name[6];
! short g_graph;
} __graph[] = {
"hor", '-',
"vert", '|',
***************
*** 38,44
"dtee", '+',
"ll", '+',
"ul", '+',
- "lr", '+',
"ur", '+',
"scan9", '_',
"scan1", '-',
--- 38,43 -----
"dtee", '+',
"ll", '+',
"ul", '+',
"ur", '+',
"lr", '+',
"scan9", '_',
***************
*** 40,45
"ul", '+',
"lr", '+',
"ur", '+',
"scan9", '_',
"scan1", '-',
"up", '^',
--- 39,45 -----
"ll", '+',
"ul", '+',
"ur", '+',
+ "lr", '+',
"scan9", '_',
"scan1", '-',
"up", '^',
***************
*** 56,61
"block", '#',
"", '\0',
};
extern char *getenv();
--- 56,63 -----
"block", '#',
"", '\0',
};
+
+ #endif ACS_DIAMOND
extern char *getenv();
--
Bruce Townsend (bnr-vpa!bruce)
Bell-Northern Research,
Ottawa, Ontario.
Phone: (613) 726-3008
Mail path: {utzoo, utcs}!bnr-vpa!bruce
Technical Details
Message-ID:
<99@bnr-vpa.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utcs!bnr-vpa!bruceReferences:
<111@tdi2.UUCP>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!utcs!bnr-vpa!bruce From: bruce@bnr-vpa.UUCP Newsgroups: net.sources.bugs Subject: Re: TGRAPH (2 bugs fixed herein) Message-ID: <99@bnr-vpa.UUCP> Date: Thu, 6-Nov-86 13:49:35 EST Article-I.D.: bnr-vpa.99 Posted: Thu Nov 6 13:49:35 1986 Date-Received: Fri, 7-Nov-86 09:47:11 EST References: <111@tdi2.UUCP> Organization: Bell-Northern Research, Ottawa, Ontario Lines: 121