[Scummvm-cvs-logs] SF.net SVN: scummvm:[55175] scummvm/trunk/sound/softsynth/mt32

marcus_c at users.sourceforge.net marcus_c at users.sourceforge.net
Sat Jan 8 22:11:31 CET 2011


Revision: 55175
          http://scummvm.svn.sourceforge.net/scummvm/?rev=55175&view=rev
Author:   marcus_c
Date:     2011-01-08 21:11:31 +0000 (Sat, 08 Jan 2011)

Log Message:
-----------
MT32: Fixed compilation warnings

The conversion specification "%f" converts a double, not a float,
so floats need to be converted to doubles before passing them to
vprintf().

Modified Paths:
--------------
    scummvm/trunk/sound/softsynth/mt32/partial.cpp
    scummvm/trunk/sound/softsynth/mt32/synth.cpp
    scummvm/trunk/sound/softsynth/mt32/tables.cpp

Modified: scummvm/trunk/sound/softsynth/mt32/partial.cpp
===================================================================
--- scummvm/trunk/sound/softsynth/mt32/partial.cpp	2011-01-08 20:58:23 UTC (rev 55174)
+++ scummvm/trunk/sound/softsynth/mt32/partial.cpp	2011-01-08 21:11:31 UTC (rev 55175)
@@ -118,7 +118,7 @@
 #endif
 #if MT32EMU_ACCURATENOTES == 1
 	noteVal = newPitch;
-	synth->printDebug("key=%d, pitch=%f, pitchKeyfollow=%f, pitchShift=%f, newPitch=%f", key, patchCache->pitch, patchCache->pitchKeyfollow, patchCache->pitchShift, newPitch);
+	synth->printDebug("key=%d, pitch=%f, pitchKeyfollow=%f, pitchShift=%f, newPitch=%f", key, (double)patchCache->pitch, (double)patchCache->pitchKeyfollow, (double)patchCache->pitchShift, (double)newPitch);
 #else
 	float newPitchInt;
 	float newPitchFract = modff(newPitch, &newPitchInt);
@@ -128,7 +128,7 @@
 	}
 	noteVal = (int)newPitchInt;
 	fineShift = (int)(powf(2.0f, newPitchFract / 12.0f) * 4096.0f);
-	synth->printDebug("key=%d, pitch=%f, pitchKeyfollow=%f, pitchShift=%f, newPitch=%f, noteVal=%d, fineShift=%d", key, patchCache->pitch, patchCache->pitchKeyfollow, patchCache->pitchShift, newPitch, noteVal, fineShift);
+	synth->printDebug("key=%d, pitch=%f, pitchKeyfollow=%f, pitchShift=%f, newPitch=%f, noteVal=%d, fineShift=%d", key, (double)patchCache->pitch, (double)patchCache->pitchKeyfollow, (double)patchCache->pitchShift, (double)newPitch, noteVal, fineShift);
 #endif
 	// FIXME:KG: Raise/lower by octaves until in the supported range.
 	while (noteVal > HIGHEST_NOTE) // FIXME:KG: see tables.cpp: >108?
@@ -451,7 +451,7 @@
 	// FIXME:KG: Bend should be influenced by pitch key-follow too, according to docs.
 	float bendSemitones = factor * patchCache->benderRange; // -24 .. 24
 	float mult = powf(2.0f, bendSemitones / 12.0f);
-	synth->printDebug("setBend(): factor=%f, benderRange=%f, semitones=%f, mult=%f\n", factor, patchCache->benderRange, bendSemitones, mult);
+	synth->printDebug("setBend(): factor=%f, benderRange=%f, semitones=%f, mult=%f\n", (double)factor, (double)patchCache->benderRange, (double)bendSemitones, (double)mult);
 	bendShift = (int)(mult * 4096.0f);
 }
 

Modified: scummvm/trunk/sound/softsynth/mt32/synth.cpp
===================================================================
--- scummvm/trunk/sound/softsynth/mt32/synth.cpp	2011-01-08 20:58:23 UTC (rev 55174)
+++ scummvm/trunk/sound/softsynth/mt32/synth.cpp	2011-01-08 21:11:31 UTC (rev 55175)
@@ -316,7 +316,7 @@
 		// The number below is confirmed to a reasonable degree of accuracy on CM-32L
 		double STANDARDFREQ = 442.0;
 		float rTune = (float)(STANDARDFREQ * pow(2.0, (0x5000 - rTuneOffset) / 4056.0 - 9.0 / 12.0));
-		//printDebug("%f,%d,%d", pTune, tps[i].pitchCoarse, tps[i].pitchFine);
+		//printDebug("%f,%d,%d", (double)pTune, tps[i].pitchCoarse, tps[i].pitchFine);
 		if (rAddr + rLen > pcmROMSize) {
 			printDebug("Control ROM error: Wave map entry %d points to invalid PCM address 0x%04X, length 0x%04X", i, rAddr, rLen);
 			return false;
@@ -1021,7 +1021,7 @@
 	// The LAPC-I documentation claims a range of 427.5Hz-452.6Hz (similar to what we have here)
 	// The MT-32 documentation claims a range of 432.1Hz-457.6Hz
 	masterTune = 440.0f * powf(2.0f, (mt32ram.system.masterTune - 64.0f) / (128.0f * 12.0f));
-	printDebug(" Master Tune: %f", masterTune);
+	printDebug(" Master Tune: %f", (double)masterTune);
 	printDebug(" Reverb: mode=%d, time=%d, level=%d", mt32ram.system.reverbMode, mt32ram.system.reverbTime, mt32ram.system.reverbLevel);
 	report(ReportType_newReverbMode,  &mt32ram.system.reverbMode);
 	report(ReportType_newReverbTime,  &mt32ram.system.reverbTime);

Modified: scummvm/trunk/sound/softsynth/mt32/tables.cpp
===================================================================
--- scummvm/trunk/sound/softsynth/mt32/tables.cpp	2011-01-08 20:58:23 UTC (rev 55174)
+++ scummvm/trunk/sound/softsynth/mt32/tables.cpp	2011-01-08 21:11:31 UTC (rev 55175)
@@ -329,7 +329,7 @@
 			tdist = (lf - 25.0f) / 25.0f;
 			padjtable[lf] = 1.0f - tdist;
 		}
-		//synth->printDebug("lf %d = padj %f", lf, padjtable[lf]);
+		//synth->printDebug("lf %d = padj %f", lf, (double)padjtable[lf]);
 	}
 
 	float lfp, depf, finalval, tlf;
@@ -352,7 +352,7 @@
 				pval = (int)finalval;
 
 				pitchEnvVal[lf][depat] = pval;
-				//synth->printDebug("lf %d depat %d pval %d tlf %f lfp %f", lf,depat,pval, tlf, lfp);
+				//synth->printDebug("lf %d depat %d pval %d tlf %f lfp %f", lf,depat,pval, (double)tlf, (double)lfp);
 			} else {
 				pitchEnvVal[lf][depat] = 4096;
 				//synth->printDebug("lf %d depat %d pval 4096", lf, depat);
@@ -402,7 +402,7 @@
 					tvaBiasMult[lf][distval] = (int)(dval * 256.0f);
 				}
 			}
-			//synth->printDebug("Ampbias lf %d distval %d = %f (%x) %f", lf, distval, dval, tvaBiasMult[lf][distval],amplog);
+			//synth->printDebug("Ampbias lf %d distval %d = %f (%x) %f", lf, distval, (double)dval, tvaBiasMult[lf][distval],(double)amplog);
 		}
 	}
 
@@ -430,7 +430,7 @@
 					tvfBiasMult[lf][distval] = (int)(dval * 256.0f);
 				}
 			}
-			//synth->printDebug("Fbias lf %d distval %d = %f (%x) %f", lf, distval, dval, tvfBiasMult[lf][distval],amplog);
+			//synth->printDebug("Fbias lf %d distval %d = %f (%x) %f", lf, distval, (double)dval, tvfBiasMult[lf][distval],(double)amplog);
 		}
 	}
 }
@@ -471,7 +471,7 @@
 			keyLookup->envTimeMult[dep] = (int)(ff * 256.0f);
 		}
 	}
-	//synth->printDebug("F %f d1 %x d2 %x d3 %x d4 %x d5 %x", f, noteLookup->fildepTable[0], noteLookup->fildepTable[1], noteLookup->fildepTable[2], noteLookup->fildepTable[3], noteLookup->fildepTable[4]);
+	//synth->printDebug("F %f d1 %x d2 %x d3 %x d4 %x d5 %x", (double)f, noteLookup->fildepTable[0], noteLookup->fildepTable[1], noteLookup->fildepTable[2], noteLookup->fildepTable[3], noteLookup->fildepTable[4]);
 }
 
 Bit16s Tables::clampWF(Synth *synth, const char *n, float ampVal, double input) {
@@ -586,7 +586,7 @@
 
 	initSaw(noteLookup, noteLookup->div2);
 
-	//synth->printDebug("Note %f; freq=%f, div=%f", note, freq, rate / freq);
+	//synth->printDebug("Note %f; freq=%f, div=%f", (double)note, (double)freq, (double) rate / freq);
 	file = initWave(synth, noteLookup, WGAMP, div2, file);
 
 	// Create the pitch tables
@@ -730,7 +730,7 @@
 
 bool Tables::init(Synth *synth, PCMWaveEntry *pcmWaves, float sampleRate, float masterTune) {
 	if (sampleRate <= 0.0f) {
-		synth->printDebug("Bad sampleRate (%f <= 0.0f)", sampleRate);
+		synth->printDebug("Bad sampleRate (%f <= 0.0f)", (double)sampleRate);
 		return false;
 	}
 	if (initialisedSampleRate == 0.0f) {


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




More information about the Scummvm-git-logs mailing list