X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2F_PDCLIB%2Fprint.c;h=d47a48d977f18e78e76dbc2c3712100f6ecfec8b;hb=f2a617905a769178f35c9ea1abdd080023279e4e;hp=ddb6b99fc979d30a7847c8499b7c2fa25e8bdb9a;hpb=b42a534f135f12fe47a6bc343bb6cc2c0e973198;p=pdclib.old 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