More source headers harmonization

* fix missing #ifdefs
* remove spaces and page feeds
* follow same set of rules everywhere, with cdio includes coming
  after standard C includes.
This commit is contained in:
Pete Batard
2012-03-05 17:58:56 +00:00
parent 9b0a90d4ae
commit 0074e54f97
25 changed files with 149 additions and 130 deletions

View File

@@ -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>

View File

@@ -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

View File

@@ -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"

View File

@@ -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 */

View File

@@ -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

View File

@@ -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>

View File

@@ -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>

View File

@@ -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

View File

@@ -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>

View File

@@ -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

View File

@@ -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

View File

@@ -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 */

View File

@@ -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>

View File

@@ -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[])

View File

@@ -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 '/'

View File

@@ -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[])

View File

@@ -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[])

View File

@@ -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[])

View File

@@ -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 */

View File

@@ -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[])

View File

@@ -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[])
{

View File

@@ -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

View File

@@ -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

View File

@@ -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/"

View File

@@ -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"