use PyUnicode_From_STR_String in the game engine in more places.
authorCampbell Barton <ideasman42@gmail.com>
Fri, 30 Dec 2011 12:44:16 +0000 (12:44 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 30 Dec 2011 12:44:16 +0000 (12:44 +0000)
source/gameengine/Expressions/StringValue.h
source/gameengine/Expressions/Value.h
source/gameengine/Ketsji/KX_BlenderMaterial.h
source/gameengine/Ketsji/KX_FontObject.cpp
source/gameengine/Ketsji/KX_GameObject.h
source/gameengine/Ketsji/KX_Scene.h

index e5a892ff82d9b19fa7392d639f463a0b7635d97a..931858b7eed4d6f90515089d8c1a40e9a222c507 100644 (file)
@@ -43,7 +43,7 @@ public:
        virtual CValue*         GetReplica();
 #ifdef WITH_PYTHON
        virtual PyObject*       ConvertValueToPython() {
-               return PyUnicode_FromString(m_strString.Ptr());
+               return PyUnicode_From_STR_String(m_strString);
        }
 #endif // WITH_PYTHON
 
index f9697a55d3f8fb4ae002d2fddc6d49e82cbee379..10d8a8abd8fee4a0afbe15c0ef763e0588dbdd8d 100644 (file)
@@ -221,7 +221,7 @@ public:
        //static PyObject*      PyMake(PyObject*,PyObject*);
        virtual PyObject *py_repr(void)
        {
-               return PyUnicode_FromString((const char*)GetText());
+               return PyUnicode_From_STR_String(GetText());
        }
 
        virtual PyObject*       ConvertValueToPython() {
index 2736516bf33573c58b7f7db42c600209aa22f063..18f9875a804afbd1523074f98060df4603bc283a 100644 (file)
@@ -106,7 +106,7 @@ public:
 
 #ifdef WITH_PYTHON
        // --------------------------------
-       virtual PyObject* py_repr(void) { return PyUnicode_FromString(mMaterial->matname.ReadPtr()); }
+       virtual PyObject* py_repr(void) { return PyUnicode_From_STR_String(mMaterial->matname); }
 
        static PyObject* pyattr_get_shader(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
        static PyObject* pyattr_get_materialIndex(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
index cfcca821e223d8b65d81d953692a02b8b13e7c98..eca9a14ce7cf0058534fbd4d9bbfe21e59a261d8 100644 (file)
@@ -215,7 +215,7 @@ PyObject* KX_FontObject::pyattr_get_text(void *self_v, const KX_PYATTRIBUTE_DEF
                        str += '\n';
                str += self->m_text[i];
        }
-       return PyUnicode_FromString(str.ReadPtr());
+       return PyUnicode_From_STR_String(str);
 }
 
 int KX_FontObject::pyattr_set_text(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
index 245a92a96de7d051df216b7d8899ee562e7d2492..cc078e96e643bd6b02f09c9f59d91e4ca3bf80f1 100644 (file)
@@ -888,7 +888,7 @@ public:
         */
        virtual PyObject* py_repr(void)
        {
-               return PyUnicode_FromString(GetName().ReadPtr());
+               return PyUnicode_From_STR_String(GetName());
        }
 
        KX_PYMETHOD_O(KX_GameObject,SetWorldPosition);
index c8070736b7f930b6be413aabdb6a83a0e36d5d8f..c3e6fa376dd20621baa6878c00fcc2630d86af88 100644 (file)
@@ -617,7 +617,7 @@ public:
        static PyObject*        pyattr_get_drawing_callback_post(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
        static int                      pyattr_set_drawing_callback_post(void *selv_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
 
-       virtual PyObject* py_repr(void) { return PyUnicode_FromString(GetName().ReadPtr()); }
+       virtual PyObject* py_repr(void) { return PyUnicode_From_STR_String(GetName()); }
        
        /* getitem/setitem */
        static PyMappingMethods Mapping;