From 9903dd52a39fbe4531596b1266e226f01769de21 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 20 Dec 2016 16:37:00 -0200 Subject: Using LUAI_UAC* types more consistently on vararg calls --- liolib.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'liolib.c') diff --git a/liolib.c b/liolib.c index db2f01c2..8491edca 100644 --- a/liolib.c +++ b/liolib.c @@ -1,5 +1,5 @@ /* -** $Id: liolib.c,v 2.149 2016/05/02 14:03:19 roberto Exp roberto $ +** $Id: liolib.c,v 2.150 2016/09/01 16:14:56 roberto Exp roberto $ ** Standard I/O (and system) library ** See Copyright Notice in lua.h */ @@ -619,8 +619,10 @@ static int g_write (lua_State *L, FILE *f, int arg) { if (lua_type(L, arg) == LUA_TNUMBER) { /* optimization: could be done exactly as for strings */ int len = lua_isinteger(L, arg) - ? fprintf(f, LUA_INTEGER_FMT, lua_tointeger(L, arg)) - : fprintf(f, LUA_NUMBER_FMT, lua_tonumber(L, arg)); + ? fprintf(f, LUA_INTEGER_FMT, + (LUAI_UACINT)lua_tointeger(L, arg)) + : fprintf(f, LUA_NUMBER_FMT, + (LUAI_UACNUMBER)lua_tonumber(L, arg)); status = status && (len > 0); } else { -- cgit v1.2.3-55-g6feb