Mercurial > hg > nginx-vendor-current
comparison src/core/ngx_crc.h @ 248:acd2ec3541cb NGINX_0_4_9
nginx 0.4.9
*) Feature: the "set" parameter in the "include" SSI command.
*) Feature: the ngx_http_perl_module now tests the nginx.pm module
version.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Fri, 13 Oct 2006 00:00:00 +0400 |
parents | 74b1868dd3cd |
children | fbf2b2f66c9f |
comparison
equal
deleted
inserted
replaced
247:fcca101509a4 | 248:acd2ec3541cb |
---|---|
8 #define _NGX_CRC_H_INCLUDED_ | 8 #define _NGX_CRC_H_INCLUDED_ |
9 | 9 |
10 | 10 |
11 /* 32-bit crc16 */ | 11 /* 32-bit crc16 */ |
12 | 12 |
13 static ngx_inline uint32_t ngx_crc(char *data, size_t len) | 13 static ngx_inline uint32_t |
14 ngx_crc(char *data, size_t len) | |
14 { | 15 { |
15 uint32_t sum; | 16 uint32_t sum; |
16 | 17 |
17 for (sum = 0; len; len--) { | 18 for (sum = 0; len; len--) { |
18 | 19 |
19 /* | 20 /* |
20 * gcc 2.95.2 x86 and icc 7.1.006 compile that operator | 21 * gcc 2.95.2 x86 and icc 7.1.006 compile |
21 * into the single "rol" opcode. | 22 * that operator into the single "rol" opcode, |
22 * msvc 6.0sp2 compiles it into four opcodes. | 23 * msvc 6.0sp2 compiles it into four opcodes. |
23 */ | 24 */ |
24 sum = sum >> 1 | sum << 31; | 25 sum = sum >> 1 | sum << 31; |
25 | 26 |
26 sum += *data++; | 27 sum += *data++; |