summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--example/cdchange.c20
-rw-r--r--lib/driver/cdio.c4
-rw-r--r--lib/driver/image/bincue.c22
-rw-r--r--lib/driver/image/cdrdao.c23
-rw-r--r--lib/driver/realpath.c5
-rw-r--r--src/cdda-player.c2
-rw-r--r--test/check_sizeof.c11
-rw-r--r--test/driver/abs_path.c4
-rw-r--r--test/driver/freebsd.c12
-rw-r--r--test/driver/gnu_linux.c4
-rw-r--r--test/driver/helper.c5
-rw-r--r--test/driver/mmc_read.c11
-rw-r--r--test/driver/mmc_write.c10
-rw-r--r--test/driver/osx.c11
-rw-r--r--test/driver/realpath.c28
-rw-r--r--test/driver/solaris.c11
-rw-r--r--test/driver/win32.c11
-rw-r--r--test/test_lib_driver_util.c12
-rw-r--r--test/testassert.c5
-rw-r--r--test/testdefault.c13
-rwxr-xr-xtest/testgetdevices.c.in15
-rw-r--r--test/testischar.c8
-rw-r--r--test/testiso9660.c6
-rw-r--r--test/testisocd2.c.in13
-rw-r--r--test/testpregap.c.in13
25 files changed, 149 insertions, 130 deletions
diff --git a/example/cdchange.c b/example/cdchange.c
index 091900e3..240263b5 100644
--- a/example/cdchange.c
+++ b/example/cdchange.c
@@ -23,31 +23,25 @@
#endif
#ifdef HAVE_STDIO_H
-# include <stdio.h>
+#include <stdio.h>
#endif
-
#ifdef HAVE_LIMITS_H
-# include <limits.h>
+#include <limits.h>
#endif
-
#ifdef HAVE_STDLIB_H
-# include <stdlib.h>
+#include <stdlib.h>
#endif
-
#ifdef HAVE_STRING_H
-# include <string.h>
+#include <string.h>
#endif
-
#ifdef HAVE_UNISTD_H
-# include <unistd.h>
+#include <unistd.h>
#endif
-
#ifdef HAVE_ERRNO_H
-# include <errno.h>
+#include <errno.h>
#endif
-
#ifdef HAVE_WINDOWS_H
-# include <windows.h>
+#include <windows.h>
#endif
#if !defined(HAVE_SLEEP) && defined(_WIN32)
#include <windows.h>
diff --git a/lib/driver/cdio.c b/lib/driver/cdio.c
index 03d1c41e..1c92c29d 100644
--- a/lib/driver/cdio.c
+++ b/lib/driver/cdio.c
@@ -23,8 +23,12 @@
# define __CDIO_CONFIG_H__ 1
#endif
+#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
+#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
diff --git a/lib/driver/image/bincue.c b/lib/driver/image/bincue.c
index baf30e25..6a37e8b3 100644
--- a/lib/driver/image/bincue.c
+++ b/lib/driver/image/bincue.c
@@ -23,16 +23,7 @@
residing inside a disk file (*.bin) and its associated cue sheet.
(*.cue).
*/
-
-#include "image.h"
-#include "cdio_assert.h"
-#include "cdio_private.h"
-#include "_cdio_stdio.h"
-
-#include <cdio/logging.h>
-#include <cdio/util.h>
-#include <cdio/utf8.h>
-#include <cdio/version.h>
+#include "portable.h"
#ifdef HAVE_STDIO_H
#include <stdio.h>
@@ -60,7 +51,16 @@
#include <ctype.h>
-#include "portable.h"
+#include <cdio/logging.h>
+#include <cdio/util.h>
+#include <cdio/utf8.h>
+#include <cdio/version.h>
+
+#include "image.h"
+#include "cdio_assert.h"
+#include "cdio_private.h"
+#include "_cdio_stdio.h"
+
/* reader */
#define DEFAULT_CDIO_DEVICE "videocd.bin"
diff --git a/lib/driver/image/cdrdao.c b/lib/driver/image/cdrdao.c
index 254ac0b3..431e9286 100644
--- a/lib/driver/image/cdrdao.c
+++ b/lib/driver/image/cdrdao.c
@@ -22,17 +22,7 @@
residing inside a disk file (*.bin) and its associated cue sheet.
(*.cue).
*/
-
-
-#include "image.h"
-#include "cdio_assert.h"
-#include "_cdio_stdio.h"
-
-#include <cdio/logging.h>
-#include <cdio/sector.h>
-#include <cdio/util.h>
-#include <cdio/utf8.h>
-#include <cdio/version.h>
+#include "portable.h"
#ifdef HAVE_LIMITS_H
#include <limits.h>
@@ -63,7 +53,16 @@
#include <ctype.h>
-#include "portable.h"
+#include <cdio/logging.h>
+#include <cdio/sector.h>
+#include <cdio/util.h>
+#include <stdio.h>
+#include <cdio/utf8.h>
+#include <cdio/version.h>
+
+#include "image.h"
+#include "cdio_assert.h"
+#include "_cdio_stdio.h"
/* reader */
diff --git a/lib/driver/realpath.c b/lib/driver/realpath.c
index b83a9936..fd99110e 100644
--- a/lib/driver/realpath.c
+++ b/lib/driver/realpath.c
@@ -40,7 +40,9 @@
# include <stdlib.h>
#endif
-#include <stdio.h>
+#ifdef HAVE_STDIO_H
+# include <stdio.h>
+#endif
#ifdef HAVE_STRING_H
# include <string.h>
@@ -50,7 +52,6 @@
# include <unistd.h>
#endif
-
#ifdef HAVE_INTTYPES_H
# include "inttypes.h"
#endif
diff --git a/src/cdda-player.c b/src/cdda-player.c
index de9c680d..f1081575 100644
--- a/src/cdda-player.c
+++ b/src/cdda-player.c
@@ -40,7 +40,9 @@
#include <string.h>
#endif
+#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
+#endif
#ifdef HAVE_CDDB
#include <cddb/cddb.h>
diff --git a/test/check_sizeof.c b/test/check_sizeof.c
index 068264dc..10079b42 100644
--- a/test/check_sizeof.c
+++ b/test/check_sizeof.c
@@ -14,16 +14,21 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-
#ifdef HAVE_CONFIG_H
-# include "config.h"
-# define __CDIO_CONFIG_H__ 1
+#include "config.h"
+#define __CDIO_CONFIG_H__ 1
#endif
#include <assert.h>
+#ifdef HAVE_STDLIB_H
#include <stdlib.h>
+#endif
+#ifdef HAVE_STRING_H
#include <string.h>
+#endif
+#ifdef HAVE_STDIO_H
#include <stdio.h>
+#endif
#include <math.h>
#include <cdio/iso9660.h>
diff --git a/test/driver/abs_path.c b/test/driver/abs_path.c
index e1c5edd3..ec479972 100644
--- a/test/driver/abs_path.c
+++ b/test/driver/abs_path.c
@@ -1,6 +1,6 @@
#ifdef HAVE_CONFIG_H
-# include "config.h"
-# define __CDIO_CONFIG_H__ 1
+#include "config.h"
+#define __CDIO_CONFIG_H__ 1
#endif
#ifdef HAVE_STDIO_H
diff --git a/test/driver/freebsd.c b/test/driver/freebsd.c
index 40d1e38a..7664a4fe 100644
--- a/test/driver/freebsd.c
+++ b/test/driver/freebsd.c
@@ -19,21 +19,21 @@
Unit test for lib/driver/freebsd.c
*/
#ifdef HAVE_CONFIG_H
-# include "config.h"
-# define __CDIO_CONFIG_H__ 1
+#include "config.h"
+#define __CDIO_CONFIG_H__ 1
#endif
#ifdef HAVE_STDIO_H
-# include <stdio.h>
+#include <stdio.h>
#endif
#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
+#include <sys/types.h>
#endif
#ifdef HAVE_STDLIB_H
-# include <stdlib.h>
+#include <stdlib.h>
#endif
#ifdef HAVE_STRING_H
-# include <string.h>
+#include <string.h>
#endif
#include <cdio/cdio.h>
diff --git a/test/driver/gnu_linux.c b/test/driver/gnu_linux.c
index a16de72c..fdf998e5 100644
--- a/test/driver/gnu_linux.c
+++ b/test/driver/gnu_linux.c
@@ -19,8 +19,8 @@
Unit test for lib/driver/gnu_linux.c
*/
#ifdef HAVE_CONFIG_H
-# include "config.h"
-# define __CDIO_CONFIG_H__ 1
+#include "config.h"
+#define __CDIO_CONFIG_H__ 1
#endif
#ifdef HAVE_STDIO_H
diff --git a/test/driver/helper.c b/test/driver/helper.c
index ab89cb67..b000de40 100644
--- a/test/driver/helper.c
+++ b/test/driver/helper.c
@@ -15,9 +15,10 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef HAVE_CONFIG_H
-# include "config.h"
-# define __CDIO_CONFIG_H__ 1
+#include "config.h"
+#define __CDIO_CONFIG_H__ 1
#endif
+
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
diff --git a/test/driver/mmc_read.c b/test/driver/mmc_read.c
index 2e856e70..15c7bd76 100644
--- a/test/driver/mmc_read.c
+++ b/test/driver/mmc_read.c
@@ -20,12 +20,9 @@
Regression test for MMC commands which don't involve write access.
*/
#ifdef HAVE_CONFIG_H
-# include "config.h"
-# define __CDIO_CONFIG_H__ 1
+#include "config.h"
+#define __CDIO_CONFIG_H__ 1
#endif
-#include <cdio/cdio.h>
-#include <cdio/logging.h>
-#include <cdio/mmc_cmds.h>
#ifdef HAVE_STDIO_H
#include <stdio.h>
@@ -47,6 +44,10 @@
#define sleep(s) Sleep(1000*s)
#endif
+#include <cdio/cdio.h>
+#include <cdio/logging.h>
+#include <cdio/mmc_cmds.h>
+
#define SKIP_TEST 77
/* gcc may warn if no prototypes are given before function definition */
diff --git a/test/driver/mmc_write.c b/test/driver/mmc_write.c
index 676c7642..583fb1b4 100644
--- a/test/driver/mmc_write.c
+++ b/test/driver/mmc_write.c
@@ -25,19 +25,19 @@
#endif
#ifdef HAVE_STDIO_H
-# include <stdio.h>
+#include <stdio.h>
#endif
#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
+#include <sys/types.h>
#endif
#ifdef HAVE_STDLIB_H
-# include <stdlib.h>
+#include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
-# include <unistd.h>
+#include <unistd.h>
#endif
#ifdef HAVE_STRING_H
-# include <string.h>
+#include <string.h>
#endif
#if !defined(HAVE_SLEEP) && defined(_WIN32)
#include <windows.h>
diff --git a/test/driver/osx.c b/test/driver/osx.c
index 5d2b8c13..01c6a5bb 100644
--- a/test/driver/osx.c
+++ b/test/driver/osx.c
@@ -19,11 +19,9 @@
Unit test for lib/driver/osx.c
*/
#ifdef HAVE_CONFIG_H
-# include "config.h"
-# define __CDIO_CONFIG_H__ 1
+#include "config.h"
+#define __CDIO_CONFIG_H__ 1
#endif
-#include <cdio/cdio.h>
-#include <cdio/logging.h>
#ifdef HAVE_STDIO_H
#include <stdio.h>
@@ -34,7 +32,12 @@
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
+#ifdef HAVE_STRING_H
#include <string.h>
+#endif
+
+#include <cdio/cdio.h>
+#include <cdio/logging.h>
int
main(int argc, const char *argv[])
diff --git a/test/driver/realpath.c b/test/driver/realpath.c
index e9ce40a3..c182ef2d 100644
--- a/test/driver/realpath.c
+++ b/test/driver/realpath.c
@@ -19,33 +19,33 @@
Unit test for lib/driver/gnu_linux.c
*/
#ifdef HAVE_CONFIG_H
-# include "config.h"
-# define __CDIO_CONFIG_H__ 1
+#include "config.h"
+#define __CDIO_CONFIG_H__ 1
#endif
#ifdef HAVE_STDIO_H
-# include <stdio.h>
+#include <stdio.h>
#endif
#ifdef HAVE_STRING_H
-# include <string.h>
+#include <string.h>
#endif
#ifdef HAVE_LIMITS_H
-# include <limits.h>
+#include <limits.h>
#endif
#ifdef HAVE_STDLIB_H
-# include <stdlib.h>
+#include <stdlib.h>
#endif
-
#ifdef HAVE_SYS_STAT_H
-# include <sys/stat.h>
+#include <sys/stat.h>
#endif
-
#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
+#include <sys/types.h>
#endif
-
#ifdef HAVE_UNISTD_H
-# include <unistd.h>
+#include <unistd.h>
+#endif
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
#endif
#if defined(_WIN32) && !defined(__CYGWIN__)
#include <windows.h>
@@ -56,10 +56,6 @@
#define _mkdir(a) mkdir(a, S_IRWXU)
#endif
-#ifdef HAVE_ERRNO_H
-# include <errno.h>
-#endif
-
#include <cdio/util.h>
#define MY_DIR_SEPARATOR '/'
diff --git a/test/driver/solaris.c b/test/driver/solaris.c
index 831af279..1d15b85c 100644
--- a/test/driver/solaris.c
+++ b/test/driver/solaris.c
@@ -19,11 +19,9 @@
Unit test for lib/driver/solaris.c
*/
#ifdef HAVE_CONFIG_H
-# include "config.h"
-# define __CDIO_CONFIG_H__ 1
+#include "config.h"
+#define __CDIO_CONFIG_H__ 1
#endif
-#include <cdio/cdio.h>
-#include <cdio/logging.h>
#ifdef HAVE_STDIO_H
#include <stdio.h>
@@ -34,7 +32,12 @@
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
+#ifdef HAVE_STRING_H
#include <string.h>
+#endif
+
+#include <cdio/cdio.h>
+#include <cdio/logging.h>
int
main(int argc, const char *argv[])
diff --git a/test/driver/win32.c b/test/driver/win32.c
index 9f35807c..486d6425 100644
--- a/test/driver/win32.c
+++ b/test/driver/win32.c
@@ -19,11 +19,9 @@
Unit test for lib/driver/MSWindows/win32.c
*/
#ifdef HAVE_CONFIG_H
-# include "config.h"
-# define __CDIO_CONFIG_H__ 1
+#include "config.h"
+#define __CDIO_CONFIG_H__ 1
#endif
-#include <cdio/cdio.h>
-#include <cdio/logging.h>
#ifdef HAVE_STDIO_H
#include <stdio.h>
@@ -34,7 +32,12 @@
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
+#ifdef HAVE_STRING_H
#include <string.h>
+#endif
+
+#include <cdio/cdio.h>
+#include <cdio/logging.h>
int
main(int argc, const char *argv[])
diff --git a/test/test_lib_driver_util.c b/test/test_lib_driver_util.c
index bcecec5b..cd478679 100644
--- a/test/test_lib_driver_util.c
+++ b/test/test_lib_driver_util.c
@@ -15,20 +15,22 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* Unit test for lib/driver/util.c */
-
-#include <cdio/version.h>
-
#ifdef HAVE_CONFIG_H
-# include "config.h"
-# define __CDIO_CONFIG_H__ 1
+#include "config.h"
+#define __CDIO_CONFIG_H__ 1
#endif
+
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
+#ifdef HAVE_STRING_H
#include <string.h>
+#endif
+
+#include <cdio/version.h>
int
main(int argc, const char *argv[])
diff --git a/test/testassert.c b/test/testassert.c
index d764cd72..90741aca 100644
--- a/test/testassert.c
+++ b/test/testassert.c
@@ -14,10 +14,9 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-
#ifdef HAVE_CONFIG_H
-# include "config.h"
-# define __CDIO_CONFIG_H__ 1
+#include "config.h"
+#define __CDIO_CONFIG_H__ 1
#endif
/* Private headers */
diff --git a/test/testdefault.c b/test/testdefault.c
index f6468539..45d16a55 100644
--- a/test/testdefault.c
+++ b/test/testdefault.c
@@ -20,12 +20,9 @@
and cdio_free_device_list()
*/
#ifdef HAVE_CONFIG_H
-# include "config.h"
-# define __CDIO_CONFIG_H__ 1
+#include "config.h"
+#define __CDIO_CONFIG_H__ 1
#endif
-#include <cdio/cdio.h>
-#include <cdio/cd_types.h>
-#include <cdio/logging.h>
#ifdef HAVE_STDIO_H
#include <stdio.h>
@@ -36,7 +33,13 @@
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
+#ifdef HAVE_STRING_H
#include <string.h>
+#endif
+
+#include <cdio/cdio.h>
+#include <cdio/cd_types.h>
+#include <cdio/logging.h>
static void
log_handler (cdio_log_level_t level, const char message[])
diff --git a/test/testgetdevices.c.in b/test/testgetdevices.c.in
index 85b799b0..bf376dbd 100755
--- a/test/testgetdevices.c.in
+++ b/test/testgetdevices.c.in
@@ -20,12 +20,9 @@
and cdio_free_device_list()
*/
#ifdef HAVE_CONFIG_H
-# include "config.h"
-# define __CDIO_CONFIG_H__ 1
+#include "config.h"
+#define __CDIO_CONFIG_H__ 1
#endif
-#include <cdio/cdio.h>
-#include <cdio/cd_types.h>
-#include <cdio/logging.h>
#ifdef HAVE_STDIO_H
#include <stdio.h>
@@ -42,14 +39,18 @@
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-
+#ifdef HAVE_STRING_H
#include <string.h>
+#endif
+
+#include <cdio/cdio.h>
+#include <cdio/cd_types.h>
+#include <cdio/logging.h>
#ifndef DATA_DIR
#define DATA_DIR "@abs_top_srcdir@/test/data/"
#endif
-
static void
log_handler (cdio_log_level_t level, const char message[])
{
diff --git a/test/testischar.c b/test/testischar.c
index 080f1fd0..295e633d 100644
--- a/test/testischar.c
+++ b/test/testischar.c
@@ -17,13 +17,15 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* Tests ISO9660 character sets. */
-
#ifdef HAVE_CONFIG_H
-# include "config.h"
-# define __CDIO_CONFIG_H__ 1
+#include "config.h"
+#define __CDIO_CONFIG_H__ 1
#endif
+#ifdef HAVE_STDIO_H
#include <stdio.h>
+#endif
+
#include <cdio/iso9660.h>
int
diff --git a/test/testiso9660.c b/test/testiso9660.c
index 5f5281dd..6f659196 100644
--- a/test/testiso9660.c
+++ b/test/testiso9660.c
@@ -16,10 +16,9 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* Tests ISO9660 library routines. */
-
#ifdef HAVE_CONFIG_H
-# include "config.h"
-# define __CDIO_CONFIG_H__ 1
+#include "config.h"
+#define __CDIO_CONFIG_H__ 1
#endif
#include <ctype.h>
@@ -32,6 +31,7 @@
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
+
#include <cdio/iso9660.h>
static bool
diff --git a/test/testisocd2.c.in b/test/testisocd2.c.in
index e614c964..9b2645cb 100644
--- a/test/testisocd2.c.in
+++ b/test/testisocd2.c.in
@@ -23,11 +23,6 @@
# include "config.h"
#endif
-#include "filemode.h"
-#include <cdio/cdio.h>
-#include <cdio/iso9660.h>
-#include <cdio/cd_types.h>
-
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
@@ -46,9 +41,11 @@
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
+
+#include <cdio/cdio.h>
+#include <cdio/iso9660.h>
+#include <cdio/cd_types.h>
+#include "filemode.h"
/* Set up a CD-DA image to test on which is in the libcdio distribution. */
#define ISO9660_IMAGE_PATH "@abs_top_srcdir@/test/data/"
diff --git a/test/testpregap.c.in b/test/testpregap.c.in
index b049fde5..d15bd53a 100644
--- a/test/testpregap.c.in
+++ b/test/testpregap.c.in
@@ -20,12 +20,9 @@
Regression test for cdio_get_pregap_lsn()
*/
#ifdef HAVE_CONFIG_H
-# include "config.h"
-# define __CDIO_CONFIG_H__ 1
+#include "config.h"
+#define __CDIO_CONFIG_H__ 1
#endif
-#include <cdio/cdio.h>
-#include <cdio/cd_types.h>
-#include <cdio/logging.h>
#ifdef HAVE_STDIO_H
#include <stdio.h>
@@ -36,7 +33,13 @@
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
+#ifdef HAVE_STRING_H
#include <string.h>
+#endif
+
+#include <cdio/cdio.h>
+#include <cdio/cd_types.h>
+#include <cdio/logging.h>
#ifndef DATA_DIR
#define DATA_DIR "@srcdir@/data"