Index: apps/codecs/libgme/nes_apu.h
===================================================================
--- apps/codecs/libgme/nes_apu.h (Revision 30397)
+++ apps/codecs/libgme/nes_apu.h (Arbeitskopie)
@@ -88,7 +88,7 @@
// 2) Triangle, 3) Noise, 4) DMC.
static inline void Apu_osc_output( struct Nes_Apu* this, int osc, struct Blip_Buffer* buf )
{
- assert( (unsigned) osc < apu_osc_count );
+ require( (unsigned) osc < apu_osc_count );
this->oscs [osc]->output = buf;
}

Index: apps/codecs/libgme/nes_vrc7_apu.h
===================================================================
--- apps/codecs/libgme/nes_vrc7_apu.h (Revision 30396)
+++ apps/codecs/libgme/nes_vrc7_apu.h (Arbeitskopie)
@@ -36,7 +36,7 @@
void output_changed( struct Nes_Vrc7_Apu* this );
static inline void Vrc7_set_output( struct Nes_Vrc7_Apu* this, int i, struct Blip_Buffer* buf )
{
- assert( (unsigned) i < vrc7_osc_count );
+ require( (unsigned) i < vrc7_osc_count );
this->mask |= 1 << i;

// Will use OPLL_setMask to mute voices
Index: apps/codecs/libgme/sms_apu.c
===================================================================
--- apps/codecs/libgme/sms_apu.c (Revision 30397)
+++ apps/codecs/libgme/sms_apu.c (Arbeitskopie)
@@ -302,5 +302,5 @@
run_until( this, end_time );

this->last_time -= end_time;
- assert( this->last_time >= 0 );
+ require( this->last_time >= 0 );
}
Index: apps/codecs/libgme/nes_namco_apu.c
===================================================================
--- apps/codecs/libgme/nes_namco_apu.c (Revision 30397)
+++ apps/codecs/libgme/nes_namco_apu.c (Arbeitskopie)
@@ -54,7 +54,7 @@
if ( time > this->last_time )
Namco_run_until( this, time );

- assert( this->last_time >= time );
+ require( this->last_time >= time );
this->last_time -= time;
}

Index: apps/codecs/libgme/nes_namco_apu.h
===================================================================
--- apps/codecs/libgme/nes_namco_apu.h (Revision 30397)
+++ apps/codecs/libgme/nes_namco_apu.h (Arbeitskopie)
@@ -56,7 +56,7 @@

static inline void Namco_osc_output( struct Nes_Namco_Apu* this, int i, struct Blip_Buffer* buf )
{
- assert( (unsigned) i < namco_osc_count );
+ require( (unsigned) i < namco_osc_count );
this->oscs [i].output = buf;
}

Index: apps/codecs/libgme/ay_apu.c
===================================================================
--- apps/codecs/libgme/ay_apu.c (Revision 30396)
+++ apps/codecs/libgme/ay_apu.c (Arbeitskopie)
@@ -139,7 +139,7 @@

void write_data_( struct Ay_Apu* this, int addr, int data )
{
- assert( (unsigned) addr < ay_reg_count );
+ require( (unsigned) addr < ay_reg_count );

/* if ( (unsigned) addr >= 14 )
dprintf( "Wrote to I/O port %02X\n", (int) addr ); */
@@ -305,7 +305,7 @@
// so we can avoid using last_amp every time to calculate the delta.
int delta = amp * 2 - volume;
int delta_non_zero = delta != 0;
- int phase = osc->phase | (osc_mode & tone_off); assert( tone_off == 0x01 );
+ int phase = osc->phase | (osc_mode & tone_off); require( tone_off == 0x01 );
do
{
// run noise
@@ -403,11 +403,11 @@
if ( this->env_pos >= 0 )
this->env_pos = (this->env_pos & 31) - 32;
remain -= count * env_period;
- assert( -remain <= env_period );
+ require( -remain <= env_period );
}
this->env_delay = -remain;
- assert( this->env_delay > 0 );
- assert( this->env_pos < 0 );
+ require( this->env_delay > 0 );
+ require( this->env_pos < 0 );

this->last_time = final_end_time;
}
Index: apps/codecs/libgme/sgc_emu.c
===================================================================
--- apps/codecs/libgme/sgc_emu.c (Revision 30399)
+++ apps/codecs/libgme/sgc_emu.c (Arbeitskopie)
@@ -27,7 +27,7 @@

void Sgc_init( struct Sgc_Emu* this )
{
- assert( offsetof (struct header_t,copyright [32]) == header_size );
+ require( offsetof (struct header_t,copyright [32]) == header_size );

this->sample_rate = 0;
this->mute_mask_ = 0;
@@ -280,7 +280,7 @@
else
{
struct channel_t ch = Buffer_channel( &this->stereo_buf, i );
- assert( (ch.center && ch.left && ch.right) ||
+ require( (ch.center && ch.left && ch.right) ||
(!ch.center && !ch.left && !ch.right) ); // all or nothing
Sound_set_voice( this, i, ch.center, ch.left, ch.right );
}
@@ -472,7 +472,7 @@
int msec = Buffer_length( &this->stereo_buf );
blip_time_t clocks_emulated = msec * this->clock_rate_ / 1000 - 100;
RETURN_ERR( run_clocks( this, &clocks_emulated, msec ) );
- assert( clocks_emulated );
+ require( clocks_emulated );
Buffer_end_frame( &this->stereo_buf, clocks_emulated );
}
}
Index: apps/codecs/libgme/ay_apu.h
===================================================================
--- apps/codecs/libgme/ay_apu.h (Revision 30396)
+++ apps/codecs/libgme/ay_apu.h (Arbeitskopie)
@@ -61,7 +61,7 @@

static inline void Ay_apu_set_output( struct Ay_Apu* this, int i, struct Blip_Buffer* out )
{
- assert( (unsigned) i < ay_osc_count );
+ require( (unsigned) i < ay_osc_count );
this->oscs [i].output = out;
}

@@ -73,7 +73,7 @@
run_until( this, time );

this->last_time -= time;
- assert( this->last_time >= 0 );
+ require( this->last_time >= 0 );
}

#endif
Index: apps/codecs/libgme/sgc_emu.h
===================================================================
--- apps/codecs/libgme/sgc_emu.h (Revision 30397)
+++ apps/codecs/libgme/sgc_emu.h (Arbeitskopie)
@@ -175,7 +175,7 @@
// Must be called before set_sample_rate().
static inline void Sound_set_gain( struct Sgc_Emu* this, int g )
{
- assert( !this->sample_rate ); // you must set gain before setting sample rate
+ require( !this->sample_rate ); // you must set gain before setting sample rate
this->gain = g;
}

Index: apps/codecs/libgme/kss_scc_apu.c
===================================================================
--- apps/codecs/libgme/kss_scc_apu.c (Revision 30396)
+++ apps/codecs/libgme/kss_scc_apu.c (Arbeitskopie)
@@ -130,8 +130,8 @@

void Scc_write( struct Scc_Apu* this, blip_time_t time, int addr, int data )
{
- //assert( (unsigned) addr < reg_count );
- assert( ( addr >= 0x9800 && addr <= 0x988F ) || ( addr >= 0xB800 && addr <= 0xB8AF ) );
+ //require( (unsigned) addr < reg_count );
+ require( ( addr >= 0x9800 && addr <= 0x988F ) || ( addr >= 0xB800 && addr <= 0xB8AF ) );
run_until( this, time );

addr -= 0x9800;
@@ -162,5 +162,5 @@
run_until( this, end_time );

this->last_time -= end_time;
- assert( this->last_time >= 0 );
+ require( this->last_time >= 0 );
}
Index: apps/codecs/libgme/vgm_emu.c
===================================================================
--- apps/codecs/libgme/vgm_emu.c (Revision 30397)
+++ apps/codecs/libgme/vgm_emu.c (Arbeitskopie)
@@ -231,7 +231,7 @@
// Clear info
memset( &this->info, 0, sizeof this->info );

- assert( offsetof (struct header_t,unused2 [8]) == header_size );
+ require( offsetof (struct header_t,unused2 [8]) == header_size );

if ( new_size <= header_size )
return gme_wrong_file_type;
@@ -395,7 +395,7 @@
int msec = Buffer_length( &this->stereo_buf );
blip_time_t clocks_emulated = msec * this->clock_rate_ / 1000 - 100;
RETURN_ERR( run_clocks( this, &clocks_emulated, msec ) );
- assert( clocks_emulated );
+ require( clocks_emulated );
Buffer_end_frame( &this->stereo_buf, clocks_emulated );
}
}
@@ -572,7 +572,7 @@
// to do: timing is working mostly by luck
int min_pairs = (unsigned) sample_count / 2;
int vgm_time = (min_pairs << fm_time_bits) / this->fm_time_factor - 1;
- assert( to_fm_time( this, vgm_time ) <= min_pairs );
+ require( to_fm_time( this, vgm_time ) <= min_pairs );
int pairs;
while ( (pairs = to_fm_time( this, vgm_time )) < min_pairs )
vgm_time++;
@@ -687,7 +687,7 @@
else
{
struct channel_t ch = Buffer_channel( &this->stereo_buf, i );
- assert( (ch.center && ch.left && ch.right) ||
+ require( (ch.center && ch.left && ch.right) ||
(!ch.center && !ch.left && !ch.right) ); // all or nothing
set_voice( this, i, ch.center, ch.left, ch.right );
}
Index: apps/codecs/libgme/kss_scc_apu.h
===================================================================
--- apps/codecs/libgme/kss_scc_apu.h (Revision 30397)
+++ apps/codecs/libgme/kss_scc_apu.h (Arbeitskopie)
@@ -37,7 +37,7 @@

static inline void Scc_set_output( struct Scc_Apu* this, int index, struct Blip_Buffer* b )
{
- assert( (unsigned) index < scc_osc_count );
+ require( (unsigned) index < scc_osc_count );
this->oscs [index].output = b;
}

Index: apps/codecs/libgme/vgm_emu.h
===================================================================
--- apps/codecs/libgme/vgm_emu.h (Revision 30397)
+++ apps/codecs/libgme/vgm_emu.h (Arbeitskopie)
@@ -199,7 +199,7 @@
// Must be called before set_sample_rate().
static inline void Sound_set_gain( struct Vgm_Emu* this, int g )
{
- assert( !this->sample_rate ); // you must set gain before setting sample rate
+ require( !this->sample_rate ); // you must set gain before setting sample rate
this->gain = g;
}

Index: apps/codecs/libgme/kss_emu.c
===================================================================
--- apps/codecs/libgme/kss_emu.c (Revision 30397)
+++ apps/codecs/libgme/kss_emu.c (Arbeitskopie)
@@ -118,7 +118,7 @@
{
/* warning( core.warning() ); */
memset( &this->header, 0, sizeof this->header );
- assert( offsetof (header_t,msx_audio_vol) == header_size - 1 );
+ require( offsetof (header_t,msx_audio_vol) == header_size - 1 );
RETURN_ERR( Rom_load( &this->rom, data, size, header_base_size, &this->header, 0 ) );

RETURN_ERR( check_kss_header( this->header.tag ) );
@@ -514,7 +514,7 @@
else
{
struct channel_t ch = Buffer_channel( &this->stereo_buf, i );
- assert( (ch.center && ch.left && ch.right) ||
+ require( (ch.center && ch.left && ch.right) ||
(!ch.center && !ch.left && !ch.right) ); // all or nothing
set_voice( this, i, ch.center, ch.left, ch.right );
}
@@ -706,7 +706,7 @@
int msec = Buffer_length( &this->stereo_buf );
blip_time_t clocks_emulated = msec * this->clock_rate_ / 1000 - 100;
RETURN_ERR( run_clocks( this, &clocks_emulated ) );
- assert( clocks_emulated );
+ require( clocks_emulated );
Buffer_end_frame( &this->stereo_buf, clocks_emulated );
}
}
Index: apps/codecs/libgme/nsfe_info.c
===================================================================
--- apps/codecs/libgme/nsfe_info.c (Revision 30397)
+++ apps/codecs/libgme/nsfe_info.c (Arbeitskopie)
@@ -111,7 +111,7 @@
{
long offset = 0;
int const nsfe_info_size = 16;
- assert( offsetof (struct nsfe_info_t,unused [6]) == nsfe_info_size );
+ require( offsetof (struct nsfe_info_t,unused [6]) == nsfe_info_size );

// check header
byte signature [4];
Index: apps/codecs/libgme/track_filter.c
===================================================================
--- apps/codecs/libgme/track_filter.c (Revision 30397)
+++ apps/codecs/libgme/track_filter.c (Arbeitskopie)
@@ -197,7 +197,7 @@
// fill internal buffer and check it for silence
void fill_buf( struct Track_Filter* this )
{
- assert( !this->buf_remain );
+ require( !this->buf_remain );
if ( !this->emu_track_ended_ )
{
emu_play( this, this->buf, buf_size );
@@ -221,7 +221,7 @@
}
else
{
- assert( this->emu_time >= this->out_time );
+ require( this->emu_time >= this->out_time );

// prints nifty graph of how far ahead we are when searching for silence
//dprintf( "%*s \n", int ((emu_time - out_time) * 7 / 44100), "*" );
Index: apps/codecs/libgme/kss_emu.h
===================================================================
--- apps/codecs/libgme/kss_emu.h (Revision 30397)
+++ apps/codecs/libgme/kss_emu.h (Arbeitskopie)
@@ -200,7 +200,7 @@
// Must be called before set_sample_rate().
static inline void Sound_set_gain( struct Kss_Emu* this, int g )
{
- assert( !this->sample_rate ); // you must set gain before setting sample rate
+ require( !this->sample_rate ); // you must set gain before setting sample rate
this->gain = g;
}

Index: apps/codecs/libgme/nes_fme7_apu.h
===================================================================
--- apps/codecs/libgme/nes_fme7_apu.h (Revision 30397)
+++ apps/codecs/libgme/nes_fme7_apu.h (Arbeitskopie)
@@ -48,7 +48,7 @@

static inline void Fme7_osc_output( struct Nes_Fme7_Apu* this, int i, struct Blip_Buffer* buf )
{
- assert( (unsigned) i < fme7_osc_count );
+ require( (unsigned) i < fme7_osc_count );
this->oscs [i].output = buf;
}

@@ -83,7 +83,7 @@
if ( time > this->last_time )
Fme7_run_until( this, time );

- assert( this->last_time >= time );
+ require( this->last_time >= time );
this->last_time -= time;
}

Index: apps/codecs/libgme/blip_buffer.c
===================================================================
--- apps/codecs/libgme/blip_buffer.c (Revision 30397)
+++ apps/codecs/libgme/blip_buffer.c (Arbeitskopie)
@@ -35,11 +35,11 @@
#ifndef NDEBUG
// right shift of negative value preserves sign
buf_t_ i = -0x7FFFFFFE;
- assert( (i >> 1) == -0x3FFFFFFF );
+ require( (i >> 1) == -0x3FFFFFFF );

// casting to short truncates to 16 bits and sign-extends
i = 0x18000;
- assert( (short) i == -0x8000 );
+ require( (short) i == -0x8000 );
#endif

Blip_clear( this );
@@ -90,7 +90,7 @@
blip_resampled_time_t Blip_clock_rate_factor( struct Blip_Buffer* this, int rate )
{
int factor = (int) ( this->sample_rate_ * (1LL << BLIP_BUFFER_ACCURACY) / rate);
- assert( factor > 0 || !this->sample_rate_ ); // fails if clock/output ratio is too large
+ require( factor > 0 || !this->sample_rate_ ); // fails if clock/output ratio is too large
return (blip_resampled_time_t) factor;
}

@@ -110,7 +110,7 @@
void Blip_end_frame( struct Blip_Buffer* this, blip_time_t t )
{
this->offset_ += t * this->factor_;
- assert( Blip_samples_avail( this ) <= (int) this->buffer_size_ ); // time outside buffer length
+ require( Blip_samples_avail( this ) <= (int) this->buffer_size_ ); // time outside buffer length
}

int Blip_count_samples( struct Blip_Buffer* this, blip_time_t t )
Index: apps/codecs/libgme/blargg_endian.h
===================================================================
--- apps/codecs/libgme/blargg_endian.h (Revision 30397)
+++ apps/codecs/libgme/blargg_endian.h (Arbeitskopie)
@@ -56,10 +56,10 @@
#ifndef NDEBUG
#if BLARGG_BIG_ENDIAN
volatile int i = 1;
- assert( *(volatile char*) &i == 0 );
+ require( *(volatile char*) &i == 0 );
#elif BLARGG_LITTLE_ENDIAN
volatile int i = 1;
- assert( *(volatile char*) &i != 0 );
+ require( *(volatile char*) &i != 0 );
#endif
#endif
}
Index: apps/codecs/libgme/gbs_emu.c
===================================================================
--- apps/codecs/libgme/gbs_emu.c (Revision 30397)
+++ apps/codecs/libgme/gbs_emu.c (Arbeitskopie)
@@ -80,7 +80,7 @@
this->m3u.size = 0;
clear_track_vars( this );

- assert( offsetof (struct header_t,copyright [32]) == header_size );
+ require( offsetof (struct header_t,copyright [32]) == header_size );
RETURN_ERR( Rom_load( &this->rom, data, size, header_size, &this->header, 0 ) );

RETURN_ERR( check_gbs_header( &this->header ) );
@@ -250,7 +250,7 @@
int msec = Buffer_length( &this->stereo_buf );
blip_time_t clocks_emulated = msec * this->clock_rate_ / 1000 - 100;
RETURN_ERR( run_clocks( this, clocks_emulated ) );
- assert( clocks_emulated );
+ require( clocks_emulated );
Buffer_end_frame( &this->stereo_buf, clocks_emulated );
}
}
@@ -300,7 +300,7 @@
else
{
struct channel_t ch = Buffer_channel( &this->stereo_buf, i );
- assert( (ch.center && ch.left && ch.right) ||
+ require( (ch.center && ch.left && ch.right) ||
(!ch.center && !ch.left && !ch.right) ); // all or nothing
Apu_set_output( &this->apu, i, ch.center, ch.left, ch.right );
}
Index: apps/codecs/libgme/blip_buffer.h
===================================================================
--- apps/codecs/libgme/blip_buffer.h (Revision 30398)
+++ apps/codecs/libgme/blip_buffer.h (Arbeitskopie)
@@ -70,7 +70,7 @@

static inline delta_t* delta_at( struct Blip_Buffer *this, ufixed_t f )
{
- assert( (f >> fixed_bits) < (unsigned) this->buffer_size_ );
+ require( (f >> fixed_bits) < (unsigned) this->buffer_size_ );
return this->buffer_center_ + (f >> fixed_bits);
}

@@ -82,7 +82,7 @@

static inline void Blip_remove_silence( struct Blip_Buffer* this, int count )
{
- assert( count <= Blip_samples_avail( this ) ); // tried to remove more samples than available
+ require( count <= Blip_samples_avail( this ) ); // tried to remove more samples than available
this->offset_ -= (blip_resampled_time_t) count << BLIP_BUFFER_ACCURACY;
}

Index: apps/codecs/libgme/gbs_emu.h
===================================================================
--- apps/codecs/libgme/gbs_emu.h (Revision 30397)
+++ apps/codecs/libgme/gbs_emu.h (Arbeitskopie)
@@ -164,7 +164,7 @@
// Must be called before set_sample_rate().
static inline void Sound_set_gain( struct Gbs_Emu* this, int g )
{
- assert( !this->sample_rate_ ); // you must set gain before setting sample rate
+ require( !this->sample_rate_ ); // you must set gain before setting sample rate
this->gain_ = g;
}

Index: apps/codecs/libgme/resampler.c
===================================================================
--- apps/codecs/libgme/resampler.c (Revision 30397)
+++ apps/codecs/libgme/resampler.c (Arbeitskopie)
@@ -138,12 +138,12 @@
static inline int resample_wrapper( struct Resampler* this, dsample_t out [], int* out_size,
dsample_t const in [], int in_size )
{
- assert( Resampler_rate( this ) );
+ require( Resampler_rate( this ) );

dsample_t* out_ = out;
int result = resample_( this, &out_, out + *out_size, in, in_size ) - in;
- assert( out_ <= out + *out_size );
- assert( result <= in_size );
+ require( out_ <= out + *out_size );
+ require( result <= in_size );

*out_size = out_ - out;
return result;
@@ -168,18 +168,18 @@
int sample_count = this->oversamples_per_frame - this->write_pos + resampler_extra;

int new_count = this->callback( this->callback_data, blip_time, sample_count, &this->buf [this->write_pos] );
- assert( new_count < this->resampler_size );
+ require( new_count < this->resampler_size );

Blip_end_frame( blip_buf, blip_time );
- assert( Blip_samples_avail( blip_buf ) == pair_count );
+ require( Blip_samples_avail( blip_buf ) == pair_count );

this->write_pos += new_count;
- assert( (unsigned) this->write_pos <= this->buffer_size );
+ require( (unsigned) this->write_pos <= this->buffer_size );

int count = this->sample_buf_size;
if ( count )
skip_input( this, resample_wrapper( this, this->sample_buf, &count, this->buf, this->write_pos ) );
- assert( count == this->sample_buf_size );
+ require( count == this->sample_buf_size );

mix_samples( this, blip_buf, out );
Blip_remove_samples( blip_buf, pair_count );
Index: apps/codecs/libgme/nes_vrc6_apu.c
===================================================================
--- apps/codecs/libgme/nes_vrc6_apu.c (Revision 30397)
+++ apps/codecs/libgme/nes_vrc6_apu.c (Arbeitskopie)
@@ -74,7 +74,7 @@
if ( time > this->last_time )
Vrc6_run_until( this, time );

- assert( this->last_time >= time );
+ require( this->last_time >= time );
this->last_time -= time;
}

Index: apps/codecs/libgme/nes_fds_apu.h
===================================================================
--- apps/codecs/libgme/nes_fds_apu.h (Revision 30396)
+++ apps/codecs/libgme/nes_fds_apu.h (Arbeitskopie)
@@ -64,7 +64,7 @@
(void) i;
#endif

- assert( (unsigned) i < fds_osc_count );
+ require( (unsigned) i < fds_osc_count );
this->output_ = b;
}

@@ -74,7 +74,7 @@
if ( end_time > this->last_time )
Fds_run_until( this, end_time );
this->last_time -= end_time;
- assert( this->last_time >= 0 );
+ require( this->last_time >= 0 );
}

void Fds_write_( struct Nes_Fds_Apu* this, unsigned addr, int data );
Index: apps/codecs/libgme/nes_vrc6_apu.h
===================================================================
--- apps/codecs/libgme/nes_vrc6_apu.h (Revision 30397)
+++ apps/codecs/libgme/nes_vrc6_apu.h (Arbeitskopie)
@@ -48,7 +48,7 @@

static inline void Vrc6_osc_output( struct Nes_Vrc6_Apu* this, int i, struct Blip_Buffer* buf )
{
- assert( (unsigned) i < vrc6_osc_count );
+ require( (unsigned) i < vrc6_osc_count );
this->oscs [i].output = buf;
}

Index: apps/codecs/libgme/hes_emu.c
===================================================================
--- apps/codecs/libgme/hes_emu.c (Revision 30397)
+++ apps/codecs/libgme/hes_emu.c (Arbeitskopie)
@@ -78,7 +78,7 @@
this->m3u.size = 0;
clear_track_vars( this );

- assert( offsetof (struct header_t,unused [4]) == header_size );
+ require( offsetof (struct header_t,unused [4]) == header_size );
RETURN_ERR( Rom_load( &this->rom, data, size, header_size, &this->header, unmapped ) );

RETURN_ERR( check_hes_header( this->header.tag ) );
@@ -442,7 +442,7 @@
int msec = Buffer_length( &this->stereo_buf );
blip_time_t clocks_emulated = msec * this->clock_rate_ / 1000 - 100;
RETURN_ERR( run_clocks( this, &clocks_emulated ) );
- assert( clocks_emulated );
+ require( clocks_emulated );
Buffer_end_frame( &this->stereo_buf, clocks_emulated );
}
}
@@ -499,7 +499,7 @@
else
{
struct channel_t ch = Buffer_channel( &this->stereo_buf, i );
- assert( (ch.center && ch.left && ch.right) ||
+ require( (ch.center && ch.left && ch.right) ||
(!ch.center && !ch.left && !ch.right) ); // all or nothing
Apu_osc_output( &this->apu, i, ch.center, ch.left, ch.right );
}
Index: apps/codecs/libgme/sms_fm_apu.c
===================================================================
--- apps/codecs/libgme/sms_fm_apu.c (Revision 30396)
+++ apps/codecs/libgme/sms_fm_apu.c (Arbeitskopie)
@@ -39,7 +39,7 @@

void fm_run_until( struct Sms_Fm_Apu* this, blip_time_t end_time )
{
- assert( end_time > this->next_time );
+ require( end_time > this->next_time );

struct Blip_Buffer* const output = this->output_;
if ( !output )
@@ -75,7 +75,7 @@
fm_run_until( this, time );

this->next_time -= time;
- assert( this->next_time >= 0 );
+ require( this->next_time >= 0 );

if ( this->output_ )
Blip_set_modified( this->output_ );
Index: apps/codecs/libgme/hes_emu.h
===================================================================
--- apps/codecs/libgme/hes_emu.h (Revision 30397)
+++ apps/codecs/libgme/hes_emu.h (Arbeitskopie)
@@ -175,7 +175,7 @@
// Must be called before set_sample_rate().
static inline void Sound_set_gain( struct Hes_Emu* this, int g )
{
- assert( !this->sample_rate_ ); // you must set gain before setting sample rate
+ require( !this->sample_rate_ ); // you must set gain before setting sample rate
this->gain_ = g;
}

Index: apps/codecs/libgme/nsf_emu.c
===================================================================
--- apps/codecs/libgme/nsf_emu.c (Revision 30397)
+++ apps/codecs/libgme/nsf_emu.c (Arbeitskopie)
@@ -73,7 +73,7 @@

static void append_voices( struct Nsf_Emu* this, int const types [], int count )
{
- assert( this->voice_count + count < max_voices );
+ require( this->voice_count + count < max_voices );
int i;
for ( i = 0; i < count; i++ ) {
this->voice_types [this->voice_count + i] = types [i];
@@ -262,7 +262,7 @@
this->voice_count = 0;
clear_track_vars( this );

- assert( offsetof (struct header_t,unused [4]) == header_size );
+ require( offsetof (struct header_t,unused [4]) == header_size );

if ( !memcmp( data, "NESM\x1A", 5 ) ) {
Nsf_disable_playlist( this, true );
@@ -495,7 +495,7 @@
else
{
struct channel_t ch = Buffer_channel( &this->stereo_buf, i );
- assert( (ch.center && ch.left && ch.right) ||
+ require( (ch.center && ch.left && ch.right) ||
(!ch.center && !ch.left && !ch.right) ); // all or nothing
set_voice( this, i, ch.center, ch.left, ch.right );
}
@@ -903,7 +903,7 @@
int msec = Buffer_length( &this->stereo_buf );
blip_time_t clocks_emulated = msec * this->clock_rate__ / 1000 - 100;
RETURN_ERR( run_clocks( this, &clocks_emulated, msec ) );
- assert( clocks_emulated );
+ require( clocks_emulated );
Buffer_end_frame( &this->stereo_buf, clocks_emulated );
}
}
Index: apps/codecs/libgme/nsf_emu.h
===================================================================
--- apps/codecs/libgme/nsf_emu.h (Revision 30397)
+++ apps/codecs/libgme/nsf_emu.h (Arbeitskopie)
@@ -201,7 +201,7 @@
// Must be called before set_sample_rate().
static inline void Sound_set_gain( struct Nsf_Emu* this, int g )
{
- assert( !this->sample_rate ); // you must set gain before setting sample rate
+ require( !this->sample_rate ); // you must set gain before setting sample rate
this->gain = g;
}

Index: apps/codecs/libgme/opl_apu.h
===================================================================
--- apps/codecs/libgme/opl_apu.h (Revision 30397)
+++ apps/codecs/libgme/opl_apu.h (Arbeitskopie)
@@ -46,7 +46,7 @@
#if defined(ROCKBOX)
(void) i;
#endif
- assert( (unsigned) i < opl_osc_count );
+ require( (unsigned) i < opl_osc_count );
this->output_ = buf;
}

Index: apps/codecs/libgme/ym2612_emu.c
===================================================================
--- apps/codecs/libgme/ym2612_emu.c (Revision 30397)
+++ apps/codecs/libgme/ym2612_emu.c (Arbeitskopie)
@@ -487,8 +487,8 @@
void impl_reset( struct Ym2612_Impl* impl );
static void impl_set_rate( struct Ym2612_Impl* impl, double sample_rate, double clock_rate )
{
- assert( sample_rate );
- assert( !clock_rate || clock_rate > sample_rate );
+ require( sample_rate );
+ require( !clock_rate || clock_rate > sample_rate );

int i;

@@ -700,7 +700,7 @@

static inline void write0( struct Ym2612_Impl* impl, int opn_addr, int data )
{
- assert( (unsigned) data <= 0xFF );
+ require( (unsigned) data <= 0xFF );

if ( opn_addr < 0x30 )
{
@@ -720,7 +720,7 @@

static inline void write1( struct Ym2612_Impl* impl, int opn_addr, int data )
{
- assert( (unsigned) data <= 0xFF );
+ require( (unsigned) data <= 0xFF );

if ( opn_addr >= 0x30 && impl->YM2612.REG [1] [opn_addr] != data )
{
Index: apps/codecs/libgme/gb_oscs.c
===================================================================
--- apps/codecs/libgme/gb_oscs.c (Revision 30396)
+++ apps/codecs/libgme/gb_oscs.c (Arbeitskopie)
@@ -379,7 +379,7 @@
void write_osc( struct Gb_Apu* this, int reg, int old_data, int data )
{
int index = (reg * 3 + 3) >> 4; // avoids divide
- assert( index == reg / 5 );
+ require( index == reg / 5 );
reg -= index * 5;
switch ( index )
{
Index: apps/codecs/libgme/ay_emu.c
===================================================================
--- apps/codecs/libgme/ay_emu.c (Revision 30397)
+++ apps/codecs/libgme/ay_emu.c (Arbeitskopie)
@@ -70,7 +70,7 @@
int offset = (int16_t) get_be16( ptr );
int pos = ptr - (byte const*) file->header;
int size = file->end - (byte const*) file->header;
- assert( (unsigned) pos <= (unsigned) size - 2 );
+ require( (unsigned) pos <= (unsigned) size - 2 );
int limit = size - min_size;
if ( limit < 0 || !offset || (unsigned) (pos + offset) > (unsigned) limit )
return NULL;
@@ -111,7 +111,7 @@
this->m3u.size = 0;
clear_track_vars( this );

- assert( offsetof (struct header_t,track_info [2]) == header_size );
+ require( offsetof (struct header_t,track_info [2]) == header_size );

RETURN_ERR( parse_header( in, size, &this->file ) );

@@ -316,7 +316,7 @@
else
{
struct channel_t ch = Buffer_channel( &this->stereo_buf, i );
- assert( (ch.center && ch.left && ch.right) ||
+ require( (ch.center && ch.left && ch.right) ||
(!ch.center && !ch.left && !ch.right) ); // all or nothing
set_voice( this, i, ch.center );
}
@@ -591,7 +591,7 @@
int msec = Buffer_length( &this->stereo_buf );
blip_time_t clocks_emulated = msec * this->clock_rate_ / 1000 - 100;
RETURN_ERR( run_clocks( this, &clocks_emulated, msec ) );
- assert( clocks_emulated );
+ require( clocks_emulated );
Buffer_end_frame( &this->stereo_buf, clocks_emulated );
}
}
Index: apps/codecs/libgme/hes_cpu_run.h
===================================================================
--- apps/codecs/libgme/hes_cpu_run.h (Revision 30397)
+++ apps/codecs/libgme/hes_cpu_run.h (Arbeitskopie)
@@ -1273,7 +1273,7 @@
illegal_encountered = true;
goto loop;
}
- assert( false ); // catch missing 'goto loop' or accidental 'break'
+ require( false ); // catch missing 'goto loop' or accidental 'break'

int result_;
handle_brk:
Index: apps/codecs/libgme/z80_cpu_run.h
===================================================================
--- apps/codecs/libgme/z80_cpu_run.h (Revision 30396)
+++ apps/codecs/libgme/z80_cpu_run.h (Arbeitskopie)
@@ -1044,7 +1044,7 @@
R8( data & 7, 0 ) &= ~(1 << (data >> 3 & 7));
goto loop;
}
- assert( false );
+ require( false );
}

#undef GET_ADDR
@@ -1316,7 +1316,7 @@
warning = true;
goto loop;
}
- assert( false );
+ require( false );
}

//////////////////////////////////////// DD/FD prefix
@@ -1576,7 +1576,7 @@
warning = true;
goto loop;
}
- assert( false );
+ require( false );
}

// INC/DEC
@@ -1666,12 +1666,12 @@
pc--;
goto loop;
}
- assert( false );
+ require( false );
}

}
dprintf( "Unhandled main opcode: $%02X\n", opcode );
- assert( false );
+ require( false );

#ifdef IDLE_ADDR
hit_idle_addr:
Index: apps/codecs/libgme/blargg_source.h
===================================================================
--- apps/codecs/libgme/blargg_source.h (Revision 30397)
+++ apps/codecs/libgme/blargg_source.h (Arbeitskopie)
@@ -7,8 +7,6 @@
// module. A failed requirement indicates a bug outside the module.
// void require( bool expr );
#if defined(ROCKBOX)
-#undef assert
-#define assert( expr )
#undef require
#define require( expr )
#else
Index: apps/codecs/libgme/hes_apu.c
===================================================================
--- apps/codecs/libgme/hes_apu.c (Revision 30397)
+++ apps/codecs/libgme/hes_apu.c (Arbeitskopie)
@@ -364,7 +364,7 @@
osc--;
if ( end_time > osc->last_time )
run_osc( osc, &this->synth, end_time );
- assert( osc->last_time >= end_time );
+ require( osc->last_time >= end_time );
osc->last_time -= end_time;
}
while ( osc != this->oscs );
Index: apps/codecs/libgme/ay_emu.h
===================================================================
--- apps/codecs/libgme/ay_emu.h (Revision 30397)
+++ apps/codecs/libgme/ay_emu.h (Arbeitskopie)
@@ -151,7 +151,7 @@
// Must be called before set_sample_rate().
static inline void Sound_set_gain( struct Ay_Emu* this, int g )
{
- assert( !this->sample_rate ); // you must set gain before setting sample rate
+ require( !this->sample_rate ); // you must set gain before setting sample rate
this->gain = g;
}

Index: apps/codecs/libgme/nes_cpu_run.h
===================================================================
--- apps/codecs/libgme/nes_cpu_run.h (Revision 30396)
+++ apps/codecs/libgme/nes_cpu_run.h (Arbeitskopie)
@@ -1053,7 +1053,7 @@
}
goto loop;
}
- assert( false ); // catch missing 'goto loop' or accidental 'break'
+ require( false ); // catch missing 'goto loop' or accidental 'break'

int result_;
handle_brk:
Index: apps/codecs/libgme/gb_cpu_run.h
===================================================================
--- apps/codecs/libgme/gb_cpu_run.h (Revision 30396)
+++ apps/codecs/libgme/gb_cpu_run.h (Arbeitskopie)
@@ -568,7 +568,7 @@
goto loop;

} // CB op
- assert( false ); // unhandled CB op
+ require( false ); // unhandled CB op

case 0x07: // RLCA
cz = RG.a >> 7;
@@ -1168,7 +1168,7 @@
}

// If this fails then an opcode isn't handled above
- assert( false );
+ require( false );

stop:
pc--;
Index: apps/codecs/libgme/hes_cpu.h
===================================================================
--- apps/codecs/libgme/hes_cpu.h (Revision 30397)
+++ apps/codecs/libgme/hes_cpu.h (Arbeitskopie)
@@ -113,7 +113,7 @@

static inline void Cpu_end_frame( struct Hes_Cpu* this, hes_time_t t )
{
- assert( this->cpu_state == &this->cpu_state_ );
+ require( this->cpu_state == &this->cpu_state_ );
this->cpu_state_.base -= t;
if ( this->irq_time_ < future_time ) this->irq_time_ -= t;
if ( this->end_time_ < future_time ) this->end_time_ -= t;
@@ -121,8 +121,8 @@

static inline void Cpu_set_mmr( struct Hes_Cpu* this, int reg, int bank, void const* code )
{
- assert( (unsigned) reg <= page_count ); // allow page past end to be set
- assert( (unsigned) bank < 0x100 );
+ require( (unsigned) reg <= page_count ); // allow page past end to be set
+ require( (unsigned) bank < 0x100 );
this->mmr [reg] = bank;
byte const* p = STATIC_CAST(byte const*,code) - HES_CPU_OFFSET( reg << page_bits );
this->cpu_state->code_map [reg] = p;
Index: apps/codecs/libgme/nes_vrc7_apu.c
===================================================================
--- apps/codecs/libgme/nes_vrc7_apu.c (Revision 30396)
+++ apps/codecs/libgme/nes_vrc7_apu.c (Arbeitskopie)
@@ -56,7 +56,7 @@
Vrc7_run_until( this, time );

this->next_time -= time;
- assert( this->next_time >= 0 );
+ require( this->next_time >= 0 );

if ( this->osc.output )
Blip_set_modified( this->osc.output );
Index: apps/codecs/libgme/gb_apu.c
===================================================================
--- apps/codecs/libgme/gb_apu.c (Revision 30396)
+++ apps/codecs/libgme/gb_apu.c (Arbeitskopie)
@@ -211,7 +211,7 @@
break;

// run frame sequencer
- assert( this->frame_period );
+ require( this->frame_period );
this->frame_time += this->frame_period * clk_mul;
switch ( this->frame_phase++ )
{
@@ -255,10 +255,10 @@
run_until( this, end_time );

this->frame_time -= end_time;
- assert( this->frame_time >= 0 );
+ require( this->frame_time >= 0 );

this->last_time -= end_time;
- assert( this->last_time >= 0 );
+ require( this->last_time >= 0 );
}

static void silence_osc( struct Gb_Apu* this, struct Gb_Osc* o )