vox-etf 0.1.1 → 0.1.2

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: 814a39714371d1d129be3606ee5f4f00045c6f6a35fdbcae83bec672cec55d33
4
- data.tar.gz: f2cd32adb4fa957dd6bf692babe956f7f8569251bac15658ae1445d476c342d3
3
+ metadata.gz: cd3946973c5609f6a44d6f1bc0ea10d3f5ed7095dd0009ddaaa64593c90de538
4
+ data.tar.gz: 6e50761784880810734201a0d6e4684c2def7b6f4e7de0464ac8e42491768a12
5
5
  SHA512:
6
- metadata.gz: 7fc627a3904d13c023aa85092010b11ea4a281a2ca93992c39a1e13293b9d1768362a12114c6cefa6c9afae1075bc1902fbcee337f3a8a852ec8fbe75754a5b7
7
- data.tar.gz: d26faa973c98490470b43735e5f45c0dbe53759499def683ac6d80fd662af94e158951702014ca6a55bafed2f2a2839226b5b67709d28a9f2adfc62a09d3f807
6
+ metadata.gz: 111a3cc908087690d58e0ac939c3b3d1576d05bfc50fdb457e55eaa0ee54b71f1ae29bfb804e234c98bae047c8809803f5268ab1fddb5808cfff81ed5a492007
7
+ data.tar.gz: c176eb3b67e1d83d6972eb50e5263f57286a37c1093b47ad3c92f3513f4e1c2902ec4b218dce4e813f004cd4e6d8e8917cdef223f40d1650db4e115c78a85fb6
@@ -156,7 +156,7 @@ namespace etf
156
156
  VALUE array = decode_array(length);
157
157
  const uint8_t tail = read8();
158
158
 
159
- if (tail != term::nil)
159
+ if (tail != NIL_EXT)
160
160
  {
161
161
  rb_raise(rb_eArgError, "List doesn't end with `NIL`, but it must!");
162
162
  return Qnil;
@@ -278,7 +278,7 @@ namespace etf
278
278
  const uint8_t sign = read8();
279
279
  const char *buff = read_string(length);
280
280
 
281
- auto flags = INTEGER_PACK_LITTLE_ENDIAN | (sign * INTEGER_PACK_NEGATIVE);
281
+ int flags = INTEGER_PACK_LITTLE_ENDIAN | (sign * INTEGER_PACK_NEGATIVE);
282
282
  return rb_integer_unpack(buff, length, 1, 0, flags);
283
283
  }
284
284
 
@@ -1,4 +1,5 @@
1
1
  #include "erlpack/encoder.h"
2
+ #include "erlpack/constants.h"
2
3
  #include "etf.hpp"
3
4
 
4
5
  namespace etf
@@ -101,7 +102,7 @@ namespace etf
101
102
  {
102
103
  // id byte | n byte | sign byte | data
103
104
  uint8_t buff[3 + byte_count];
104
- buff[0] = term::small_big;
105
+ buff[0] = SMALL_BIG_EXT;
105
106
  buff[1] = byte_count;
106
107
  buff[2] = FIX2LONG(bignum) >= 0 ? 0 : 1;
107
108
  rb_integer_pack(bignum, buff + 3, byte_count, sizeof(uint8_t), 0, INTEGER_PACK_LITTLE_ENDIAN);
@@ -111,7 +112,7 @@ namespace etf
111
112
  {
112
113
  // id byte | 4 byte n | sign byte | data
113
114
  uint8_t buff[6 + byte_count];
114
- buff[0] = term::large_big;
115
+ buff[0] = LARGE_BIG_EXT;
115
116
  _erlpack_store32(buff + 1, byte_count);
116
117
  buff[5] = RBIGNUM_SIGN(bignum) ? 0 : 1;
117
118
  rb_integer_pack(bignum, buff + 6, byte_count, sizeof(uint8_t), 0, INTEGER_PACK_LITTLE_ENDIAN);
@@ -2,42 +2,6 @@
2
2
 
3
3
  #define ETF_VERSION 131
4
4
 
5
- // Term IDs, first byte of any term.
6
- enum term
7
- {
8
- new_float = 70,
9
- bit_binary = 77,
10
- atom_cache = 82,
11
- new_pid = 88,
12
- new_port = 89,
13
- newer_reference = 90,
14
- small_integer = 97,
15
- integer = 98,
16
- // annoying
17
- etf_float = 99,
18
- atom = 100,
19
- reference = 101,
20
- port = 102,
21
- pid = 103,
22
- small_tuple = 104,
23
- large_tuple = 105,
24
- nil = 106,
25
- string = 107,
26
- list = 108,
27
- binary = 109,
28
- small_big = 110,
29
- large_big = 111,
30
- new_fun = 112,
31
- // annoying
32
- etf_export = 113,
33
- new_reference = 114,
34
- small_atom = 115,
35
- map = 116,
36
- fun = 117,
37
- atom_utf8 = 118,
38
- small_atom_utf8 = 119
39
- };
40
-
41
5
  VALUE decode(VALUE self, VALUE input);
42
6
  VALUE encode(VALUE self, VALUE input);
43
7
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Vox
4
4
  module ETF
5
- VERSION = '0.1.1'
5
+ VERSION = '0.1.2'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vox-etf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Carey