Replaced some assert macros with SDL_assert.
This commit is contained in:
parent
067b1ec8a2
commit
df8784cd61
7 changed files with 31 additions and 33 deletions
|
@ -25,12 +25,9 @@
|
||||||
#include "SDL_audio.h"
|
#include "SDL_audio.h"
|
||||||
#include "SDL_audio_c.h"
|
#include "SDL_audio_c.h"
|
||||||
|
|
||||||
/* #define DEBUG_CONVERT */
|
#include "SDL_assert.h"
|
||||||
|
|
||||||
/* !!! FIXME */
|
/* #define DEBUG_CONVERT */
|
||||||
#ifndef assert
|
|
||||||
#define assert(x)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Effectively mix right and left channels into a single channel */
|
/* Effectively mix right and left channels into a single channel */
|
||||||
static void SDLCALL
|
static void SDLCALL
|
||||||
|
@ -881,9 +878,9 @@ SDL_FindFrequencyMultiple(const int src_rate, const int dst_rate)
|
||||||
int lo, hi;
|
int lo, hi;
|
||||||
int div;
|
int div;
|
||||||
|
|
||||||
assert(src_rate != 0);
|
SDL_assert(src_rate != 0);
|
||||||
assert(dst_rate != 0);
|
SDL_assert(dst_rate != 0);
|
||||||
assert(src_rate != dst_rate);
|
SDL_assert(src_rate != dst_rate);
|
||||||
|
|
||||||
if (src_rate < dst_rate) {
|
if (src_rate < dst_rate) {
|
||||||
lo = src_rate;
|
lo = src_rate;
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#include "../SDL_audio_c.h"
|
#include "../SDL_audio_c.h"
|
||||||
#include "../SDL_sysaudio.h"
|
#include "../SDL_sysaudio.h"
|
||||||
#include "SDL_coreaudio.h"
|
#include "SDL_coreaudio.h"
|
||||||
|
#include "SDL_assert.h"
|
||||||
|
|
||||||
#define DEBUG_COREAUDIO 0
|
#define DEBUG_COREAUDIO 0
|
||||||
|
|
||||||
|
@ -268,8 +269,8 @@ outputCallback(void *inRefCon,
|
||||||
any input format in OpenAudio, and leave the conversion to CoreAudio.
|
any input format in OpenAudio, and leave the conversion to CoreAudio.
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
assert(!this->convert.needed);
|
SDL_assert(!this->convert.needed);
|
||||||
assert(this->spec.channels == ioData->mNumberChannels);
|
SDL_assert(this->spec.channels == ioData->mNumberChannels);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
for (i = 0; i < ioData->mNumberBuffers; i++) {
|
for (i = 0; i < ioData->mNumberBuffers; i++) {
|
||||||
|
|
|
@ -49,11 +49,12 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
*/
|
*/
|
||||||
#include "SDL_stdinc.h"
|
#include "SDL_stdinc.h"
|
||||||
|
#include "SDL_assert.h"
|
||||||
|
|
||||||
#ifdef assert
|
#ifdef assert
|
||||||
#undef assert
|
#undef assert
|
||||||
#endif
|
#endif
|
||||||
#define assert(X)
|
#define assert(X) SDL_assert(X)
|
||||||
#ifdef malloc
|
#ifdef malloc
|
||||||
#undef malloc
|
#undef malloc
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -424,7 +424,6 @@ BlitRGBtoRGBPixelAlphaMMX(SDL_BlitInfo * info)
|
||||||
#if HAVE_ALTIVEC_H
|
#if HAVE_ALTIVEC_H
|
||||||
#include <altivec.h>
|
#include <altivec.h>
|
||||||
#endif
|
#endif
|
||||||
#include <assert.h>
|
|
||||||
|
|
||||||
#if (defined(__MACOSX__) && (__GNUC__ < 4))
|
#if (defined(__MACOSX__) && (__GNUC__ < 4))
|
||||||
#define VECUINT8_LITERAL(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \
|
#define VECUINT8_LITERAL(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \
|
||||||
|
|
|
@ -25,13 +25,14 @@
|
||||||
#include "SDL_cpuinfo.h"
|
#include "SDL_cpuinfo.h"
|
||||||
#include "SDL_blit.h"
|
#include "SDL_blit.h"
|
||||||
|
|
||||||
|
#include "SDL_assert.h"
|
||||||
|
|
||||||
/* Functions to blit from N-bit surfaces to other surfaces */
|
/* Functions to blit from N-bit surfaces to other surfaces */
|
||||||
|
|
||||||
#if SDL_ALTIVEC_BLITTERS
|
#if SDL_ALTIVEC_BLITTERS
|
||||||
#ifdef HAVE_ALTIVEC_H
|
#ifdef HAVE_ALTIVEC_H
|
||||||
#include <altivec.h>
|
#include <altivec.h>
|
||||||
#endif
|
#endif
|
||||||
#define assert(X)
|
|
||||||
#ifdef __MACOSX__
|
#ifdef __MACOSX__
|
||||||
#include <sys/sysctl.h>
|
#include <sys/sysctl.h>
|
||||||
static size_t
|
static size_t
|
||||||
|
@ -243,7 +244,7 @@ Blit_RGB888_RGB565Altivec(SDL_BlitInfo * info)
|
||||||
vsrc = voverflow;
|
vsrc = voverflow;
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(width == 0);
|
SDL_assert(width == 0);
|
||||||
|
|
||||||
/* do scalar until we can align... */
|
/* do scalar until we can align... */
|
||||||
ONE_PIXEL_BLEND((extrawidth), extrawidth);
|
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))
|
char) (vec_add((vector unsigned int) vgreen1, vec_sl(v8, v8))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
SDL_assert(srcfmt->BytesPerPixel == 2);
|
||||||
assert(srcfmt->BytesPerPixel == 2);
|
SDL_assert(dstfmt->BytesPerPixel == 4);
|
||||||
assert(dstfmt->BytesPerPixel == 4);
|
|
||||||
|
|
||||||
vf800 = (vector unsigned short) vec_splat_u8(-7);
|
vf800 = (vector unsigned short) vec_splat_u8(-7);
|
||||||
vf800 = vec_sl(vf800, vec_splat_u16(8));
|
vf800 = vec_sl(vf800, vec_splat_u16(8));
|
||||||
|
@ -390,7 +390,7 @@ Blit_RGB565_32Altivec(SDL_BlitInfo * info)
|
||||||
vsrc = voverflow;
|
vsrc = voverflow;
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(width == 0);
|
SDL_assert(width == 0);
|
||||||
|
|
||||||
|
|
||||||
/* do scalar until we can align... */
|
/* 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))
|
char) (vec_add((vector unsigned int) vgreen1, vec_sl(v8, v8))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
SDL_assert(srcfmt->BytesPerPixel == 2);
|
||||||
assert(srcfmt->BytesPerPixel == 2);
|
SDL_assert(dstfmt->BytesPerPixel == 4);
|
||||||
assert(dstfmt->BytesPerPixel == 4);
|
|
||||||
|
|
||||||
vf800 = (vector unsigned short) vec_splat_u8(-7);
|
vf800 = (vector unsigned short) vec_splat_u8(-7);
|
||||||
vf800 = vec_sl(vf800, vec_splat_u16(8));
|
vf800 = vec_sl(vf800, vec_splat_u16(8));
|
||||||
|
@ -538,7 +537,7 @@ Blit_RGB555_32Altivec(SDL_BlitInfo * info)
|
||||||
vsrc = voverflow;
|
vsrc = voverflow;
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(width == 0);
|
SDL_assert(width == 0);
|
||||||
|
|
||||||
|
|
||||||
/* do scalar until we can align... */
|
/* do scalar until we can align... */
|
||||||
|
@ -630,13 +629,13 @@ Blit32to32KeyAltivec(SDL_BlitInfo * info)
|
||||||
}
|
}
|
||||||
int width = info->dst_w;
|
int width = info->dst_w;
|
||||||
ONE_PIXEL_BLEND((UNALIGNED_PTR(dstp)) && (width), width);
|
ONE_PIXEL_BLEND((UNALIGNED_PTR(dstp)) && (width), width);
|
||||||
assert(width > 0);
|
SDL_assert(width > 0);
|
||||||
if (width > 0) {
|
if (width > 0) {
|
||||||
int extrawidth = (width % 4);
|
int extrawidth = (width % 4);
|
||||||
vector unsigned char valigner = VEC_ALIGNER(srcp);
|
vector unsigned char valigner = VEC_ALIGNER(srcp);
|
||||||
vector unsigned int vs = vec_ld(0, srcp);
|
vector unsigned int vs = vec_ld(0, srcp);
|
||||||
width -= extrawidth;
|
width -= extrawidth;
|
||||||
assert(width >= 4);
|
SDL_assert(width >= 4);
|
||||||
while (width) {
|
while (width) {
|
||||||
vector unsigned char vsel;
|
vector unsigned char vsel;
|
||||||
vector unsigned int vd;
|
vector unsigned int vd;
|
||||||
|
@ -691,8 +690,8 @@ ConvertAltivec32to32_noprefetch(SDL_BlitInfo * info)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(srcfmt->BytesPerPixel == 4);
|
SDL_assert(srcfmt->BytesPerPixel == 4);
|
||||||
assert(dstfmt->BytesPerPixel == 4);
|
SDL_assert(dstfmt->BytesPerPixel == 4);
|
||||||
|
|
||||||
while (height--) {
|
while (height--) {
|
||||||
vector unsigned char valigner;
|
vector unsigned char valigner;
|
||||||
|
@ -729,7 +728,7 @@ ConvertAltivec32to32_noprefetch(SDL_BlitInfo * info)
|
||||||
vbits = voverflow;
|
vbits = voverflow;
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(width == 0);
|
SDL_assert(width == 0);
|
||||||
|
|
||||||
/* cover pixels at the end of the row that didn't fit in 16 bytes. */
|
/* cover pixels at the end of the row that didn't fit in 16 bytes. */
|
||||||
while (extrawidth) {
|
while (extrawidth) {
|
||||||
|
@ -770,8 +769,8 @@ ConvertAltivec32to32_prefetch(SDL_BlitInfo * info)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(srcfmt->BytesPerPixel == 4);
|
SDL_assert(srcfmt->BytesPerPixel == 4);
|
||||||
assert(dstfmt->BytesPerPixel == 4);
|
SDL_assert(dstfmt->BytesPerPixel == 4);
|
||||||
|
|
||||||
while (height--) {
|
while (height--) {
|
||||||
vector unsigned char valigner;
|
vector unsigned char valigner;
|
||||||
|
@ -816,7 +815,7 @@ ConvertAltivec32to32_prefetch(SDL_BlitInfo * info)
|
||||||
vbits = voverflow;
|
vbits = voverflow;
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(width == 0);
|
SDL_assert(width == 0);
|
||||||
|
|
||||||
/* cover pixels at the end of the row that didn't fit in 16 bytes. */
|
/* cover pixels at the end of the row that didn't fit in 16 bytes. */
|
||||||
while (extrawidth) {
|
while (extrawidth) {
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include "SDL_shape.h"
|
#include "SDL_shape.h"
|
||||||
#include "SDL_cocoashape.h"
|
#include "SDL_cocoashape.h"
|
||||||
#include "../SDL_sysvideo.h"
|
#include "../SDL_sysvideo.h"
|
||||||
|
#include "SDL_assert.h"
|
||||||
|
|
||||||
SDL_WindowShaper*
|
SDL_WindowShaper*
|
||||||
Cocoa_CreateShaper(SDL_Window* window) {
|
Cocoa_CreateShaper(SDL_Window* window) {
|
||||||
|
@ -49,7 +50,7 @@ Cocoa_CreateShaper(SDL_Window* window) {
|
||||||
data->shape = NULL;
|
data->shape = NULL;
|
||||||
|
|
||||||
int resized_properly = Cocoa_ResizeWindowShape(window);
|
int resized_properly = Cocoa_ResizeWindowShape(window);
|
||||||
assert(resized_properly == 0);
|
SDL_assert(resized_properly == 0);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,7 +101,7 @@ Cocoa_SetWindowShape(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowShape
|
||||||
int
|
int
|
||||||
Cocoa_ResizeWindowShape(SDL_Window *window) {
|
Cocoa_ResizeWindowShape(SDL_Window *window) {
|
||||||
SDL_ShapeData* data = window->shaper->driverdata;
|
SDL_ShapeData* data = window->shaper->driverdata;
|
||||||
assert(data != NULL);
|
SDL_assert(data != NULL);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -311,7 +311,7 @@ X11_GL_GetAttributes(_THIS, Display * display, int screen, int * attribs, int si
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
/* assert buffer is large enough to hold all SDL attributes. */
|
/* 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. */
|
/* Setup our GLX attributes according to the gl_config. */
|
||||||
attribs[i++] = GLX_RGBA;
|
attribs[i++] = GLX_RGBA;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue