Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | Use proper C99 integer types |
| 2 | |
| 3 | Upstream-Status: Pending |
| 4 | |
| 5 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 6 | |
| 7 | Index: quota-tools/bylabel.c |
| 8 | =================================================================== |
| 9 | --- quota-tools.orig/bylabel.c |
| 10 | +++ quota-tools/bylabel.c |
| 11 | @@ -20,6 +20,7 @@ |
| 12 | #include <ctype.h> |
| 13 | #include <fcntl.h> |
| 14 | #include <unistd.h> |
| 15 | +#include <stdint.h> |
| 16 | |
| 17 | #include "bylabel.h" |
| 18 | #include "common.h" |
| 19 | @@ -37,32 +38,32 @@ static struct uuidCache_s { |
| 20 | |
| 21 | #define EXT2_SUPER_MAGIC 0xEF53 |
| 22 | struct ext2_super_block { |
| 23 | - u_char s_dummy1[56]; |
| 24 | - u_char s_magic[2]; |
| 25 | - u_char s_dummy2[46]; |
| 26 | - u_char s_uuid[16]; |
| 27 | - u_char s_volume_name[16]; |
| 28 | + uint8_t s_dummy1[56]; |
| 29 | + uint8_t s_magic[2]; |
| 30 | + uint8_t s_dummy2[46]; |
| 31 | + uint8_t s_uuid[16]; |
| 32 | + uint8_t s_volume_name[16]; |
| 33 | }; |
| 34 | |
| 35 | -#define ext2magic(s) ((uint) s.s_magic[0] + (((uint) s.s_magic[1]) << 8)) |
| 36 | +#define ext2magic(s) ((uint32_t) s.s_magic[0] + (((uint32_t) s.s_magic[1]) << 8)) |
| 37 | |
| 38 | #define XFS_SUPER_MAGIC "XFSB" |
| 39 | #define XFS_SUPER_MAGIC2 "BSFX" |
| 40 | struct xfs_super_block { |
| 41 | - u_char s_magic[4]; |
| 42 | - u_char s_dummy[28]; |
| 43 | - u_char s_uuid[16]; |
| 44 | - u_char s_dummy2[60]; |
| 45 | - u_char s_fsname[12]; |
| 46 | + uint8_t s_magic[4]; |
| 47 | + uint8_t s_dummy[28]; |
| 48 | + uint8_t s_uuid[16]; |
| 49 | + uint8_t s_dummy2[60]; |
| 50 | + uint8_t s_fsname[12]; |
| 51 | }; |
| 52 | |
| 53 | #define REISER_SUPER_MAGIC "ReIsEr2Fs" |
| 54 | struct reiserfs_super_block { |
| 55 | - u_char s_dummy1[52]; |
| 56 | - u_char s_magic[10]; |
| 57 | - u_char s_dummy2[22]; |
| 58 | - u_char s_uuid[16]; |
| 59 | - u_char s_volume_name[16]; |
| 60 | + uint8_t s_dummy1[52]; |
| 61 | + uint8_t s_magic[10]; |
| 62 | + uint8_t s_dummy2[22]; |
| 63 | + uint8_t s_uuid[16]; |
| 64 | + uint8_t s_volume_name[16]; |
| 65 | }; |
| 66 | |
| 67 | static inline unsigned short swapped(unsigned short a) |
| 68 | @@ -222,7 +223,7 @@ static char *get_spec_by_x(int n, const |
| 69 | return NULL; |
| 70 | } |
| 71 | |
| 72 | -static u_char fromhex(char c) |
| 73 | +static uint8_t fromhex(char c) |
| 74 | { |
| 75 | if (isdigit(c)) |
| 76 | return (c - '0'); |
| 77 | @@ -234,7 +235,7 @@ static u_char fromhex(char c) |
| 78 | |
| 79 | static char *get_spec_by_uuid(const char *s) |
| 80 | { |
| 81 | - u_char uuid[16]; |
| 82 | + uint8_t uuid[16]; |
| 83 | int i; |
| 84 | |
| 85 | if (strlen(s) != 36 || s[8] != '-' || s[13] != '-' || s[18] != '-' || s[23] != '-') |
| 86 | Index: quota-tools/quot.c |
| 87 | =================================================================== |
| 88 | --- quota-tools.orig/quot.c |
| 89 | +++ quota-tools/quot.c |
| 90 | @@ -47,6 +47,7 @@ |
| 91 | #include <utmp.h> |
| 92 | #include <pwd.h> |
| 93 | #include <grp.h> |
| 94 | +#include <stdint.h> |
| 95 | |
| 96 | #include "pot.h" |
| 97 | #include "quot.h" |
| 98 | @@ -56,8 +57,8 @@ |
| 99 | #include "quotasys.h" |
| 100 | |
| 101 | #define TSIZE 500 |
| 102 | -static __uint64_t sizes[TSIZE]; |
| 103 | -static __uint64_t overflow; |
| 104 | +static uint64_t sizes[TSIZE]; |
| 105 | +static uint64_t overflow; |
| 106 | |
| 107 | static int aflag; |
| 108 | static int cflag; |
| 109 | @@ -72,7 +73,7 @@ static time_t now; |
| 110 | char *progname; |
| 111 | |
| 112 | static void mounttable(void); |
| 113 | -static char *idname(__uint32_t, int); |
| 114 | +static char *idname(uint32_t, int); |
| 115 | static void report(const char *, const char *, int); |
| 116 | static void creport(const char *, const char *); |
| 117 | |
| 118 | @@ -173,7 +174,7 @@ static int qcmp(du_t * p1, du_t * p2) |
| 119 | static void creport(const char *file, const char *fsdir) |
| 120 | { |
| 121 | int i; |
| 122 | - __uint64_t t = 0; |
| 123 | + uint64_t t = 0; |
| 124 | |
| 125 | printf(_("%s (%s):\n"), file, fsdir); |
| 126 | for (i = 0; i < TSIZE - 1; i++) |
| 127 | @@ -219,7 +220,7 @@ static void report(const char *file, con |
| 128 | } |
| 129 | } |
| 130 | |
| 131 | -static idcache_t *getnextent(int type, __uint32_t id, int byid) |
| 132 | +static idcache_t *getnextent(int type, uint32_t id, int byid) |
| 133 | { |
| 134 | struct passwd *pw; |
| 135 | struct group *gr; |
| 136 | @@ -240,7 +241,7 @@ static idcache_t *getnextent(int type, _ |
| 137 | return &idc; |
| 138 | } |
| 139 | |
| 140 | -static char *idname(__uint32_t id, int type) |
| 141 | +static char *idname(uint32_t id, int type) |
| 142 | { |
| 143 | idcache_t *ncp, *idp; |
| 144 | static idcache_t nc[2][NID]; |
| 145 | @@ -286,8 +287,8 @@ static void acctXFS(xfs_bstat_t *p) |
| 146 | { |
| 147 | register du_t *dp; |
| 148 | du_t **hp; |
| 149 | - __uint64_t size; |
| 150 | - __uint32_t i, id; |
| 151 | + uint64_t size; |
| 152 | + uint32_t i, id; |
| 153 | |
| 154 | if ((p->bs_mode & S_IFMT) == 0) |
| 155 | return; |
| 156 | Index: quota-tools/quot.h |
| 157 | =================================================================== |
| 158 | --- quota-tools.orig/quot.h |
| 159 | +++ quota-tools/quot.h |
| 160 | @@ -35,18 +35,18 @@ |
| 161 | #define SEC24HR (60*60*24) /* seconds per day */ |
| 162 | |
| 163 | typedef struct { |
| 164 | - __uint32_t id; |
| 165 | + uint32_t id; |
| 166 | char name[UT_NAMESIZE + 1]; |
| 167 | } idcache_t; |
| 168 | |
| 169 | typedef struct du { |
| 170 | struct du *next; |
| 171 | - __uint64_t blocks; |
| 172 | - __uint64_t blocks30; |
| 173 | - __uint64_t blocks60; |
| 174 | - __uint64_t blocks90; |
| 175 | - __uint64_t nfiles; |
| 176 | - __uint32_t id; |
| 177 | + uint64_t blocks; |
| 178 | + uint64_t blocks30; |
| 179 | + uint64_t blocks60; |
| 180 | + uint64_t blocks90; |
| 181 | + uint64_t nfiles; |
| 182 | + uint32_t id; |
| 183 | } du_t; |
| 184 | |
| 185 | #define NDU 60000 |