aboutsummaryrefslogtreecommitdiff
path: root/llimits.h
diff options
context:
space:
mode:
Diffstat (limited to 'llimits.h')
-rw-r--r--llimits.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/llimits.h b/llimits.h
index 0f3a8ecd..e7da009b 100644
--- a/llimits.h
+++ b/llimits.h
@@ -130,6 +130,7 @@ typedef LUAI_UACINT l_uacInt;
130#define cast_num(i) cast(lua_Number, (i)) 130#define cast_num(i) cast(lua_Number, (i))
131#define cast_int(i) cast(int, (i)) 131#define cast_int(i) cast(int, (i))
132#define cast_uint(i) cast(unsigned int, (i)) 132#define cast_uint(i) cast(unsigned int, (i))
133#define cast_ulong(i) cast(unsigned long, (i))
133#define cast_byte(i) cast(lu_byte, (i)) 134#define cast_byte(i) cast(lu_byte, (i))
134#define cast_uchar(i) cast(unsigned char, (i)) 135#define cast_uchar(i) cast(unsigned char, (i))
135#define cast_char(i) cast(char, (i)) 136#define cast_char(i) cast(char, (i))
@@ -151,6 +152,16 @@ typedef LUAI_UACINT l_uacInt;
151#define l_castU2S(i) ((lua_Integer)(i)) 152#define l_castU2S(i) ((lua_Integer)(i))
152#endif 153#endif
153 154
155/*
156** cast a size_t to lua_Integer: These casts are always valid for
157** sizes of Lua objects (see MAX_SIZE)
158*/
159#define cast_st2S(sz) ((lua_Integer)(sz))
160
161/* Cast a ptrdiff_t to size_t, when it is known that the minuend
162** comes from the subtraend (the base)
163*/
164#define ct_diff2sz(df) ((size_t)(df))
154 165
155/* 166/*
156** Special type equivalent to '(void*)' for functions (to suppress some 167** Special type equivalent to '(void*)' for functions (to suppress some