Some checks failed
sm-rpc / build (Debug, arm-linux-gnueabihf) (push) Successful in 1m34s
sm-rpc / build (Debug, aarch64-linux-gnu) (push) Successful in 2m46s
sm-rpc / build (Debug, host.gcc) (push) Failing after 1m28s
sm-rpc / build (Release, aarch64-linux-gnu) (push) Successful in 2m14s
sm-rpc / build (Release, arm-linux-gnueabihf) (push) Successful in 2m8s
sm-rpc / build (Debug, mipsel-linux-gnu) (push) Successful in 5m35s
sm-rpc / build (Release, host.gcc) (push) Failing after 1m55s
sm-rpc / build (Release, mipsel-linux-gnu) (push) Successful in 7m21s
43 lines
1.4 KiB
C
43 lines
1.4 KiB
C
/* crc32.c -- compute the CRC-32 of a data stream
|
|
* Copyright (C) 1995-2022 Mark Adler
|
|
* For conditions of distribution and use, see copyright notice in zlib.h
|
|
*
|
|
* This interleaved implementation of a CRC makes use of pipelined multiple
|
|
* arithmetic-logic units, commonly found in modern CPU cores. It is due to
|
|
* Kadatch and Jenkins (2010). See doc/crc-doc.1.0.pdf in this distribution.
|
|
*/
|
|
|
|
#include "zbuild.h"
|
|
#include "functable.h"
|
|
#include "crc32_braid_tbl.h"
|
|
|
|
/* ========================================================================= */
|
|
|
|
const uint32_t * Z_EXPORT PREFIX(get_crc_table)(void) {
|
|
return (const uint32_t *)crc_table;
|
|
}
|
|
|
|
#ifdef ZLIB_COMPAT
|
|
unsigned long Z_EXPORT PREFIX(crc32_z)(unsigned long crc, const unsigned char *buf, size_t len) {
|
|
if (buf == NULL) return 0;
|
|
|
|
return (unsigned long)FUNCTABLE_CALL(crc32)((uint32_t)crc, buf, len);
|
|
}
|
|
#else
|
|
uint32_t Z_EXPORT PREFIX(crc32_z)(uint32_t crc, const unsigned char *buf, size_t len) {
|
|
if (buf == NULL) return 0;
|
|
|
|
return FUNCTABLE_CALL(crc32)(crc, buf, len);
|
|
}
|
|
#endif
|
|
|
|
#ifdef ZLIB_COMPAT
|
|
unsigned long Z_EXPORT PREFIX(crc32)(unsigned long crc, const unsigned char *buf, unsigned int len) {
|
|
return (unsigned long)PREFIX(crc32_z)((uint32_t)crc, buf, len);
|
|
}
|
|
#else
|
|
uint32_t Z_EXPORT PREFIX(crc32)(uint32_t crc, const unsigned char *buf, uint32_t len) {
|
|
return PREFIX(crc32_z)(crc, buf, len);
|
|
}
|
|
#endif
|