summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Kristian Rosbach <hk-git@circlestorm.org>2020-08-20 16:09:23 +0200
committerHans Kristian Rosbach <hk-github@circlestorm.org>2020-08-21 09:46:03 +0200
commit0cd1818e8669423815626de48c00b3334d2875cb (patch)
tree639c1a04824bd8a7a3c4580f642a75b8dd673d6e
parent5b5677abd326e9ad2cda16edf4aa9dc3ec6a1171 (diff)
Remove return value from insert_string, since it is always ignored and
quick_insert_string is being used instead.
-rw-r--r--functable.c10
-rw-r--r--functable.h2
-rw-r--r--insert_string_tpl.h9
3 files changed, 9 insertions, 12 deletions
diff --git a/functable.c b/functable.c
index 1d43551..aa70046 100644
--- a/functable.c
+++ b/functable.c
@@ -15,11 +15,11 @@
#endif
/* insert_string */
-extern Pos insert_string_c(deflate_state *const s, const uint32_t str, uint32_t count);
+extern void insert_string_c(deflate_state *const s, const uint32_t str, uint32_t count);
#ifdef X86_SSE42_CRC_HASH
-extern Pos insert_string_sse4(deflate_state *const s, const uint32_t str, uint32_t count);
+extern void insert_string_sse4(deflate_state *const s, const uint32_t str, uint32_t count);
#elif defined(ARM_ACLE_CRC_HASH)
-extern Pos insert_string_acle(deflate_state *const s, const uint32_t str, uint32_t count);
+extern void insert_string_acle(deflate_state *const s, const uint32_t str, uint32_t count);
#endif
/* quick_insert_string */
@@ -144,7 +144,7 @@ ZLIB_INTERNAL void cpu_check_features(void)
}
/* stub functions */
-ZLIB_INTERNAL Pos insert_string_stub(deflate_state *const s, const uint32_t str, uint32_t count) {
+ZLIB_INTERNAL void insert_string_stub(deflate_state *const s, const uint32_t str, uint32_t count) {
// Initialize default
functable.insert_string = &insert_string_c;
@@ -158,7 +158,7 @@ ZLIB_INTERNAL Pos insert_string_stub(deflate_state *const s, const uint32_t str,
functable.insert_string = &insert_string_acle;
#endif
- return functable.insert_string(s, str, count);
+ functable.insert_string(s, str, count);
}
ZLIB_INTERNAL Pos quick_insert_string_stub(deflate_state *const s, const uint32_t str) {
diff --git a/functable.h b/functable.h
index dab313d..82b04c3 100644
--- a/functable.h
+++ b/functable.h
@@ -9,7 +9,7 @@
#include "deflate.h"
struct functable_s {
- Pos (* insert_string) (deflate_state *const s, const uint32_t str, uint32_t count);
+ void (* insert_string) (deflate_state *const s, const uint32_t str, uint32_t count);
Pos (* quick_insert_string)(deflate_state *const s, const uint32_t str);
uint32_t (* adler32) (uint32_t adler, const unsigned char *buf, size_t len);
uint32_t (* crc32) (uint32_t crc, const unsigned char *buf, uint64_t len);
diff --git a/insert_string_tpl.h b/insert_string_tpl.h
index f5d61ce..d667231 100644
--- a/insert_string_tpl.h
+++ b/insert_string_tpl.h
@@ -60,13 +60,12 @@ ZLIB_INTERNAL Pos QUICK_INSERT_STRING(deflate_state *const s, const uint32_t str
* input characters and the first MIN_MATCH bytes of str are valid
* (except for the last MIN_MATCH-1 bytes of the input file).
*/
-ZLIB_INTERNAL Pos INSERT_STRING(deflate_state *const s, const uint32_t str, uint32_t count) {
- Pos head = 0, idx;
+ZLIB_INTERNAL void INSERT_STRING(deflate_state *const s, const uint32_t str, uint32_t count) {
uint8_t *strstart = s->window + str;
uint8_t *strend = strstart + count - 1; /* last position */
uint32_t hash_mask = s->hash_mask;
- for (idx = str; strstart <= strend; idx++, strstart++) {
+ for (Pos idx = str; strstart <= strend; idx++, strstart++) {
uint32_t val, hm, h = 0;
#ifdef UNALIGNED_OK
@@ -81,13 +80,11 @@ ZLIB_INTERNAL Pos INSERT_STRING(deflate_state *const s, const uint32_t str, uint
UPDATE_HASH(s, h, val);
hm = h & hash_mask;
- head = s->head[hm];
+ Pos head = s->head[hm];
if (LIKELY(head != idx)) {
s->prev[idx & s->w_mask] = head;
s->head[hm] = idx;
}
}
-
- return head;
}
#endif