varint 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/ext/varint/varint.c +5 -6
- data/lib/varint/version.rb +1 -1
- data/varint.gemspec +3 -2
- metadata +23 -25
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 14718aa092b809ce67cebc5282bb1d0ebd7193e0
|
4
|
+
data.tar.gz: e843768c7d7a4bb3d63c51d3e9e145a52bbbefd0
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 96c3fa4f615a23e9be14c07bde2a4a48249504ab4f8febb053dd9916e479c6a57ba504272b73c39fcd196430a94d624996b36f2695f0e58624807dc54a1ffea2
|
7
|
+
data.tar.gz: 83c2d2b006de7a336b71aa2b5a88dbac2c8c332d0dad9e51b41fb6fcf5399dd97a8ff918996831bb37d4166f8f9063501c7e0615d14ee57348030e565fcb1cd5
|
data/ext/varint/varint.c
CHANGED
@@ -6,16 +6,16 @@ static ID getbyte, putbyte;
|
|
6
6
|
static VALUE varint_encode(VALUE module, VALUE io, VALUE int_valV)
|
7
7
|
{
|
8
8
|
/* unsigned for the bit shifting ops */
|
9
|
-
unsigned long long int_val = (
|
9
|
+
unsigned long long int_val = NUM2ULL(int_valV);
|
10
10
|
unsigned char byte;
|
11
11
|
while (1) {
|
12
12
|
byte = int_val & 0x7f;
|
13
13
|
int_val >>= 7;
|
14
14
|
if (int_val == 0) {
|
15
|
-
rb_funcall(io, putbyte, 1,
|
15
|
+
rb_funcall(io, putbyte, 1, INT2NUM(byte));
|
16
16
|
return Qnil;
|
17
17
|
} else {
|
18
|
-
rb_funcall(io, putbyte, 1,
|
18
|
+
rb_funcall(io, putbyte, 1, INT2NUM(byte | 0x80));
|
19
19
|
}
|
20
20
|
}
|
21
21
|
}
|
@@ -30,12 +30,11 @@ static VALUE varint_decode(VALUE module, VALUE io)
|
|
30
30
|
if (shift >= 64) {
|
31
31
|
rb_raise(rb_eArgError, "too many bytes when decoding varint");
|
32
32
|
}
|
33
|
-
byte = (unsigned char)
|
33
|
+
byte = (unsigned char)NUM2INT(rb_funcall(io, getbyte, 0));
|
34
34
|
int_val |= ((unsigned long long)(byte & 0x7f)) << shift;
|
35
35
|
shift += 7;
|
36
36
|
if ((byte & 0x80) == 0) {
|
37
|
-
|
38
|
-
return LL2NUM((long long)int_val);
|
37
|
+
return ULL2NUM(int_val);
|
39
38
|
}
|
40
39
|
}
|
41
40
|
}
|
data/lib/varint/version.rb
CHANGED
data/varint.gemspec
CHANGED
@@ -6,10 +6,11 @@ require 'varint/version'
|
|
6
6
|
Gem::Specification.new do |gem|
|
7
7
|
gem.name = "varint"
|
8
8
|
gem.version = Varint::VERSION
|
9
|
-
gem.authors = ["Brian Palmer", "
|
9
|
+
gem.authors = ["Brian Palmer", "Benedikt Boehm", "Rob Marable", "Paulo Luis Franchini Casaretto"]
|
10
10
|
gem.email = ["brian@codekitchen.net", "bb@xnull.de"]
|
11
11
|
gem.summary = %q{varint C extension}
|
12
|
-
gem.homepage = "https://github.com/
|
12
|
+
gem.homepage = "https://github.com/liquidm/varint"
|
13
|
+
gem.license = "BSD"
|
13
14
|
|
14
15
|
gem.files = `git ls-files`.split($/)
|
15
16
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
metadata
CHANGED
@@ -1,36 +1,33 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: varint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
5
|
-
prerelease:
|
4
|
+
version: 0.1.1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Brian Palmer
|
9
|
-
-
|
8
|
+
- Benedikt Boehm
|
10
9
|
- Rob Marable
|
11
10
|
- Paulo Luis Franchini Casaretto
|
12
|
-
autorequire:
|
11
|
+
autorequire:
|
13
12
|
bindir: bin
|
14
13
|
cert_chain: []
|
15
|
-
date:
|
14
|
+
date: 2015-04-10 00:00:00.000000000 Z
|
16
15
|
dependencies:
|
17
16
|
- !ruby/object:Gem::Dependency
|
18
17
|
name: rake
|
19
|
-
|
20
|
-
none: false
|
18
|
+
version_requirements: !ruby/object:Gem::Requirement
|
21
19
|
requirements:
|
22
|
-
- -
|
20
|
+
- - '>='
|
23
21
|
- !ruby/object:Gem::Version
|
24
22
|
version: '0'
|
25
|
-
|
26
|
-
prerelease: false
|
27
|
-
version_requirements: !ruby/object:Gem::Requirement
|
28
|
-
none: false
|
23
|
+
requirement: !ruby/object:Gem::Requirement
|
29
24
|
requirements:
|
30
|
-
- -
|
25
|
+
- - '>='
|
31
26
|
- !ruby/object:Gem::Version
|
32
27
|
version: '0'
|
33
|
-
|
28
|
+
prerelease: false
|
29
|
+
type: :development
|
30
|
+
description:
|
34
31
|
email:
|
35
32
|
- brian@codekitchen.net
|
36
33
|
- bb@xnull.de
|
@@ -48,28 +45,29 @@ files:
|
|
48
45
|
- ext/varint/varint.c
|
49
46
|
- lib/varint/version.rb
|
50
47
|
- varint.gemspec
|
51
|
-
homepage: https://github.com/
|
52
|
-
licenses:
|
53
|
-
|
48
|
+
homepage: https://github.com/liquidm/varint
|
49
|
+
licenses:
|
50
|
+
- BSD
|
51
|
+
metadata: {}
|
52
|
+
post_install_message:
|
54
53
|
rdoc_options: []
|
55
54
|
require_paths:
|
56
55
|
- lib
|
57
56
|
required_ruby_version: !ruby/object:Gem::Requirement
|
58
|
-
none: false
|
59
57
|
requirements:
|
60
|
-
- -
|
58
|
+
- - '>='
|
61
59
|
- !ruby/object:Gem::Version
|
62
60
|
version: '0'
|
63
61
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
64
|
-
none: false
|
65
62
|
requirements:
|
66
|
-
- -
|
63
|
+
- - '>='
|
67
64
|
- !ruby/object:Gem::Version
|
68
65
|
version: '0'
|
69
66
|
requirements: []
|
70
|
-
rubyforge_project:
|
71
|
-
rubygems_version:
|
72
|
-
signing_key:
|
73
|
-
specification_version:
|
67
|
+
rubyforge_project:
|
68
|
+
rubygems_version: 2.2.2
|
69
|
+
signing_key:
|
70
|
+
specification_version: 4
|
74
71
|
summary: varint C extension
|
75
72
|
test_files: []
|
73
|
+
has_rdoc:
|