aboutsummaryrefslogtreecommitdiff
path: root/src/server/worldserver/CommandLine
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2017-06-19 23:20:06 -0300
committerariel- <ariel-@users.noreply.github.com>2017-06-19 23:20:06 -0300
commit85a7d5ce9ac68b30da2277cc91d4b70358f1880d (patch)
treedf3d2084ee2e35008903c03178039b9c986e2d08 /src/server/worldserver/CommandLine
parent052fc24315ace866ea1cf610e85df119b68100c9 (diff)
Core: ported headers cleanup from master branch
Diffstat (limited to 'src/server/worldserver/CommandLine')
-rw-r--r--src/server/worldserver/CommandLine/CliRunnable.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/server/worldserver/CommandLine/CliRunnable.cpp b/src/server/worldserver/CommandLine/CliRunnable.cpp
index d5e03edbd04..8c05a47608d 100644
--- a/src/server/worldserver/CommandLine/CliRunnable.cpp
+++ b/src/server/worldserver/CommandLine/CliRunnable.cpp
@@ -34,10 +34,10 @@
#include <readline/history.h>
#include "Chat.h"
-char* command_finder(const char* text, int state)
+char* command_finder(char const* text, int state)
{
static size_t idx, len;
- const char* ret;
+ char const* ret;
std::vector<ChatCommand> const& cmd = ChatHandler::getCommandTable();
if (!state)
@@ -61,12 +61,12 @@ char* command_finder(const char* text, int state)
return strdup(ret);
}
- return ((char*)NULL);
+ return ((char*)nullptr);
}
-char** cli_completion(const char* text, int start, int /*end*/)
+char** cli_completion(char const* text, int start, int /*end*/)
{
- char** matches = NULL;
+ char** matches = nullptr;
if (start)
rl_bind_key('\t', rl_abort);
@@ -84,7 +84,7 @@ int cli_hook_func()
#endif
-void utf8print(void* /*arg*/, const char* str)
+void utf8print(void* /*arg*/, char const* str)
{
#if TRINITY_PLATFORM == TRINITY_PLATFORM_WINDOWS
wchar_t wtemp_buf[6000];
@@ -92,9 +92,7 @@ void utf8print(void* /*arg*/, const char* str)
if (!Utf8toWStr(str, strlen(str), wtemp_buf, wtemp_len))
return;
- char temp_buf[6000];
- CharToOemBuffW(&wtemp_buf[0], &temp_buf[0], wtemp_len+1);
- printf(temp_buf);
+ wprintf(L"%s", wtemp_buf);
#else
{
printf("%s", str);
@@ -119,7 +117,7 @@ int kb_hit_return()
tv.tv_usec = 0;
FD_ZERO(&fds);
FD_SET(STDIN_FILENO, &fds);
- select(STDIN_FILENO+1, &fds, NULL, NULL, &tv);
+ select(STDIN_FILENO+1, &fds, nullptr, nullptr, &tv);
return FD_ISSET(STDIN_FILENO, &fds);
}
#endif
@@ -156,7 +154,7 @@ void CliThread()
rl_bind_key('\t', rl_complete);
#endif
- if (command_str != NULL)
+ if (command_str != nullptr)
{
for (int x=0; command_str[x]; ++x)
if (command_str[x] == '\r' || command_str[x] == '\n')
@@ -187,7 +185,7 @@ void CliThread()
}
fflush(stdout);
- sWorld->QueueCliCommand(new CliCommandHolder(NULL, command.c_str(), &utf8print, &commandFinished));
+ sWorld->QueueCliCommand(new CliCommandHolder(nullptr, command.c_str(), &utf8print, &commandFinished));
#if TRINITY_PLATFORM != TRINITY_PLATFORM_WINDOWS
add_history(command.c_str());
free(command_str);