rubber-generate 0.0.11 → 0.0.12
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.
- data/lib/rubber/scanner.rb +1 -1
- data/lib/rubber/types.rb +17 -7
- metadata +4 -4
data/lib/rubber/scanner.rb
CHANGED
data/lib/rubber/types.rb
CHANGED
@@ -1,15 +1,16 @@
|
|
1
1
|
|
2
|
-
$custom_maps
|
2
|
+
$custom_maps = {}
|
3
3
|
$custom_frees = {}
|
4
|
-
$equivalents
|
4
|
+
$equivalents = {}
|
5
5
|
module Rubber
|
6
6
|
# Map most GLib types to normal C style ones
|
7
|
-
CMAP = {
|
7
|
+
CMAP = {
|
8
8
|
'ruby'=>'VALUE',
|
9
|
-
'gboolean'=>'bool',
|
10
|
-
'gint'=>'int',
|
11
|
-
'glong'=>'long',
|
12
|
-
'guint'=>'uint',
|
9
|
+
'gboolean'=>'bool',
|
10
|
+
'gint'=>'int',
|
11
|
+
'glong'=>'long',
|
12
|
+
'guint'=>'uint',
|
13
|
+
'guint64'=>'uint64',
|
13
14
|
'gchar'=>'char',
|
14
15
|
'gfloat'=>'double', # Ruby only uses doubles?
|
15
16
|
'float'=>'double', # Ruby only uses doubles?
|
@@ -152,6 +153,8 @@ def self.explicit_cast(name, ctype, rule)
|
|
152
153
|
"NUM2INT(#{name})"
|
153
154
|
when 'uint'
|
154
155
|
"NUM2UINT(#{name})"
|
156
|
+
when 'uint64'
|
157
|
+
"rb_num2ull(#{name})"
|
155
158
|
when 'long'
|
156
159
|
"NUM2LONG(#{name})"
|
157
160
|
when 'double'
|
@@ -179,6 +182,13 @@ def self.explicit_cast(name, ctype, rule)
|
|
179
182
|
else
|
180
183
|
raise "Unable to convert #{ctype} to #{rule}"
|
181
184
|
end
|
185
|
+
when 'uint64'
|
186
|
+
case rule
|
187
|
+
when 'VALUE', 'ruby'
|
188
|
+
" rb_ull2inum(#{name})"
|
189
|
+
else
|
190
|
+
raise "Unable to convert #{ctype} to #{rule}"
|
191
|
+
end
|
182
192
|
when 'char*', 'string'
|
183
193
|
case rule
|
184
194
|
when 'VALUE', 'ruby'
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubber-generate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 7
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 12
|
10
|
+
version: 0.0.12
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Geoff Youngs
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-05-03 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|