From 76eaddfc2ff3d7c3976de3456389b29d7987102d Mon Sep 17 00:00:00 2001 From: tb Date: Sun, 28 Jan 2024 16:11:31 +0000 Subject: [PATCH] sync with userland --- sys/lib/libz/deflate.c | 8 ++++---- sys/lib/libz/trees.c | 2 +- sys/lib/libz/zutil.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/lib/libz/deflate.c b/sys/lib/libz/deflate.c index 51c012c89dc..cf8a65d9311 100644 --- a/sys/lib/libz/deflate.c +++ b/sys/lib/libz/deflate.c @@ -1669,10 +1669,10 @@ local block_state deflate_stored(deflate_state *s, int flush) { _tr_stored_block(s, (char *)0, 0L, last); /* Replace the lengths in the dummy stored block with len. */ - s->pending_buf[s->pending - 4] = len; - s->pending_buf[s->pending - 3] = len >> 8; - s->pending_buf[s->pending - 2] = ~len; - s->pending_buf[s->pending - 1] = ~len >> 8; + s->pending_buf[s->pending - 4] = (Bytef)len; + s->pending_buf[s->pending - 3] = (Bytef)(len >> 8); + s->pending_buf[s->pending - 2] = (Bytef)~len; + s->pending_buf[s->pending - 1] = (Bytef)(~len >> 8); /* Write the stored block header bytes. */ flush_pending(s->strm); diff --git a/sys/lib/libz/trees.c b/sys/lib/libz/trees.c index b486030ccf9..cba0708b602 100644 --- a/sys/lib/libz/trees.c +++ b/sys/lib/libz/trees.c @@ -722,7 +722,7 @@ local void scan_tree(deflate_state *s, ct_data *tree, int max_code) { if (++count < max_count && curlen == nextlen) { continue; } else if (count < min_count) { - s->bl_tree[curlen].Freq += count; + s->bl_tree[curlen].Freq += (ush)count; } else if (curlen != 0) { if (curlen != prevlen) s->bl_tree[curlen].Freq++; s->bl_tree[REP_3_6].Freq++; diff --git a/sys/lib/libz/zutil.h b/sys/lib/libz/zutil.h index af855cc4494..10018086f8a 100644 --- a/sys/lib/libz/zutil.h +++ b/sys/lib/libz/zutil.h @@ -157,7 +157,7 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ # define OS_CODE 7 #endif -#ifdef __acorn +#if defined(__acorn) || defined(__riscos) # define OS_CODE 13 #endif -- 2.20.1