Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove duplicate mapping of clang_getEnumDeclIntegerType #67

Merged
merged 1 commit into from
May 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions lib/ffi/clang/cursor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,6 @@ def underlying_type
Type.new Lib.get_typedef_decl_underlying_type(@cursor), @translation_unit
end

def enum_decl_integer_type
Type.new Lib.get_enum_decl_integer_type(@cursor), @translation_unit
end

def typedef_type
Type.new Lib.get_typedef_decl_unerlying_type(@cursor), @translation_unit
end
Expand Down
4 changes: 1 addition & 3 deletions lib/ffi/clang/lib/cursor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ class CXCursorAndRangeVisitor < FFI::Struct
attach_function :get_cursor_type, :clang_getCursorType, [CXCursor.by_value], CXType.by_value
attach_function :get_cursor_result_type, :clang_getCursorResultType, [CXCursor.by_value], CXType.by_value
attach_function :get_typedef_decl_underlying_type, :clang_getTypedefDeclUnderlyingType, [CXCursor.by_value], CXType.by_value
attach_function :get_enum_decl_integer_type, :clang_getEnumDeclIntegerType, [CXCursor.by_value], CXType.by_value
attach_function :get_enum_type, :clang_getEnumDeclIntegerType, [CXCursor.by_value], CXType.by_value
attach_function :get_type_declaration, :clang_getTypeDeclaration, [CXType.by_value], FFI::Clang::Lib::CXCursor.by_value

attach_function :get_cursor_referenced, :clang_getCursorReferenced, [CXCursor.by_value], CXCursor.by_value
Expand Down Expand Up @@ -473,8 +473,6 @@ class CXCursorAndRangeVisitor < FFI::Struct

attach_function :get_typedef_decl_unerlying_type, :clang_getTypedefDeclUnderlyingType, [CXCursor.by_value], CXType.by_value

attach_function :get_enum_type, :clang_getEnumDeclIntegerType, [CXCursor.by_value], CXType.by_value

attach_function :get_num_args, :clang_Cursor_getNumArguments, [CXCursor.by_value], :int

attach_function :is_converting_constructor, :clang_CXXConstructor_isConvertingConstructor, [CXCursor.by_value], :uint
Expand Down
6 changes: 3 additions & 3 deletions spec/ffi/clang/cursor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -612,13 +612,13 @@
end
end

describe '#enum_decl_integer_type' do
describe '#enum_type' do
let(:enum) { find_matching(cursor_cxx) { |child, parent|
child.kind == :cursor_enum_decl and child.spelling == 'normal_enum' } }

it "returns the integer type of the enum declaration" do
expect(enum.enum_decl_integer_type).to be_kind_of(Type)
expect(enum.enum_decl_integer_type.kind).to be(:type_uint)
expect(enum.enum_type).to be_kind_of(Type)
expect(enum.enum_type.kind).to be(:type_uint)
end
end

Expand Down