diff options
author | Karel Zak | 2017-09-15 13:25:32 +0200 |
---|---|---|
committer | Karel Zak | 2017-09-15 13:25:32 +0200 |
commit | 9f20d800799fb1b5104cd87f9c3c68c9b159491f (patch) | |
tree | 89509a047aeec9f377359f9ecf419c221705296f | |
parent | logger: make stdin parsing more friendly to static analyzers (diff) | |
download | kernel-qcow2-util-linux-9f20d800799fb1b5104cd87f9c3c68c9b159491f.tar.gz kernel-qcow2-util-linux-9f20d800799fb1b5104cd87f9c3c68c9b159491f.tar.xz kernel-qcow2-util-linux-9f20d800799fb1b5104cd87f9c3c68c9b159491f.zip |
misc: cleanup UUID_STR_LEN definitions
Signed-off-by: Karel Zak <kzak@redhat.com>
-rw-r--r-- | libblkid/src/blkidP.h | 6 | ||||
-rw-r--r-- | libblkid/src/partitions/partitions.h | 4 | ||||
-rw-r--r-- | libblkid/src/probe.c | 4 | ||||
-rw-r--r-- | libblkid/src/superblocks/superblocks.h | 4 | ||||
-rw-r--r-- | libfdisk/src/fdiskP.h | 1 | ||||
-rw-r--r-- | libfdisk/src/gpt.c | 4 | ||||
-rw-r--r-- | libuuid/src/uuid.h | 4 | ||||
-rw-r--r-- | misc-utils/uuidparse.c | 2 | ||||
-rw-r--r-- | sys-utils/swapon.c | 2 |
9 files changed, 10 insertions, 21 deletions
diff --git a/libblkid/src/blkidP.h b/libblkid/src/blkidP.h index c79132773..8108b0efa 100644 --- a/libblkid/src/blkidP.h +++ b/libblkid/src/blkidP.h @@ -23,6 +23,12 @@ #include <stdarg.h> #include <stdint.h> +#ifdef HAVE_LIBUUID +# include <uuid.h> +#else +# define UUID_STR_LEN 37 +#endif + #include "c.h" #include "bitops.h" /* $(top_srcdir)/include/ */ #include "blkdev.h" diff --git a/libblkid/src/partitions/partitions.h b/libblkid/src/partitions/partitions.h index 5ed2681e3..1d99fb6a3 100644 --- a/libblkid/src/partitions/partitions.h +++ b/libblkid/src/partitions/partitions.h @@ -4,10 +4,6 @@ #include "blkidP.h" #include "pt-mbr.h" -#ifndef UUID_STR_LEN -#define UUID_STR_LEN 37 -#endif - extern int blkid_partitions_get_flags(blkid_probe pr); extern blkid_parttable blkid_partlist_new_parttable(blkid_partlist ls, diff --git a/libblkid/src/probe.c b/libblkid/src/probe.c index 21cd790e9..476461bc4 100644 --- a/libblkid/src/probe.c +++ b/libblkid/src/probe.c @@ -105,10 +105,6 @@ #include <stdarg.h> #include <limits.h> -#ifdef HAVE_LIBUUID -# include <uuid.h> -#endif - #include "blkidP.h" #include "all-io.h" #include "sysfs.h" diff --git a/libblkid/src/superblocks/superblocks.h b/libblkid/src/superblocks/superblocks.h index 3dea7b881..695c3b783 100644 --- a/libblkid/src/superblocks/superblocks.h +++ b/libblkid/src/superblocks/superblocks.h @@ -9,10 +9,6 @@ #include "blkidP.h" -#ifndef UUID_STR_LEN -#define UUID_STR_LEN 37 -#endif - extern const struct blkid_idinfo cramfs_idinfo; extern const struct blkid_idinfo swap_idinfo; extern const struct blkid_idinfo swsuspend_idinfo; diff --git a/libfdisk/src/fdiskP.h b/libfdisk/src/fdiskP.h index 23903b4b4..b81d6fc7a 100644 --- a/libfdisk/src/fdiskP.h +++ b/libfdisk/src/fdiskP.h @@ -16,6 +16,7 @@ #include <sys/stat.h> #include <sys/types.h> #include <unistd.h> +#include <uuid.h> #include "c.h" #include "libfdisk.h" diff --git a/libfdisk/src/gpt.c b/libfdisk/src/gpt.c index 7134a36ce..26d04f1d8 100644 --- a/libfdisk/src/gpt.c +++ b/libfdisk/src/gpt.c @@ -286,10 +286,6 @@ static struct fdisk_parttype gpt_parttypes[] = #define gpt_partition_start(_e) le64_to_cpu((_e)->lba_start) #define gpt_partition_end(_e) le64_to_cpu((_e)->lba_end) -#ifndef UUID_STR_LEN -#define UUID_STR_LEN 37 -#endif - /* * in-memory fdisk GPT stuff */ diff --git a/libuuid/src/uuid.h b/libuuid/src/uuid.h index 2fd470558..03c232caa 100644 --- a/libuuid/src/uuid.h +++ b/libuuid/src/uuid.h @@ -62,6 +62,8 @@ typedef unsigned char uuid_t[16]; #define UUID_TYPE_SHIFT 4 #define UUID_TYPE_MASK 0xf +#define UUID_STR_LEN 37 + /* Allow UUID constants to be defined */ #ifdef __GNUC__ #define UUID_DEFINE(name,u0,u1,u2,u3,u4,u5,u6,u7,u8,u9,u10,u11,u12,u13,u14,u15) \ @@ -99,8 +101,6 @@ extern int uuid_is_null(const uuid_t uu); /* parse.c */ extern int uuid_parse(const char *in, uuid_t uu); -#define UUID_STR_LEN 37 - /* unparse.c */ extern void uuid_unparse(const uuid_t uu, char *out); extern void uuid_unparse_lower(const uuid_t uu, char *out); diff --git a/misc-utils/uuidparse.c b/misc-utils/uuidparse.c index 5fa34b23d..19bb3f1b9 100644 --- a/misc-utils/uuidparse.c +++ b/misc-utils/uuidparse.c @@ -55,8 +55,6 @@ #include "uuid.h" #include "xalloc.h" -#define UUID_STR_LEN 37 - /* column IDs */ enum { COL_UUID = 0, diff --git a/sys-utils/swapon.c b/sys-utils/swapon.c index 1e7d3c0b5..6bf67a91f 100644 --- a/sys-utils/swapon.c +++ b/sys-utils/swapon.c @@ -68,7 +68,7 @@ #define MAX_PAGESIZE (64 * 1024) #ifndef UUID_STR_LEN -#define UUID_STR_LEN 37 +# define UUID_STR_LEN 37 #endif enum { |