Add explicit unsigned int and char types in (for bug 4290)
authorSylvain Becker <sylvain.becker@gmail.com>
Wed, 30 Jan 2019 15:31:07 +0100
changeset 12583338b02acfdfc
parent 12582 57b136cff952
child 12584 233b2a61cad1
Add explicit unsigned int and char types in (for bug 4290)
src/video/SDL_blit_N.c
     1.1 --- a/src/video/SDL_blit_N.c	Wed Jan 30 15:23:33 2019 +0100
     1.2 +++ b/src/video/SDL_blit_N.c	Wed Jan 30 15:31:07 2019 +0100
     1.3 @@ -2532,16 +2532,16 @@
     1.4  
     1.5      if (dstfmt->Amask) {
     1.6          /* SET_ALPHA */
     1.7 -        unsigned alpha = info->a;
     1.8 -        int alphashift = alpha << 24;
     1.9 +        Uint32 alpha = info->a;
    1.10 +        Uint32 alphashift = alpha << 24;
    1.11          while (height--) {
    1.12              /* *INDENT-OFF* */
    1.13              DUFFS_LOOP(
    1.14              {
    1.15                  Uint32  *dst32 = (Uint32*)dst;
    1.16 -                unsigned s0 = src[0];
    1.17 -                unsigned s1 = src[1];
    1.18 -                unsigned s2 = src[2];
    1.19 +                Uint8 s0 = src[0];
    1.20 +                Uint8 s1 = src[1];
    1.21 +                Uint8 s2 = src[2];
    1.22                  *dst32 = (s0) | (s1 << 8) | (s2 << 16) | alphashift;
    1.23                  dst += dstbpp;
    1.24                  src += srcbpp;
    1.25 @@ -2557,9 +2557,9 @@
    1.26              DUFFS_LOOP(
    1.27              {
    1.28                  Uint32  *dst32 = (Uint32*)dst;
    1.29 -                unsigned s0 = src[0];
    1.30 -                unsigned s1 = src[1];
    1.31 -                unsigned s2 = src[2];
    1.32 +                Uint8 s0 = src[0];
    1.33 +                Uint8 s1 = src[1];
    1.34 +                Uint8 s2 = src[2];
    1.35                  *dst32 = (s0) | (s1 << 8) | (s2 << 16);
    1.36                  dst += dstbpp;
    1.37                  src += srcbpp;
    1.38 @@ -2597,10 +2597,10 @@
    1.39                  DUFFS_LOOP(
    1.40                  {
    1.41                      Uint32  *dst32 = (Uint32*)dst;
    1.42 -                    unsigned s0 = src[0];
    1.43 -                    unsigned s1 = src[1];
    1.44 -                    unsigned s2 = src[2];
    1.45 -                    unsigned alphashift = src[3] << 24;
    1.46 +                    Uint8 s0 = src[0];
    1.47 +                    Uint8 s1 = src[1];
    1.48 +                    Uint8 s2 = src[2];
    1.49 +                    Uint32 alphashift = src[3] << 24;
    1.50                      /* inversed, compared to Blit_3or4_to_3or4__same_rgb */
    1.51                      *dst32 = (s0 << 16) | (s1 << 8) | (s2) | alphashift;
    1.52                      dst += dstbpp;
    1.53 @@ -2612,16 +2612,16 @@
    1.54              }
    1.55          } else {
    1.56              /* SET_ALPHA */
    1.57 -            unsigned alpha = info->a;
    1.58 -            int alphashift = alpha << 24;
    1.59 +            Uint32 alpha = info->a;
    1.60 +            Uint32 alphashift = alpha << 24;
    1.61              while (height--) {
    1.62                  /* *INDENT-OFF* */
    1.63                  DUFFS_LOOP(
    1.64                  {
    1.65                      Uint32  *dst32 = (Uint32*)dst;
    1.66 -                    unsigned s0 = src[0];
    1.67 -                    unsigned s1 = src[1];
    1.68 -                    unsigned s2 = src[2];
    1.69 +                    Uint8 s0 = src[0];
    1.70 +                    Uint8 s1 = src[1];
    1.71 +                    Uint8 s2 = src[2];
    1.72                      /* inversed, compared to Blit_3or4_to_3or4__same_rgb */
    1.73                      *dst32 = (s0 << 16) | (s1 << 8) | (s2) | alphashift;
    1.74                      dst += dstbpp;
    1.75 @@ -2639,9 +2639,9 @@
    1.76              DUFFS_LOOP(
    1.77              {
    1.78                  Uint32  *dst32 = (Uint32*)dst;
    1.79 -                unsigned s0 = src[0];
    1.80 -                unsigned s1 = src[1];
    1.81 -                unsigned s2 = src[2];
    1.82 +                Uint8 s0 = src[0];
    1.83 +                Uint8 s1 = src[1];
    1.84 +                Uint8 s2 = src[2];
    1.85                  /* inversed, compared to Blit_3or4_to_3or4__same_rgb */
    1.86                  *dst32 = (s0 << 16) | (s1 << 8) | (s2);
    1.87                  dst += dstbpp;