[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sc-dev] SF.net SVN: supercollider:[8089] trunk/Source/plugins



Revision: 8089
          http://supercollider.svn.sourceforge.net/supercollider/?rev=8089&view=rev
Author:   danstowell
Date:     2008-12-09 18:30:13 +0000 (Tue, 09 Dec 2008)

Log Message:
-----------
Fix some compiler warnings: double->float stuff, and unneeded double-declaration of vars

Modified Paths:
--------------
    trunk/Source/plugins/FilterUGens.cpp
    trunk/Source/plugins/IOUGens.cpp
    trunk/Source/plugins/MouseUGens.cpp
    trunk/Source/plugins/PanUGens.cpp

Modified: trunk/Source/plugins/FilterUGens.cpp
===================================================================
--- trunk/Source/plugins/FilterUGens.cpp	2008-12-09 16:19:39 UTC (rev 8088)
+++ trunk/Source/plugins/FilterUGens.cpp	2008-12-09 18:30:13 UTC (rev 8089)
@@ -5776,8 +5776,8 @@
     b2 = unit->m_b2;
     
     LOOP(unit->mRate->mFilterLoops,
-	 float nextfreq = ZXP(freq);
-	 float nextrq = ZXP(rq);
+	 nextfreq = ZXP(freq);
+	 nextrq = ZXP(rq);
 	 if ((unit->m_freq != nextfreq) || (unit->m_rq != nextrq)) {
 	 w0 = twopi * (double)nextfreq * SAMPLEDUR;
 	 alpha = sin(w0) * (double)nextrq * 0.5;

Modified: trunk/Source/plugins/IOUGens.cpp
===================================================================
--- trunk/Source/plugins/IOUGens.cpp	2008-12-09 16:19:39 UTC (rev 8088)
+++ trunk/Source/plugins/IOUGens.cpp	2008-12-09 18:30:13 UTC (rev 8089)
@@ -259,7 +259,7 @@
 	for (int i=0; i<numChannels; ++i, mapin++) {
 		unit->m_y1[i] = **mapin;
 		float lag = ZIN0(i);
-		unit->m_b1[i] = lag == 0.f ? 0.f : exp(log001 / (lag * unit->mRate->mSampleRate));
+		unit->m_b1[i] = lag == 0.f ? 0.f : (float)exp(log001 / (lag * unit->mRate->mSampleRate));
 	}
 }
 
@@ -404,7 +404,7 @@
 	unit->m_fbusChannel = -1.;
 
 	float lag = ZIN0(1);
-	unit->m_b1 = lag == 0.f ? 0.f : exp(log001 / (lag * unit->mRate->mSampleRate));
+	unit->m_b1 = lag == 0.f ? 0.f : (float)exp(log001 / (lag * unit->mRate->mSampleRate));
 
 	SETCALC(LagIn_next_k);
 	unit->m_bus = world->mControlBus;

Modified: trunk/Source/plugins/MouseUGens.cpp
===================================================================
--- trunk/Source/plugins/MouseUGens.cpp	2008-12-09 16:19:39 UTC (rev 8088)
+++ trunk/Source/plugins/MouseUGens.cpp	2008-12-09 18:30:13 UTC (rev 8089)
@@ -106,15 +106,15 @@
 		// lines uncommented below are just for a specially need on multi-display.
 	//int screenWidth  = GetSystemMetrics( SM_CXVIRTUALSCREEN ); 
 	//int screenHeight = GetSystemMetrics( SM_CYVIRTUALSCREEN );
-	float r_screenWidth  = 1. / (float)(screenWidth  -1);
-	float r_screenHeight = 1. / (float)(screenHeight -1);
+	float r_screenWidth  = 1.f / (float)(screenWidth  -1);
+	float r_screenHeight = 1.f / (float)(screenHeight -1);
 
 	gstate = &gMouseUGenGlobals;
 	
 	for(;;)	{
 		GetCursorPos(&p);
 		gstate->mouseX = (float)p.x * r_screenWidth;
-		gstate->mouseY = 1.0 - (float)p.y * r_screenHeight;
+		gstate->mouseY = 1.f - (float)p.y * r_screenHeight;
 		gstate->mouseButton = (GetKeyState(mButton) < 0);
 		::Sleep(17); // 17msec.
 	}
@@ -185,7 +185,7 @@
 	float b1 = unit->m_b1;
 	
 	if (lag != unit->m_lag) {
-		unit->m_b1 = lag == 0.f ? 0.f : exp(log001 / (lag * unit->mRate->mSampleRate));
+		unit->m_b1 = lag == 0.f ? 0.f : (float)exp(log001 / (lag * unit->mRate->mSampleRate));
 		unit->m_lag = lag;
 	}
 	float y0 = unit->gstate->mouseX; 
@@ -221,7 +221,7 @@
 	float b1 = unit->m_b1;
 	
 	if (lag != unit->m_lag) {
-		unit->m_b1 = lag == 0.f ? 0.f : exp(log001 / (lag * unit->mRate->mSampleRate));
+		unit->m_b1 = lag == 0.f ? 0.f : (float)exp(log001 / (lag * unit->mRate->mSampleRate));
 		unit->m_lag = lag;
 	}
 	float y0 = unit->gstate->mouseY; 
@@ -257,7 +257,7 @@
 	float b1 = unit->m_b1;
 	
 	if (lag != unit->m_lag) {
-		unit->m_b1 = lag == 0.f ? 0.f : exp(log001 / (lag * unit->mRate->mSampleRate));
+		unit->m_b1 = lag == 0.f ? 0.f : (float)exp(log001 / (lag * unit->mRate->mSampleRate));
 		unit->m_lag = lag;
 	}
 	float y0 = unit->gstate->mouseButton ? maxval : minval; 
@@ -430,7 +430,7 @@
 	DefineUnit("MouseButton", sizeof(MouseInputUGen), (UnitCtorFunc)&MouseButton_Ctor, 0, 0);
 	
 	// define a plugin command - example code
-	gMyPlugin.a = 1.2;
-	gMyPlugin.b = 3.4;
+	gMyPlugin.a = 1.2f;
+	gMyPlugin.b = 3.4f;
 	DefinePlugInCmd("pluginCmdDemo", cmdDemoFunc, (void*)&gMyPlugin);
 }

Modified: trunk/Source/plugins/PanUGens.cpp
===================================================================
--- trunk/Source/plugins/PanUGens.cpp	2008-12-09 16:19:39 UTC (rev 8088)
+++ trunk/Source/plugins/PanUGens.cpp	2008-12-09 18:30:13 UTC (rev 8089)
@@ -1310,9 +1310,9 @@
 	float angle = (twopi / numOutputs);
 	unit->m_cosa = cos(angle);
 	unit->m_sina = sin(angle);
-	unit->m_W_amp = 0.7071067811865476;
-	unit->m_X_amp = 0.5 * cos(orientation * angle);
-	unit->m_Y_amp = 0.5 * sin(orientation * angle);
+	unit->m_W_amp = 0.7071067811865476f;
+	unit->m_X_amp = 0.5f * (float)cos(orientation * angle);
+	unit->m_Y_amp = 0.5f * (float)sin(orientation * angle);
 }
 
 void DecodeB2_next(DecodeB2 *unit, int inNumSamples)


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

_______________________________________________
sc-dev mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-dev/
search: https://listarc.bham.ac.uk/lists/sc-dev/search/