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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2015-10-11 02:44:47 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2015-10-11 03:15:44 +0300
commit6e66ddf5ed29c2593dbd25d4fd48b36c2e68e411 (patch)
tree227df0cc568ab72f9b350b9cccb1700b727744c4 /source
parentbb580664e6eae0714ec54f1cefeec5c5560150fc (diff)
Fix warnings and remove casts by adding copy_vx_vx_uchar() functions.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/DerivedMesh.c6
-rw-r--r--source/blender/blenkernel/intern/cdderivedmesh.c6
-rw-r--r--source/blender/blenkernel/intern/editderivedmesh.c20
-rw-r--r--source/blender/blenkernel/intern/subsurf_ccg.c10
-rw-r--r--source/blender/blenlib/BLI_math_vector.h5
-rw-r--r--source/blender/blenlib/intern/math_color_blend_inline.c50
-rw-r--r--source/blender/blenlib/intern/math_vector_inline.c24
-rw-r--r--source/blender/blenloader/intern/versioning_260.c2
-rw-r--r--source/blender/editors/space_view3d/drawmesh.c2
-rw-r--r--source/blender/editors/space_view3d/drawobject.c2
-rw-r--r--source/blender/imbuf/intern/stereoimbuf.c16
-rw-r--r--source/blender/render/intern/source/bake.c6
12 files changed, 87 insertions, 62 deletions
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index e71cfca4e5b..4cf9885c716 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -1561,8 +1561,8 @@ void DM_update_weight_mcol(
ml = mloop + mp->loopstart;
for (j = 0; j < mp->totloop; j++, ml++, l_index++) {
- copy_v4_v4_char((char *)&wtcol_l[l_index],
- (char *)&wtcol_v[ml->v]);
+ copy_v4_v4_uchar(&wtcol_l[l_index][0],
+ &wtcol_v[ml->v][0]);
}
}
MEM_freeN(wtcol_v);
@@ -3453,7 +3453,7 @@ void DM_draw_attrib_vertex(DMVertexAttribs *attribs, int a, int index, int vert,
if (attribs->mcol[b].array) {
const MLoopCol *cp = &attribs->mcol[b].array[loop];
- copy_v4_v4_char((char *)col, &cp->r);
+ copy_v4_v4_uchar(col, &cp->r);
}
else {
col[0] = 0; col[1] = 0; col[2] = 0; col[3] = 0;
diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c
index 7c3287e6934..989e5e3a624 100644
--- a/source/blender/blenkernel/intern/cdderivedmesh.c
+++ b/source/blender/blenkernel/intern/cdderivedmesh.c
@@ -967,7 +967,7 @@ static void cdDM_drawMappedFacesGLSL(
int *mat_orig_to_new;
int tot_active_mat;
GPUBuffer *buffer = NULL;
- char *varray;
+ unsigned char *varray;
size_t max_element_size = 0;
int tot_loops = 0;
@@ -1072,7 +1072,7 @@ static void cdDM_drawMappedFacesGLSL(
if (matconv[i].attribs.mcol[b].array) {
const MLoopCol *mloopcol = matconv[i].attribs.mcol[b].array;
for (j = 0; j < mpoly->totloop; j++)
- copy_v4_v4_char((char *)&varray[offset + j * max_element_size], &mloopcol[mpoly->loopstart + j].r);
+ copy_v4_v4_uchar(&varray[offset + j * max_element_size], &mloopcol[mpoly->loopstart + j].r);
offset += sizeof(unsigned char) * 4;
}
}
@@ -1482,7 +1482,7 @@ static void cdDM_buffer_copy_mcol(
for (i = 0; i < totpoly; i++, mpoly++) {
for (j = 0; j < mpoly->totloop; j++) {
- copy_v3_v3_char((char *)&varray[start], &mloopcol[mpoly->loopstart + j].r);
+ copy_v3_v3_uchar(&varray[start], &mloopcol[mpoly->loopstart + j].r);
start += 3;
}
}
diff --git a/source/blender/blenkernel/intern/editderivedmesh.c b/source/blender/blenkernel/intern/editderivedmesh.c
index 840935c090b..88ae279050c 100644
--- a/source/blender/blenkernel/intern/editderivedmesh.c
+++ b/source/blender/blenkernel/intern/editderivedmesh.c
@@ -1248,7 +1248,7 @@ static void emdm_pass_attrib_vertex_glsl(const DMVertexAttribs *attribs, const B
GLubyte col[4];
if (attribs->mcol[i].em_offset != -1) {
const MLoopCol *cp = BM_ELEM_CD_GET_VOID_P(loop, attribs->mcol[i].em_offset);
- copy_v4_v4_char((char *)col, &cp->r);
+ copy_v4_v4_uchar(col, &cp->r);
}
else {
col[0] = 0; col[1] = 0; col[2] = 0; col[3] = 0;
@@ -2170,8 +2170,8 @@ static void statvis_calc_overhang(
rgb_float_to_uchar(r_face_colors[index], fcol);
}
else {
- unsigned char *fallback = is_max ? col_fallback_max : col_fallback;
- copy_v4_v4_char((char *)r_face_colors[index], (const char *)fallback);
+ const unsigned char *fallback = is_max ? col_fallback_max : col_fallback;
+ copy_v4_v4_uchar(r_face_colors[index], fallback);
}
}
}
@@ -2210,7 +2210,7 @@ static void statvis_calc_thickness(
struct BMLoop *(*looptris)[3] = em->looptris;
/* fallback */
- const char col_fallback[4] = {64, 64, 64, 255};
+ const unsigned char col_fallback[4] = {64, 64, 64, 255};
struct BMBVHTree *bmtree;
@@ -2305,7 +2305,7 @@ static void statvis_calc_thickness(
rgb_float_to_uchar(r_face_colors[i], fcol);
}
else {
- copy_v4_v4_char((char *)r_face_colors[i], (const char *)col_fallback);
+ copy_v4_v4_uchar(r_face_colors[i], col_fallback);
}
}
}
@@ -2357,7 +2357,7 @@ static void statvis_calc_intersect(
index = BM_elem_index_get(f_hit);
- copy_v3_v3_char((char *)r_face_colors[index], (const char *)col);
+ copy_v3_v3_uchar(r_face_colors[index], col);
}
}
MEM_freeN(overlap);
@@ -2382,7 +2382,7 @@ static void statvis_calc_distort(
const float minmax_irange = 1.0f / (max - min);
/* fallback */
- const char col_fallback[4] = {64, 64, 64, 255};
+ const unsigned char col_fallback[4] = {64, 64, 64, 255};
/* now convert into global space */
BM_ITER_MESH_INDEX (f, &iter, bm, BM_FACES_OF_MESH, index) {
@@ -2431,7 +2431,7 @@ static void statvis_calc_distort(
rgb_float_to_uchar(r_face_colors[index], fcol);
}
else {
- copy_v4_v4_char((char *)r_face_colors[index], (const char *)col_fallback);
+ copy_v4_v4_uchar(r_face_colors[index], col_fallback);
}
}
}
@@ -2453,7 +2453,7 @@ static void statvis_calc_sharp(
int i;
/* fallback */
- const char col_fallback[4] = {64, 64, 64, 255};
+ const unsigned char col_fallback[4] = {64, 64, 64, 255};
(void)vertexCos; /* TODO */
@@ -2481,7 +2481,7 @@ static void statvis_calc_sharp(
rgb_float_to_uchar(r_vert_colors[i], fcol);
}
else {
- copy_v4_v4_char((char *)r_vert_colors[i], (const char *)col_fallback);
+ copy_v4_v4_uchar(r_vert_colors[i], col_fallback);
}
}
}
diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c
index 509ca9cdd19..f351ce0ff41 100644
--- a/source/blender/blenkernel/intern/subsurf_ccg.c
+++ b/source/blender/blenkernel/intern/subsurf_ccg.c
@@ -2167,7 +2167,7 @@ static void ccgDM_buffer_copy_color(
CCGDerivedMesh *ccgdm = (CCGDerivedMesh *) dm;
CCGSubSurf *ss = ccgdm->ss;
CCGKey key;
- const char *mloopcol = user_data;
+ const unsigned char *mloopcol = user_data;
int gridSize = ccgSubSurf_getGridSize(ss);
int gridFaces = gridSize - 1;
int i, totface = ccgSubSurf_getNumFaces(ss);
@@ -2184,10 +2184,10 @@ static void ccgDM_buffer_copy_color(
for (S = 0; S < numVerts; S++) {
for (y = 0; y < gridFaces; y++) {
for (x = 0; x < gridFaces; x++) {
- copy_v3_v3_char((char *)&varray[start + 0], &mloopcol[iface * 16 + 0]);
- copy_v3_v3_char((char *)&varray[start + 3], &mloopcol[iface * 16 + 12]);
- copy_v3_v3_char((char *)&varray[start + 6], &mloopcol[iface * 16 + 8]);
- copy_v3_v3_char((char *)&varray[start + 9], &mloopcol[iface * 16 + 4]);
+ copy_v3_v3_uchar(&varray[start + 0], &mloopcol[iface * 16 + 0]);
+ copy_v3_v3_uchar(&varray[start + 3], &mloopcol[iface * 16 + 12]);
+ copy_v3_v3_uchar(&varray[start + 6], &mloopcol[iface * 16 + 8]);
+ copy_v3_v3_uchar(&varray[start + 9], &mloopcol[iface * 16 + 4]);
start += 12;
iface++;
diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h
index fc0dd76b003..01c00ddb48e 100644
--- a/source/blender/blenlib/BLI_math_vector.h
+++ b/source/blender/blenlib/BLI_math_vector.h
@@ -61,11 +61,14 @@ MINLINE void swap_v2_v2(float a[2], float b[2]);
MINLINE void swap_v3_v3(float a[3], float b[3]);
MINLINE void swap_v4_v4(float a[4], float b[4]);
+/* unsigned char */
+MINLINE void copy_v2_v2_uchar(unsigned char r[2], const unsigned char a[2]);
+MINLINE void copy_v3_v3_uchar(unsigned char r[3], const unsigned char a[3]);
+MINLINE void copy_v4_v4_uchar(unsigned char r[4], const unsigned char a[4]);
/* char */
MINLINE void copy_v2_v2_char(char r[2], const char a[2]);
MINLINE void copy_v3_v3_char(char r[3], const char a[3]);
MINLINE void copy_v4_v4_char(char r[4], const char a[4]);
-
/* short */
MINLINE void copy_v2_v2_short(short r[2], const short a[2]);
MINLINE void copy_v3_v3_short(short r[3], const short a[3]);
diff --git a/source/blender/blenlib/intern/math_color_blend_inline.c b/source/blender/blenlib/intern/math_color_blend_inline.c
index 88be86aa1c2..048ab71c6dc 100644
--- a/source/blender/blenlib/intern/math_color_blend_inline.c
+++ b/source/blender/blenlib/intern/math_color_blend_inline.c
@@ -72,7 +72,7 @@ MINLINE void blend_color_mix_byte(unsigned char dst[4], const unsigned char src1
}
else {
/* no op */
- copy_v4_v4_char((char *)dst, (char *)src1);
+ copy_v4_v4_uchar(dst, src1);
}
}
@@ -94,7 +94,7 @@ MINLINE void blend_color_add_byte(unsigned char dst[4], const unsigned char src1
}
else {
/* no op */
- copy_v4_v4_char((char *)dst, (char *)src1);
+ copy_v4_v4_uchar(dst, src1);
}
}
@@ -116,7 +116,7 @@ MINLINE void blend_color_sub_byte(unsigned char dst[4], const unsigned char src1
}
else {
/* no op */
- copy_v4_v4_char((char *)dst, (char *)src1);
+ copy_v4_v4_uchar(dst, src1);
}
}
@@ -139,7 +139,7 @@ MINLINE void blend_color_mul_byte(unsigned char dst[4], const unsigned char src1
}
else {
/* no op */
- copy_v4_v4_char((char *)dst, (char *)src1);
+ copy_v4_v4_uchar(dst, src1);
}
}
@@ -162,7 +162,7 @@ MINLINE void blend_color_lighten_byte(unsigned char dst[4], const unsigned char
}
else {
/* no op */
- copy_v4_v4_char((char *)dst, (char *)src1);
+ copy_v4_v4_uchar(dst, src1);
}
}
@@ -185,7 +185,7 @@ MINLINE void blend_color_darken_byte(unsigned char dst[4], const unsigned char s
}
else {
/* no op */
- copy_v4_v4_char((char *)dst, (char *)src1);
+ copy_v4_v4_uchar(dst, src1);
}
}
@@ -202,7 +202,7 @@ MINLINE void blend_color_erase_alpha_byte(unsigned char dst[4], const unsigned c
}
else {
/* no op */
- copy_v4_v4_char((char *)dst, (char *)src1);
+ copy_v4_v4_uchar(dst, src1);
}
}
@@ -219,7 +219,7 @@ MINLINE void blend_color_add_alpha_byte(unsigned char dst[4], const unsigned cha
}
else {
/* no op */
- copy_v4_v4_char((char *)dst, (char *)src1);
+ copy_v4_v4_uchar(dst, src1);
}
}
@@ -244,7 +244,7 @@ MINLINE void blend_color_overlay_byte(unsigned char dst[4], unsigned const char
}
else {
/* no op */
- copy_v4_v4_char((char *)dst, (char *)src1);
+ copy_v4_v4_uchar(dst, src1);
}
}
@@ -270,7 +270,7 @@ MINLINE void blend_color_hardlight_byte(unsigned char dst[4], unsigned const cha
}
else {
/* no op */
- copy_v4_v4_char((char *)dst, (char *)src1);
+ copy_v4_v4_uchar(dst, src1);
}
}
@@ -289,7 +289,7 @@ MINLINE void blend_color_burn_byte(unsigned char dst[4], unsigned const char src
}
else {
/* no op */
- copy_v4_v4_char((char *)dst, (char *)src1);
+ copy_v4_v4_uchar(dst, src1);
}
}
@@ -308,7 +308,7 @@ MINLINE void blend_color_linearburn_byte(unsigned char dst[4], unsigned const ch
}
else {
/* no op */
- copy_v4_v4_char((char *)dst, (char *)src1);
+ copy_v4_v4_uchar(dst, src1);
}
}
@@ -327,7 +327,7 @@ MINLINE void blend_color_dodge_byte(unsigned char dst[4], unsigned const char sr
}
else {
/* no op */
- copy_v4_v4_char((char *)dst, (char *)src1);
+ copy_v4_v4_uchar(dst, src1);
}
}
@@ -345,7 +345,7 @@ MINLINE void blend_color_screen_byte(unsigned char dst[4], unsigned const char s
}
else {
/* no op */
- copy_v4_v4_char((char *)dst, (char *)src1);
+ copy_v4_v4_uchar(dst, src1);
}
}
@@ -371,7 +371,7 @@ MINLINE void blend_color_softlight_byte(unsigned char dst[4], unsigned const cha
}
else {
/* no op */
- copy_v4_v4_char((char *)dst, (char *)src1);
+ copy_v4_v4_uchar(dst, src1);
}
}
@@ -397,7 +397,7 @@ MINLINE void blend_color_pinlight_byte(unsigned char dst[4], unsigned const char
}
else {
/* no op */
- copy_v4_v4_char((char *)dst, (char *)src1);
+ copy_v4_v4_uchar(dst, src1);
}
}
@@ -423,7 +423,7 @@ MINLINE void blend_color_linearlight_byte(unsigned char dst[4], unsigned const c
}
else {
/* no op */
- copy_v4_v4_char((char *)dst, (char *)src1);
+ copy_v4_v4_uchar(dst, src1);
}
}
@@ -455,7 +455,7 @@ MINLINE void blend_color_vividlight_byte(unsigned char dst[4], unsigned const ch
}
else {
/* no op */
- copy_v4_v4_char((char *)dst, (char *)src1);
+ copy_v4_v4_uchar(dst, src1);
}
}
@@ -475,7 +475,7 @@ MINLINE void blend_color_difference_byte(unsigned char dst[4], unsigned const ch
}
else {
/* no op */
- copy_v4_v4_char((char *)dst, (char *)src1);
+ copy_v4_v4_uchar(dst, src1);
}
}
@@ -494,7 +494,7 @@ MINLINE void blend_color_exclusion_byte(unsigned char dst[4], unsigned const cha
}
else {
/* no op */
- copy_v4_v4_char((char *)dst, (char *)src1);
+ copy_v4_v4_uchar(dst, src1);
}
}
@@ -521,7 +521,7 @@ MINLINE void blend_color_color_byte(unsigned char dst[4], unsigned const char sr
}
else {
/* no op */
- copy_v4_v4_char((char *)dst, (char *)src1);
+ copy_v4_v4_uchar(dst, src1);
}
}
@@ -547,7 +547,7 @@ MINLINE void blend_color_hue_byte(unsigned char dst[4], unsigned const char src1
}
else {
/* no op */
- copy_v4_v4_char((char *)dst, (char *)src1);
+ copy_v4_v4_uchar(dst, src1);
}
}
@@ -575,7 +575,7 @@ MINLINE void blend_color_saturation_byte(unsigned char dst[4], unsigned const ch
}
else {
/* no op */
- copy_v4_v4_char((char *)dst, (char *)src1);
+ copy_v4_v4_uchar(dst, src1);
}
}
@@ -601,7 +601,7 @@ MINLINE void blend_color_luminosity_byte(unsigned char dst[4], unsigned const ch
}
else {
/* no op */
- copy_v4_v4_char((char *)dst, (char *)src1);
+ copy_v4_v4_uchar(dst, src1);
}
}
@@ -621,7 +621,7 @@ MINLINE void blend_color_interpolate_byte(unsigned char dst[4], const unsigned c
dst[3] = (unsigned char)divide_round_i(tmp, 255);
}
else {
- copy_v4_v4_char((char *)dst, (char *)src1);
+ copy_v4_v4_uchar(dst, src1);
}
}
diff --git a/source/blender/blenlib/intern/math_vector_inline.c b/source/blender/blenlib/intern/math_vector_inline.c
index c21b09748c9..e625ac18685 100644
--- a/source/blender/blenlib/intern/math_vector_inline.c
+++ b/source/blender/blenlib/intern/math_vector_inline.c
@@ -97,7 +97,29 @@ MINLINE void copy_v4_fl(float r[4], float f)
r[3] = f;
}
-/* short */
+/* unsigned char */
+MINLINE void copy_v2_v2_uchar(unsigned char r[2], const unsigned char a[2])
+{
+ r[0] = a[0];
+ r[1] = a[1];
+}
+
+MINLINE void copy_v3_v3_uchar(unsigned char r[3], const unsigned char a[3])
+{
+ r[0] = a[0];
+ r[1] = a[1];
+ r[2] = a[2];
+}
+
+MINLINE void copy_v4_v4_uchar(unsigned char r[4], const unsigned char a[4])
+{
+ r[0] = a[0];
+ r[1] = a[1];
+ r[2] = a[2];
+ r[3] = a[3];
+}
+
+/* char */
MINLINE void copy_v2_v2_char(char r[2], const char a[2])
{
r[0] = a[0];
diff --git a/source/blender/blenloader/intern/versioning_260.c b/source/blender/blenloader/intern/versioning_260.c
index 25074effaab..947f945edcc 100644
--- a/source/blender/blenloader/intern/versioning_260.c
+++ b/source/blender/blenloader/intern/versioning_260.c
@@ -343,7 +343,7 @@ static void do_versions_mesh_mloopcol_swap_2_62_1(Mesh *me)
if (layer->type == CD_MLOOPCOL) {
mloopcol = (MLoopCol *)layer->data;
for (i = 0; i < me->totloop; i++, mloopcol++) {
- SWAP(char, mloopcol->r, mloopcol->b);
+ SWAP(unsigned char, mloopcol->r, mloopcol->b);
}
}
}
diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c
index d806dfa015a..c40330a2f23 100644
--- a/source/blender/editors/space_view3d/drawmesh.c
+++ b/source/blender/editors/space_view3d/drawmesh.c
@@ -664,7 +664,7 @@ static void update_tface_color_layer(DerivedMesh *dm, bool use_mcol)
else if (ma && (ma->shade_flag & MA_OBCOLOR)) {
int loop_index = mp->loopstart;
for (j = 0; j < mp->totloop; j++, loop_index++) {
- copy_v3_v3_char(&finalCol[loop_index].r, (char *)Gtexdraw.obcol);
+ copy_v3_v3_uchar(&finalCol[loop_index].r, Gtexdraw.obcol);
}
copy_mode = COPY_PREV;
}
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index cd3a4a31fed..8e664d74451 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -829,7 +829,7 @@ void view3d_cached_text_draw_add(const float co[3],
BLI_LINKS_PREPEND(g_v3d_strings[g_v3d_string_level], vos);
copy_v3_v3(vos->vec, co);
- copy_v4_v4_char((char *)vos->col.ub, (const char *)col);
+ copy_v4_v4_uchar(vos->col.ub, col);
vos->xoffs = xoffs;
vos->flag = flag;
vos->str_len = str_len;
diff --git a/source/blender/imbuf/intern/stereoimbuf.c b/source/blender/imbuf/intern/stereoimbuf.c
index 3b9da639a86..13a15f101e7 100644
--- a/source/blender/imbuf/intern/stereoimbuf.c
+++ b/source/blender/imbuf/intern/stereoimbuf.c
@@ -343,7 +343,7 @@ static void imb_stereo3d_write_interlace(Stereo3DData *s3d, enum eStereo3dInterl
};
char i = (char) swap;
for (x = 0; x < width; x++, from[0] += 3, from[1] += 3, to += 3) {
- copy_v3_v3_char((char *)to, (char *)from[i]);
+ copy_v3_v3_uchar(to, from[i]);
i = !i;
}
}
@@ -357,7 +357,7 @@ static void imb_stereo3d_write_interlace(Stereo3DData *s3d, enum eStereo3dInterl
};
char i = (char) swap;
for (x = 0; x < width; x++, from[0] += 4, from[1] += 4, to += 4) {
- copy_v4_v4_char((char *)to, (char *)from[i]);
+ copy_v4_v4_uchar(to, from[i]);
i = !i;
}
}
@@ -392,7 +392,7 @@ static void imb_stereo3d_write_interlace(Stereo3DData *s3d, enum eStereo3dInterl
};
char j = i;
for (x = 0; x < width; x++, from[0] += 3, from[1] += 3, to += 3) {
- copy_v3_v3_char((char *)to, (char *)from[j]);
+ copy_v3_v3_uchar(to, from[j]);
j = !j;
}
i = !i;
@@ -408,7 +408,7 @@ static void imb_stereo3d_write_interlace(Stereo3DData *s3d, enum eStereo3dInterl
};
char j = i;
for (x = 0; x < width; x++, from[0] += 4, from[1] += 4, to += 4) {
- copy_v4_v4_char((char *)to, (char *)from[j]);
+ copy_v4_v4_uchar(to, from[j]);
j = !j;
}
i = !i;
@@ -1035,7 +1035,7 @@ static void imb_stereo3d_read_interlace(Stereo3DData *s3d, enum eStereo3dInterla
};
char i = (char) swap;
for (x = 0; x < width; x++, from += 3, to[0] += 3, to[1] += 3) {
- copy_v3_v3_char((char *)to[i], (char *)from);
+ copy_v3_v3_uchar(to[i], from);
i = !i;
}
}
@@ -1049,7 +1049,7 @@ static void imb_stereo3d_read_interlace(Stereo3DData *s3d, enum eStereo3dInterla
};
char i = (char) swap;
for (x = 0; x < width; x++, from += 4, to[0] += 4, to[1] += 4) {
- copy_v4_v4_char((char *)to[i], (char *)from);
+ copy_v4_v4_uchar(to[i], from);
i = !i;
}
}
@@ -1084,7 +1084,7 @@ static void imb_stereo3d_read_interlace(Stereo3DData *s3d, enum eStereo3dInterla
};
char j = i;
for (x = 0; x < width; x++, from += 3, to[0] += 3, to[1] += 3) {
- copy_v3_v3_char((char *)to[j], (char *)from);
+ copy_v3_v3_uchar(to[j], from);
j = !j;
}
i = !i;
@@ -1100,7 +1100,7 @@ static void imb_stereo3d_read_interlace(Stereo3DData *s3d, enum eStereo3dInterla
};
char j = i;
for (x = 0; x < width; x++, from += 4, to[0] += 4, to[1] += 4) {
- copy_v4_v4_char((char *)to[j], (char *)from);
+ copy_v4_v4_uchar(to[j], from);
j = !j;
}
i = !i;
diff --git a/source/blender/render/intern/source/bake.c b/source/blender/render/intern/source/bake.c
index 0210bec5ab4..30036c27b5d 100644
--- a/source/blender/render/intern/source/bake.c
+++ b/source/blender/render/intern/source/bake.c
@@ -320,7 +320,7 @@ static void bake_shade(void *handle, Object *ob, ShadeInput *shi, int UNUSED(qua
}
else {
unsigned char *imcol = (unsigned char *)(bs->rect + bs->rectx * y + x);
- copy_v4_v4_char((char *)imcol, (char *)col);
+ copy_v4_v4_uchar(imcol, col);
}
}
@@ -375,8 +375,8 @@ 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);
- copy_v4_v4_char(imcol, (char *)col);
+ unsigned char *imcol = (unsigned char *)(bs->rect + bs->rectx * y + x);
+ copy_v4_v4_uchar(imcol, col);
}
}
if (bs->rect_mask) {