diff options
author | Benoit Germain <bnt.germain@gmail.com> | 2012-10-20 20:24:56 +0200 |
---|---|---|
committer | Benoit Germain <bnt.germain@gmail.com> | 2012-10-20 20:24:56 +0200 |
commit | dcd65c02b597974721bec92180ec8d522a04cab2 (patch) | |
tree | 1ce3b9f2aca938501cadc765331c468dfc8f53ae | |
parent | 47dc5f2211294ac0e43cd2b4e8f511f9234ffd8c (diff) | |
download | lanes-dcd65c02b597974721bec92180ec8d522a04cab2.tar.gz lanes-dcd65c02b597974721bec92180ec8d522a04cab2.tar.bz2 lanes-dcd65c02b597974721bec92180ec8d522a04cab2.zip |
build fixes
-rw-r--r-- | src/keeper.c | 35 | ||||
-rw-r--r-- | src/threading.c | 2 |
2 files changed, 19 insertions, 18 deletions
diff --git a/src/keeper.c b/src/keeper.c index 83ec8f3..ba4b8ed 100644 --- a/src/keeper.c +++ b/src/keeper.c | |||
@@ -186,28 +186,29 @@ static void push_table( lua_State* L, int idx) | |||
186 | int keeper_push_linda_storage( lua_State* L, void* ptr) | 186 | int keeper_push_linda_storage( lua_State* L, void* ptr) |
187 | { | 187 | { |
188 | struct s_Keeper* K = keeper_acquire( ptr); | 188 | struct s_Keeper* K = keeper_acquire( ptr); |
189 | STACK_CHECK( K->L) | 189 | lua_State* KL = K->L; |
190 | lua_pushlightuserdata( K->L, fifos_key); // fifos_key | 190 | STACK_CHECK( KL) |
191 | lua_rawget( K->L, LUA_REGISTRYINDEX); // fifos | 191 | lua_pushlightuserdata( KL, fifos_key); // fifos_key |
192 | lua_pushlightuserdata( K->L, ptr); // fifos ud | 192 | lua_rawget( KL, LUA_REGISTRYINDEX); // fifos |
193 | lua_rawget( K->L, -2); // fifos storage | 193 | lua_pushlightuserdata( KL, ptr); // fifos ud |
194 | lua_remove( K->L, -2); // storage | 194 | lua_rawget( KL, -2); // fifos storage |
195 | if( !lua_istable( K->L, -1)) | 195 | lua_remove( KL, -2); // storage |
196 | if( !lua_istable( KL, -1)) | ||
196 | { | 197 | { |
197 | lua_pop( K->L, 1); // | 198 | lua_pop( KL, 1); // |
198 | STACK_MID( K->L, 0); | 199 | STACK_MID( KL, 0); |
199 | return 0; | 200 | return 0; |
200 | } | 201 | } |
201 | lua_pushnil( K->L); // storage nil | 202 | lua_pushnil( KL); // storage nil |
202 | lua_newtable( L); // out | 203 | lua_newtable( L); // out |
203 | while( lua_next( K->L, -2)) // storage key fifo | 204 | while( lua_next( KL, -2)) // storage key fifo |
204 | { | 205 | { |
205 | keeper_fifo* fifo = prepare_fifo_access( K->L, -1); // storage key fifo | 206 | keeper_fifo* fifo = prepare_fifo_access( KL, -1); // storage key fifo |
206 | lua_pushvalue( K->L, -2); // storage key fifo key | 207 | lua_pushvalue( KL, -2); // storage key fifo key |
207 | luaG_inter_move( K->L, L, 1); // storage key fifo // out key | 208 | luaG_inter_move( KL, L, 1); // storage key fifo // out key |
208 | STACK_CHECK( L) | 209 | STACK_CHECK( L) |
209 | lua_newtable( L); // out key keyout | 210 | lua_newtable( L); // out key keyout |
210 | luaG_inter_move( K->L, L, 1); // storage key // out key keyout fifo | 211 | luaG_inter_move( KL, L, 1); // storage key // out key keyout fifo |
211 | lua_pushinteger( L, fifo->first); // out key keyout fifo first | 212 | lua_pushinteger( L, fifo->first); // out key keyout fifo first |
212 | lua_setfield( L, -3, "first"); // out key keyout fifo | 213 | lua_setfield( L, -3, "first"); // out key keyout fifo |
213 | lua_pushinteger( L, fifo->count); // out key keyout fifo count | 214 | lua_pushinteger( L, fifo->count); // out key keyout fifo count |
@@ -218,8 +219,8 @@ int keeper_push_linda_storage( lua_State* L, void* ptr) | |||
218 | lua_rawset( L, -3); // out | 219 | lua_rawset( L, -3); // out |
219 | STACK_END( L, 0) | 220 | STACK_END( L, 0) |
220 | } | 221 | } |
221 | lua_pop( K->L, 1); // | 222 | lua_pop( KL, 1); // |
222 | STACK_END( K->L, 0) | 223 | STACK_END( KL, 0) |
223 | keeper_release( K); | 224 | keeper_release( K); |
224 | return 1; | 225 | return 1; |
225 | } | 226 | } |
diff --git a/src/threading.c b/src/threading.c index 3bcf6cd..edfae90 100644 --- a/src/threading.c +++ b/src/threading.c | |||
@@ -778,7 +778,7 @@ bool_t THREAD_WAIT( THREAD_T *ref, double secs , SIGNAL_T *signal_ref, MUTEX_T * | |||
778 | #if defined PLATFORM_BSD | 778 | #if defined PLATFORM_BSD |
779 | pthread_set_name_np( pthread_self(), _name); | 779 | pthread_set_name_np( pthread_self(), _name); |
780 | #elif defined PLATFORM_LINUX || defined PLATFORM_QNX || defined PLATFORM_CYGWIN | 780 | #elif defined PLATFORM_LINUX || defined PLATFORM_QNX || defined PLATFORM_CYGWIN |
781 | pthread_setname_np(_name pthread_self(), _name); | 781 | pthread_setname_np( pthread_self(), _name); |
782 | #elif defined PLATFORM_OSX | 782 | #elif defined PLATFORM_OSX |
783 | pthread_setname_np(_name); | 783 | pthread_setname_np(_name); |
784 | #elif defined PLATFORM_WIN32 || defined PLATFORM_POCKETPC | 784 | #elif defined PLATFORM_WIN32 || defined PLATFORM_POCKETPC |