diff src/video/SDL_blit_1.c @ 91:e85e03f195b4

From: "Markus F.X.J. Oberhumer" Subject: SDL CVS patches below you will find some small patches against the current SDL CVS. It adresses these things: 1) Use "&" instead of "%" in some cases. For negative signed integers (x % 8) is not always (x & 7), and the compiler can produce slightly faster code when using "&" here. 2) Some const issues.
author Sam Lantinga <slouken@lokigames.com>
date Sat, 07 Jul 2001 20:20:17 +0000
parents 74212992fb08
children e8157fcb3114
line wrap: on
line diff
--- a/src/video/SDL_blit_1.c	Sat Jul 07 08:08:42 2001 +0000
+++ b/src/video/SDL_blit_1.c	Sat Jul 07 20:20:17 2001 +0000
@@ -137,7 +137,7 @@
 				dst += 4;
 			}
 			/* Get any leftovers */
-			switch (width % 4) {
+			switch (width & 3) {
 				case 3:
 					*(Uint16 *)dst = map[*src++];
 					dst += 2;
@@ -169,7 +169,7 @@
 				dst += 4;
 			}
 			/* Get any leftovers */
-			switch (width % 4) {
+			switch (width & 3) {
 				case 3:
 					*(Uint16 *)dst = map[*src++];
 					dst += 2;
@@ -266,7 +266,7 @@
 			*dst++ = map[*src++];
 			*dst++ = map[*src++];
 		}
-		switch ( width % 4 ) {
+		switch ( width & 3 ) {
 			case 3:
 				*dst++ = map[*src++];
 			case 2: