chore(Core/Worldserver): restyle worldserver lib with astyle (#3463)

This commit is contained in:
Kargatum
2020-09-11 10:41:31 +07:00
committed by GitHub
parent c141be8684
commit d47d6d34f3
11 changed files with 139 additions and 137 deletions

View File

@@ -70,9 +70,9 @@ char** cli_completion(const char* text, int start, int /*end*/)
int cli_hook_func()
{
if (World::IsStopped())
rl_done = 1;
return 0;
if (World::IsStopped())
rl_done = 1;
return 0;
}
#endif
@@ -81,18 +81,18 @@ void utf8print(void* /*arg*/, const char* str)
{
#if AC_PLATFORM == AC_PLATFORM_WINDOWS
wchar_t wtemp_buf[6000];
size_t wtemp_len = 6000-1;
size_t wtemp_len = 6000 - 1;
if (!Utf8toWStr(str, strlen(str), wtemp_buf, wtemp_len))
return;
char temp_buf[6000];
CharToOemBuffW(&wtemp_buf[0], &temp_buf[0], wtemp_len+1);
CharToOemBuffW(&wtemp_buf[0], &temp_buf[0], wtemp_len + 1);
printf(temp_buf);
#else
{
printf("%s", str);
fflush(stdout);
}
{
printf("%s", str);
fflush(stdout);
}
#endif
}
@@ -112,7 +112,7 @@ int kb_hit_return()
tv.tv_usec = 0;
FD_ZERO(&fds);
FD_SET(STDIN_FILENO, &fds);
select(STDIN_FILENO+1, &fds, nullptr, nullptr, &tv);
select(STDIN_FILENO + 1, &fds, nullptr, nullptr, &tv);
return FD_ISSET(STDIN_FILENO, &fds);
}
#endif
@@ -139,7 +139,7 @@ void CliRunnable::run()
{
fflush(stdout);
char *command_str ; // = fgets(commandbuf, sizeof(commandbuf), stdin);
char* command_str ; // = fgets(commandbuf, sizeof(commandbuf), stdin);
#if AC_PLATFORM == AC_PLATFORM_WINDOWS
char commandbuf[256];
@@ -151,7 +151,7 @@ void CliRunnable::run()
if (command_str != nullptr)
{
for (int x=0; command_str[x]; ++x)
for (int x = 0; command_str[x]; ++x)
if (command_str[x] == '\r' || command_str[x] == '\n')
{
command_str[x] = 0;