src/video/SDL_RLEaccel.c
changeset 1428 5f52867ba65c
parent 1402 d910939febfa
child 1456 84de7511f79f
     1.1 --- a/src/video/SDL_RLEaccel.c	Fri Feb 24 17:03:06 2006 +0000
     1.2 +++ b/src/video/SDL_RLEaccel.c	Fri Feb 24 18:24:57 2006 +0000
     1.3 @@ -110,9 +110,9 @@
     1.4  #define PIXEL_COPY(to, from, len, bpp)			\
     1.5  do {							\
     1.6      if(bpp == 4) {					\
     1.7 -	SDL_memcpy4(to, from, (unsigned)(len));		\
     1.8 +	SDL_memcpy4(to, from, (size_t)(len));		\
     1.9      } else {						\
    1.10 -	SDL_memcpy(to, from, (unsigned)(len) * (bpp));	\
    1.11 +	SDL_memcpy(to, from, (size_t)(len) * (bpp));	\
    1.12      }							\
    1.13  } while(0)
    1.14  
    1.15 @@ -423,7 +423,7 @@
    1.16  	    d = (d | d << 16) & 0x07e0f81f;		\
    1.17  	    d += (s - d) * ALPHA >> 5;			\
    1.18  	    d &= 0x07e0f81f;				\
    1.19 -	    *dst++ = d | d >> 16;			\
    1.20 +	    *dst++ = (Uint16)(d | d >> 16);			\
    1.21  	}						\
    1.22      } while(0)
    1.23  
    1.24 @@ -440,7 +440,7 @@
    1.25  	    d = (d | d << 16) & 0x03e07c1f;		\
    1.26  	    d += (s - d) * ALPHA >> 5;			\
    1.27  	    d &= 0x03e07c1f;				\
    1.28 -	    *dst++ = d | d >> 16;			\
    1.29 +	    *dst++ = (Uint16)(d | d >> 16);			\
    1.30  	}						\
    1.31      } while(0)
    1.32  
    1.33 @@ -482,17 +482,17 @@
    1.34  	    PIXEL_FROM_RGB(d, fmt, rd, gd, bd);				\
    1.35  	    switch(bpp) {						\
    1.36  	    case 2:							\
    1.37 -		*(Uint16 *)dst = d;					\
    1.38 +		*(Uint16 *)dst = (Uint16)d;					\
    1.39  		break;							\
    1.40  	    case 3:							\
    1.41  		if(SDL_BYTEORDER == SDL_BIG_ENDIAN) {			\
    1.42 -		    dst[0] = d >> 16;					\
    1.43 -		    dst[1] = d >> 8;					\
    1.44 -		    dst[2] = d;						\
    1.45 +		    dst[0] = (Uint8)(d >> 16);					\
    1.46 +		    dst[1] = (Uint8)(d >> 8);					\
    1.47 +		    dst[2] = (Uint8)(d);						\
    1.48  		} else {						\
    1.49 -		    dst[0] = d;						\
    1.50 -		    dst[1] = d >> 8;					\
    1.51 -		    dst[2] = d >> 16;					\
    1.52 +		    dst[0] = (Uint8)d;						\
    1.53 +		    dst[1] = (Uint8)(d >> 8);					\
    1.54 +		    dst[2] = (Uint8)(d >> 16);					\
    1.55  		}							\
    1.56  		break;							\
    1.57  	    case 4:							\
    1.58 @@ -575,10 +575,10 @@
    1.59  /* helper: blend a single 16 bit pixel at 50% */
    1.60  #define BLEND16_50(dst, src, mask)			\
    1.61      do {						\
    1.62 -        Uint32 s = *src++;				\
    1.63 +	Uint32 s = *src++;				\
    1.64  	Uint32 d = *dst;				\
    1.65 -	*dst++ = (((s & mask) + (d & mask)) >> 1)	\
    1.66 -	         + (s & d & (~mask & 0xffff));		\
    1.67 +	*dst++ = (Uint16)((((s & mask) + (d & mask)) >> 1) +	\
    1.68 +	                  (s & d & (~mask & 0xffff)));		\
    1.69      } while(0)
    1.70  
    1.71  /* basic 16bpp blender. mask is the pixels to keep when adding. */
    1.72 @@ -971,32 +971,32 @@
    1.73   */
    1.74  #define BLIT_TRANSL_565(src, dst)		\
    1.75      do {					\
    1.76 -        Uint32 s = src;				\
    1.77 +	Uint32 s = src;				\
    1.78  	Uint32 d = dst;				\
    1.79  	unsigned alpha = (s & 0x3e0) >> 5;	\
    1.80  	s &= 0x07e0f81f;			\
    1.81  	d = (d | d << 16) & 0x07e0f81f;		\
    1.82  	d += (s - d) * alpha >> 5;		\
    1.83  	d &= 0x07e0f81f;			\
    1.84 -	dst = d | d >> 16;			\
    1.85 +	dst = (Uint16)(d | d >> 16);			\
    1.86      } while(0)
    1.87  
    1.88  #define BLIT_TRANSL_555(src, dst)		\
    1.89      do {					\
    1.90 -        Uint32 s = src;				\
    1.91 +	Uint32 s = src;				\
    1.92  	Uint32 d = dst;				\
    1.93  	unsigned alpha = (s & 0x3e0) >> 5;	\
    1.94  	s &= 0x03e07c1f;			\
    1.95  	d = (d | d << 16) & 0x03e07c1f;		\
    1.96  	d += (s - d) * alpha >> 5;		\
    1.97  	d &= 0x03e07c1f;			\
    1.98 -	dst = d | d >> 16;			\
    1.99 +	dst = (Uint16)(d | d >> 16);			\
   1.100      } while(0)
   1.101  
   1.102  /* used to save the destination format in the encoding. Designed to be
   1.103     macro-compatible with SDL_PixelFormat but without the unneeded fields */
   1.104  typedef struct {
   1.105 -    	Uint8  BytesPerPixel;
   1.106 +	Uint8  BytesPerPixel;
   1.107  	Uint8  Rloss;
   1.108  	Uint8  Gloss;
   1.109  	Uint8  Bloss;