[libdvdnav-devel] [PATCH] Add const

Petri Hintukainen phintuka at gmail.com
Wed Sep 9 09:10:26 CEST 2015


---
 src/dvd_reader.c      | 6 +++---
 src/dvd_udf.c         | 2 +-
 src/dvdread/dvd_udf.h | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/dvd_reader.c b/src/dvd_reader.c
index 3da9633..eca22ae 100644
--- a/src/dvd_reader.c
+++ b/src/dvd_reader.c
@@ -173,7 +173,7 @@ static int initAllCSSKeys( dvd_reader_t *dvd )
   uint32_t start, len;
   int title;
 
-  char *nokeys_str = getenv("DVDREAD_NOKEYS");
+  const char *nokeys_str = getenv("DVDREAD_NOKEYS");
   if(nokeys_str != NULL)
     return 0;
 
@@ -651,7 +651,7 @@ void DVDClose( dvd_reader_t *dvd )
 /**
  * Open an unencrypted file on a DVD image file.
  */
-static dvd_file_t *DVDOpenFileUDF( dvd_reader_t *dvd, char *filename,
+static dvd_file_t *DVDOpenFileUDF( dvd_reader_t *dvd, const char *filename,
                                    int do_cache )
 {
   uint32_t start, len;
@@ -759,7 +759,7 @@ static int findDVDFile( dvd_reader_t *dvd, const char *file, char *filename )
 /**
  * Open an unencrypted file from a DVD directory tree.
  */
-static dvd_file_t *DVDOpenFilePath( dvd_reader_t *dvd, char *filename )
+static dvd_file_t *DVDOpenFilePath( dvd_reader_t *dvd, const char *filename )
 {
   char full_path[ PATH_MAX + 1 ];
   dvd_file_t *dvd_file;
diff --git a/src/dvd_udf.c b/src/dvd_udf.c
index 3ff857b..5eb3d2b 100644
--- a/src/dvd_udf.c
+++ b/src/dvd_udf.c
@@ -794,7 +794,7 @@ static int UDFFindPartition( dvd_reader_t *device, int partnum,
   return part->valid;
 }
 
-uint32_t UDFFindFile( dvd_reader_t *device, char *filename,
+uint32_t UDFFindFile( dvd_reader_t *device, const char *filename,
                       uint32_t *filesize )
 {
   uint8_t LogBlock_base[ DVD_VIDEO_LB_LEN + 2048 ];
diff --git a/src/dvdread/dvd_udf.h b/src/dvdread/dvd_udf.h
index 9156a67..9f449e0 100644
--- a/src/dvdread/dvd_udf.h
+++ b/src/dvdread/dvd_udf.h
@@ -46,7 +46,7 @@ extern "C" {
  * '/VIDEO_TS/VTS_01_1.IFO'.  On success, filesize will be set to the size of
  * the file in bytes.
  */
-uint32_t UDFFindFile( dvd_reader_t *device, char *filename, uint32_t *size );
+uint32_t UDFFindFile( dvd_reader_t *device, const char *filename, uint32_t *size );
 
 int UDFGetVolumeIdentifier(dvd_reader_t *device,
                            char *volid, unsigned int volid_size);
-- 
2.1.4



More information about the libdvdnav-devel mailing list