From 060c9e7c45f3ef736acffc35a8a83c52763f9a95 Mon Sep 17 00:00:00 2001 From: Jan Nijtmans Date: Tue, 3 Feb 2026 13:21:58 +0000 Subject: Remove all uses of the obsolete keyword "register". --- contrib/minizip/crypt.h | 2 +- deflate.c | 26 +++++++++++++------------- trees.c | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/contrib/minizip/crypt.h b/contrib/minizip/crypt.h index f4b93b78..8bde464b 100644 --- a/contrib/minizip/crypt.h +++ b/contrib/minizip/crypt.h @@ -50,7 +50,7 @@ static int update_keys(unsigned long* pkeys, const z_crc_t* pcrc_32_tab, int c) (*(pkeys+1)) += (*(pkeys+0)) & 0xff; (*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1; { - register int keyshift = (int)((*(pkeys+1)) >> 24); + int keyshift = (int)((*(pkeys+1)) >> 24); (*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift); } return c; diff --git a/deflate.c b/deflate.c index 6ec1e456..1c29e2b4 100644 --- a/deflate.c +++ b/deflate.c @@ -1377,9 +1377,9 @@ int ZEXPORT deflateCopy(z_streamp dest, z_streamp source) { */ local uInt longest_match(deflate_state *s, IPos cur_match) { unsigned chain_length = s->max_chain_length;/* max hash chain length */ - register Bytef *scan = s->window + s->strstart; /* current string */ - register Bytef *match; /* matched string */ - register int len; /* length of current match */ + Bytef *scan = s->window + s->strstart; /* current string */ + Bytef *match; /* matched string */ + int len; /* length of current match */ int best_len = (int)s->prev_length; /* best match length so far */ int nice_match = s->nice_match; /* stop if match long enough */ IPos limit = s->strstart > (IPos)MAX_DIST(s) ? @@ -1394,13 +1394,13 @@ local uInt longest_match(deflate_state *s, IPos cur_match) { /* Compare two bytes at a time. Note: this is not always beneficial. * Try with and without -DUNALIGNED_OK to check. */ - register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1; - register ush scan_start = *(ushf*)scan; - register ush scan_end = *(ushf*)(scan + best_len - 1); + Bytef *strend = s->window + s->strstart + MAX_MATCH - 1; + ush scan_start = *(ushf*)scan; + ush scan_end = *(ushf*)(scan + best_len - 1); #else - register Bytef *strend = s->window + s->strstart + MAX_MATCH; - register Byte scan_end1 = scan[best_len - 1]; - register Byte scan_end = scan[best_len]; + Bytef *strend = s->window + s->strstart + MAX_MATCH; + Byte scan_end1 = scan[best_len - 1]; + Byte scan_end = scan[best_len]; #endif /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. @@ -1524,10 +1524,10 @@ local uInt longest_match(deflate_state *s, IPos cur_match) { * Optimized version for FASTEST only */ local uInt longest_match(deflate_state *s, IPos cur_match) { - register Bytef *scan = s->window + s->strstart; /* current string */ - register Bytef *match; /* matched string */ - register int len; /* length of current match */ - register Bytef *strend = s->window + s->strstart + MAX_MATCH; + Bytef *scan = s->window + s->strstart; /* current string */ + Bytef *match; /* matched string */ + int len; /* length of current match */ + Bytef *strend = s->window + s->strstart + MAX_MATCH; /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. * It is easy to get rid of this optimization if necessary. diff --git a/trees.c b/trees.c index 52024140..68d3bfaa 100644 --- a/trees.c +++ b/trees.c @@ -152,7 +152,7 @@ local TCONST static_tree_desc static_bl_desc = * IN assertion: 1 <= len <= 15 */ local unsigned bi_reverse(unsigned code, int len) { - register unsigned res = 0; + unsigned res = 0; do { res |= code & 1; code >>= 1, res <<= 1; -- cgit v1.2.3-55-g6feb