ffi 1.14.0-x64-mingw32 → 1.14.1-x64-mingw32

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: 614f2331a77eb45762c942a282697e247a86a4b2f97582226893e93cb496bee5
4
- data.tar.gz: 1c39548adec97f5c9b7f19518edcf1581583b3a55b11535edfdc7b67031f2a54
3
+ metadata.gz: 634ac08faa345adcb69704357ca330210cc1a693016e9baa006f24e50a074ced
4
+ data.tar.gz: e7206eee796d20f6e95af6235c68ad6bd8a9bd63563fab5a05adb9c586d5e304
5
5
  SHA512:
6
- metadata.gz: 62f122b39e7f8b78fb5e01e6acdbb67f9d0ae009145944b22af0cd1c474cdf0d4afe63c409d644418d66d3135269a979e435c78c3e4df4ec641160e72d6685aa
7
- data.tar.gz: 15f60935d1e76db78ef96d6e06de2dfcb2f3151b005083abe1b6fd180fbad3945544d1d344b582529d07401c14d22b7a15d0ad1a03f73592356fc7e6a4a8684b
6
+ metadata.gz: 1bf9dc354b64cdb522381ac403ababf2ea03a7c81b320c5c8b13106ece4678db3b6dd348c533b4c206fd9e938d912cbd41bc75a64a9cd20ac06ea9f7a60d3804
7
+ data.tar.gz: b9e4210ee459b68934ebf8b2d44deb53cfcf9821285d62b94e515a656ab20608533382632c6e96ff02510c6f2579255ee537443be3b05ed695926bc97ed3b0ab
@@ -1,3 +1,11 @@
1
+ 1.14.1 / 2020-12-19
2
+ -------------------
3
+
4
+ Changed:
5
+ * Revert changes to FFI::Pointer#write_string made in ffi-1.14.0.
6
+ It turned out that it can cause hard to find errors. #857
7
+
8
+
1
9
  1.14.0 / 2020-12-18
2
10
  -------------------
3
11
 
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -85,37 +85,23 @@ module FFI
85
85
  # @param [String] str string to write
86
86
  # @param [Numeric] len length of string to return
87
87
  # @return [self]
88
- # Write +len+ first bytes of +str+ in pointer's contents and a final \0 byte.
88
+ # Write +len+ first bytes of +str+ in pointer's contents.
89
89
  #
90
90
  # Same as:
91
91
  # ptr.write_string(str, len) # with len not nil
92
92
  def write_string_length(str, len)
93
- write_string(str, len)
93
+ put_bytes(0, str, 0, len)
94
94
  end unless method_defined?(:write_string_length)
95
95
 
96
96
  # @param [String] str string to write
97
97
  # @param [Numeric] len length of string to return
98
98
  # @return [self]
99
- # Write +str+ in pointer's contents.
100
- # If +len+ is given, write the first +len+ bytes of +str+.
101
- # In both cases a final \0 byte is written after the string.
99
+ # Write +str+ in pointer's contents, or first +len+ bytes if
100
+ # +len+ is not +nil+.
102
101
  def write_string(str, len=nil)
103
- if len
104
- if len == size
105
- warn "[DEPRECATION] Memory too small to write a final 0-byte in #{caller(1, 1)[0]}. This will raise an error in ffi-2.0. Please use write_bytes instead or enlarge the memory region."
106
- write_bytes(str, 0, len)
107
- else
108
- put_char(len, 0) # Check size before writing str
109
- write_bytes(str, 0, len)
110
- end
111
- else
112
- if str.bytesize == size
113
- warn "[DEPRECATION] Memory too small to write a final 0-byte in #{caller(1, 1)[0]}. This will raise an error in ffi-2.0. Please use write_bytes instead or enlarge the memory region."
114
- write_bytes(str)
115
- else
116
- put_string(0, str)
117
- end
118
- end
102
+ len = str.bytesize unless len
103
+ # Write the string data without NUL termination
104
+ put_bytes(0, str, 0, len)
119
105
  end unless method_defined?(:write_string)
120
106
 
121
107
  # @param [Type] type type of data to read from pointer's contents
@@ -1,3 +1,3 @@
1
1
  module FFI
2
- VERSION = '1.14.0'
2
+ VERSION = '1.14.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ffi
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.14.0
4
+ version: 1.14.1
5
5
  platform: x64-mingw32
6
6
  authors:
7
7
  - Wayne Meissner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-18 00:00:00.000000000 Z
11
+ date: 2020-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake