Skip to content

Commit aee660b

Browse files
committed
bugfix: suppressed the gcc warning "comparison between signed and unsigned integer expressions".
1 parent 4bbf399 commit aee660b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/ngx_http_lua_socket_tcp.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2711,7 +2711,7 @@ ngx_http_lua_socket_tcp_settimeout(lua_State *L)
27112711
}
27122712

27132713
timeout = (ngx_int_t) lua_tonumber(L, 2);
2714-
if (timeout > NGX_MAX_INT32_VALUE) {
2714+
if (timeout > (ngx_int_t) NGX_MAX_INT32_VALUE) {
27152715
return luaL_error(L, "lua tcp socket timeout %f will overflow",
27162716
(lua_Number) timeout);
27172717
}
@@ -2759,19 +2759,19 @@ ngx_http_lua_socket_tcp_settimeouts(lua_State *L)
27592759
}
27602760

27612761
connect_timeout = (ngx_int_t) lua_tonumber(L, 2);
2762-
if (connect_timeout > NGX_MAX_INT32_VALUE) {
2762+
if (connect_timeout > (ngx_int_t) NGX_MAX_INT32_VALUE) {
27632763
return luaL_error(L, "lua tcp socket connect timeout %f will overflow",
27642764
(lua_Number) connect_timeout);
27652765
}
27662766

27672767
send_timeout = (ngx_int_t) lua_tonumber(L, 3);
2768-
if (send_timeout > NGX_MAX_INT32_VALUE) {
2768+
if (send_timeout > (ngx_int_t) NGX_MAX_INT32_VALUE) {
27692769
return luaL_error(L, "lua tcp socket send timeout %f will overflow",
27702770
(lua_Number) send_timeout);
27712771
}
27722772

27732773
read_timeout = (ngx_int_t) lua_tonumber(L, 4);
2774-
if (read_timeout > NGX_MAX_INT32_VALUE) {
2774+
if (read_timeout > (ngx_int_t) NGX_MAX_INT32_VALUE) {
27752775
return luaL_error(L, "lua tcp socket read timeout %f will overflow",
27762776
(lua_Number) read_timeout);
27772777
}

0 commit comments

Comments
 (0)