========================================================================= */
(crc, buf, len)
| 200 | |
| 201 | /* ========================================================================= */ |
| 202 | unsigned long ZEXPORT crc32_z(crc, buf, len) |
| 203 | unsigned long crc; |
| 204 | const unsigned char FAR *buf; |
| 205 | z_size_t len; |
| 206 | { |
| 207 | if (buf == Z_NULL) return 0UL; |
| 208 | |
| 209 | #ifdef DYNAMIC_CRC_TABLE |
| 210 | if (crc_table_empty) |
| 211 | make_crc_table(); |
| 212 | #endif /* DYNAMIC_CRC_TABLE */ |
| 213 | |
| 214 | #ifdef BYFOUR |
| 215 | if (sizeof(void *) == sizeof(ptrdiff_t)) { |
| 216 | z_crc_t endian; |
| 217 | |
| 218 | endian = 1; |
| 219 | if (*((unsigned char *)(&endian))) |
| 220 | return crc32_little(crc, buf, len); |
| 221 | else |
| 222 | return crc32_big(crc, buf, len); |
| 223 | } |
| 224 | #endif /* BYFOUR */ |
| 225 | crc = crc ^ 0xffffffffUL; |
| 226 | while (len >= 8) { |
| 227 | DO8; |
| 228 | len -= 8; |
| 229 | } |
| 230 | if (len) do { |
| 231 | DO1; |
| 232 | } while (--len); |
| 233 | return crc ^ 0xffffffffUL; |
| 234 | } |
| 235 | |
| 236 | /* ========================================================================= */ |
| 237 | unsigned long ZEXPORT crc32(crc, buf, len) |
no test coverage detected