[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11750] branches/soc-2007-hcube/intern/ tinySND/intern/SND_DataMultiplexer.cpp: better type casts

Csaba Hruska csaba.hruska at gmail.com
Mon Aug 20 21:25:46 CEST 2007


Revision: 11750
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11750
Author:   hcube
Date:     2007-08-20 21:25:45 +0200 (Mon, 20 Aug 2007)

Log Message:
-----------
better type casts

Modified Paths:
--------------
    branches/soc-2007-hcube/intern/tinySND/intern/SND_DataMultiplexer.cpp

Modified: branches/soc-2007-hcube/intern/tinySND/intern/SND_DataMultiplexer.cpp
===================================================================
--- branches/soc-2007-hcube/intern/tinySND/intern/SND_DataMultiplexer.cpp	2007-08-20 19:14:03 UTC (rev 11749)
+++ branches/soc-2007-hcube/intern/tinySND/intern/SND_DataMultiplexer.cpp	2007-08-20 19:25:45 UTC (rev 11750)
@@ -155,7 +155,7 @@
 	{
 		// float -> signed char
 		int j;
-		char *dstBuffer = static_cast<char *>((void*)buffer);
+		signed char *dstBuffer = static_cast<signed char *>((void*)buffer);
 		
 	    for( i = 0 ; i < framesNum ; ++i )
 	    {
@@ -163,7 +163,7 @@
 			{
 			    if( mSoundBuffers[j] != 0 )
 			    {
-					dstBuffer[0] = (char)(128.0 * mSoundBuffers[j][0]);
+					dstBuffer[0] = (signed char)(128.0 * mSoundBuffers[j][0]);
 					++mSoundBuffers[j];
 			    }
 				else
@@ -178,7 +178,7 @@
 	{
 		// float -> signed short
 		int j;
-		short *dstBuffer = static_cast<short *>((void*)buffer);
+		signed short *dstBuffer = static_cast<signed short *>((void*)buffer);
 		
 	    for( i = 0 ; i < framesNum ; ++i )
 	    {
@@ -186,7 +186,7 @@
 			{
 			    if( mSoundBuffers[j] != 0 )
 			    {
-					dstBuffer[0] = (short)(32768.0 * mSoundBuffers[j][0]);
+					dstBuffer[0] = (signed short)(32768.0 * mSoundBuffers[j][0]);
 					++mSoundBuffers[j];
 			    }
 				else
@@ -201,7 +201,7 @@
 	{
 		// float -> signed int
 		int j;
-		short *dstBuffer = static_cast<short *>((void*)buffer);
+		signed int *dstBuffer = static_cast<signed int *>((void*)buffer);
 		
 	    for( i = 0 ; i < framesNum ; ++i )
 	    {
@@ -209,7 +209,7 @@
 			{
 			    if( mSoundBuffers[j] != 0 )
 			    {
-					dstBuffer[0] = (int)(2147483648.0 * mSoundBuffers[j][0]);
+					dstBuffer[0] = (signed int)(2147483648.0 * mSoundBuffers[j][0]);
 					++mSoundBuffers[j];
 			    }
 				else





More information about the Bf-blender-cvs mailing list