Clean up more code

- Found some bugs in LLVM compiler-rt library
- The useless LIBC_STUBS package is now deleted
- Improve the overflow checking story even further
- Get chibicc tests working in MODE=dbg mode again
- The libc/isystem/ headers now have correctly named guards
This commit is contained in:
Justine Tunney 2023-06-18 00:55:09 -07:00
parent afc58a8b41
commit d7c79f43ef
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
294 changed files with 912 additions and 1208 deletions

View file

@ -957,10 +957,10 @@ int ZEXPORT deflate(strm, flush)
(s->gzhead->name == Z_NULL ? 0 : 8) +
(s->gzhead->comment == Z_NULL ? 0 : 16)
);
put_byte(s, (Byte)(s->gzhead->time & 0xff));
put_byte(s, (Byte)((s->gzhead->time >> 8) & 0xff));
put_byte(s, (Byte)((s->gzhead->time >> 16) & 0xff));
put_byte(s, (Byte)((s->gzhead->time >> 24) & 0xff));
put_byte(s, (Byte)(s->gzhead->time_ & 0xff));
put_byte(s, (Byte)((s->gzhead->time_ >> 8) & 0xff));
put_byte(s, (Byte)((s->gzhead->time_ >> 16) & 0xff));
put_byte(s, (Byte)((s->gzhead->time_ >> 24) & 0xff));
put_byte(s, s->level == 9 ? 2 :
(s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ?
4 : 0));

View file

@ -24,7 +24,6 @@ THIRD_PARTY_ZLIB_GZ_A_DIRECTDEPS = \
LIBC_NEXGEN32E \
LIBC_STDIO \
LIBC_STR \
LIBC_STUBS \
LIBC_SYSV \
THIRD_PARTY_ZLIB

View file

@ -331,7 +331,6 @@ struct inflate_state FAR *state;
#include "libc/stdio/dprintf.h"
#include "libc/calls/weirdtypes.h"
#include "libc/fmt/fmt.h"
#include "libc/mem/fmt.h"
#include "libc/stdio/stdio.h"
#include "libc/stdio/temp.h"
#include "third_party/musl/tempnam.h"
@ -751,7 +750,7 @@ int flush;
case TIME:
NEEDBITS(32);
if (state->head != Z_NULL)
state->head->time = hold;
state->head->time_ = hold;
if ((state->flags & 0x0200) && (state->wrap & 4))
CRC4(state->check, hold);
INITBITS();

View file

@ -8,7 +8,6 @@
*/
#include "libc/calls/calls.h"
#include "libc/fmt/fmt.h"
#include "libc/mem/fmt.h"
#include "libc/stdio/lock.internal.h"
#include "libc/stdio/stdio.h"
#include "libc/stdio/temp.h"

View file

@ -171,7 +171,7 @@ typedef z_stream *z_streamp;
*/
typedef struct gz_header_s {
int text; /* true if compressed data believed to be text */
uLong time; /* modification time */
uLong time_; /* modification time */
int xflags; /* extra flags (not used when writing a gzip file) */
int os; /* operating system */
Bytef *extra; /* pointer to extra field or Z_NULL if none */

View file

@ -19,9 +19,8 @@ THIRD_PARTY_ZLIB_A_CHECKS = \
THIRD_PARTY_ZLIB_A_DIRECTDEPS = \
LIBC_INTRIN \
LIBC_NEXGEN32E \
LIBC_SYSV \
LIBC_STR \
LIBC_STUBS
LIBC_SYSV
THIRD_PARTY_ZLIB_A_DEPS := \
$(call uniq,$(foreach x,$(THIRD_PARTY_ZLIB_A_DIRECTDEPS),$($(x))))