zlib 3.2.1 → 3.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/ext/zlib/zlib.c +14 -20
  3. metadata +3 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 92e21e7d156e0a92bfb671d2c63ce8773f14faa73376b134d2b50619ee0d5cf1
4
- data.tar.gz: 4dbf1207f8e6bfde47c7c7ad3e6e4fb34ac925ab6aa46c801b5f6260c1a81031
3
+ metadata.gz: 336dc64dd83cbbd9a74ca0494fd75bc2324ff0a615baa20b3c45c232ea6ee35a
4
+ data.tar.gz: f23633ed1053a62b9423628edf0ad19149bf1785371f5c5bc3b08900dabeb56e
5
5
  SHA512:
6
- metadata.gz: 9d651705b95865f99bc0b47efb06a2b8bbd0154c63dc905c7e21733ce1ce244489eb67925bd83dd48eb9b7f8a8fd1cd3622b2a73159e33d8d51c9f78ae5f723e
7
- data.tar.gz: 22166bec315ebd5c069c6c32bd451bc8af24d90904d9051b78c867a839617b5a49133e9dd25afa6e357bb321a3ac46e4b2dec307f7835ec7b094a7d0d6782dfe
6
+ metadata.gz: d6b289bcde42b602690993bd4dc087928f1d50542ed9ddeffb148071f3e5eb9e37bd3891cfa9ec435648a62e01b6cffcfdc1dd92995674efe39c88c434843c6f
7
+ data.tar.gz: 00764a29cf1ecbe3a0db97919a911e98ec21d1690599381c12e34a736469f1be8643997964575b4782aa5a100b0f219e645ca067bd22ad222e34b723f886d2f0
data/ext/zlib/zlib.c CHANGED
@@ -25,7 +25,7 @@
25
25
  # define VALGRIND_MAKE_MEM_UNDEFINED(p, n) 0
26
26
  #endif
27
27
 
28
- #define RUBY_ZLIB_VERSION "3.2.1"
28
+ #define RUBY_ZLIB_VERSION "3.2.3"
29
29
 
30
30
  #ifndef RB_PASS_CALLED_KEYWORDS
31
31
  # define rb_class_new_instance_kw(argc, argv, klass, kw_splat) rb_class_new_instance(argc, argv, klass)
@@ -860,9 +860,7 @@ zstream_buffer_ungets(struct zstream *z, const Bytef *b, unsigned long len)
860
860
  char *bufptr;
861
861
  long filled;
862
862
 
863
- if (NIL_P(z->buf) || (long)rb_str_capacity(z->buf) <= ZSTREAM_BUF_FILLED(z)) {
864
- zstream_expand_buffer_into(z, len);
865
- }
863
+ zstream_expand_buffer_into(z, len);
866
864
 
867
865
  RSTRING_GETMEM(z->buf, bufptr, filled);
868
866
  memmove(bufptr + len, bufptr, filled);
@@ -2444,17 +2442,16 @@ struct gzfile {
2444
2442
 
2445
2443
  #define GZFILE_READ_SIZE 2048
2446
2444
 
2445
+ enum { read_raw_arg_len, read_raw_arg_buf, read_raw_arg__count};
2447
2446
  struct read_raw_arg {
2448
2447
  VALUE io;
2449
- union {
2450
- const VALUE argv[2]; /* for rb_funcallv */
2451
- struct {
2452
- VALUE len;
2453
- VALUE buf;
2454
- } in;
2455
- } as;
2448
+ const VALUE argv[read_raw_arg__count]; /* for rb_funcallv */
2456
2449
  };
2457
2450
 
2451
+ #define read_raw_arg_argc(ra) \
2452
+ ((int)read_raw_arg__count - NIL_P((ra)->argv[read_raw_arg__count - 1]))
2453
+ #define read_raw_arg_init(io, len, buf) { io, { len, buf } }
2454
+
2458
2455
  static void
2459
2456
  gzfile_mark(void *p)
2460
2457
  {
@@ -2580,9 +2577,9 @@ gzfile_read_raw_partial(VALUE arg)
2580
2577
  {
2581
2578
  struct read_raw_arg *ra = (struct read_raw_arg *)arg;
2582
2579
  VALUE str;
2583
- int argc = NIL_P(ra->as.argv[1]) ? 1 : 2;
2580
+ int argc = read_raw_arg_argc(ra);
2584
2581
 
2585
- str = rb_funcallv(ra->io, id_readpartial, argc, ra->as.argv);
2582
+ str = rb_funcallv(ra->io, id_readpartial, argc, ra->argv);
2586
2583
  Check_Type(str, T_STRING);
2587
2584
  return str;
2588
2585
  }
@@ -2593,8 +2590,8 @@ gzfile_read_raw_rescue(VALUE arg, VALUE _)
2593
2590
  struct read_raw_arg *ra = (struct read_raw_arg *)arg;
2594
2591
  VALUE str = Qnil;
2595
2592
  if (rb_obj_is_kind_of(rb_errinfo(), rb_eNoMethodError)) {
2596
- int argc = NIL_P(ra->as.argv[1]) ? 1 : 2;
2597
- str = rb_funcallv(ra->io, id_read, argc, ra->as.argv);
2593
+ int argc = read_raw_arg_argc(ra);
2594
+ str = rb_funcallv(ra->io, id_read, argc, ra->argv);
2598
2595
  if (!NIL_P(str)) {
2599
2596
  Check_Type(str, T_STRING);
2600
2597
  }
@@ -2605,11 +2602,8 @@ gzfile_read_raw_rescue(VALUE arg, VALUE _)
2605
2602
  static VALUE
2606
2603
  gzfile_read_raw(struct gzfile *gz, VALUE outbuf)
2607
2604
  {
2608
- struct read_raw_arg ra;
2609
-
2610
- ra.io = gz->io;
2611
- ra.as.in.len = INT2FIX(GZFILE_READ_SIZE);
2612
- ra.as.in.buf = outbuf;
2605
+ struct read_raw_arg ra =
2606
+ read_raw_arg_init(gz->io, INT2FIX(GZFILE_READ_SIZE), outbuf);
2613
2607
 
2614
2608
  return rb_rescue2(gzfile_read_raw_partial, (VALUE)&ra,
2615
2609
  gzfile_read_raw_rescue, (VALUE)&ra,
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zlib
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.1
4
+ version: 3.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yukihiro Matsumoto
8
8
  - UENO Katsuhiro
9
- autorequire:
10
9
  bindir: exe
11
10
  cert_chain: []
12
- date: 2024-12-17 00:00:00.000000000 Z
11
+ date: 1980-01-02 00:00:00.000000000 Z
13
12
  dependencies: []
14
13
  description: Ruby interface for the zlib compression/decompression library
15
14
  email:
@@ -31,7 +30,6 @@ licenses:
31
30
  - Ruby
32
31
  - BSD-2-Clause
33
32
  metadata: {}
34
- post_install_message:
35
33
  rdoc_options: []
36
34
  require_paths:
37
35
  - lib
@@ -46,8 +44,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
46
44
  - !ruby/object:Gem::Version
47
45
  version: '0'
48
46
  requirements: []
49
- rubygems_version: 3.5.11
50
- signing_key:
47
+ rubygems_version: 3.6.9
51
48
  specification_version: 4
52
49
  summary: Ruby interface for the zlib compression/decompression library
53
50
  test_files: []