Skip to content

Commit 0b9af72

Browse files
committed
use an inline function here instead of a macro for ngx_http_lua_shdict_get_list_head
1 parent 3e66f5f commit 0b9af72

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/ngx_http_lua_shdict.c

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,20 @@ enum {
6161
};
6262

6363
enum {
64-
SHDICT_TNIL = 0, // same as LUA_TNIL
65-
SHDICT_TBOOLEAN = 1, // same as LUA_TBOOLEAN
66-
SHDICT_TNUMBER = 3, // same as LUA_TNUMBER
67-
SHDICT_TSTRING = 4, // same as LUA_TSTRING
64+
SHDICT_TNIL = 0, /* same as LUA_TNIL */
65+
SHDICT_TBOOLEAN = 1, /* same as LUA_TBOOLEAN */
66+
SHDICT_TNUMBER = 3, /* same as LUA_TNUMBER */
67+
SHDICT_TSTRING = 4, /* same as LUA_TSTRING */
6868
SHDICT_TLIST = 5,
6969
};
7070

7171

72-
#define ngx_http_lua_shdict_get_list_head(sd, key_len) \
73-
(ngx_queue_t *) ngx_align_ptr(((u_char *) &sd->data + key_len), \
74-
NGX_ALIGNMENT)
72+
static ngx_queue_t *
73+
ngx_http_lua_shdict_get_list_head(ngx_http_lua_shdict_node_t *sd, u_short len)
74+
{
75+
return (ngx_queue_t *) ngx_align_ptr(((u_char *) &sd->data + len),
76+
NGX_ALIGNMENT);
77+
}
7578

7679

7780
ngx_int_t

0 commit comments

Comments
 (0)