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.
@@ -1,6 +1,6 @@
1
1
  require 'rubber/struct'
2
2
  module Rubber
3
- VERSION = [0,0,11]
3
+ VERSION = [0,0,12]
4
4
  def VERSION.to_s
5
5
  self.map{|i|i.to_s}.join('.')
6
6
  end
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: 9
4
+ hash: 7
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 11
10
- version: 0.0.11
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-04-27 00:00:00 +01:00
18
+ date: 2011-05-03 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies: []
21
21