Skip to content

Commit

Permalink
update bindings and skip assigning to a local for void functions
Browse files Browse the repository at this point in the history
  • Loading branch information
jhass committed Oct 18, 2017
1 parent da47f9d commit f311da3
Show file tree
Hide file tree
Showing 551 changed files with 7,772 additions and 7,219 deletions.
2 changes: 1 addition & 1 deletion src/g_i_repository/info/callable_info.cr
Expand Up @@ -89,7 +89,7 @@ module GIRepository
end

def skip_return?
LibGIRepository.callable_info_skip_return(self)
LibGIRepository.callable_info_skip_return(self) || return_type.void?
end

def may_return_null?
Expand Down
6 changes: 4 additions & 2 deletions src/g_i_repository/info/function_info.cr
Expand Up @@ -50,7 +50,9 @@ module GIRepository

io << "\n#{indent} __error = Pointer(LibGLib::Error).null" if throws?

io << "\n#{indent} __return_value = #{libname}.#{prefix}#{name}"
io << "\n#{indent} "
io << "__return_value = " unless skip_return?
io << "#{libname}.#{prefix}#{name}"

lib_args = args.map(&.for_wrapper_pass(libname)).compact.join(", ")
io << "(#{lib_args})" unless lib_args.empty?
Expand All @@ -62,7 +64,7 @@ module GIRepository
io << " if __return_value" if may_return_null?
io << '\n'
else
io << "\n#{indent} nil\n"
io << "\n#{indent} nil\n"
end

io << "#{indent}end\n"
Expand Down
4 changes: 4 additions & 0 deletions src/g_i_repository/info/type_info.cr
Expand Up @@ -35,6 +35,10 @@ module GIRepository
LibGIRepository.type_info_is_pointer(self)
end

def void?
tag == LibGIRepository::TypeTag::VOID
end

def interface
BaseInfo.wrap BaseInfo.new LibGIRepository.type_info_get_interface(self)
end
Expand Down
4 changes: 2 additions & 2 deletions src/generated/atk/attribute.cr
Expand Up @@ -19,8 +19,8 @@ module Atk
end

def self.set_free(attrib_set)
__return_value = LibAtk.attribute_set_free(attrib_set)
__return_value
LibAtk.attribute_set_free(attrib_set)
nil
end

def name
Expand Down
16 changes: 8 additions & 8 deletions src/generated/atk/component.cr
Expand Up @@ -11,8 +11,8 @@ module Atk
end

def extents(x, y, width, height, coord_type : Atk::CoordType)
__return_value = LibAtk.component_get_extents(to_unsafe.as(LibAtk::Component*), x, y, width, height, coord_type)
__return_value
LibAtk.component_get_extents(to_unsafe.as(LibAtk::Component*), x, y, width, height, coord_type)
nil
end

def layer
Expand All @@ -26,13 +26,13 @@ module Atk
end

def position(x, y, coord_type : Atk::CoordType)
__return_value = LibAtk.component_get_position(to_unsafe.as(LibAtk::Component*), x, y, coord_type)
__return_value
LibAtk.component_get_position(to_unsafe.as(LibAtk::Component*), x, y, coord_type)
nil
end

def size(width, height)
__return_value = LibAtk.component_get_size(to_unsafe.as(LibAtk::Component*), width, height)
__return_value
LibAtk.component_get_size(to_unsafe.as(LibAtk::Component*), width, height)
nil
end

def grab_focus
Expand All @@ -46,8 +46,8 @@ module Atk
end

def remove_focus_handler(handler_id)
__return_value = LibAtk.component_remove_focus_handler(to_unsafe.as(LibAtk::Component*), UInt32.new(handler_id))
__return_value
LibAtk.component_remove_focus_handler(to_unsafe.as(LibAtk::Component*), UInt32.new(handler_id))
nil
end

def set_extents(x, y, width, height, coord_type : Atk::CoordType)
Expand Down
4 changes: 2 additions & 2 deletions src/generated/atk/document.cr
Expand Up @@ -16,8 +16,8 @@ module Atk
end

def document
__return_value = LibAtk.document_get_document(to_unsafe.as(LibAtk::Document*))
__return_value if __return_value
LibAtk.document_get_document(to_unsafe.as(LibAtk::Document*))
nil
end

def document_type
Expand Down
24 changes: 12 additions & 12 deletions src/generated/atk/editable_text.cr
@@ -1,28 +1,28 @@
module Atk
module EditableText
def copy_text(start_pos, end_pos)
__return_value = LibAtk.editable_text_copy_text(to_unsafe.as(LibAtk::EditableText*), Int32.new(start_pos), Int32.new(end_pos))
__return_value
LibAtk.editable_text_copy_text(to_unsafe.as(LibAtk::EditableText*), Int32.new(start_pos), Int32.new(end_pos))
nil
end

def cut_text(start_pos, end_pos)
__return_value = LibAtk.editable_text_cut_text(to_unsafe.as(LibAtk::EditableText*), Int32.new(start_pos), Int32.new(end_pos))
__return_value
LibAtk.editable_text_cut_text(to_unsafe.as(LibAtk::EditableText*), Int32.new(start_pos), Int32.new(end_pos))
nil
end

def delete_text(start_pos, end_pos)
__return_value = LibAtk.editable_text_delete_text(to_unsafe.as(LibAtk::EditableText*), Int32.new(start_pos), Int32.new(end_pos))
__return_value
LibAtk.editable_text_delete_text(to_unsafe.as(LibAtk::EditableText*), Int32.new(start_pos), Int32.new(end_pos))
nil
end

def insert_text(string, length, position)
__return_value = LibAtk.editable_text_insert_text(to_unsafe.as(LibAtk::EditableText*), string.to_unsafe, Int32.new(length), position)
__return_value
LibAtk.editable_text_insert_text(to_unsafe.as(LibAtk::EditableText*), string.to_unsafe, Int32.new(length), position)
nil
end

def paste_text(position)
__return_value = LibAtk.editable_text_paste_text(to_unsafe.as(LibAtk::EditableText*), Int32.new(position))
__return_value
LibAtk.editable_text_paste_text(to_unsafe.as(LibAtk::EditableText*), Int32.new(position))
nil
end

def set_run_attributes(attrib_set, start_offset, end_offset)
Expand All @@ -31,8 +31,8 @@ module Atk
end

def text_contents=(string)
__return_value = LibAtk.editable_text_set_text_contents(to_unsafe.as(LibAtk::EditableText*), string.to_unsafe)
__return_value
LibAtk.editable_text_set_text_contents(to_unsafe.as(LibAtk::EditableText*), string.to_unsafe)
nil
end

end
Expand Down
8 changes: 4 additions & 4 deletions src/generated/atk/image.cr
Expand Up @@ -11,13 +11,13 @@ module Atk
end

def image_position(x, y, coord_type : Atk::CoordType)
__return_value = LibAtk.image_get_image_position(to_unsafe.as(LibAtk::Image*), x, y, coord_type)
__return_value
LibAtk.image_get_image_position(to_unsafe.as(LibAtk::Image*), x, y, coord_type)
nil
end

def image_size(width, height)
__return_value = LibAtk.image_get_image_size(to_unsafe.as(LibAtk::Image*), width, height)
__return_value
LibAtk.image_get_image_size(to_unsafe.as(LibAtk::Image*), width, height)
nil
end

def image_description=(description)
Expand Down
8 changes: 4 additions & 4 deletions src/generated/atk/misc.cr
Expand Up @@ -14,13 +14,13 @@ module Atk
end

def threads_enter
__return_value = LibAtk.misc_threads_enter(to_unsafe.as(LibAtk::Misc*))
__return_value
LibAtk.misc_threads_enter(to_unsafe.as(LibAtk::Misc*))
nil
end

def threads_leave
__return_value = LibAtk.misc_threads_leave(to_unsafe.as(LibAtk::Misc*))
__return_value
LibAtk.misc_threads_leave(to_unsafe.as(LibAtk::Misc*))
nil
end

end
Expand Down
24 changes: 12 additions & 12 deletions src/generated/atk/module_functions.cr
@@ -1,12 +1,12 @@
module Atk
def self.attribute_set_free(attrib_set)
__return_value = LibAtk.attribute_set_free(attrib_set)
__return_value
LibAtk.attribute_set_free(attrib_set)
nil
end

def self.focus_tracker_notify(object)
__return_value = LibAtk.focus_tracker_notify(object.to_unsafe.as(LibAtk::Object*))
__return_value
LibAtk.focus_tracker_notify(object.to_unsafe.as(LibAtk::Object*))
nil
end

def self.binary_age
Expand Down Expand Up @@ -80,18 +80,18 @@ module Atk
end

def self.remove_focus_tracker(tracker_id)
__return_value = LibAtk.remove_focus_tracker(UInt32.new(tracker_id))
__return_value
LibAtk.remove_focus_tracker(UInt32.new(tracker_id))
nil
end

def self.remove_global_event_listener(listener_id)
__return_value = LibAtk.remove_global_event_listener(UInt32.new(listener_id))
__return_value
LibAtk.remove_global_event_listener(UInt32.new(listener_id))
nil
end

def self.remove_key_event_listener(listener_id)
__return_value = LibAtk.remove_key_event_listener(UInt32.new(listener_id))
__return_value
LibAtk.remove_key_event_listener(UInt32.new(listener_id))
nil
end

def self.role_for_name(name)
Expand Down Expand Up @@ -150,8 +150,8 @@ module Atk
end

def self.text_free_ranges(ranges)
__return_value = LibAtk.text_free_ranges(ranges)
__return_value
LibAtk.text_free_ranges(ranges)
nil
end

def self.value_type_get_localized_name(value_type : Atk::ValueType)
Expand Down
28 changes: 14 additions & 14 deletions src/generated/atk/object.cr
Expand Up @@ -139,13 +139,13 @@ module Atk
end

def init(data)
__return_value = LibAtk.object_init(to_unsafe.as(LibAtk::Object*), data ? data : nil)
__return_value
LibAtk.object_init(to_unsafe.as(LibAtk::Object*), data ? data : nil)
nil
end

def notify_state_change(state, value)
__return_value = LibAtk.object_notify_state_change(to_unsafe.as(LibAtk::Object*), UInt64.new(state), value)
__return_value
LibAtk.object_notify_state_change(to_unsafe.as(LibAtk::Object*), UInt64.new(state), value)
nil
end

def peek_parent
Expand All @@ -169,8 +169,8 @@ module Atk
end

def remove_property_change_handler(handler_id)
__return_value = LibAtk.object_remove_property_change_handler(to_unsafe.as(LibAtk::Object*), UInt32.new(handler_id))
__return_value
LibAtk.object_remove_property_change_handler(to_unsafe.as(LibAtk::Object*), UInt32.new(handler_id))
nil
end

def remove_relationship(relationship : Atk::RelationType, target)
Expand All @@ -179,23 +179,23 @@ module Atk
end

def description=(description)
__return_value = LibAtk.object_set_description(to_unsafe.as(LibAtk::Object*), description.to_unsafe)
__return_value
LibAtk.object_set_description(to_unsafe.as(LibAtk::Object*), description.to_unsafe)
nil
end

def name=(name)
__return_value = LibAtk.object_set_name(to_unsafe.as(LibAtk::Object*), name.to_unsafe)
__return_value
LibAtk.object_set_name(to_unsafe.as(LibAtk::Object*), name.to_unsafe)
nil
end

def parent=(parent)
__return_value = LibAtk.object_set_parent(to_unsafe.as(LibAtk::Object*), parent.to_unsafe.as(LibAtk::Object*))
__return_value
LibAtk.object_set_parent(to_unsafe.as(LibAtk::Object*), parent.to_unsafe.as(LibAtk::Object*))
nil
end

def role=(role : Atk::Role)
__return_value = LibAtk.object_set_role(to_unsafe.as(LibAtk::Object*), role)
__return_value
LibAtk.object_set_role(to_unsafe.as(LibAtk::Object*), role)
nil
end

alias ActiveDescendantChangedSignal = Object, Void* ->
Expand Down
4 changes: 2 additions & 2 deletions src/generated/atk/object_factory.cr
Expand Up @@ -19,8 +19,8 @@ module Atk
end

def invalidate
__return_value = LibAtk.object_factory_invalidate(to_unsafe.as(LibAtk::ObjectFactory*))
__return_value
LibAtk.object_factory_invalidate(to_unsafe.as(LibAtk::ObjectFactory*))
nil
end

end
Expand Down
4 changes: 2 additions & 2 deletions src/generated/atk/range.cr
Expand Up @@ -21,8 +21,8 @@ module Atk
end

def free
__return_value = LibAtk.range_free(to_unsafe.as(LibAtk::Range*))
__return_value
LibAtk.range_free(to_unsafe.as(LibAtk::Range*))
nil
end

def description
Expand Down
4 changes: 2 additions & 2 deletions src/generated/atk/registry.cr
Expand Up @@ -19,8 +19,8 @@ module Atk
end

def set_factory_type(type, factory_type)
__return_value = LibAtk.registry_set_factory_type(to_unsafe.as(LibAtk::Registry*), UInt64.new(type), UInt64.new(factory_type))
__return_value
LibAtk.registry_set_factory_type(to_unsafe.as(LibAtk::Registry*), UInt64.new(type), UInt64.new(factory_type))
nil
end

end
Expand Down
4 changes: 2 additions & 2 deletions src/generated/atk/relation.cr
Expand Up @@ -24,8 +24,8 @@ module Atk
end

def add_target(target)
__return_value = LibAtk.relation_add_target(to_unsafe.as(LibAtk::Relation*), target.to_unsafe.as(LibAtk::Object*))
__return_value
LibAtk.relation_add_target(to_unsafe.as(LibAtk::Relation*), target.to_unsafe.as(LibAtk::Object*))
nil
end

def relation_type
Expand Down
12 changes: 6 additions & 6 deletions src/generated/atk/relation_set.cr
Expand Up @@ -14,13 +14,13 @@ module Atk
end

def add(relation)
__return_value = LibAtk.relation_set_add(to_unsafe.as(LibAtk::RelationSet*), relation.to_unsafe.as(LibAtk::Relation*))
__return_value
LibAtk.relation_set_add(to_unsafe.as(LibAtk::RelationSet*), relation.to_unsafe.as(LibAtk::Relation*))
nil
end

def add_relation_by_type(relationship : Atk::RelationType, target)
__return_value = LibAtk.relation_set_add_relation_by_type(to_unsafe.as(LibAtk::RelationSet*), relationship, target.to_unsafe.as(LibAtk::Object*))
__return_value
LibAtk.relation_set_add_relation_by_type(to_unsafe.as(LibAtk::RelationSet*), relationship, target.to_unsafe.as(LibAtk::Object*))
nil
end

def contains(relationship : Atk::RelationType)
Expand Down Expand Up @@ -49,8 +49,8 @@ module Atk
end

def remove(relation)
__return_value = LibAtk.relation_set_remove(to_unsafe.as(LibAtk::RelationSet*), relation.to_unsafe.as(LibAtk::Relation*))
__return_value
LibAtk.relation_set_remove(to_unsafe.as(LibAtk::RelationSet*), relation.to_unsafe.as(LibAtk::Relation*))
nil
end

end
Expand Down
4 changes: 2 additions & 2 deletions src/generated/atk/socket.cr
Expand Up @@ -17,8 +17,8 @@ module Atk
end

def embed(plug_id)
__return_value = LibAtk.socket_embed(to_unsafe.as(LibAtk::Socket*), plug_id.to_unsafe)
__return_value
LibAtk.socket_embed(to_unsafe.as(LibAtk::Socket*), plug_id.to_unsafe)
nil
end

def occupied?
Expand Down

0 comments on commit f311da3

Please sign in to comment.