From 31170c47314a8b71331dd7d63c898478edc98c84 Mon Sep 17 00:00:00 2001 From: Greg Ercolano Date: Sat, 6 Apr 2024 23:36:04 -0700 Subject: Rename putchar() to plot_char() (#944) Some old platforms (NetBSD, AIX) implement the common stdio "putchar()" function as a global macro which poisons the global namespace, preventing all C and C++ programs from using "putchar()" as a function or method. There was a long thread about this in fltk.coredev during the period Mar 25 2024 ~ Apr 4 2024, subject "RFC: Fl_Terminal::putchar() in public API" as to why we have no choice but to not use putchar() as a method name. --- src/Fl_Terminal.cxx | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/Fl_Terminal.cxx b/src/Fl_Terminal.cxx index 52afb4ef8..ad41f31fe 100644 --- a/src/Fl_Terminal.cxx +++ b/src/Fl_Terminal.cxx @@ -1902,10 +1902,10 @@ void Fl_Terminal::clear_sod(void) { for (int drow=0; drow <= cursor_.row(); drow++) if (drow == cursor_.row()) for (int dcol=0; dcol<=cursor_.col(); dcol++) - putchar(' ', drow, dcol); + plot_char(' ', drow, dcol); else for (int dcol=0; dcolu8c->max_utf8() || len!=fl_utf8len(*text)) @@ -3001,7 +3001,7 @@ void Fl_Terminal::putchar(const char *text, int len, int drow, int dcol) { } /** - Print the ASCII character \p c at the terminal's display position \p (drow,dcol). + Plot the ASCII character \p c at the terminal's display position \p (drow,dcol). The character MUST be printable (in range 0x20 - 0x7e), and is displayed using the current text color/attributes. Characters outside that range are either @@ -3018,7 +3018,7 @@ void Fl_Terminal::putchar(const char *text, int len, int drow, int dcol) { \see show_unknown(bool), handle_unknown_char(), is_printable() */ -void Fl_Terminal::putchar(char c, int drow, int dcol) { +void Fl_Terminal::plot_char(char c, int drow, int dcol) { if (!is_printable(c)) { handle_unknown_char(); return; } Utf8Char *u8c = u8c_disp_row(drow) + dcol; u8c->text_ascii(c, *current_style_); @@ -3053,7 +3053,7 @@ void Fl_Terminal::print_char(const char *text, int len/*=-1*/) { } else if (escseq.parse_in_progress()) { // ESC sequence in progress? handle_escseq(*text); } else { // Handle printable char.. - putchar(text, len, cursor_row(), cursor_col()); + plot_char(text, len, cursor_row(), cursor_col()); cursor_right(1, do_scroll); } } @@ -3074,7 +3074,7 @@ void Fl_Terminal::print_char(char c) { } else if (escseq.parse_in_progress()) { // ESC sequence in progress? handle_escseq(c); } else { // Handle printable char.. - putchar(c, cursor_row(), cursor_col()); + plot_char(c, cursor_row(), cursor_col()); cursor_right(1, do_scroll); return; } -- cgit v1.2.3