Mercurial > sdl-ios-xcode
comparison 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 |
comparison
equal
deleted
inserted
replaced
90:ee1f71c10889 | 91:e85e03f195b4 |
---|---|
135 (map[src[HI]]<<16)|(map[src[LO]]); | 135 (map[src[HI]]<<16)|(map[src[LO]]); |
136 src += 2; | 136 src += 2; |
137 dst += 4; | 137 dst += 4; |
138 } | 138 } |
139 /* Get any leftovers */ | 139 /* Get any leftovers */ |
140 switch (width % 4) { | 140 switch (width & 3) { |
141 case 3: | 141 case 3: |
142 *(Uint16 *)dst = map[*src++]; | 142 *(Uint16 *)dst = map[*src++]; |
143 dst += 2; | 143 dst += 2; |
144 case 2: | 144 case 2: |
145 *(Uint32 *)dst = | 145 *(Uint32 *)dst = |
167 (map[src[HI]]<<16)|(map[src[LO]]); | 167 (map[src[HI]]<<16)|(map[src[LO]]); |
168 src += 2; | 168 src += 2; |
169 dst += 4; | 169 dst += 4; |
170 } | 170 } |
171 /* Get any leftovers */ | 171 /* Get any leftovers */ |
172 switch (width % 4) { | 172 switch (width & 3) { |
173 case 3: | 173 case 3: |
174 *(Uint16 *)dst = map[*src++]; | 174 *(Uint16 *)dst = map[*src++]; |
175 dst += 2; | 175 dst += 2; |
176 case 2: | 176 case 2: |
177 *(Uint32 *)dst = | 177 *(Uint32 *)dst = |
264 *dst++ = map[*src++]; | 264 *dst++ = map[*src++]; |
265 *dst++ = map[*src++]; | 265 *dst++ = map[*src++]; |
266 *dst++ = map[*src++]; | 266 *dst++ = map[*src++]; |
267 *dst++ = map[*src++]; | 267 *dst++ = map[*src++]; |
268 } | 268 } |
269 switch ( width % 4 ) { | 269 switch ( width & 3 ) { |
270 case 3: | 270 case 3: |
271 *dst++ = map[*src++]; | 271 *dst++ = map[*src++]; |
272 case 2: | 272 case 2: |
273 *dst++ = map[*src++]; | 273 *dst++ = map[*src++]; |
274 case 1: | 274 case 1: |