Commit graph

3,427 commits

Author SHA1 Message Date
William S Fulton
32855cfb69 Merge branch 'tamuratak-fix_ruby_unordered_set'
* tamuratak-fix_ruby_unordered_set:
  [ruby] add simple tests for std unordered containers.
  [ruby] clarify dependency of fragments for unordered_set containers.

 Conflicts:
	Examples/test-suite/ruby/Makefile.in
2017-04-24 20:44:12 +01:00
William S Fulton
ee44f9ba67 Merge branch 'tamuratak-fix_ruby_null_shared_ptr'
* tamuratak-fix_ruby_null_shared_ptr:
  [ruby] add a test.
  [ruby] use std::vector::back() method.
  [ruby] enable a test for null shared_ptr in containers.
  [ruby] add a test for null shared_ptr in containers.
  [ruby] treat null shared_ptr in std containers properly.

Conflicts:
	Examples/test-suite/ruby/Makefile.in
2017-04-24 19:50:59 +01:00
Takashi Tamura
43c3ca3767 [ruby] clarify dependency of fragments for unordered_set containers. 2017-04-22 16:35:25 +09:00
William S Fulton
71e5ff406f Merge branch 'tamuratak-fix_ruby_director_and_shared_ptr'
* tamuratak-fix_ruby_director_and_shared_ptr:
  Rename shared_ptr testcase
  [ruby] use boost/shared_ptr and boost_shared_ptr.i. not use auto.
  [ruby] delete unnecessary changes.
  [ruby] add %typemap(directorin) for shared_ptr.
  [ruby] enable a test, cpp11_shared_ptr_director.
  [ruby] add %typemap(directorin) and %typemap(directorout) for shared_ptr.
  [ruby] add %typemap(directorout) for shared_ptr.
  add a test for shared_ptr with director

Conflicts:
	CHANGES.current
2017-04-21 19:31:25 +01:00
Takashi Tamura
6672338cc0 [ruby] delete unnecessary changes. 2017-04-21 22:44:38 +09:00
William S Fulton
ab1e9f5bd9 Consistent whitespace amongst all the shared_ptr and intrusive_ptr typemaps
[skip ci]
2017-04-20 19:21:47 +01:00
William S Fulton
b4377488f7 Add assert for invalid NULL type parameter when calling SWIG_Ruby_NewPointerObj.
Closes #935
2017-04-20 18:51:45 +01:00
Takashi Tamura
0020fc97b0 [ruby] add %typemap(directorin) for shared_ptr. 2017-04-20 19:20:55 +09:00
Takashi Tamura
17b4e0c66e [ruby] add %typemap(directorin) and %typemap(directorout) for shared_ptr. 2017-04-20 19:20:11 +09:00
Takashi Tamura
b3c2b1c51c [ruby] add %typemap(directorout) for shared_ptr. 2017-04-20 19:20:11 +09:00
Takashi Tamura
661c3fc554 [ruby] treat null shared_ptr in std containers properly. 2017-04-20 18:53:47 +09:00
William S Fulton
c9d094e034 Merge branch 'tamuratak-shared_ptr_derived_2'
* tamuratak-shared_ptr_derived_2:
  Correct comment about const removal for shared_ptr
  Correct ordering of declarations in testcase
  Ruby shared_ptr on error code improvement in traits_as::as
  Add support for pointers to shared_ptr and null shared_ptr in Ruby containers
  Add shared_ptr non-overloaded upcast tests
  use forward declaration to treat the dependency of fragments
  [ruby] must not do a null check for VALUE.
  [ruby] add tests for shared_ptr of const Type.
  [ruby] For swig::from, use template specialization to convert shared_ptr<const T> to shared_ptr<T>.
  [ruby] edit comments [skip ci]
  [ruby] move template specialization to std_shared_ptr.i.
  [ruby] add tests for upcasting std::shared_ptr within std containers.
  [ruby] use template specialization for swig::asptr,asval functions on std:shared_ptr.
2017-04-20 07:50:20 +01:00
William S Fulton
660147043d Correct comment about const removal for shared_ptr 2017-04-20 07:49:03 +01:00
William S Fulton
1a6f8d1e4b Ruby shared_ptr on error code improvement in traits_as::as 2017-04-13 07:04:07 +01:00
William S Fulton
83a389d3fb Add support for pointers to shared_ptr and null shared_ptr in Ruby containers
Upcasting of pointers to shared_ptr would need some more fundamental
changes, but not done yet ... pointers to shared_ptr are not common.
2017-04-13 06:59:56 +01:00
Takashi Tamura
b32854bc59 use forward declaration to treat the dependency of fragments 2017-03-29 19:11:44 +09:00
Takashi Tamura
377d439964 Merge remote-tracking branch 'origin/shared_ptr_const_conv' into shared_ptr_derived_2 2017-03-29 18:16:01 +09:00
William S Fulton
382b3f0f8c Merge branch 'tamuratak-fix_typo_ruby_unordered_map'
* tamuratak-fix_typo_ruby_unordered_map:
  [ruby] add a test to make sure that std::multiset is including Enumerable.
  [ruyb] enable std::list test for Ruby.
  [ruby] make std::list include Enumerable.
  [ruby] make std::multiset and std::unordered_multiset include Enumerable. tests added.
  [ruby] make std::unordered_map include Enumerable.
2017-03-29 08:56:25 +01:00
William S Fulton
3797eaac89 Merge branch 'tamuratak-fix_ruby_bool'
* tamuratak-fix_ruby_bool:
  [ruby] must not do null check for VALUE obj, which can be 0x0 == Qfalse, a valid Ruby object.
2017-03-24 20:06:03 +00:00
William S Fulton
ea118c945b Merge branch 'srepmub-coverity_replacecount'
* srepmub-coverity_replacecount:
  Fix Coverity issue reported for setslice (pycontainer.swg):
2017-03-24 07:42:59 +00:00
William S Fulton
279744603f Merge branch 'vadz-use-cstype-vector-typemap'
* vadz-use-cstype-vector-typemap:
  Don't hardcode C# type corresponding to size_t in vector typemaps
2017-03-24 07:29:41 +00:00
William S Fulton
7f9b9db2e0 Fix ocaml warning
Warning 20: this argument will not be used by the function.
2017-03-23 19:11:20 +00:00
William S Fulton
b1dc7294cc Merge branch 'vadz-fix-py-frag-deps'
* vadz-fix-py-frag-deps:
  Add stddef.h back in to SwigPySequence_Base fragment
  Fix dependency of SwigPySequence_Base fragment
2017-03-17 19:22:00 +00:00
William S Fulton
fa65b24b78 Add stddef.h back in to SwigPySequence_Base fragment 2017-03-17 19:20:02 +00:00
William S Fulton
72ba741d1c Fix wrapping of references/pointers and qualifiers to member pointers
Also fix Go wrapping of member const function pointers.
2017-03-16 21:04:38 +00:00
Vadim Zeitlin
bf11d5ee7a Don't hardcode C# type corresponding to size_t in vector typemaps
The C# type corresponding to size_t may be changed by redefining its "cstype"
type typemap, but this broke compilation of the code using std::vector<> as
the typemap generating it assumed that size_t was always represented by uint
in C#. Make this work in all cases by explicitly looking up cstype of size_t
instead.

Notice that it may be quite useful, and even necessary, to map size_t to int
as when generating C# assembly for use with COM, via .NET interop, as some COM
clients, notably VBA-using ones, including all Microsoft Office applications,
don't support unsigned types and can't call methods using or returning uint in
C# at all.
2017-03-15 23:17:03 +01:00
Vadim Zeitlin
51aa2bdea1 Fix dependency of SwigPySequence_Base fragment
This fragment needs to depend on StdTraits fragment as it specializes the
template struct traits<> defined there and it could happen that the struct was
not declared before being specialized, resulting in compilation errors in the
generated code.

It doesn't seem to need to depend on stddef.h inclusion, however, so replace
it with the correct dependency instead of keeping both.
2017-03-11 18:07:51 +01:00
Takashi Tamura
cb1f89cb68 [ruby] must not do a null check for VALUE. 2017-03-07 11:43:01 +09:00
Mark Dufour
5803e81d48 Fix Coverity issue reported for setslice (pycontainer.swg):
"CID 11151 (#3-1 of 3): Using invalid iterator (INVALIDATE_ITERATOR)18.
increment_iterator: Incrementing iterator it though it is already past
the end of its container."

Coverity does not understand 'replace_count', so warns that we may go
past self->end() (or self->rend() I guess).
2017-03-06 21:16:41 +01:00
Takashi Tamura
d0af6fd97d [ruby] must not do null check for VALUE obj, which can be 0x0 == Qfalse, a valid Ruby object. 2017-03-06 15:13:05 +09:00
Takashi Tamura
f96c2ad73d [ruby] For swig::from, use template specialization to convert shared_ptr<const T> to shared_ptr<T>. 2017-03-03 12:50:23 +09:00
Takashi Tamura
806f49bf58 [ruby] edit comments [skip ci] 2017-03-02 11:55:09 +09:00
Takashi Tamura
a784ace983 [ruby] move template specialization to std_shared_ptr.i. 2017-03-02 09:47:46 +09:00
Takashi Tamura
50e495c453 [ruby] use template specialization for swig::asptr,asval functions on std:shared_ptr. 2017-03-01 20:17:50 +09:00
Takashi Tamura
c88b9e8777 [ruby] make std::list include Enumerable. 2017-02-25 16:08:21 +09:00
Takashi Tamura
9f43082786 [ruby] make std::multiset and std::unordered_multiset include Enumerable. tests added. 2017-02-24 16:59:17 +09:00
Takashi Tamura
005e129287 [ruby] make std::unordered_map include Enumerable. 2017-02-24 16:59:17 +09:00
Mark Dufour
21f532975f [Coverity] fix issue reported for SWIG_Python_ConvertFunctionPtr
Fix Coverity issue reported for SWIG_Python_ConvertFunctionPtr:

"Execution cannot reach this statement: *ptr = vptr;"

Because if 'ty' is null, then desc becomes null and we return with
SWIG_ERROR. So 'ty' cannot be null at 'if (ty)'.
2017-02-19 09:47:34 +13:00
Mark Dufour
9825fcbab5 [Coverity] fix issue reported for SWIG_Python_FixMethods
Fix Coverity issue reported for SWIG_Python_FixMethods:

"buffer_size: Calling strncpy with a source string whose length
(10 chars) is greater than or equal to the size argument (10)
will fail to null-terminate buff."

The issue is only reported for the "swig_ptr: " line, but for
consistency we replace both occurrences of strncpy with memcpy.
2017-02-15 15:58:26 +13:00
William S Fulton
de6476f321 Merge branch 'tamuratak-fix_std_unordred'
* tamuratak-fix_std_unordred:
  Move cpp11_hash_tables test to Ruby makefile until other languages work
  Cosmetic changes in C++11 std_unordered support files
  [ruby] add tests for unordered containers.
  [ruby] support for std unordered containers.
  use equal_range instead of upper_bound. unordered containers do not have the upper_bound method.
  fix a %fragment argument.
  use %std_container_methods_without_reverse_iterators
  fix Lib/std/std unordered containers
2017-02-10 19:49:10 +00:00
William S Fulton
50f556de39 Cosmetic changes in C++11 std_unordered support files 2017-02-10 19:26:02 +00:00
Jean-Claude Manoli
18ac3030df Replace ICollection with IEnumerable<T>
Adding a constructor that accepts IEnumerable<T> avoids the boxing and unboxing overhead of the original constructor, when the type parameter is a value type. This also allows passing IList<T>, which does not implement ICollection (ironically the generated type implements IList<T>).

Kept the original constructor for backward compatibility, but replaced ICollection with IEnumerable for added flexibility.
2017-02-05 08:02:14 +01:00
Takashi Tamura
d29a325b99 [ruby] support for std unordered containers. 2017-01-29 11:17:18 +09:00
Takashi Tamura
37af90a50e use equal_range instead of upper_bound.
unordered containers do not have the upper_bound method.
2017-01-29 11:11:55 +09:00
Takashi Tamura
b8cf6412e8 fix a %fragment argument. 2017-01-29 10:56:36 +09:00
Takashi Tamura
88a76de9fe use %std_container_methods_without_reverse_iterators 2017-01-29 09:47:18 +09:00
Takashi Tamura
9cb90982ee fix Lib/std/std unordered containers 2017-01-28 16:51:21 +09:00
Brian Caine
892f3592cc Redid the source and the text to check for SCM_MAJOR_VERSION >= 2 2017-01-27 19:06:33 +00:00
Brian Caine
a4ec4df5c9 Disabled pointer conversion when the relevant macros are unavailable (for Guile 1.8) 2017-01-27 19:05:59 +00:00
William S Fulton
65689af848 Refactor std_container iterator functions
This is for future improvements in the C++11 unordered containers which
do not have reverse iterators.
2017-01-27 18:45:22 +00:00