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:22:07 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-04-26 18:25:15 +0400
commitf2d25975b5e90f89744be733b81462493dc57977 (patch)
tree012edc272b43920b09af443160ad2657322e2a93 /source/blender/render
parent15d77d201d667d5b7f4277cff91f11400e85971a (diff)
Code cleanup: use 'const' for arrays (render)
Diffstat (limited to 'source/blender/render')
-rw-r--r--source/blender/render/intern/source/bake.c6
-rw-r--r--source/blender/render/intern/source/convertblender.c10
-rw-r--r--source/blender/render/intern/source/imagetexture.c10
-rw-r--r--source/blender/render/intern/source/multires_bake.c16
-rw-r--r--source/blender/render/intern/source/occlusion.c2
-rw-r--r--source/blender/render/intern/source/pointdensity.c2
-rw-r--r--source/blender/render/intern/source/rayshade.c8
-rw-r--r--source/blender/render/intern/source/render_texture.c4
-rw-r--r--source/blender/render/intern/source/rendercore.c16
-rw-r--r--source/blender/render/intern/source/shadbuf.c8
-rw-r--r--source/blender/render/intern/source/shadeinput.c22
-rw-r--r--source/blender/render/intern/source/sss.c2
-rw-r--r--source/blender/render/intern/source/strand.c2
-rw-r--r--source/blender/render/intern/source/volume_precache.c4
-rw-r--r--source/blender/render/intern/source/volumetric.c4
-rw-r--r--source/blender/render/intern/source/voxeldata.c2
-rw-r--r--source/blender/render/intern/source/zbuf.c26
17 files changed, 72 insertions, 72 deletions
diff --git a/source/blender/render/intern/source/bake.c b/source/blender/render/intern/source/bake.c
index 59a2a0d78fc..0d165f4e060 100644
--- a/source/blender/render/intern/source/bake.c
+++ b/source/blender/render/intern/source/bake.c
@@ -373,7 +373,7 @@ static void bake_displacement(void *handle, ShadeInput *UNUSED(shi), float dist,
bs->vcol->b = col[2];
}
else {
- char *imcol = (char *)(bs->rect + bs->rectx * y + x);
+ const char *imcol = (char *)(bs->rect + bs->rectx * y + x);
copy_v4_v4_char((char *)imcol, (char *)col);
}
}
@@ -936,8 +936,8 @@ void RE_bake_ibuf_filter(ImBuf *ibuf, char *mask, const int filter)
void RE_bake_ibuf_normalize_displacement(ImBuf *ibuf, float *displacement, char *mask, float displacement_min, float displacement_max)
{
int i;
- float *current_displacement = displacement;
- char *current_mask = mask;
+ const float *current_displacement = displacement;
+ const char *current_mask = mask;
float max_distance;
max_distance = max_ff(fabsf(displacement_min), fabsf(displacement_max));
diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c
index 908215f4215..7c8a6e030d5 100644
--- a/source/blender/render/intern/source/convertblender.c
+++ b/source/blender/render/intern/source/convertblender.c
@@ -416,7 +416,7 @@ static void calc_vertexnormals(Render *UNUSED(re), ObjectRen *obr, bool do_verte
VlakRen *vlr= RE_findOrAddVlak(obr, a);
if (do_vertex_normal && vlr->flag & ME_SMOOTH) {
float *n4= (vlr->v4)? vlr->v4->n: NULL;
- float *c4= (vlr->v4)? vlr->v4->co: NULL;
+ const float *c4= (vlr->v4)? vlr->v4->co: NULL;
accumulate_vertex_normals(vlr->v1->n, vlr->v2->n, vlr->v3->n, n4,
vlr->n, vlr->v1->co, vlr->v2->co, vlr->v3->co, c4);
@@ -1325,7 +1325,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
int totchild=0, step_nbr;
int seed, path_nbr=0, orco1=0, num;
int totface;
- char **uv_name = NULL;
+ const char **uv_name = NULL;
const int *index_mf_to_mpoly = NULL;
const int *index_mp_to_orig = NULL;
@@ -2045,7 +2045,7 @@ static void displace_render_vert(Render *re, ObjectRen *obr, ShadeInput *shi, Ve
/* not (yet?) */
}
if (texco & TEXCO_STRESS) {
- float *s= RE_vertren_get_stress(obr, vr, 0);
+ const float *s= RE_vertren_get_stress(obr, vr, 0);
if (s) {
shi->stress= *s;
@@ -2714,7 +2714,7 @@ static void init_render_curve(Render *re, ObjectRen *obr, int timeoffset)
/* pass */
}
else if (dl->type==DL_INDEX3) {
- int *index;
+ const int *index;
startvert= obr->totvert;
data= dl->verts;
@@ -3085,7 +3085,7 @@ static EdgeHash *make_freestyle_edge_mark_hash(Mesh *me, DerivedMesh *dm)
FreestyleEdge *fed;
MEdge *medge;
int totedge, a;
- int *index;
+ const int *index;
medge = dm->getEdgeArray(dm);
totedge = dm->getNumEdges(dm);
diff --git a/source/blender/render/intern/source/imagetexture.c b/source/blender/render/intern/source/imagetexture.c
index 31748549768..7733e5acfbb 100644
--- a/source/blender/render/intern/source/imagetexture.c
+++ b/source/blender/render/intern/source/imagetexture.c
@@ -82,21 +82,21 @@ static void ibuf_get_color(float col[4], struct ImBuf *ibuf, int x, int y)
if (ibuf->rect_float) {
if (ibuf->channels==4) {
- float *fp= ibuf->rect_float + 4*ofs;
+ const float *fp= ibuf->rect_float + 4*ofs;
copy_v4_v4(col, fp);
}
else if (ibuf->channels==3) {
- float *fp= ibuf->rect_float + 3*ofs;
+ const float *fp= ibuf->rect_float + 3*ofs;
copy_v3_v3(col, fp);
col[3]= 1.0f;
}
else {
- float *fp= ibuf->rect_float + ofs;
+ const float *fp= ibuf->rect_float + ofs;
col[0]= col[1]= col[2]= col[3]= *fp;
}
}
else {
- char *rect = (char *)( ibuf->rect+ ofs);
+ const char *rect = (char *)( ibuf->rect+ ofs);
col[0] = ((float)rect[0])*(1.0f/255.0f);
col[1] = ((float)rect[1])*(1.0f/255.0f);
@@ -727,7 +727,7 @@ static int ibuf_get_color_clip(float col[4], ImBuf *ibuf, int x, int y, int extf
}
}
else {
- char *rect = (char *)(ibuf->rect + x + y*ibuf->x);
+ const char *rect = (char *)(ibuf->rect + x + y*ibuf->x);
float inv_alpha_fac = (1.0f / 255.0f) * rect[3] * (1.0f / 255.0f);
col[0] = rect[0] * inv_alpha_fac;
col[1] = rect[1] * inv_alpha_fac;
diff --git a/source/blender/render/intern/source/multires_bake.c b/source/blender/render/intern/source/multires_bake.c
index b0416c5d517..7e07054772c 100644
--- a/source/blender/render/intern/source/multires_bake.c
+++ b/source/blender/render/intern/source/multires_bake.c
@@ -76,7 +76,7 @@ typedef struct {
MFace *mface;
MTFace *mtface;
float *pvtangent;
- float *precomputed_normals;
+ const float *precomputed_normals;
int w, h;
int face_index;
int i0, i1, i2;
@@ -137,7 +137,7 @@ static void multiresbake_get_normal(const MResolvePixelData *data, float norm[],
}
else {
float nor[3];
- float *p0, *p1, *p2;
+ const float *p0, *p1, *p2;
const int iGetNrVerts = data->mface[face_num].v4 != 0 ? 4 : 3;
p0 = data->mvert[indices[0]].co;
@@ -145,7 +145,7 @@ static void multiresbake_get_normal(const MResolvePixelData *data, float norm[],
p2 = data->mvert[indices[2]].co;
if (iGetNrVerts == 4) {
- float *p3 = data->mvert[indices[3]].co;
+ const float *p3 = data->mvert[indices[3]].co;
normal_quad_v3(nor, p0, p1, p2, p3);
}
else {
@@ -156,7 +156,7 @@ static void multiresbake_get_normal(const MResolvePixelData *data, float norm[],
}
}
else {
- short *no = data->mvert[indices[vert_index]].no;
+ const short *no = data->mvert[indices[vert_index]].no;
normal_short_to_float_v3(norm, no);
normalize_v3(norm);
@@ -181,8 +181,8 @@ static void init_bake_rast(MBakeRast *bake_rast, const ImBuf *ibuf, const MResol
static void flush_pixel(const MResolvePixelData *data, const int x, const int y)
{
float st[2] = {(x + 0.5f) / data->w, (y + 0.5f) / data->h};
- float *st0, *st1, *st2;
- float *tang0, *tang1, *tang2;
+ const float *st0, *st1, *st2;
+ const float *tang0, *tang1, *tang2;
float no0[3], no1[3], no2[3];
float fUV[2], from_tang[3][3], to_tang[3][3];
float u, v, w, sign;
@@ -451,7 +451,7 @@ static void init_ccgdm_arrays(DerivedMesh *dm)
CCGElem **grid_data;
CCGKey key;
int grid_size;
- int *grid_offset;
+ const int *grid_offset;
grid_size = dm->getGridSize(dm);
grid_data = dm->getGridData(dm);
@@ -478,7 +478,7 @@ static void do_multires_bake(MultiresBakeRender *bkr, Image *ima, bool require_t
MVert *mvert = dm->getVertArray(dm);
MFace *mface = dm->getTessFaceArray(dm);
MTFace *mtface = dm->getTessFaceDataArray(dm, CD_MTFACE);
- float *precomputed_normals = dm->getTessFaceDataArray(dm, CD_NORMAL);
+ const float *precomputed_normals = dm->getTessFaceDataArray(dm, CD_NORMAL);
float *pvtangent = NULL;
ListBase threads;
diff --git a/source/blender/render/intern/source/occlusion.c b/source/blender/render/intern/source/occlusion.c
index 91c9143f5a3..3fafc61b42a 100644
--- a/source/blender/render/intern/source/occlusion.c
+++ b/source/blender/render/intern/source/occlusion.c
@@ -1176,7 +1176,7 @@ static void sample_occ_surface(ShadeInput *shi)
{
StrandRen *strand = shi->strand;
StrandSurface *mesh = strand->buffer->surface;
- int *face, *index = RE_strandren_get_face(shi->obr, strand, 0);
+ const int *face, *index = RE_strandren_get_face(shi->obr, strand, 0);
float w[4], *co1, *co2, *co3, *co4;
if (mesh && mesh->face && mesh->co && mesh->ao && index) {
diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c
index b085ac5812b..51fe4892ff7 100644
--- a/source/blender/render/intern/source/pointdensity.c
+++ b/source/blender/render/intern/source/pointdensity.c
@@ -350,7 +350,7 @@ void free_pointdensities(Render *re)
typedef struct PointDensityRangeData {
float *density;
float squared_radius;
- float *point_data;
+ const float *point_data;
float *vec;
float softness;
short falloff_type;
diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c
index 61e8eb2dc61..e39a1109680 100644
--- a/source/blender/render/intern/source/rayshade.c
+++ b/source/blender/render/intern/source/rayshade.c
@@ -476,9 +476,9 @@ static void shade_ray_set_derivative(ShadeInput *shi)
t10= v3[axis1]-v2[axis1]; t11= v3[axis2]-v2[axis2];
}
else {
- float *v1= shi->v1->co;
- float *v2= shi->v2->co;
- float *v3= shi->v3->co;
+ const float *v1= shi->v1->co;
+ const float *v2= shi->v2->co;
+ const float *v3= shi->v3->co;
/* same as above */
t00= v3[axis1]-v1[axis1]; t01= v3[axis2]-v1[axis2];
@@ -2327,7 +2327,7 @@ static void ray_shadow_qmc(ShadeInput *shi, LampRen *lar, const float lampco[3],
static void ray_shadow_jitter(ShadeInput *shi, LampRen *lar, const float lampco[3], float shadfac[4], Isect *isec)
{
/* area soft shadow */
- float *jitlamp;
+ const float *jitlamp;
float fac=0.0f, div=0.0f, vec[3];
int a, j= -1, mask;
RayHint point_hint;
diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c
index adc824fcd6f..9c7c6738a11 100644
--- a/source/blender/render/intern/source/render_texture.c
+++ b/source/blender/render/intern/source/render_texture.c
@@ -1683,7 +1683,7 @@ static void compatible_bump_uv_derivs(CompatibleBump *compat_bump, ShadeInput *s
}
if (tf) {
- float *uv1 = tf->uv[j1], *uv2 = tf->uv[j2], *uv3 = tf->uv[j3];
+ const float *uv1 = tf->uv[j1], *uv2 = tf->uv[j2], *uv3 = tf->uv[j3];
const float an[3] = {fabsf(compat_bump->nn[0]), fabsf(compat_bump->nn[1]), fabsf(compat_bump->nn[2])};
const int a1 = (an[0] > an[1] && an[0] > an[2]) ? 1 : 0;
const int a2 = (an[2] > an[0] && an[2] > an[1]) ? 1 : 2;
@@ -3713,7 +3713,7 @@ void RE_sample_material_color(Material *mat, float color[3], float *alpha, const
/* for every uv map set coords and name */
for (i=0; i<layers; i++) {
if (layer_index >= 0) {
- float *uv1, *uv2, *uv3;
+ const float *uv1, *uv2, *uv3;
float l;
CustomData *data = &orcoDm->faceData;
MTFace *tface = (MTFace *) data->layers[layer_index+i].data;
diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c
index 3b71fd40c94..1e38fd97bf6 100644
--- a/source/blender/render/intern/source/rendercore.c
+++ b/source/blender/render/intern/source/rendercore.c
@@ -348,7 +348,7 @@ static void lamphalo_tile(RenderPart *pa, RenderLayer *rl)
float *pass;
float fac, col[4];
intptr_t *rd= pa->rectdaps;
- int *rz= pa->rectz;
+ const int *rz= pa->rectz;
int x, y, sample, totsample, fullsample, od;
totsample= get_sample_layers(pa, rl, rlpp);
@@ -763,7 +763,7 @@ static void atm_tile(RenderPart *pa, RenderLayer *rl)
int sample;
for (sample=0; sample<totsample; sample++) {
- float *zrect= RE_RenderLayerGetPass(rlpp[sample], SCE_PASS_Z) + od;
+ const float *zrect= RE_RenderLayerGetPass(rlpp[sample], SCE_PASS_Z) + od;
float *rgbrect = rlpp[sample]->rectf + 4*od;
float rgb[3] = {0};
bool done = false;
@@ -1157,10 +1157,10 @@ static void make_pixelstructs(RenderPart *pa, ZSpan *zspan, int sample, void *da
ZbufSolidData *sdata = (ZbufSolidData *)data;
ListBase *lb= sdata->psmlist;
intptr_t *rd= pa->rectdaps;
- int *ro= zspan->recto;
- int *rp= zspan->rectp;
- int *rz= zspan->rectz;
- int *rm= zspan->rectmask;
+ const int *ro= zspan->recto;
+ const int *rp= zspan->rectp;
+ const int *rz= zspan->rectz;
+ const int *rm= zspan->rectmask;
int x, y;
int mask= 1<<sample;
@@ -1363,8 +1363,8 @@ void zbufshade_tile(RenderPart *pa)
rr->renlay= rl;
if (rl->layflag & SCE_LAY_SOLID) {
- float *fcol= rl->rectf;
- int *ro= pa->recto, *rp= pa->rectp, *rz= pa->rectz;
+ const float *fcol= rl->rectf;
+ const int *ro= pa->recto, *rp= pa->rectp, *rz= pa->rectz;
int x, y, offs=0, seed;
/* we set per pixel a fixed seed, for random AO and shadow samples */
diff --git a/source/blender/render/intern/source/shadbuf.c b/source/blender/render/intern/source/shadbuf.c
index ed820737a0f..9d337e542a1 100644
--- a/source/blender/render/intern/source/shadbuf.c
+++ b/source/blender/render/intern/source/shadbuf.c
@@ -925,7 +925,7 @@ void freeshadowbuf(LampRen *lar)
}
else {
intptr_t *ztile= shsample->zbuf;
- char *ctile= shsample->cbuf;
+ const char *ctile= shsample->cbuf;
v= (shb->size*shb->size)/256;
for (b=0; b<v; b++, ztile++, ctile++)
@@ -949,7 +949,7 @@ static int firstreadshadbuf(ShadBuf *shb, ShadSampleBuf *shsample, int **rz, int
{
/* return a 1 if fully compressed shadbuf-tile && z==const */
int ofs;
- char *ct;
+ const char *ct;
if (shsample->deepbuf)
return 0;
@@ -1614,7 +1614,7 @@ static void isb_bsp_split(ISBBranch *root, MemArena *mem)
static int isb_bsp_insert(ISBBranch *root, MemArena *memarena, ISBSample *sample)
{
ISBBranch *bspn= root;
- float *zco= sample->zco;
+ const float *zco= sample->zco;
int i= 0;
/* debug counter, also used to check if something was filled in ever */
@@ -2574,7 +2574,7 @@ float ISB_getshadow(ShadeInput *shi, ShadBuf *shb)
if (y >= 0 && y < isbdata->recty) {
if (isbdata->shadfacs) {
- short *sp= isbdata->shadfacs + y*isbdata->rectx + x;
+ const short *sp= isbdata->shadfacs + y*isbdata->rectx + x;
return *sp>=4096?0.0f:1.0f - ((float)*sp)/4096.0f;
}
else {
diff --git a/source/blender/render/intern/source/shadeinput.c b/source/blender/render/intern/source/shadeinput.c
index 95e6cbd6354..6aeee7721c5 100644
--- a/source/blender/render/intern/source/shadeinput.c
+++ b/source/blender/render/intern/source/shadeinput.c
@@ -396,7 +396,7 @@ void shade_input_set_strand_texco(ShadeInput *shi, StrandRen *strand, StrandVert
}
if (mode & MA_STR_SURFDIFF) {
- float *surfnor = RE_strandren_get_surfnor(obr, strand, 0);
+ const float *surfnor = RE_strandren_get_surfnor(obr, strand, 0);
if (surfnor)
copy_v3_v3(shi->surfnor, surfnor);
@@ -412,7 +412,7 @@ void shade_input_set_strand_texco(ShadeInput *shi, StrandRen *strand, StrandVert
}
if (R.r.mode & R_SPEED) {
- float *speed;
+ const float *speed;
speed = RE_strandren_get_winspeed(shi->obi, strand, 0);
if (speed)
@@ -451,7 +451,7 @@ void shade_input_set_strand_texco(ShadeInput *shi, StrandRen *strand, StrandVert
if ((texco & TEXCO_UV) || (mode & (MA_VERTEXCOL | MA_VERTEXCOLP | MA_FACETEXTURE))) {
MCol *mcol;
- float *uv;
+ const float *uv;
char *name;
int i;
@@ -463,7 +463,7 @@ void shade_input_set_strand_texco(ShadeInput *shi, StrandRen *strand, StrandVert
if (mode & (MA_VERTEXCOL | MA_VERTEXCOLP)) {
for (i = 0; (mcol = RE_strandren_get_mcol(obr, strand, i, &name, 0)); i++) {
ShadeInputCol *scol = &shi->col[i];
- char *cp = (char *)mcol;
+ const char *cp = (char *)mcol;
shi->totcol++;
scol->name = name;
@@ -886,7 +886,7 @@ void shade_input_set_shade_texco(ShadeInput *shi)
if (shi->vlr->flag & R_SMOOTH) {
if (shi->osatex && (texco & (TEXCO_NORM | TEXCO_REFL)) ) {
- float *n1 = shi->n1, *n2 = shi->n2, *n3 = shi->n3;
+ const float *n1 = shi->n1, *n2 = shi->n2, *n3 = shi->n3;
dl = shi->dx_u + shi->dx_v;
shi->dxno[0] = dl * n3[0] - shi->dx_u * n1[0] - shi->dx_v * n2[0];
@@ -902,7 +902,7 @@ void shade_input_set_shade_texco(ShadeInput *shi)
/* calc tangents */
if (mode & (MA_TANGENT_V | MA_NORMAP_TANG) || R.flag & R_NEED_TANGENT) {
- float *tangent, *s1, *s2, *s3;
+ const float *tangent, *s1, *s2, *s3;
float tl, tu, tv;
if (shi->vlr->flag & R_SMOOTH) {
@@ -974,7 +974,7 @@ void shade_input_set_shade_texco(ShadeInput *shi)
}
if (mode & MA_STR_SURFDIFF) {
- float *surfnor = RE_vlakren_get_surfnor(obr, shi->vlr, 0);
+ const float *surfnor = RE_vlakren_get_surfnor(obr, shi->vlr, 0);
if (surfnor) {
copy_v3_v3(shi->surfnor, surfnor);
@@ -988,7 +988,7 @@ void shade_input_set_shade_texco(ShadeInput *shi)
}
if (R.r.mode & R_SPEED) {
- float *s1, *s2, *s3;
+ const float *s1, *s2, *s3;
s1 = RE_vertren_get_winspeed(obi, v1, 0);
s2 = RE_vertren_get_winspeed(obi, v2, 0);
@@ -1013,7 +1013,7 @@ void shade_input_set_shade_texco(ShadeInput *shi)
if (texco & TEXCO_ORCO) {
if (v1->orco) {
- float *o1, *o2, *o3;
+ const float *o1, *o2, *o3;
o1 = v1->orco;
o2 = v2->orco;
@@ -1077,7 +1077,7 @@ void shade_input_set_shade_texco(ShadeInput *shi)
if ((mode & (MA_VERTEXCOL | MA_VERTEXCOLP)) || (R.flag & R_NEED_VCOL)) {
for (i = 0; (mcol = RE_vlakren_get_mcol(obr, vlr, i, &name, 0)); i++) {
ShadeInputCol *scol = &shi->col[i];
- char *cp1, *cp2, *cp3;
+ const char *cp1, *cp2, *cp3;
float a[3];
shi->totcol++;
@@ -1257,7 +1257,7 @@ void shade_input_set_shade_texco(ShadeInput *shi)
}
if (texco & TEXCO_STRESS) {
- float *s1, *s2, *s3;
+ const float *s1, *s2, *s3;
s1 = RE_vertren_get_stress(obr, v1, 0);
s2 = RE_vertren_get_stress(obr, v2, 0);
diff --git a/source/blender/render/intern/source/sss.c b/source/blender/render/intern/source/sss.c
index 09169259461..99829851494 100644
--- a/source/blender/render/intern/source/sss.c
+++ b/source/blender/render/intern/source/sss.c
@@ -934,7 +934,7 @@ static void sss_create_tree_mat(Render *re, Material *mat)
if (!re->test_break(re->tbh)) {
SSSData *sss= MEM_callocN(sizeof(*sss), "SSSData");
float ior= mat->sss_ior, cfac= mat->sss_colfac;
- float *radius= mat->sss_radius;
+ const float *radius = mat->sss_radius;
float fw= mat->sss_front, bw= mat->sss_back;
float error = mat->sss_error;
diff --git a/source/blender/render/intern/source/strand.c b/source/blender/render/intern/source/strand.c
index 190651645db..50343cfaa0b 100644
--- a/source/blender/render/intern/source/strand.c
+++ b/source/blender/render/intern/source/strand.c
@@ -79,7 +79,7 @@ void strand_eval_point(StrandSegment *sseg, StrandPoint *spoint)
{
Material *ma;
StrandBuffer *strandbuf;
- float *simplify;
+ const float *simplify;
float p[4][3], data[4], cross[3], w, dx, dy, t;
int type;
diff --git a/source/blender/render/intern/source/volume_precache.c b/source/blender/render/intern/source/volume_precache.c
index 6cf83d0508f..a3a4f23b526 100644
--- a/source/blender/render/intern/source/volume_precache.c
+++ b/source/blender/render/intern/source/volume_precache.c
@@ -290,7 +290,7 @@ BLI_INLINE int lc_to_ms_I(int x, int y, int z, int *n)
static float total_ss_energy(Render *re, int do_test_break, VolumePrecache *vp)
{
int x, y, z;
- int *res = vp->res;
+ const int *res = vp->res;
float energy=0.f;
for (z=0; z < res[2]; z++) {
@@ -600,7 +600,7 @@ static void precache_launch_parts(Render *re, RayObject *tree, ShadeInput *shi,
float voxel[3];
int sizex, sizey, sizez;
float bbmin[3], bbmax[3];
- int *res;
+ const int *res;
int minx, maxx;
int miny, maxy;
int minz, maxz;
diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c
index 39950a1d417..6b1c03bd4ba 100644
--- a/source/blender/render/intern/source/volumetric.c
+++ b/source/blender/render/intern/source/volumetric.c
@@ -661,7 +661,7 @@ static void volumeintegrate(struct ShadeInput *shi, float col[4], const float co
static void volume_trace(struct ShadeInput *shi, struct ShadeResult *shr, int inside_volume)
{
float hitco[3], col[4] = {0.f, 0.f, 0.f, 0.f};
- float *startco, *endco;
+ const float *startco, *endco;
int trace_behind = 1;
const int ztransp = ((shi->depth == 0) && (shi->mat->mode & MA_TRANSP) && (shi->mat->mode & MA_ZTRANSP));
Isect is;
@@ -758,7 +758,7 @@ void shade_volume_shadow(struct ShadeInput *shi, struct ShadeResult *shr, struct
float hitco[3];
float tr[3] = {1.0, 1.0, 1.0};
Isect is = {{0}};
- float *startco, *endco;
+ const float *startco, *endco;
memset(shr, 0, sizeof(ShadeResult));
diff --git a/source/blender/render/intern/source/voxeldata.c b/source/blender/render/intern/source/voxeldata.c
index 24e32817a97..50b5e392b3f 100644
--- a/source/blender/render/intern/source/voxeldata.c
+++ b/source/blender/render/intern/source/voxeldata.c
@@ -154,7 +154,7 @@ static void load_frame_image_sequence(VoxelData *vd, Tex *tex)
ImageUser *tiuser = &tex->iuser;
ImageUser iuser = *(tiuser);
int x = 0, y = 0, z = 0;
- float *rf;
+ const float *rf;
if (!ima) return;
if (iuser.frames == 0) return;
diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c
index 8dc4a6c65de..03eac8cb38b 100644
--- a/source/blender/render/intern/source/zbuf.c
+++ b/source/blender/render/intern/source/zbuf.c
@@ -313,7 +313,7 @@ static void zbuffillAc4(ZSpan *zspan, int obi, int zvlnr,
double zxd, zyd, zy0, zverg;
float x0, y0, z0;
float x1, y1, z1, x2, y2, z2, xx1;
- float *span1, *span2;
+ const float *span1, *span2;
int *rz, *rm, x, y;
int sn1, sn2, rectx, *rectzofs, *rectmaskofs, my0, my2, mask;
@@ -436,7 +436,7 @@ static void zbuffillAc4(ZSpan *zspan, int obi, int zvlnr,
static void zbuflineAc(ZSpan *zspan, int obi, int zvlnr, const float vec1[3], const float vec2[3])
{
APixstr *ap, *apn;
- int *rectz, *rectmask;
+ const int *rectz, *rectmask;
int start, end, x, y, oldx, oldy, ofs;
int dz, vergz, mask, maxtest=0;
float dx, dy;
@@ -1053,10 +1053,10 @@ static void zbuffillGLinv4(ZSpan *zspan, int obi, int zvlnr,
double zxd, zyd, zy0, zverg;
float x0, y0, z0;
float x1, y1, z1, x2, y2, z2, xx1;
- float *span1, *span2;
+ const float *span1, *span2;
int *rectoofs, *ro;
int *rectpofs, *rp;
- int *rectmaskofs, *rm;
+ const int *rectmaskofs, *rm;
int *rz, x, y;
int sn1, sn2, rectx, *rectzofs, my0, my2;
@@ -1176,10 +1176,10 @@ static void zbuffillGL4(ZSpan *zspan, int obi, int zvlnr,
double zxd, zyd, zy0, zverg;
float x0, y0, z0;
float x1, y1, z1, x2, y2, z2, xx1;
- float *span1, *span2;
+ const float *span1, *span2;
int *rectoofs, *ro;
int *rectpofs, *rp;
- int *rectmaskofs, *rm;
+ const int *rectmaskofs, *rm;
int *rz, x, y;
int sn1, sn2, rectx, *rectzofs, my0, my2;
@@ -1307,7 +1307,7 @@ static void zbuffillGL_onlyZ(ZSpan *zspan, int UNUSED(obi), int UNUSED(zvlnr),
double zxd, zyd, zy0, zverg;
float x0, y0, z0;
float x1, y1, z1, x2, y2, z2, xx1;
- float *span1, *span2;
+ const float *span1, *span2;
int *rz, *rz1, x, y;
int sn1, sn2, rectx, *rectzofs, *rectzofs1= NULL, my0, my2;
@@ -1415,7 +1415,7 @@ void zspan_scanconvert_strand(ZSpan *zspan, void *handle, float *v1, float *v2,
{
float x0, y0, x1, y1, x2, y2, z0, z1, z2, z;
float u, v, uxd, uyd, vxd, vyd, uy0, vy0, zxd, zyd, zy0, xx1;
- float *span1, *span2;
+ const float *span1, *span2;
int x, y, sn1, sn2, rectx= zspan->rectx, my0, my2;
/* init */
@@ -1515,7 +1515,7 @@ void zspan_scanconvert(ZSpan *zspan, void *handle, float *v1, float *v2, float *
{
float x0, y0, x1, y1, x2, y2, z0, z1, z2;
float u, v, uxd, uyd, vxd, vyd, uy0, vy0, xx1;
- float *span1, *span2;
+ const float *span1, *span2;
int x, y, sn1, sn2, rectx= zspan->rectx, my0, my2;
/* init */
@@ -2658,7 +2658,7 @@ void zbuffer_sss(RenderPart *pa, unsigned int lay, void *handle, void (*func)(vo
/* ******************** VECBLUR ACCUM BUF ************************* */
typedef struct DrawBufPixel {
- float *colpoin;
+ const float *colpoin;
float alpha;
} DrawBufPixel;
@@ -2669,7 +2669,7 @@ static void zbuf_fill_in_rgba(ZSpan *zspan, DrawBufPixel *col, float *v1, float
double zxd, zyd, zy0, zverg;
float x0, y0, z0;
float x1, y1, z1, x2, y2, z2, xx1;
- float *span1, *span2;
+ const float *span1, *span2;
float *rectzofs, *rz;
int x, y;
int sn1, sn2, rectx, my0, my2;
@@ -3615,7 +3615,7 @@ static void merge_transp_passes(RenderLayer *rl, ShadeResult *shr)
for (samp= 1; samp<R.osa; samp++, shr_t++) {
if (shr_t->combined[3] > 0.0f) {
- float *speed= shr_t->winspeed;
+ const float *speed= shr_t->winspeed;
if ( (ABS(speed[0]) + ABS(speed[1]))< (ABS(fp[0]) + ABS(fp[1])) ) {
fp[0]= speed[0];
@@ -3631,7 +3631,7 @@ static void merge_transp_passes(RenderLayer *rl, ShadeResult *shr)
break;
}
if (col) {
- float *fp= col+delta;
+ const float *fp= col+delta;
int samp;
for (samp= 1; samp<R.osa; samp++, fp+=delta) {