From: ceriel Date: Tue, 19 Apr 1988 19:46:28 +0000 (+0000) Subject: Made a bit more portable X-Git-Tag: release-5-5~3373 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=750aad12f6ee3a015ab63ae61463911c8a7b9cdf;p=ack.git Made a bit more portable --- diff --git a/util/opt/alloc.c b/util/opt/alloc.c index 5d095643a..6c489f76a 100644 --- a/util/opt/alloc.c +++ b/util/opt/alloc.c @@ -321,6 +321,7 @@ short *grabcore(size) int size; { short *newcore(size) int size; { register short *p,*q; + size = (size + sizeof(int) - 1) & ~(sizeof(int) - 1); if( size < 2*MAXSHORT ) { if ((p=freelist[size/sizeof(short)]) != (short *) 0) freelist[size/sizeof(short)] = *(short **) p; diff --git a/util/opt/main.c b/util/opt/main.c index 853e3e57d..778e5e071 100644 --- a/util/opt/main.c +++ b/util/opt/main.c @@ -21,7 +21,7 @@ static char rcsid[] = "$Header$"; */ main(argc,argv) int argc; char *argv[]; { - short somespace[STACKROOM]; + int somespace[STACKROOM]; progname = argv[0]; while (argc-->1 && **++argv == '-') @@ -34,7 +34,7 @@ main(argc,argv) int argc; char *argv[]; { if (freopen(*argv,"r",stdin) == NULL) error("Cannot open %s",*argv); fileinit(); - coreinit(somespace,somespace+STACKROOM); + coreinit((short *)somespace,(short *)(somespace+STACKROOM)); getlines(); cleanup(); return(0);