Mercurial > hg > nginx-quic
comparison src/core/ngx_crc.h @ 776:5622cdd48e5b
style fix
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 13 Oct 2006 15:09:25 +0000 |
parents | bbd6b0b4a2b1 |
children | 604f9671fae6 |
comparison
equal
deleted
inserted
replaced
775:a452a0e13539 | 776:5622cdd48e5b |
---|---|
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++; |