1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

Another round of accumulated tweaks and cleanups

Notable changes:

src/cmd/ksh93/*.c:
- Get rid of all the dtuserdata(FOO,&sh,1) calls backported in
  cc492752. These set pointers to sh in Cdt objects. As of
  b590a9f1, the code does not use any pointers to sh, so these are
  superfluous.

src/cmd/ksh93/data/builtins.c,
src/cmd/ksh93/sh.1:
- As of ksh 93l 2001-06-01, the -h/trackall option has no effect at
  all, so trim its documentation.

src/lib/libast/man/stk.3,
src/lib/libast/man/stak.3:
- Correct the documentation on what the ST(A)K_SMALL option bit
  actually does based on a reading of the code.
- Document the STK_NULL option bit.

README.md,
src/cmd/ksh93/README:
- Add a note that -fdiagnostics-color=always will break the build.
  Ref.: https://github.com/ksh93/ksh/issues/379

src/lib/libast/Mamfile:
- Remove a 'rm -f astmath' command -- a file that is never created.
  But on Cygwin this removes astmath.exe, which *is* used. As a
  result, executing it failed on Cygwin, so the system incorrectly
  detected that Cygwin needs -lm for math functions.
This commit is contained in:
Martijn Dekker 2022-01-28 20:30:52 +00:00
parent bd9faa81bf
commit 304648d0c5
19 changed files with 27 additions and 64 deletions

View file

@ -359,7 +359,6 @@ make install
exec - 0) rm -f astmath.exe ;;
exec - *) touch astmath.exe ;;
exec - esac
exec - rm -f astmath
done astmath.exe dontcare generated
prev FEATURE/aso
exec - sed -e '/^#define _REQ_/!d' -e 's/#define _REQ_\([a-z0-9_]*\).*/ -l\1/' FEATURE/aso >> ast.req

View file

@ -54,9 +54,9 @@ There is a preset initial active stack.
To use an additional stack, it is necessary to create it and to
install it as the active stack.
A stack is created with the \f3stakcreate\fP() function.
A \fIflags\fP argument of \f3STAK_SMALL\fP indicates that unused
space on the stack should be freed whenever this stack ceases
to be the active stack.
The \fIflags\fP argument is an options bitmask.
If the \f3STAK_SMALL\fP bit is set, the stack allocates memory in
small blocks, optimizing for memory usage at the expense of performance.
If successful,
\f3stakcreate\fP() returns a pointer to a stack whose reference
count is 1.

View file

@ -55,9 +55,11 @@ There is a preset initial active stack.
To use an additional stack, it is necessary to create it and to
install it as the active stack.
A stack is created with the \f3stkopen\fP() function.
A \fIflags\fP argument of \f3STK_SMALL\fP indicates that unused
space on the stack should be freed whenever this stack ceases
to be the active stack.
The \fIflags\fP argument is an options bitmask.
If the \f3STK_SMALL\fP bit is set, the stack allocates memory in
small blocks, optimizing for memory usage at the expense of performance.
If the \f3STK_NULL\fP bit is set, a stack overflow will cause stack
operations to return a null pointer instead of throwing an error.
If successful,
\f3stkopen\fP() returns a pointer to a stack whose reference
count is 1.

View file

@ -229,11 +229,9 @@ Sfio_t *stkopen(int flags)
if(flags&STK_NULL) sp->stkoverflow = 0;
else sp->stkoverflow = stkcur?stkcur->stkoverflow:overflow;
bsize = init+sizeof(struct frame);
#ifndef USE_REALLOC
if(flags&STK_SMALL)
bsize = roundof(bsize,STK_FSIZE/16);
else
#endif /* USE_REALLOC */
bsize = roundof(bsize,STK_FSIZE);
bsize -= sizeof(struct frame);
if(!(fp=newof((char*)0,struct frame, 1,bsize)))
@ -279,9 +277,6 @@ Sfio_t *stkinstall(Sfio_t *stream, _stk_overflow_ oflow)
if(stream!=stkstd)
sfstack(stkstd,stream);
stkcur = sp;
#ifdef USE_REALLOC
/*** someday ***/
#endif /* USE_REALLOC */
}
else
sp = stkcur;
@ -509,10 +504,8 @@ static char *stkgrow(register Sfio_t *stream, size_t size)
int nn=0,add=1;
n += (m + sizeof(struct frame)+1);
if(sp->stkflags&STK_SMALL)
#ifndef USE_REALLOC
n = roundof(n,STK_FSIZE/16);
else
#endif /* !USE_REALLOC */
n = roundof(n,STK_FSIZE);
/* see whether current frame can be extended */
if(stkptr(stream,0)==sp->stkbase+sizeof(struct frame))