insert_string_roll.c 733 B

123456789101112131415161718192021222324
  1. /* insert_string_roll.c -- insert_string rolling hash variant
  2. *
  3. * Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler
  4. * For conditions of distribution and use, see copyright notice in zlib.h
  5. *
  6. */
  7. #include "zbuild.h"
  8. #include "deflate.h"
  9. #define HASH_SLIDE 5
  10. #define HASH_CALC(h, val) h = ((h << HASH_SLIDE) ^ ((uint8_t)val))
  11. #define HASH_CALC_VAR s->ins_h
  12. #define HASH_CALC_VAR_INIT
  13. #define HASH_CALC_READ val = strstart[0]
  14. #define HASH_CALC_MASK (32768u - 1u)
  15. #define HASH_CALC_OFFSET (STD_MIN_MATCH-1)
  16. #define UPDATE_HASH update_hash_roll
  17. #define INSERT_STRING insert_string_roll
  18. #define QUICK_INSERT_STRING quick_insert_string_roll
  19. #include "insert_string_tpl.h"