thrift 0.21.0 → 0.22.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 513fd9b0d94c913f2ebada5ec1156e32f8ce291d575407c615cdaa92d01162d4
4
- data.tar.gz: 454090a96ba6fd84b0c7e81501a00e23d5cfea33da978e09940a7de5f13ef35b
3
+ metadata.gz: fe32174805f7e6b9801ebf00500fad76c1922c3f5e816fba597dfc0aae195c5d
4
+ data.tar.gz: b908a7a66b4bff7fc95728778240d2583d685f2fdcdf563edb125dc571cb0040
5
5
  SHA512:
6
- metadata.gz: b8402b90b52eedbd93a9d5dcdfa9149eb8ffb1180ffa02b4d4140cfac30de0e35782d1e964334d5835e40ea1199deedb344ff1f4817d6b3398f66fbfa0ee096b
7
- data.tar.gz: 2bc884035d0610608ab30d8725fda1b10502fba09310a40dbee897358354378f877f68dbb4db49162267e4422bcf1068c183e88065c02801d60d954c434ebb61
6
+ metadata.gz: cd8377282c40257b9d4bd2e95633584a04f27609118a8694d9a0037cbf9affc4d9f42aa4647c4dcd43ed64668a77f7abb375f77ca6e5bef8aaae03db8702dcd8
7
+ data.tar.gz: 31637b8001126ee81c9a74803e2cbb942cb57dfbc529a72ceb121a28a2614695689d55bd0204dc12429d82ce38a7c0057c18420a872921f376e20e178b213c5e
@@ -82,7 +82,7 @@ static void write_string_direct(VALUE trans, VALUE str) {
82
82
  rb_raise(rb_eStandardError, "Value should be a string");
83
83
  }
84
84
  str = convert_to_utf8_byte_buffer(str);
85
- write_i32_direct(trans, RSTRING_LEN(str));
85
+ write_i32_direct(trans, (int32_t)RSTRING_LEN(str));
86
86
  rb_funcall(trans, write_method_id, 1, str);
87
87
  }
88
88
 
@@ -223,7 +223,7 @@ VALUE rb_thrift_binary_proto_write_binary(VALUE self, VALUE buf) {
223
223
  CHECK_NIL(buf);
224
224
  VALUE trans = GET_TRANSPORT(self);
225
225
  buf = force_binary_encoding(buf);
226
- write_i32_direct(trans, RSTRING_LEN(buf));
226
+ write_i32_direct(trans, (int32_t)RSTRING_LEN(buf));
227
227
  rb_funcall(trans, write_method_id, 1, buf);
228
228
  return Qnil;
229
229
  }
@@ -403,9 +403,9 @@ VALUE rb_thrift_binary_proto_read_binary(VALUE self) {
403
403
  void Init_binary_protocol_accelerated() {
404
404
  VALUE thrift_binary_protocol_class = rb_const_get(thrift_module, rb_intern("BinaryProtocol"));
405
405
 
406
- VERSION_1 = rb_num2ll(rb_const_get(thrift_binary_protocol_class, rb_intern("VERSION_1")));
407
- VERSION_MASK = rb_num2ll(rb_const_get(thrift_binary_protocol_class, rb_intern("VERSION_MASK")));
408
- TYPE_MASK = rb_num2ll(rb_const_get(thrift_binary_protocol_class, rb_intern("TYPE_MASK")));
406
+ VERSION_1 = (int)rb_num2ll(rb_const_get(thrift_binary_protocol_class, rb_intern("VERSION_1")));
407
+ VERSION_MASK = (int)rb_num2ll(rb_const_get(thrift_binary_protocol_class, rb_intern("VERSION_MASK")));
408
+ TYPE_MASK = (int)rb_num2ll(rb_const_get(thrift_binary_protocol_class, rb_intern("TYPE_MASK")));
409
409
 
410
410
  VALUE bpa_class = rb_define_class_under(thrift_module, "BinaryProtocolAccelerated", thrift_binary_protocol_class);
411
411
 
@@ -315,7 +315,7 @@ VALUE rb_thrift_compact_proto_write_string(VALUE self, VALUE str) {
315
315
  VALUE rb_thrift_compact_proto_write_binary(VALUE self, VALUE buf) {
316
316
  buf = force_binary_encoding(buf);
317
317
  VALUE transport = GET_TRANSPORT(self);
318
- write_varint32(transport, RSTRING_LEN(buf));
318
+ write_varint32(transport, (uint32_t)RSTRING_LEN(buf));
319
319
  WRITE(transport, StringValuePtr(buf), RSTRING_LEN(buf));
320
320
  return Qnil;
321
321
  }
@@ -452,7 +452,7 @@ VALUE rb_thrift_compact_proto_read_message_begin(VALUE self) {
452
452
  }
453
453
 
454
454
  int8_t type = (version_and_type >> TYPE_SHIFT_AMOUNT) & TYPE_BITS;
455
- int32_t seqid = read_varint64(self);
455
+ int32_t seqid = (int32_t)read_varint64(self);
456
456
  VALUE messageName = rb_thrift_compact_proto_read_string(self);
457
457
  return rb_ary_new3(3, messageName, INT2FIX(type), INT2NUM(seqid));
458
458
  }
@@ -490,7 +490,7 @@ VALUE rb_thrift_compact_proto_read_field_begin(VALUE self) {
490
490
  }
491
491
 
492
492
  VALUE rb_thrift_compact_proto_read_map_begin(VALUE self) {
493
- int32_t size = read_varint64(self);
493
+ int32_t size = (int32_t)read_varint64(self);
494
494
  uint8_t key_and_value_type = size == 0 ? 0 : read_byte_direct(self);
495
495
  return rb_ary_new3(3, INT2FIX(get_ttype(key_and_value_type >> 4)), INT2FIX(get_ttype(key_and_value_type & 0xf)), INT2FIX(size));
496
496
  }
@@ -499,7 +499,7 @@ VALUE rb_thrift_compact_proto_read_list_begin(VALUE self) {
499
499
  uint8_t size_and_type = read_byte_direct(self);
500
500
  int32_t size = (size_and_type >> 4) & 0x0f;
501
501
  if (size == 15) {
502
- size = read_varint64(self);
502
+ size = (int32_t)read_varint64(self);
503
503
  }
504
504
  uint8_t type = get_ttype(size_and_type & 0x0f);
505
505
  return rb_ary_new3(2, INT2FIX(type), INT2FIX(size));
@@ -528,7 +528,7 @@ VALUE rb_thrift_compact_proto_read_i16(VALUE self) {
528
528
  }
529
529
 
530
530
  VALUE rb_thrift_compact_proto_read_i32(VALUE self) {
531
- return INT2NUM(zig_zag_to_int(read_varint64(self)));
531
+ return INT2NUM(zig_zag_to_int((int32_t)read_varint64(self)));
532
532
  }
533
533
 
534
534
  VALUE rb_thrift_compact_proto_read_i64(VALUE self) {
@@ -569,10 +569,10 @@ static void Init_constants() {
569
569
  thrift_compact_protocol_class = rb_const_get(thrift_module, rb_intern("CompactProtocol"));
570
570
  rb_global_variable(&thrift_compact_protocol_class);
571
571
 
572
- VERSION = rb_num2ll(rb_const_get(thrift_compact_protocol_class, rb_intern("VERSION")));
573
- VERSION_MASK = rb_num2ll(rb_const_get(thrift_compact_protocol_class, rb_intern("VERSION_MASK")));
574
- TYPE_MASK = rb_num2ll(rb_const_get(thrift_compact_protocol_class, rb_intern("TYPE_MASK")));
575
- TYPE_BITS = rb_num2ll(rb_const_get(thrift_compact_protocol_class, rb_intern("TYPE_BITS")));
572
+ VERSION = (int32_t)rb_num2ll(rb_const_get(thrift_compact_protocol_class, rb_intern("VERSION")));
573
+ VERSION_MASK = (int32_t)rb_num2ll(rb_const_get(thrift_compact_protocol_class, rb_intern("VERSION_MASK")));
574
+ TYPE_MASK = (int32_t)rb_num2ll(rb_const_get(thrift_compact_protocol_class, rb_intern("TYPE_MASK")));
575
+ TYPE_BITS = (int32_t)rb_num2ll(rb_const_get(thrift_compact_protocol_class, rb_intern("TYPE_BITS")));
576
576
  TYPE_SHIFT_AMOUNT = FIX2INT(rb_const_get(thrift_compact_protocol_class, rb_intern("TYPE_SHIFT_AMOUNT")));
577
577
  PROTOCOL_ID = FIX2INT(rb_const_get(thrift_compact_protocol_class, rb_intern("PROTOCOL_ID")));
578
578
 
data/ext/memory_buffer.c CHANGED
@@ -54,7 +54,7 @@ VALUE rb_thrift_memory_buffer_read(VALUE self, VALUE length_value) {
54
54
 
55
55
  index += length;
56
56
  if (index > RSTRING_LEN(buf)) {
57
- index = RSTRING_LEN(buf);
57
+ index = (int)RSTRING_LEN(buf);
58
58
  }
59
59
  if (index >= GARBAGE_BUFFER_SIZE) {
60
60
  rb_ivar_set(self, buf_ivar_id, rb_funcall(buf, slice_method_id, 2, INT2FIX(index), INT2FIX(RSTRING_LEN(buf) - 1)));
data/ext/struct.c CHANGED
@@ -225,7 +225,7 @@ VALUE get_field_value(VALUE obj, VALUE field_name) {
225
225
  }
226
226
 
227
227
  static void write_container(int ttype, VALUE field_info, VALUE value, VALUE protocol) {
228
- int sz, i;
228
+ long sz, i;
229
229
 
230
230
  if (ttype == TTYPE_MAP) {
231
231
  VALUE keys;
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thrift
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.0
4
+ version: 0.22.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Apache Thrift Developers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-22 00:00:00.000000000 Z
11
+ date: 2025-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler