protobuf-generate 0.2.0 → 0.2.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
  SHA1:
3
- metadata.gz: 62a9a7dc427851854af74f77d0143aa950a5c8ab
4
- data.tar.gz: c464d9c4aacdc84106511b5c47aac741053af044
3
+ metadata.gz: b5d33ecf2d7d77a5e6683308ae910c137103c6e2
4
+ data.tar.gz: 3b9bcae4f9cb5a4b0f8a6345a41d005fa281ca80
5
5
  SHA512:
6
- metadata.gz: 0770f71df505d61ab1e3ebaef17e52cd949ec1113cabe6d84f1c706bfa31ed3c24adabada7dd97177dff4d51a335978fa3f43d09bdd7d662b2c7c810ca1bbc82
7
- data.tar.gz: 646e176dbd99611c6524de75bf4c4f025d183cc3edab890460553e4fee4344737eeb8ebb634079798d4c5ff14840044963c7575bd5938693a20b414a0c5e163f
6
+ metadata.gz: 7f8f7ed76f4b78ccb68c64aaeb8d4f7866d90b6741cecc06856a83bfdfea1fab9a52a88f2f1eeb1e2fddeec7bf81a47a0ecf23039cb4170c3f4636c21c288fdc
7
+ data.tar.gz: 46bd074d37993af2b63f7ba3deb5bf4105a167f736e8b1af6d5d5cb172f0e819c8594fbf84ad8a0f9b08e707d5b69043a479c27436a3c25c7ecdf948acd57778
data/README.md CHANGED
@@ -41,7 +41,7 @@ null terminated to fit within the maximum size. Bytes will just be truncated.
41
41
 
42
42
  ```
43
43
  message Message {
44
- required string name = 1; // @size_max = 32
44
+ required string name = 1; // @size = 32
45
45
  }
46
46
  ```
47
47
 
@@ -77,11 +77,13 @@ static int write_raw_varint64(uint64_t value, uint8_t *buffer, int offset) {
77
77
  }
78
78
  <% end %>
79
79
 
80
+ <% if type_count(:string, :bytes) > 0 %>
80
81
  static int write_raw_bytes(uint8_t *bytes, int bytes_size, uint8_t *buffer, int offset) {
81
82
  for (int i = 0; i < bytes_size; ++i)
82
83
  offset = write_raw_byte(*(bytes + i), buffer, offset);
83
84
  return offset;
84
85
  }
86
+ <% end %>
85
87
 
86
88
  static inline uint32_t encode_zig_zag32(int32_t n) {
87
89
  return (n << 1) ^ (n >> 31);
@@ -435,7 +437,7 @@ static int read_raw_varint64(uint64_t *tag, const uint8_t *buffer, int offset) {
435
437
  }
436
438
 
437
439
  int <%= function exp.package, exp.name, 'encode' %>(const <%= type exp.package, exp.name %> *pb, uint8_t *data, size_t data_size, size_t *encoded_size) {
438
- *encoded_size = <%= function exp.package, exp.name, 'write', 'delimited', 'to' %>(pb, data, -1);
440
+ *encoded_size = <%= function exp.package, exp.name, 'write' %>(pb, data, 0);
439
441
  return 0; // TODO: Encoding errors.
440
442
  }
441
443
 
@@ -2,7 +2,7 @@ $:.unshift(File.join(File.dirname(__FILE__), 'lib'))
2
2
 
3
3
  spec = Gem::Specification.new do |s|
4
4
  s.name = 'protobuf-generate'
5
- s.version = '0.2.0'
5
+ s.version = '0.2.1'
6
6
  s.summary = 'A multi-language concrete protobuf code generator.'
7
7
  s.description = 'A simple PEG parser, AST and template based approach to code generation.'
8
8
  s.authors = ['Shane Hanna']
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protobuf-generate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane Hanna
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-22 00:00:00.000000000 Z
11
+ date: 2013-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parslet