aboutsummaryrefslogtreecommitdiff
path: root/src/keeper.c
diff options
context:
space:
mode:
authorBenoit Germain <bnt period germain arrobase gmail period com>2017-05-10 17:10:29 +0200
committerBenoit Germain <bnt period germain arrobase gmail period com>2017-05-10 17:10:29 +0200
commite5f454b3cee91f79f4f107b68a4708addc0a914a (patch)
treee8d3c53937659b2f615870b9294a0d5e0dfa7a30 /src/keeper.c
parent0a064da8d02d0863463583e4f693462ef7725c2f (diff)
downloadlanes-e5f454b3cee91f79f4f107b68a4708addc0a914a.tar.gz
lanes-e5f454b3cee91f79f4f107b68a4708addc0a914a.tar.bz2
lanes-e5f454b3cee91f79f4f107b68a4708addc0a914a.zip
Improve LuaJIT support
* better LuaJIT-specific headers detection * add LuaJIT-specific libraries when known * properly raise an error when attempting to transfer a LUAT_CDATA value * some compilationg warning fixes
Diffstat (limited to 'src/keeper.c')
-rw-r--r--src/keeper.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/keeper.c b/src/keeper.c
index 056c01e..9a7c804 100644
--- a/src/keeper.c
+++ b/src/keeper.c
@@ -103,7 +103,7 @@ static void fifo_push( lua_State* L, keeper_fifo* fifo_, lua_Integer count_)
103 for( i = count_; i >= 1; -- i) 103 for( i = count_; i >= 1; -- i)
104 { 104 {
105 // store in the fifo the value at the top of the stack at the specified index, popping it from the stack 105 // store in the fifo the value at the top of the stack at the specified index, popping it from the stack
106 lua_rawseti( L, idx, start + i); 106 lua_rawseti( L, idx, (int)(start + i));
107 } 107 }
108 fifo_->count += count_; 108 fifo_->count += count_;
109} 109}
@@ -115,11 +115,11 @@ static void fifo_push( lua_State* L, keeper_fifo* fifo_, lua_Integer count_)
115// function assumes that there is enough data in the fifo to satisfy the request 115// function assumes that there is enough data in the fifo to satisfy the request
116static void fifo_peek( lua_State* L, keeper_fifo* fifo_, lua_Integer count_) 116static void fifo_peek( lua_State* L, keeper_fifo* fifo_, lua_Integer count_)
117{ 117{
118 int i; 118 lua_Integer i;
119 STACK_GROW( L, count_); 119 STACK_GROW( L, count_);
120 for( i = 0; i < count_; ++ i) 120 for( i = 0; i < count_; ++ i)
121 { 121 {
122 lua_rawgeti( L, 1, fifo_->first + i); 122 lua_rawgeti( L, 1, (int)( fifo_->first + i));
123 } 123 }
124} 124}
125 125
@@ -134,7 +134,7 @@ static void fifo_pop( lua_State* L, keeper_fifo* fifo_, lua_Integer count_)
134 // skip first item, we will push it last 134 // skip first item, we will push it last
135 for( i = 1; i < count_; ++ i) 135 for( i = 1; i < count_; ++ i)
136 { 136 {
137 lua_Integer const at = fifo_->first + i; 137 int const at = (int)( fifo_->first + i);
138 // push item on the stack 138 // push item on the stack
139 lua_rawgeti( L, fifo_idx, at); // ... fifo val 139 lua_rawgeti( L, fifo_idx, at); // ... fifo val
140 // remove item from the fifo 140 // remove item from the fifo
@@ -143,7 +143,7 @@ static void fifo_pop( lua_State* L, keeper_fifo* fifo_, lua_Integer count_)
143 } 143 }
144 // now process first item 144 // now process first item
145 { 145 {
146 lua_Integer const at = fifo_->first; 146 int const at = (int)( fifo_->first);
147 lua_rawgeti( L, fifo_idx, at); // ... fifo vals val 147 lua_rawgeti( L, fifo_idx, at); // ... fifo vals val
148 lua_pushnil( L); // ... fifo vals val nil 148 lua_pushnil( L); // ... fifo vals val nil
149 lua_rawseti( L, fifo_idx, at); // ... fifo vals val 149 lua_rawseti( L, fifo_idx, at); // ... fifo vals val