summaryrefslogtreecommitdiff
path: root/apps/plugins/lua/liolib.c
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2012-11-12 18:35:00 +0100
committerAmaury Pouly <amaury.pouly@gmail.com>2012-11-13 18:25:00 +0100
commit214f226ca63c8c5d6f446d69ffe95aec91779254 (patch)
tree79331e1f87552db1733ca4eb702e355a7c12ed10 /apps/plugins/lua/liolib.c
parent02f67224f9c424bf9c3a613741adfccaf4847d12 (diff)
downloadrockbox-214f226ca63c8c5d6f446d69ffe95aec91779254.zip
rockbox-214f226ca63c8c5d6f446d69ffe95aec91779254.tar.gz
rockbox-214f226ca63c8c5d6f446d69ffe95aec91779254.tar.bz2
rockbox-214f226ca63c8c5d6f446d69ffe95aec91779254.tar.xz
upgtools: allow creation of a UPG archive + improvements
Change-Id: I9c3e2eb95f7eb6d41591b006328fd720dfcf93a5
Diffstat (limited to 'apps/plugins/lua/liolib.c')
0 files changed, 0 insertions, 0 deletions
124' href='#n124'>124 125
/* Bitwise operations library */
/* (c) Reuben Thomas 2000-2008 */
/* bitlib is copyright Reuben Thomas 2000-2008, and is released under the MIT
   license, like Lua (see http://www.lua.org/copyright.html; it's
   basically the same as the BSD license). There is no warranty. */

#include "config.h"

#include "lua.h"
#include "lauxlib.h"
#include <limits.h>


/* FIXME: Assume lua_Integer is ptrdiff_t */
#define LUA_INTEGER_MAX INTPTR_MAX
#define LUA_INTEGER_MIN INTPTR_MIN

/* FIXME: Assume size_t is an unsigned lua_Integer */
typedef size_t lua_UInteger;
#define LUA_UINTEGER_MAX UINT_MAX


/* Bit type size and limits */

#define BIT_BITS (CHAR_BIT * sizeof(lua_Integer))

/* This code may give warnings if BITLIB_FLOAT_* are too big to fit in
   long, but that doesn't matter since in that case they won't be
   used. */
#define BIT_MAX  (LUA_INTEGER_MAX)

#define BIT_MIN  (LUA_INTEGER_MIN)

#define BIT_UMAX (LUA_UINTEGER_MAX)


/* Define TOBIT to get a bit value */
#ifdef BUILTIN_CAST
#define 
#define TOBIT(L, n, res)                    \
  ((void)(res), luaL_checkinteger((L), (n)))
#else

#define TOBIT(L, n, res)                                            \