remove_non_posix_types.patch 4.7 KB

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