Fix a bunch of compile warnings. (#691)
This commit is contained in:
parent
3230f8ccf1
commit
566936cbe7
@ -10,6 +10,9 @@
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#if PLATFORM_WINDOWS
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
int os_chmod(lua_State* L)
|
||||
{
|
||||
|
@ -24,7 +24,7 @@ int do_getcwd(char* buffer, size_t size)
|
||||
int result;
|
||||
|
||||
#if PLATFORM_WINDOWS
|
||||
result = (GetCurrentDirectoryA(size, buffer) != 0);
|
||||
result = (GetCurrentDirectoryA((DWORD)size, buffer) != 0);
|
||||
if (result) {
|
||||
do_translate(buffer, '/');
|
||||
}
|
||||
|
@ -18,14 +18,14 @@ int os_getpass(lua_State* L)
|
||||
char buffer[1024];
|
||||
const char* newline = "\n";
|
||||
|
||||
WriteConsoleA(hstdout, prompt, strlen(prompt), &written_chars, NULL);
|
||||
WriteConsoleA(hstdout, prompt, (DWORD)strlen(prompt), &written_chars, NULL);
|
||||
|
||||
GetConsoleMode(hstdin, &mode);
|
||||
SetConsoleMode(hstdin, ENABLE_LINE_INPUT | ENABLE_PROCESSED_INPUT);
|
||||
ReadConsoleA(hstdin, buffer, sizeof (buffer), &read_chars, NULL);
|
||||
SetConsoleMode(hstdin, mode);
|
||||
|
||||
WriteConsoleA(hstdout, newline, strlen(newline), &written_chars, NULL);
|
||||
WriteConsoleA(hstdout, newline, (DWORD)strlen(newline), &written_chars, NULL);
|
||||
|
||||
buffer[strcspn(buffer, "\r\n")] = '\0';
|
||||
|
||||
|
@ -26,7 +26,7 @@ int do_mkdir(const char* path)
|
||||
return 1;
|
||||
|
||||
// find the parent folder name.
|
||||
length = strlen(path);
|
||||
length = (int)strlen(path);
|
||||
for (i = length - 1; i >= 0; --i)
|
||||
{
|
||||
if (path[i] == '/' || path[i] == '\\')
|
||||
|
Reference in New Issue
Block a user