diff options
author | Brad King <brad.king@kitware.com> | 2014-04-11 13:01:27 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-04-11 13:01:27 (GMT) |
commit | 5a58efaac3557b0cee27f06e49183069cd598a7f (patch) | |
tree | a49a42134000055066a823bec4e1d43009d24c12 /Utilities | |
parent | e2b02823e7986e7df59907b307480acad5ec6562 (diff) | |
download | CMake-5a58efaac3557b0cee27f06e49183069cd598a7f.zip CMake-5a58efaac3557b0cee27f06e49183069cd598a7f.tar.gz CMake-5a58efaac3557b0cee27f06e49183069cd598a7f.tar.bz2 |
libarchive: Avoid using name 'u_long'
The system headers on some platforms define a 'u_long' type so we cannot
use the name. Spell out 'unsigned long' instead.
Diffstat (limited to 'Utilities')
-rw-r--r-- | Utilities/cmlibarchive/libarchive/archive_pack_dev.c | 54 | ||||
-rw-r--r-- | Utilities/cmlibarchive/libarchive/archive_pack_dev.h | 3 |
2 files changed, 28 insertions, 29 deletions
diff --git a/Utilities/cmlibarchive/libarchive/archive_pack_dev.c b/Utilities/cmlibarchive/libarchive/archive_pack_dev.c index c90d8de..6b7b472 100644 --- a/Utilities/cmlibarchive/libarchive/archive_pack_dev.c +++ b/Utilities/cmlibarchive/libarchive/archive_pack_dev.c @@ -103,15 +103,15 @@ static const char tooManyFields[] = "too many fields for format"; /* exported */ dev_t -pack_native(int n, u_long numbers[], const char **error) +pack_native(int n, unsigned long numbers[], const char **error) { dev_t dev = 0; if (n == 2) { dev = apd_makedev(numbers[0], numbers[1]); - if ((u_long)major(dev) != numbers[0]) + if ((unsigned long)major(dev) != numbers[0]) *error = iMajorError; - else if ((u_long)minor(dev) != numbers[1]) + else if ((unsigned long)minor(dev) != numbers[1]) *error = iMinorError; } else *error = tooManyFields; @@ -120,15 +120,15 @@ pack_native(int n, u_long numbers[], const char **error) static dev_t -pack_netbsd(int n, u_long numbers[], const char **error) +pack_netbsd(int n, unsigned long numbers[], const char **error) { dev_t dev = 0; if (n == 2) { dev = makedev_netbsd(numbers[0], numbers[1]); - if ((u_long)major_netbsd(dev) != numbers[0]) + if ((unsigned long)major_netbsd(dev) != numbers[0]) *error = iMajorError; - else if ((u_long)minor_netbsd(dev) != numbers[1]) + else if ((unsigned long)minor_netbsd(dev) != numbers[1]) *error = iMinorError; } else *error = tooManyFields; @@ -142,15 +142,15 @@ pack_netbsd(int n, u_long numbers[], const char **error) (((y) << 0) & 0xffff00ff))) static dev_t -pack_freebsd(int n, u_long numbers[], const char **error) +pack_freebsd(int n, unsigned long numbers[], const char **error) { dev_t dev = 0; if (n == 2) { dev = makedev_freebsd(numbers[0], numbers[1]); - if ((u_long)major_freebsd(dev) != numbers[0]) + if ((unsigned long)major_freebsd(dev) != numbers[0]) *error = iMajorError; - if ((u_long)minor_freebsd(dev) != numbers[1]) + if ((unsigned long)minor_freebsd(dev) != numbers[1]) *error = iMinorError; } else *error = tooManyFields; @@ -164,15 +164,15 @@ pack_freebsd(int n, u_long numbers[], const char **error) (((y) << 0) & 0x000000ff))) static dev_t -pack_8_8(int n, u_long numbers[], const char **error) +pack_8_8(int n, unsigned long numbers[], const char **error) { dev_t dev = 0; if (n == 2) { dev = makedev_8_8(numbers[0], numbers[1]); - if ((u_long)major_8_8(dev) != numbers[0]) + if ((unsigned long)major_8_8(dev) != numbers[0]) *error = iMajorError; - if ((u_long)minor_8_8(dev) != numbers[1]) + if ((unsigned long)minor_8_8(dev) != numbers[1]) *error = iMinorError; } else *error = tooManyFields; @@ -186,15 +186,15 @@ pack_8_8(int n, u_long numbers[], const char **error) (((y) << 0) & 0x000fffff))) static dev_t -pack_12_20(int n, u_long numbers[], const char **error) +pack_12_20(int n, unsigned long numbers[], const char **error) { dev_t dev = 0; if (n == 2) { dev = makedev_12_20(numbers[0], numbers[1]); - if ((u_long)major_12_20(dev) != numbers[0]) + if ((unsigned long)major_12_20(dev) != numbers[0]) *error = iMajorError; - if ((u_long)minor_12_20(dev) != numbers[1]) + if ((unsigned long)minor_12_20(dev) != numbers[1]) *error = iMinorError; } else *error = tooManyFields; @@ -208,15 +208,15 @@ pack_12_20(int n, u_long numbers[], const char **error) (((y) << 0) & 0x0003ffff))) static dev_t -pack_14_18(int n, u_long numbers[], const char **error) +pack_14_18(int n, unsigned long numbers[], const char **error) { dev_t dev = 0; if (n == 2) { dev = makedev_14_18(numbers[0], numbers[1]); - if ((u_long)major_14_18(dev) != numbers[0]) + if ((unsigned long)major_14_18(dev) != numbers[0]) *error = iMajorError; - if ((u_long)minor_14_18(dev) != numbers[1]) + if ((unsigned long)minor_14_18(dev) != numbers[1]) *error = iMinorError; } else *error = tooManyFields; @@ -230,15 +230,15 @@ pack_14_18(int n, u_long numbers[], const char **error) (((y) << 0) & 0x00ffffff))) static dev_t -pack_8_24(int n, u_long numbers[], const char **error) +pack_8_24(int n, unsigned long numbers[], const char **error) { dev_t dev = 0; if (n == 2) { dev = makedev_8_24(numbers[0], numbers[1]); - if ((u_long)major_8_24(dev) != numbers[0]) + if ((unsigned long)major_8_24(dev) != numbers[0]) *error = iMajorError; - if ((u_long)minor_8_24(dev) != numbers[1]) + if ((unsigned long)minor_8_24(dev) != numbers[1]) *error = iMinorError; } else *error = tooManyFields; @@ -254,23 +254,23 @@ pack_8_24(int n, u_long numbers[], const char **error) (((z) << 0) & 0x000000ff))) static dev_t -pack_bsdos(int n, u_long numbers[], const char **error) +pack_bsdos(int n, unsigned long numbers[], const char **error) { dev_t dev = 0; if (n == 2) { dev = makedev_12_20(numbers[0], numbers[1]); - if ((u_long)major_12_20(dev) != numbers[0]) + if ((unsigned long)major_12_20(dev) != numbers[0]) *error = iMajorError; - if ((u_long)minor_12_20(dev) != numbers[1]) + if ((unsigned long)minor_12_20(dev) != numbers[1]) *error = iMinorError; } else if (n == 3) { dev = makedev_12_12_8(numbers[0], numbers[1], numbers[2]); - if ((u_long)major_12_12_8(dev) != numbers[0]) + if ((unsigned long)major_12_12_8(dev) != numbers[0]) *error = iMajorError; - if ((u_long)unit_12_12_8(dev) != numbers[1]) + if ((unsigned long)unit_12_12_8(dev) != numbers[1]) *error = "invalid unit number"; - if ((u_long)subunit_12_12_8(dev) != numbers[2]) + if ((unsigned long)subunit_12_12_8(dev) != numbers[2]) *error = "invalid subunit number"; } else *error = tooManyFields; diff --git a/Utilities/cmlibarchive/libarchive/archive_pack_dev.h b/Utilities/cmlibarchive/libarchive/archive_pack_dev.h index 7c7b80b..749fd3d 100644 --- a/Utilities/cmlibarchive/libarchive/archive_pack_dev.h +++ b/Utilities/cmlibarchive/libarchive/archive_pack_dev.h @@ -34,8 +34,7 @@ #ifndef _PACK_DEV_H #define _PACK_DEV_H -typedef dev_t pack_t(int, u_long [], const char **); -typedef unsigned long u_long; +typedef dev_t pack_t(int, unsigned long [], const char **); pack_t *pack_find(const char *); pack_t pack_native; |