Mercurial > hg > nginx
comparison src/core/ngx_string.c @ 1310:33d6c994a0b2
Sun Studio on sparc uses different bit order
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 17 Jul 2007 09:23:23 +0000 |
parents | 458e041fc902 |
children | 07ebeeb55700 |
comparison
equal
deleted
inserted
replaced
1309:08c6ee7a1b11 | 1310:33d6c994a0b2 |
---|---|
103 | 103 |
104 | 104 |
105 u_char * | 105 u_char * |
106 ngx_vsnprintf(u_char *buf, size_t max, const char *fmt, va_list args) | 106 ngx_vsnprintf(u_char *buf, size_t max, const char *fmt, va_list args) |
107 { | 107 { |
108 u_char *p, zero, *last, temp[NGX_INT64_LEN + 1]; | 108 u_char *p, zero, *last, temp[NGX_INT64_LEN + 1]; |
109 /* | 109 /* |
110 * really we need temp[NGX_INT64_LEN] only, | 110 * really we need temp[NGX_INT64_LEN] only, |
111 * but icc issues the warning | 111 * but icc issues the warning |
112 */ | 112 */ |
113 int d; | 113 int d; |
114 size_t len; | 114 size_t len; |
115 uint32_t ui32; | 115 uint32_t ui32; |
116 int64_t i64; | 116 int64_t i64; |
117 uint64_t ui64; | 117 uint64_t ui64; |
118 ngx_msec_t ms; | 118 ngx_msec_t ms; |
119 ngx_str_t *s; | 119 ngx_uint_t width, sign, hexadecimal, max_width; |
120 ngx_uint_t width, sign, hexadecimal, max_width; | 120 ngx_variable_value_t *v; |
121 static u_char hex[] = "0123456789abcdef"; | 121 static u_char hex[] = "0123456789abcdef"; |
122 static u_char HEX[] = "0123456789ABCDEF"; | 122 static u_char HEX[] = "0123456789ABCDEF"; |
123 | 123 |
124 if (max == 0) { | 124 if (max == 0) { |
125 return buf; | 125 return buf; |
126 } | 126 } |
127 | 127 |
186 | 186 |
187 | 187 |
188 switch (*fmt) { | 188 switch (*fmt) { |
189 | 189 |
190 case 'V': | 190 case 'V': |
191 s = va_arg(args, ngx_str_t *); | 191 v = va_arg(args, ngx_variable_value_t *); |
192 | 192 |
193 len = s->len & 0xffff; | 193 len = v->len; |
194 len = (buf + len < last) ? len : (size_t) (last - buf); | 194 len = (buf + len < last) ? len : (size_t) (last - buf); |
195 | 195 |
196 buf = ngx_cpymem(buf, s->data, len); | 196 buf = ngx_cpymem(buf, v->data, len); |
197 fmt++; | 197 fmt++; |
198 | 198 |
199 continue; | 199 continue; |
200 | 200 |
201 case 's': | 201 case 's': |