ox 2.2.3 → 2.2.4

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of ox might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6501b4bbce82df3807ef682abd7900ad0a01c8c4
4
- data.tar.gz: ab7dc1b9321f2f023edba54e29104a3962136b5e
3
+ metadata.gz: 46e015e0b3899db57415e3edbf2634590d199b7e
4
+ data.tar.gz: 5aeb573b6fdc7342b392513e4731713f4c7caee2
5
5
  SHA512:
6
- metadata.gz: c0192af23950c8fbcbc3ff351a12b17e57198836e34fe1b8662f4089b93389ac6e2b614deb8c1c96f61c5d99d76aa06509e0a049e97011ea708fc09440df3968
7
- data.tar.gz: b95bb36a7fbc7695dcb333f13e610d9086e977a538c22e85c1941fb33d076c9b371380a208d4ed5f078556a73bae4c36cd895e2615b254bb987aa4b3837b7483
6
+ metadata.gz: 1258f0904dd33ebc85adf0f89436dd1d4d783cfd2393f1cdc4fe0cfc55321c33da5fb687dd4cdda0df15922c850a27fa3cdd1a5491b4e4d713598d4de64f36db
7
+ data.tar.gz: 3b34e3bbfbb4b6d512f763447a822ce6552f3630e5097b03b8a33ae3ea563452cb9cc2718135b40496640b654b65c180214274594e8605924f434275373e5e98
data/README.md CHANGED
@@ -34,6 +34,11 @@ A fast XML parser and Object marshaller as a Ruby gem.
34
34
 
35
35
  ## Release Notes
36
36
 
37
+ ### Release 2.2.4
38
+
39
+ - Changed the code to allow compilation on older compilers. No change in
40
+ functionality otherwise.
41
+
37
42
  ### Release 2.2.3
38
43
 
39
44
  - The convert_special option now applies to attributes as well as elements in
@@ -37,16 +37,16 @@ ox_sax_buf_init(Buf buf, VALUE io) {
37
37
  VALUE s = rb_funcall2(io, ox_string_id, 0, 0);
38
38
 
39
39
  buf->read_func = read_from_str;
40
- buf->in_str = StringValuePtr(s);
40
+ buf->in.str = StringValuePtr(s);
41
41
  } else if (rb_cFile == io_class && Qnil != (rfd = rb_funcall(io, ox_fileno_id, 0))) {
42
42
  buf->read_func = read_from_fd;
43
- buf->fd = FIX2INT(rfd);
43
+ buf->in.fd = FIX2INT(rfd);
44
44
  } else if (rb_respond_to(io, ox_readpartial_id)) {
45
45
  buf->read_func = read_from_io_partial;
46
- buf->io = io;
46
+ buf->in.io = io;
47
47
  } else if (rb_respond_to(io, ox_read_id)) {
48
48
  buf->read_func = read_from_io;
49
- buf->io = io;
49
+ buf->in.io = io;
50
50
  } else {
51
51
  rb_raise(ox_arg_error_class, "sax_parser io argument must respond to readpartial() or read().\n");
52
52
  }
@@ -137,7 +137,7 @@ partial_io_cb(VALUE rbuf) {
137
137
  size_t cnt;
138
138
 
139
139
  args[0] = ULONG2NUM(buf->end - buf->tail);
140
- rstr = rb_funcall2(buf->io, ox_readpartial_id, 1, args);
140
+ rstr = rb_funcall2(buf->in.io, ox_readpartial_id, 1, args);
141
141
  str = StringValuePtr(rstr);
142
142
  cnt = strlen(str);
143
143
  //printf("*** read partial %lu bytes, str: '%s'\n", cnt, str);
@@ -156,7 +156,7 @@ io_cb(VALUE rbuf) {
156
156
  size_t cnt;
157
157
 
158
158
  args[0] = ULONG2NUM(buf->end - buf->tail);
159
- rstr = rb_funcall2(buf->io, ox_read_id, 1, args);
159
+ rstr = rb_funcall2(buf->in.io, ox_read_id, 1, args);
160
160
  str = StringValuePtr(rstr);
161
161
  cnt = strlen(str);
162
162
  //printf("*** read %lu bytes, str: '%s'\n", cnt, str);
@@ -181,7 +181,7 @@ read_from_fd(Buf buf) {
181
181
  ssize_t cnt;
182
182
  size_t max = buf->end - buf->tail;
183
183
 
184
- cnt = read(buf->fd, buf->tail, max);
184
+ cnt = read(buf->in.fd, buf->tail, max);
185
185
  if (cnt < 0) {
186
186
  ox_sax_drive_error(buf->dr, "failed to read from file");
187
187
  return -1;
@@ -210,14 +210,14 @@ read_from_str(Buf buf) {
210
210
  char *s;
211
211
  long cnt;
212
212
 
213
- if ('\0' == *buf->in_str) {
213
+ if ('\0' == *buf->in.str) {
214
214
  /* done */
215
215
  return -1;
216
216
  }
217
- s = ox_stpncpy(buf->tail, buf->in_str, max);
217
+ s = ox_stpncpy(buf->tail, buf->in.str, max);
218
218
  *s = '\0';
219
219
  cnt = s - buf->tail;
220
- buf->in_str += cnt;
220
+ buf->in.str += cnt;
221
221
  buf->read_end = buf->tail + cnt;
222
222
 
223
223
  return 0;
@@ -24,8 +24,8 @@ typedef struct _Buf {
24
24
  union {
25
25
  int fd;
26
26
  VALUE io;
27
- const char *in_str;
28
- };
27
+ const char *str;
28
+ } in;
29
29
  struct _SaxDrive *dr;
30
30
  } *Buf;
31
31
 
@@ -1,5 +1,5 @@
1
1
 
2
2
  module Ox
3
3
  # Current version of the module.
4
- VERSION = '2.2.3'
4
+ VERSION = '2.2.4'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ox
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.3
4
+ version: 2.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Ohler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-31 00:00:00.000000000 Z
11
+ date: 2016-02-04 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: "A fast XML parser and object serializer that uses only standard C lib.\n
14
14
  \ \nOptimized XML (Ox), as the name implies was written to provide speed