[Bf-blender-cvs] [b9db39a] multiview: From review: all chars in blender are unsigned, no need special math utils function just cast/call the _char functions

Dalai Felinto noreply at git.blender.org
Wed Nov 26 19:45:13 CET 2014


Commit: b9db39ab5e1f7b1c77b299e1301ee327ab73971f
Author: Dalai Felinto
Date:   Wed Nov 26 11:27:34 2014 -0200
Branches: multiview
https://developer.blender.org/rBb9db39ab5e1f7b1c77b299e1301ee327ab73971f

>From review: all chars in blender are unsigned, no need special  math
utils function just cast/call the _char functions

===================================================================

M	source/blender/blenlib/BLI_math_vector.h
M	source/blender/blenlib/intern/math_vector_inline.c
M	source/blender/imbuf/intern/stereoimbuf.c

===================================================================

diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h
index 96db03e..6885a5a 100644
--- a/source/blender/blenlib/BLI_math_vector.h
+++ b/source/blender/blenlib/BLI_math_vector.h
@@ -66,11 +66,6 @@ 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]);
 
-/* 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]);
-
 /* 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_vector_inline.c b/source/blender/blenlib/intern/math_vector_inline.c
index 1ffd80a..da9d5bd 100644
--- a/source/blender/blenlib/intern/math_vector_inline.c
+++ b/source/blender/blenlib/intern/math_vector_inline.c
@@ -97,7 +97,7 @@ MINLINE void copy_v4_fl(float r[4], float f)
 	r[3] = f;
 }
 
-/* char */
+/* short */
 MINLINE void copy_v2_v2_char(char r[2], const char a[2])
 {
 	r[0] = a[0];
@@ -119,28 +119,6 @@ MINLINE void copy_v4_v4_char(char r[4], const char a[4])
 	r[3] = a[3];
 }
 
-/* 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];
-}
-
 /* short */
 MINLINE void zero_v3_int(int r[3])
 {
diff --git a/source/blender/imbuf/intern/stereoimbuf.c b/source/blender/imbuf/intern/stereoimbuf.c
index 0df2890..3d64222 100644
--- a/source/blender/imbuf/intern/stereoimbuf.c
+++ b/source/blender/imbuf/intern/stereoimbuf.c
@@ -343,7 +343,7 @@ static void imb_stereo_write_interlace(Stereo3DData *s3d, enum eStereo3dInterlac
 						};
 						char i = (char) swap;
 						for (x = 0; x < width; x++, from[0] += 3, from[1] += 3, to += 3) {
-							copy_v3_v3_uchar(to, from[i]);
+							copy_v3_v3_char((char *)to, (char *)from[i]);
 							i = !i;
 						}
 					}
@@ -357,7 +357,7 @@ static void imb_stereo_write_interlace(Stereo3DData *s3d, enum eStereo3dInterlac
 						};
 						char i = (char) swap;
 						for (x = 0; x < width; x++, from[0] += 4, from[1] += 4, to += 4) {
-							copy_v4_v4_uchar(to, from[i]);
+							copy_v4_v4_char((char *)to, (char *)from[i]);
 							i = !i;
 						}
 					}
@@ -392,7 +392,7 @@ static void imb_stereo_write_interlace(Stereo3DData *s3d, enum eStereo3dInterlac
 						};
 						char j = i;
 						for (x = 0; x < width; x++, from[0] += 3, from[1] += 3, to += 3) {
-							copy_v3_v3_uchar(to, from[j]);
+							copy_v3_v3_char((char *)to, (char *)from[j]);
 							j = !j;
 						}
 						i = !i;
@@ -408,7 +408,7 @@ static void imb_stereo_write_interlace(Stereo3DData *s3d, enum eStereo3dInterlac
 						};
 						char j = i;
 						for (x = 0; x < width; x++, from[0] += 4, from[1] += 4, to += 4) {
-							copy_v4_v4_uchar(to, from[j]);
+							copy_v4_v4_char((char *)to, (char *)from[j]);
 							j = !j;
 						}
 						i = !i;
@@ -1037,7 +1037,7 @@ static void imb_stereo_read_interlace(Stereo3DData *s3d, enum eStereo3dInterlace
 						};
 						char i = (char) swap;
 						for (x = 0; x < width; x++, from += 3, to[0] += 3, to[1] += 3) {
-							copy_v3_v3_uchar(to[i], from);
+							copy_v3_v3_char((char *)to[i], (char *)from);
 							i = !i;
 						}
 					}
@@ -1051,7 +1051,7 @@ static void imb_stereo_read_interlace(Stereo3DData *s3d, enum eStereo3dInterlace
 						};
 						char i = (char) swap;
 						for (x = 0; x < width; x++, from += 4, to[0] += 4, to[1] += 4) {
-							copy_v4_v4_uchar(to[i], from);
+							copy_v4_v4_char((char *)to[i], (char *)from);
 							i = !i;
 						}
 					}
@@ -1086,7 +1086,7 @@ static void imb_stereo_read_interlace(Stereo3DData *s3d, enum eStereo3dInterlace
 						};
 						char j = i;
 						for (x = 0; x < width; x++, from += 3, to[0] += 3, to[1] += 3) {
-							copy_v3_v3_uchar(to[j], from);
+							copy_v3_v3_char((char *)to[j], (char *)from);
 							j = !j;
 						}
 						i = !i;
@@ -1102,7 +1102,7 @@ static void imb_stereo_read_interlace(Stereo3DData *s3d, enum eStereo3dInterlace
 						};
 						char j = i;
 						for (x = 0; x < width; x++, from += 4, to[0] += 4, to[1] += 4) {
-							copy_v4_v4_uchar(to[j], from);
+							copy_v4_v4_char((char *)to[j], (char *)from);
 							j = !j;
 						}
 						i = !i;




More information about the Bf-blender-cvs mailing list