Commit 7599f518 authored by Libretro-Admin's avatar Libretro-Admin
Browse files

Cleanups

parent 57b4d604
Pipeline #58251 passed with stages
in 5 minutes and 19 seconds
......@@ -25,11 +25,7 @@
# include "global.h"
# ifdef HAVE_LIMITS_H
# include <limits.h>
# else
# define CHAR_BIT 8
# endif
#include <limits.h>
# include "bit.h"
......
......@@ -52,12 +52,4 @@
# define USE_ASYNC
# endif
# if !defined(HAVE_ASSERT_H)
# if defined(NDEBUG)
# define assert(x) /* nothing */
# else
# define assert(x) do { if (!(x)) abort(); } while (0)
# endif
# endif
# endif
......@@ -25,11 +25,7 @@
# include "global.h"
# ifdef HAVE_LIMITS_H
# include <limits.h>
# else
# define CHAR_BIT 8
# endif
#include <limits.h>
# include "fixed.h"
# include "bit.h"
......
......@@ -28,15 +28,7 @@
# include <stdlib.h>
# include <string.h>
# ifdef HAVE_ASSERT_H
# include <assert.h>
# endif
# ifdef HAVE_LIMITS_H
# include <limits.h>
# else
# define CHAR_BIT 8
# endif
#include <limits.h>
# include "fixed.h"
# include "bit.h"
......@@ -1250,15 +1242,6 @@ enum mad_error III_huffdecode(struct mad_bitptr *ptr, mad_fixed_t xr[576],
}
}
assert(-bits_left <= MAD_BUFFER_GUARD * CHAR_BIT);
# if 0 && defined(DEBUG)
if (bits_left < 0)
fprintf(stderr, "read %d bits too many\n", -bits_left);
else if (cachesz + bits_left > 0)
fprintf(stderr, "%d stuffing bits\n", cachesz + bits_left);
# endif
/* rzero */
while (xrptr < &xr[576]) {
xrptr[0] = 0;
......@@ -2435,9 +2418,6 @@ int mad_layer_III(struct mad_stream *stream, struct mad_frame *frame)
*stream->main_data + stream->md_len - si.main_data_begin);
if (md_len > si.main_data_begin) {
assert(stream->md_len + md_len -
si.main_data_begin <= MAD_BUFFER_MDLEN);
memcpy(*stream->main_data + stream->md_len,
mad_bit_nextbyte(&stream->ptr),
frame_used = md_len - si.main_data_begin);
......
......@@ -27,10 +27,6 @@
# include <stdio.h>
# ifdef HAVE_ASSERT_H
# include <assert.h>
# endif
# include "timer.h"
mad_timer_t const mad_timer_zero = { 0, 0 };
......@@ -120,11 +116,7 @@ unsigned long gcd(unsigned long num1, unsigned long num2)
static
void reduce_rational(unsigned long *numer, unsigned long *denom)
{
unsigned long factor;
factor = gcd(*numer, *denom);
assert(factor != 0);
unsigned long factor = gcd(*numer, *denom);
*numer /= factor;
*denom /= factor;
......@@ -141,8 +133,6 @@ unsigned long scale_rational(unsigned long numer, unsigned long denom,
reduce_rational(&numer, &denom);
reduce_rational(&scale, &denom);
assert(denom != 0);
if (denom < scale)
return numer * (scale / denom) + numer * (scale % denom) / denom;
if (denom < numer)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment