summaryrefslogtreecommitdiff
path: root/common/console.cpp
diff options
context:
space:
mode:
authorCebtenzzre <cebtenzzre@gmail.com>2023-09-15 15:38:27 -0400
committerGitHub <noreply@github.com>2023-09-15 15:38:27 -0400
commit3aefaab9e59335ebb07d5205dbc8633efd680e58 (patch)
tree1249b50bd748a1bdcc85d010f44feda0d884fef7 /common/console.cpp
parent69eb67e28275cd2d57693405f768754a7b2245ad (diff)
check C++ code with -Wmissing-declarations (#3184)
Diffstat (limited to 'common/console.cpp')
-rw-r--r--common/console.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/common/console.cpp b/common/console.cpp
index 23545e5b..f65cbc6e 100644
--- a/common/console.cpp
+++ b/common/console.cpp
@@ -158,7 +158,7 @@ namespace console {
}
}
- char32_t getchar32() {
+ static char32_t getchar32() {
#if defined(_WIN32)
HANDLE hConsole = GetStdHandle(STD_INPUT_HANDLE);
wchar_t high_surrogate = 0;
@@ -212,7 +212,7 @@ namespace console {
#endif
}
- void pop_cursor() {
+ static void pop_cursor() {
#if defined(_WIN32)
if (hConsole != NULL) {
CONSOLE_SCREEN_BUFFER_INFO bufferInfo;
@@ -233,7 +233,7 @@ namespace console {
putc('\b', out);
}
- int estimateWidth(char32_t codepoint) {
+ static int estimateWidth(char32_t codepoint) {
#if defined(_WIN32)
(void)codepoint;
return 1;
@@ -242,7 +242,7 @@ namespace console {
#endif
}
- int put_codepoint(const char* utf8_codepoint, size_t length, int expectedWidth) {
+ static int put_codepoint(const char* utf8_codepoint, size_t length, int expectedWidth) {
#if defined(_WIN32)
CONSOLE_SCREEN_BUFFER_INFO bufferInfo;
if (!GetConsoleScreenBufferInfo(hConsole, &bufferInfo)) {
@@ -303,7 +303,7 @@ namespace console {
#endif
}
- void replace_last(char ch) {
+ static void replace_last(char ch) {
#if defined(_WIN32)
pop_cursor();
put_codepoint(&ch, 1, 1);
@@ -312,7 +312,7 @@ namespace console {
#endif
}
- void append_utf8(char32_t ch, std::string & out) {
+ static void append_utf8(char32_t ch, std::string & out) {
if (ch <= 0x7F) {
out.push_back(static_cast<unsigned char>(ch));
} else if (ch <= 0x7FF) {
@@ -333,7 +333,7 @@ namespace console {
}
// Helper function to remove the last UTF-8 character from a string
- void pop_back_utf8_char(std::string & line) {
+ static void pop_back_utf8_char(std::string & line) {
if (line.empty()) {
return;
}
@@ -349,7 +349,7 @@ namespace console {
line.erase(pos);
}
- bool readline_advanced(std::string & line, bool multiline_input) {
+ static bool readline_advanced(std::string & line, bool multiline_input) {
if (out != stdout) {
fflush(stdout);
}
@@ -452,7 +452,7 @@ namespace console {
return has_more;
}
- bool readline_simple(std::string & line, bool multiline_input) {
+ static bool readline_simple(std::string & line, bool multiline_input) {
#if defined(_WIN32)
std::wstring wline;
if (!std::getline(std::wcin, wline)) {