diff Plugins/Input/console/Nes_Vrc6.cpp @ 256:84aabc053b6e trunk

[svn] C++ warning fixes by external contractor Stephen Bennett.
author chainsaw
date Sun, 04 Dec 2005 08:49:53 -0800
parents 252843aac42f
children
line wrap: on
line diff
--- a/Plugins/Input/console/Nes_Vrc6.cpp	Sun Dec 04 07:37:06 2005 -0800
+++ b/Plugins/Input/console/Nes_Vrc6.cpp	Sun Dec 04 08:49:53 2005 -0800
@@ -89,18 +89,21 @@
 	assert( last_time >= 0 );
 }
 
+#define chars_to_long(s) ( (long)(s[0] << 24) | (long)(s[1] << 16) | \
+				(long)(s[2] << 8)  | (long)(s[3]) )
+
 void Nes_Vrc6::reflect_state( Tagged_Data& data )
 {
 	for ( int i = 0; i < osc_count; i++ )
 	{
-		Tagged_Data odata( data, 'cCH0' + i );
+		Tagged_Data odata( data, chars_to_long("cCH0") + i );
 		Vrc6_Osc& osc = oscs [i];
 		for ( int r = 0; r < reg_count; r++ )
-			reflect_int16( odata, 'REG0' + r, &osc.regs [r] );
-		reflect_int16( odata, 'DELY', &osc.delay );
-		reflect_int16( odata, 'PHAS', &osc.phase );
+			reflect_int16( odata, chars_to_long("REG0") + r, &osc.regs [r] );
+		reflect_int16( odata, chars_to_long("DELY"), &osc.delay );
+		reflect_int16( odata, chars_to_long("PHAS"), &osc.phase );
 		if ( i == 2 )
-			reflect_int16( odata, 'AMPL', &osc.amp );
+			reflect_int16( odata, chars_to_long("AMPL"), &osc.amp );
 	}
 }