[libdvdcss-devel] Comment some #endifs for increased readability.

Diego Biurrun git at videolan.org
Fri Oct 31 16:06:09 CET 2014


libdvdcss | branch: master | Diego Biurrun <diego at biurrun.de> | Fri Oct 24 13:04:51 2014 +0200| [f35ad494d9fa93f079f6578ddd7d10ace0d8c617] | committer: Diego Biurrun

Comment some #endifs for increased readability.

> http://git.videolan.org/gitweb.cgi/libdvdcss.git/?a=commit;h=f35ad494d9fa93f079f6578ddd7d10ace0d8c617
---

 src/common.h    |    8 ++++----
 src/css.c       |    6 +++---
 src/device.c    |   12 ++++++------
 src/ioctl.c     |    8 ++++----
 src/ioctl.h     |    4 ++--
 src/libdvdcss.c |   10 +++++-----
 src/libdvdcss.h |    2 +-
 7 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/src/common.h b/src/common.h
index d2cd4d0..bfa6c18 100644
--- a/src/common.h
+++ b/src/common.h
@@ -62,7 +62,7 @@ typedef _off_t off_t;
 #       else
 #           define off_t long long
 #       endif
-#   endif
+#   endif /* defined( __MINGW32__ ) */
 
 #   if defined( _MSC_VER )
 #       define lseek _lseeki64
@@ -79,15 +79,15 @@ typedef __int64 off_t;
 #       define close _close
 #       define read _read
 #       define write _write
-#   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 9bc137c..c5a16b1 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 )
     {
@@ -1566,7 +1566,7 @@ static int CrackTitleKey( dvdcss_t dvdcss, int i_pos, int i_len,
             {
                 b_stop_scanning = 1;
             }
-#endif
+#endif /* 0 */
         }
 
         i_pos++;
@@ -1730,4 +1730,4 @@ static int AttackPadding( const uint8_t p_sec[ DVDCSS_BLOCK_SIZE ] )
 
     return 0;
 }
-#endif
+#endif /* 0 */
diff --git a/src/device.c b/src/device.c
index 93bccab..73ace00 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 )
 {
@@ -507,7 +507,7 @@ error:
     print_error( dvdcss, "failed opening device" );
     return -1;
 }
-#endif
+#endif /* defined( WIN32 ) */
 
 #ifdef __OS2__
 static int os2_open ( dvdcss_t dvdcss, const char *psz_device )
@@ -538,7 +538,7 @@ static int os2_open ( dvdcss_t dvdcss, const char *psz_device )
 
     return 0;
 }
-#endif
+#endif /* __OS2__ */
 
 /*****************************************************************************
  * Seek commands.
@@ -595,7 +595,7 @@ static int win2k_seek( dvdcss_t dvdcss, int i_blocks )
 
     return dvdcss->i_pos;
 }
-#endif
+#endif /* defined( WIN32 ) */
 
 /*****************************************************************************
  * Read commands.
@@ -650,7 +650,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.
@@ -789,4 +789,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 0681309..c28472a 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 d7f231a..f75bad2 100644
--- a/src/ioctl.h
+++ b/src/ioctl.h
@@ -286,7 +286,7 @@ typedef struct SCSI_PASS_THROUGH_DIRECT
     UCHAR Cdb[16];
 } SCSI_PASS_THROUGH_DIRECT, *PSCSI_PASS_THROUGH_DIRECT;
 
-#endif
+#endif /* defined( WIN32 ) */
 
 /*****************************************************************************
  * OS2 ioctl specific
@@ -312,6 +312,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 d6ed21c..6dc2bd8 100644
--- a/src/libdvdcss.c
+++ b/src/libdvdcss.c
@@ -240,7 +240,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. */
@@ -249,7 +249,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 )
         {
@@ -279,13 +279,13 @@ 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';
             psz_cache = psz_buffer;
         }
-#endif
+#endif /* ! defined(_WIN32_IE) && _WIN32_IE >= 0x500 */
     }
 
     /*
@@ -514,7 +514,7 @@ LIBDVDCSS_EXPORT dvdcss_t dvdcss_open ( const char *psz_target )
     {
         dvdcss_raw_open( dvdcss, psz_raw_device );
     }
-#endif
+#endif /* DVDCSS_RAW_OPEN */
 
     /* Seek at the beginning, just for safety. */
     dvdcss->pf_seek( dvdcss, 0 );
diff --git a/src/libdvdcss.h b/src/libdvdcss.h
index 4ef1183..4f1f4af 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;



More information about the libdvdcss-devel mailing list