summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Seifert <soap@gentoo.org>2017-01-15 10:37:02 +0100
committerErik de Castro Lopo <erikd@mega-nerd.com>2017-01-19 20:47:26 +1100
commitb3ece71334540aa35de30c821ae83acc1c503b01 (patch)
treec0d12f29ab6c80e1b7ae6ce8b63c1c50cc754dc2 /src
parent09b8224804545338b66aa985c0f9eba949e0ede5 (diff)
downloadflac-b3ece71334540aa35de30c821ae83acc1c503b01.tar.gz
Do not override CFLAGS, as CFLAGS is a user flag.
* Furthermore, use NDEBUG globally to detect the presence of building with more debug output information. AX_CHECK_ENABLE_DEBUG is easier to use, and nowadays Gnome has also switched to it from its own custom solution. Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
Diffstat (limited to 'src')
-rw-r--r--src/libFLAC/cpu.c2
-rw-r--r--src/libFLAC/lpc.c4
-rw-r--r--src/libFLAC/stream_encoder.c10
-rw-r--r--src/plugin_common/Makefile.am6
-rw-r--r--src/plugin_common/charset.c4
-rw-r--r--src/plugin_xmms/http.c12
-rw-r--r--src/share/Makefile.am6
7 files changed, 15 insertions, 29 deletions
diff --git a/src/libFLAC/cpu.c b/src/libFLAC/cpu.c
index 6629fb95..5f868090 100644
--- a/src/libFLAC/cpu.c
+++ b/src/libFLAC/cpu.c
@@ -47,7 +47,7 @@
# include <cpuid.h> /* for __get_cpuid() and __get_cpuid_max() */
#endif
-#ifdef DEBUG
+#ifndef NDEBUG
#include <stdio.h>
#define dfprintf fprintf
diff --git a/src/libFLAC/lpc.c b/src/libFLAC/lpc.c
index 53c3082e..a624c936 100644
--- a/src/libFLAC/lpc.c
+++ b/src/libFLAC/lpc.c
@@ -42,7 +42,7 @@
#include "private/bitmath.h"
#include "private/lpc.h"
#include "private/macros.h"
-#if defined DEBUG || defined FLAC__OVERFLOW_DETECT || defined FLAC__OVERFLOW_DETECT_VERBOSE
+#if !defined(NDEBUG) || defined FLAC__OVERFLOW_DETECT || defined FLAC__OVERFLOW_DETECT_VERBOSE
#include <stdio.h>
#endif
@@ -234,7 +234,7 @@ int FLAC__lpc_quantize_coefficients(const FLAC__real lp_coeff[], uint32_t order,
const int nshift = -(*shift);
double error = 0.0;
FLAC__int32 q;
-#ifdef DEBUG
+#ifndef NDEBUG
fprintf(stderr,"FLAC__lpc_quantize_coefficients: negative shift=%d order=%u cmax=%f\n", *shift, order, cmax);
#endif
for(i = 0; i < order; i++) {
diff --git a/src/libFLAC/stream_encoder.c b/src/libFLAC/stream_encoder.c
index 9279c0a3..dcdc70f0 100644
--- a/src/libFLAC/stream_encoder.c
+++ b/src/libFLAC/stream_encoder.c
@@ -3452,7 +3452,7 @@ FLAC__bool process_subframe_(
#endif
rice_parameter++; /* to account for the signed->uint32_t conversion during rice coding */
if(rice_parameter >= rice_parameter_limit) {
-#ifdef DEBUG_VERBOSE
+#ifndef NDEBUG
fprintf(stderr, "clipping rice_parameter (%u -> %u) @0\n", rice_parameter, rice_parameter_limit - 1);
#endif
rice_parameter = rice_parameter_limit - 1;
@@ -3524,7 +3524,7 @@ FLAC__bool process_subframe_(
rice_parameter = (lpc_residual_bits_per_sample > 0.0)? (uint32_t)(lpc_residual_bits_per_sample+0.5) : 0; /* 0.5 is for rounding */
rice_parameter++; /* to account for the signed->uint32_t conversion during rice coding */
if(rice_parameter >= rice_parameter_limit) {
-#ifdef DEBUG_VERBOSE
+#ifndef NDEBUG
fprintf(stderr, "clipping rice_parameter (%u -> %u) @1\n", rice_parameter, rice_parameter_limit - 1);
#endif
rice_parameter = rice_parameter_limit - 1;
@@ -4156,7 +4156,7 @@ FLAC__bool set_partitioned_rice_(
min_rice_parameter = suggested_rice_parameter - rice_parameter_search_dist;
max_rice_parameter = suggested_rice_parameter + rice_parameter_search_dist;
if(max_rice_parameter >= rice_parameter_limit) {
-#ifdef DEBUG_VERBOSE
+#ifndef NDEBUG
fprintf(stderr, "clipping rice_parameter (%u -> %u) @5\n", max_rice_parameter, rice_parameter_limit - 1);
#endif
max_rice_parameter = rice_parameter_limit - 1;
@@ -4246,7 +4246,7 @@ FLAC__bool set_partitioned_rice_(
}
#endif
if(rice_parameter >= rice_parameter_limit) {
-#ifdef DEBUG_VERBOSE
+#ifndef NDEBUG
fprintf(stderr, "clipping rice_parameter (%u -> %u) @6\n", rice_parameter, rice_parameter_limit - 1);
#endif
rice_parameter = rice_parameter_limit - 1;
@@ -4261,7 +4261,7 @@ FLAC__bool set_partitioned_rice_(
min_rice_parameter = rice_parameter - rice_parameter_search_dist;
max_rice_parameter = rice_parameter + rice_parameter_search_dist;
if(max_rice_parameter >= rice_parameter_limit) {
-#ifdef DEBUG_VERBOSE
+#ifndef NDEBUG
fprintf(stderr, "clipping rice_parameter (%u -> %u) @7\n", max_rice_parameter, rice_parameter_limit - 1);
#endif
max_rice_parameter = rice_parameter_limit - 1;
diff --git a/src/plugin_common/Makefile.am b/src/plugin_common/Makefile.am
index 6e9e3ed3..a528fb45 100644
--- a/src/plugin_common/Makefile.am
+++ b/src/plugin_common/Makefile.am
@@ -37,9 +37,3 @@ libplugin_common_la_SOURCES = \
EXTRA_DIST = \
Makefile.lite \
README
-
-debug:
- $(MAKE) all CFLAGS="@DEBUG@"
-
-profile:
- $(MAKE) all CFLAGS="@PROFILE@"
diff --git a/src/plugin_common/charset.c b/src/plugin_common/charset.c
index 5dded8a0..85e574bc 100644
--- a/src/plugin_common/charset.c
+++ b/src/plugin_common/charset.c
@@ -75,7 +75,7 @@ char* FLAC_plugin__charset_convert_string (const char *string, char *from, char
if ((cd = iconv_open(to, from)) == (iconv_t)-1)
{
-#ifdef DEBUG
+#ifndef NDEBUG
fprintf(stderr, "convert_string(): Conversion not supported. Charsets: %s -> %s", from, to);
#endif
return strdup(string);
@@ -115,7 +115,7 @@ retry:
length = strlen(input);
goto retry;
default:
-#ifdef DEBUG
+#ifndef NDEBUG
fprintf(stderr, "convert_string(): Conversion failed. Inputstring: %s; Error: %s", string, strerror(errno));
#endif
break;
diff --git a/src/plugin_xmms/http.c b/src/plugin_xmms/http.c
index 05f7300e..161d1b3d 100644
--- a/src/plugin_xmms/http.c
+++ b/src/plugin_xmms/http.c
@@ -61,8 +61,6 @@ static gint icy_metaint = 0;
extern InputPlugin flac_ip;
-#undef DEBUG_UDP
-
/* Static udp channel functions */
static int udp_establish_listener (gint *sock);
static int udp_check_for_data(gint sock);
@@ -573,7 +571,7 @@ static int http_connect (gchar *url_, gboolean head, guint64 offset)
if (!strncmp(line, "icy-metaint:", 12))
icy_metaint = atoi(line + 12);
if (!strncmp(line, "x-audiocast-udpport:", 20)) {
-#ifdef DEBUG_UDP
+#ifndef NDEBUG
fprintf (stderr, "Server wants udp messages on port %d\n", atoi (line + 20));
#endif
/*udp_serverport = atoi (line + 20);*/
@@ -752,7 +750,7 @@ static int udp_establish_listener(int *sock)
struct sockaddr_in sin;
socklen_t sinlen = sizeof (struct sockaddr_in);
-#ifdef DEBUG_UDP
+#ifndef NDEBUG
fprintf (stderr,"Establishing udp listener\n");
#endif
@@ -791,7 +789,7 @@ static int udp_establish_listener(int *sock)
return -1;
}
-#ifdef DEBUG_UDP
+#ifndef NDEBUG
fprintf (stderr,"Listening on local %s:%d\n", inet_ntoa(sin.sin_addr), g_ntohs(sin.sin_port));
#endif
@@ -820,7 +818,7 @@ static int udp_check_for_data(int sock)
return 0;
}
buf[len] = '\0';
-#ifdef DEBUG_UDP
+#ifndef NDEBUG
fprintf (stderr,"Received: [%s]\n", buf);
#endif
lines = g_strsplit(buf, "\n", 0);
@@ -889,7 +887,7 @@ static int udp_check_for_data(int sock)
g_log(NULL, G_LOG_LEVEL_WARNING,
"udp_check_for_data(): Unable to send ack to server: %s", strerror(errno));
}
-#ifdef DEBUG_UDP
+#ifndef NDEBUG
else
fprintf(stderr,"Sent ack: %s", obuf);
fprintf (stderr,"Remote: %s:%d\n", inet_ntoa(from.sin_addr), g_ntohs(from.sin_port));
diff --git a/src/share/Makefile.am b/src/share/Makefile.am
index 82d0fc96..8e3984a1 100644
--- a/src/share/Makefile.am
+++ b/src/share/Makefile.am
@@ -92,9 +92,3 @@ replaygain_analysis_libreplaygain_analysis_la_SOURCES = replaygain_analysis/repl
replaygain_synthesis_libreplaygain_synthesis_la_CFLAGS = -I $(top_srcdir)/src/share/replaygain_synthesis/include
replaygain_synthesis_libreplaygain_synthesis_la_SOURCES = replaygain_synthesis/replaygain_synthesis.c
-
-debug:
- $(MAKE) all CFLAGS="@DEBUG@"
-
-profile:
- $(MAKE) all CFLAGS="@PROFILE@"