Made a bit more portable
This commit is contained in:
parent
62c9bd14ce
commit
750aad12f6
2 changed files with 3 additions and 2 deletions
|
@ -321,6 +321,7 @@ short *grabcore(size) int size; {
|
||||||
short *newcore(size) int size; {
|
short *newcore(size) int size; {
|
||||||
register short *p,*q;
|
register short *p,*q;
|
||||||
|
|
||||||
|
size = (size + sizeof(int) - 1) & ~(sizeof(int) - 1);
|
||||||
if( size < 2*MAXSHORT ) {
|
if( size < 2*MAXSHORT ) {
|
||||||
if ((p=freelist[size/sizeof(short)]) != (short *) 0)
|
if ((p=freelist[size/sizeof(short)]) != (short *) 0)
|
||||||
freelist[size/sizeof(short)] = *(short **) p;
|
freelist[size/sizeof(short)] = *(short **) p;
|
||||||
|
|
|
@ -21,7 +21,7 @@ static char rcsid[] = "$Header$";
|
||||||
*/
|
*/
|
||||||
|
|
||||||
main(argc,argv) int argc; char *argv[]; {
|
main(argc,argv) int argc; char *argv[]; {
|
||||||
short somespace[STACKROOM];
|
int somespace[STACKROOM];
|
||||||
|
|
||||||
progname = argv[0];
|
progname = argv[0];
|
||||||
while (argc-->1 && **++argv == '-')
|
while (argc-->1 && **++argv == '-')
|
||||||
|
@ -34,7 +34,7 @@ main(argc,argv) int argc; char *argv[]; {
|
||||||
if (freopen(*argv,"r",stdin) == NULL)
|
if (freopen(*argv,"r",stdin) == NULL)
|
||||||
error("Cannot open %s",*argv);
|
error("Cannot open %s",*argv);
|
||||||
fileinit();
|
fileinit();
|
||||||
coreinit(somespace,somespace+STACKROOM);
|
coreinit((short *)somespace,(short *)(somespace+STACKROOM));
|
||||||
getlines();
|
getlines();
|
||||||
cleanup();
|
cleanup();
|
||||||
return(0);
|
return(0);
|
||||||
|
|
Loading…
Add table
Reference in a new issue