diff options
author | Hugo Parente Lima <hugo.lima@openbossa.org> | 2010-04-08 19:19:45 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.lima@openbossa.org> | 2010-04-12 13:48:33 -0300 |
commit | 4623048983f0c230c47909545cb457018d97951b (patch) | |
tree | 2cf370dc178e3be2fb793fc52adbfd40169c5524 | |
parent | 3b61b201210760c922a293f79f5904ba51cda4e2 (diff) |
Remove warnings about "deprecated conversion from string constant to 'char*'".
These warnings are due to the Python C API using a char* as parameter when
it should const char*.
Reviewer: Anderson Lizardo <anderson.lizardo@openbossa.org>
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org>
-rw-r--r-- | cppgenerator.cpp | 2 | ||||
-rw-r--r-- | libshiboken/basewrapper.cpp | 2 | ||||
-rw-r--r-- | tests/samplebinding/typesystem_sample.xml | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/cppgenerator.cpp b/cppgenerator.cpp index 55add07e9..57e509da0 100644 --- a/cppgenerator.cpp +++ b/cppgenerator.cpp @@ -909,7 +909,7 @@ void CppGenerator::writeMethodWrapper(QTextStream& s, const AbstractMetaFunction s << INDENT << "if (revOpMethod && PyCallable_Check(revOpMethod)) {" << endl; { Indentation indent(INDENT); - s << INDENT << PYTHON_RETURN_VAR << " = PyObject_CallFunction(revOpMethod, \"O\", self);" << endl; + s << INDENT << PYTHON_RETURN_VAR << " = PyObject_CallFunction(revOpMethod, const_cast<char*>(\"O\"), self);" << endl; s << INDENT << "if (PyErr_Occurred() && (PyErr_ExceptionMatches(PyExc_NotImplementedError)"; s << " || PyErr_ExceptionMatches(PyExc_AttributeError))) {" << endl; { diff --git a/libshiboken/basewrapper.cpp b/libshiboken/basewrapper.cpp index 92b6b1d3e..dde7a7151 100644 --- a/libshiboken/basewrapper.cpp +++ b/libshiboken/basewrapper.cpp @@ -426,7 +426,7 @@ static PyObject* SbkBaseWrapper_get_dict(SbkBaseWrapper* obj) } static PyGetSetDef SbkBaseWrapper_getsetlist[] = { - {"__dict__", (getter)SbkBaseWrapper_get_dict, 0}, + {const_cast<char*>("__dict__"), (getter)SbkBaseWrapper_get_dict, 0}, {0} // Sentinel }; diff --git a/tests/samplebinding/typesystem_sample.xml b/tests/samplebinding/typesystem_sample.xml index 8a36ec057..cfe709a61 100644 --- a/tests/samplebinding/typesystem_sample.xml +++ b/tests/samplebinding/typesystem_sample.xml @@ -880,7 +880,7 @@ %0 = new %TYPE(); </inject-code> <inject-code class="target" position="end"> - Shiboken::AutoDecRef result(PyObject_CallMethod(%PYSELF, "setHeight", "i", 2)); + Shiboken::AutoDecRef result(PyObject_CallMethod(%PYSELF, const_cast<char*>("setHeight"), const_cast<char*>("i"), 2)); </inject-code> </add-function> </value-type> |