recipes: tools/ed: upgraded to version 1.15
[dragora.git] / patches / quota / remove_non_posix_types.patch
blob06ff13cb981886c99edad61e26281a5adac17d36
1 Use proper C99 integer types
3 Upstream-Status: Pending
5 Signed-off-by: Khem Raj <raj.khem@gmail.com>
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>
17 #include "bylabel.h"
18 #include "common.h"
19 @@ -37,32 +38,32 @@ static struct uuidCache_s {
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];
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))
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];
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];
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;
72 -static u_char fromhex(char c)
73 +static uint8_t fromhex(char c)
75 if (isdigit(c))
76 return (c - '0');
77 @@ -234,7 +235,7 @@ static u_char fromhex(char c)
79 static char *get_spec_by_uuid(const char *s)
81 - u_char uuid[16];
82 + uint8_t uuid[16];
83 int i;
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>
96 #include "pot.h"
97 #include "quot.h"
98 @@ -56,8 +57,8 @@
99 #include "quotasys.h"
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;
107 static int aflag;
108 static int cflag;
109 @@ -72,7 +73,7 @@ static time_t now;
110 char *progname;
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 *);
118 @@ -173,7 +174,7 @@ static int qcmp(du_t * p1, du_t * p2)
119 static void creport(const char *file, const char *fsdir)
121 int i;
122 - __uint64_t t = 0;
123 + uint64_t t = 0;
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
131 -static idcache_t *getnextent(int type, __uint32_t id, int byid)
132 +static idcache_t *getnextent(int type, uint32_t id, int byid)
134 struct passwd *pw;
135 struct group *gr;
136 @@ -240,7 +241,7 @@ static idcache_t *getnextent(int type, _
137 return &idc;
140 -static char *idname(__uint32_t id, int type)
141 +static char *idname(uint32_t id, int type)
143 idcache_t *ncp, *idp;
144 static idcache_t nc[2][NID];
145 @@ -286,8 +287,8 @@ static void acctXFS(xfs_bstat_t *p)
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;
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 */
163 typedef struct {
164 - __uint32_t id;
165 + uint32_t id;
166 char name[UT_NAMESIZE + 1];
167 } idcache_t;
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;
185 #define NDU 60000
186 Index: quota-tools/rquota_server.c
187 ===================================================================
188 --- quota-tools.orig/rquota_server.c
189 +++ quota-tools/rquota_server.c
190 @@ -60,7 +60,7 @@ extern char nfs_pseudoroot[PATH_MAX];
192 extern struct authunix_parms *unix_cred;
194 -int in_group(gid_t * gids, u_int len, gid_t gid)
195 +int in_group(gid_t * gids, uint32_t len, gid_t gid)
197 gid_t *gidsp = gids + len;