comparison src/http/ngx_http_parse_time.c @ 3207:154b5f8565a9

use ngx_uint_t instead of int, strange to say this reduce function size by 16 bytes
author Igor Sysoev <igor@sysoev.ru>
date Thu, 15 Oct 2009 13:09:58 +0000
parents f62751dab60d
children 8cec9724fe71
comparison
equal deleted inserted replaced
3206:d77551ac7335 3207:154b5f8565a9
6 6
7 #include <ngx_config.h> 7 #include <ngx_config.h>
8 #include <ngx_core.h> 8 #include <ngx_core.h>
9 9
10 10
11 static int mday[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; 11 static ngx_uint_t mday[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
12 12
13 time_t 13 time_t
14 ngx_http_parse_time(u_char *value, size_t len) 14 ngx_http_parse_time(u_char *value, size_t len)
15 { 15 {
16 u_char *p, *end; 16 u_char *p, *end;
17 int day, month, year, hour, min, sec; 17 ngx_int_t month;
18 ngx_uint_t day, year, hour, min, sec;
18 enum { 19 enum {
19 no = 0, 20 no = 0,
20 rfc822, /* Tue, 10 Nov 2002 23:50:13 */ 21 rfc822, /* Tue, 10 Nov 2002 23:50:13 */
21 rfc850, /* Tuesday, 10-Dec-02 23:50:13 */ 22 rfc850, /* Tuesday, 10-Dec-02 23:50:13 */
22 isoc /* Tue Dec 10 23:50:13 2002 */ 23 isoc /* Tue Dec 10 23:50:13 2002 */