Skip to content

Commit

Permalink
fix a warning, add some machinery to define NDEBUG for standard build…
Browse files Browse the repository at this point in the history
…s in resid. patch by Leandro Nini

git-svn-id: https://svn.code.sf.net/p/vice-emu/code/trunk@45317 379a1393-f5fb-40a0-bcee-ef074d9b53f7
  • Loading branch information
mrdudz committed Aug 25, 2024
1 parent 945a009 commit 677b978
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
7 changes: 1 addition & 6 deletions vice/src/resid/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@

AR = @AR@

AM_CFLAGS = @VICE_CFLAGS@

AM_LDFLAGS = @VICE_LDFLAGS@


#AM_CXXFLAGS = @VICE_CXXFLAGS@
AM_CPPFLAGS = @RESID_CPPFLAGS@

noinst_LIBRARIES = libresid.a

Expand Down
10 changes: 10 additions & 0 deletions vice/src/resid/configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ AC_LANG([C++])

AC_CANONICAL_HOST

AC_MSG_CHECKING([for debugging])
AC_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug], [whether to enable asserts (default is no)])],
[], [enable_debug=no])

AS_IF([test "x$enable_debug" = "xno"],
[AC_MSG_RESULT([build without asserts]); RESID_CPPFLAGS="-DNDEBUG"],
[AC_MSG_RESULT([build with asserts]); RESID_CPPFLAGS=""]
)
AC_SUBST(RESID_CPPFLAGS)

dnl Enable inlining.
AC_ARG_ENABLE([inline],
[AC_HELP_STRING([--enable-inline],
Expand Down
3 changes: 3 additions & 0 deletions vice/src/resid/filter8580new.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "dac.h"
#include "spline.h"
#include <math.h>
#include <cassert>

namespace reSID
{
Expand Down Expand Up @@ -300,6 +301,8 @@ Filter::Filter()
// double_point scaled_voltage[fi.opamp_voltage_size];
double_point scaled_voltage[50];

assert((fi.opamp_voltage_size > 0) && (fi.opamp_voltage_size < 50));

for (int i = 0; i < fi.opamp_voltage_size; i++) {
// The target output range is 16 bits, in order to fit in an unsigned
// short.
Expand Down

0 comments on commit 677b978

Please sign in to comment.