protobuf-generate 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/protobuf/generate/language/c/c.erb +57 -50
- data/protobuf-generate.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4dfc74f7688e44e7b50a3ce841ac809205633097
|
4
|
+
data.tar.gz: 9ba9103b05c1a65409d0b9503838f575158be164
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 505001be4621794ff21a622971c6c6a1de00c094cffed065572fc34c3c55f62e8c88c9f8cf8370abe79a10c27363ee4398e44be9ad35c7ced92cf216eb737575
|
7
|
+
data.tar.gz: 0fe4e63e11eca9882642e30ca3a401fcd5b772b7e3d20b11b7b8f5c109ba3d9a2e95cbd512b8b16cdeddcd93e77d7135c64771a947749cbdacd264e1d0f6c5c8
|
@@ -176,63 +176,70 @@ static int read_raw_double(double *value, const uint8_t *buffer, int offset) {
|
|
176
176
|
<% end %>
|
177
177
|
|
178
178
|
static int read_raw_varint32(uint32_t *tag, const uint8_t *buffer, int offset) {
|
179
|
-
|
179
|
+
*tag = 0;
|
180
180
|
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
if (
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
} else {
|
201
|
-
*tag |= (((uint32_t)result) & 0x7f) << 21;
|
202
|
-
offset = read_raw_byte(&result, buffer, offset);
|
203
|
-
*tag |= ((uint32_t)result) << 28;
|
204
|
-
if (result < 0) {
|
205
|
-
/* Discard upper 32 bits. */
|
206
|
-
int i;
|
207
|
-
for (i = 0; i < 5; ++ i) {
|
208
|
-
offset = read_raw_byte(&result, buffer, offset);
|
209
|
-
if (result >= 0) {
|
210
|
-
return offset;
|
211
|
-
}
|
212
|
-
}
|
213
|
-
/* Invalid state. */
|
214
|
-
}
|
215
|
-
}
|
216
|
-
}
|
217
|
-
}
|
181
|
+
uint8_t b;
|
182
|
+
offset = read_raw_byte(&b, buffer, offset);
|
183
|
+
*tag |= (uint32_t)(b & 0x7f) << 0;
|
184
|
+
if ((b & 0x80) == 0) return offset;
|
185
|
+
|
186
|
+
offset = read_raw_byte(&b, buffer, offset);
|
187
|
+
*tag |= (uint32_t)(b & 0x7f) << 7;
|
188
|
+
if ((b & 0x80) == 0) return offset;
|
189
|
+
|
190
|
+
offset = read_raw_byte(&b, buffer, offset);
|
191
|
+
*tag |= (uint32_t)(b & 0x7f) << 14;
|
192
|
+
if ((b & 0x80) == 0) return offset;
|
193
|
+
|
194
|
+
offset = read_raw_byte(&b, buffer, offset);
|
195
|
+
*tag |= (uint32_t)(b & 0x7f) << 21;
|
196
|
+
if ((b & 0x80) == 0) return offset;
|
197
|
+
|
198
|
+
offset = read_raw_byte(&b, buffer, offset);
|
199
|
+
*tag |= (uint32_t)(b & 0x7f) << 28;
|
218
200
|
return offset;
|
219
201
|
}
|
220
202
|
|
221
203
|
<% if type_count(:int64, :sint64, :uint64) > 0 %>
|
222
204
|
static int read_raw_varint64(uint64_t *tag, const uint8_t *buffer, int offset) {
|
223
|
-
short shift = 0;
|
224
|
-
uint8_t b;
|
225
205
|
*tag = 0;
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
206
|
+
|
207
|
+
uint8_t b;
|
208
|
+
offset = read_raw_byte(&b, buffer, offset);
|
209
|
+
*tag |= (uint64_t)(b & 0x7f) << 0;
|
210
|
+
if ((b & 0x80) == 0) return offset;
|
211
|
+
|
212
|
+
offset = read_raw_byte(&b, buffer, offset);
|
213
|
+
*tag |= (uint64_t)(b & 0x7f) << 7;
|
214
|
+
if ((b & 0x80) == 0) return offset;
|
215
|
+
|
216
|
+
offset = read_raw_byte(&b, buffer, offset);
|
217
|
+
*tag |= (uint64_t)(b & 0x7f) << 14;
|
218
|
+
if ((b & 0x80) == 0) return offset;
|
219
|
+
|
220
|
+
offset = read_raw_byte(&b, buffer, offset);
|
221
|
+
*tag |= (uint64_t)(b & 0x7f) << 21;
|
222
|
+
if ((b & 0x80) == 0) return offset;
|
223
|
+
|
224
|
+
offset = read_raw_byte(&b, buffer, offset);
|
225
|
+
*tag |= (uint64_t)(b & 0x7f) << 28;
|
226
|
+
if ((b & 0x80) == 0) return offset;
|
227
|
+
|
228
|
+
offset = read_raw_byte(&b, buffer, offset);
|
229
|
+
*tag |= (uint64_t)(b & 0x7f) << 35;
|
230
|
+
if ((b & 0x80) == 0) return offset;
|
231
|
+
|
232
|
+
offset = read_raw_byte(&b, buffer, offset);
|
233
|
+
*tag |= (uint64_t)(b & 0x7f) << 42;
|
234
|
+
if ((b & 0x80) == 0) return offset;
|
235
|
+
|
236
|
+
offset = read_raw_byte(&b, buffer, offset);
|
237
|
+
*tag |= (uint64_t)(b & 0x7f) << 49;
|
238
|
+
if ((b & 0x80) == 0) return offset;
|
239
|
+
|
240
|
+
offset = read_raw_byte(&b, buffer, offset);
|
241
|
+
*tag |= (uint64_t)(b & 0x7f) << 56;
|
242
|
+
return offset;
|
236
243
|
}
|
237
244
|
<% end %>
|
238
245
|
|
data/protobuf-generate.gemspec
CHANGED
@@ -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.
|
5
|
+
s.version = '0.2.2'
|
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.
|
4
|
+
version: 0.2.2
|
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-
|
11
|
+
date: 2013-08-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parslet
|