summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.lima@openbossa.org>2010-04-08 19:19:45 -0300
committerHugo Parente Lima <hugo.lima@openbossa.org>2010-04-12 13:48:33 -0300
commit4623048983f0c230c47909545cb457018d97951b (patch)
tree2cf370dc178e3be2fb793fc52adbfd40169c5524
parent3b61b201210760c922a293f79f5904ba51cda4e2 (diff)
downloadshiboken-4623048983f0c230c47909545cb457018d97951b.tar.gz
shiboken-4623048983f0c230c47909545cb457018d97951b.tar.xz
shiboken-4623048983f0c230c47909545cb457018d97951b.zip
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.cpp2
-rw-r--r--libshiboken/basewrapper.cpp2
-rw-r--r--tests/samplebinding/typesystem_sample.xml2
3 files changed, 3 insertions, 3 deletions
diff --git a/cppgenerator.cpp b/cppgenerator.cpp
index 55add07e..57e509da 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 92b6b1d3..dde7a715 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 8a36ec05..cfe709a6 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&lt;char*>("setHeight"), const_cast&lt;char*>("i"), 2));
</inject-code>
</add-function>
</value-type>