diff --git a/src/audio.c b/src/audio.c index 317d4c8d..41dc76a2 100644 --- a/src/audio.c +++ b/src/audio.c @@ -15,6 +15,8 @@ #include #endif +#include "debug.h" + static int file_write(struct audio_output_struct* ao, unsigned char *bytes, int count) { return (int)write(ao->fn, bytes, count); diff --git a/src/buffer.c b/src/buffer.c index 5fc8a54e..e443b5a4 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -16,6 +16,7 @@ #include "common.h" #include +#include "debug.h" int outburst = 32768; diff --git a/src/common.c b/src/common.c index f9759fbb..6690decf 100644 --- a/src/common.c +++ b/src/common.c @@ -8,15 +8,15 @@ #include "mpg123app.h" #include - #include - #include "common.h" #ifdef WIN32 #include #endif +#include "debug.h" + const char* rva_name[3] = { "off", "mix", "album" }; static const char *modes[5] = {"Stereo", "Joint-Stereo", "Dual-Channel", "Single-Channel", "Invalid" }; static const char *smodes[5] = { "stereo", "joint-stereo", "dual-channel", "mono", "invalid" }; diff --git a/src/control_generic.c b/src/control_generic.c index c2210724..3dbd24ed 100644 --- a/src/control_generic.c +++ b/src/control_generic.c @@ -37,6 +37,8 @@ FILE *outstream; static int mode = MODE_STOPPED; static int init = 0; +#include "debug.h" + void generic_sendmsg (const char *fmt, ...) { va_list ap; diff --git a/src/getlopt.c b/src/getlopt.c index 1373d70a..48f2e200 100644 --- a/src/getlopt.c +++ b/src/getlopt.c @@ -9,8 +9,8 @@ #include #include "config.h" -#include "debug.h" #include "getlopt.h" +#include "debug.h" int loptind = 1; /* index in argv[] */ int loptchr = 0; /* index in argv[loptind] */ diff --git a/src/httpget.c b/src/httpget.c index 644d2216..2b2b3e95 100644 --- a/src/httpget.c +++ b/src/httpget.c @@ -29,6 +29,24 @@ #include "mpg123app.h" #include "httpget.h" +#if !defined(WIN32) && !defined(GENERIC) +#include +#define HTTP_MAX_RELOCATIONS 20 +#include +#include +#include +#include +#include +#include +#include +#include "true.h" +#ifndef INADDR_NONE +#define INADDR_NONE 0xffffffff +#endif +#endif + +#include "debug.h" + void httpdata_init(struct httpdata *e) { mpg123_init_string(&e->content_type); @@ -89,24 +107,6 @@ debunk_result: #if !defined(WIN32) && !defined(GENERIC) -#include - -#define HTTP_MAX_RELOCATIONS 20 - -#include -#include -#include -#include -#include -#include -#include - -#include "true.h" - -#ifndef INADDR_NONE -#define INADDR_NONE 0xffffffff -#endif - int writestring (int fd, char *string) { int result, bytes = strlen(string); diff --git a/src/id3print.c b/src/id3print.c index 6135266c..2510b703 100644 --- a/src/id3print.c +++ b/src/id3print.c @@ -9,6 +9,7 @@ #include "mpg123.h" #include "mpg123app.h" #include "genre.h" +#include "debug.h" static void utf8_ascii(mpg123_string *dest, mpg123_string *source); static void transform(mpg123_string *dest, mpg123_string *source) diff --git a/src/legacy_module.c b/src/legacy_module.c index ebf4bf6f..fe1214ac 100644 --- a/src/legacy_module.c +++ b/src/legacy_module.c @@ -7,7 +7,7 @@ */ #include "mpg123app.h" - +#include "debug.h" /* A single module is staticly compiled in for each type */ extern mpg123_module_t mpg123_output_module_info; diff --git a/src/libmpg123/decode_ntom.c b/src/libmpg123/decode_ntom.c index 0f17f826..acf8ce8f 100644 --- a/src/libmpg123/decode_ntom.c +++ b/src/libmpg123/decode_ntom.c @@ -8,6 +8,7 @@ #define SAFE_NTOM /* Do not depend on off_t*off_t with big values still being in the range... */ #include "mpg123lib_intern.h" +#include "debug.h" int synth_ntom_set_step(mpg123_handle *fr) { diff --git a/src/libmpg123/format.c b/src/libmpg123/format.c index 12be0b4b..0dfd7df8 100644 --- a/src/libmpg123/format.c +++ b/src/libmpg123/format.c @@ -7,6 +7,7 @@ */ #include "mpg123lib_intern.h" +#include "debug.h" /* static int chans[NUM_CHANNELS] = { 1 , 2 }; */ static const long my_rates[MPG123_RATES] = /* only the standard rates */ diff --git a/src/libmpg123/frame.c b/src/libmpg123/frame.c index 8b0577b5..d3185c73 100644 --- a/src/libmpg123/frame.c +++ b/src/libmpg123/frame.c @@ -8,6 +8,7 @@ #include "mpg123lib_intern.h" #include "getcpuflags.h" +#include "debug.h" #define IGNORESHIFT 2 diff --git a/src/libmpg123/id3.c b/src/libmpg123/id3.c index 24c9afb7..bdb6628a 100644 --- a/src/libmpg123/id3.c +++ b/src/libmpg123/id3.c @@ -8,6 +8,7 @@ #include "mpg123lib_intern.h" #include "id3.h" +#include "debug.h" /* UTF support definitions */ diff --git a/src/libmpg123/layer3.c b/src/libmpg123/layer3.c index 2072541a..025a97a1 100644 --- a/src/libmpg123/layer3.c +++ b/src/libmpg123/layer3.c @@ -13,8 +13,8 @@ #include "mpg123lib_intern.h" #include "huffman.h" - #include "getbits.h" +#include "debug.h" /* static one-time calculated tables... or so */ static real ispow[8207]; diff --git a/src/libmpg123/libmpg123.c b/src/libmpg123/libmpg123.c index 3ee2fc67..9ea597f7 100644 --- a/src/libmpg123/libmpg123.c +++ b/src/libmpg123/libmpg123.c @@ -8,6 +8,7 @@ #include "mpg123lib_intern.h" #include "getbits.h" +#include "debug.h" #ifdef GAPLESS #define SAMPLE_ADJUST(x) ((x) - ((mh->p.flags & MPG123_GAPLESS) ? mh->begin_os : 0)) diff --git a/src/libmpg123/mpg123lib_intern.h b/src/libmpg123/mpg123lib_intern.h index 81f1855e..2273ac56 100644 --- a/src/libmpg123/mpg123lib_intern.h +++ b/src/libmpg123/mpg123lib_intern.h @@ -19,7 +19,6 @@ #endif #include "mpg123.h" #include "config.h" -#include "debug.h" #include "compat.h" #define SKIP_JUNK 1 diff --git a/src/libmpg123/parse.c b/src/libmpg123/parse.c index 2047ed42..38fcc768 100644 --- a/src/libmpg123/parse.c +++ b/src/libmpg123/parse.c @@ -17,6 +17,18 @@ #include #endif +/* a limit for number of frames in a track; beyond that unsigned long may not be enough to hold byte addresses */ +#ifdef HAVE_LIMITS_H +#include +#endif +#ifndef ULONG_MAX +/* hm, is this portable across preprocessors? */ +#define ULONG_MAX ((unsigned long)-1) +#endif +#define TRACK_MAX_FRAMES ULONG_MAX/4/1152 + +#include "debug.h" + #define bsbufid(fr) (fr)->bsbuf==(fr)->bsspace[0] ? 0 : ((fr)->bsbuf==fr->bsspace[1] ? 1 : ( (fr)->bsbuf==(fr)->bsspace[0]+512 ? 2 : ((fr)->bsbuf==fr->bsspace[1]+512 ? 3 : -1) ) ) /* @@ -67,15 +79,6 @@ static const int tabsel_123[2][3][16] = { const long freqs[9] = { 44100, 48000, 32000, 22050, 24000, 16000 , 11025 , 12000 , 8000 }; -/* a limit for number of frames in a track; beyond that unsigned long may not be enough to hold byte addresses */ -#ifdef HAVE_LIMITS_H -#include -#endif -#ifndef ULONG_MAX -/* hm, is this portable across preprocessors? */ -#define ULONG_MAX ((unsigned long)-1) -#endif -#define TRACK_MAX_FRAMES ULONG_MAX/4/1152 #ifdef VARMODESUPPORT /* diff --git a/src/libmpg123/readers.c b/src/libmpg123/readers.c index 0318e679..2554ece2 100644 --- a/src/libmpg123/readers.c +++ b/src/libmpg123/readers.c @@ -24,6 +24,7 @@ #endif #include "mpg123lib_intern.h" +#include "debug.h" static int default_init(mpg123_handle *fr); static off_t get_fileinfo(mpg123_handle *); diff --git a/src/libmpg123/stringbuf.c b/src/libmpg123/stringbuf.c index 407c1398..c0d41fb6 100644 --- a/src/libmpg123/stringbuf.c +++ b/src/libmpg123/stringbuf.c @@ -7,10 +7,10 @@ */ #include "config.h" -#include "debug.h" #include "mpg123.h" #include "compat.h" #include +#include "debug.h" void mpg123_init_string(mpg123_string* sb) { diff --git a/src/libmpg123/system.c b/src/libmpg123/system.c index 5efb8a65..d2d36d66 100644 --- a/src/libmpg123/system.c +++ b/src/libmpg123/system.c @@ -19,7 +19,8 @@ #include #include -#include "mpg123app.h" +#include "mpg123app.h" <<<--- nope! +#include "debug.h" static int filept; static int verbose = 1; diff --git a/src/libmpg123/tabinit.c b/src/libmpg123/tabinit.c index 476e99df..a48ddf80 100644 --- a/src/libmpg123/tabinit.c +++ b/src/libmpg123/tabinit.c @@ -7,6 +7,7 @@ */ #include "mpg123lib_intern.h" +#include "debug.h" /* All optimizations share this code - with the exception of MMX */ #ifndef OPT_MMX_ONLY diff --git a/src/module.c b/src/module.c index 2c058e79..5309817e 100644 --- a/src/module.c +++ b/src/module.c @@ -14,6 +14,7 @@ #include #include "mpg123app.h" +#include "debug.h" #ifndef HAVE_LTDL #error Cannot build without LTDL library support diff --git a/src/mpg123.c b/src/mpg123.c index 7fcceb80..c39a007c 100644 --- a/src/mpg123.c +++ b/src/mpg123.c @@ -45,6 +45,8 @@ #include "httpget.h" #include "getcpuflags.h" +#include "debug.h" + static void usage(int err); static void want_usage(char* arg); static void long_usage(int err); diff --git a/src/mpg123app.h b/src/mpg123app.h index 968360ea..f505822d 100644 --- a/src/mpg123app.h +++ b/src/mpg123app.h @@ -14,7 +14,6 @@ /* everyone needs it */ #include "config.h" -#include "debug.h" #include "httpget.h" /* import DLL symbols on windows */ #if defined(WIN32) && defined(DYNAMIC_BUILD) diff --git a/src/playlist.c b/src/playlist.c index 286ba80e..c8ab0545 100644 --- a/src/playlist.c +++ b/src/playlist.c @@ -13,6 +13,7 @@ #include "term.h" /* for term_restore */ #include "playlist.h" #include "httpget.h" +#include "debug.h" #ifdef HAVE_RANDOM #define RAND random diff --git a/src/term.c b/src/term.c index 10097198..fb9674ee 100644 --- a/src/term.c +++ b/src/term.c @@ -18,6 +18,7 @@ #include "common.h" #include "playlist.h" #include "id3print.h" +#include "debug.h" extern int buffer_pid; extern audio_output_t *ao; diff --git a/src/wav.c b/src/wav.c index f6712fac..6ed208fc 100644 --- a/src/wav.c +++ b/src/wav.c @@ -16,6 +16,7 @@ #include "mpg123app.h" #include +#include "debug.h" #ifdef FLOATOUT #define WAVE_FORMAT 3 diff --git a/src/xfermem.c b/src/xfermem.c index 40a13ae3..09a5d5d0 100644 --- a/src/xfermem.c +++ b/src/xfermem.c @@ -25,6 +25,8 @@ #include #endif +#include "debug.h" + #if defined (HAVE_MMAP) && defined(MAP_ANONYMOUS) && !defined(MAP_ANON) #define MAP_ANON MAP_ANONYMOUS #endif