]> err.no Git - util-linux/commitdiff
blkid: remove blkid_types.h
authorKarel Zak <kzak@redhat.com>
Wed, 3 Dec 2008 22:34:23 +0000 (23:34 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 11 Feb 2009 22:21:49 +0000 (23:21 +0100)
We needn't to use kernel types, in userspace we have portable
stdint.h.

Signed-off-by: Karel Zak <kzak@redhat.com>
configure.ac
libs/blkid/.gitignore
libs/blkid/src/Makefile.am
libs/blkid/src/blkid.h
libs/blkid/src/blkid_types.h.in [deleted file]
libs/blkid/src/probers/vfat.c
libs/blkid/src/tst_types.c

index 4186d40d1711aa72146de78c83a9f6ad2748aa80..25ba67485cbcac7d995955a207ce7362b95ba474 100644 (file)
@@ -795,7 +795,6 @@ libs/blkid/libblkid.3
 libs/blkid/blkid.8
 libs/blkid/Makefile
 libs/blkid/bin/Makefile
-libs/blkid/src/blkid_types.h
 libs/blkid/src/Makefile
 libs/blkid/src/probers/Makefile
 login-utils/Makefile
index d3c0028cbf119608d1b97afdd82af2dc704e587f..e886cb89c6ecf35091cb59dfea274d47558198b7 100644 (file)
@@ -1,4 +1,3 @@
 *.[38]
-blkid_types.h
 *.sh
 bin/blkid
index 58f30af6cc9ed3f6ab9ff1e95cb4b86fbcb2327a..202fe4af4796a808577f63a3b2ca49e852eac189 100644 (file)
@@ -8,7 +8,7 @@ AM_CPPFLAGS += -I$(top_builddir)/libs/blkid/src
 lib_LIBRARIES = libblkid.a
 libblkid_a_SOURCES = cache.c dev.c devname.c devno.c getsize.c llseek.c  \
                     probe.c read.c resolve.c save.c tag.c version.c verify.c \
-                    blkid.h blkidP.h list.h blkid_types.h probers/probers.h \
+                    blkid.h blkidP.h list.h probers/probers.h \
                     $(top_srcdir)/lib/blkdev.c $(top_srcdir)/lib/linux_version.c
 libblkid_a_LIBADD = probers/libprobers.a
 libblkid_a_CFLAGS = -fPIC
@@ -28,7 +28,7 @@ if HAVE_UUID
 blkid_OTHERLDADD += -luuid     #TODO $(UUID_LIBS)
 endif
 
-EXTRA_DIST = blkid.sym blkid_types.h.in
+EXTRA_DIST = blkid.sym
 
 all-local: $(blkid_LIB)
 
index c31a9b89d283b37b5fcf06f0d87f51feb46e813a..be6f7e06fa1009b457ff6a8f993fc810b3db9d2c 100644 (file)
@@ -23,8 +23,8 @@
 #ifndef _BLKID_BLKID_H
 #define _BLKID_BLKID_H
 
+#include <stdint.h>
 #include <sys/types.h>
-#include <blkid/blkid_types.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -34,7 +34,7 @@ typedef struct blkid_struct_dev *blkid_dev;
 typedef struct blkid_struct_cache *blkid_cache;
 typedef struct blkid_struct_probe *blkid_probe;
 
-typedef __s64 blkid_loff_t;
+typedef int64_t blkid_loff_t;
 
 typedef struct blkid_struct_tag_iterate *blkid_tag_iterate;
 typedef struct blkid_struct_dev_iterate *blkid_dev_iterate;
diff --git a/libs/blkid/src/blkid_types.h.in b/libs/blkid/src/blkid_types.h.in
deleted file mode 100644 (file)
index 4efffba..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * If linux/types.h is already been included, assume it has defined
- * everything we need.  (cross fingers)  Other header files may have
- * also defined the types that we need.
- */
-#if (!defined(_LINUX_TYPES_H) && !defined(_BLKID_TYPES_H) && \
-       !defined(_EXT2_TYPES_H))
-#define _BLKID_TYPES_H
-
-@ASM_TYPES_HEADER@
-
-#ifdef __U8_TYPEDEF
-typedef __U8_TYPEDEF __u8;
-#else
-typedef unsigned char __u8;
-#endif
-
-#ifdef __S8_TYPEDEF
-typedef __S8_TYPEDEF __s8;
-#else
-typedef signed char __s8;
-#endif
-
-#ifdef __U16_TYPEDEF
-typedef __U16_TYPEDEF __u16;
-#else
-#if (@SIZEOF_INT@ == 2)
-typedef        unsigned int    __u16;
-#else
-#if (@SIZEOF_SHORT@ == 2)
-typedef        unsigned short  __u16;
-#else
-  ?==error: undefined 16 bit type
-#endif /* SIZEOF_SHORT == 2 */
-#endif /* SIZEOF_INT == 2 */
-#endif /* __U16_TYPEDEF */
-
-#ifdef __S16_TYPEDEF
-typedef __S16_TYPEDEF __s16;
-#else
-#if (@SIZEOF_INT@ == 2)
-typedef        int             __s16;
-#else
-#if (@SIZEOF_SHORT@ == 2)
-typedef        short           __s16;
-#else
-  ?==error: undefined 16 bit type
-#endif /* SIZEOF_SHORT == 2 */
-#endif /* SIZEOF_INT == 2 */
-#endif /* __S16_TYPEDEF */
-
-
-#ifdef __U32_TYPEDEF
-typedef __U32_TYPEDEF __u32;
-#else
-#if (@SIZEOF_INT@ == 4)
-typedef        unsigned int    __u32;
-#else
-#if (@SIZEOF_LONG@ == 4)
-typedef        unsigned long   __u32;
-#else
-#if (@SIZEOF_SHORT@ == 4)
-typedef        unsigned short  __u32;
-#else
- ?== error: undefined 32 bit type
-#endif /* SIZEOF_SHORT == 4 */
-#endif /* SIZEOF_LONG == 4 */
-#endif /* SIZEOF_INT == 4 */
-#endif /* __U32_TYPEDEF */
-
-#ifdef __S32_TYPEDEF
-typedef __S32_TYPEDEF __s32;
-#else
-#if (@SIZEOF_INT@ == 4)
-typedef        int             __s32;
-#else
-#if (@SIZEOF_LONG@ == 4)
-typedef        long            __s32;
-#else
-#if (@SIZEOF_SHORT@ == 4)
-typedef        short           __s32;
-#else
- ?== error: undefined 32 bit type
-#endif /* SIZEOF_SHORT == 4 */
-#endif /* SIZEOF_LONG == 4 */
-#endif /* SIZEOF_INT == 4 */
-#endif /* __S32_TYPEDEF */
-
-#ifdef __U64_TYPEDEF
-typedef __U64_TYPEDEF __u64;
-#else
-#if (@SIZEOF_INT@ == 8)
-typedef unsigned int   __u64;
-#else
-#if (@SIZEOF_LONG@ == 8)
-typedef unsigned long  __u64;
-#else
-#if (@SIZEOF_LONG_LONG@ == 8)
-typedef unsigned long long     __u64;
-#endif /* SIZEOF_LONG_LONG == 8 */
-#endif /* SIZEOF_LONG == 8 */
-#endif /* SIZEOF_INT == 8 */
-#endif /* __U64_TYPEDEF */
-
-#ifdef __S64_TYPEDEF
-typedef __S64_TYPEDEF __s64;
-#else
-#if (@SIZEOF_INT@ == 8)
-typedef int            __s64;
-#else
-#if (@SIZEOF_LONG@ == 8)
-typedef long           __s64;
-#else
-#if (@SIZEOF_LONG_LONG@ == 8)
-#if defined(__GNUC__)
-typedef __signed__ long long   __s64;
-#else
-typedef signed long long       __s64;
-#endif /* __GNUC__ */
-#endif /* SIZEOF_LONG_LONG == 8 */
-#endif /* SIZEOF_LONG == 8 */
-#endif /* SIZEOF_INT == 8 */
-#endif /* __S64_TYPEDEF */
-
-#undef __S8_TYPEDEF
-#undef __U8_TYPEDEF
-#undef __S16_TYPEDEF
-#undef __U16_TYPEDEF
-#undef __S32_TYPEDEF
-#undef __U32_TYPEDEF
-#undef __S64_TYPEDEF
-#undef __U64_TYPEDEF
-
-#endif /* _*_TYPES_H */
index b12ab63a1890882ac617371e65513dba4a7ba6ea..80d9ff8f654de68df8d38117f7948fc1e6bcb8df 100644 (file)
@@ -272,7 +272,7 @@ static int probe_vfat(blkid_probe pr, const struct blkid_idmag *mag)
                next = le32_to_cpu(vs->vs_root_cluster);
                while (next && --maxloop) {
                        uint32_t next_sect_off;
-                       __u64 next_off, fat_entry_off;
+                       uint64_t next_off, fat_entry_off;
                        int count;
 
                        next_sect_off = (next - 2) * vs->vs_cluster_size;
index 3003c8b5b3d62f8858e1aaeafafd6b7957b27882..ecbc03217b44fd8f7eff97b41bdfc3ecd1dc8acd 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * This testing program makes sure the blkid_types header file
+ * This testing program makes sure the stdint.h header file
  *
  * Copyright (C) 2006 by Theodore Ts'o.
  *
  */
 
 #include <sys/types.h>
-#include "blkid/blkid_types.h"
+#include <stdint.h>
 
 #include <stdlib.h>
 #include <stdio.h>
 
 int main(int argc, char **argv)
 {
-       if (sizeof(__u8) != 1) {
-               printf("Sizeof(__u8) is %d should be 1\n",
-                      (int)sizeof(__u8));
+       if (sizeof(uint8_t) != 1) {
+               printf("Sizeof(uint8_t) is %d should be 1\n",
+                      (int)sizeof(uint8_t));
                exit(1);
        }
-       if (sizeof(__s8) != 1) {
-               printf("Sizeof(_s8) is %d should be 1\n",
-                      (int)sizeof(__s8));
+       if (sizeof(int8_t) != 1) {
+               printf("Sizeof(int8_t) is %d should be 1\n",
+                      (int)sizeof(int8_t));
                exit(1);
        }
-       if (sizeof(__u16) != 2) {
-               printf("Sizeof(__u16) is %d should be 2\n",
-                      (int)sizeof(__u16));
+       if (sizeof(uint16_t) != 2) {
+               printf("Sizeof(uint16_t) is %d should be 2\n",
+                      (int)sizeof(uint16_t));
                exit(1);
        }
-       if (sizeof(__s16) != 2) {
-               printf("Sizeof(__s16) is %d should be 2\n",
-                      (int)sizeof(__s16));
+       if (sizeof(int16_t) != 2) {
+               printf("Sizeof(int16_t) is %d should be 2\n",
+                      (int)sizeof(int16_t));
                exit(1);
        }
-       if (sizeof(__u32) != 4) {
-               printf("Sizeof(__u32) is %d should be 4\n",
-                      (int)sizeof(__u32));
+       if (sizeof(uint32_t) != 4) {
+               printf("Sizeof(uint32_t) is %d should be 4\n",
+                      (int)sizeof(uint32_t));
                exit(1);
        }
-       if (sizeof(__s32) != 4) {
-               printf("Sizeof(__s32) is %d should be 4\n",
-                      (int)sizeof(__s32));
+       if (sizeof(int32_t) != 4) {
+               printf("Sizeof(int32_t) is %d should be 4\n",
+                      (int)sizeof(int32_t));
                exit(1);
        }
-       if (sizeof(__u64) != 8) {
-               printf("Sizeof(__u64) is %d should be 8\n",
-                      (int)sizeof(__u64));
+       if (sizeof(uint64_t) != 8) {
+               printf("Sizeof(uint64_t) is %d should be 8\n",
+                      (int)sizeof(uint64_t));
                exit(1);
        }
-       if (sizeof(__s64) != 8) {
-               printf("Sizeof(__s64) is %d should be 8\n",
-                      (int)sizeof(__s64));
+       if (sizeof(int64_t) != 8) {
+               printf("Sizeof(int64_t) is %d should be 8\n",
+                      (int)sizeof(int64_t));
                exit(1);
        }
-       printf("The blkid_types.h types are correct.\n");
+       printf("The stdint.h types are correct.\n");
        exit(0);
 }