src/video/SDL_blit_N.c
changeset 6281 e46d6f4b469e
parent 6165 b7347e716ab6
child 6295 a2c60beb6115
     1.1 --- a/src/video/SDL_blit_N.c	Tue Feb 07 01:26:00 2012 -0500
     1.2 +++ b/src/video/SDL_blit_N.c	Tue Feb 07 02:11:15 2012 -0500
     1.3 @@ -25,13 +25,14 @@
     1.4  #include "SDL_cpuinfo.h"
     1.5  #include "SDL_blit.h"
     1.6  
     1.7 +#include "SDL_assert.h"
     1.8 +
     1.9  /* Functions to blit from N-bit surfaces to other surfaces */
    1.10  
    1.11  #if SDL_ALTIVEC_BLITTERS
    1.12  #ifdef HAVE_ALTIVEC_H
    1.13  #include <altivec.h>
    1.14  #endif
    1.15 -#define assert(X)
    1.16  #ifdef __MACOSX__
    1.17  #include <sys/sysctl.h>
    1.18  static size_t
    1.19 @@ -243,7 +244,7 @@
    1.20              vsrc = voverflow;
    1.21          }
    1.22  
    1.23 -        assert(width == 0);
    1.24 +        SDL_assert(width == 0);
    1.25  
    1.26          /* do scalar until we can align... */
    1.27          ONE_PIXEL_BLEND((extrawidth), extrawidth);
    1.28 @@ -312,9 +313,8 @@
    1.29           char) (vec_add((vector unsigned int) vgreen1, vec_sl(v8, v8))
    1.30          );
    1.31  
    1.32 -
    1.33 -    assert(srcfmt->BytesPerPixel == 2);
    1.34 -    assert(dstfmt->BytesPerPixel == 4);
    1.35 +    SDL_assert(srcfmt->BytesPerPixel == 2);
    1.36 +    SDL_assert(dstfmt->BytesPerPixel == 4);
    1.37  
    1.38      vf800 = (vector unsigned short) vec_splat_u8(-7);
    1.39      vf800 = vec_sl(vf800, vec_splat_u16(8));
    1.40 @@ -390,7 +390,7 @@
    1.41              vsrc = voverflow;
    1.42          }
    1.43  
    1.44 -        assert(width == 0);
    1.45 +        SDL_assert(width == 0);
    1.46  
    1.47  
    1.48          /* do scalar until we can align... */
    1.49 @@ -460,9 +460,8 @@
    1.50           char) (vec_add((vector unsigned int) vgreen1, vec_sl(v8, v8))
    1.51          );
    1.52  
    1.53 -
    1.54 -    assert(srcfmt->BytesPerPixel == 2);
    1.55 -    assert(dstfmt->BytesPerPixel == 4);
    1.56 +    SDL_assert(srcfmt->BytesPerPixel == 2);
    1.57 +    SDL_assert(dstfmt->BytesPerPixel == 4);
    1.58  
    1.59      vf800 = (vector unsigned short) vec_splat_u8(-7);
    1.60      vf800 = vec_sl(vf800, vec_splat_u16(8));
    1.61 @@ -538,7 +537,7 @@
    1.62              vsrc = voverflow;
    1.63          }
    1.64  
    1.65 -        assert(width == 0);
    1.66 +        SDL_assert(width == 0);
    1.67  
    1.68  
    1.69          /* do scalar until we can align... */
    1.70 @@ -630,13 +629,13 @@
    1.71          }
    1.72          int width = info->dst_w;
    1.73          ONE_PIXEL_BLEND((UNALIGNED_PTR(dstp)) && (width), width);
    1.74 -        assert(width > 0);
    1.75 +        SDL_assert(width > 0);
    1.76          if (width > 0) {
    1.77              int extrawidth = (width % 4);
    1.78              vector unsigned char valigner = VEC_ALIGNER(srcp);
    1.79              vector unsigned int vs = vec_ld(0, srcp);
    1.80              width -= extrawidth;
    1.81 -            assert(width >= 4);
    1.82 +            SDL_assert(width >= 4);
    1.83              while (width) {
    1.84                  vector unsigned char vsel;
    1.85                  vector unsigned int vd;
    1.86 @@ -691,8 +690,8 @@
    1.87          }
    1.88      }
    1.89  
    1.90 -    assert(srcfmt->BytesPerPixel == 4);
    1.91 -    assert(dstfmt->BytesPerPixel == 4);
    1.92 +    SDL_assert(srcfmt->BytesPerPixel == 4);
    1.93 +    SDL_assert(dstfmt->BytesPerPixel == 4);
    1.94  
    1.95      while (height--) {
    1.96          vector unsigned char valigner;
    1.97 @@ -729,7 +728,7 @@
    1.98              vbits = voverflow;
    1.99          }
   1.100  
   1.101 -        assert(width == 0);
   1.102 +        SDL_assert(width == 0);
   1.103  
   1.104          /* cover pixels at the end of the row that didn't fit in 16 bytes. */
   1.105          while (extrawidth) {
   1.106 @@ -770,8 +769,8 @@
   1.107          }
   1.108      }
   1.109  
   1.110 -    assert(srcfmt->BytesPerPixel == 4);
   1.111 -    assert(dstfmt->BytesPerPixel == 4);
   1.112 +    SDL_assert(srcfmt->BytesPerPixel == 4);
   1.113 +    SDL_assert(dstfmt->BytesPerPixel == 4);
   1.114  
   1.115      while (height--) {
   1.116          vector unsigned char valigner;
   1.117 @@ -816,7 +815,7 @@
   1.118              vbits = voverflow;
   1.119          }
   1.120  
   1.121 -        assert(width == 0);
   1.122 +        SDL_assert(width == 0);
   1.123  
   1.124          /* cover pixels at the end of the row that didn't fit in 16 bytes. */
   1.125          while (extrawidth) {