Being a bit more strict on warnings (-Wall).
This commit is contained in:
parent
74fb1cff61
commit
a262a916dc
12
h/missing_proto.h
Normal file
12
h/missing_proto.h
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#ifndef H_MISSING_PROTO_H
|
||||||
|
#define H_MISSING_PROTO_H
|
||||||
|
|
||||||
|
#ifdef NOSBRK
|
||||||
|
void *sbrk(__intptr_t increment);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef NOMKTEMP
|
||||||
|
char *mktemp(char *template);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* H_MISSING_H */
|
||||||
@ -3,10 +3,15 @@
|
|||||||
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||||
*/
|
*/
|
||||||
|
#ifndef H_EM_CODE_H
|
||||||
|
#define H_EM_CODE_H
|
||||||
|
|
||||||
#include "em_mesX.h"
|
#include "em_mesX.h"
|
||||||
#include "ansi.h"
|
#include "ansi.h"
|
||||||
|
|
||||||
|
void C_flush();
|
||||||
|
void C_internal_error();
|
||||||
|
|
||||||
_PROTOTYPE(void C_ms_com, (char *));
|
_PROTOTYPE(void C_ms_com, (char *));
|
||||||
_PROTOTYPE(void C_ms_ego, (int, arith, arith, int));
|
_PROTOTYPE(void C_ms_ego, (int, arith, arith, int));
|
||||||
_PROTOTYPE(void C_ms_emx, ( arith, arith));
|
_PROTOTYPE(void C_ms_emx, ( arith, arith));
|
||||||
@ -34,3 +39,5 @@ _PROTOTYPE(void C_ms_std, (char *, int, int));
|
|||||||
#include "em_codeEK.h"
|
#include "em_codeEK.h"
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif /* H_EM_CODE_H */
|
||||||
@ -13,6 +13,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "alloc.h"
|
#include "alloc.h"
|
||||||
|
#include "print.h"
|
||||||
#include "em_arith.h"
|
#include "em_arith.h"
|
||||||
#include "insert.h"
|
#include "insert.h"
|
||||||
#include "em_private.h"
|
#include "em_private.h"
|
||||||
@ -31,7 +32,6 @@ File *C_ofp;
|
|||||||
#ifndef INCORE
|
#ifndef INCORE
|
||||||
File *C_tfr;
|
File *C_tfr;
|
||||||
char *C_tmpfile;
|
char *C_tmpfile;
|
||||||
char *strcpy(), *strcat();
|
|
||||||
char *C_ibuf = 0;
|
char *C_ibuf = 0;
|
||||||
long C_current_out;
|
long C_current_out;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -13,6 +13,9 @@
|
|||||||
|
|
||||||
#include <em_path.h>
|
#include <em_path.h>
|
||||||
#include <alloc.h>
|
#include <alloc.h>
|
||||||
|
|
||||||
|
#include <em_code.h>
|
||||||
|
|
||||||
#include "insert.h"
|
#include "insert.h"
|
||||||
|
|
||||||
char *C_tmpdir = TMP_DIR;
|
char *C_tmpdir = TMP_DIR;
|
||||||
|
|||||||
@ -5,6 +5,11 @@
|
|||||||
*/
|
*/
|
||||||
#include "obj.h"
|
#include "obj.h"
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Parts of the output file.
|
* Parts of the output file.
|
||||||
*/
|
*/
|
||||||
@ -39,12 +44,9 @@ static long rd_base;
|
|||||||
|
|
||||||
static int sectionnr;
|
static int sectionnr;
|
||||||
|
|
||||||
static void
|
static void OUTREAD(int p, char *b, long n)
|
||||||
OUTREAD(p, b, n)
|
|
||||||
char *b;
|
|
||||||
long n;
|
|
||||||
{
|
{
|
||||||
register long l = outseek[p];
|
long l = outseek[p];
|
||||||
|
|
||||||
if (currpos != l) {
|
if (currpos != l) {
|
||||||
lseek(outfile, l, 0);
|
lseek(outfile, l, 0);
|
||||||
@ -58,9 +60,7 @@ OUTREAD(p, b, n)
|
|||||||
/*
|
/*
|
||||||
* Open the output file according to the chosen strategy.
|
* Open the output file according to the chosen strategy.
|
||||||
*/
|
*/
|
||||||
int
|
int rd_open(char *f)
|
||||||
rd_open(f)
|
|
||||||
char *f;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
if ((outfile = open(f, 0)) < 0)
|
if ((outfile = open(f, 0)) < 0)
|
||||||
@ -70,10 +70,9 @@ rd_open(f)
|
|||||||
|
|
||||||
static int offcnt;
|
static int offcnt;
|
||||||
|
|
||||||
int
|
int rd_fdopen(int fd)
|
||||||
rd_fdopen(fd)
|
|
||||||
{
|
{
|
||||||
register int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < NPARTS; i++) outseek[i] = 0;
|
for (i = 0; i < NPARTS; i++) outseek[i] = 0;
|
||||||
offcnt = 0;
|
offcnt = 0;
|
||||||
@ -88,32 +87,28 @@ rd_fdopen(fd)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void rd_close()
|
||||||
rd_close()
|
|
||||||
{
|
{
|
||||||
|
|
||||||
close(outfile);
|
close(outfile);
|
||||||
outfile = -1;
|
outfile = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int rd_fd()
|
||||||
rd_fd()
|
|
||||||
{
|
{
|
||||||
return outfile;
|
return outfile;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void rd_ohead(struct outhead *head)
|
||||||
rd_ohead(head)
|
|
||||||
register struct outhead *head;
|
|
||||||
{
|
{
|
||||||
register long off;
|
long off;
|
||||||
|
|
||||||
OUTREAD(PARTEMIT, (char *) head, (long) SZ_HEAD);
|
OUTREAD(PARTEMIT, (char *) head, (long) SZ_HEAD);
|
||||||
#if BYTE_ORDER == 0x0123
|
#if BYTE_ORDER == 0x0123
|
||||||
if (sizeof(struct outhead) != SZ_HEAD)
|
if (sizeof(struct outhead) != SZ_HEAD)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
register char *c = (char *) head + (SZ_HEAD-4);
|
char *c = (char *) head + (SZ_HEAD-4);
|
||||||
|
|
||||||
head->oh_nchar = get4(c);
|
head->oh_nchar = get4(c);
|
||||||
c -= 4; head->oh_nemit = get4(c);
|
c -= 4; head->oh_nemit = get4(c);
|
||||||
@ -136,21 +131,16 @@ rd_ohead(head)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void rd_rew_relos(struct outhead *head)
|
||||||
rd_rew_relos(head)
|
|
||||||
register struct outhead *head;
|
|
||||||
{
|
{
|
||||||
register long off = OFF_RELO(*head) + rd_base;
|
long off = OFF_RELO(*head) + rd_base;
|
||||||
|
|
||||||
BEGINSEEK(PARTRELO, off);
|
BEGINSEEK(PARTRELO, off);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void rd_sect(struct outsect *sect, unsigned int cnt)
|
||||||
rd_sect(sect, cnt)
|
|
||||||
register struct outsect *sect;
|
|
||||||
register unsigned int cnt;
|
|
||||||
{
|
{
|
||||||
register char *c = (char *) sect + cnt * SZ_SECT;
|
char *c = (char *) sect + cnt * SZ_SECT;
|
||||||
|
|
||||||
OUTREAD(PARTEMIT, (char *) sect, (long)cnt * SZ_SECT);
|
OUTREAD(PARTEMIT, (char *) sect, (long)cnt * SZ_SECT);
|
||||||
sect += cnt;
|
sect += cnt;
|
||||||
@ -171,8 +161,7 @@ rd_sect(sect, cnt)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void rd_outsect(int s)
|
||||||
rd_outsect(s)
|
|
||||||
{
|
{
|
||||||
OUTSECT(s);
|
OUTSECT(s);
|
||||||
sectionnr = s;
|
sectionnr = s;
|
||||||
@ -181,27 +170,20 @@ rd_outsect(s)
|
|||||||
/*
|
/*
|
||||||
* We don't have to worry about byte order here.
|
* We don't have to worry about byte order here.
|
||||||
*/
|
*/
|
||||||
void
|
void rd_emit(char *emit, long cnt)
|
||||||
rd_emit(emit, cnt)
|
|
||||||
char *emit;
|
|
||||||
long cnt;
|
|
||||||
{
|
{
|
||||||
OUTREAD(PARTEMIT, emit, cnt);
|
OUTREAD(PARTEMIT, emit, cnt);
|
||||||
offset[sectionnr] += cnt;
|
offset[sectionnr] += cnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void rd_relo(struct outrelo *relo, unsigned int cnt)
|
||||||
rd_relo(relo, cnt)
|
|
||||||
register struct outrelo *relo;
|
|
||||||
register unsigned int cnt;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
OUTREAD(PARTRELO, (char *) relo, (long) cnt * SZ_RELO);
|
OUTREAD(PARTRELO, (char *) relo, (long) cnt * SZ_RELO);
|
||||||
#if BYTE_ORDER == 0x0123
|
#if BYTE_ORDER == 0x0123
|
||||||
if (sizeof(struct outrelo) != SZ_RELO)
|
if (sizeof(struct outrelo) != SZ_RELO)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
register char *c = (char *) relo + (long) cnt * SZ_RELO;
|
char *c = (char *) relo + (long) cnt * SZ_RELO;
|
||||||
|
|
||||||
relo += cnt;
|
relo += cnt;
|
||||||
while (cnt--) {
|
while (cnt--) {
|
||||||
@ -214,18 +196,14 @@ rd_relo(relo, cnt)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void rd_name(struct outname *name, unsigned int cnt)
|
||||||
rd_name(name, cnt)
|
|
||||||
register struct outname *name;
|
|
||||||
register unsigned int cnt;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
OUTREAD(PARTNAME, (char *) name, (long) cnt * SZ_NAME);
|
OUTREAD(PARTNAME, (char *) name, (long) cnt * SZ_NAME);
|
||||||
#if BYTE_ORDER == 0x0123
|
#if BYTE_ORDER == 0x0123
|
||||||
if (sizeof(struct outname) != SZ_NAME)
|
if (sizeof(struct outname) != SZ_NAME)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
register char *c = (char *) name + (long) cnt * SZ_NAME;
|
char *c = (char *) name + (long) cnt * SZ_NAME;
|
||||||
|
|
||||||
name += cnt;
|
name += cnt;
|
||||||
while (cnt--) {
|
while (cnt--) {
|
||||||
@ -238,20 +216,13 @@ rd_name(name, cnt)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void rd_string(char *addr, long len)
|
||||||
rd_string(addr, len)
|
|
||||||
char *addr;
|
|
||||||
long len;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
OUTREAD(PARTCHAR, addr, len);
|
OUTREAD(PARTCHAR, addr, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SYMDBUG
|
#ifdef SYMDBUG
|
||||||
void
|
void rd_dbug(char *buf, long size)
|
||||||
rd_dbug(buf, size)
|
|
||||||
char *buf;
|
|
||||||
long size;
|
|
||||||
{
|
{
|
||||||
OUTREAD(PARTDBUG, buf, size);
|
OUTREAD(PARTDBUG, buf, size);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,14 +5,16 @@
|
|||||||
*/
|
*/
|
||||||
#include "obj.h"
|
#include "obj.h"
|
||||||
|
|
||||||
int
|
void rd_fatal();
|
||||||
rd_arhdr(fd, arhdr)
|
|
||||||
register struct ar_hdr *arhdr;
|
#include <unistd.h>
|
||||||
|
|
||||||
|
int rd_arhdr(int fd, struct ar_hdr *arhdr)
|
||||||
{
|
{
|
||||||
char buf[AR_TOTAL];
|
char buf[AR_TOTAL];
|
||||||
register char *c = buf;
|
char *c = buf;
|
||||||
register char *p = arhdr->ar_name;
|
char *p = arhdr->ar_name;
|
||||||
register int i;
|
int i;
|
||||||
|
|
||||||
i = read(fd, c, AR_TOTAL);
|
i = read(fd, c, AR_TOTAL);
|
||||||
if (i == 0) return 0;
|
if (i == 0) return 0;
|
||||||
|
|||||||
@ -6,24 +6,24 @@
|
|||||||
|
|
||||||
#include "obj.h"
|
#include "obj.h"
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
#define MININT (1 << (sizeof(int) * 8 - 1))
|
#define MININT (1 << (sizeof(int) * 8 - 1))
|
||||||
#define MAXCHUNK (~MININT) /* Highest count we read(2). */
|
#define MAXCHUNK (~MININT) /* Highest count we read(2). */
|
||||||
/* Unfortunately, MAXCHUNK is too large with some compilers. Put it in
|
/* Unfortunately, MAXCHUNK is too large with some compilers. Put it in
|
||||||
an int!
|
an int!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
void rd_fatal();
|
||||||
|
|
||||||
static int maxchunk = MAXCHUNK;
|
static int maxchunk = MAXCHUNK;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We don't have to worry about byte order here.
|
* We don't have to worry about byte order here.
|
||||||
* Just read "cnt" bytes from file-descriptor "fd".
|
* Just read "cnt" bytes from file-descriptor "fd".
|
||||||
*/
|
*/
|
||||||
void
|
void rd_bytes(int fd, char *string, long cnt)
|
||||||
rd_bytes(fd, string, cnt)
|
|
||||||
register char *string;
|
|
||||||
register long cnt;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
while (cnt) {
|
while (cnt) {
|
||||||
register int n = cnt >= maxchunk ? maxchunk : cnt;
|
register int n = cnt >= maxchunk ? maxchunk : cnt;
|
||||||
|
|
||||||
|
|||||||
@ -27,9 +27,7 @@ int __sectionnr;
|
|||||||
#define sectionnr __sectionnr
|
#define sectionnr __sectionnr
|
||||||
static int offcnt;
|
static int offcnt;
|
||||||
|
|
||||||
void
|
void __wr_flush(struct fil *ptr)
|
||||||
__wr_flush(ptr)
|
|
||||||
register struct fil *ptr;
|
|
||||||
{
|
{
|
||||||
#ifdef OUTSEEK
|
#ifdef OUTSEEK
|
||||||
/* seek to correct position even if we aren't going to write now */
|
/* seek to correct position even if we aren't going to write now */
|
||||||
|
|||||||
@ -5,14 +5,12 @@
|
|||||||
*/
|
*/
|
||||||
#include "obj.h"
|
#include "obj.h"
|
||||||
|
|
||||||
void
|
void wr_arhdr(int fd, struct ar_hdr *arhdr)
|
||||||
wr_arhdr(fd, arhdr)
|
|
||||||
register struct ar_hdr *arhdr;
|
|
||||||
{
|
{
|
||||||
char buf[AR_TOTAL];
|
char buf[AR_TOTAL];
|
||||||
register char *c = buf;
|
char *c = buf;
|
||||||
register char *p = arhdr->ar_name;
|
char *p = arhdr->ar_name;
|
||||||
register int i = 14;
|
int i = 14;
|
||||||
|
|
||||||
while (i--) {
|
while (i--) {
|
||||||
*c++ = *p++;
|
*c++ = *p++;
|
||||||
|
|||||||
@ -6,6 +6,10 @@
|
|||||||
|
|
||||||
#include "obj.h"
|
#include "obj.h"
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
void wr_fatal();
|
||||||
|
|
||||||
#define MININT (1 << (sizeof(int) * 8 - 1))
|
#define MININT (1 << (sizeof(int) * 8 - 1))
|
||||||
#define MAXCHUNK (~MININT) /* Highest count we write(2). */
|
#define MAXCHUNK (~MININT) /* Highest count we write(2). */
|
||||||
/* Notice that MAXCHUNK itself might be too large with some compilers.
|
/* Notice that MAXCHUNK itself might be too large with some compilers.
|
||||||
@ -17,14 +21,10 @@ static int maxchunk = MAXCHUNK;
|
|||||||
/*
|
/*
|
||||||
* Just write "cnt" bytes to file-descriptor "fd".
|
* Just write "cnt" bytes to file-descriptor "fd".
|
||||||
*/
|
*/
|
||||||
void
|
void wr_bytes(int fd, char *string, long cnt)
|
||||||
wr_bytes(fd, string, cnt)
|
|
||||||
register char *string;
|
|
||||||
register long cnt;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
while (cnt) {
|
while (cnt) {
|
||||||
register int n = cnt >= maxchunk ? maxchunk : cnt;
|
int n = cnt >= maxchunk ? maxchunk : cnt;
|
||||||
|
|
||||||
if (write(fd, string, n) != n)
|
if (write(fd, string, n) != n)
|
||||||
wr_fatal();
|
wr_fatal();
|
||||||
|
|||||||
@ -6,10 +6,7 @@
|
|||||||
|
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
|
|
||||||
int
|
int sys_access(char *path, int mode)
|
||||||
sys_access(path, mode)
|
|
||||||
char *path;
|
|
||||||
int mode;
|
|
||||||
{
|
{
|
||||||
return access(path, mode) == 0;
|
return access(path, mode) == 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,10 +6,7 @@
|
|||||||
|
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
|
|
||||||
int
|
int sys_chmode(char *path, int mode)
|
||||||
sys_chmode(path, mode)
|
|
||||||
char *path;
|
|
||||||
int mode;
|
|
||||||
{
|
{
|
||||||
return chmod(path, mode) == 0;
|
return chmod(path, mode) == 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,9 +6,7 @@
|
|||||||
|
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
|
|
||||||
void
|
void sys_close(File *fp)
|
||||||
sys_close(fp)
|
|
||||||
register File *fp;
|
|
||||||
{
|
{
|
||||||
if (fp) {
|
if (fp) {
|
||||||
fp->o_flags = 0;
|
fp->o_flags = 0;
|
||||||
|
|||||||
@ -8,11 +8,7 @@
|
|||||||
|
|
||||||
extern File *_get_entry();
|
extern File *_get_entry();
|
||||||
|
|
||||||
int
|
int sys_create(File **filep, char *path, int mode)
|
||||||
sys_create(filep, path, mode)
|
|
||||||
File **filep;
|
|
||||||
char *path;
|
|
||||||
int mode;
|
|
||||||
{
|
{
|
||||||
register fd;
|
register fd;
|
||||||
register File *fp;
|
register File *fp;
|
||||||
|
|||||||
@ -8,6 +8,13 @@
|
|||||||
|
|
||||||
#include <ansi.h>
|
#include <ansi.h>
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <missing_proto.h>
|
||||||
|
|
||||||
struct _sys_fildes {
|
struct _sys_fildes {
|
||||||
int o_fd; /* UNIX filedescriptor */
|
int o_fd; /* UNIX filedescriptor */
|
||||||
int o_flags; /* flags for open; 0 if not used */
|
int o_flags; /* flags for open; 0 if not used */
|
||||||
|
|||||||
@ -387,10 +387,6 @@ static short LL_index[] = {0,0,
|
|||||||
* This file is copied into Lpars.c.
|
* This file is copied into Lpars.c.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef lint
|
|
||||||
static char *rcsid = "$Id$";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
unsigned int LLtcnt[LL_NTERMINALS];
|
unsigned int LLtcnt[LL_NTERMINALS];
|
||||||
unsigned int LLscnt[LL_NSETS];
|
unsigned int LLscnt[LL_NSETS];
|
||||||
int LLcsymb, LLsymb;
|
int LLcsymb, LLsymb;
|
||||||
|
|||||||
@ -15,40 +15,37 @@
|
|||||||
* alloc.c
|
* alloc.c
|
||||||
* Interface to malloc() and realloc()
|
* Interface to malloc() and realloc()
|
||||||
*/
|
*/
|
||||||
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
# include "types.h"
|
# include "types.h"
|
||||||
# include "extern.h"
|
# include "extern.h"
|
||||||
|
# include "LLgen.h"
|
||||||
# ifndef NORCSID
|
|
||||||
static string rcsid = "$Id$";
|
|
||||||
# endif
|
|
||||||
|
|
||||||
static string e_nomem = "Out of memory";
|
static string e_nomem = "Out of memory";
|
||||||
|
|
||||||
p_mem
|
p_mem alloc(unsigned int size)
|
||||||
alloc(size) unsigned size; {
|
{
|
||||||
/*
|
/*
|
||||||
Allocate "size" bytes. Panic if it fails
|
Allocate "size" bytes. Panic if it fails
|
||||||
*/
|
*/
|
||||||
p_mem p;
|
p_mem p;
|
||||||
|
|
||||||
if ((p = malloc(size)) == 0) fatal(linecount,e_nomem);
|
if ((p = malloc(size)) == 0) fatal(linecount,e_nomem, NULL, NULL);
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
p_mem
|
p_mem ralloc(p_mem p, unsigned int size)
|
||||||
ralloc(p,size) p_mem p; unsigned size; {
|
{
|
||||||
/*
|
/*
|
||||||
Re-allocate the chunk of memory indicated by "p", to
|
Re-allocate the chunk of memory indicated by "p", to
|
||||||
occupy "size" bytes
|
occupy "size" bytes
|
||||||
*/
|
*/
|
||||||
if ((p = realloc(p,size)) == 0) fatal(linecount,e_nomem);
|
if ((p = realloc(p,size)) == 0) fatal(linecount,e_nomem, NULL, NULL);
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
p_mem
|
p_mem new_mem(p_info p)
|
||||||
new_mem(p) register p_info p; {
|
{
|
||||||
/*
|
/*
|
||||||
This routine implements arrays that can grow.
|
This routine implements arrays that can grow.
|
||||||
It must be called every time a new element is added to it.
|
It must be called every time a new element is added to it.
|
||||||
@ -60,7 +57,7 @@ new_mem(p) register p_info p; {
|
|||||||
be updated each time this routine is called
|
be updated each time this routine is called
|
||||||
*/
|
*/
|
||||||
p_mem rp;
|
p_mem rp;
|
||||||
unsigned sz;
|
unsigned int sz;
|
||||||
|
|
||||||
if (p->i_max >= p->i_top) { /* No more free elements */
|
if (p->i_max >= p->i_top) { /* No more free elements */
|
||||||
sz = p->i_size;
|
sz = p->i_size;
|
||||||
|
|||||||
@ -579,6 +579,7 @@ static int nc_nfollow(p_nont p)
|
|||||||
return follow(p->n_nc_follow, p->n_rule);
|
return follow(p->n_nc_follow, p->n_rule);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
static int nc_follow(p_set setp, p_gram p)
|
static int nc_follow(p_set setp, p_gram p)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@ -650,6 +651,7 @@ static int nc_follow(p_set setp, p_gram p)
|
|||||||
p++;
|
p++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@ -20,10 +20,6 @@
|
|||||||
# include "extern.h"
|
# include "extern.h"
|
||||||
# include "io.h"
|
# include "io.h"
|
||||||
|
|
||||||
# ifndef NORCSID
|
|
||||||
static string rcsid4 = "$Id$";
|
|
||||||
# endif
|
|
||||||
|
|
||||||
char ltext[LTEXTSZ];
|
char ltext[LTEXTSZ];
|
||||||
p_nont nonterms;
|
p_nont nonterms;
|
||||||
p_nont maxnt;
|
p_nont maxnt;
|
||||||
|
|||||||
@ -24,16 +24,9 @@
|
|||||||
|
|
||||||
#include "LLgen.h"
|
#include "LLgen.h"
|
||||||
|
|
||||||
# ifndef NORCSID
|
|
||||||
static string rcsid5 = "$Id$";
|
|
||||||
# endif
|
|
||||||
|
|
||||||
/* In this file the following routines are defined: */
|
/* In this file the following routines are defined: */
|
||||||
/* extern UNLINK(); */
|
void UNLINK(string x)
|
||||||
/* extern RENAME(); */
|
{
|
||||||
/* extern string libpath(); */
|
|
||||||
|
|
||||||
void UNLINK(string x) {
|
|
||||||
/* Must remove the file "x" */
|
/* Must remove the file "x" */
|
||||||
|
|
||||||
#ifdef USE_SYS
|
#ifdef USE_SYS
|
||||||
|
|||||||
@ -23,12 +23,15 @@
|
|||||||
#include "assert.h"
|
#include "assert.h"
|
||||||
#include "LLgen.h"
|
#include "LLgen.h"
|
||||||
|
|
||||||
|
#include <missing_proto.h>
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[])
|
||||||
register string arg;
|
{
|
||||||
|
string arg;
|
||||||
string libpath();
|
string libpath();
|
||||||
char *beg_sbrk = 0;
|
char *beg_sbrk = 0;
|
||||||
|
|
||||||
|
|||||||
@ -4,8 +4,6 @@
|
|||||||
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
* See the copyright notice in the ACK home directory, in the file "Copyright".
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
#include "../share/types.h"
|
#include "../share/types.h"
|
||||||
#include "../share/alloc.h"
|
#include "../share/alloc.h"
|
||||||
#include "cs.h"
|
#include "cs.h"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user