[OCaml] Eliminate use of -Wno-write-strings

Don't convert string literals to char * in the strings_test example.

In constantWrapper(), use SwigType_str() instead of SwigType_lstr()
in order to keep const qualifiers.
This commit is contained in:
Zackery Spytz 2019-01-24 05:32:35 -07:00
commit 4ca7cd7b27
7 changed files with 20 additions and 27 deletions

View file

@ -19,7 +19,7 @@ void takes_char_ptr( char *p ) {
cout << "takes_char_ptr( \"" << p << "\" );" << endl;
}
char *gives_char_ptr() {
const char *gives_const_char_ptr() {
return "foo";
}
@ -28,8 +28,8 @@ void takes_and_gives_std_string( std::string &inout ) {
inout.insert( inout.end(), ']' );
}
void takes_and_gives_char_ptr( char *&inout ) {
char *pout = strchr( inout, '.' );
void takes_and_gives_const_char_ptr( const char *&inout ) {
const char *pout = strchr( inout, '.' );
if( pout ) inout = pout + 1;
else inout = "foo";
}