sereal 0.0.16 → 0.0.17

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
  SHA1:
3
- metadata.gz: 64ff27261d48f5ecf93ef19adb89cd126590c397
4
- data.tar.gz: c2a9ecfb806d3dd559bc0b18e9aea7b26128c44a
3
+ metadata.gz: d8a56a6cb7a2ba50f8301e8f4d86ed041e86b72c
4
+ data.tar.gz: 19a41dd12c2323163ad7b2020fe77b6fbe7dcd88
5
5
  SHA512:
6
- metadata.gz: 02e40c40cb0a9f151ff59fa257037986519fadd6c68d6733db37c35fe41cd72b0b5b7958317e8732c40a24cc6df9bb0af8a9f1c12442d379eaabc486c6c2203a
7
- data.tar.gz: edfc06b878c2516420f7358cba6ea478b053ae5b0c1dad802e6634eccd96dc0dfaab6726060ea1b8721621f4275537a3a77ea320b636893f954a1a81922dc715
6
+ metadata.gz: 5f876f0f313862a4fc5ebc71953e0fe0a734d244912314ac0363b045aa845b29ca56b8b82ccee28ed46da727112490f9327e890f591c0e4b883a8a87e695080e
7
+ data.tar.gz: b611d10133aaef4f6a5e9a69ba02249b3f97013a5de53237b38078a4e61028665aae044e23e2af6793942be52a7e2a8ace26596f0536ffb30db50ef489f966cc
@@ -1,6 +1,8 @@
1
1
  #include "sereal.h"
2
2
  #include <errno.h>
3
-
3
+ #include <sys/types.h>
4
+ #include <sys/uio.h>
5
+ #include <unistd.h>
4
6
  static inline void s_free_data_if_not_mine(sereal_t *s) {
5
7
  if (!(s->flags & __NOT_MINE)) {
6
8
  if (s->data)
@@ -190,21 +192,3 @@ static inline void s_set_flag_at_pos(sereal_t *s, u32 pos, u8 flag) {
190
192
  u8 *p = s_get_p_at_pos(s,pos,0);
191
193
  *p |= flag;
192
194
  }
193
-
194
- static void b_dump(u8 *p, u32 len, u32 pos) {
195
- u32 i;
196
-
197
- fprintf(stderr,"\n-----------\n");
198
- for (i = 0; i < len; i++) {
199
- if (i == pos)
200
- fprintf(stderr," [%c %d] ",p[i],p[i]);
201
- else
202
- fprintf(stderr," (%c %d) ",p[i],p[i]);
203
- }
204
- fprintf(stderr,"\n-----------\n");
205
- }
206
-
207
- static void s_dump(sereal_t *s) {
208
- E("[ pos: %d, size: %d, rsize: %d ]\n",s->pos,s->size,s->rsize);
209
- b_dump(s->data,s->size,s->pos);
210
- }
@@ -127,6 +127,7 @@ static VALUE s_read_rb_string_bang(sereal_t *s,u8 t) {
127
127
  }
128
128
  #undef RETURN_STRING
129
129
  s_raise(s,rb_eTypeError, "undefined string type %d",t);
130
+ return Qnil;
130
131
  }
131
132
 
132
133
  static VALUE s_read_next_rb_string_bang(sereal_t *s) {
@@ -173,6 +174,7 @@ static VALUE s_read_pad(sereal_t *s, u8 tag) {
173
174
 
174
175
  static VALUE s_read_extend(sereal_t *s, u8 tag) {
175
176
  s_raise(s,rb_eArgError,"extend tags are not supported");
177
+ return Qnil;
176
178
  }
177
179
 
178
180
  static VALUE s_read_ref(sereal_t *s, u8 tag) {
@@ -180,7 +182,7 @@ static VALUE s_read_ref(sereal_t *s, u8 tag) {
180
182
  s_raise(s,rb_eArgError,"there are no references stored");
181
183
  u64 off = s_get_varint_bang(s);
182
184
  VALUE object = rb_hash_lookup(s->tracked,INT2FIX(off + s->hdr_end));
183
- SD(s,"reading reference from offset: %llu, id: %d",off + s->hdr_end,FIX2INT(rb_obj_id(object)));
185
+ SD(s,"reading reference from offset: %" PRIu64 ", id: %d",off + s->hdr_end,FIX2INT(rb_obj_id(object)));
184
186
  return object;
185
187
  }
186
188
 
@@ -338,7 +340,7 @@ again:
338
340
  return Qnil;
339
341
  }
340
342
  if (size < __MIN_SIZE)
341
- s_raise(s,rb_eTypeError,"size(%d) is less then min packet size %d, offset: %llu",size,__MIN_SIZE,offset);
343
+ s_raise(s,rb_eTypeError,"size(%d) is less then min packet size %d, offset: %" PRIu64,size,__MIN_SIZE,offset);
342
344
 
343
345
  s->flags |= __NOT_MINE;
344
346
  s->data = (u8 *) RSTRING_PTR(payload) + offset;
@@ -351,6 +353,9 @@ again:
351
353
 
352
354
  u8 version = s_get_u8_bang(s);
353
355
  u8 suffix = s_get_varint_bang(s);
356
+ if (suffix > 0)
357
+ s_raise(s,rb_eTypeError,"HEADER-SUFFIX-SIZE is not supported yet");
358
+
354
359
  u8 is_compressed;
355
360
 
356
361
  if ((version & SRL_PROTOCOL_ENCODING_MASK) == SRL_PROTOCOL_ENCODING_SNAPPY) {
@@ -433,7 +433,7 @@ method_sereal_encode(VALUE self, VALUE args) {
433
433
  s->size = compressed_len + s_header_len + compressed_len_varint + un_compressed_len_varint;
434
434
  s->pos = s->size;
435
435
  }
436
- VALUE ret = rb_str_new(s->data,s->size);
436
+ VALUE ret = rb_str_new((char *) s->data,s->size);
437
437
  s_destroy(s);
438
438
  return ret;
439
439
  }
@@ -2,6 +2,8 @@ require 'mkmf'
2
2
 
3
3
  have_func("rb_intern_str", ["ruby.h"])
4
4
  have_func("rb_sym_to_s", ["ruby.h"])
5
+ have_func("rb_hash_clear", ["ruby.h"])
6
+ $CFLAGS << ' -Wall -Wno-unknown-warning-option -Wno-variadic-macros -Wno-gnu-zero-variadic-macro-arguments -Wno-declaration-after-statement -Wno-c99-extensions -O3 '
5
7
 
6
8
  extension_name = 'sereal'
7
9
  dir_config(extension_name)
@@ -112,7 +112,9 @@ extern VALUE SerealPerlObject;
112
112
  #ifndef HAVE_RB_SYM_TO_S
113
113
  #define rb_sym_to_s(object) rb_funcall(object,rb_intern("to_s"),0)
114
114
  #endif
115
-
115
+ #ifndef HAVE_RB_HASH_CLEAR
116
+ #define rb_hash_clear(object) rb_funcall(object,rb_intern("clear"),0)
117
+ #endif
116
118
  #define __RAW 0
117
119
  #define __SNAPPY 1
118
120
  #define __SNAPPY_INCR 2
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sereal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.16
4
+ version: 0.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Borislav Nikolov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-26 00:00:00.000000000 Z
11
+ date: 2014-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-compiler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  description: Sereal encoder/decoder (https://github.com/Sereal/Sereal)
@@ -33,44 +33,44 @@ extensions:
33
33
  extra_rdoc_files:
34
34
  - ext/sereal/sereal.c
35
35
  files:
36
- - bin/rsrl
37
- - ext/sereal/buffer.h
38
36
  - ext/sereal/decode.c
39
- - ext/sereal/decode.h
40
37
  - ext/sereal/encode.c
38
+ - ext/sereal/sereal.c
39
+ - ext/sereal/snappy/csnappy_compress.c
40
+ - ext/sereal/snappy/csnappy_decompress.c
41
+ - ext/sereal/buffer.h
42
+ - ext/sereal/decode.h
41
43
  - ext/sereal/encode.h
42
- - ext/sereal/extconf.rb
43
44
  - ext/sereal/proto.h
44
- - ext/sereal/sereal.c
45
45
  - ext/sereal/sereal.h
46
46
  - ext/sereal/snappy/csnappy.h
47
47
  - ext/sereal/snappy/csnappy_compat.h
48
- - ext/sereal/snappy/csnappy_compress.c
49
- - ext/sereal/snappy/csnappy_decompress.c
50
48
  - ext/sereal/snappy/csnappy_internal.h
51
49
  - ext/sereal/snappy/csnappy_internal_userspace.h
50
+ - ext/sereal/extconf.rb
51
+ - bin/rsrl
52
52
  homepage: https://github.com/Sereal/Sereal
53
53
  licenses: []
54
54
  metadata: {}
55
55
  post_install_message:
56
56
  rdoc_options:
57
- - "--exclude"
58
- - ".*\\.so"
57
+ - --exclude
58
+ - .*\.so
59
59
  require_paths:
60
60
  - lib
61
61
  required_ruby_version: !ruby/object:Gem::Requirement
62
62
  requirements:
63
- - - ">="
63
+ - - '>='
64
64
  - !ruby/object:Gem::Version
65
65
  version: '0'
66
66
  required_rubygems_version: !ruby/object:Gem::Requirement
67
67
  requirements:
68
- - - ">="
68
+ - - '>='
69
69
  - !ruby/object:Gem::Version
70
70
  version: '0'
71
71
  requirements: []
72
72
  rubyforge_project:
73
- rubygems_version: 2.2.2
73
+ rubygems_version: 2.0.14
74
74
  signing_key:
75
75
  specification_version: 4
76
76
  summary: Sereal encoder/decoder