diff src/video/SDL_blit_0.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_0.c	Sat Jul 07 08:08:42 2001 +0000
+++ b/src/video/SDL_blit_0.c	Sat Jul 07 20:20:17 2001 +0000
@@ -55,7 +55,7 @@
 		while ( height-- ) {
 		        Uint8 byte = 0, bit;
 	    		for ( c=0; c<width; ++c ) {
-				if ( (c%8) == 0 ) {
+				if ( (c&7) == 0 ) {
 					byte = *src++;
 				}
 				bit = (byte&0x80)>>7;
@@ -72,7 +72,7 @@
 		while ( height-- ) {
 		        Uint8 byte = 0, bit;
 	    		for ( c=0; c<width; ++c ) {
-				if ( (c%8) == 0 ) {
+				if ( (c&7) == 0 ) {
 					byte = *src++;
 				}
 				bit = (byte&0x80)>>7;
@@ -108,7 +108,7 @@
 	while ( height-- ) {
 	        Uint8 byte = 0, bit;
 	    	for ( c=0; c<width; ++c ) {
-			if ( (c%8) == 0 ) {
+			if ( (c&7) == 0 ) {
 				byte = *src++;
 			}
 			bit = (byte&0x80)>>7;
@@ -142,7 +142,7 @@
 	while ( height-- ) {
 	        Uint8 byte = 0, bit;
 	    	for ( c=0; c<width; ++c ) {
-			if ( (c%8) == 0 ) {
+			if ( (c&7) == 0 ) {
 				byte = *src++;
 			}
 			bit = (byte&0x80)>>7;
@@ -180,7 +180,7 @@
 	while ( height-- ) {
 	        Uint8 byte = 0, bit;
 	    	for ( c=0; c<width; ++c ) {
-			if ( (c%8) == 0 ) {
+			if ( (c&7) == 0 ) {
 				byte = *src++;
 			}
 			bit = (byte&0x80)>>7;
@@ -214,7 +214,7 @@
 		while ( height-- ) {
 		        Uint8  byte = 0, bit;
 	    		for ( c=0; c<width; ++c ) {
-				if ( (c%8) == 0 ) {
+				if ( (c&7) == 0 ) {
 					byte = *src++;
 				}
 				bit = (byte&0x80)>>7;
@@ -231,7 +231,7 @@
 		while ( height-- ) {
 		        Uint8  byte = 0, bit;
 	    		for ( c=0; c<width; ++c ) {
-				if ( (c%8) == 0 ) {
+				if ( (c&7) == 0 ) {
 					byte = *src++;
 				}
 				bit = (byte&0x80)>>7;
@@ -266,7 +266,7 @@
 	while ( height-- ) {
 	        Uint8 byte = 0, bit;
 	    	for ( c=0; c<width; ++c ) {
-			if ( (c%8) == 0 ) {
+			if ( (c&7) == 0 ) {
 				byte = *src++;
 			}
 			bit = (byte&0x80)>>7;
@@ -299,7 +299,7 @@
 	while ( height-- ) {
 	        Uint8  byte = 0, bit;
 	    	for ( c=0; c<width; ++c ) {
-			if ( (c%8) == 0 ) {
+			if ( (c&7) == 0 ) {
 				byte = *src++;
 			}
 			bit = (byte&0x80)>>7;
@@ -333,7 +333,7 @@
 	while ( height-- ) {
 	        Uint8 byte = 0, bit;
 	    	for ( c=0; c<width; ++c ) {
-			if ( (c%8) == 0 ) {
+			if ( (c&7) == 0 ) {
 				byte = *src++;
 			}
 			bit = (byte&0x80)>>7;
@@ -369,7 +369,7 @@
 	while ( height-- ) {
 	        Uint8 byte = 0, bit;
 	    	for ( c=0; c<width; ++c ) {
-			if ( (c%8) == 0 ) {
+			if ( (c&7) == 0 ) {
 				byte = *src++;
 			}
 			bit = (byte&0x80)>>7;
@@ -416,7 +416,7 @@
 	while ( height-- ) {
 	        Uint8  byte = 0, bit;
 	    	for ( c=0; c<width; ++c ) {
-			if ( (c%8) == 0 ) {
+			if ( (c&7) == 0 ) {
 				byte = *src++;
 			}
 			bit = (byte&0x80)>>7;