From bf91ac1605ced99da9ea9bf7e44a84dbf756da30 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 20 Aug 2008 01:12:23 +0000 Subject: [PATCH] c++ needs const char * for static strings git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9326 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/include/switch_cpp.h | 2 +- src/mod/languages/mod_java/switch_swig_wrap.cpp | 2 +- src/mod/languages/mod_lua/mod_lua_wrap.cpp | 4 ++-- src/mod/languages/mod_perl/mod_perl_wrap.cpp | 4 ++-- src/mod/languages/mod_python/mod_python_wrap.cpp | 6 +++--- src/switch_cpp.cpp | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/include/switch_cpp.h b/src/include/switch_cpp.h index 8dd0227932..58f46eafaf 100644 --- a/src/include/switch_cpp.h +++ b/src/include/switch_cpp.h @@ -216,7 +216,7 @@ SWITCH_DECLARE(void) consoleCleanLog(char *msg); SWITCH_DECLARE(int) answer(); SWITCH_DECLARE(int) preAnswer(); - SWITCH_DECLARE(void) hangup(char *cause = "normal_clearing"); + SWITCH_DECLARE(void) hangup(const char *cause = "normal_clearing"); SWITCH_DECLARE(void) setVariable(char *var, char *val); SWITCH_DECLARE(void) setPrivate(char *var, void *val); SWITCH_DECLARE(void *) getPrivate(char *var); diff --git a/src/mod/languages/mod_java/switch_swig_wrap.cpp b/src/mod/languages/mod_java/switch_swig_wrap.cpp index 4716697476..88ffa0af1b 100644 --- a/src/mod/languages/mod_java/switch_swig_wrap.cpp +++ b/src/mod/languages/mod_java/switch_swig_wrap.cpp @@ -1886,7 +1886,7 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1hang arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); if (!arg2) return ; } - (arg1)->hangup(arg2); + (arg1)->hangup((char const *)arg2); if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); } diff --git a/src/mod/languages/mod_lua/mod_lua_wrap.cpp b/src/mod/languages/mod_lua/mod_lua_wrap.cpp index c13d3140fb..c1c864fb79 100644 --- a/src/mod/languages/mod_lua/mod_lua_wrap.cpp +++ b/src/mod/languages/mod_lua/mod_lua_wrap.cpp @@ -4529,14 +4529,14 @@ static int _wrap_CoreSession_hangup__SWIG_0(lua_State* L) { SWIG_check_num_args("hangup",2,2) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hangup",1,"CoreSession *"); - if(!lua_isstring(L,2)) SWIG_fail_arg("hangup",2,"char *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("hangup",2,"char const *"); if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ SWIG_fail_ptr("CoreSession_hangup",1,SWIGTYPE_p_CoreSession); } arg2 = (char *)lua_tostring(L, 2); - (arg1)->hangup(arg2); + (arg1)->hangup((char const *)arg2); SWIG_arg=0; return SWIG_arg; diff --git a/src/mod/languages/mod_perl/mod_perl_wrap.cpp b/src/mod/languages/mod_perl/mod_perl_wrap.cpp index 6cba7b4f6d..0d606dd77a 100644 --- a/src/mod/languages/mod_perl/mod_perl_wrap.cpp +++ b/src/mod/languages/mod_perl/mod_perl_wrap.cpp @@ -5675,10 +5675,10 @@ XS(_wrap_CoreSession_hangup__SWIG_0) { arg1 = reinterpret_cast< CoreSession * >(argp1); res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_hangup" "', argument " "2"" of type '" "char *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_hangup" "', argument " "2"" of type '" "char const *""'"); } arg2 = reinterpret_cast< char * >(buf2); - (arg1)->hangup(arg2); + (arg1)->hangup((char const *)arg2); if (alloc2 == SWIG_NEWOBJ) delete[] buf2; diff --git a/src/mod/languages/mod_python/mod_python_wrap.cpp b/src/mod/languages/mod_python/mod_python_wrap.cpp index 2bf13206df..60155d014b 100644 --- a/src/mod/languages/mod_python/mod_python_wrap.cpp +++ b/src/mod/languages/mod_python/mod_python_wrap.cpp @@ -6090,10 +6090,10 @@ SWIGINTERN PyObject *_wrap_CoreSession_hangup__SWIG_0(PyObject *SWIGUNUSEDPARM(s arg1 = reinterpret_cast< CoreSession * >(argp1); res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_hangup" "', argument " "2"" of type '" "char *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_hangup" "', argument " "2"" of type '" "char const *""'"); } arg2 = reinterpret_cast< char * >(buf2); - (arg1)->hangup(arg2); + (arg1)->hangup((char const *)arg2); resultobj = SWIG_Py_Void(); if (alloc2 == SWIG_NEWOBJ) delete[] buf2; return resultobj; @@ -6160,7 +6160,7 @@ SWIGINTERN PyObject *_wrap_CoreSession_hangup(PyObject *self, PyObject *args) { fail: SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CoreSession_hangup'.\n" " Possible C/C++ prototypes are:\n" - " hangup(CoreSession *,char *)\n" + " hangup(CoreSession *,char const *)\n" " hangup(CoreSession *)\n"); return NULL; } diff --git a/src/switch_cpp.cpp b/src/switch_cpp.cpp index a1e5b7ff7a..7b81769b54 100644 --- a/src/switch_cpp.cpp +++ b/src/switch_cpp.cpp @@ -523,7 +523,7 @@ SWITCH_DECLARE(int) CoreSession::preAnswer() return status == SWITCH_STATUS_SUCCESS ? 1 : 0; } -SWITCH_DECLARE(void) CoreSession::hangup(char *cause) +SWITCH_DECLARE(void) CoreSession::hangup(const char *cause) { this_check_void(); sanity_check_noreturn;