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>2014-04-26 18:24:11 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-04-26 18:25:16 +0400
commit7ca74fc1c008355b84c08bcadb56ea6acabce2f3 (patch)
tree6823cc2e0945928dbabb3e4735380128d61eace2 /source/blender/blenloader/intern
parent88a0fe5f1bc52ebd918be1f63af57cf0f9d594d1 (diff)
Code cleanup: use 'const' for arrays (blenloader, gpu, imbuf, makesdna, modifiers, nodes)
Diffstat (limited to 'source/blender/blenloader/intern')
-rw-r--r--source/blender/blenloader/intern/readblenentry.c8
-rw-r--r--source/blender/blenloader/intern/readfile.c6
-rw-r--r--source/blender/blenloader/intern/versioning_250.c2
-rw-r--r--source/blender/blenloader/intern/writefile.c6
4 files changed, 11 insertions, 11 deletions
diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c
index 5dcf875a32b..c1590d02a51 100644
--- a/source/blender/blenloader/intern/readblenentry.c
+++ b/source/blender/blenloader/intern/readblenentry.c
@@ -102,8 +102,8 @@ void BLO_blendhandle_print_sizes(BlendHandle *bh, void *fp)
if (bhead->code == ENDB)
break;
else {
- short *sp = fd->filesdna->structs[bhead->SDNAnr];
- char *name = fd->filesdna->types[sp[0]];
+ const short *sp = fd->filesdna->structs[bhead->SDNAnr];
+ const char *name = fd->filesdna->types[sp[0]];
char buf[4];
buf[0] = (bhead->code >> 24) & 0xFF;
@@ -131,7 +131,7 @@ LinkNode *BLO_blendhandle_get_datablock_names(BlendHandle *bh, int ofblocktype,
for (bhead = blo_firstbhead(fd); bhead; bhead = blo_nextbhead(fd, bhead)) {
if (bhead->code == ofblocktype) {
- char *idname = bhead_id_name(fd, bhead);
+ const char *idname = bhead_id_name(fd, bhead);
BLI_linklist_prepend(&names, strdup(idname + 2));
tot++;
@@ -156,7 +156,7 @@ LinkNode *BLO_blendhandle_get_previews(BlendHandle *bh, int ofblocktype, int *to
for (bhead = blo_firstbhead(fd); bhead; bhead = blo_nextbhead(fd, bhead)) {
if (bhead->code == ofblocktype) {
- char *idname = bhead_id_name(fd, bhead);
+ const char *idname = bhead_id_name(fd, bhead);
switch (GS(idname)) {
case ID_MA: /* fall through */
case ID_TE: /* fall through */
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 2c97d98f2a5..004eacdef2c 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -537,7 +537,7 @@ static Main *blo_find_main(FileData *fd, const char *filepath, const char *relab
// printf("blo_find_main: converted to %s\n", name1);
for (m = mainlist->first; m; m = m->next) {
- char *libname = (m->curlib) ? m->curlib->filepath : m->name;
+ const char *libname = (m->curlib) ? m->curlib->filepath : m->name;
if (BLI_path_cmp(name1, libname) == 0) {
if (G.debug & G_DEBUG) printf("blo_find_main: found library %s\n", libname);
@@ -3052,7 +3052,7 @@ static void lib_link_key(FileData *fd, Main *main)
static void switch_endian_keyblock(Key *key, KeyBlock *kb)
{
int elemsize, a, b;
- char *data, *poin, *cp;
+ const char *data, *poin, *cp;
elemsize = key->elemsize;
data = kb->data;
@@ -4333,7 +4333,7 @@ static void lib_link_object(FileData *fd, Main *main)
/* When the object is local and the data is library its possible
* the material list size gets out of sync. [#22663] */
if (ob->data && ob->id.lib != ((ID *)ob->data)->lib) {
- short *totcol_data = give_totcolp(ob);
+ const short *totcol_data = give_totcolp(ob);
/* Only expand so as not to loose any object materials that might be set. */
if (totcol_data && (*totcol_data > ob->totcol)) {
/* printf("'%s' %d -> %d\n", ob->id.name, ob->totcol, *totcol_data); */
diff --git a/source/blender/blenloader/intern/versioning_250.c b/source/blender/blenloader/intern/versioning_250.c
index 17600d1fcd1..e6d327f1043 100644
--- a/source/blender/blenloader/intern/versioning_250.c
+++ b/source/blender/blenloader/intern/versioning_250.c
@@ -1267,7 +1267,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *main)
Lattice *lt;
Curve *cu;
Key *key;
- float *data;
+ const float *data;
int a, tot;
/* shape keys are no longer applied to the mesh itself, but rather
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 71e490d777e..70e3c62a1f1 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -344,7 +344,7 @@ static int endwrite(WriteData *wd)
static void writestruct_at_address(WriteData *wd, int filecode, const char *structname, int nr, void *adr, void *data)
{
BHead bh;
- short *sp;
+ const short *sp;
if (adr==NULL || data==NULL || nr==0) return;
@@ -1337,7 +1337,7 @@ static void write_pose(WriteData *wd, bPose *pose)
/* write IK param */
if (pose->ikparam) {
- char *structname = (char *)BKE_pose_ikparam_get_name(pose);
+ const char *structname = (char *)BKE_pose_ikparam_get_name(pose);
if (structname)
writestruct(wd, DATA, structname, 1, pose->ikparam);
}
@@ -1784,7 +1784,7 @@ static void write_customdata(WriteData *wd, ID *id, int count, CustomData *data,
write_mdisps(wd, count, layer->data, layer->flag & CD_FLAG_EXTERNAL);
}
else if (layer->type == CD_PAINT_MASK) {
- float *layer_data = layer->data;
+ const float *layer_data = layer->data;
writedata(wd, DATA, sizeof(*layer_data) * count, layer_data);
}
else if (layer->type == CD_GRID_PAINT_MASK) {