ext/zlib/zlib.c in zlib-3.0.0 vs ext/zlib/zlib.c in zlib-3.1.0
- old
+ new
@@ -23,11 +23,11 @@
#else
# define VALGRIND_MAKE_MEM_DEFINED(p, n) 0
# define VALGRIND_MAKE_MEM_UNDEFINED(p, n) 0
#endif
-#define RUBY_ZLIB_VERSION "3.0.0"
+#define RUBY_ZLIB_VERSION "3.1.0"
#ifndef RB_PASS_CALLED_KEYWORDS
# define rb_class_new_instance_kw(argc, argv, klass, kw_splat) rb_class_new_instance(argc, argv, klass)
#endif
@@ -42,11 +42,11 @@
#else
#define DEF_MEM_LEVEL MAX_MEM_LEVEL
#endif
#endif
-#if defined(HAVE_TYPE_Z_SIZE_T)
+#if defined(HAVE_ZLIB_SIZE_T_FUNCS)
typedef uLong (*checksum_func)(uLong, const Bytef*, z_size_t);
# define crc32 crc32_z
# define adler32 adler32_z
#else
typedef uLong (*checksum_func)(uLong, const Bytef*, uInt);
@@ -386,11 +386,11 @@
# define mask32(x) ((x) & 0xffffffff)
#else
# define mask32(x) (x)
#endif
-#if SIZEOF_LONG > SIZEOF_INT && !defined(HAVE_TYPE_Z_SIZE_T)
+#if SIZEOF_LONG > SIZEOF_INT && !defined(HAVE_ZLIB_SIZE_T_FUNCS)
static uLong
checksum_long(uLong (*func)(uLong, const Bytef*, uInt), uLong sum, const Bytef *ptr, long len)
{
if (len > UINT_MAX) {
do {
@@ -921,10 +921,10 @@
else { /* do not mangle user-provided data */
if (RSTRING_LEN(z->input) <= len) {
z->input = Qnil;
}
else {
- z->input = rb_str_substr(z->input, len,
+ z->input = rb_str_subseq(z->input, len,
RSTRING_LEN(z->input) - len);
}
}
}