diff options
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/ngx_buf.c | 3 | ||||
| -rw-r--r-- | src/core/ngx_buf.h | 7 | ||||
| -rw-r--r-- | src/core/ngx_conf_file.h | 18 | ||||
| -rw-r--r-- | src/core/ngx_config.h | 26 | ||||
| -rw-r--r-- | src/core/ngx_connection.h | 2 | ||||
| -rw-r--r-- | src/core/ngx_output_chain.c | 10 |
6 files changed, 41 insertions, 25 deletions
diff --git a/src/core/ngx_buf.c b/src/core/ngx_buf.c index 90973a66d..9c5266a73 100644 --- a/src/core/ngx_buf.c +++ b/src/core/ngx_buf.c @@ -84,7 +84,8 @@ ngx_chain_t *ngx_create_chain_of_bufs(ngx_pool_t *pool, ngx_bufs_t *bufs) } -int ngx_chain_add_copy(ngx_pool_t *pool, ngx_chain_t **chain, ngx_chain_t *in) +ngx_int_t ngx_chain_add_copy(ngx_pool_t *pool, ngx_chain_t **chain, + ngx_chain_t *in) { ngx_chain_t *cl, **ll; diff --git a/src/core/ngx_buf.h b/src/core/ngx_buf.h index bfae4ac80..301d8f794 100644 --- a/src/core/ngx_buf.h +++ b/src/core/ngx_buf.h @@ -170,10 +170,11 @@ ngx_chain_t *ngx_create_chain_of_bufs(ngx_pool_t *pool, ngx_bufs_t *bufs); last = &cl->next -int ngx_output_chain(ngx_output_chain_ctx_t *ctx, ngx_chain_t *in); -int ngx_chain_writer(void *data, ngx_chain_t *in); +ngx_int_t ngx_output_chain(ngx_output_chain_ctx_t *ctx, ngx_chain_t *in); +ngx_int_t ngx_chain_writer(void *data, ngx_chain_t *in); -int ngx_chain_add_copy(ngx_pool_t *pool, ngx_chain_t **chain, ngx_chain_t *in); +ngx_int_t ngx_chain_add_copy(ngx_pool_t *pool, ngx_chain_t **chain, + ngx_chain_t *in); void ngx_chain_update_chains(ngx_chain_t **free, ngx_chain_t **busy, ngx_chain_t **out, ngx_buf_tag_t tag); diff --git a/src/core/ngx_conf_file.h b/src/core/ngx_conf_file.h index 4b9fd90d9..ec61e94cf 100644 --- a/src/core/ngx_conf_file.h +++ b/src/core/ngx_conf_file.h @@ -90,15 +90,15 @@ struct ngx_open_file_s { struct ngx_module_s { - int ctx_index; - int index; + ngx_uint_t ctx_index; + ngx_uint_t index; void *ctx; ngx_command_t *commands; - int type; - int (*init_module)(ngx_cycle_t *cycle); - int (*init_process)(ngx_cycle_t *cycle); + ngx_uint_t type; + ngx_int_t (*init_module)(ngx_cycle_t *cycle); + ngx_int_t (*init_process)(ngx_cycle_t *cycle); #if 0 - int (*init_thread)(ngx_cycle_t *cycle); + ngx_int_t (*init_thread)(ngx_cycle_t *cycle); #endif }; @@ -113,7 +113,7 @@ typedef struct { typedef struct { ngx_file_t file; ngx_buf_t *buffer; - int line; + ngx_uint_t line; } ngx_conf_file_t; @@ -131,8 +131,8 @@ struct ngx_conf_s { ngx_log_t *log; void *ctx; - int module_type; - int cmd_type; + ngx_uint_t module_type; + ngx_uint_t cmd_type; ngx_conf_handler_pt handler; char *handler_conf; diff --git a/src/core/ngx_config.h b/src/core/ngx_config.h index 57039b9fe..465e1bfe1 100644 --- a/src/core/ngx_config.h +++ b/src/core/ngx_config.h @@ -31,12 +31,6 @@ #endif -/* STUB: autoconf */ -typedef int ngx_int_t; -typedef u_int ngx_uint_t; -typedef int ngx_flag_t; - - #if !(WIN32) #define ngx_signal_helper(n) SIG##n @@ -58,6 +52,26 @@ typedef int ngx_flag_t; #define NGX_INVALID_ARRAY_INDEX 0x80000000 +#if 1 +/* STUB: autoconf */ +typedef int ngx_int_t; +typedef u_int ngx_uint_t; +typedef int ngx_flag_t; +#define NGX_INT_T_LEN sizeof("-2147483648") - 1 +#define NGX_INT_T_FMT "d" +#define NGX_UINT_T_FMT "u" + +#else + +typedef long ngx_int_t; +typedef u_long ngx_uint_t; +typedef long ngx_flag_t; +#define NGX_INT_T_LEN sizeof("-9223372036854775808") - 1 +#define NGX_INT_T_FMT "lld" +#define NGX_UINT_T_FMT "llu" + +#endif + /* TODO: auto */ #define NGX_INT32_LEN sizeof("-2147483648") - 1 #define NGX_INT64_LEN sizeof("-9223372036854775808") - 1 diff --git a/src/core/ngx_connection.h b/src/core/ngx_connection.h index 8dbc4e49f..67275bd5e 100644 --- a/src/core/ngx_connection.h +++ b/src/core/ngx_connection.h @@ -97,7 +97,7 @@ struct ngx_connection_s { ngx_buf_t *buffer; - ngx_int_t number; + ngx_uint_t number; unsigned log_error:2; /* ngx_connection_log_error_e */ diff --git a/src/core/ngx_output_chain.c b/src/core/ngx_output_chain.c index 5ea4fd90b..7ab202cef 100644 --- a/src/core/ngx_output_chain.c +++ b/src/core/ngx_output_chain.c @@ -7,13 +7,13 @@ #define NGX_NONE 1 -ngx_inline static int ngx_output_chain_need_to_copy(ngx_output_chain_ctx_t *ctx, - ngx_buf_t *buf); +ngx_inline static ngx_int_t + ngx_output_chain_need_to_copy(ngx_output_chain_ctx_t *ctx, ngx_buf_t *buf); static ngx_int_t ngx_output_chain_copy_buf(ngx_buf_t *dst, ngx_buf_t *src, ngx_uint_t sendfile); -int ngx_output_chain(ngx_output_chain_ctx_t *ctx, ngx_chain_t *in) +ngx_int_t ngx_output_chain(ngx_output_chain_ctx_t *ctx, ngx_chain_t *in) { int rc, last; size_t size, bsize; @@ -168,8 +168,8 @@ int ngx_output_chain(ngx_output_chain_ctx_t *ctx, ngx_chain_t *in) } -ngx_inline static int ngx_output_chain_need_to_copy(ngx_output_chain_ctx_t *ctx, - ngx_buf_t *buf) +ngx_inline static ngx_int_t + ngx_output_chain_need_to_copy(ngx_output_chain_ctx_t *ctx, ngx_buf_t *buf) { if (ngx_buf_special(buf)) { return 0; |
