summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2011-05-03 21:21:58 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2011-05-03 21:21:58 +0200
commit38539b2515507e78415a0b40f496c74bb11b9d79 (patch)
treeaa6499a5c912da6abc7f8658b9751c7ed8a5975d
parent2527c06659f34daa5604f78f34f0a24e7efd7f39 (diff)
downloadffi-efl-38539b2515507e78415a0b40f496c74bb11b9d79.zip
ffi-efl-38539b2515507e78415a0b40f496c74bb11b9d79.tar.gz
be 1.8 compatible
-rw-r--r--lib/efl/ecore_getopt.rb16
-rw-r--r--lib/efl/eina_hash.rb2
-rw-r--r--lib/efl/eina_list.rb2
-rw-r--r--lib/efl/evas.rb4
-rw-r--r--lib/efl/ffi.rb6
5 files changed, 15 insertions, 15 deletions
diff --git a/lib/efl/ecore_getopt.rb b/lib/efl/ecore_getopt.rb
index 7f67a29..5be6492 100644
--- a/lib/efl/ecore_getopt.rb
+++ b/lib/efl/ecore_getopt.rb
@@ -18,7 +18,7 @@ module Efl
:ulongp, :ulong_p,
:doublep, :double_p,
:listp, :eina_list_p,
- :ptrp, :void_p,
+ :ptrp, :void_p
end
#
class DescStoreDef < FFI::Union
@@ -30,13 +30,13 @@ module Efl
:ushortv, :ushort,
:uintv, :uint,
:ulongv, :ulong,
- :doublev, :double,
+ :doublev, :double
end
#
class DescStore < FFI::Struct
layout :type, :ecore_getopt_type, # enum
:arg_req, :ecore_getopt_desc_arg_requirement, # enum
- :def, DescStoreDef,
+ :def, DescStoreDef
end
#
callback :ecore_getopt_desc_cb, [:ecore_getopt_p, :ecore_getopt_desc_p, :string, :pointer, :ecore_getopt_value_p ], :eina_bool
@@ -45,7 +45,7 @@ module Efl
layout :func, :ecore_getopt_desc_cb,
:data, :pointer,
:arg_req, :ecore_getopt_desc_arg_requirement, # enum
- :def, :pointer,
+ :def, :pointer
end
#
class ActionParam < FFI::Union
@@ -54,7 +54,7 @@ module Efl
:choices, :pointer,
:append_type, :ecore_getopt_type, # enum
:callback, DescCallback,
- :dummy, :pointer,
+ :dummy, :pointer
end
#
class Desc < FFI::Struct
@@ -63,7 +63,7 @@ module Efl
:help, :pointer,
:metavar, :pointer,
:action, :ecore_getopt_action, # enum
- :action_param, ActionParam,
+ :action_param, ActionParam
end
#
class EcoreGetopt < FFI::Struct
@@ -110,14 +110,14 @@ module Efl
@ecore_getopt.to_ptr
end
def create
- @ecore_getopt = Efl::EcoreGetopt::EcoreGetopt.new FFI::MemoryPointer.new (Efl::EcoreGetopt::EcoreGetopt.size+Efl::EcoreGetopt::Desc.size*@options.length), 1
+ @ecore_getopt = Efl::EcoreGetopt::EcoreGetopt.new( FFI::MemoryPointer.new( :uchar, Efl::EcoreGetopt::EcoreGetopt.size+Efl::EcoreGetopt::Desc.size*@options.length) )
[:prog,:usage,:version,:copyright,:license,:description].each do |sym|
@ecore_getopt[sym] = ( @desc.has_key?(sym) ? FFI::MemoryPointer.from_string(@desc[sym]) : FFI::Pointer::NULL )
end
@ecore_getopt[:strict] = @desc[:strict] if @desc.has_key? :strict
@options.each_with_index do |o,i|
d = @ecore_getopt.desc_ptr i
- d[:shortname] = o[0].ord
+ d[:shortname] = o[0].to_s.bytes.first
d[:longname] = p_from_string o[1]
d[:help] = p_from_string o[2]
d[:metavar] = o[3]
diff --git a/lib/efl/eina_hash.rb b/lib/efl/eina_hash.rb
index 59d99e2..e2d05be 100644
--- a/lib/efl/eina_hash.rb
+++ b/lib/efl/eina_hash.rb
@@ -17,7 +17,7 @@ module Efl
when NilClass
FFI::AutoPointer.new cstr.call, REinaHash.method(:release)
when FFI::Pointer
- FFI::AutoPointer.new ( o==FFI::Pointer::NULL ? cstr.call : o ), REinaHash.method(:release)
+ FFI::AutoPointer.new( (o==FFI::Pointer::NULL ? cstr.call : o), REinaHash.method(:release))
when Hash
ptr = cstr.call
o.each do |k,v| Efl::EinaHash.eina_hash_add ptr, k, v end
diff --git a/lib/efl/eina_list.rb b/lib/efl/eina_list.rb
index 3e014ad..ea59f89 100644
--- a/lib/efl/eina_list.rb
+++ b/lib/efl/eina_list.rb
@@ -11,7 +11,7 @@ module Efl
:next, :pointer,
:prev, :pointer,
:accounting, :pointer,
- :magic, :uint,
+ :magic, :uint
end
#
class REinaList
diff --git a/lib/efl/evas.rb b/lib/efl/evas.rb
index 0dcbd86..aada313 100644
--- a/lib/efl/evas.rb
+++ b/lib/efl/evas.rb
@@ -32,13 +32,13 @@ module Efl
:color_key_r, :int,
:color_key_g, :int,
:color_key_b, :int,
- :func, EngineInfoBufferFuncStruct,
+ :func, EngineInfoBufferFuncStruct
end
class EngineInfoBufferStruct < FFI::Struct
layout :magic, EngineInfoStruct,
:info, EngineInfoBufferInfoStruct,
# :func, EvasEngineInfoBufferFunc,
- :mode, :evas_engine_render_mode,
+ :mode, :evas_engine_render_mode
end
#
class REvas
diff --git a/lib/efl/ffi.rb b/lib/efl/ffi.rb
index 281d7dd..1512147 100644
--- a/lib/efl/ffi.rb
+++ b/lib/efl/ffi.rb
@@ -85,14 +85,14 @@ module Efl
EOF
end
def method_missing m, *args, &block
- if m =~/^(.*)=$/
+ m_s = m.to_s
+ if m_s =~/^(.*)=$/
m_s = $1+'_set'
args_s = '*args[0]'
- elsif m =~/^(.*)\?$/
+ elsif m_s =~/^(.*)\?$/
m_s = $1+'_get'
args_s = '*args'
else
- m_s = m.to_s
args_s = '*args'
end
self.class.proxy_list.each do |mod,p|