Format macros nicely.

This commit is contained in:
Jim Derry 2017-10-03 14:14:59 -04:00
parent ab67229238
commit 9679d88fae

View file

@ -1184,35 +1184,30 @@ int tidyDocSaveFile( TidyDocImpl* doc, ctmbstr filnam )
*/ */
#if !defined(NO_SETMODE_SUPPORT) #if !defined(NO_SETMODE_SUPPORT)
# if defined(_WIN32) || defined(OS2_OS) # if defined(_WIN32) || defined(OS2_OS)
# include <fcntl.h> # include <fcntl.h>
# include <io.h> # include <io.h>
# endif # endif
#endif #endif
int tidyDocSaveStdout( TidyDocImpl* doc ) int tidyDocSaveStdout( TidyDocImpl* doc )
{ {
#if !defined(NO_SETMODE_SUPPORT) #if !defined(NO_SETMODE_SUPPORT)
# if defined(_WIN32) || defined(OS2_OS) # if defined(_WIN32) || defined(OS2_OS)
int oldstdoutmode = -1, oldstderrmode = -1; int oldstdoutmode = -1, oldstderrmode = -1;
# endif # endif
#endif #endif
int status = 0; int status = 0;
uint outenc = cfg( doc, TidyOutCharEncoding ); uint outenc = cfg( doc, TidyOutCharEncoding );
uint nl = cfg( doc, TidyNewline ); uint nl = cfg( doc, TidyNewline );
StreamOut* out = TY_(FileOutput)( doc, stdout, outenc, nl ); StreamOut* out = TY_(FileOutput)( doc, stdout, outenc, nl );
#if !defined(NO_SETMODE_SUPPORT) #if !defined(NO_SETMODE_SUPPORT)
# if defined(_WIN32) || defined(OS2_OS) # if defined(_WIN32) || defined(OS2_OS)
oldstdoutmode = setmode( fileno(stdout), _O_BINARY ); oldstdoutmode = setmode( fileno(stdout), _O_BINARY );
oldstderrmode = setmode( fileno(stderr), _O_BINARY ); oldstderrmode = setmode( fileno(stderr), _O_BINARY );
# endif # endif
#endif #endif
if ( 0 == status ) if ( 0 == status )
@ -1222,14 +1217,12 @@ int tidyDocSaveStdout( TidyDocImpl* doc )
fflush(stderr); fflush(stderr);
#if !defined(NO_SETMODE_SUPPORT) #if !defined(NO_SETMODE_SUPPORT)
# if defined(_WIN32) || defined(OS2_OS) # if defined(_WIN32) || defined(OS2_OS)
if ( oldstdoutmode != -1 ) if ( oldstdoutmode != -1 )
oldstdoutmode = setmode( fileno(stdout), oldstdoutmode ); oldstdoutmode = setmode( fileno(stdout), oldstdoutmode );
if ( oldstderrmode != -1 ) if ( oldstderrmode != -1 )
oldstderrmode = setmode( fileno(stderr), oldstderrmode ); oldstderrmode = setmode( fileno(stderr), oldstderrmode );
# endif # endif
#endif #endif
TidyDocFree( doc, out ); TidyDocFree( doc, out );