[Scummvm-cvs-logs] SF.net SVN: scummvm:[49517] scummvm/trunk

tdhs at users.sourceforge.net tdhs at users.sourceforge.net
Tue Jun 8 22:29:33 CEST 2010


Revision: 49517
          http://scummvm.svn.sourceforge.net/scummvm/?rev=49517&view=rev
Author:   tdhs
Date:     2010-06-08 20:29:33 +0000 (Tue, 08 Jun 2010)

Log Message:
-----------
Modification to remove false positive "Possible divide by zero" warnings given by cppcheck-1.43.

These are incorrect as '/' operator has precedence over >>, but this does improve readability anyway.

This bug in cppcheck has already been corrected: http://sourceforge.net/apps/trac/cppcheck/ticket/1714

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/sound.cpp
    scummvm/trunk/sound/softsynth/sid.cpp

Modified: scummvm/trunk/engines/scumm/sound.cpp
===================================================================
--- scummvm/trunk/engines/scumm/sound.cpp	2010-06-08 20:24:54 UTC (rev 49516)
+++ scummvm/trunk/engines/scumm/sound.cpp	2010-06-08 20:29:33 UTC (rev 49517)
@@ -1789,7 +1789,7 @@
 
 		// There is a constant delay of ppqn/3 before the music starts.
 		if (ppqn / 3 >= 128)
-			*ptr++ = (ppqn / 3 >> 7) | 0x80;
+			*ptr++ = ((ppqn / 3) >> 7) | 0x80;
 		*ptr++ = ppqn / 3 & 0x7f;
 
 		// Now copy the actual music data

Modified: scummvm/trunk/sound/softsynth/sid.cpp
===================================================================
--- scummvm/trunk/sound/softsynth/sid.cpp	2010-06-08 20:24:54 UTC (rev 49516)
+++ scummvm/trunk/sound/softsynth/sid.cpp	2010-06-08 20:29:33 UTC (rev 49517)
@@ -506,7 +506,7 @@
 		+ sizeof(f0_points_6581)/sizeof(*f0_points_6581) - 1,
 		PointPlotter<sound_sample>(f0_6581), 1.0);
 
-	mixer_DC = -0xfff*0xff/18 >> 7;
+	mixer_DC = (-0xfff*0xff/18) >> 7;
 
 	f0 = f0_6581;
 	f0_points = f0_points_6581;


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