[libdvdcss-devel] error: const correctness

Diego Biurrun git at videolan.org
Wed Nov 5 12:10:09 CET 2014


libdvdcss | branch: master | Diego Biurrun <diego at biurrun.de> | Thu Oct 30 13:16:38 2014 +0100| [e9ff3b341c2da792cac1c502faefe7adc17a2514] | committer: Diego Biurrun

error: const correctness

> http://git.videolan.org/gitweb.cgi/libdvdcss.git/?a=commit;h=e9ff3b341c2da792cac1c502faefe7adc17a2514
---

 NEWS                |    1 +
 src/dvdcss/dvdcss.h |    2 +-
 src/error.c         |    2 +-
 src/libdvdcss.c     |    2 +-
 src/libdvdcss.h     |    4 ++--
 5 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/NEWS b/NEWS
index ef617b5..61c7b58 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,7 @@ Changes since 1.3.0:
   * Drop support for Windows 9x.
     Windows NT 4.0 SP4 with IE 5.0 is now required.
   * Replace BeOS support by Haiku support.
+  * dvdcss_error() now returns "const char *" instad of "char *".
   * Miscellaneous cleanups to code, documentation, build system.
 
 
diff --git a/src/dvdcss/dvdcss.h b/src/dvdcss/dvdcss.h
index 64f95cf..ea62b8b 100644
--- a/src/dvdcss/dvdcss.h
+++ b/src/dvdcss/dvdcss.h
@@ -85,7 +85,7 @@ LIBDVDCSS_EXPORT int      dvdcss_readv ( dvdcss_t,
                                void *p_iovec,
                                int i_blocks,
                                int i_flags );
-LIBDVDCSS_EXPORT char *   dvdcss_error ( dvdcss_t );
+LIBDVDCSS_EXPORT const char *dvdcss_error ( const dvdcss_t );
 
 LIBDVDCSS_EXPORT int      dvdcss_is_scrambled ( dvdcss_t );
 
diff --git a/src/error.c b/src/error.c
index 9d5f242..00aee4a 100644
--- a/src/error.c
+++ b/src/error.c
@@ -29,7 +29,7 @@
 /*****************************************************************************
  * Error messages
  *****************************************************************************/
-void print_error( dvdcss_t dvdcss, char *psz_string )
+void print_error( dvdcss_t dvdcss, const char *psz_string )
 {
     if( dvdcss->b_errors )
     {
diff --git a/src/libdvdcss.c b/src/libdvdcss.c
index 96df29c..4c19c6d 100644
--- a/src/libdvdcss.c
+++ b/src/libdvdcss.c
@@ -562,7 +562,7 @@ error:
  * Return a string with the last error message produced by \e libdvdcss.
  * Useful to conveniently format error messages in external applications.
  */
-LIBDVDCSS_EXPORT char * dvdcss_error ( dvdcss_t dvdcss )
+LIBDVDCSS_EXPORT const char * dvdcss_error ( const dvdcss_t dvdcss )
 {
     return dvdcss->psz_error;
 }
diff --git a/src/libdvdcss.h b/src/libdvdcss.h
index 7b64103..9750c37 100644
--- a/src/libdvdcss.h
+++ b/src/libdvdcss.h
@@ -70,7 +70,7 @@ struct dvdcss_s
     char * psz_block;
 
     /* Error management */
-    char * psz_error;
+    const char *psz_error;
     int    b_errors;
     int    b_debug;
 
@@ -96,6 +96,6 @@ struct dvdcss_s
         fprintf( stderr, "\n" ); \
     }
 
-void print_error ( dvdcss_t, char * );
+void print_error ( dvdcss_t, const char * );
 
 #endif /* DVDCSS_LIBDVDCSS_H */



More information about the libdvdcss-devel mailing list