Resolve a few compiler warnings.
This commit is contained in:
parent
3e4ebb8acc
commit
3c1373c4a0
@ -673,7 +673,7 @@ static int skipBOM (LoadF *lf) {
|
|||||||
do {
|
do {
|
||||||
c = getc(lf->f);
|
c = getc(lf->f);
|
||||||
if (c == EOF || c != *(const unsigned char *)p++) return c;
|
if (c == EOF || c != *(const unsigned char *)p++) return c;
|
||||||
lf->buff[lf->n++] = c; /* to be read by the parser */
|
lf->buff[lf->n++] = (char)c; /* to be read by the parser */
|
||||||
} while (*p != '\0');
|
} while (*p != '\0');
|
||||||
lf->n = 0; /* prefix matched; discard it */
|
lf->n = 0; /* prefix matched; discard it */
|
||||||
return getc(lf->f); /* return next character */
|
return getc(lf->f); /* return next character */
|
||||||
@ -723,7 +723,7 @@ LUALIB_API int luaL_loadfilex (lua_State *L, const char *filename,
|
|||||||
skipcomment(&lf, &c); /* re-read initial portion */
|
skipcomment(&lf, &c); /* re-read initial portion */
|
||||||
}
|
}
|
||||||
if (c != EOF)
|
if (c != EOF)
|
||||||
lf.buff[lf.n++] = c; /* 'c' is the first character of the stream */
|
lf.buff[lf.n++] = (char)c; /* 'c' is the first character of the stream */
|
||||||
status = lua_load(L, getF, &lf, lua_tostring(L, -1), mode);
|
status = lua_load(L, getF, &lf, lua_tostring(L, -1), mode);
|
||||||
readstatus = ferror(lf.f);
|
readstatus = ferror(lf.f);
|
||||||
if (filename) fclose(lf.f); /* close file (even in case of errors) */
|
if (filename) fclose(lf.f); /* close file (even in case of errors) */
|
||||||
|
@ -28,7 +28,7 @@ int do_getcwd(char* buffer, size_t size)
|
|||||||
|
|
||||||
result = (GetCurrentDirectoryW(PATH_MAX, wbuffer) != 0);
|
result = (GetCurrentDirectoryW(PATH_MAX, wbuffer) != 0);
|
||||||
if (result) {
|
if (result) {
|
||||||
WideCharToMultiByte(CP_UTF8, 0, wbuffer, -1, buffer, size, NULL, NULL);
|
WideCharToMultiByte(CP_UTF8, 0, wbuffer, -1, buffer, (int)size, NULL, NULL);
|
||||||
|
|
||||||
do_translate(buffer, '/');
|
do_translate(buffer, '/');
|
||||||
}
|
}
|
||||||
|
@ -11,8 +11,8 @@
|
|||||||
int string_hash(lua_State* L)
|
int string_hash(lua_State* L)
|
||||||
{
|
{
|
||||||
const char* str = luaL_checkstring(L, 1);
|
const char* str = luaL_checkstring(L, 1);
|
||||||
unsigned long seed = luaL_optnumber(L, 2, 0);
|
int seed = (int)luaL_optinteger(L, 2, 0);
|
||||||
lua_pushnumber(L, (lua_Number)do_hash(str, seed));
|
lua_pushinteger(L, do_hash(str, seed));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user