]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
mkfs: Remove workaround for getsubopt() on older glibc
authorFelix Janda <felix.janda@posteo.de>
Thu, 4 Aug 2016 01:29:49 +0000 (11:29 +1000)
committerDave Chinner <david@fromorbit.com>
Thu, 4 Aug 2016 01:29:49 +0000 (11:29 +1000)
The workaround addressed a const-correctness warning on glibc
versions older than 2.2. However, it also captures alternative C
libraries on Linux which it should not do. glibc is really old, so
let's just remove the workaround.

Signed-off-by: Felix Janda <felix.janda@posteo.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
include/darwin.h
include/freebsd.h
include/gnukfreebsd.h
include/irix.h
include/linux.h
mkfs/xfs_mkfs.c
repair/xfs_repair.c

index a52030d58d3999fc727a50f1478e32ea699f88b0..45e0c03013a7270cf3c06cb4c2ccd1b1038aebc3 100644 (file)
@@ -160,7 +160,6 @@ typedef int64_t             xfs_daddr_t;
 
 #define EFSCORRUPTED   990     /* Filesystem is corrupted */
 #define EFSBADCRC      991     /* Bad CRC detected */
-#define constpp                char * const *
 
 #define HAVE_FID       1
 
index f7e0c758f45f2d1d5284ce650028f9e15732de76..6e77427a12b05a0951a6e1bcd84f5f984087cde6 100644 (file)
@@ -43,8 +43,6 @@
 #define fdatasync      fsync
 #define memalign(a,sz) valloc(sz)
 
-#define constpp        char * const *
-
 #define EFSCORRUPTED   990     /* Filesystem is corrupted */
 #define EFSBADCRC      991     /* Bad CRC detected */
 
index 64167b247a4038bb430f3f1c5d52f41aac073211..d55acfba38638c7c961716b3902dabf508867096 100644 (file)
@@ -33,8 +33,6 @@
 #include <paths.h>
 #include <mntent.h>
 
-#define constpp        char * const *
-
 #define EFSCORRUPTED   990     /* Filesystem is corrupted */
 #define EFSBADCRC      991     /* Bad CRC detected */
 
index c2191eef8c987875ae4e5b972ffe094e0456cf36..b92e01bbb58294828f9059da3fb5958c205d906a 100644 (file)
@@ -184,8 +184,6 @@ typedef struct xfs_efd_log_format_32 {
 #define inline         __inline
 #endif
 
-#define constpp                char * const *
-
 /*ARGSUSED*/
 static __inline__ int xfsctl(const char *path, int fd, int cmd, void *arg)
 {
index 0c616f4fc3758c281bb7605323638dbf9278c333..561471905e81a0544a47352bb87c5eb102e68757 100644 (file)
@@ -133,12 +133,6 @@ platform_discard_blocks(int fd, uint64_t start, uint64_t len)
        return 0;
 }
 
-#if (__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ <= 1))
-# define constpp       const char * const *
-#else
-# define constpp       char * const *
-#endif
-
 #define ENOATTR                ENODATA /* Attribute not found */
 #define EFSCORRUPTED   EUCLEAN /* Filesystem is corrupted */
 #define EFSBADCRC      EBADMSG /* Bad CRC detected */
index 8007dd0c6c67a774a259fd05e434b2071b6c1c55..8b02983198ec53bfaf4426333cceb13529308052 100644 (file)
@@ -1521,8 +1521,7 @@ main(
                                char    **subopts = (char **)bopts.subopts;
                                char    *value;
 
-                               switch (getsubopt(&p, (constpp)subopts,
-                                                 &value)) {
+                               switch (getsubopt(&p, subopts, &value)) {
                                case B_LOG:
                                        blocklog = getnum(value, &bopts, B_LOG);
                                        blocksize = 1 << blocklog;
@@ -1545,8 +1544,7 @@ main(
                                char    **subopts = (char **)dopts.subopts;
                                char    *value;
 
-                               switch (getsubopt(&p, (constpp)subopts,
-                                                 &value)) {
+                               switch (getsubopt(&p, subopts, &value)) {
                                case D_AGCOUNT:
                                        agcount = getnum(value, &dopts,
                                                         D_AGCOUNT);
@@ -1625,8 +1623,7 @@ main(
                                char    **subopts = (char **)iopts.subopts;
                                char    *value;
 
-                               switch (getsubopt(&p, (constpp)subopts,
-                                                 &value)) {
+                               switch (getsubopt(&p, subopts, &value)) {
                                case I_ALIGN:
                                        sb_feat.inode_align = getnum(value,
                                                                &iopts, I_ALIGN);
@@ -1675,8 +1672,7 @@ main(
                                char    **subopts = (char **)lopts.subopts;
                                char    *value;
 
-                               switch (getsubopt(&p, (constpp)subopts,
-                                                 &value)) {
+                               switch (getsubopt(&p, subopts, &value)) {
                                case L_AGNUM:
                                        logagno = getnum(value, &lopts, L_AGNUM);
                                        laflag = 1;
@@ -1747,8 +1743,7 @@ main(
                                char    **subopts = (char **)mopts.subopts;
                                char    *value;
 
-                               switch (getsubopt(&p, (constpp)subopts,
-                                                 &value)) {
+                               switch (getsubopt(&p, subopts, &value)) {
                                case M_CRC:
                                        sb_feat.crcs_enabled =
                                                getnum(value, &mopts, M_CRC);
@@ -1776,8 +1771,7 @@ main(
                                char    **subopts = (char **)nopts.subopts;
                                char    *value;
 
-                               switch (getsubopt(&p, (constpp)subopts,
-                                                 &value)) {
+                               switch (getsubopt(&p, subopts, &value)) {
                                case N_LOG:
                                        dirblocklog = getnum(value, &nopts,
                                                             N_LOG);
@@ -1832,8 +1826,7 @@ main(
                                char    **subopts = (char **)ropts.subopts;
                                char    *value;
 
-                               switch (getsubopt(&p, (constpp)subopts,
-                                                 &value)) {
+                               switch (getsubopt(&p, subopts, &value)) {
                                case R_EXTSIZE:
                                        rtextsize = getstr(value, &ropts,
                                                           R_EXTSIZE);
@@ -1865,8 +1858,7 @@ main(
                                char    **subopts = (char **)sopts.subopts;
                                char    *value;
 
-                               switch (getsubopt(&p, (constpp)subopts,
-                                                 &value)) {
+                               switch (getsubopt(&p, subopts, &value)) {
                                case S_LOG:
                                case S_SECTLOG:
                                        if (lssflag)
index bbf0edc0e1b90dc2fa9870353724e0b6fcbf2d75..50a1ac9c270bf3957b665ae11aa8daf1f8e350f7 100644 (file)
@@ -225,7 +225,7 @@ process_args(int argc, char **argv)
                        while (*p != '\0')  {
                                char *val;
 
-                               switch (getsubopt(&p, (constpp)o_opts, &val))  {
+                               switch (getsubopt(&p, o_opts, &val))  {
                                case ASSUME_XFS:
                                        if (val)
                                                noval('o', o_opts, ASSUME_XFS);
@@ -276,7 +276,7 @@ process_args(int argc, char **argv)
                        while (*p) {
                                char *val;
 
-                               switch (getsubopt(&p, (constpp)c_opts, &val)) {
+                               switch (getsubopt(&p, c_opts, &val)) {
                                case CONVERT_LAZY_COUNT:
                                        lazy_count = (int)strtol(val, NULL, 0);
                                        convert_lazy_count = 1;