[libdvdcss-devel] [PATCH 18/47] Comment some #endifs for increased readability.

Diego Biurrun <[email protected]>
Newsgroups gmane.comp.video.videolan.libdvdcss,gmane.comp.video.videolan.libdvdcss.devel
Message-ID <[email protected]>
---
 src/common.h    |  8 ++++----
 src/css.c       |  6 +++---
 src/device.c    | 12 ++++++------
 src/ioctl.c     |  8 ++++----
 src/ioctl.h     |  4 ++--
 src/libdvdcss.c |  8 ++++----
 src/libdvdcss.h |  2 +-
 7 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/src/common.h b/src/common.h
index a83b0c0..b4c4fa7 100644
--- a/src/common.h
+++ b/src/common.h
@@ -58,7 +58,7 @@ typedef _off_t off_t;
 #       else
 #           define off_t long long
 #       endif
-#   endif
+#   endif /* defined( __MINGW32__ ) */
 
 #   if defined( _MSC_VER )
 #       define lseek _lseeki64
@@ -70,15 +70,15 @@ typedef __int64 off_t;
 #       endif
 #       define stat _stati64
 #       define snprintf _snprintf
-#   endif
+#   endif /* defined( _MSC_VER ) */
 
-#endif
+#endif /* defined( WIN32 ) */
 
 #ifdef __ANDROID__
 # undef  lseek
 # define lseek lseek64
 # undef  off_t
 # define off_t off64_t
-#endif
+#endif /* __ANDROID__ */
 
 #endif /* DVDCSS_COMMON_H */
diff --git a/src/css.c b/src/css.c
index b899fc9..3d73080 100644
--- a/src/css.c
+++ b/src/css.c
@@ -122,7 +122,7 @@ int dvdcss_test( dvdcss_t dvdcss )
             i_copyright = 0;
         }
     }
-#endif
+#endif /* WIN32 */
 
     if( i_ret < 0 )
     {
@@ -1562,7 +1562,7 @@ static int CrackTitleKey( dvdcss_t dvdcss, int i_pos, int i_len,
             {
                 b_stop_scanning = 1;
             }
-#endif
+#endif /* 0 */
         }
 
         i_pos++;
@@ -1726,4 +1726,4 @@ static int AttackPadding( uint8_t const p_sec[ DVDCSS_BLOCK_SIZE ] )
 
     return 0;
 }
-#endif
+#endif /* 0 */
diff --git a/src/device.c b/src/device.c
index 802a73f..6e37e37 100644
--- a/src/device.c
+++ b/src/device.c
@@ -408,7 +408,7 @@ int dvdcss_raw_open ( dvdcss_t dvdcss, const char *psz_device )
 
     return 0;
 }
-#endif
+#endif /* DVDCSS_RAW_OPEN */
 
 int dvdcss_close_device ( dvdcss_t dvdcss )
 {
@@ -501,7 +501,7 @@ static int win2k_open ( dvdcss_t dvdcss, const char *psz_device )
 
     return 0;
 }
-#endif
+#endif /* defined( WIN32 ) */
 
 #ifdef __OS2__
 static int os2_open ( dvdcss_t dvdcss, const char *psz_device )
@@ -532,7 +532,7 @@ static int os2_open ( dvdcss_t dvdcss, const char *psz_device )
 
     return 0;
 }
-#endif
+#endif /* __OS2__ */
 
 /*****************************************************************************
  * Seek commands.
@@ -593,7 +593,7 @@ static int win2k_seek( dvdcss_t dvdcss, int i_blocks )
 
     return dvdcss->i_pos;
 }
-#endif
+#endif /* defined( WIN32 ) */
 
 /*****************************************************************************
  * Read commands.
@@ -648,7 +648,7 @@ static int win2k_read ( dvdcss_t dvdcss, void *p_buffer, int i_blocks )
     dvdcss->i_pos += i_bytes / DVDCSS_BLOCK_SIZE;
     return i_bytes / DVDCSS_BLOCK_SIZE;
 }
-#endif
+#endif /* defined( WIN32 ) */
 
 /*****************************************************************************
  * Readv commands.
@@ -787,4 +787,4 @@ static int win2k_readv ( dvdcss_t dvdcss, struct iovec *p_iovec, int i_blocks )
     dvdcss->i_pos += i_blocks_read;
     return i_blocks_read;
 }
-#endif
+#endif /* defined( WIN32 ) */
diff --git a/src/ioctl.c b/src/ioctl.c
index a993808..72adf33 100644
--- a/src/ioctl.c
+++ b/src/ioctl.c
@@ -1479,7 +1479,7 @@ static int SolarisSendUSCSI( int i_fd, struct uscsi_cmd *p_sc )
 
     return ioctl( i_fd, USCSICMD, p_sc );
 }
-#endif
+#endif /* defined( SOLARIS_USCSI ) */
 
 #if defined( WIN32 )
 /*****************************************************************************
@@ -1511,7 +1511,7 @@ static void WinInitSPTD( SCSI_PASS_THROUGH_DIRECT *p_sptd, int i_type )
 
     p_sptd->TimeOutValue = 2;
 }
-#endif
+#endif /* defined( WIN32 ) */
 
 #if defined( __QNXNTO__ )
 /*****************************************************************************
@@ -1542,7 +1542,7 @@ static void QNXInitCPT( CAM_PASS_THRU * p_cpt, int i_type )
 
     p_cpt->cam_timeout = CAM_TIME_DEFAULT;
 }
-#endif
+#endif /* defined( __QNXNTO__ ) */
 
 #if defined( __OS2__ )
 /*****************************************************************************
@@ -1571,4 +1571,4 @@ static void OS2InitSDC( struct OS2_ExecSCSICmd *p_sdc, int i_type )
     p_sdc->id_code      = 0x31304443;    // 'CD01'
     p_sdc->cmd_length   = 12;
 }
-#endif
+#endif /* defined( __OS2__ ) */
diff --git a/src/ioctl.h b/src/ioctl.h
index 453a119..1c6cb0c 100644
--- a/src/ioctl.h
+++ b/src/ioctl.h
@@ -285,7 +285,7 @@ typedef struct SCSI_PASS_THROUGH_DIRECT
     UCHAR Cdb[16];
 } SCSI_PASS_THROUGH_DIRECT, *PSCSI_PASS_THROUGH_DIRECT;
 
-#endif
+#endif /* defined( WIN32 ) */
 
 /*****************************************************************************
  * OS/2 ioctl specific
@@ -311,6 +311,6 @@ struct OS2_ExecSCSICmd
 
 #pragma pack()
 
-#endif
+#endif /* defined( __OS2__ ) */
 
 #endif /* DVDCSS_IOCTL_H */
diff --git a/src/libdvdcss.c b/src/libdvdcss.c
index 59bd12d..7bd888b 100644
--- a/src/libdvdcss.c
+++ b/src/libdvdcss.c
@@ -242,7 +242,7 @@ LIBDVDCSS_EXPORT dvdcss_t dvdcss_open ( const char *psz_target )
         }
 #else
         char *psz_home = NULL;
-#   ifdef HAVE_PWD_H
+#ifdef HAVE_PWD_H
         struct passwd *p_pwd;
 
         /* Try looking in password file for home dir. */
@@ -251,7 +251,7 @@ LIBDVDCSS_EXPORT dvdcss_t dvdcss_open ( const char *psz_target )
         {
             psz_home = p_pwd->pw_dir;
         }
-#   endif
+#endif /* HAVE_PWD_H */
 
         if( psz_home == NULL )
         {
@@ -281,7 +281,7 @@ LIBDVDCSS_EXPORT dvdcss_t dvdcss_open ( const char *psz_target )
                     home_pos = 2;
                 }
             }
-#endif
+#endif /* __OS2__ */
             snprintf( psz_buffer + home_pos, PATH_MAX - home_pos,
                       "%s/.dvdcss", psz_home );
             psz_buffer[PATH_MAX-1] = '\0';
@@ -518,7 +518,7 @@ LIBDVDCSS_EXPORT dvdcss_t dvdcss_open ( const char *psz_target )
     {
         dvdcss_raw_open( dvdcss, psz_raw_device );
     }
-#endif
+#endif /* DVDCSS_RAW_OPEN */
 
     /* Seek to the beginning, just for safety. */
     dvdcss->pf_seek( dvdcss, 0 );
diff --git a/src/libdvdcss.h b/src/libdvdcss.h
index 71e8daf..8ac0633 100644
--- a/src/libdvdcss.h
+++ b/src/libdvdcss.h
@@ -70,7 +70,7 @@ struct dvdcss_s
     int    b_file;
     char * p_readv_buffer;
     int    i_readv_buf_size;
-#endif
+#endif /* WIN32 */
 
 #ifdef DVDCSS_RAW_OPEN
     int    i_raw_fd;
-- 
1.9.1

_______________________________________________
libdvdcss-devel mailing list
[email protected]
https://mailman.videolan.org/listinfo/libdvdcss-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.