summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/blkid/ChangeLog15
-rw-r--r--lib/blkid/Makefile.in26
-rw-r--r--lib/blkid/blkid_types.h.in14
-rw-r--r--lib/blkid/devname.c5
-rw-r--r--lib/blkid/list.h24
-rw-r--r--lib/blkid/probe.h14
-rw-r--r--lib/ext2fs/ChangeLog16
-rw-r--r--lib/ext2fs/ext2_ext_attr.h2
-rw-r--r--lib/ext2fs/ext2_types.h.in14
-rw-r--r--lib/ext2fs/flushb.c8
-rw-r--r--lib/ext2fs/ismounted.c2
-rw-r--r--lib/ext2fs/kernel-jbd.h8
-rw-r--r--lib/uuid/ChangeLog9
-rw-r--r--lib/uuid/Makefile.in4
-rw-r--r--lib/uuid/uuid_types.h.in14
15 files changed, 119 insertions, 56 deletions
diff --git a/lib/blkid/ChangeLog b/lib/blkid/ChangeLog
index 88963e30..a5b06a6c 100644
--- a/lib/blkid/ChangeLog
+++ b/lib/blkid/ChangeLog
@@ -1,3 +1,18 @@
+2003-03-06 Theodore Tso <tytso@mit.edu>
+
+ * blkid_types.h.in: Don't redefine types if other e2fsprogs
+ *_types.h files have been included already.
+
+ * list.h, probe.h: Use static inline instead of extern inline to
+ comply with C99 inline support.
+
+ * devname.c (blkid_probe_all): Avoid GCC extension; don't
+ initialize an array with the address of an automatic
+ variable.
+
+ * Makefile.in: Eliminate -Wall as a C compiler option by default;
+ it's not portable.
+
2003-03-02 Theodore Ts'o <tytso@mit.edu>
* Makefile.in: Don't install list.h, since it's not used by the
diff --git a/lib/blkid/Makefile.in b/lib/blkid/Makefile.in
index 58bc8331..05574e70 100644
--- a/lib/blkid/Makefile.in
+++ b/lib/blkid/Makefile.in
@@ -54,7 +54,7 @@ LIBS_BLKID= $(STATIC_LIBBLKID) $(STATIC_LIBUUID)
DEPLIBS_BLKID= $(DEPSTATIC_LIBBLKID) $(DEPSTATIC_LIBUUID)
.c.o:
- $(CC) -Wall $(ALL_CFLAGS) -c $< -o $@
+ $(CC) $(ALL_CFLAGS) -c $< -o $@
@PROFILE_CMT@ $(CC) $(ALL_CFLAGS) -g -pg -o profiled/$*.o -c $<
@CHECKER_CMT@ $(CC) $(ALL_CFLAGS) -checker -g -o checker/$*.o -c $<
@DLL_CMT@ (export JUMP_DIR=`pwd`/jump; $(CC) -B$(JUMP_PREFIX) $(ALL_CFLAGS) \
@@ -71,38 +71,38 @@ libblkid.3: $(DEP_SUBSTITUTE) $(srcdir)/libblkid.3.in
$(SUBSTITUTE) $(srcdir)/libblkid.3.in libblkid.3
tst_cache: $(srcdir)/cache.c $(DEPLIBS_BLKID)
- $(CC) -Wall -o tst_cache -DTEST_PROGRAM $(srcdir)/cache.c $(LIBS_BLKID) $(LIBUUID) $(ALL_CFLAGS)
+ $(CC) -o tst_cache -DTEST_PROGRAM $(srcdir)/cache.c $(LIBS_BLKID) $(ALL_CFLAGS)
tst_dev: $(srcdir)/dev.c $(DEPLIBS_BLKID)
- $(CC) -Wall -o tst_dev -DTEST_PROGRAM $(srcdir)/dev.c $(LIBS_BLKID) $(ALL_CFLAGS)
+ $(CC) -o tst_dev -DTEST_PROGRAM $(srcdir)/dev.c $(LIBS_BLKID) $(ALL_CFLAGS)
tst_devname: $(srcdir)/devname.c $(DEPLIBS_BLKID)
- $(CC) -Wall -o tst_devname -DTEST_PROGRAM $(srcdir)/devname.c $(LIBS_BLKID) $(ALL_CFLAGS)
+ $(CC) -o tst_devname -DTEST_PROGRAM $(srcdir)/devname.c $(LIBS_BLKID) $(ALL_CFLAGS)
tst_devno: $(srcdir)/devno.c $(DEPLIBS_BLKID)
- $(CC) -Wall -o tst_devno -DTEST_PROGRAM $(srcdir)/devno.c $(LIBS_BLKID) $(ALL_CFLAGS)
+ $(CC) -o tst_devno -DTEST_PROGRAM $(srcdir)/devno.c $(LIBS_BLKID) $(ALL_CFLAGS)
tst_getsize: $(srcdir)/getsize.c $(DEPLIBS_BLKID)
- $(CC) -Wall -o tst_getsize -DTEST_PROGRAM $(srcdir)/getsize.c $(LIBS_BLKID) $(ALL_CFLAGS)
+ $(CC) -o tst_getsize -DTEST_PROGRAM $(srcdir)/getsize.c $(LIBS_BLKID) $(ALL_CFLAGS)
tst_probe: $(srcdir)/probe.c $(DEPLIBS_BLKID)
- $(CC) -Wall -o tst_probe -DTEST_PROGRAM $(srcdir)/probe.c $(LIBS_BLKID) $(LIBUUID) $(ALL_CFLAGS)
+ $(CC) -o tst_probe -DTEST_PROGRAM $(srcdir)/probe.c $(LIBS_BLKID) $(ALL_CFLAGS)
tst_read: $(srcdir)/read.c $(DEPLIBS_BLKID)
- $(CC) -Wall -o tst_read -DTEST_PROGRAM $(srcdir)/read.c $(LIBS_BLKID) $(ALL_CFLAGS)
+ $(CC) -o tst_read -DTEST_PROGRAM $(srcdir)/read.c $(LIBS_BLKID) $(ALL_CFLAGS)
tst_resolve: $(srcdir)/resolve.c $(DEPLIBS_BLKID)
- $(CC) -Wall -o tst_resolve -DTEST_PROGRAM $(srcdir)/resolve.c $(LIBS_BLKID) $(LIBUUID) $(ALL_CFLAGS)
+ $(CC) -o tst_resolve -DTEST_PROGRAM $(srcdir)/resolve.c $(LIBS_BLKID) $(ALL_CFLAGS)
tst_save: $(srcdir)/save.c $(DEPLIBS_BLKID)
- $(CC) -Wall -o tst_save -DTEST_PROGRAM $(srcdir)/save.c $(LIBS_BLKID) $(LIBUUID) $(ALL_CFLAGS)
+ $(CC) -o tst_save -DTEST_PROGRAM $(srcdir)/save.c $(LIBS_BLKID) $(ALL_CFLAGS)
../../misc/blkid.o: $(top_srcdir)/misc/blkid.c blkid.h
- $(CC) -Wall $(ALL_CFLAGS) -c $(top_srcdir)/misc/blkid.c \
+ $(CC) $(ALL_CFLAGS) -c $(top_srcdir)/misc/blkid.c \
-o ../../misc/blkid.o
-blkid: ../../misc/blkid.o libblkid.a $(LIBUUID)
- $(CC) -Wall -o blkid ../../misc/blkid.o libblkid.a $(LIBUUID)
+blkid: ../../misc/blkid.o libblkid.a $(DEPLIBUUID)
+ $(CC) -o blkid ../../misc/blkid.o libblkid.a $(LIBUUID)
check:: all tst_cache tst_devname tst_devno tst_getsize tst_probe \
tst_read tst_resolve tst_save
diff --git a/lib/blkid/blkid_types.h.in b/lib/blkid/blkid_types.h.in
index 1fb4d27a..9de6804e 100644
--- a/lib/blkid/blkid_types.h.in
+++ b/lib/blkid/blkid_types.h.in
@@ -1,11 +1,11 @@
-#ifndef _BLKID_TYPES_H
-#define _BLKID_TYPES_H
-
/*
* If linux/types.h is already been included, assume it has defined
- * everything we need. (cross fingers)
+ * everything we need. (cross fingers) Other header files may have
+ * also defined the types that we need.
*/
-#ifndef _LINUX_TYPES_H
+#if (!defined(_LINUX_TYPES_H) && !defined(_BLKID_TYPES_H) && \
+ !defined(_UUID_TYPES) && !defined(_EXT2_TYPES_H))
+#define _BLKID_TYPES_H
typedef unsigned char __u8;
typedef signed char __s8;
@@ -48,6 +48,4 @@ typedef unsigned short __u32;
?== error: undefined 32 bit type
#endif
-#endif /* LINUX_TYPES_H */
-
-#endif /* BLKID_TYPES_H */
+#endif /* _*_TYPES_H */
diff --git a/lib/blkid/devname.c b/lib/blkid/devname.c
index 27a9d0c0..df770018 100644
--- a/lib/blkid/devname.c
+++ b/lib/blkid/devname.c
@@ -266,13 +266,16 @@ int blkid_probe_all(blkid_cache cache)
FILE *proc;
char line[1024];
char ptname0[128], ptname1[128], *ptname = 0;
- char *ptnames[2] = { ptname0, ptname1 };
+ char *ptnames[2];
dev_t devs[2];
int ma, mi;
unsigned long long sz;
int lens[2] = { 0, 0 };
int which = 0, last = 0;
+ ptnames[0] = ptname0;
+ ptnames[1] = ptname1;
+
if (!cache)
return -BLKID_ERR_PARAM;
diff --git a/lib/blkid/list.h b/lib/blkid/list.h
index 7800a464..c1cbfec5 100644
--- a/lib/blkid/list.h
+++ b/lib/blkid/list.h
@@ -5,6 +5,12 @@
extern "C" {
#endif
+#ifdef __GNUC__
+#define _INLINE_ static __inline__
+#else /* For Watcom C */
+#define _INLINE_ static inline
+#endif
+
/*
* Simple doubly linked list implementation.
*
@@ -34,7 +40,7 @@ struct list_head {
* This is only for internal list manipulation where we know
* the prev/next entries already!
*/
-static __inline__ void __list_add(struct list_head * add,
+_INLINE_ void __list_add(struct list_head * add,
struct list_head * prev,
struct list_head * next)
{
@@ -52,7 +58,7 @@ static __inline__ void __list_add(struct list_head * add,
* Insert a new entry after the specified head.
* This is good for implementing stacks.
*/
-static __inline__ void list_add(struct list_head *add, struct list_head *head)
+_INLINE_ void list_add(struct list_head *add, struct list_head *head)
{
__list_add(add, head, head->next);
}
@@ -65,7 +71,7 @@ static __inline__ void list_add(struct list_head *add, struct list_head *head)
* Insert a new entry before the specified head.
* This is useful for implementing queues.
*/
-static __inline__ void list_add_tail(struct list_head *add, struct list_head *head)
+_INLINE_ void list_add_tail(struct list_head *add, struct list_head *head)
{
__list_add(add, head->prev, head);
}
@@ -77,7 +83,7 @@ static __inline__ void list_add_tail(struct list_head *add, struct list_head *he
* This is only for internal list manipulation where we know
* the prev/next entries already!
*/
-static __inline__ void __list_del(struct list_head * prev,
+_INLINE_ void __list_del(struct list_head * prev,
struct list_head * next)
{
next->prev = prev;
@@ -91,7 +97,7 @@ static __inline__ void __list_del(struct list_head * prev,
* list_empty() on @entry does not return true after this, @entry is
* in an undefined state.
*/
-static __inline__ void list_del(struct list_head *entry)
+_INLINE_ void list_del(struct list_head *entry)
{
__list_del(entry->prev, entry->next);
}
@@ -100,7 +106,7 @@ static __inline__ void list_del(struct list_head *entry)
* list_del_init - deletes entry from list and reinitialize it.
* @entry: the element to delete from the list.
*/
-static __inline__ void list_del_init(struct list_head *entry)
+_INLINE_ void list_del_init(struct list_head *entry)
{
__list_del(entry->prev, entry->next);
INIT_LIST_HEAD(entry);
@@ -110,7 +116,7 @@ static __inline__ void list_del_init(struct list_head *entry)
* list_empty - tests whether a list is empty
* @head: the list to test.
*/
-static __inline__ int list_empty(struct list_head *head)
+_INLINE_ int list_empty(struct list_head *head)
{
return head->next == head;
}
@@ -120,7 +126,7 @@ static __inline__ int list_empty(struct list_head *head)
* @list: the new list to add.
* @head: the place to add it in the first list.
*/
-static __inline__ void list_splice(struct list_head *list, struct list_head *head)
+_INLINE_ void list_splice(struct list_head *list, struct list_head *head)
{
struct list_head *first = list->next;
@@ -164,6 +170,8 @@ static __inline__ void list_splice(struct list_head *list, struct list_head *hea
for (pos = (head)->next, pnext = pos->next; pos != (head); \
pos = pnext, pnext = pos->next)
+#undef _INLINE_
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/blkid/probe.h b/lib/blkid/probe.h
index 391428ca..8302b3f4 100644
--- a/lib/blkid/probe.h
+++ b/lib/blkid/probe.h
@@ -194,14 +194,14 @@ struct hfs_super_block {
* Byte swap functions
*/
#ifdef __GNUC__
-#define _INLINE_ extern __inline__
+#define _INLINE_ static __inline__
#else /* For Watcom C */
-#define _INLINE_ extern inline
+#define _INLINE_ static inline
#endif
-extern __u16 blkid_swab16(__u16 val);
-extern __u32 blkid_swab32(__u32 val);
-extern __u64 blkid_swab64(__u64 val);
+static __u16 blkid_swab16(__u16 val);
+static __u32 blkid_swab32(__u32 val);
+static __u64 blkid_swab64(__u64 val);
#if ((defined __GNUC__) && \
(defined(__i386__) || defined(__i486__) || defined(__i586__)))
@@ -250,7 +250,7 @@ _INLINE_ __u32 blkid_swab32(__u32 val)
((val<<8)&0xFF0000) | (val<<24));
}
-_INLINE_ u64 blkid_swab64(__u64 val)
+_INLINE_ __u64 blkid_swab64(__u64 val)
{
return (blkid_swab32(val >> 32) |
(((__u64) blkid_swab32(val & 0xFFFFFFFFUL)) << 32));
@@ -275,4 +275,6 @@ _INLINE_ u64 blkid_swab64(__u64 val)
#define blkid_be64(x) blkid_swab64(x)
#endif
+#undef _INLINE_
+
#endif /* _BLKID_PROBE_H */
diff --git a/lib/ext2fs/ChangeLog b/lib/ext2fs/ChangeLog
index 2a1bce25..45fc6bc7 100644
--- a/lib/ext2fs/ChangeLog
+++ b/lib/ext2fs/ChangeLog
@@ -1,3 +1,19 @@
+2003-03-06 Theodore Tso <tytso@mit.edu>
+
+ * ext2_types.h.in: Don't redefine types if other e2fsprogs
+ *_types.h files have been included already.
+
+ * kernel-jbd.h: Use C99 variadic cpp macros if not using GCC.
+ (Older GCC's don't support the C99 variadic macros.)
+
+ * flushb.c (ext2fs_sync_device),
+ ismounted.c (ext2fs_check_mount_point): Avoid GCC extension:
+ #warning not supported by Solaris suncc
+
+ * ext2_ext_attr.h: Avoid GCC extension: 0 length arrays in
+ structure definition. Not needed for now in
+ ext2_ext_attr_entry.
+
2003-01-25 Theodore Ts'o <tytso@mit.edu>
* dirhash.c: Fix gcc -Wall nits.
diff --git a/lib/ext2fs/ext2_ext_attr.h b/lib/ext2fs/ext2_ext_attr.h
index 7fff2669..d0a44f3f 100644
--- a/lib/ext2fs/ext2_ext_attr.h
+++ b/lib/ext2fs/ext2_ext_attr.h
@@ -28,7 +28,9 @@ struct ext2_ext_attr_entry {
__u32 e_value_block; /* disk block attribute is stored on (n/i) */
__u32 e_value_size; /* size of attribute value */
__u32 e_hash; /* hash value of name and value */
+#if 0
char e_name[0]; /* attribute name */
+#endif
};
#define EXT2_EXT_ATTR_PAD_BITS 2
diff --git a/lib/ext2fs/ext2_types.h.in b/lib/ext2fs/ext2_types.h.in
index 38f588f8..1d82c5d2 100644
--- a/lib/ext2fs/ext2_types.h.in
+++ b/lib/ext2fs/ext2_types.h.in
@@ -1,11 +1,11 @@
-#ifndef _EXT2_TYPES_H
-#define _EXT2_TYPES_H
-
/*
* If linux/types.h is already been included, assume it has defined
- * everything we need. (cross fingers)
+ * everything we need. (cross fingers) Other header files may have
+ * also defined the types that we need.
*/
-#ifndef _LINUX_TYPES_H
+#if (!defined(_LINUX_TYPES_H) && !defined(_BLKID_TYPES_H) && \
+ !defined(_UUID_TYPES) && !defined(_EXT2_TYPES_H))
+#define _EXT2_TYPES_H
typedef unsigned char __u8;
typedef signed char __s8;
@@ -48,6 +48,4 @@ typedef unsigned short __u32;
?== error: undefined 32 bit type
#endif
-#endif /* LINUX_TYPES_H */
-
-#endif /* EXT2_TYPES_H */
+#endif /* _*_TYPES_H */
diff --git a/lib/ext2fs/flushb.c b/lib/ext2fs/flushb.c
index ed4d3901..80a21179 100644
--- a/lib/ext2fs/flushb.c
+++ b/lib/ext2fs/flushb.c
@@ -65,12 +65,16 @@ errcode_t ext2fs_sync_device(int fd, int flushb)
if (ioctl (fd, BLKFLSBUF, 0) == 0)
return 0;
#else
- #warning BLKFLSBUF not defined
+ #ifdef __GNUC__
+ #warning BLKFLSBUF not defined
+ #endif
#endif
#ifdef FDFLUSH
ioctl (fd, FDFLUSH, 0); /* In case this is a floppy */
#else
- #warning FDFLUSH not defined
+ #ifdef __GNUC__
+ #warning FDFLUSH not defined
+ #endif
#endif
}
return 0;
diff --git a/lib/ext2fs/ismounted.c b/lib/ext2fs/ismounted.c
index 3552a1b7..26e80545 100644
--- a/lib/ext2fs/ismounted.c
+++ b/lib/ext2fs/ismounted.c
@@ -296,7 +296,9 @@ errcode_t ext2fs_check_mount_point(const char *device, int *mount_flags,
#ifdef HAVE_GETMNTINFO
return check_getmntinfo(device, mount_flags, mtpt, mtlen);
#else
+#ifdef __GNUC__
#warning "Can't use getmntent or getmntinfo to check for mounted filesystems!"
+#endif
*mount_flags = 0;
return 0;
#endif /* HAVE_GETMNTINFO */
diff --git a/lib/ext2fs/kernel-jbd.h b/lib/ext2fs/kernel-jbd.h
index 42803466..4d97b7f9 100644
--- a/lib/ext2fs/kernel-jbd.h
+++ b/lib/ext2fs/kernel-jbd.h
@@ -30,6 +30,10 @@
#include <asm/semaphore.h>
#endif
+#ifndef __GNUC__
+#define __FUNCTION__ ""
+#endif
+
#define journal_oom_retry 1
#ifdef __STDC__
@@ -51,7 +55,11 @@ extern int journal_enable_debug;
} \
} while (0)
#else
+#ifdef __GNUC__
#define jbd_debug(f, a...) /**/
+#else
+#define jbd_debug(f, ...) /**/
+#endif
#endif
#else
#define jbd_debug(x) /* AIX doesn't do STDC */
diff --git a/lib/uuid/ChangeLog b/lib/uuid/ChangeLog
index f23bb69a..2146e25d 100644
--- a/lib/uuid/ChangeLog
+++ b/lib/uuid/ChangeLog
@@ -1,3 +1,12 @@
+2003-03-06 Theodore Tso <tytso@mit.edu>
+
+ * uuid_types.h.in: Don't redefine types if other e2fsprogs
+ *_types.h files have been included already.
+
+ * Makefile.in (tst_uuid): Link against the static library instead
+ of all of the object files, so that we automatically pick
+ up -lsocket under Solaris.
+
2003-03-02 Theodore Ts'o <tytso@mit.edu>
* Makefile.in, uuidP.h, uuid_types.h.in: Use uuid_types.h instead
diff --git a/lib/uuid/Makefile.in b/lib/uuid/Makefile.in
index 133b959c..c91093ca 100644
--- a/lib/uuid/Makefile.in
+++ b/lib/uuid/Makefile.in
@@ -90,8 +90,8 @@ $(top_builddir)/lib/uuid/uuid_types.h: $(srcdir)/uuid_types.h.in $(top_builddir)
tst_uuid.o: $(srcdir)/tst_uuid.c
$(CC) $(ALL_CFLAGS) -c $(srcdir)/tst_uuid.c -o tst_uuid.o
-tst_uuid: tst_uuid.o $(DEPLIBUUID)
- $(CC) $(ALL_LDFLAGS) -o tst_uuid tst_uuid.o $(OBJS)
+tst_uuid: tst_uuid.o $(DEPSTATIC_LIBUUID)
+ $(CC) $(ALL_LDFLAGS) -o tst_uuid tst_uuid.o $(STATIC_LIBUUID)
uuid_time: $(srcdir)/uuid_time.c $(DEPLIBUUID)
$(CC) $(ALL_CFLAGS) -DDEBUG -o uuid_time $(srcdir)/uuid_time.c \
diff --git a/lib/uuid/uuid_types.h.in b/lib/uuid/uuid_types.h.in
index 250d0434..ba67feaf 100644
--- a/lib/uuid/uuid_types.h.in
+++ b/lib/uuid/uuid_types.h.in
@@ -1,11 +1,11 @@
-#ifndef _UUID_TYPES_H
-#define _UUID_TYPES_H
-
/*
* If linux/types.h is already been included, assume it has defined
- * everything we need. (cross fingers)
+ * everything we need. (cross fingers) Other header files may have
+ * also defined the types that we need.
*/
-#ifndef _LINUX_TYPES_H
+#if (!defined(_LINUX_TYPES_H) && !defined(_BLKID_TYPES_H) && \
+ !defined(_UUID_TYPES) && !defined(_EXT2_TYPES_H))
+#define _UUID_TYPES_H
typedef unsigned char __u8;
typedef signed char __s8;
@@ -48,6 +48,4 @@ typedef unsigned short __u32;
?== error: undefined 32 bit type
#endif
-#endif /* LINUX_TYPES_H */
-
-#endif /* UUID_TYPES_H */
+#endif /* _*_TYPES_H */