From 0685442e1a6b4098c572fba4b1fdeae38c9e8d9b Mon Sep 17 00:00:00 2001 From: Simon Brooke Date: Sun, 15 Oct 2017 14:31:57 +0100 Subject: [PATCH] Tidied up 'wide' printing. --- Makefile | 2 +- src/conspage.c | 4 ++-- src/read.c | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 35c4627..c15c1e2 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ test: .PHONY: clean clean: - $(RM) $(TARGET) $(OBJS) $(DEPS) + $(RM) $(TARGET) $(OBJS) $(DEPS) $(SRC_DIRS)/*~ repl: $(TARGET) -p 2> psse.log diff --git a/src/conspage.c b/src/conspage.c index 0805ee3..2d31cf6 100644 --- a/src/conspage.c +++ b/src/conspage.c @@ -63,7 +63,7 @@ void make_cons_page( ) { cell->count = MAXREFERENCE; cell->payload.free.car = NIL; cell->payload.free.cdr = NIL; - fprintf( stderr, "Allocated special cell NIL\n" ); + fwprintf( stderr, L"Allocated special cell NIL\n" ); } else if ( i == 1 ) { /* * initialise cell as T @@ -74,7 +74,7 @@ void make_cons_page( ) { 0, 1}; cell->payload.free.cdr = ( struct cons_pointer ) { 0, 1}; - fprintf( stderr, "Allocated special cell T\n" ); + fwprintf( stderr, L"Allocated special cell T\n" ); } } else { /* diff --git a/src/read.c b/src/read.c index 24d7ece..92f9f52 100644 --- a/src/read.c +++ b/src/read.c @@ -71,7 +71,7 @@ struct cons_pointer read_continuation( FILE * input, wint_t initial ) { } else if ( iswprint( c ) ) { result = read_symbol( input, c ); } else { - fprintf( stderr, "Unrecognised start of input character %c\n", c ); + fwprintf( stderr, L"Unrecognised start of input character %c\n", c ); } } @@ -88,7 +88,7 @@ struct cons_pointer read_number( FILE * input, wint_t initial ) { bool seen_period = false; wint_t c; - fprintf( stderr, "read_number starting '%c' (%d)\n", initial, initial ); + fwprintf( stderr, L"read_number starting '%c' (%d)\n", initial, initial ); for ( c = initial; iswdigit( c ) || c == btowc( '.' ); c = fgetwc( input ) ) { @@ -137,7 +137,7 @@ struct cons_pointer read_list( FILE * input, wint_t initial ) { struct cons_pointer car = read_continuation( input, initial ); result = make_cons( car, read_list( input, fgetwc( input ) ) ); } else { - fprintf( stderr, "End of list detected\n" ); + fwprintf( stderr, L"End of list detected\n" ); } return result;