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