[Scummvm-cvs-logs] SF.net SVN: scummvm:[43663] scummvm/trunk/backends/platform/wince/CEScaler. cpp

robinwatts at users.sourceforge.net robinwatts at users.sourceforge.net
Sun Aug 23 01:09:43 CEST 2009


Revision: 43663
          http://scummvm.svn.sourceforge.net/scummvm/?rev=43663&view=rev
Author:   robinwatts
Date:     2009-08-22 23:09:43 +0000 (Sat, 22 Aug 2009)

Log Message:
-----------
Remove more warnings from wince build.

Modified Paths:
--------------
    scummvm/trunk/backends/platform/wince/CEScaler.cpp

Modified: scummvm/trunk/backends/platform/wince/CEScaler.cpp
===================================================================
--- scummvm/trunk/backends/platform/wince/CEScaler.cpp	2009-08-22 23:00:08 UTC (rev 43662)
+++ scummvm/trunk/backends/platform/wince/CEScaler.cpp	2009-08-22 23:09:43 UTC (rev 43663)
@@ -82,30 +82,32 @@
 	outbuf = (uint8 *)dstPtr;
 	height /= 5;
 
+	// Various casts below go via (void *) to avoid warning. This is
+	// safe as these are all even addresses.
 	for (i = 0; i < height; i++) {
 		instart = inbuf;
 		outstart = outbuf;
 		for (j=0; j < width; j++) {
 
-			p1 = *(const uint16*)inbuf; inbuf += srcPitch;
-			*(uint16*)outbuf = p1; outbuf += dstPitch;
+			p1 = *(const uint16*)(const void *)inbuf; inbuf += srcPitch;
+			*(uint16*)(void *)outbuf = p1; outbuf += dstPitch;
 
-			p2 = *(const uint16*)inbuf; inbuf += srcPitch;
-			*(uint16*)outbuf = MAKEPIXEL(P20(RB(p1))+P80(RB(p2)),P20(G(p1))+P80(G(p2)));  outbuf += dstPitch;
+			p2 = *(const uint16*)(const void *)inbuf; inbuf += srcPitch;
+			*(uint16*)(void *)outbuf = MAKEPIXEL(P20(RB(p1))+P80(RB(p2)),P20(G(p1))+P80(G(p2)));  outbuf += dstPitch;
 
 			p1 = p2;
-			p2 = *(const uint16*)inbuf; inbuf += srcPitch;
-			*(uint16*)outbuf = MAKEPIXEL(P40(RB(p1))+P60(RB(p2)),P40(G(p1))+P60(G(p2)));  outbuf += dstPitch;
+			p2 = *(const uint16*)(const void *)inbuf; inbuf += srcPitch;
+			*(uint16*)(void *)outbuf = MAKEPIXEL(P40(RB(p1))+P60(RB(p2)),P40(G(p1))+P60(G(p2)));  outbuf += dstPitch;
 
 			p1 = p2;
-			p2 = *(const uint16*)inbuf; inbuf += srcPitch;
-			*(uint16*)outbuf = MAKEPIXEL(P60(RB(p1))+P40(RB(p2)),P60(G(p1))+P40(G(p2)));  outbuf += dstPitch;
+			p2 = *(const uint16*)(const void *)inbuf; inbuf += srcPitch;
+			*(uint16*)(void *)outbuf = MAKEPIXEL(P60(RB(p1))+P40(RB(p2)),P60(G(p1))+P40(G(p2)));  outbuf += dstPitch;
 
 			p1 = p2;
-			p2 = *(const uint16*)inbuf;
-			*(uint16*)outbuf = MAKEPIXEL(P80(RB(p1))+P20(RB(p2)),P80(G(p1))+P20(G(p2)));  outbuf += dstPitch;
+			p2 = *(const uint16*)(const void *)inbuf;
+			*(uint16*)(void *)outbuf = MAKEPIXEL(P80(RB(p1))+P20(RB(p2)),P80(G(p1))+P20(G(p2)));  outbuf += dstPitch;
 
-			*(uint16*)outbuf = p2;
+			*(uint16*)(void *)outbuf = p2;
 
 			inbuf = inbuf - srcPitch*4 + sizeof(uint16);
 			outbuf = outbuf - dstPitch*5 + sizeof(uint16);


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