From owner-svn-src-head@freebsd.org Fri Jan 26 17:56:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 469D1EBECAB; Fri, 26 Jan 2018 17:56:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E59857DF6D; Fri, 26 Jan 2018 17:56:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD4B41ED9F; Fri, 26 Jan 2018 17:56:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0QHuKK0003394; Fri, 26 Jan 2018 17:56:20 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0QHuKxT003393; Fri, 26 Jan 2018 17:56:20 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201801261756.w0QHuKxT003393@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 26 Jan 2018 17:56:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328443 - head/contrib/lua/src X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/contrib/lua/src X-SVN-Commit-Revision: 328443 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Jan 2018 17:56:21 -0000 Author: imp Date: Fri Jan 26 17:56:20 2018 New Revision: 328443 URL: https://svnweb.freebsd.org/changeset/base/328443 Log: Gross hack to omit printing hex floating point when the lua number type is int64. While lua is setup for the representation, it's not setup to properly print the numbers as ints. This is the least-gross way around that, and won't affect the bootloader where we do this. Modified: head/contrib/lua/src/lstrlib.c Modified: head/contrib/lua/src/lstrlib.c ============================================================================== --- head/contrib/lua/src/lstrlib.c Fri Jan 26 17:55:17 2018 (r328442) +++ head/contrib/lua/src/lstrlib.c Fri Jan 26 17:56:20 2018 (r328443) @@ -951,12 +951,16 @@ static void addliteral (lua_State *L, luaL_Buffer *b, case LUA_TNUMBER: { char *buff = luaL_prepbuffsize(b, MAX_ITEM); int nb; +#if LUA_FLOAT_TYPE != LUA_FLOAT_INT64 if (!lua_isinteger(L, arg)) { /* float? */ lua_Number n = lua_tonumber(L, arg); /* write as hexa ('%a') */ nb = lua_number2strx(L, buff, MAX_ITEM, "%" LUA_NUMBER_FRMLEN "a", n); checkdp(buff, nb); /* ensure it uses a dot */ } else { /* integers */ +#else + { +#endif lua_Integer n = lua_tointeger(L, arg); const char *format = (n == LUA_MININTEGER) /* corner case? */ ? "0x%" LUA_INTEGER_FRMLEN "x" /* use hexa */