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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-10-12 06:19:37 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-10-12 06:19:37 +0400
commitb6db417ee466c6aec5d412a259a6dc7c0b4c1750 (patch)
treeca86ca90c7868f92d3c795c8d1f6a968dade6760 /source
parent744f691af42ffeadd306180048c51edad65a5f06 (diff)
code cleanup: use const's for vector args.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/anim.c2
-rw-r--r--source/blender/blenlib/intern/noise.c4
-rw-r--r--source/blender/editors/mesh/editmesh_extrude.c2
-rw-r--r--source/blender/editors/space_view3d/drawobject.c4
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c4
-rw-r--r--source/blender/imbuf/intern/tiff.c8
-rw-r--r--source/blender/python/mathutils/mathutils_Euler.c2
-rw-r--r--source/blender/python/mathutils/mathutils_Euler.h2
-rw-r--r--source/blender/python/mathutils/mathutils_Quaternion.c2
-rw-r--r--source/blender/python/mathutils/mathutils_Quaternion.h2
-rw-r--r--source/blender/python/mathutils/mathutils_Vector.c6
-rw-r--r--source/blender/python/mathutils/mathutils_Vector.h4
-rw-r--r--source/blender/render/extern/include/RE_pipeline.h2
-rw-r--r--source/blender/render/intern/source/convertblender.c2
14 files changed, 23 insertions, 23 deletions
diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c
index 5c3f67d8959..225be335c6d 100644
--- a/source/blender/blenkernel/intern/anim.c
+++ b/source/blender/blenkernel/intern/anim.c
@@ -530,7 +530,7 @@ void calc_curvepath(Object *ob, ListBase *nurbs)
path->len = nu->resolu * SEGMENTSU(nu);
}
- dist = (float *)MEM_mallocN((tot + 1) * 4, "calcpathdist");
+ dist = (float *)MEM_mallocN(sizeof(float) * (tot + 1), "calcpathdist");
/* all lengths in *dist */
bevp = bevpfirst = (BevPoint *)(bl + 1);
diff --git a/source/blender/blenlib/intern/noise.c b/source/blender/blenlib/intern/noise.c
index 9ba5124264f..5b9fefe77bb 100644
--- a/source/blender/blenlib/intern/noise.c
+++ b/source/blender/blenlib/intern/noise.c
@@ -42,7 +42,7 @@
/* local */
static float noise3_perlin(float vec[3]);
-//static float turbulence_perlin(float *point, float lofreq, float hifreq);
+//static float turbulence_perlin(const float point[3], float lofreq, float hifreq);
//static float turbulencep(float noisesize, float x, float y, float z, int nr);
/* UNUSED */
@@ -1097,7 +1097,7 @@ static float noise3_perlin(float vec[3])
}
#if 0
-static float turbulence_perlin(float *point, float lofreq, float hifreq)
+static float turbulence_perlin(const float point[3], float lofreq, float hifreq)
{
float freq, t, p[3];
diff --git a/source/blender/editors/mesh/editmesh_extrude.c b/source/blender/editors/mesh/editmesh_extrude.c
index 300fb67ec80..3df4ad738ae 100644
--- a/source/blender/editors/mesh/editmesh_extrude.c
+++ b/source/blender/editors/mesh/editmesh_extrude.c
@@ -290,7 +290,7 @@ static int edbm_extrude_repeat_exec(bContext *C, wmOperator *op)
//BMO_op_callf(em->bm, BMO_FLAG_DEFAULTS, "extrude_face_region geom=%hef", BM_ELEM_SELECT);
BMO_op_callf(em->bm, BMO_FLAG_DEFAULTS,
"translate vec=%v verts=%hv",
- (float *)dvec, BM_ELEM_SELECT);
+ dvec, BM_ELEM_SELECT);
//extrudeflag(obedit, em, SELECT, nor);
//translateflag(em, SELECT, dvec);
}
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 23b80fc5bea..3e27346f9fe 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -2043,7 +2043,7 @@ static void draw_dm_face_normals__mapFunc(void *userData, int index, const float
if (!BM_elem_flag_test(efa, BM_ELEM_HIDDEN)) {
if (!data->uniform_scale) {
- mul_v3_m3v3(n, data->tmat, (float *) no);
+ mul_v3_m3v3(n, data->tmat, no);
normalize_v3(n);
mul_m3_v3(data->imat, n);
}
@@ -2108,7 +2108,7 @@ static void draw_dm_vert_normals__mapFunc(void *userData, int index, const float
}
if (!data->uniform_scale) {
- mul_v3_m3v3(n, data->tmat, (float *) no);
+ mul_v3_m3v3(n, data->tmat, no);
normalize_v3(n);
mul_m3_v3(data->imat, n);
}
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index b737dba1a3b..24edfb413c8 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -113,9 +113,9 @@ static void star_stuff_init_func(void)
glPointSize(1.0);
glBegin(GL_POINTS);
}
-static void star_stuff_vertex_func(float *i)
+static void star_stuff_vertex_func(const float vec[3])
{
- glVertex3fv(i);
+ glVertex3fv(vec);
}
static void star_stuff_term_func(void)
{
diff --git a/source/blender/imbuf/intern/tiff.c b/source/blender/imbuf/intern/tiff.c
index eaba04c9310..05e9a4fa134 100644
--- a/source/blender/imbuf/intern/tiff.c
+++ b/source/blender/imbuf/intern/tiff.c
@@ -315,7 +315,7 @@ int imb_is_a_tiff(unsigned char *mem)
(memcmp(lil_endian, mem, IMB_TIFF_NCB) == 0) );
}
-static void scanline_contig_16bit(float *rectf, unsigned short *sbuf, int scanline_w, int spp)
+static void scanline_contig_16bit(float *rectf, const unsigned short *sbuf, int scanline_w, int spp)
{
int i;
for (i = 0; i < scanline_w; i++) {
@@ -326,7 +326,7 @@ static void scanline_contig_16bit(float *rectf, unsigned short *sbuf, int scanli
}
}
-static void scanline_contig_32bit(float *rectf, float *fbuf, int scanline_w, int spp)
+static void scanline_contig_32bit(float *rectf, const float *fbuf, int scanline_w, int spp)
{
int i;
for (i = 0; i < scanline_w; i++) {
@@ -337,14 +337,14 @@ static void scanline_contig_32bit(float *rectf, float *fbuf, int scanline_w, int
}
}
-static void scanline_separate_16bit(float *rectf, unsigned short *sbuf, int scanline_w, int chan)
+static void scanline_separate_16bit(float *rectf, const unsigned short *sbuf, int scanline_w, int chan)
{
int i;
for (i = 0; i < scanline_w; i++)
rectf[i * 4 + chan] = sbuf[i] / 65535.0;
}
-static void scanline_separate_32bit(float *rectf, float *fbuf, int scanline_w, int chan)
+static void scanline_separate_32bit(float *rectf, const float *fbuf, int scanline_w, int chan)
{
int i;
for (i = 0; i < scanline_w; i++)
diff --git a/source/blender/python/mathutils/mathutils_Euler.c b/source/blender/python/mathutils/mathutils_Euler.c
index 6bb3031f0a3..2a874f51fd4 100644
--- a/source/blender/python/mathutils/mathutils_Euler.c
+++ b/source/blender/python/mathutils/mathutils_Euler.c
@@ -707,7 +707,7 @@ PyTypeObject euler_Type = {
* (i.e. it was allocated elsewhere by MEM_mallocN())
* pass Py_NEW - if vector is not a WRAPPER and managed by PYTHON
* (i.e. it must be created here with PyMEM_malloc())*/
-PyObject *Euler_CreatePyObject(float *eul, const short order, int type, PyTypeObject *base_type)
+PyObject *Euler_CreatePyObject(float eul[3], const short order, int type, PyTypeObject *base_type)
{
EulerObject *self;
diff --git a/source/blender/python/mathutils/mathutils_Euler.h b/source/blender/python/mathutils/mathutils_Euler.h
index 355d0ed1810..62fb83ef234 100644
--- a/source/blender/python/mathutils/mathutils_Euler.h
+++ b/source/blender/python/mathutils/mathutils_Euler.h
@@ -43,7 +43,7 @@ typedef struct {
* blender (stored in blend_data). This is an either/or struct not both */
/* prototypes */
-PyObject *Euler_CreatePyObject(float *eul, const short order, int type, PyTypeObject *base_type);
+PyObject *Euler_CreatePyObject(float eul[3], const short order, int type, PyTypeObject *base_type);
PyObject *Euler_CreatePyObject_cb(PyObject *cb_user, const short order,
unsigned char cb_type, unsigned char cb_subtype);
diff --git a/source/blender/python/mathutils/mathutils_Quaternion.c b/source/blender/python/mathutils/mathutils_Quaternion.c
index b0b818faaa0..e13136057c8 100644
--- a/source/blender/python/mathutils/mathutils_Quaternion.c
+++ b/source/blender/python/mathutils/mathutils_Quaternion.c
@@ -1246,7 +1246,7 @@ PyTypeObject quaternion_Type = {
* (i.e. it was allocated elsewhere by MEM_mallocN())
* pass Py_NEW - if vector is not a WRAPPER and managed by PYTHON
* (i.e. it must be created here with PyMEM_malloc())*/
-PyObject *Quaternion_CreatePyObject(float *quat, int type, PyTypeObject *base_type)
+PyObject *Quaternion_CreatePyObject(float quat[4], int type, PyTypeObject *base_type)
{
QuaternionObject *self;
diff --git a/source/blender/python/mathutils/mathutils_Quaternion.h b/source/blender/python/mathutils/mathutils_Quaternion.h
index be3566934a4..36036c6d3fa 100644
--- a/source/blender/python/mathutils/mathutils_Quaternion.h
+++ b/source/blender/python/mathutils/mathutils_Quaternion.h
@@ -40,7 +40,7 @@ typedef struct {
* blender (stored in blend_data). This is an either/or struct not both */
/* prototypes */
-PyObject *Quaternion_CreatePyObject(float *quat, int type, PyTypeObject *base_type);
+PyObject *Quaternion_CreatePyObject(float quat[4], int type, PyTypeObject *base_type);
PyObject *Quaternion_CreatePyObject_cb(PyObject *cb_user,
unsigned char cb_type, unsigned char cb_subtype);
diff --git a/source/blender/python/mathutils/mathutils_Vector.c b/source/blender/python/mathutils/mathutils_Vector.c
index 8a5a8446ac6..6b2da9ca593 100644
--- a/source/blender/python/mathutils/mathutils_Vector.c
+++ b/source/blender/python/mathutils/mathutils_Vector.c
@@ -1853,7 +1853,7 @@ static PyObject *Vector_neg(VectorObject *self)
}
/*------------------------vec_magnitude_nosqrt (internal) - for comparing only */
-static double vec_magnitude_nosqrt(float *data, int size)
+static double vec_magnitude_nosqrt(const float *data, int size)
{
/* return (double)sqrt(dot);*/
/* warning, line above removed because we are not using the length,
@@ -2940,10 +2940,10 @@ PyObject *Vector_CreatePyObject_cb(PyObject *cb_user, int size, unsigned char cb
return (PyObject *)self;
}
-PyObject *Vector_CreatePyObject_alloc(float *vec, const int size, PyTypeObject *base_type)
+PyObject *Vector_CreatePyObject_alloc(const float *vec, const int size, PyTypeObject *base_type)
{
VectorObject *vect_ob;
- vect_ob = (VectorObject *)Vector_CreatePyObject(vec, size, Py_WRAP, base_type);
+ vect_ob = (VectorObject *)Vector_CreatePyObject((float *)vec, size, Py_WRAP, base_type);
vect_ob->wrapped = Py_NEW;
return (PyObject *)vect_ob;
diff --git a/source/blender/python/mathutils/mathutils_Vector.h b/source/blender/python/mathutils/mathutils_Vector.h
index 18d89e73734..2074270670a 100644
--- a/source/blender/python/mathutils/mathutils_Vector.h
+++ b/source/blender/python/mathutils/mathutils_Vector.h
@@ -41,6 +41,6 @@ typedef struct {
PyObject *Vector_CreatePyObject(float *vec, const int size, const int type, PyTypeObject *base_type);
PyObject *Vector_CreatePyObject_cb(PyObject *user, int size,
unsigned char cb_type, unsigned char subtype);
-PyObject *Vector_CreatePyObject_alloc(float *vec, const int size, PyTypeObject *base_type);
+PyObject *Vector_CreatePyObject_alloc(const float *vec, const int size, PyTypeObject *base_type);
-#endif /* __MATHUTILS_VECTOR_H__ */
+#endif /* __MATHUTILS_VECTOR_H__ */
diff --git a/source/blender/render/extern/include/RE_pipeline.h b/source/blender/render/extern/include/RE_pipeline.h
index 19757ff083a..79826a63690 100644
--- a/source/blender/render/extern/include/RE_pipeline.h
+++ b/source/blender/render/extern/include/RE_pipeline.h
@@ -249,7 +249,7 @@ void RE_MergeFullSample(struct Render *re, struct Main *bmain, struct Scene *sce
/* ancient stars function... go away! */
void RE_make_stars(struct Render *re, struct Scene *scenev3d, void (*initfunc)(void),
- void (*vertexfunc)(float *), void (*termfunc)(void));
+ void (*vertexfunc)(const float *), void (*termfunc)(void));
/* display and event callbacks */
void RE_display_init_cb (struct Render *re, void *handle, void (*f)(void *handle, RenderResult *rr));
diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c
index 6ab61343c08..18f658fb169 100644
--- a/source/blender/render/intern/source/convertblender.c
+++ b/source/blender/render/intern/source/convertblender.c
@@ -167,7 +167,7 @@ static HaloRen *initstar(Render *re, ObjectRen *obr, const float vec[3], float h
*/
void RE_make_stars(Render *re, Scene *scenev3d, void (*initfunc)(void),
- void (*vertexfunc)(float *), void (*termfunc)(void))
+ void (*vertexfunc)(const float *), void (*termfunc)(void))
{
extern unsigned char hash[512];
ObjectRen *obr= NULL;