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>2011-10-27 18:41:26 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-10-27 18:41:26 +0400
commit699030ceb698f827fe582bf03a78a44ffc283629 (patch)
treeb9bd3afdc7d131f66460fad247135c3ed155a2ff /source/blender
parent626f73718631a641fe2d9fe6e2786fc48a341ff7 (diff)
use const for readonly strings and set some functions to static
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/BKE_image.h2
-rw-r--r--source/blender/blenkernel/intern/image.c2
-rw-r--r--source/blender/collada/ArmatureImporter.cpp2
-rw-r--r--source/blender/collada/ArmatureImporter.h2
-rw-r--r--source/blender/makesdna/intern/makesdna.c20
-rw-r--r--source/blender/makesrna/intern/makesrna.c4
-rw-r--r--source/blender/python/generic/bpy_internal_import.c2
-rw-r--r--source/blender/python/generic/bpy_internal_import.h2
-rw-r--r--source/blender/render/intern/source/pipeline.c2
9 files changed, 19 insertions, 19 deletions
diff --git a/source/blender/blenkernel/BKE_image.h b/source/blender/blenkernel/BKE_image.h
index c7e269a3b75..adb34f4c501 100644
--- a/source/blender/blenkernel/BKE_image.h
+++ b/source/blender/blenkernel/BKE_image.h
@@ -58,7 +58,7 @@ int BKE_ftype_to_imtype(int ftype);
int BKE_imtype_to_ftype(int imtype);
int BKE_imtype_is_movie(int imtype);
-struct anim *openanim(char * name, int flags, int streamindex);
+struct anim *openanim(const char *name, int flags, int streamindex);
void image_de_interlace(struct Image *ima, int odd);
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index d88cbc33926..8bce7515695 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -1500,7 +1500,7 @@ void BKE_makepicstring(char *string, const char *base, int frame, int imtype, co
}
/* used by sequencer too */
-struct anim *openanim(char *name, int flags, int streamindex)
+struct anim *openanim(const char *name, int flags, int streamindex)
{
struct anim *anim;
struct ImBuf *ibuf;
diff --git a/source/blender/collada/ArmatureImporter.cpp b/source/blender/collada/ArmatureImporter.cpp
index 219cf47d857..7e9634da21d 100644
--- a/source/blender/collada/ArmatureImporter.cpp
+++ b/source/blender/collada/ArmatureImporter.cpp
@@ -567,7 +567,7 @@ void ArmatureImporter::create_armature_bones(SkinInfo& skin)
// is a child of a node (not joint), root should be true since
// this is where we build armature bones from
-void ArmatureImporter::set_pose ( Object * ob_arm , COLLADAFW::Node * root_node , char *parentname, float parent_mat[][4])
+void ArmatureImporter::set_pose ( Object * ob_arm , COLLADAFW::Node * root_node , const char *parentname, float parent_mat[][4])
{
char * bone_name = (char *) bc_get_joint_name ( root_node);
float mat[4][4];
diff --git a/source/blender/collada/ArmatureImporter.h b/source/blender/collada/ArmatureImporter.h
index cc8c3de57f0..d2e3b8be4f5 100644
--- a/source/blender/collada/ArmatureImporter.h
+++ b/source/blender/collada/ArmatureImporter.h
@@ -113,7 +113,7 @@ private:
void fix_leaf_bones();
- void set_pose ( Object * ob_arm , COLLADAFW::Node * root_node ,char * parentname, float parent_mat[][4]);
+ void set_pose ( Object * ob_arm , COLLADAFW::Node * root_node , const char *parentname, float parent_mat[][4]);
#if 0
diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c
index 39cb1743c25..a966523d990 100644
--- a/source/blender/makesdna/intern/makesdna.c
+++ b/source/blender/makesdna/intern/makesdna.c
@@ -168,35 +168,35 @@ static int additional_slen_offset;
* \param str char
* \param len int
*/
-int add_type(const char *str, int len);
+static int add_type(const char *str, int len);
/**
* Add variable \c str to
* \param str
*/
-int add_name(char *str);
+static int add_name(const char *str);
/**
* Search whether this structure type was already found, and if not,
* add it.
*/
-short *add_struct(int namecode);
+static short *add_struct(int namecode);
/**
* Remove comments from this buffer. Assumes that the buffer refers to
* ascii-code text.
*/
-int preprocess_include(char *maindata, int len);
+static int preprocess_include(char *maindata, int len);
/**
* Scan this file for serializable types.
*/
-int convert_include(char *filename);
+static int convert_include(char *filename);
/**
* Determine how many bytes are needed for an array.
*/
-int arraysize(char *astr, int len);
+static int arraysize(char *astr, int len);
/**
* Determine how many bytes are needed for each struct.
@@ -267,12 +267,12 @@ int add_type(const char *str, int len)
* cases, unfortunately. These are explicitly checked.
*
* */
-int add_name(char *str)
+static int add_name(const char *str)
{
int nr, i, j, k;
char *cp;
char buf[255]; /* stupid limit, change it :) */
- char *name;
+ const char *name;
additional_slen_offset = 0;
@@ -422,7 +422,7 @@ short *add_struct(int namecode)
return sp;
}
-int preprocess_include(char *maindata, int len)
+static int preprocess_include(char *maindata, int len)
{
int a, newlen, comment = 0;
char *cp, *temp, *md;
@@ -1087,7 +1087,7 @@ static int make_structDNA(char *baseDirectory, FILE *file)
/* ************************* END MAKE DNA ********************** */
-static void make_bad_file(char *file, int line)
+static void make_bad_file(const char *file, int line)
{
FILE *fp= fopen(file, "w");
fprintf(fp, "#error \"Error! can't make correct DNA.c file from %s:%d, STUPID!\"\n", __FILE__, line);
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c
index d7fb9536587..adedcbb18b3 100644
--- a/source/blender/makesrna/intern/makesrna.c
+++ b/source/blender/makesrna/intern/makesrna.c
@@ -2768,14 +2768,14 @@ static void rna_generate_header_cpp(BlenderRNA *brna, FILE *f)
fprintf(f, "}\n\n#endif /* __RNA_BLENDER_CPP_H__ */\n\n");
}
-static void make_bad_file(char *file, int line)
+static void make_bad_file(const char *file, int line)
{
FILE *fp= fopen(file, "w");
fprintf(fp, "#error \"Error! can't make correct RNA file from %s:%d, STUPID!\"\n", __FILE__, line);
fclose(fp);
}
-static int rna_preprocess(char *outfile)
+static int rna_preprocess(const char *outfile)
{
BlenderRNA *brna;
StructDefRNA *ds;
diff --git a/source/blender/python/generic/bpy_internal_import.c b/source/blender/python/generic/bpy_internal_import.c
index ac54cef7d4d..293ade35584 100644
--- a/source/blender/python/generic/bpy_internal_import.c
+++ b/source/blender/python/generic/bpy_internal_import.c
@@ -124,7 +124,7 @@ PyObject *bpy_text_import(Text *text)
return PyImport_ExecCodeModule(modulename, text->compiled);
}
-PyObject *bpy_text_import_name(char *name, int *found)
+PyObject *bpy_text_import_name(const char *name, int *found)
{
Text *text;
char txtname[MAX_ID_NAME-2];
diff --git a/source/blender/python/generic/bpy_internal_import.h b/source/blender/python/generic/bpy_internal_import.h
index 8bc10234a9b..2ce644715e9 100644
--- a/source/blender/python/generic/bpy_internal_import.h
+++ b/source/blender/python/generic/bpy_internal_import.h
@@ -49,7 +49,7 @@ struct Text;
void bpy_import_init(PyObject *builtins);
PyObject* bpy_text_import(struct Text *text);
-PyObject* bpy_text_import_name(char *name, int *found);
+PyObject* bpy_text_import_name(const char *name, int *found);
PyObject* bpy_text_reimport(PyObject *module, int *found);
/* void bpy_text_clear_modules(int clear_all);*/ /* Clear user modules */
diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c
index bbe32765443..64b36c1fd12 100644
--- a/source/blender/render/intern/source/pipeline.c
+++ b/source/blender/render/intern/source/pipeline.c
@@ -405,7 +405,7 @@ static const char *get_pass_name(int passtype, int channel)
return "Unknown";
}
-static int passtype_from_name(char *str)
+static int passtype_from_name(const char *str)
{
if(strcmp(str, "Combined")==0)