Switch to miniz from zlib

This commit is contained in:
Cacodemon345 2023-09-17 13:48:39 +02:00 committed by Christoph Oelckers
commit ba9ce0e83f
54 changed files with 9285 additions and 24321 deletions

View file

@ -319,7 +319,7 @@ add_custom_target( revision_check ALL
# required libraries
set( PROJECT_LIBRARIES ${PROJECT_LIBRARIES} "${ZLIB_LIBRARIES}" "${BZIP2_LIBRARIES}" "${CMAKE_DL_LIBS}" "${DRPC_LIBRARIES}")
set( PROJECT_LIBRARIES ${PROJECT_LIBRARIES} miniz "${BZIP2_LIBRARIES}" "${CMAKE_DL_LIBS}" "${DRPC_LIBRARIES}")
if (HAVE_VULKAN)
list( APPEND PROJECT_LIBRARIES "zvulkan" )
endif()
@ -387,7 +387,7 @@ if (TARGET WebP::webp)
endif()
endif()
include_directories( SYSTEM "${ZLIB_INCLUDE_DIR}" "${BZIP2_INCLUDE_DIR}" "${LZMA_INCLUDE_DIR}" "${ZMUSIC_INCLUDE_DIR}" "${DRPC_INCLUDE_DIR}")
include_directories( SYSTEM "${BZIP2_INCLUDE_DIR}" "${LZMA_INCLUDE_DIR}" "${ZMUSIC_INCLUDE_DIR}" "${DRPC_INCLUDE_DIR}")
if( ${HAVE_VM_JIT} )
add_definitions( -DHAVE_VM_JIT )

View file

@ -37,7 +37,7 @@
#include <sys/wait.h>
#endif
#include <zlib.h>
#include <miniz.h>
#include <zmusic.h>
#include "filesystem.h"

View file

@ -37,7 +37,7 @@
#define RAPIDJSON_HAS_CXX11_RANGE_FOR 1
#define RAPIDJSON_PARSE_DEFAULT_FLAGS kParseFullPrecisionFlag
#include <zlib.h>
#include <miniz.h>
#include "rapidjson/rapidjson.h"
#include "rapidjson/writer.h"
#include "rapidjson/prettywriter.h"

View file

@ -36,7 +36,7 @@
// Caution: LzmaDec also pulls in windows.h!
#define NOMINMAX
#include "LzmaDec.h"
#include <zlib.h>
#include <miniz.h>
#include <bzlib.h>
#include <algorithm>
#include <stdexcept>

View file

@ -36,7 +36,7 @@
// HEADER FILES ------------------------------------------------------------
#include <zlib.h>
#include <miniz.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>

View file

@ -34,7 +34,7 @@
**
*/
#include <zlib.h>
#include <miniz.h>
#include "resourcefile_internal.h"
#include "md5.hpp"
#include "fs_stringpool.h"

View file

@ -25,6 +25,7 @@
** General model handling code
**
**/
#include <stddef.h> // offsetof() macro.
#include "filesystem.h"
#include "cmdlib.h"
@ -132,17 +133,7 @@ FTextureID LoadSkin(const char * path, const char * fn)
int ModelFrameHash(FSpriteModelFrame * smf)
{
const uint32_t *table = GetCRCTable ();
uint32_t hash = 0xffffffff;
const char * s = (const char *)(&smf->type); // this uses type, sprite and frame for hashing
const char * se= (const char *)(&smf->hashnext);
for (; s<se; s++)
{
hash = CRC1 (hash, *s, table);
}
return hash ^ 0xffffffff;
return crc32(0, (const unsigned char *)(&smf->type), offsetof(FSpriteModelFrame, hashnext) - offsetof(FSpriteModelFrame, type));
}
//===========================================================================

View file

@ -68,7 +68,7 @@
#include "i_mainwindow.h"
#include <time.h>
#include <zlib.h>
#include <miniz.h>
// MACROS ------------------------------------------------------------------

View file

@ -36,7 +36,7 @@
#include <algorithm>
#include <stdlib.h>
#include <zlib.h>
#include <miniz.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <malloc.h> // for alloca()

View file

@ -32,12 +32,11 @@
**
*/
#pragma once
#include <zlib.h>
#include <miniz.h>
#include <stdint.h>
// zlib includes some CRC32 stuff, so just use that
// miniz includes some CRC32 stuff, so just use that
inline const uint32_t *GetCRCTable () { return (const uint32_t *)get_crc_table(); }
inline uint32_t CalcCRC32 (const uint8_t *buf, unsigned int len)
{
return crc32 (0, buf, len);

View file

@ -10,7 +10,7 @@
#include <errno.h>
#include <ctype.h>
#include <stdint.h>
#include <zlib.h>
#include <miniz.h>
#include <new>
#include <algorithm>
#include <forward_list>

View file

@ -11,7 +11,7 @@
#include <errno.h>
#include <ctype.h>
#include <stdint.h>
#include <zlib.h>
#include <miniz.h>
#include <new>
#include <algorithm>
#include <sys/stat.h>

View file

@ -42,7 +42,7 @@
#endif
#include <zlib.h>
#include <miniz.h>
#include "m_argv.h"
#include "c_dispatch.h"

View file

@ -38,7 +38,7 @@
#define RAPIDJSON_HAS_CXX11_RANGE_FOR 1
#define RAPIDJSON_PARSE_DEFAULT_FLAGS kParseFullPrecisionFlag
#include <zlib.h>
#include <miniz.h>
#include "rapidjson/rapidjson.h"
#include "rapidjson/writer.h"
#include "rapidjson/prettywriter.h"