From a1376e8a4ee272f8f1c5da01a6d4e4b18a479122 Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Fri, 3 Apr 2009 22:33:00 +0200 Subject: [PATCH] pass small structs and POD types to Window::operator<<() by value --- src/window.cpp | 18 +++++++++--------- src/window.h | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/window.cpp b/src/window.cpp index 0b69b215..95484797 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -659,7 +659,7 @@ void Window::Scroll(Where where) } -Window &Window::operator<<(const Colors &colors) +Window &Window::operator<<(Colors colors) { if (colors.fg == clEnd || colors.bg == clEnd) return *this; @@ -668,7 +668,7 @@ Window &Window::operator<<(const Colors &colors) return *this; } -Window &Window::operator<<(const Color &color) +Window &Window::operator<<(Color color) { switch (color) { @@ -692,7 +692,7 @@ Window &Window::operator<<(const Color &color) return *this; } -Window &Window::operator<<(const Format &format) +Window &Window::operator<<(Format format) { switch (format) { @@ -729,7 +729,7 @@ Window &Window::operator<<(int (*f)(WINDOW *)) return *this; } -Window &Window::operator<<(const XY &coords) +Window &Window::operator<<(XY coords) { GotoXY(coords.x, coords.y); return *this; @@ -741,7 +741,7 @@ Window &Window::operator<<(const char *s) return *this; } -Window &Window::operator<<(const char &c) +Window &Window::operator<<(char c) { wprintw(itsWindow, "%c", c); return *this; @@ -753,19 +753,19 @@ Window &Window::operator<<(const wchar_t *ws) return *this; } -Window &Window::operator<<(const wchar_t &wc) +Window &Window::operator<<(wchar_t wc) { wprintw(itsWindow, "%lc", wc); return *this; } -Window &Window::operator<<(const int &i) +Window &Window::operator<<(int i) { wprintw(itsWindow, "%d", i); return *this; } -Window &Window::operator<<(const double &d) +Window &Window::operator<<(double d) { wprintw(itsWindow, "%f", d); return *this; @@ -785,7 +785,7 @@ Window &Window::operator<<(const wstring &ws) return *this; } -Window &Window::operator<<(const size_t &s) +Window &Window::operator<<(size_t s) { wprintw(itsWindow, "%u", s); return *this; diff --git a/src/window.h b/src/window.h index 70033457..5aca3c20 100644 --- a/src/window.h +++ b/src/window.h @@ -128,17 +128,17 @@ namespace NCurses virtual void Scroll(Where); Window &operator<<(int (*)(WINDOW *)); - Window &operator<<(const Colors &); - Window &operator<<(const Color &); - Window &operator<<(const Format &); - Window &operator<<(const XY &); + Window &operator<<(Colors); + Window &operator<<(Color); + Window &operator<<(Format); + Window &operator<<(XY); Window &operator<<(const char *); - Window &operator<<(const char &); + Window &operator<<(char); Window &operator<<(const wchar_t *); - Window &operator<<(const wchar_t &); - Window &operator<<(const int &); - Window &operator<<(const double &); - Window &operator<<(const size_t &); + Window &operator<<(wchar_t); + Window &operator<<(int); + Window &operator<<(double); + Window &operator<<(size_t); Window &operator<<(const std::string &); Window &operator<<(const std::wstring &);