build: bump lua-bitop to 1.0.3 #35063

Source: https://bitop.luajit.org/download.html
This commit is contained in:
Phạm Bình An
2025-08-03 05:58:11 +07:00
committed by GitHub
parent 1240d29f8f
commit 3f416ef524
2 changed files with 5 additions and 14 deletions

View File

@@ -376,7 +376,7 @@ strongly advised not to rely on undefined or implementation-defined behavior.
==============================================================================
COPYRIGHT
Lua BitOp is Copyright (C) 2008-2012 Mike Pall.
Lua BitOp is Copyright (C) 2008-2025 Mike Pall.
Lua BitOp is free software, released under the MIT license.
vim:tw=78:ts=4:sw=4:sts=4:et:ft=help:norl:

View File

@@ -2,7 +2,7 @@
** Lua BitOp -- a bit operations library for Lua 5.1/5.2.
** http://bitop.luajit.org/
**
** Copyright (C) 2008-2012 Mike Pall. All rights reserved.
** Copyright (C) 2008-2025 Mike Pall. All rights reserved.
**
** Permission is hereby granted, free of charge, to any person obtaining
** a copy of this software and associated documentation files (the
@@ -26,22 +26,13 @@
** [ MIT license: http://www.opensource.org/licenses/mit-license.php ]
*/
#define LUA_BITOP_VERSION "1.0.2"
#define LUA_BITOP_VERSION "1.0.3"
#define LUA_LIB
#include "lua.h"
#include "lauxlib.h"
#include "bit.h"
#ifdef _MSC_VER
/* MSVC is stuck in the last century and doesn't have C99's stdint.h. */
typedef __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef unsigned __int64 uint64_t;
#else
#include <stdint.h>
#endif
typedef int32_t SBits;
typedef uint32_t UBits;
@@ -129,11 +120,11 @@ static int bit_bswap(lua_State *L)
static int bit_tohex(lua_State *L)
{
UBits b = barg(L, 1);
SBits n = lua_isnone(L, 2) ? 8 : (SBits)barg(L, 2);
UBits n = lua_isnone(L, 2) ? 8 : barg(L, 2);
const char *hexdigits = "0123456789abcdef";
char buf[8];
int i;
if (n < 0) { n = -n; hexdigits = "0123456789ABCDEF"; }
if ((SBits)n < 0) { n = ~n+1; hexdigits = "0123456789ABCDEF"; }
if (n > 8) n = 8;
for (i = (int)n; --i >= 0; ) { buf[i] = hexdigits[b & 15]; b >>= 4; }
lua_pushlstring(L, buf, (size_t)n);