Whamcloud - gitweb
ChangeLog, e2p.h, feature.c:
authorTheodore Ts'o <tytso@mit.edu>
Tue, 26 Oct 1999 14:29:22 +0000 (14:29 +0000)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 26 Oct 1999 14:29:22 +0000 (14:29 +0000)
  feature.c: Fix GCC warnings; add const to the char * types in the
   function prototypes for e2p_feature2string and e2p_edit_feature.
ChangeLog, uuid.h, uuid_time.c:
  uuid_time.c (variant_string): Declare to be static to avoid gcc warnings.
  uuid.h: Add function prototypes for uuid_generate_random() and
   uuid_generate_time().
ChangeLog, chattr.c:
  chattr.c: Add hack to compile in a definition for S_ISLNK so we can
   successfully compile even with warnings turned on.

lib/e2p/ChangeLog
lib/e2p/e2p.h
lib/e2p/feature.c
lib/uuid/ChangeLog
lib/uuid/uuid.h
lib/uuid/uuid_time.c
misc/ChangeLog
misc/chattr.c

index f9180f6..02dad9f 100644 (file)
@@ -1,3 +1,9 @@
+1999-10-26    <tytso@valinux.com>
+
+       * feature.c: Fix GCC warnings; add const to the char * types in
+               the function prototypes for e2p_feature2string and
+               e2p_edit_feature.
+
 1999-10-22    <tytso@valinux.com>
 
        * Release of E2fsprogs 1.16
index 2ccbecc..9f5636c 100644 (file)
@@ -24,9 +24,9 @@ void print_fs_state (FILE * f, unsigned short state);
 int setflags (int fd, unsigned long flags);
 int setversion (int fd, unsigned long version);
 
-char *e2p_feature2string(int compat, unsigned int mask);
+const char *e2p_feature2string(int compat, unsigned int mask);
 int e2p_string2feature(char *string, int *compat, unsigned int *mask);
-int e2p_edit_feature(char *str, __u32 *compat_array, __u32 *ok_array);
+int e2p_edit_feature(const char *str, __u32 *compat_array, __u32 *ok_array);
 
 int e2p_is_null_uuid(void *uu);
 void e2p_uuid_to_str(void *uu, char *out);
index 00b5336..eee64e6 100644 (file)
@@ -11,6 +11,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <ctype.h>
 #include <errno.h>
 
 #include "e2p.h"
@@ -59,7 +60,7 @@
 struct feature {
        int             compat;
        unsigned int    mask;
-       char            *string;
+       const char      *string;
 };
 
 struct feature feature_list[] = {
@@ -84,7 +85,7 @@ struct feature feature_list[] = {
        {       0, 0, 0 },
 };
 
-char *e2p_feature2string(int compat, unsigned int mask)
+const char *e2p_feature2string(int compat, unsigned int mask)
 {
        struct feature  *f;
        static char buf[20];
@@ -115,7 +116,7 @@ char *e2p_feature2string(int compat, unsigned int mask)
        return buf;
 }
 
-int e2p_string2feature(char *string, int *compat, unsigned int *mask)
+int e2p_string2feature(char *string, int *compat_type, unsigned int *mask)
 {
        struct feature  *f;
        char            *eptr;
@@ -123,7 +124,7 @@ int e2p_string2feature(char *string, int *compat, unsigned int *mask)
 
        for (f = feature_list; f->string; f++) {
                if (!strcasecmp(string, f->string)) {
-                       *compat = f->compat;
+                       *compat_type = f->compat;
                        *mask = f->mask;
                        return 0;
                }
@@ -134,15 +135,15 @@ int e2p_string2feature(char *string, int *compat, unsigned int *mask)
        switch (string[8]) {
        case 'c':
        case 'C':
-               *compat = E2P_FEATURE_COMPAT;
+               *compat_type = E2P_FEATURE_COMPAT;
                break;
        case 'i':
        case 'I':
-               *compat = E2P_FEATURE_INCOMPAT;
+               *compat_type = E2P_FEATURE_INCOMPAT;
                break;
        case 'r':
        case 'R':
-               *compat = E2P_FEATURE_RO_INCOMPAT;
+               *compat_type = E2P_FEATURE_RO_INCOMPAT;
                break;
        default:
                return 1;
@@ -165,7 +166,7 @@ static char *skip_over_blanks(char *cp)
        return cp;
 }
 
-char *skip_over_word(char *cp)
+static char *skip_over_word(char *cp)
 {
        while (*cp && !isspace(*cp) && *cp != ',')
                cp++;
@@ -177,11 +178,12 @@ char *skip_over_word(char *cp)
  * if set, allows the application to limit what features the user is
  * allowed to set or clear using this function.
  */
-int e2p_edit_feature(char *str, __u32 *compat_array, __u32 *ok_array)
+int e2p_edit_feature(const char *str, __u32 *compat_array, __u32 *ok_array)
 {
        char    *cp, *buf, *next;
        int     neg;
-       unsigned int    compat, mask;
+       unsigned int    mask;
+       int             compat_type;
 
        buf = malloc(strlen(str)+1);
        if (!buf)
@@ -204,14 +206,14 @@ int e2p_edit_feature(char *str, __u32 *compat_array, __u32 *ok_array)
                        cp++;
                        break;
                }
-               if (e2p_string2feature(cp, &compat, &mask))
+               if (e2p_string2feature(cp, &compat_type, &mask))
                        return 1;
-               if (ok_array && !(ok_array[compat] & mask))
+               if (ok_array && !(ok_array[compat_type] & mask))
                        return 1;
                if (neg)
-                       compat_array[compat] &= ~mask;
+                       compat_array[compat_type] &= ~mask;
                else
-                       compat_array[compat] |= mask;
+                       compat_array[compat_type] |= mask;
                cp = next ? next+1 : 0;
        }
        return 0;
index 83abc89..858bb54 100644 (file)
@@ -1,3 +1,11 @@
+1999-10-26    <tytso@valinux.com>
+
+       * uuid_time.c (variant_string): Declare to be static to avoid gcc
+               warnings.
+
+       * uuid.h: Add function prototypes for uuid_generate_random() and
+               uuid_generate_time().
+
 1999-10-25    <tytso@valinux.com>
 
        * gen_uuid_nt.c (uuid_generate): W2K strikes again!  An
index 8354111..12afabf 100644 (file)
@@ -32,6 +32,8 @@ void uuid_copy(uuid_t uu1, uuid_t uu2);
 
 /* gen_uuid.c */
 void uuid_generate(uuid_t out);
+void uuid_generate_random(uuid_t out);
+void uuid_generate_time(uuid_t out);
 
 /* isnull.c */
 int uuid_is_null(uuid_t uu);
index 6526496..f2fddfa 100644 (file)
@@ -69,7 +69,7 @@ int uuid_variant(uuid_t uu)
 }
 
 #ifdef DEBUG
-const char *variant_string(int variant)
+static const char *variant_string(int variant)
 {
        switch (variant) {
        case UUID_VARIANT_NCS:
index 508aafb..7bf0bfc 100644 (file)
@@ -1,3 +1,8 @@
+1999-10-26    <tytso@valinux.com>
+
+       * chattr.c: Add hack to compile in a definition for S_ISLNK so we
+               can successfully compile even with warnings turned on.
+
 1999-10-25    <tytso@valinux.com>
 
        * mke2fs.c (show_stats): Capitalized Hurd to make the GNU types
index 848c1d5..de1480c 100644 (file)
 #include <sys/stat.h>
 #include <linux/ext2_fs.h>
 
+#ifndef S_ISLNK                        /* So we can compile even with gcc-warn */
+# ifdef __S_IFLNK
+#  define S_ISLNK(mode)         __S_ISTYPE((mode), __S_IFLNK)
+# else
+#  define S_ISLNK(mode)  0
+# endif
+#endif
+
 #include "et/com_err.h"
 #include "e2p/e2p.h"