rbs 3.5.0 → 3.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1b76067316b4cfcc66b0072df88be6f74b1e982c3e2c583aa81153fc1d7590cf
4
- data.tar.gz: 1051d0012adab3eb36807bad04223e2f6aee7e242981ff12ad0f5e7bdab910d9
3
+ metadata.gz: 3dc7a972ca885618f8bcb3beb35d5096ddd9cc3dc6880fb6ae6b06d4a1845be0
4
+ data.tar.gz: 3fd84cf6a4869385f16e98cb1319855fcc1fcc242e16731b6bbdd5d249f1df8a
5
5
  SHA512:
6
- metadata.gz: cb7c0b36f6398e989fb33cac75b76566404004c54bc395d2e320c01ec50022a6dd9161589506d2446ec71e4f64bebc983a2664acefc8b64a5bbef1832ee86191
7
- data.tar.gz: fc53b27131a5b9d947c072b809aff22c23edadbbe211f49ce415796dc0d3f084230f6c609b1eaf1229adf4a15acce1f67aa57bc9ec0929989c9f085155f8c272
6
+ metadata.gz: 0b79dcac9fa9f94eff95b2c098208784f45e8ee891b94202f8e82886d15e0af04bbb26acdff5428277470536cfef164f79b5a1f73ded288b320600bd15568500
7
+ data.tar.gz: c0c6f53213e0b0aac09747c2aef470548b2b872b8ace2647ebdedca292a55b8aa0dbbebfa5c3ff75c47d3f76e87643f23f75883cacc49726fd778f95e1c3ee9e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 3.5.1 (2024-06-07)
4
+
5
+ ### Library changes
6
+
7
+ * Add explicit dependency on the `logger` gem ([#1865](https://github.com/ruby/rbs/pull/1865))
8
+ * Make c99, c23 compatible ([#1870](https://github.com/ruby/rbs/pull/1870))
9
+
10
+ ### Miscellaneous
11
+
12
+ * Don't try to sign git commits when running tests ([#1867](https://github.com/ruby/rbs/pull/1867))
13
+
3
14
  ## 3.5.0 (2024-06-06)
4
15
 
5
16
  ### Signature updates
@@ -2,6 +2,7 @@
2
2
 
3
3
  #define RBS_LOC_REQUIRED_P(loc, i) ((loc)->children->required_p & (1 << (i)))
4
4
  #define RBS_LOC_OPTIONAL_P(loc, i) (!RBS_LOC_REQUIRED_P((loc), (i)))
5
+ #define RBS_LOC_CHILDREN_SIZE(cap) (sizeof(rbs_loc_children) + sizeof(rbs_loc_entry) * ((cap) - 1))
5
6
 
6
7
  VALUE RBS_Location;
7
8
 
@@ -25,7 +26,7 @@ static void check_children_max(unsigned short n) {
25
26
  void rbs_loc_alloc_children(rbs_loc *loc, unsigned short cap) {
26
27
  check_children_max(cap);
27
28
 
28
- size_t s = sizeof(rbs_loc_children) + sizeof(rbs_loc_entry) * cap;
29
+ size_t s = RBS_LOC_CHILDREN_SIZE(cap);
29
30
  loc->children = malloc(s);
30
31
 
31
32
  loc->children->len = 0;
@@ -39,7 +40,7 @@ static void check_children_cap(rbs_loc *loc) {
39
40
  } else {
40
41
  if (loc->children->len == loc->children->cap) {
41
42
  check_children_max(loc->children->cap + 1);
42
- size_t s = sizeof(rbs_loc_children) + sizeof(rbs_loc_entry) * (++loc->children->cap);
43
+ size_t s = RBS_LOC_CHILDREN_SIZE(++loc->children->cap);
43
44
  loc->children = realloc(loc->children, s);
44
45
  }
45
46
  }
@@ -85,7 +86,7 @@ static size_t rbs_loc_memsize(const void *ptr) {
85
86
  if (loc->children == NULL) {
86
87
  return sizeof(rbs_loc);
87
88
  } else {
88
- return sizeof(rbs_loc) + sizeof(rbs_loc_children) + sizeof(rbs_loc_entry) * loc->children->cap;
89
+ return sizeof(rbs_loc) + RBS_LOC_CHILDREN_SIZE(loc->children->cap);
89
90
  }
90
91
  }
91
92
 
@@ -129,7 +130,7 @@ static VALUE location_initialize_copy(VALUE self, VALUE other) {
129
130
  self_loc->rg = other_loc->rg;
130
131
  if (other_loc->children != NULL) {
131
132
  rbs_loc_alloc_children(self_loc, other_loc->children->cap);
132
- memcpy(self_loc->children, other_loc->children, sizeof(rbs_loc_children) + sizeof(rbs_loc_entry) * other_loc->children->cap);
133
+ memcpy(self_loc->children, other_loc->children, RBS_LOC_CHILDREN_SIZE(other_loc->children->cap));
133
134
  }
134
135
 
135
136
  return Qnil;
@@ -16,17 +16,19 @@ typedef struct {
16
16
 
17
17
  typedef unsigned int rbs_loc_entry_bitmap;
18
18
 
19
+ // The flexible array always allocates, but it's okay.
20
+ // This struct is not allocated when the `rbs_loc` doesn't have children.
19
21
  typedef struct {
20
22
  unsigned short len;
21
23
  unsigned short cap;
22
24
  rbs_loc_entry_bitmap required_p;
23
- rbs_loc_entry entries[0];
25
+ rbs_loc_entry entries[1];
24
26
  } rbs_loc_children;
25
27
 
26
28
  typedef struct {
27
29
  VALUE buffer;
28
30
  range rg;
29
- rbs_loc_children *children;
31
+ rbs_loc_children *children; // NULL when no children is allocated
30
32
  } rbs_loc;
31
33
 
32
34
  /**
data/lib/rbs/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RBS
4
- VERSION = "3.5.0"
4
+ VERSION = "3.5.1"
5
5
  end
data/rbs.gemspec CHANGED
@@ -41,4 +41,5 @@ Gem::Specification.new do |spec|
41
41
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
42
42
  spec.require_paths = ["lib"]
43
43
  spec.required_ruby_version = ">= 3.0"
44
+ spec.add_dependency "logger"
44
45
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbs
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.0
4
+ version: 3.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Soutaro Matsumoto
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-06-06 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2024-06-07 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: logger
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  description: RBS is the language for type signatures for Ruby and standard library
14
28
  definitions.
15
29
  email:
@@ -513,7 +527,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
513
527
  - !ruby/object:Gem::Version
514
528
  version: '0'
515
529
  requirements: []
516
- rubygems_version: 3.5.9
530
+ rubygems_version: 3.5.3
517
531
  signing_key:
518
532
  specification_version: 4
519
533
  summary: Type signature for Ruby.