summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRyan C. Gordon <icculus@icculus.org>2012-02-07 02:11:15 -0500
committerRyan C. Gordon <icculus@icculus.org>2012-02-07 02:11:15 -0500
commitaf406689fd28698d2a1d7d1febfb9377c7a9fa01 (patch)
tree8985d3a0a53a5219822abbda92d6a7f3a7a136cf /src
parent0b3a9da088a5dd0028348cd69196fea48a4e6a04 (diff)
Replaced some assert macros with SDL_assert.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/audio/SDL_audiocvt.c13
-rwxr-xr-xsrc/audio/coreaudio/SDL_coreaudio.c5
-rw-r--r--src/stdlib/SDL_qsort.c3
-rwxr-xr-xsrc/video/SDL_blit_A.c1
-rwxr-xr-xsrc/video/SDL_blit_N.c35
-rwxr-xr-xsrc/video/cocoa/SDL_cocoashape.m5
-rwxr-xr-xsrc/video/x11/SDL_x11opengl.c2
7 files changed, 31 insertions, 33 deletions
diff --git a/src/audio/SDL_audiocvt.c b/src/audio/SDL_audiocvt.c
index 870d8cd2..b069543e 100755
--- a/src/audio/SDL_audiocvt.c
+++ b/src/audio/SDL_audiocvt.c
@@ -25,12 +25,9 @@
#include "SDL_audio.h"
#include "SDL_audio_c.h"
-/* #define DEBUG_CONVERT */
+#include "SDL_assert.h"
-/* !!! FIXME */
-#ifndef assert
-#define assert(x)
-#endif
+/* #define DEBUG_CONVERT */
/* Effectively mix right and left channels into a single channel */
static void SDLCALL
@@ -881,9 +878,9 @@ SDL_FindFrequencyMultiple(const int src_rate, const int dst_rate)
int lo, hi;
int div;
- assert(src_rate != 0);
- assert(dst_rate != 0);
- assert(src_rate != dst_rate);
+ SDL_assert(src_rate != 0);
+ SDL_assert(dst_rate != 0);
+ SDL_assert(src_rate != dst_rate);
if (src_rate < dst_rate) {
lo = src_rate;
diff --git a/src/audio/coreaudio/SDL_coreaudio.c b/src/audio/coreaudio/SDL_coreaudio.c
index dfcbe389..53d3a08f 100755
--- a/src/audio/coreaudio/SDL_coreaudio.c
+++ b/src/audio/coreaudio/SDL_coreaudio.c
@@ -23,6 +23,7 @@
#include "../SDL_audio_c.h"
#include "../SDL_sysaudio.h"
#include "SDL_coreaudio.h"
+#include "SDL_assert.h"
#define DEBUG_COREAUDIO 0
@@ -268,8 +269,8 @@ outputCallback(void *inRefCon,
any input format in OpenAudio, and leave the conversion to CoreAudio.
*/
/*
- assert(!this->convert.needed);
- assert(this->spec.channels == ioData->mNumberChannels);
+ SDL_assert(!this->convert.needed);
+ SDL_assert(this->spec.channels == ioData->mNumberChannels);
*/
for (i = 0; i < ioData->mNumberBuffers; i++) {
diff --git a/src/stdlib/SDL_qsort.c b/src/stdlib/SDL_qsort.c
index b91be69c..6d56c675 100644
--- a/src/stdlib/SDL_qsort.c
+++ b/src/stdlib/SDL_qsort.c
@@ -49,11 +49,12 @@
#include <string.h>
*/
#include "SDL_stdinc.h"
+#include "SDL_assert.h"
#ifdef assert
#undef assert
#endif
-#define assert(X)
+#define assert(X) SDL_assert(X)
#ifdef malloc
#undef malloc
#endif
diff --git a/src/video/SDL_blit_A.c b/src/video/SDL_blit_A.c
index 9242be7f..d8537ee7 100755
--- a/src/video/SDL_blit_A.c
+++ b/src/video/SDL_blit_A.c
@@ -424,7 +424,6 @@ BlitRGBtoRGBPixelAlphaMMX(SDL_BlitInfo * info)
#if HAVE_ALTIVEC_H
#include <altivec.h>
#endif
-#include <assert.h>
#if (defined(__MACOSX__) && (__GNUC__ < 4))
#define VECUINT8_LITERAL(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \
diff --git a/src/video/SDL_blit_N.c b/src/video/SDL_blit_N.c
index b52e2fe5..309cdeb7 100755
--- a/src/video/SDL_blit_N.c
+++ b/src/video/SDL_blit_N.c
@@ -25,13 +25,14 @@
#include "SDL_cpuinfo.h"
#include "SDL_blit.h"
+#include "SDL_assert.h"
+
/* Functions to blit from N-bit surfaces to other surfaces */
#if SDL_ALTIVEC_BLITTERS
#ifdef HAVE_ALTIVEC_H
#include <altivec.h>
#endif
-#define assert(X)
#ifdef __MACOSX__
#include <sys/sysctl.h>
static size_t
@@ -243,7 +244,7 @@ Blit_RGB888_RGB565Altivec(SDL_BlitInfo * info)
vsrc = voverflow;
}
- assert(width == 0);
+ SDL_assert(width == 0);
/* do scalar until we can align... */
ONE_PIXEL_BLEND((extrawidth), extrawidth);
@@ -312,9 +313,8 @@ Blit_RGB565_32Altivec(SDL_BlitInfo * info)
char) (vec_add((vector unsigned int) vgreen1, vec_sl(v8, v8))
);
-
- assert(srcfmt->BytesPerPixel == 2);
- assert(dstfmt->BytesPerPixel == 4);
+ SDL_assert(srcfmt->BytesPerPixel == 2);
+ SDL_assert(dstfmt->BytesPerPixel == 4);
vf800 = (vector unsigned short) vec_splat_u8(-7);
vf800 = vec_sl(vf800, vec_splat_u16(8));
@@ -390,7 +390,7 @@ Blit_RGB565_32Altivec(SDL_BlitInfo * info)
vsrc = voverflow;
}
- assert(width == 0);
+ SDL_assert(width == 0);
/* do scalar until we can align... */
@@ -460,9 +460,8 @@ Blit_RGB555_32Altivec(SDL_BlitInfo * info)
char) (vec_add((vector unsigned int) vgreen1, vec_sl(v8, v8))
);
-
- assert(srcfmt->BytesPerPixel == 2);
- assert(dstfmt->BytesPerPixel == 4);
+ SDL_assert(srcfmt->BytesPerPixel == 2);
+ SDL_assert(dstfmt->BytesPerPixel == 4);
vf800 = (vector unsigned short) vec_splat_u8(-7);
vf800 = vec_sl(vf800, vec_splat_u16(8));
@@ -538,7 +537,7 @@ Blit_RGB555_32Altivec(SDL_BlitInfo * info)
vsrc = voverflow;
}
- assert(width == 0);
+ SDL_assert(width == 0);
/* do scalar until we can align... */
@@ -630,13 +629,13 @@ Blit32to32KeyAltivec(SDL_BlitInfo * info)
}
int width = info->dst_w;
ONE_PIXEL_BLEND((UNALIGNED_PTR(dstp)) && (width), width);
- assert(width > 0);
+ SDL_assert(width > 0);
if (width > 0) {
int extrawidth = (width % 4);
vector unsigned char valigner = VEC_ALIGNER(srcp);
vector unsigned int vs = vec_ld(0, srcp);
width -= extrawidth;
- assert(width >= 4);
+ SDL_assert(width >= 4);
while (width) {
vector unsigned char vsel;
vector unsigned int vd;
@@ -691,8 +690,8 @@ ConvertAltivec32to32_noprefetch(SDL_BlitInfo * info)
}
}
- assert(srcfmt->BytesPerPixel == 4);
- assert(dstfmt->BytesPerPixel == 4);
+ SDL_assert(srcfmt->BytesPerPixel == 4);
+ SDL_assert(dstfmt->BytesPerPixel == 4);
while (height--) {
vector unsigned char valigner;
@@ -729,7 +728,7 @@ ConvertAltivec32to32_noprefetch(SDL_BlitInfo * info)
vbits = voverflow;
}
- assert(width == 0);
+ SDL_assert(width == 0);
/* cover pixels at the end of the row that didn't fit in 16 bytes. */
while (extrawidth) {
@@ -770,8 +769,8 @@ ConvertAltivec32to32_prefetch(SDL_BlitInfo * info)
}
}
- assert(srcfmt->BytesPerPixel == 4);
- assert(dstfmt->BytesPerPixel == 4);
+ SDL_assert(srcfmt->BytesPerPixel == 4);
+ SDL_assert(dstfmt->BytesPerPixel == 4);
while (height--) {
vector unsigned char valigner;
@@ -816,7 +815,7 @@ ConvertAltivec32to32_prefetch(SDL_BlitInfo * info)
vbits = voverflow;
}
- assert(width == 0);
+ SDL_assert(width == 0);
/* cover pixels at the end of the row that didn't fit in 16 bytes. */
while (extrawidth) {
diff --git a/src/video/cocoa/SDL_cocoashape.m b/src/video/cocoa/SDL_cocoashape.m
index da62f1ec..afada6cc 100755
--- a/src/video/cocoa/SDL_cocoashape.m
+++ b/src/video/cocoa/SDL_cocoashape.m
@@ -27,6 +27,7 @@
#include "SDL_shape.h"
#include "SDL_cocoashape.h"
#include "../SDL_sysvideo.h"
+#include "SDL_assert.h"
SDL_WindowShaper*
Cocoa_CreateShaper(SDL_Window* window) {
@@ -49,7 +50,7 @@ Cocoa_CreateShaper(SDL_Window* window) {
data->shape = NULL;
int resized_properly = Cocoa_ResizeWindowShape(window);
- assert(resized_properly == 0);
+ SDL_assert(resized_properly == 0);
return result;
}
@@ -100,7 +101,7 @@ Cocoa_SetWindowShape(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowShape
int
Cocoa_ResizeWindowShape(SDL_Window *window) {
SDL_ShapeData* data = window->shaper->driverdata;
- assert(data != NULL);
+ SDL_assert(data != NULL);
return 0;
}
diff --git a/src/video/x11/SDL_x11opengl.c b/src/video/x11/SDL_x11opengl.c
index f3875f0c..08a18971 100755
--- a/src/video/x11/SDL_x11opengl.c
+++ b/src/video/x11/SDL_x11opengl.c
@@ -311,7 +311,7 @@ X11_GL_GetAttributes(_THIS, Display * display, int screen, int * attribs, int si
int i = 0;
/* assert buffer is large enough to hold all SDL attributes. */
- /* assert(size >= 32);*/
+ SDL_assert(size >= 32);
/* Setup our GLX attributes according to the gl_config. */
attribs[i++] = GLX_RGBA;