]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
misc: fix some compiler warnings
authorRuediger Meier <ruediger.meier@ga-group.nl>
Wed, 26 Oct 2016 18:44:15 +0000 (20:44 +0200)
committerRuediger Meier <ruediger.meier@ga-group.nl>
Thu, 27 Oct 2016 09:03:24 +0000 (11:03 +0200)
  libsmartcols/samples/fromfile.c:59:2: warning: passing argument 3 of 'string_to_bitmask' from incompatible pointer type
  text-utils/pg.c:79:0: warning: "TABSIZE" redefined
  libblkid/src/read.c:455:13: warning: 'debug_dump_dev' defined but not used [-Wunused-function]
  libblkid/src/probe.c:769:13: warning: unused function 'cdrom_size_correction' [-Wunused-function]
  /usr/include/sys/termios.h:3:2: warning: "this file includes <sys/termios.h> which is deprecated, use <termios.h> instead" [-W#warnings]

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
libblkid/src/probe.c
libblkid/src/read.c
libsmartcols/samples/fromfile.c
text-utils/pg.c

index f2b3f9348252194bf2b96831de38a9c901e9df35..da6720daee66ea0af9209d3ce386b9dcfbbc6153 100644 (file)
@@ -740,6 +740,8 @@ int blkid_probe_is_cdrom(blkid_probe pr)
        return (pr->flags & BLKID_FL_CDROM_DEV);
 }
 
+#ifdef CDROM_GET_CAPABILITY
+
 static int is_sector_readable(int fd, uint64_t sector)
 {
        char buf[512];
@@ -785,6 +787,8 @@ failed:
        pr->size = n << 9;
 }
 
+#endif
+
 /**
  * blkid_probe_set_device:
  * @pr: probe
index c081baff54c79d910e8886383afcdcc70c6f7b5b..42867735ff2d11da5669202296187b79e8eceea6 100644 (file)
 # include <stdlib.h>
 #endif
 
-#ifdef TEST_PROGRAM
-#define blkid_debug_dump_dev(dev)      (debug_dump_dev(dev))
-static void debug_dump_dev(blkid_dev dev);
-#endif
-
 /*
  * File format:
  *
@@ -377,8 +372,6 @@ static int blkid_parse_line(blkid_cache cache, blkid_dev *dev_p, char *cp)
                goto done;
        }
 
-       /*DBG(READ, blkid_debug_dump_dev(dev));*/
-
 done:
        return ret;
 }
@@ -452,31 +445,6 @@ errout:
 }
 
 #ifdef TEST_PROGRAM
-static void debug_dump_dev(blkid_dev dev)
-{
-       struct list_head *p;
-
-       if (!dev) {
-               printf("  dev: NULL\n");
-               return;
-       }
-
-       printf("  dev: name = %s\n", dev->bid_name);
-       printf("  dev: DEVNO=\"0x%0llx\"\n", (long long)dev->bid_devno);
-       printf("  dev: TIME=\"%ld.%ld\"\n", (long)dev->bid_time, (long)dev->bid_utime);
-       printf("  dev: PRI=\"%d\"\n", dev->bid_pri);
-       printf("  dev: flags = 0x%08X\n", dev->bid_flags);
-
-       list_for_each(p, &dev->bid_tags) {
-               blkid_tag tag = list_entry(p, struct blkid_struct_tag, bit_tags);
-               if (tag)
-                       printf("    tag: %s=\"%s\"\n", tag->bit_name,
-                              tag->bit_val);
-               else
-                       printf("    tag: NULL\n");
-       }
-       printf("\n");
-}
 
 int main(int argc, char**argv)
 {
index fcf01c74990fe17178b2e2a3054f1a036a90b17d..a2a22a4cdc701843fe106642884e1055a472100b 100644 (file)
@@ -38,7 +38,7 @@ static const struct column_flag flags[] = {
        { "none",       0 }
 };
 
-static long name_to_flag(const char *name, long unsigned int namesz)
+static long name_to_flag(const char *name, size_t namesz)
 {
        size_t i;
 
index 142e3f1e95ba9f03d2359b30b93e3493a8cdf09c..ed62adcfde66e5c2b7647d0579f6820bcccbcca5 100644 (file)
@@ -46,7 +46,7 @@
 #ifndef        TIOCGWINSZ
 # include <sys/ioctl.h>
 #endif
-#include <sys/termios.h>
+#include <termios.h>
 #include <fcntl.h>
 #include <regex.h>
 #include <stdio.h>
@@ -76,7 +76,7 @@
 
 #define        READBUF         LINE_MAX        /* size of input buffer */
 #define CMDBUF         255             /* size of command buffer */
-#define        TABSIZE         8               /* spaces consumed by tab character */
+#define        PG_TABSIZE      8               /* spaces consumed by tab character */
 
 #define        cuc(c)          ((c) & 0377)
 
@@ -417,7 +417,7 @@ static char *endline_for_mb(unsigned col, char *s)
                        goto ended;
                        /* Cursor right. */
                case L'\t':
-                       pos += TABSIZE - (pos % TABSIZE);
+                       pos += PG_TABSIZE - (pos % PG_TABSIZE);
                        break;
                default:
                        if (iswprint(*p))
@@ -481,7 +481,7 @@ static char *endline(unsigned col, char *s)
                        goto cend;
                        /* Cursor right. */
                case '\t':
-                       pos += TABSIZE - (pos % TABSIZE);
+                       pos += PG_TABSIZE - (pos % PG_TABSIZE);
                        break;
                default:
                        pos++;