[libdvdcss-devel] [PATCH 19/47] ioctl: cosmetics: Coalesce some macro and declaration blocks

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


---

Or not, this is a debatable cosmetic patch...

 src/ioctl.c | 29 +++++------------------------
 src/ioctl.h | 37 ++++++-------------------------------
 2 files changed, 11 insertions(+), 55 deletions(-)

diff --git a/src/ioctl.c b/src/ioctl.c
index 72adf33..788282a 100644
--- a/src/ioctl.c
+++ b/src/ioctl.c
@@ -88,38 +88,19 @@
 #include "ioctl.h"
 
 /*****************************************************************************
- * Local prototypes, BeOS specific
+ * Local prototypes, OS specific
  *****************************************************************************/
 #if defined( __BEOS__ )
 static void BeInitRDC ( raw_device_command *, int );
 #endif
-
-/*****************************************************************************
- * Local prototypes, Solaris specific
- *****************************************************************************/
-#if defined( SOLARIS_USCSI )
+#elif defined( SOLARIS_USCSI )
 static void SolarisInitUSCSI( struct uscsi_cmd *p_sc, int i_type );
 static int SolarisSendUSCSI( int fd, struct uscsi_cmd *p_sc );
-#endif
-
-/*****************************************************************************
- * Local prototypes, Win32 specific
- *****************************************************************************/
-#if defined( WIN32 )
+#elif defined( WIN32 )
 static void WinInitSPTD ( SCSI_PASS_THROUGH_DIRECT *, int );
-#endif
-
-/*****************************************************************************
- * Local prototypes, QNX specific
- *****************************************************************************/
-#if defined( __QNXNTO__ )
+#elif defined( __QNXNTO__ )
 static void QNXInitCPT ( CAM_PASS_THRU *, int );
-#endif
-
-/*****************************************************************************
- * Local prototypes, OS/2 specific
- *****************************************************************************/
-#if defined( __OS2__ )
+#elif defined( __OS2__ )
 static void OS2InitSDC( struct OS2_ExecSCSICmd *, int );
 #endif
 
diff --git a/src/ioctl.h b/src/ioctl.h
index 1c6cb0c..1ba090f 100644
--- a/src/ioctl.h
+++ b/src/ioctl.h
@@ -42,7 +42,7 @@ int ioctl_ReportRPC         ( int, int *, int *, int * );
 #define DVD_DISCKEY_SIZE 2048
 
 /*****************************************************************************
- * Common macro, BeOS specific
+ * Common macros, OS specific
  *****************************************************************************/
 #if defined( __BEOS__ )
 #define INIT_RDC( TYPE, SIZE ) \
@@ -51,12 +51,7 @@ int ioctl_ReportRPC         ( int, int *, int *, int * );
     rdc.data = (char *)p_buffer; \
     rdc.data_length = (SIZE); \
     BeInitRDC( &rdc, (TYPE) );
-#endif
-
-/*****************************************************************************
- * Common macro, Solaris specific
- *****************************************************************************/
-#if defined( SOLARIS_USCSI )
+#elif defined( SOLARIS_USCSI )
 #define INIT_USCSI( TYPE, SIZE ) \
     struct uscsi_cmd sc = { 0 }; \
     union scsi_cdb rs_cdb; \
@@ -65,24 +60,14 @@ int ioctl_ReportRPC         ( int, int *, int *, int * );
     sc.uscsi_bufaddr = (caddr_t)p_buffer; \
     sc.uscsi_buflen = (SIZE); \
     SolarisInitUSCSI( &sc, (TYPE) );
-#endif
-
-/*****************************************************************************
- * Common macro, Darwin specific
- *****************************************************************************/
-#if defined( DARWIN_DVD_IOCTL )
+#elif defined( DARWIN_DVD_IOCTL )
 #define INIT_DVDIOCTL( DKDVD_TYPE, BUFFER_TYPE, FORMAT ) \
     DKDVD_TYPE dvd = { 0 }; \
     BUFFER_TYPE dvdbs = { 0 }; \
     dvd.format = FORMAT; \
     dvd.buffer = &dvdbs; \
     dvd.bufferLength = sizeof(dvdbs);
-#endif
-
-/*****************************************************************************
- * Common macro, win32 specific
- *****************************************************************************/
-#if defined( WIN32 )
+#elif defined( WIN32 )
 #define INIT_SPTD( TYPE, SIZE ) \
     DWORD tmp; \
     SCSI_PASS_THROUGH_DIRECT sptd = { 0 }; \
@@ -96,12 +81,7 @@ int ioctl_ReportRPC         ( int, int *, int *, int * );
                       (SPTD), sizeof( SCSI_PASS_THROUGH_DIRECT ), \
                       (SPTD), sizeof( SCSI_PASS_THROUGH_DIRECT ), \
                       (TMP), NULL ) ? 0 : -1)
-#endif
-
-/*****************************************************************************
- * Common macro, QNX specific
- *****************************************************************************/
-#if defined( __QNXNTO__ )
+#elif defined( __QNXNTO__ )
 #define INIT_CPT( TYPE, SIZE ) \
     CAM_PASS_THRU * p_cpt = { 0 }; \
     uint8_t * p_buffer; \
@@ -111,12 +91,7 @@ int ioctl_ReportRPC         ( int, int *, int *, int * );
       p_cpt->cam_data_ptr = sizeof( CAM_PASS_THRU ); \
       p_cpt->cam_dxfer_len = (SIZE); \
     QNXInitCPT( p_cpt, (TYPE) );
-#endif
-
-/*****************************************************************************
- * Common macro, OS/2 specific
- *****************************************************************************/
-#if defined( __OS2__ )
+#elif defined( __OS2__ )
 #define INIT_SSC( TYPE, SIZE ) \
     struct OS2_ExecSCSICmd sdc = { 0 }; \
     uint8_t p_buffer[ (SIZE) + 1 ] = { 0 }; \
-- 
1.9.1



More information about the libdvdcss-devel mailing list