Remove zlib/
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
#undef NDEBUG
|
||||
#include <assert.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
@@ -59,6 +60,7 @@ void asserts(void) {
|
||||
assert(sizeof(Group) == 24); // Group struct incorrect size
|
||||
assert(sizeof((Group) { 0 }.label) == 4); // Label union in group struct incorrect size
|
||||
assert(sizeof(Field) == 6); // Field struct incorrect size
|
||||
assert(sizeof(uLongf) == sizeof(uint32_t)); // zlib compatability
|
||||
}
|
||||
|
||||
void espr_walk(char *data, size_t size, struct walker_callbacks cb) {
|
||||
@@ -174,11 +176,11 @@ void decompress_pre(Node n, void *decom_ptr, void **carry_out) {
|
||||
|
||||
// decompress directly into buffer
|
||||
// first 4 bytes are the decompressed size
|
||||
const size_t dc_size = *((uint32_t *)n.data);
|
||||
size_t to_copy = dc_size;
|
||||
size_t cur_size = n.header.record->size - sizeof(uint32_t);
|
||||
const uint32_t dc_size = *((uint32_t *)n.data);
|
||||
uint32_t to_copy = dc_size;
|
||||
uint32_t cur_size = n.header.record->size - sizeof(uint32_t);
|
||||
char *data_start = n.data + sizeof(uint32_t);
|
||||
int ret = uncompress(d->buf, &to_copy, data_start, cur_size);
|
||||
int ret = uncompress((Bytef *)d->buf, (uLongf *)&to_copy, (Bytef *)data_start, (uLong)cur_size);
|
||||
assert(ret == Z_OK);
|
||||
assert(to_copy == dc_size);
|
||||
|
||||
@@ -225,7 +227,7 @@ void decompress_post(Node n, void *decom_ptr, void **carry_in) {
|
||||
// only need to handle group resize
|
||||
if (n.type == NT_GROUP) {
|
||||
Group *g = (Group *)(*carry_in);
|
||||
size_t new_size = (char *)d->buf - (char *)g;
|
||||
uint32_t new_size = (uint32_t)((char *)d->buf - (char *)g);
|
||||
g->size = new_size;
|
||||
}
|
||||
}
|
||||
@@ -377,7 +379,8 @@ void print_record_flags(Record *header) {
|
||||
if (flag_lut) {
|
||||
while (flags != 0) {
|
||||
// will always be >= 0 as flags is not 0
|
||||
size_t highest = 31 - __lzcnt(flags);
|
||||
int highest = 31 - __lzcnt(flags);
|
||||
assert(highest >= 0);
|
||||
const char *const str = (*flag_lut)[highest];
|
||||
if (str) {
|
||||
printf(" - %s\n", str);
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
<PreprocessorDefinitions>NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<LanguageStandard_C>stdc11</LanguageStandard_C>
|
||||
<AdditionalIncludeDirectories>..\zlib</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>..\zlib-win-build</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>
|
||||
@@ -148,8 +148,8 @@
|
||||
<ClCompile Include="Reader.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\zlib\contrib\vstudio\vc14\zlibstat.vcxproj">
|
||||
<Project>{745dec58-ebb3-47a9-a9b8-4c6627c01bf8}</Project>
|
||||
<ProjectReference Include="..\zlib-win-build\build-VS2022\libz-static\libz-static.vcxproj">
|
||||
<Project>{b56d17bc-072b-42f3-844a-870a07afbaaa}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
|
||||
Reference in New Issue
Block a user