Update for Visual C++ 6.0
authorSam Lantinga <slouken@libsdl.org>
Fri, 24 Feb 2006 18:24:57 +0000
changeset 14285f52867ba65c
parent 1427 5f5a74d29d18
child 1429 aff0170f9f1b
Update for Visual C++ 6.0
VisualC.zip
include/SDL_config_win32.h
src/audio/SDL_audiocvt.c
src/audio/SDL_wave.c
src/video/SDL_RLEaccel.c
src/video/SDL_blit_A.c
src/video/SDL_blit_N.c
src/video/SDL_cursor.c
src/video/SDL_surface.c
src/video/SDL_video.c
src/video/SDL_yuv_sw.c
src/video/wincommon/SDL_sysevents.c
     1.1 Binary file VisualC.zip has changed
     2.1 --- a/include/SDL_config_win32.h	Fri Feb 24 17:03:06 2006 +0000
     2.2 +++ b/include/SDL_config_win32.h	Fri Feb 24 18:24:57 2006 +0000
     2.3 @@ -34,6 +34,9 @@
     2.4  typedef unsigned __int32	uint32_t;
     2.5  typedef __int64			int64_t;
     2.6  typedef unsigned __int64	uint64_t;
     2.7 +#if _MSC_VER <= 1200
     2.8 +typedef unsigned long uintptr_t;
     2.9 +#endif
    2.10  #endif
    2.11  #define SDL_HAS_64BIT_TYPE	1
    2.12  
     3.1 --- a/src/audio/SDL_audiocvt.c	Fri Feb 24 17:03:06 2006 +0000
     3.2 +++ b/src/audio/SDL_audiocvt.c	Fri Feb 24 18:24:57 2006 +0000
     3.3 @@ -47,7 +47,7 @@
     3.4  				if ( sample > 255 ) {
     3.5  					*dst = 255;
     3.6  				} else {
     3.7 -					*dst = sample;
     3.8 +					*dst = (Uint8)sample;
     3.9  				}
    3.10  				src += 2;
    3.11  				dst += 1;
    3.12 @@ -68,7 +68,7 @@
    3.13  				if ( sample < -128 ) {
    3.14  					*dst = -128;
    3.15  				} else {
    3.16 -					*dst = sample;
    3.17 +					*dst = (Sint8)sample;
    3.18  				}
    3.19  				src += 2;
    3.20  				dst += 1;
    3.21 @@ -185,10 +185,8 @@
    3.22  			src = cvt->buf;
    3.23  			dst = cvt->buf;
    3.24  			for ( i=cvt->len_cvt/6; i; --i ) {
    3.25 -				lsample = src[0];
    3.26 -				rsample = src[1];
    3.27 -				dst[0] = lsample;
    3.28 -				dst[1] = rsample;
    3.29 +				dst[0] = src[0];
    3.30 +				dst[1] = src[1];
    3.31  				src += 6;
    3.32  				dst += 2;
    3.33  			}
    3.34 @@ -201,10 +199,8 @@
    3.35  			src = (Sint8 *)cvt->buf;
    3.36  			dst = (Sint8 *)cvt->buf;
    3.37  			for ( i=cvt->len_cvt/6; i; --i ) {
    3.38 -				lsample = src[0];
    3.39 -				rsample = src[1];
    3.40 -				dst[0] = lsample;
    3.41 -				dst[1] = rsample;
    3.42 +				dst[0] = src[0];
    3.43 +				dst[1] = src[1];
    3.44  				src += 6;
    3.45  				dst += 2;
    3.46  			}
    3.47 @@ -305,10 +301,8 @@
    3.48  			src = cvt->buf;
    3.49  			dst = cvt->buf;
    3.50  			for ( i=cvt->len_cvt/4; i; --i ) {
    3.51 -				lsample = src[0];
    3.52 -				rsample = src[1];
    3.53 -				dst[0] = lsample;
    3.54 -				dst[1] = rsample;
    3.55 +				dst[0] = src[0];
    3.56 +				dst[1] = src[1];
    3.57  				src += 4;
    3.58  				dst += 2;
    3.59  			}
    3.60 @@ -321,10 +315,8 @@
    3.61  			src = (Sint8 *)cvt->buf;
    3.62  			dst = (Sint8 *)cvt->buf;
    3.63  			for ( i=cvt->len_cvt/4; i; --i ) {
    3.64 -				lsample = src[0];
    3.65 -				rsample = src[1];
    3.66 -				dst[0] = lsample;
    3.67 -				dst[1] = rsample;
    3.68 +				dst[0] = src[0];
    3.69 +				dst[1] = src[1];
    3.70  				src += 4;
    3.71  				dst += 2;
    3.72  			}
     4.1 --- a/src/audio/SDL_wave.c	Fri Feb 24 17:03:06 2006 +0000
     4.2 +++ b/src/audio/SDL_wave.c	Fri Feb 24 18:24:57 2006 +0000
     4.3 @@ -108,9 +108,9 @@
     4.4  	if ( delta < 16 ) {
     4.5  		delta = 16;
     4.6  	}
     4.7 -	state->iDelta = delta;
     4.8 +	state->iDelta = (Uint16)delta;
     4.9  	state->iSamp2 = state->iSamp1;
    4.10 -	state->iSamp1 = new_sample;
    4.11 +	state->iSamp1 = (Sint16)new_sample;
    4.12  	return(new_sample);
    4.13  }
    4.14  
    4.15 @@ -371,8 +371,8 @@
    4.16  			}
    4.17  
    4.18  			/* Store the initial sample we start with */
    4.19 -			decoded[0] = state[c].sample&0xFF;
    4.20 -			decoded[1] = state[c].sample>>8;
    4.21 +			decoded[0] = (Uint8)(state[c].sample&0xFF);
    4.22 +			decoded[1] = (Uint8)(state[c].sample>>8);
    4.23  			decoded += 2;
    4.24  		}
    4.25  
     5.1 --- a/src/video/SDL_RLEaccel.c	Fri Feb 24 17:03:06 2006 +0000
     5.2 +++ b/src/video/SDL_RLEaccel.c	Fri Feb 24 18:24:57 2006 +0000
     5.3 @@ -110,9 +110,9 @@
     5.4  #define PIXEL_COPY(to, from, len, bpp)			\
     5.5  do {							\
     5.6      if(bpp == 4) {					\
     5.7 -	SDL_memcpy4(to, from, (unsigned)(len));		\
     5.8 +	SDL_memcpy4(to, from, (size_t)(len));		\
     5.9      } else {						\
    5.10 -	SDL_memcpy(to, from, (unsigned)(len) * (bpp));	\
    5.11 +	SDL_memcpy(to, from, (size_t)(len) * (bpp));	\
    5.12      }							\
    5.13  } while(0)
    5.14  
    5.15 @@ -423,7 +423,7 @@
    5.16  	    d = (d | d << 16) & 0x07e0f81f;		\
    5.17  	    d += (s - d) * ALPHA >> 5;			\
    5.18  	    d &= 0x07e0f81f;				\
    5.19 -	    *dst++ = d | d >> 16;			\
    5.20 +	    *dst++ = (Uint16)(d | d >> 16);			\
    5.21  	}						\
    5.22      } while(0)
    5.23  
    5.24 @@ -440,7 +440,7 @@
    5.25  	    d = (d | d << 16) & 0x03e07c1f;		\
    5.26  	    d += (s - d) * ALPHA >> 5;			\
    5.27  	    d &= 0x03e07c1f;				\
    5.28 -	    *dst++ = d | d >> 16;			\
    5.29 +	    *dst++ = (Uint16)(d | d >> 16);			\
    5.30  	}						\
    5.31      } while(0)
    5.32  
    5.33 @@ -482,17 +482,17 @@
    5.34  	    PIXEL_FROM_RGB(d, fmt, rd, gd, bd);				\
    5.35  	    switch(bpp) {						\
    5.36  	    case 2:							\
    5.37 -		*(Uint16 *)dst = d;					\
    5.38 +		*(Uint16 *)dst = (Uint16)d;					\
    5.39  		break;							\
    5.40  	    case 3:							\
    5.41  		if(SDL_BYTEORDER == SDL_BIG_ENDIAN) {			\
    5.42 -		    dst[0] = d >> 16;					\
    5.43 -		    dst[1] = d >> 8;					\
    5.44 -		    dst[2] = d;						\
    5.45 +		    dst[0] = (Uint8)(d >> 16);					\
    5.46 +		    dst[1] = (Uint8)(d >> 8);					\
    5.47 +		    dst[2] = (Uint8)(d);						\
    5.48  		} else {						\
    5.49 -		    dst[0] = d;						\
    5.50 -		    dst[1] = d >> 8;					\
    5.51 -		    dst[2] = d >> 16;					\
    5.52 +		    dst[0] = (Uint8)d;						\
    5.53 +		    dst[1] = (Uint8)(d >> 8);					\
    5.54 +		    dst[2] = (Uint8)(d >> 16);					\
    5.55  		}							\
    5.56  		break;							\
    5.57  	    case 4:							\
    5.58 @@ -575,10 +575,10 @@
    5.59  /* helper: blend a single 16 bit pixel at 50% */
    5.60  #define BLEND16_50(dst, src, mask)			\
    5.61      do {						\
    5.62 -        Uint32 s = *src++;				\
    5.63 +	Uint32 s = *src++;				\
    5.64  	Uint32 d = *dst;				\
    5.65 -	*dst++ = (((s & mask) + (d & mask)) >> 1)	\
    5.66 -	         + (s & d & (~mask & 0xffff));		\
    5.67 +	*dst++ = (Uint16)((((s & mask) + (d & mask)) >> 1) +	\
    5.68 +	                  (s & d & (~mask & 0xffff)));		\
    5.69      } while(0)
    5.70  
    5.71  /* basic 16bpp blender. mask is the pixels to keep when adding. */
    5.72 @@ -971,32 +971,32 @@
    5.73   */
    5.74  #define BLIT_TRANSL_565(src, dst)		\
    5.75      do {					\
    5.76 -        Uint32 s = src;				\
    5.77 +	Uint32 s = src;				\
    5.78  	Uint32 d = dst;				\
    5.79  	unsigned alpha = (s & 0x3e0) >> 5;	\
    5.80  	s &= 0x07e0f81f;			\
    5.81  	d = (d | d << 16) & 0x07e0f81f;		\
    5.82  	d += (s - d) * alpha >> 5;		\
    5.83  	d &= 0x07e0f81f;			\
    5.84 -	dst = d | d >> 16;			\
    5.85 +	dst = (Uint16)(d | d >> 16);			\
    5.86      } while(0)
    5.87  
    5.88  #define BLIT_TRANSL_555(src, dst)		\
    5.89      do {					\
    5.90 -        Uint32 s = src;				\
    5.91 +	Uint32 s = src;				\
    5.92  	Uint32 d = dst;				\
    5.93  	unsigned alpha = (s & 0x3e0) >> 5;	\
    5.94  	s &= 0x03e07c1f;			\
    5.95  	d = (d | d << 16) & 0x03e07c1f;		\
    5.96  	d += (s - d) * alpha >> 5;		\
    5.97  	d &= 0x03e07c1f;			\
    5.98 -	dst = d | d >> 16;			\
    5.99 +	dst = (Uint16)(d | d >> 16);			\
   5.100      } while(0)
   5.101  
   5.102  /* used to save the destination format in the encoding. Designed to be
   5.103     macro-compatible with SDL_PixelFormat but without the unneeded fields */
   5.104  typedef struct {
   5.105 -    	Uint8  BytesPerPixel;
   5.106 +	Uint8  BytesPerPixel;
   5.107  	Uint8  Rloss;
   5.108  	Uint8  Gloss;
   5.109  	Uint8  Bloss;
     6.1 --- a/src/video/SDL_blit_A.c	Fri Feb 24 17:03:06 2006 +0000
     6.2 +++ b/src/video/SDL_blit_A.c	Fri Feb 24 18:24:57 2006 +0000
     6.3 @@ -1483,9 +1483,9 @@
     6.4  			if(w) {
     6.5  				Uint16 d = *dstp, s;
     6.6  				if(SDL_BYTEORDER == SDL_BIG_ENDIAN)
     6.7 -					s = prev_sw;
     6.8 +					s = (Uint16)prev_sw;
     6.9  				else
    6.10 -					s = prev_sw >> 16;
    6.11 +					s = (Uint16)(prev_sw >> 16);
    6.12  				*dstp = BLEND16_50(d, s, mask);
    6.13  				srcp++;
    6.14  				dstp++;
    6.15 @@ -1858,7 +1858,7 @@
    6.16  				d = (d | d << 16) & 0x07e0f81f;
    6.17  				d += (s - d) * alpha >> 5;
    6.18  				d &= 0x07e0f81f;
    6.19 -				*dstp++ = d | d >> 16;
    6.20 +				*dstp++ = (Uint16)(d | d >> 16);
    6.21  			}, width);
    6.22  			srcp += srcskip;
    6.23  			dstp += dstskip;
    6.24 @@ -1894,7 +1894,7 @@
    6.25  				d = (d | d << 16) & 0x03e07c1f;
    6.26  				d += (s - d) * alpha >> 5;
    6.27  				d &= 0x03e07c1f;
    6.28 -				*dstp++ = d | d >> 16;
    6.29 +				*dstp++ = (Uint16)(d | d >> 16);
    6.30  			}, width);
    6.31  			srcp += srcskip;
    6.32  			dstp += dstskip;
    6.33 @@ -1922,8 +1922,7 @@
    6.34  		   Benchmark this! */
    6.35  		if(alpha) {   
    6.36  		  if(alpha == (SDL_ALPHA_OPAQUE >> 3)) {
    6.37 -		    *dstp = (s >> 8 & 0xf800) + (s >> 5 & 0x7e0)
    6.38 -			  + (s >> 3  & 0x1f);
    6.39 +		    *dstp = (Uint16)((s >> 8 & 0xf800) + (s >> 5 & 0x7e0) + (s >> 3  & 0x1f));
    6.40  		  } else {
    6.41  		    Uint32 d = *dstp;
    6.42  		    /*
    6.43 @@ -1935,7 +1934,7 @@
    6.44  		    d = (d | d << 16) & 0x07e0f81f;
    6.45  		    d += (s - d) * alpha >> 5;
    6.46  		    d &= 0x07e0f81f;
    6.47 -		    *dstp = d | d >> 16;
    6.48 +		    *dstp = (Uint16)(d | d >> 16);
    6.49  		  }
    6.50  		}
    6.51  		srcp++;
    6.52 @@ -1967,8 +1966,7 @@
    6.53  		   Benchmark this! */
    6.54  		if(alpha) {   
    6.55  		  if(alpha == (SDL_ALPHA_OPAQUE >> 3)) {
    6.56 -		    *dstp = (s >> 9 & 0x7c00) + (s >> 6 & 0x3e0)
    6.57 -			  + (s >> 3  & 0x1f);
    6.58 +		    *dstp = (Uint16)((s >> 9 & 0x7c00) + (s >> 6 & 0x3e0) + (s >> 3  & 0x1f));
    6.59  		  } else {
    6.60  		    Uint32 d = *dstp;
    6.61  		    /*
    6.62 @@ -1980,7 +1978,7 @@
    6.63  		    d = (d | d << 16) & 0x03e07c1f;
    6.64  		    d += (s - d) * alpha >> 5;
    6.65  		    d &= 0x03e07c1f;
    6.66 -		    *dstp = d | d >> 16;
    6.67 +		    *dstp = (Uint16)(d | d >> 16);
    6.68  		  }
    6.69  		}
    6.70  		srcp++;
     7.1 --- a/src/video/SDL_blit_N.c	Fri Feb 24 17:03:06 2006 +0000
     7.2 +++ b/src/video/SDL_blit_N.c	Fri Feb 24 18:24:57 2006 +0000
     7.3 @@ -858,9 +858,9 @@
     7.4  
     7.5  /* Special optimized blit for RGB 8-8-8 --> RGB 3-3-2 */
     7.6  #define RGB888_RGB332(dst, src) { \
     7.7 -	dst = (((src)&0x00E00000)>>16)| \
     7.8 -	      (((src)&0x0000E000)>>11)| \
     7.9 -	      (((src)&0x000000C0)>>6); \
    7.10 +	dst = (Uint8)((((src)&0x00E00000)>>16)| \
    7.11 +	              (((src)&0x0000E000)>>11)| \
    7.12 +	              (((src)&0x000000C0)>>6)); \
    7.13  }
    7.14  static void Blit_RGB888_index8(SDL_BlitInfo *info)
    7.15  {
    7.16 @@ -962,9 +962,9 @@
    7.17  }
    7.18  /* Special optimized blit for RGB 8-8-8 --> RGB 5-5-5 */
    7.19  #define RGB888_RGB555(dst, src) { \
    7.20 -	*(Uint16 *)(dst) = (((*src)&0x00F80000)>>9)| \
    7.21 -	                   (((*src)&0x0000F800)>>6)| \
    7.22 -	                   (((*src)&0x000000F8)>>3); \
    7.23 +	*(Uint16 *)(dst) = (Uint16)((((*src)&0x00F80000)>>9)| \
    7.24 +	                            (((*src)&0x0000F800)>>6)| \
    7.25 +	                            (((*src)&0x000000F8)>>3)); \
    7.26  }
    7.27  #define RGB888_RGB555_TWO(dst, src) { \
    7.28  	*(Uint32 *)(dst) = (((((src[HI])&0x00F80000)>>9)| \
    7.29 @@ -1082,9 +1082,9 @@
    7.30  }
    7.31  /* Special optimized blit for RGB 8-8-8 --> RGB 5-6-5 */
    7.32  #define RGB888_RGB565(dst, src) { \
    7.33 -	*(Uint16 *)(dst) = (((*src)&0x00F80000)>>8)| \
    7.34 -	                   (((*src)&0x0000FC00)>>5)| \
    7.35 -	                   (((*src)&0x000000F8)>>3); \
    7.36 +	*(Uint16 *)(dst) = (Uint16)((((*src)&0x00F80000)>>8)| \
    7.37 +	                            (((*src)&0x0000FC00)>>5)| \
    7.38 +	                            (((*src)&0x000000F8)>>3)); \
    7.39  }
    7.40  #define RGB888_RGB565_TWO(dst, src) { \
    7.41  	*(Uint32 *)(dst) = (((((src[HI])&0x00F80000)>>8)| \
    7.42 @@ -2101,7 +2101,7 @@
    7.43  	Uint32 rgbmask = ~srcfmt->Amask;
    7.44  	int srcbpp;
    7.45  	Uint32 Pixel;
    7.46 -	Uint8  sR, sG, sB;
    7.47 +	unsigned sR, sG, sB;
    7.48  
    7.49  	/* Set up some basic variables */
    7.50  	srcbpp = srcfmt->BytesPerPixel;
    7.51 @@ -2115,9 +2115,9 @@
    7.52  								sR, sG, sB);
    7.53  				if ( (Pixel & rgbmask) != ckey ) {
    7.54  				  	/* Pack RGB into 8bit pixel */
    7.55 -				  	*dst = ((sR>>5)<<(3+2))|
    7.56 -						((sG>>5)<<(2)) |
    7.57 -						((sB>>6)<<(0)) ;
    7.58 +				  	*dst = (Uint8)(((sR>>5)<<(3+2))|
    7.59 +						           ((sG>>5)<<(2)) |
    7.60 +						           ((sB>>6)<<(0)));
    7.61  				}
    7.62  				dst++;
    7.63  				src += srcbpp;
    7.64 @@ -2134,9 +2134,9 @@
    7.65  								sR, sG, sB);
    7.66  				if ( (Pixel & rgbmask) != ckey ) {
    7.67  				  	/* Pack RGB into 8bit pixel */
    7.68 -				  	*dst = palmap[((sR>>5)<<(3+2))|
    7.69 -							((sG>>5)<<(2))  |
    7.70 -							((sB>>6)<<(0))  ];
    7.71 +				  	*dst = (Uint8)palmap[((sR>>5)<<(3+2))|
    7.72 +							             ((sG>>5)<<(2))  |
    7.73 +							             ((sB>>6)<<(0))  ];
    7.74  				}
    7.75  				dst++;
    7.76  				src += srcbpp;
    7.77 @@ -2232,7 +2232,7 @@
    7.78  	Uint8 srcbpp;
    7.79  	Uint8 dstbpp;
    7.80  	Uint32 Pixel;
    7.81 -	Uint8  sR, sG, sB, sA;
    7.82 +	unsigned sR, sG, sB, sA;
    7.83  
    7.84  	/* Set up some basic variables */
    7.85  	srcbpp = srcfmt->BytesPerPixel;
     8.1 --- a/src/video/SDL_cursor.c	Fri Feb 24 17:03:06 2006 +0000
     8.2 +++ b/src/video/SDL_cursor.c	Fri Feb 24 18:24:57 2006 +0000
     8.3 @@ -331,7 +331,7 @@
     8.4  
     8.5  /* Keep track of the current cursor colors */
     8.6  static int palette_changed = 1;
     8.7 -static Uint32 pixels8[2];
     8.8 +static Uint8 pixels8[2];
     8.9  
    8.10  void SDL_CursorPaletteChanged(void)
    8.11  {
    8.12 @@ -377,8 +377,8 @@
    8.13  		int dstskip;
    8.14  
    8.15  		if ( palette_changed ) {
    8.16 -			pixels8[0] = SDL_MapRGB(screen->format, 255, 255, 255);
    8.17 -			pixels8[1] = SDL_MapRGB(screen->format, 0, 0, 0);
    8.18 +			pixels8[0] = (Uint8)SDL_MapRGB(screen->format, 255, 255, 255);
    8.19 +			pixels8[1] = (Uint8)SDL_MapRGB(screen->format, 0, 0, 0);
    8.20  			palette_changed = 0;
    8.21  		}
    8.22  		dst = (Uint8 *)screen->pixels +
    8.23 @@ -419,7 +419,7 @@
    8.24  				datab = *data++;
    8.25  				for ( i=0; i<8; ++i ) {
    8.26  					if ( maskb & 0x80 ) {
    8.27 -						*dst = pixels[datab>>7];
    8.28 +						*dst = (Uint16)pixels[datab>>7];
    8.29  					}
    8.30  					maskb <<= 1;
    8.31  					datab <<= 1;
    8.32 @@ -509,8 +509,8 @@
    8.33  	maxx = area->x+area->w;
    8.34  	if ( screen->format->BytesPerPixel == 1 ) {
    8.35  		if ( palette_changed ) {
    8.36 -			pixels8[0] = SDL_MapRGB(screen->format, 255, 255, 255);
    8.37 -			pixels8[1] = SDL_MapRGB(screen->format, 0, 0, 0);
    8.38 +			pixels8[0] = (Uint8)SDL_MapRGB(screen->format, 255, 255, 255);
    8.39 +			pixels8[1] = (Uint8)SDL_MapRGB(screen->format, 0, 0, 0);
    8.40  			palette_changed = 0;
    8.41  		}
    8.42  		for ( h=area->h; h; h-- ) {
     9.1 --- a/src/video/SDL_surface.c	Fri Feb 24 17:03:06 2006 +0000
     9.2 +++ b/src/video/SDL_surface.c	Fri Feb 24 18:24:57 2006 +0000
     9.3 @@ -687,7 +687,7 @@
     9.4  		    case 2:
     9.5  			for ( y=dstrect->h; y; --y ) {
     9.6  				Uint16 *pixels = (Uint16 *)row;
     9.7 -				Uint16 c = color;
     9.8 +				Uint16 c = (Uint16)color;
     9.9  				Uint32 cc = (Uint32)c << 16 | c;
    9.10  				int n = dstrect->w;
    9.11  				if((unsigned long)pixels & 3) {
    10.1 --- a/src/video/SDL_video.c	Fri Feb 24 17:03:06 2006 +0000
    10.2 +++ b/src/video/SDL_video.c	Fri Feb 24 18:24:57 2006 +0000
    10.3 @@ -995,10 +995,10 @@
    10.4  			return;
    10.5  
    10.6  		/* Fill the rectangle */
    10.7 -		rect.x = x;
    10.8 -		rect.y = y;
    10.9 -		rect.w = w;
   10.10 -		rect.h = h;
   10.11 +		rect.x = (Sint16)x;
   10.12 +		rect.y = (Sint16)y;
   10.13 +		rect.w = (Uint16)w;
   10.14 +		rect.h = (Uint16)h;
   10.15  		SDL_UpdateRects(screen, 1, &rect);
   10.16  	}
   10.17  }
    11.1 --- a/src/video/SDL_yuv_sw.c	Fri Feb 24 17:03:06 2006 +0000
    11.2 +++ b/src/video/SDL_yuv_sw.c	Fri Feb 24 18:24:57 2006 +0000
    11.3 @@ -167,27 +167,27 @@
    11.4              ++cr; ++cb;
    11.5  
    11.6              L = *lum++;
    11.7 -            *row1++ = (rgb_2_pix[ L + cr_r ] |
    11.8 -                       rgb_2_pix[ L + crb_g ] |
    11.9 -                       rgb_2_pix[ L + cb_b ]);
   11.10 +            *row1++ = (unsigned short)(rgb_2_pix[ L + cr_r ] |
   11.11 +                                       rgb_2_pix[ L + crb_g ] |
   11.12 +                                       rgb_2_pix[ L + cb_b ]);
   11.13  
   11.14              L = *lum++;
   11.15 -            *row1++ = (rgb_2_pix[ L + cr_r ] |
   11.16 -                       rgb_2_pix[ L + crb_g ] |
   11.17 -                       rgb_2_pix[ L + cb_b ]);
   11.18 +            *row1++ = (unsigned short)(rgb_2_pix[ L + cr_r ] |
   11.19 +                                       rgb_2_pix[ L + crb_g ] |
   11.20 +                                       rgb_2_pix[ L + cb_b ]);
   11.21  
   11.22  
   11.23              /* Now, do second row.  */
   11.24  
   11.25              L = *lum2++;
   11.26 -            *row2++ = (rgb_2_pix[ L + cr_r ] |
   11.27 -                       rgb_2_pix[ L + crb_g ] |
   11.28 -                       rgb_2_pix[ L + cb_b ]);
   11.29 +            *row2++ = (unsigned short)(rgb_2_pix[ L + cr_r ] |
   11.30 +                                       rgb_2_pix[ L + crb_g ] |
   11.31 +                                       rgb_2_pix[ L + cb_b ]);
   11.32  
   11.33              L = *lum2++;
   11.34 -            *row2++ = (rgb_2_pix[ L + cr_r ] |
   11.35 -                       rgb_2_pix[ L + crb_g ] |
   11.36 -                       rgb_2_pix[ L + cb_b ]);
   11.37 +            *row2++ = (unsigned short)(rgb_2_pix[ L + cr_r ] |
   11.38 +                                       rgb_2_pix[ L + crb_g ] |
   11.39 +                                       rgb_2_pix[ L + cb_b ]);
   11.40          }
   11.41  
   11.42          /*
   11.43 @@ -638,14 +638,14 @@
   11.44              cr += 4; cb += 4;
   11.45  
   11.46              L = *lum; lum += 2;
   11.47 -            *row++ = (rgb_2_pix[ L + cr_r ] |
   11.48 -                       rgb_2_pix[ L + crb_g ] |
   11.49 -                       rgb_2_pix[ L + cb_b ]);
   11.50 +            *row++ = (unsigned short)(rgb_2_pix[ L + cr_r ] |
   11.51 +                                      rgb_2_pix[ L + crb_g ] |
   11.52 +                                      rgb_2_pix[ L + cb_b ]);
   11.53  
   11.54              L = *lum; lum += 2;
   11.55 -            *row++ = (rgb_2_pix[ L + cr_r ] |
   11.56 -                       rgb_2_pix[ L + crb_g ] |
   11.57 -                       rgb_2_pix[ L + cb_b ]);
   11.58 +            *row++ = (unsigned short)(rgb_2_pix[ L + cr_r ] |
   11.59 +                                      rgb_2_pix[ L + crb_g ] |
   11.60 +                                      rgb_2_pix[ L + cb_b ]);
   11.61  
   11.62          }
   11.63  
    12.1 --- a/src/video/wincommon/SDL_sysevents.c	Fri Feb 24 17:03:06 2006 +0000
    12.2 +++ b/src/video/wincommon/SDL_sysevents.c	Fri Feb 24 18:24:57 2006 +0000
    12.3 @@ -78,7 +78,7 @@
    12.4  static int codepage;
    12.5  static int Is9xME();
    12.6  static int GetCodePage();
    12.7 -static int WINAPI ToUnicode9xME(UINT vkey, UINT scancode, BYTE *keystate, Uint16 *wchars, int wsize, UINT flags);
    12.8 +static int WINAPI ToUnicode9xME(UINT vkey, UINT scancode, BYTE *keystate, LPWSTR wchars, int wsize, UINT flags);
    12.9  
   12.10  ToUnicodeFN SDL_ToUnicode = ToUnicode9xME;
   12.11  #endif /* !NO_GETKEYBOARDSTATE */