Most languages now use "NullReferenceError" in the error message
where they previously used "ValueError". Also exception changes:
Guile: "swig-null-reference-error" instead of "swig-value-error"
MzScheme: "swig-null-reference-error" instead of "swig-value-error"
PHP: zend_ce_type_error instead of zend_ce_value_error
Python: Consistently raises TypeError instead of a mix of ValueError
and TypeError.
Ruby: Consistently raises NullReferenceError instead of a mix of
ArgumentError and NullReferenceErrorError.
The consistent raising of a TypeError instead of ValueError for Python
ensures that incorrectly passing 'None' into a C++ reference argument
will correctly convert the error into a NotImplemented error for
the rich comparisons implementations per PEP 207. Fixes#2987
Note that the li_constraints checking implementation for the NONNULL
typemap for pointers also makes the same error change from
SWIG_ValueError to SWIG_NullReferenceError.
The D typemaps use SWIG_DNullReferenceException instead of
SWIG_DIllegalArgumentException, although this ultimately has no change
as the same D Exception is still thrown.
* char_binary_java_fix-tidyup:
Move SWIGStringWithLengthHelper to csharphead.swg
cdata whitespace/cosmetic fixups
cdata doc updates
Rename `typemaps/cdata_struct.swg` to `typemaps/cdata_begin.swg`. And `typemaps/cdata.swg` to `typemaps/cdata.swg`. Move `cdata_apply.swg` content to `typemaps/cdata.swg`.
Group the C# marshalling of STRING-LENGTH typemap into C# class named SWIGStringWithLengthHelper.
Leave Length & string reverse order typemap in typemaps/strings.swg
Support old C# as "LPUTF8Str" was add in 2017.
Improve documentation. Follow @wsfulton reviews.
Use a dummy for MzScheme and untested OCaml cdate. To prevent compilation error.
Further fixing follow reviews.
Reorganise raw data typemap, so typemaps folder contain only common part. Improve document.
Inline SWIG_string_to_utf8_bytes SWIG_utf8_bytes_to_string code
Fixes of STRING/BYTES LENGTH typemaps.
Conflicts:
CHANGES.current
The cdata.i docs in C#, Java, D, Go had a confusing mix of target language
and C declarations. Improve the main cdata documentation in Library.html instead.
Fix Java STRING LENGTH typemap.
Use string type in static typed languages (Java, C#, D and Go).
Add BYTES LENGTH typemap and apply it for binary data.
Use byte type in static typed languages.
Add li_cdata_cpp, li_cdata and char_binary
tests for most of languages(apart from R and experimental).
Fix the director_binary_string test and add it to C#, D, Go,
Perl, PHP, Python, Ruby and octave.
Update documents.
Signed-off-by: Erez Geva <ErezGeva2@gmail.com>
in the %array_functions and %array_class macros.
Affects C#, D, Go, Guile, Java, Javascript, Lua, Ocaml, R, Racket.
Closes#1680
If the old types are required for backwards compatibility, use %apply to
restore the old types as follows:
%include "carrays.i"
%apply int { size_t nelements, size_t index }
... %array_functions and %array_class ...
%clear size_t nelements, size_t index; # To be safe in case used elsewhere
Per comments on the merge request, this is the appropriate place for it,
and add a reference to it from the structures and unions section so
someone looking there will see it.
Also remove the changes in Contents.html, since that is regenerated and
those changes are just noise in the commit.
Signed-off-by: Corey Minyard <cminyard@mvista.com>