X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=functions%2F_PDCLIB%2Fprint.c;h=d47a48d977f18e78e76dbc2c3712100f6ecfec8b;hp=ddb6b99fc979d30a7847c8499b7c2fa25e8bdb9a;hb=66c9a724d570ec507c640f6708fe48c4b8ca8b80;hpb=f8dfae46eb161173a4460a98075669e810c8bb7b diff --git a/functions/_PDCLIB/print.c b/functions/_PDCLIB/print.c index ddb6b99..d47a48d 100644 --- a/functions/_PDCLIB/print.c +++ b/functions/_PDCLIB/print.c @@ -40,7 +40,20 @@ n - pointer to maximum number of characters to be delivered in this call s - the buffer into which the character shall be delivered */ -#define DELIVER( x ) do { if ( status->i < status->n ) { if ( status->stream != NULL ) { status->stream->buffer[status->stream->bufidx++] = x; if ( ( status->stream->bufidx == status->stream->bufsize ) || ( ( status->stream->status & _IOLBF ) && ( x == '\n' ) ) || ( status->stream->status & _IONBF ) ) fflush( status->stream ); } else status->s[status->i] = x; } ++(status->i); } while ( 0 ) +#define DELIVER( x ) \ +do { \ + if ( status->i < status->n ) { \ + if ( status->stream != NULL ) { \ + status->stream->buffer[status->stream->bufidx++] = x; \ + if ( ( status->stream->bufidx == status->stream->bufsize ) \ + || ( ( status->stream->status & _IOLBF ) && ( x == '\n' ) ) \ + || ( status->stream->status & _IONBF ) ) \ + fflush( status->stream ); \ + } else \ + status->s[status->i] = x; \ + } \ + ++(status->i); \ +} while ( 0 ) /* This function recursively converts a given integer value to a character stream. The conversion is done under the control of a given status struct