shithub: libdvdcss

Download patch

ref: 2de79ff6caa5045aae19d23169d7f6c8b4b8baed
parent: f35ad494d9fa93f079f6578ddd7d10ace0d8c617
author: Diego Biurrun <diego@biurrun.de>
date: Fri Oct 24 09:06:01 EDT 2014

ioctl: cosmetics: Coalesce some macro and declaration blocks

--- a/src/ioctl.c
+++ b/src/ioctl.c
@@ -88,38 +88,18 @@
 #include "ioctl.h"
 
 /*****************************************************************************
- * Local prototypes, BeOS specific
+ * Local prototypes, OS-specific
  *****************************************************************************/
 #if defined( __HAIKU__ )
 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, OS2 specific
- *****************************************************************************/
-#if defined( __OS2__ )
+#elif defined( __OS2__ )
 static void OS2InitSDC( struct OS2_ExecSCSICmd *, int );
 #endif
 
--- a/src/ioctl.h
+++ b/src/ioctl.h
@@ -42,7 +42,7 @@
 #define DVD_DISCKEY_SIZE 2048
 
 /*****************************************************************************
- * Common macro, BeOS specific
+ * Common macros, OS-specific
  *****************************************************************************/
 #if defined( __HAIKU__ )
 #define INIT_RDC( TYPE, SIZE ) \
@@ -51,12 +51,7 @@
     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,12 +60,7 @@
     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 }; \
@@ -77,12 +67,7 @@
     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 @@
                       (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 @@
       p_cpt->cam_data_ptr = sizeof( CAM_PASS_THRU ); \
       p_cpt->cam_dxfer_len = (SIZE); \
     QNXInitCPT( p_cpt, (TYPE) );
-#endif
-
-/*****************************************************************************
- * Common macro, OS2 specific
- *****************************************************************************/
-#if defined( __OS2__ )
+#elif defined( __OS2__ )
 #define INIT_SSC( TYPE, SIZE ) \
     struct OS2_ExecSCSICmd sdc = { 0 }; \
     uint8_t p_buffer[ (SIZE) + 1 ] = { 0 }; \