1.0.9-1.0.9.1.gz
patches · 3.7 KB · 2010-03-30
Download « Back to the patches list
diff -cr dgd/doc/Platforms new/dgd/doc/Platforms
*** dgd/doc/Platforms Sat Jan 28 13:44:06 1995
--- new/dgd/doc/Platforms Fri Mar 3 21:25:05 1995
***************
*** 1,13 ****
To compile DGD, you will have to set HOST in src/Makefile to the
proper value:
! SUNOS4 SunOS 4.x, the default. Should compile immediately with gcc.
MINIX_68K Minix 1.5 for 68K computers, probably works with Minix 1.6
as well. Copy src/host/minix68k/Makefile to src/host.
ATARI_ST Atari ST with MiNT and gcc. See src/host/atarist/README.
- GENERIC_BSD BSD Unix. Copy src/host/Makefile.bsd to src/host/Makefile.
- GENERIC_SYSV SYSV Unix. Copy src/host/Makefile.sysv to src/host/Makefile.
- NETBSD NetBSD. Copy host/Makefile.bsd to host/Makefile.
- BSD386 FreeBSD or 386BSD. Copy host/Makefile.bsd to host/Makefile.
LINUX Linux. Copy host/Makefile.sysv to host/Makefile.
For other platforms, you can either try to use the closest of the above,
--- 1,13 ----
To compile DGD, you will have to set HOST in src/Makefile to the
proper value:
! NETBSD NetBSD. This is the default.
! BSD386 FreeBSD or 386BSD.
! GENERIC_BSD BSD Unix.
! SUNOS4 SunOS 4.x. Copy src/host/Makefile.sun4 to src/host/Makefile.
! GENERIC_SYSV SYSV Unix. Copy src/host/Makefile.sysv to src/host/Makefile.
MINIX_68K Minix 1.5 for 68K computers, probably works with Minix 1.6
as well. Copy src/host/minix68k/Makefile to src/host.
ATARI_ST Atari ST with MiNT and gcc. See src/host/atarist/README.
LINUX Linux. Copy host/Makefile.sysv to host/Makefile.
For other platforms, you can either try to use the closest of the above,
diff -cr dgd/doc/kfun/map_values new/dgd/doc/kfun/map_values
*** dgd/doc/kfun/map_values Tue Aug 3 18:04:21 1993
--- new/dgd/doc/kfun/map_values Fri Mar 3 21:25:05 1995
***************
*** 6,12 ****
DESCRIPTION
! Return an array containing the values of mapping map.
SEE ALSO
kfun/map_indices
--- 6,13 ----
DESCRIPTION
! Return an array containing the values of mapping map, sorted in the
! order of the corresponding indices.
SEE ALSO
kfun/map_indices
diff -cr dgd/src/Changelog new/dgd/src/Changelog
*** dgd/src/Changelog Sat Jan 28 14:17:08 1995
--- new/dgd/src/Changelog Fri Mar 3 21:25:06 1995
***************
*** 748,750 ****
--- 748,761 ----
inconsistant state.
- Changed YYDEPTH into YYMAXDEPTH in config.h; this should work for a wider
range of yaccs.
+
+ DGD 1.1
+
+ - Fixed a bug that caused precompiled kfun calls to be wrong if kfuns were
+ added since the last state dump.
+ - The type of (expr1 ? void : expr2) and (expr1 ? expr2 : void) is now always
+ void.
+ - Fixed another bug in switch statements with only a default label inside.
+ - Made sure that mappings are compacted before the size is checked.
+ - Fixed a bug that might occur while restoring object filenames in a state
+ dump.
diff -cr dgd/src/Makefile new/dgd/src/Makefile
*** dgd/src/Makefile Sun Jan 29 13:45:02 1995
--- new/dgd/src/Makefile Fri Mar 3 21:25:06 1995
***************
*** 1,5 ****
#
! # Makefile for DGD, Dworkin's Game Driver
#
HOST= NETBSD
DEFINES=-D$(HOST) -DDUMP_FUNCS -DRUSAGE
--- 1,5 ----
#
! # Makefile for DGD, Dworkin's Generic Driver
#
HOST= NETBSD
DEFINES=-D$(HOST) -DDUMP_FUNCS -DRUSAGE
diff -cr dgd/src/array.c new/dgd/src/array.c
*** dgd/src/array.c Sat Jan 28 14:12:43 1995
--- new/dgd/src/array.c Fri Mar 3 21:25:07 1995
***************
*** 968,989 ****
}
/*
- * NAME: mapping->size()
- * DESCRIPTION: return the size of a mapping
- */
- unsigned short map_size(m)
- register array *m;
- {
- register unsigned short size;
-
- size = m->size >> 1;
- if (m->hashed != (maphash *) NULL) {
- size += m->hashed->size;
- }
- return size;
- }
-
- /*
* NAME: mapping->compact()
* DESCRIPTION: compact a mapping: put elements from the hash table into
* the array, and remove destructed objects
--- 968,973 ----
***************
*** 1120,1125 ****
--- 1104,1120 ----
m->size = arrsize;
d_change_map(m);
}
+ }
+
+ /*
+ * NAME: mapping->size()
+ * DESCRIPTION: return the size of a mapping
+ */
+ unsigned short map_size(m)
+ array *m;
+ {
+ map_compact(m);
+ return m->size >> 1;
}
/*
diff -cr dgd/src/array.h new/dgd/src/array.h
*** dgd/src/array.h Sat Jan 28 14:18:32 1995
--- new/dgd/src/array.h Fri Mar 3 21:25:07 1995
***************
*** 28,35 ****
extern array *map_new P((long));
extern void map_sort P((array*));
- extern unsigned short map_size P((array*));
extern void map_compact P((array*));
extern array *map_add P((array*, array*));
extern array *map_sub P((array*, array*));
extern array *map_intersect P((array*, array*));
--- 28,35 ----
extern array *map_new P((long));
extern void map_sort P((array*));
extern void map_compact P((array*));
+ extern unsigned short map_size P((array*));
extern array *map_add P((array*, array*));
extern array *map_sub P((array*, array*));
extern array *map_intersect P((array*, array*));
diff -cr dgd/src/comp/codegenc.c new/dgd/src/comp/codegenc.c
*** dgd/src/comp/codegenc.c Sat Jan 28 13:49:18 1995
--- new/dgd/src/comp/codegenc.c Fri Mar 3 21:25:07 1995
***************
*** 55,61 ****
static void kfun(n)
int n;
{
! output("call_kfun(%d/*%s*/)", n, KFUN(n).name);
}
/*
--- 55,61 ----
static void kfun(n)
int n;
{
! output("call_kfun(%d/*%s*/)", &KFUN(n) - kftab, KFUN(n).name);
}
/*
***************
*** 66,72 ****
int n;
char *arg;
{
! output("call_kfun_arg(%d/*%s*/, %s)", n, KFUN(n).name, arg);
}
/*
--- 66,72 ----
int n;
char *arg;
{
! output("call_kfun_arg(%d/*%s*/, %s)", &KFUN(n) - kftab, KFUN(n).name, arg);
}
/*
diff -cr dgd/src/comp/comp.c new/dgd/src/comp/comp.c
*** dgd/src/comp/comp.c Sat Jan 28 13:51:39 1995
--- new/dgd/src/comp/comp.c Fri Mar 3 21:25:08 1995
***************
*** 233,239 ****
if (ec_push()) {
warning((char *) NULL);
if (argc == 4) {
! /* remove output file */
fclose(stdout);
unlink(argv[3]);
}
--- 233,240 ----
if (ec_push()) {
warning((char *) NULL);
if (argc == 4) {
! /* remove output file: may fail if path is not absolute */
! printf("\n# error Error while compiling\n");
fclose(stdout);
unlink(argv[3]);
}
***************
*** 535,541 ****
*/
void comm_echo(obj, echo)
object *obj;
! bool echo;
{
}
--- 536,542 ----
*/
void comm_echo(obj, echo)
object *obj;
! int echo;
{
}
***************
*** 544,550 ****
* DESCRIPTION: pretend to flush output to all users
*/
void comm_flush(flag)
! bool flag;
{
}
--- 545,551 ----
* DESCRIPTION: pretend to flush output to all users
*/
void comm_flush(flag)
! int flag;
{
}
diff -cr dgd/src/comp/compile.c new/dgd/src/comp/compile.c
*** dgd/src/comp/compile.c Sat Jan 28 16:22:28 1995
--- new/dgd/src/comp/compile.c Fri Mar 3 21:25:08 1995
***************
*** 1064,1081 ****
} else if (!(stmt->flags & F_ENTRY)) {
c_error("unreachable code in switch");
} else if ((size=switch_list->ncase - switch_list->dflt) == 0) {
! /* only a default label */
! stmt = stmt->l.left;
if (switch_list->brk) {
! if (stmt->type == N_BREAK) {
! stmt = (node *) NULL;
! } else {
! /*
! * enclose the break statement with a proper block
! */
! stmt = node_bin(N_FOREVER, 0, (node *) NULL,
! node_mon(N_BLOCK, N_BREAK, stmt));
! }
}
n = c_concat(c_exp_stmt(expr), stmt);
} else if (expr->mod != T_MIXED && expr->mod != switch_list->type &&
--- 1064,1080 ----
} else if (!(stmt->flags & F_ENTRY)) {
c_error("unreachable code in switch");
} else if ((size=switch_list->ncase - switch_list->dflt) == 0) {
! /* only a default label: erase N_CASE */
! n = case_list->r.right->r.right->l.left;
! *(case_list->r.right->r.right) = *n;
! n->type = N_FAKE;
if (switch_list->brk) {
! /*
! * enclose the break statement with a proper block
! */
! stmt = c_concat(stmt, node_mon(N_BREAK, 0, (node *) NULL));
! stmt = node_mon(N_BLOCK, N_BREAK,
! node_bin(N_FOREVER, 0, (node *) NULL, stmt));
}
n = c_concat(c_exp_stmt(expr), stmt);
} else if (expr->mod != T_MIXED && expr->mod != switch_list->type &&
diff -cr dgd/src/comp/csupport.c new/dgd/src/comp/csupport.c
*** dgd/src/comp/csupport.c Tue Nov 22 21:52:17 1994
--- new/dgd/src/comp/csupport.c Fri Mar 3 21:25:08 1995
***************
*** 192,198 ****
{
register kfunc *kf;
! kf = &KFUN(n);
if (PROTO_CLASS(kf->proto) & C_TYPECHECKED) {
i_typecheck(kf->name, "kfun", kf->proto, PROTO_NARGS(kf->proto), TRUE);
}
--- 192,198 ----
{
register kfunc *kf;
! kf = &kftab[n];
if (PROTO_CLASS(kf->proto) & C_TYPECHECKED) {
i_typecheck(kf->name, "kfun", kf->proto, PROTO_NARGS(kf->proto), TRUE);
}
***************
*** 211,217 ****
{
register kfunc *kf;
! kf = &KFUN(n);
if (PROTO_CLASS(kf->proto) & C_TYPECHECKED) {
i_typecheck(kf->name, "kfun", kf->proto, nargs, TRUE);
}
--- 211,217 ----
{
register kfunc *kf;
! kf = &kftab[n];
if (PROTO_CLASS(kf->proto) & C_TYPECHECKED) {
i_typecheck(kf->name, "kfun", kf->proto, nargs, TRUE);
}
diff -cr dgd/src/comp/parser.y new/dgd/src/comp/parser.y
*** dgd/src/comp/parser.y Sat Jan 28 13:49:44 1995
--- new/dgd/src/comp/parser.y Fri Mar 3 21:25:08 1995
***************
*** 1575,1581 ****
/*
* typechecked
*/
! if ((type=n2->mod) != T_VOID || n3->mod != T_VOID) {
type = c_tmatch(n2->mod, n3->mod);
if (type == T_INVALID) {
/* no typechecking here, just let the result be mixed */
--- 1575,1584 ----
/*
* typechecked
*/
! if (n2->mod == T_VOID || n3->mod == T_VOID) {
! /* result can never be used */
! type = T_VOID;
! } else {
type = c_tmatch(n2->mod, n3->mod);
if (type == T_INVALID) {
/* no typechecking here, just let the result be mixed */
diff -cr dgd/src/ed/Makefile new/dgd/src/ed/Makefile
*** dgd/src/ed/Makefile Sun Jan 29 13:45:03 1995
--- new/dgd/src/ed/Makefile Fri Mar 3 21:25:09 1995
***************
*** 14,20 ****
OBJ= line.o buffer.o file.o regexp.o vars.o edcmd.o cmdsub.o
! a.out: $(OBJ) always
cd ..; $(DMAKE) 'DMAKE=$(DMAKE)' 'CC=$(CC)' 'CCFLAGS=$(CCFLAGS)' ed.sub
cd ../host; $(DMAKE) 'DMAKE=$(DMAKE)' 'CC=$(CC)' 'CCFLAGS=$(CCFLAGS)' \
sub
--- 14,20 ----
OBJ= line.o buffer.o file.o regexp.o vars.o edcmd.o cmdsub.o
! a.out: $(OBJ) ed.o always
cd ..; $(DMAKE) 'DMAKE=$(DMAKE)' 'CC=$(CC)' 'CCFLAGS=$(CCFLAGS)' ed.sub
cd ../host; $(DMAKE) 'DMAKE=$(DMAKE)' 'CC=$(CC)' 'CCFLAGS=$(CCFLAGS)' \
sub
diff -cr dgd/src/interpret.c new/dgd/src/interpret.c
*** dgd/src/interpret.c Tue Nov 22 21:52:21 1994
--- new/dgd/src/interpret.c Fri Mar 3 21:25:09 1995
***************
*** 14,23 ****
object *obj; /* current object */
control *ctrl; /* object control block */
dataspace *data; /* dataspace of current object */
- bool external; /* TRUE if it's an external call */
control *p_ctrl; /* program control block */
unsigned short p_index; /* program index */
unsigned short foffset; /* program function offset */
dfuncdef *func; /* current function */
int nargs; /* # arguments */
int nvars; /* # local variables */
--- 14,23 ----
object *obj; /* current object */
control *ctrl; /* object control block */
dataspace *data; /* dataspace of current object */
control *p_ctrl; /* program control block */
unsigned short p_index; /* program index */
unsigned short foffset; /* program function offset */
+ bool external; /* TRUE if it's an external call */
dfuncdef *func; /* current function */
int nargs; /* # arguments */
int nvars; /* # local variables */
***************
*** 1626,1632 ****
bool i_call(obj, func, call_static, nargs)
object *obj;
char *func;
! bool call_static;
int nargs;
{
register dsymbol *symb;
--- 1626,1632 ----
bool i_call(obj, func, call_static, nargs)
object *obj;
char *func;
! int call_static;
int nargs;
{
register dsymbol *symb;
diff -cr dgd/src/lex/Makefile new/dgd/src/lex/Makefile
*** dgd/src/lex/Makefile Sun Jan 29 13:45:04 1995
--- new/dgd/src/lex/Makefile Fri Mar 3 21:25:10 1995
***************
*** 14,20 ****
OBJ= macro.o ppstr.o token.o special.o ppcontrol.o
! a.out: $(OBJ) always
cd ..; $(DMAKE) 'DMAKE=$(DMAKE)' 'CC=$(CC)' 'CCFLAGS=$(CCFLAGS)' lex.sub
cd ../host; $(DMAKE) 'DMAKE=$(DMAKE)' 'CC=$(CC)' 'CCFLAGS=$(CCFLAGS)' \
sub
--- 14,20 ----
OBJ= macro.o ppstr.o token.o special.o ppcontrol.o
! a.out: $(OBJ) lex.o always
cd ..; $(DMAKE) 'DMAKE=$(DMAKE)' 'CC=$(CC)' 'CCFLAGS=$(CCFLAGS)' lex.sub
cd ../host; $(DMAKE) 'DMAKE=$(DMAKE)' 'CC=$(CC)' 'CCFLAGS=$(CCFLAGS)' \
sub
diff -cr dgd/src/object.c new/dgd/src/object.c
*** dgd/src/object.c Tue Nov 22 21:52:23 1994
--- new/dgd/src/object.c Fri Mar 3 21:25:10 1995
***************
*** 479,491 ****
(char *) memchr(p, '\0', buflen) == (char *) NULL) {
/* move remainder to beginning, and refill buffer */
memcpy(buffer, p, buflen);
! p = buffer + buflen;
! buflen = (onamelen > CHUNKSZ - buflen) ?
! CHUNKSZ - buflen : onamelen;
! if (read(fd, p, buflen) != buflen) {
fatal("cannot restore object names");
}
! onamelen -= buflen;
}
mstatic();
strcpy(o->chain.name = ALLOC(char, len = strlen(p) + 1), p);
--- 479,492 ----
(char *) memchr(p, '\0', buflen) == (char *) NULL) {
/* move remainder to beginning, and refill buffer */
memcpy(buffer, p, buflen);
! len = (onamelen > CHUNKSZ - buflen) ?
! CHUNKSZ - buflen : onamelen;
! if (read(fd, buffer + buflen, len) != len) {
fatal("cannot restore object names");
}
! onamelen -= len;
! buflen += len;
! p = buffer;
}
mstatic();
strcpy(o->chain.name = ALLOC(char, len = strlen(p) + 1), p);
diff -cr dgd/src/version.h new/dgd/src/version.h
*** dgd/src/version.h Sat Jan 28 13:56:53 1995
--- new/dgd/src/version.h Fri Mar 3 21:25:10 1995
***************
*** 1 ****
! # define VERSION "1.0.9"
--- 1 ----
! # define VERSION "1.0.9.1"