[libdvdcss-devel] [PATCH 04/47] Replace "char const" by "const char".

Diego Biurrun diego at biurrun.de
Wed Oct 29 21:33:04 CET 2014


The latter is the more common idiom, the former reads weird.
---
 src/css.c    |  2 +-
 src/device.c | 20 ++++++++++----------
 src/device.h |  2 +-
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/css.c b/src/css.c
index b70759a..68eaf4b 100644
--- a/src/css.c
+++ b/src/css.c
@@ -103,7 +103,7 @@ static int  _dvdcss_titlekey    ( dvdcss_t, int , dvd_key_t );
  *****************************************************************************/
 int _dvdcss_test( dvdcss_t dvdcss )
 {
-    char const *psz_type, *psz_rpc;
+    const char *psz_type, *psz_rpc;
     int i_ret, i_copyright, i_type, i_mask, i_rpc;
 
     i_ret = ioctl_ReadCopyright( dvdcss->i_fd, 0 /* i_layer */, &i_copyright );
diff --git a/src/device.c b/src/device.c
index 4f2d27a..9bfcba9 100644
--- a/src/device.c
+++ b/src/device.c
@@ -77,14 +77,14 @@
 /*****************************************************************************
  * Device reading prototypes
  *****************************************************************************/
-static int libc_open  ( dvdcss_t, char const * );
+static int libc_open  ( dvdcss_t, const char * );
 static int libc_seek  ( dvdcss_t, int );
 static int libc_read  ( dvdcss_t, void *, int );
 static int libc_readv ( dvdcss_t, struct iovec *, int );
 
 #ifdef WIN32
-static int win2k_open ( dvdcss_t, char const * );
-static int aspi_open  ( dvdcss_t, char const * );
+static int win2k_open ( dvdcss_t, const char * );
+static int aspi_open  ( dvdcss_t, const char * );
 static int win2k_seek ( dvdcss_t, int );
 static int aspi_seek  ( dvdcss_t, int );
 static int win2k_read ( dvdcss_t, void *, int );
@@ -93,7 +93,7 @@ static int win_readv  ( dvdcss_t, struct iovec *, int );
 
 static int aspi_read_internal  ( int, void *, int );
 #elif defined( __OS2__ )
-static int os2_open ( dvdcss_t, char const * );
+static int os2_open ( dvdcss_t, const char * );
 /* just use macros for libc */
 #   define os2_seek     libc_seek
 #   define os2_read     libc_read
@@ -354,7 +354,7 @@ void _dvdcss_check ( dvdcss_t dvdcss )
 
 int _dvdcss_open ( dvdcss_t dvdcss )
 {
-    char const *psz_device = dvdcss->psz_device;
+    const char *psz_device = dvdcss->psz_device;
 
     print_debug( dvdcss, "opening target `%s'", psz_device );
 
@@ -409,7 +409,7 @@ int _dvdcss_open ( dvdcss_t dvdcss )
 }
 
 #ifdef DVDCSS_RAW_OPEN
-int _dvdcss_raw_open ( dvdcss_t dvdcss, char const *psz_device )
+int _dvdcss_raw_open ( dvdcss_t dvdcss, const char *psz_device )
 {
     dvdcss->i_raw_fd = open( psz_device, 0 );
 
@@ -478,7 +478,7 @@ int _dvdcss_close ( dvdcss_t dvdcss )
 /*****************************************************************************
  * Open commands.
  *****************************************************************************/
-static int libc_open ( dvdcss_t dvdcss, char const *psz_device )
+static int libc_open ( dvdcss_t dvdcss, const char *psz_device )
 {
     dvdcss->i_fd = dvdcss->i_read_fd = open( psz_device, O_BINARY );
 
@@ -496,7 +496,7 @@ static int libc_open ( dvdcss_t dvdcss, char const *psz_device )
 }
 
 #if defined( WIN32 )
-static int win2k_open ( dvdcss_t dvdcss, char const *psz_device )
+static int win2k_open ( dvdcss_t dvdcss, const char *psz_device )
 {
     char psz_dvd[7];
     snprintf( psz_dvd, 7, "\\\\.\\%c:", psz_device[0] );
@@ -532,7 +532,7 @@ static int win2k_open ( dvdcss_t dvdcss, char const *psz_device )
     return 0;
 }
 
-static int aspi_open( dvdcss_t dvdcss, char const * psz_device )
+static int aspi_open( dvdcss_t dvdcss, const char *psz_device )
 {
     HMODULE hASPI;
     DWORD dwSupportInfo;
@@ -652,7 +652,7 @@ static int aspi_open( dvdcss_t dvdcss, char const * psz_device )
 #endif
 
 #ifdef __OS2__
-static int os2_open ( dvdcss_t dvdcss, char const *psz_device )
+static int os2_open ( dvdcss_t dvdcss, const char *psz_device )
 {
     char  psz_dvd[] = "X:";
     HFILE hfile;
diff --git a/src/device.h b/src/device.h
index e45d075..4c7f38b 100644
--- a/src/device.h
+++ b/src/device.h
@@ -60,6 +60,6 @@ int  _dvdcss_close      ( dvdcss_t );
 /*****************************************************************************
  * Device reading prototypes, raw-device specific
  *****************************************************************************/
-int _dvdcss_raw_open     ( dvdcss_t, char const * );
+int _dvdcss_raw_open     ( dvdcss_t, const char * );
 
 #endif /* DVDCSS_DEVICE_H */
-- 
1.9.1



More information about the libdvdcss-devel mailing list