summaryrefslogtreecommitdiff
path: root/src/libudev/util.h
diff options
context:
space:
mode:
authorZbigniew Jedrzejewski-Szmek <zbyszek@in.waw.pl>2014-05-15 18:42:28 -0400
committerAnthony G. Basile <blueness@gentoo.org>2014-05-15 19:34:56 -0400
commitf8e5fbd9c8b209e556c017bfb420a86e8181dfa7 (patch)
treee6488b61b93e5e69c161475a6c62f2bfbd146f00 /src/libudev/util.h
parentdb992ba3a71f320faab8f90de77ef081305917bb (diff)
Remove unnecessary casts in printfs
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/libudev/util.h')
-rw-r--r--src/libudev/util.h48
1 files changed, 42 insertions, 6 deletions
diff --git a/src/libudev/util.h b/src/libudev/util.h
index 4e0f310889..a950f2658f 100644
--- a/src/libudev/util.h
+++ b/src/libudev/util.h
@@ -32,15 +32,51 @@
#include <unistd.h>
#include <sys/socket.h>
+#include "config.h"
+
+#if SIZEOF_PID_T == 4
+# define PID_FMT "%" PRIu32
+#elif SIZEOF_PID_T == 2
+# define PID_FMT "%" PRIu16
+#else
+# error Unknown pid_t size
+#endif
+
+#if SIZEOF_UID_T == 4
+# define UID_FMT "%" PRIu32
+#elif SIZEOF_UID_T == 2
+# define UID_FMT "%" PRIu16
+#else
+# error Unknown uid_t size
+#endif
+
+#if SIZEOF_GID_T == 4
+# define GID_FMT "%" PRIu32
+#elif SIZEOF_GID_T == 2
+# define GID_FMT "%" PRIu16
+#else
+# error Unknown gid_t size
+#endif
+
+#if SIZEOF_TIME_T == 8
+# define PRI_TIME PRIu64
+#elif SIZEOF_GID_T == 4
+# define PRI_TIME PRIu32
+#else
+# error Unknown time_t size
+#endif
+
+#if SIZEOF_RLIM_T == 8
+# define RLIM_FMT "%" PRIu64
+#elif SIZEOF_RLIM_T == 4
+# define RLIM_FMT "%" PRIu32
+#else
+# error Unknown rlim_t size
+#endif
+
#include "macro.h"
#include "missing.h"
-union dirent_storage {
- struct dirent de;
- uint8_t storage[offsetof(struct dirent, d_name) +
- ((NAME_MAX + 1 + sizeof(long)) & ~(sizeof(long) - 1))];
-};
-
/* What is interpreted as whitespace? */
#define WHITESPACE " \t\n\r"
#define NEWLINE "\n\r"