Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-02-16 19:47:41 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-02-16 19:47:41 +0300
commitaefe9be5db3f767c343bae56eb49621a78b7d5b2 (patch)
tree528f363100f80b47f15d265a23499eae781dbe50 /source/gameengine
parented540dd1f17eb4e8e81068509ffc93933a548aef (diff)
[#18961] Use const char * where appropriate (2.5)
from Sean Bartell (wtachi) added own changes bpy_props.c
Diffstat (limited to 'source/gameengine')
-rw-r--r--source/gameengine/VideoTexture/BlendType.h4
-rw-r--r--source/gameengine/VideoTexture/Exception.cpp8
-rw-r--r--source/gameengine/VideoTexture/Exception.h10
-rw-r--r--source/gameengine/VideoTexture/ImageRender.cpp10
-rw-r--r--source/gameengine/VideoTexture/Texture.cpp7
-rw-r--r--source/gameengine/VideoTexture/VideoFFmpeg.cpp6
6 files changed, 24 insertions, 21 deletions
diff --git a/source/gameengine/VideoTexture/BlendType.h b/source/gameengine/VideoTexture/BlendType.h
index 8b243c43912..2b273253af6 100644
--- a/source/gameengine/VideoTexture/BlendType.h
+++ b/source/gameengine/VideoTexture/BlendType.h
@@ -30,7 +30,7 @@ template <class PyObj> class BlendType
{
public:
/// constructor
- BlendType (char * name) : m_name(name) {}
+ BlendType (const char * name) : m_name(name) {}
/// check blender type and return pointer to contained object or NULL (if type is not valid)
PyObj * checkType (PyObject * obj)
@@ -68,7 +68,7 @@ public:
protected:
/// name of Python type
- char * m_name;
+ const char * m_name;
/// pointer to Python type
PyTypeObject * m_objType;
};
diff --git a/source/gameengine/VideoTexture/Exception.cpp b/source/gameengine/VideoTexture/Exception.cpp
index 35d335b5981..8b4808ffbe9 100644
--- a/source/gameengine/VideoTexture/Exception.cpp
+++ b/source/gameengine/VideoTexture/Exception.cpp
@@ -41,7 +41,7 @@ ExpDesc errNFoundDesc (ErrNotFound, "Error description not found");
// implementation of ExpDesc
// constructor
-ExpDesc::ExpDesc (ExceptionID & exp, char * desc, RESULT hres)
+ExpDesc::ExpDesc (ExceptionID & exp, const char * desc, RESULT hres)
: m_expID(exp), m_hRslt(hres), m_description(desc)
{
}
@@ -60,7 +60,7 @@ std::vector<ExpDesc*> ExpDesc::m_expDescs;
std::string Exception::m_lastError;
// log file name
-char * Exception::m_logFile = NULL;
+const char * Exception::m_logFile = NULL;
// basic constructor
@@ -98,7 +98,7 @@ const char * Exception::what()
// debug version - with file and line of exception
-Exception::Exception (ExceptionID & expID, RESULT rslt, char * fil, int lin)
+Exception::Exception (ExceptionID & expID, RESULT rslt, const char * fil, int lin)
: m_expID (&expID), m_hRslt (rslt)
{
// set file and line
@@ -108,7 +108,7 @@ Exception::Exception (ExceptionID & expID, RESULT rslt, char * fil, int lin)
// set file and line
-void Exception::setFileLine (char * fil, int lin)
+void Exception::setFileLine (const char * fil, int lin)
{
if (fil != NULL) m_fileName = fil;
m_line = lin;
diff --git a/source/gameengine/VideoTexture/Exception.h b/source/gameengine/VideoTexture/Exception.h
index 1a3c25071b1..4a57a7f20e4 100644
--- a/source/gameengine/VideoTexture/Exception.h
+++ b/source/gameengine/VideoTexture/Exception.h
@@ -91,7 +91,7 @@ class ExpDesc
{
public:
// constructor a destructor
- ExpDesc (ExceptionID & exp, char * desc, RESULT hres = S_OK);
+ ExpDesc (ExceptionID & exp, const char * desc, RESULT hres = S_OK);
~ExpDesc (void);
// comparision function
@@ -132,7 +132,7 @@ private:
// result
RESULT m_hRslt;
// description
- char * m_description;
+ const char * m_description;
// not allowed
ExpDesc (const ExpDesc & obj) : m_expID (ErrNotFound) {}
@@ -157,9 +157,9 @@ public:
virtual const char * what(void);
// debug version of constructor
- Exception (ExceptionID & expID, RESULT rslt, char * fil, int lin);
+ Exception (ExceptionID & expID, RESULT rslt, const char * fil, int lin);
// set source file and line of exception
- void setFileLine (char * fil, int lin);
+ void setFileLine (const char * fil, int lin);
// get description in string
std::string & getDesc (void) throw() { return m_desc; }
@@ -174,7 +174,7 @@ public:
static std::string m_lastError;
/// log file name
- static char * m_logFile;
+ static const char * m_logFile;
protected:
// exception identification
diff --git a/source/gameengine/VideoTexture/ImageRender.cpp b/source/gameengine/VideoTexture/ImageRender.cpp
index 8fd0a8968f8..0a01ce11a0e 100644
--- a/source/gameengine/VideoTexture/ImageRender.cpp
+++ b/source/gameengine/VideoTexture/ImageRender.cpp
@@ -282,9 +282,10 @@ static int ImageRender_init (PyObject * pySelf, PyObject * args, PyObject * kwds
// camera object
PyObject * camera;
// parameter keywords
- static char *kwlist[] = {"sceneObj", "cameraObj", NULL};
+ static const char *kwlist[] = {"sceneObj", "cameraObj", NULL};
// get parameters
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "OO", kwlist, &scene, &camera))
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "OO",
+ const_cast<char**>(kwlist), &scene, &camera))
return -1;
try
{
@@ -428,9 +429,10 @@ static int ImageMirror_init (PyObject * pySelf, PyObject * args, PyObject * kwds
// material of the mirror
short materialID = 0;
// parameter keywords
- static char *kwlist[] = {"scene", "observer", "mirror", "material", NULL};
+ static const char *kwlist[] = {"scene", "observer", "mirror", "material", NULL};
// get parameters
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "OOO|h", kwlist, &scene, &observer, &mirror, &materialID))
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "OOO|h",
+ const_cast<char**>(kwlist), &scene, &observer, &mirror, &materialID))
return -1;
try
{
diff --git a/source/gameengine/VideoTexture/Texture.cpp b/source/gameengine/VideoTexture/Texture.cpp
index 09c95b929c5..f59b92409f5 100644
--- a/source/gameengine/VideoTexture/Texture.cpp
+++ b/source/gameengine/VideoTexture/Texture.cpp
@@ -186,11 +186,12 @@ int Texture_init (Texture *self, PyObject *args, PyObject *kwds)
// texture object with shared texture ID
Texture * texObj = NULL;
- static char *kwlist[] = {"gameObj", "materialID", "textureID", "textureObj", NULL};
+ static const char *kwlist[] = {"gameObj", "materialID", "textureID", "textureObj", NULL};
// get parameters
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|hhO!", kwlist, &obj, &matID,
- &texID, &TextureType, &texObj))
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|hhO!",
+ const_cast<char**>(kwlist), &obj, &matID, &texID, &TextureType,
+ &texObj))
return -1;
// if parameters are available
diff --git a/source/gameengine/VideoTexture/VideoFFmpeg.cpp b/source/gameengine/VideoTexture/VideoFFmpeg.cpp
index 9136e619288..4c87b1764d6 100644
--- a/source/gameengine/VideoTexture/VideoFFmpeg.cpp
+++ b/source/gameengine/VideoTexture/VideoFFmpeg.cpp
@@ -1074,11 +1074,11 @@ static int VideoFFmpeg_init (PyObject * pySelf, PyObject * args, PyObject * kwds
// capture rate, only if capt is >= 0
float rate = 25.f;
- static char *kwlist[] = {"file", "capture", "rate", "width", "height", NULL};
+ static const char *kwlist[] = {"file", "capture", "rate", "width", "height", NULL};
// get parameters
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|hfhh", kwlist, &file, &capt,
- &rate, &width, &height))
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|hfhh",
+ const_cast<char**>(kwlist), &file, &capt, &rate, &width, &height))
return -1;
try