libcdio-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Libcdio-devel] [PATCH 2/2] fix MinGW compilation warnings


From: Pete Batard
Subject: [Libcdio-devel] [PATCH 2/2] fix MinGW compilation warnings
Date: Mon, 13 Mar 2017 12:10:03 +0100
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

cd_types.c: In function 'cdio_guess_cd_type':
cd_types.c:292:2: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
  if ( _cdio_read_block(p_cdio, 35, start_session, 5, i_track) < 0)
  ^~
cd_types.c:295:4: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
    iso_analysis->UDFVerMinor=(unsigned int)buffer[5][240];
    ^~~~~~~~~~~~

...

getopt.h:182:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
 extern int getopt ();
 ^~~~~~
getopt.c:150:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
 extern char *getenv ();
 ^~~~~~
From 020b65a610dee7edb80f5f1ba7eee64f931944e5 Mon Sep 17 00:00:00 2001
From: Pete Batard <address@hidden>
Date: Mon, 13 Mar 2017 11:56:46 +0100
Subject: [PATCH 2/2] fix MinGW compilation warnings

* cd_types.c:292:2: warning: this 'if' clause does not guard... 
[-Wmisleading-indentation]
* getopt.h:182:1: warning: function declaration isn't a prototype 
[-Wstrict-prototypes]
* getopt.c:150:1: warning: function declaration isn't a prototype 
[-Wstrict-prototypes]
---
 lib/driver/cd_types.c | 20 ++++++++++----------
 src/getopt.c          |  2 +-
 src/getopt.h          |  2 +-
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/lib/driver/cd_types.c b/lib/driver/cd_types.c
index f756426..96f4ec1 100644
--- a/lib/driver/cd_types.c
+++ b/lib/driver/cd_types.c
@@ -292,18 +292,18 @@ cdio_guess_cd_type(const CdIo_t *p_cdio, int 
start_session, track_t i_track,
        if ( _cdio_read_block(p_cdio, 35, start_session, 5, i_track) < 0)
          return ret;
 
-         iso_analysis->UDFVerMinor=(unsigned int)buffer[5][240];
-         iso_analysis->UDFVerMajor=(unsigned int)buffer[5][241];
+       iso_analysis->UDFVerMinor=(unsigned int)buffer[5][240];
+       iso_analysis->UDFVerMajor=(unsigned int)buffer[5][241];
 #if 0
-         /*  We are using ISO/UDF cd's as iso,
-             no need to get UDF disc label */
-         if (_cdio_read_block(p_cdio, 32, start_session, 5, i_track) < 0)
-           return ret;
-         stnrcpy(iso_analysis->iso_label, buffer[5]+25, 33);
-         iso_analysis->iso_label[32] = '\0';
+       /*  We are using ISO/UDF cd's as iso,
+           no need to get UDF disc label */
+       if (_cdio_read_block(p_cdio, 32, start_session, 5, i_track) < 0)
+         return ret;
+       stnrcpy(iso_analysis->iso_label, buffer[5]+25, 33);
+       iso_analysis->iso_label[32] = '\0';
 #endif
-         ret=CDIO_FS_ISO_UDF;
-       }
+       ret=CDIO_FS_ISO_UDF;
+      }
 
 #if 0
       if (_cdio_is_rockridge())
diff --git a/src/getopt.c b/src/getopt.c
index 80c7cb2..b2153e5 100644
--- a/src/getopt.c
+++ b/src/getopt.c
@@ -147,7 +147,7 @@ static struct _getopt_data getopt_data;
    whose names are inconsistent.  */
 
 #ifndef getenv
-extern char *getenv ();
+extern char *getenv (const char *_VarName);
 #endif
 
 #endif /* not __GNU_LIBRARY__ */
diff --git a/src/getopt.h b/src/getopt.h
index b888c59..e17326b 100644
--- a/src/getopt.h
+++ b/src/getopt.h
@@ -179,7 +179,7 @@ extern int __posix_getopt (int ___argc, char *const 
*___argv,
 #  endif
 # endif
 #else /* not __GNU_LIBRARY__ */
-extern int getopt ();
+extern int getopt (int argc, char *const *argv, const char *optstring);
 #endif /* __GNU_LIBRARY__ */
 
 #ifndef __need_getopt
-- 
2.8.1.windows.1


reply via email to

[Prev in Thread] Current Thread [Next in Thread]