Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
0690a7d1
Commit
0690a7d1
authored
Aug 25, 2021
by
Johny Mattsson
Browse files
Make bit module handle 32/64bit integer configs.
parent
cd585ae9
Changes
3
Hide whitespace changes
Inline
Side-by-side
components/lua/lua-5.1/luaconf.h
View file @
0690a7d1
...
@@ -169,7 +169,7 @@
...
@@ -169,7 +169,7 @@
/* Changed to long for use with integral Lua numbers. */
/* Changed to long for use with integral Lua numbers. */
#if !defined LUA_NUMBER_INTEGRAL
#if !defined LUA_NUMBER_INTEGRAL
#define LUA_INTEGER
ptrdiff_
t
#define LUA_INTEGER
in
t
#else
#else
#if !defined LUA_INTEGRAL_LONGLONG
#if !defined LUA_INTEGRAL_LONGLONG
#define LUA_INTEGER int
#define LUA_INTEGER int
...
...
components/modules/bit.c
View file @
0690a7d1
...
@@ -10,9 +10,11 @@
...
@@ -10,9 +10,11 @@
#include "lauxlib.h"
#include "lauxlib.h"
/* FIXME: Assume size_t is an unsigned lua_Integer */
#if defined(LUA_UNSIGNED)
typedef
size_t
lua_UInteger
;
typedef
LUA_UNSIGNED
lua_UInteger
;
#define LUA_UINTEGER_MAX SIZE_MAX
#else
typedef
unsigned
LUA_INTEGER
lua_UInteger
;
#endif
/* Define TOBIT to get a bit value */
/* Define TOBIT to get a bit value */
#define TOBIT(L, n) \
#define TOBIT(L, n) \
...
...
docs/modules/bit.md
View file @
0690a7d1
...
@@ -4,7 +4,9 @@
...
@@ -4,7 +4,9 @@
| 2014-12-24 |
[
https://github.com/LuaDist/bitlib
](
https://github.com/LuaDist/bitlib
)
,
[
Zeroday
](
https://github.com/funshine
)
|
[
Zeroday
](
https://github.com/funshine
)
|
[
bit.c
](
../../components/modules/bit.c
)
|
| 2014-12-24 |
[
https://github.com/LuaDist/bitlib
](
https://github.com/LuaDist/bitlib
)
,
[
Zeroday
](
https://github.com/funshine
)
|
[
Zeroday
](
https://github.com/funshine
)
|
[
bit.c
](
../../components/modules/bit.c
)
|
Bit manipulation support, on 32bit integers.
Bit manipulation support, on the integer type used by the Lua VM. On 5.1 this
will be 32bit, whereas on 5.3 it may be either 32bit (default) or 64bit if
configured for 64bit integers.
## bit.arshift()
## bit.arshift()
Arithmetic right shift a number equivalent to
`value >> shift`
in C.
Arithmetic right shift a number equivalent to
`value >> shift`
in C.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment