From a61ac4664d55cddb18d2d861e76629bd07676129 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 8 Feb 2016 22:44:39 +0300 Subject: Add some missing const. --- src/utils/copynpaste.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/utils/copynpaste.cpp') diff --git a/src/utils/copynpaste.cpp b/src/utils/copynpaste.cpp index 8a413c1f7..8bce3a4c0 100644 --- a/src/utils/copynpaste.cpp +++ b/src/utils/copynpaste.cpp @@ -59,7 +59,7 @@ bool retrieveBuffer(std::string& text, size_t& pos) return false; } -bool sendBuffer(std::string& text) +bool sendBuffer(const std::string &restrict text) { return !SDL_SetClipboardText(text.c_str()); } @@ -120,7 +120,7 @@ bool retrieveBuffer(std::string& text, size_t& pos) return ret; } -bool sendBuffer(std::string& text) +bool sendBuffer(const std::string &restrict text) { const int wCharsLen = MultiByteToWideChar(CP_UTF8, 0, text.c_str(), -1, nullptr, 0); @@ -293,7 +293,7 @@ bool retrieveBuffer(std::string& text, size_t& pos) } } -bool sendBuffer(std::string& text) +bool sendBuffer(const std::string &restrict text) { return false; } @@ -402,17 +402,17 @@ bool retrieveBuffer(std::string& text, size_t& pos) return false; } -static bool runxsel(std::string& text, const char *p1, +static bool runxsel(const std::string &text, const char *p1, const char *p2 = nullptr); -bool sendBuffer(std::string& text) +bool sendBuffer(const std::string &restrict text) { runxsel(text, "-i"); runxsel(text, "-b", "-i"); return true; } -static bool runxsel(std::string& text, const char *p1, const char *p2) +static bool runxsel(const std::string &text, const char *p1, const char *p2) { pid_t pid; int fd[2]; @@ -484,7 +484,7 @@ bool retrieveBuffer(std::string& text, size_t& pos) return true; } -bool sendBuffer(std::string& text) +bool sendBuffer(const std::string &restrict text) { naclPostMessage("clipboard-copy", text); return true; @@ -495,7 +495,7 @@ bool retrieveBuffer(std::string&, size_t&) return false; } -bool sendBuffer(std::string& text A_UNUSED) +bool sendBuffer(const std::string &restrict text A_UNUSED) { return false; } -- cgit v1.2.3-60-g2f50