Whamcloud - gitweb
ChangeLog, e2fsck.h, pass1.c, super.c:
authorTheodore Ts'o <tytso@mit.edu>
Thu, 30 Apr 1998 17:35:59 +0000 (17:35 +0000)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 30 Apr 1998 17:35:59 +0000 (17:35 +0000)
  pass1.c (process_inode_cmp): Use EXT2_QSORT_TYPE to define the
   appropriate return type for comparison functions for qsort.
  e2fsck.h: Add #ifdef protection for unistd.h
  super.c: Remove header files already included by e2fsck.h
ChangeLog, dblist.c, ext2fs.h:
  ext2fs.h: Define EXT2_QSORT_TYPE appropriately for the return type for
   comparison functions for qsort.
  dblist.c (dir_block_cmp): Use EXT2_QSORT_TYPE in function declaration.
ChangeLog, extent.c:
  extent.c (ext2fs_create_extent_table): Use ext2fs_free_mem instead of
   free().
  (extent_cmp): Use EXT2_QSORT_TYPE to define the appropriate return
   type for comparison functions for qsort.

e2fsck/ChangeLog
e2fsck/e2fsck.h
e2fsck/pass1.c
e2fsck/super.c
lib/ext2fs/ChangeLog
lib/ext2fs/dblist.c
lib/ext2fs/ext2fs.h
resize/ChangeLog
resize/extent.c

index 298385e..e0a8e00 100644 (file)
@@ -1,3 +1,12 @@
+1998-04-28  Theodore Ts'o  <tytso@rsts-11.mit.edu>
+
+       * pass1.c (process_inode_cmp): Use EXT2_QSORT_TYPE to define the
+               appropriate return type for comparison functions for qsort.
+
+       * e2fsck.h: Add #ifdef protection for unistd.h
+
+       * super.c: Remove header files already included by e2fsck.h
+
 1998-04-26  Theodore Ts'o  <tytso@rsts-11.mit.edu>
 
        * dirinfo.c (e2fsck_add_dir_info): Update function to pass the old
index efb7549..a3e3e58 100644 (file)
@@ -8,7 +8,9 @@
 
 #include <stdio.h>
 #include <string.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 #include <stdlib.h>
 #include <time.h>
 #ifdef HAVE_SYS_TYPES_H
index 2e258d4..3efe086 100644 (file)
@@ -62,7 +62,7 @@ static void alloc_bad_map(e2fsck_t ctx);
 static void alloc_bb_map(e2fsck_t ctx);
 static void handle_fs_bad_blocks(e2fsck_t ctx);
 static void process_inodes(e2fsck_t ctx, char *block_buf);
-static int process_inode_cmp(const void *a, const void *b);
+static EXT2_QSORT_TYPE process_inode_cmp(const void *a, const void *b);
 static errcode_t scan_callback(ext2_filsys fs, ext2_inode_scan scan,
                                  dgrp_t group, void * priv_data);
 /* static char *describe_illegal_block(ext2_filsys fs, blk_t block); */
@@ -592,7 +592,7 @@ static void process_inodes(e2fsck_t ctx, char *block_buf)
        ehandler_operation(old_operation);
 }
 
-static int process_inode_cmp(const void *a, const void *b)
+static EXT2_QSORT_TYPE process_inode_cmp(const void *a, const void *b)
 {
        const struct process_inode_block *ib_a =
                (const struct process_inode_block *) a;
index 62038be..f5dc7f2 100644 (file)
@@ -9,22 +9,9 @@
  * %End-Header%
  */
 
-#include <stdio.h>
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#include <string.h>
-#include <time.h>
-#ifdef HAVE_GETOPT_H
-#include <getopt.h>
-#endif
-#include <unistd.h>
 #ifdef HAVE_ERRNO_H
 #include <errno.h>
 #endif
-#ifdef HAVE_MNTENT_H
-#include <mntent.h>
-#endif
 
 #ifndef EXT2_SKIP_UUID
 #include "uuid/uuid.h"
index 9fcb3ce..80e054a 100644 (file)
@@ -1,3 +1,11 @@
+1998-04-28  Theodore Ts'o  <tytso@rsts-11.mit.edu>
+
+       * ext2fs.h: Define EXT2_QSORT_TYPE appropriately for the
+               return type for comparison functions for qsort.
+
+       * dblist.c (dir_block_cmp): Use EXT2_QSORT_TYPE in function
+               declaration.
+
 1998-04-26  Theodore Ts'o  <tytso@rsts-11.mit.edu>
 
        * ext2fs.h, bitops.h: Add support for the Watcom C compiler to do
index 9683ef1..b636584 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "ext2fsP.h"
 
-static int dir_block_cmp(const void *a, const void *b);
+static EXT2_QSORT_TYPE dir_block_cmp(const void *a, const void *b);
 
 /*
  * Returns the number of directories in the filesystem as reported by
@@ -234,7 +234,7 @@ errcode_t ext2fs_dblist_iterate(ext2_dblist dblist,
 }
 
 
-static int dir_block_cmp(const void *a, const void *b)
+static EXT2_QSORT_TYPE dir_block_cmp(const void *a, const void *b)
 {
        const struct ext2_db_entry *db_a =
                (const struct ext2_db_entry *) a;
index 6c84517..83ca4df 100644 (file)
@@ -66,6 +66,15 @@ typedef __s64                blkcnt_t;
 #include "ext2fs/ext2_err.h"
 #endif
 
+/*
+ * Portability help for Microsoft Visual C++
+ */
+#ifdef _MSC_VER
+#define EXT2_QSORT_TYPE int __cdecl
+#else
+#define EXT2_QSORT_TYPE int
+#endif
+
 typedef struct struct_ext2_filsys *ext2_filsys;
 
 struct ext2fs_struct_generic_bitmap {
index 4b85202..1a632fb 100644 (file)
@@ -1,3 +1,10 @@
+1998-04-28  Theodore Ts'o  <tytso@rsts-11.mit.edu>
+
+       * extent.c (ext2fs_create_extent_table): Use ext2fs_free_mem
+               instead of free().
+         (extent_cmp): Use EXT2_QSORT_TYPE to define the appropriate
+               return type for comparison functions for qsort.
+
 1998-04-26  Theodore Ts'o  <tytso@rsts-11.mit.edu>
 
        * resize2fs.c (adjust_superblock): 
index b583baa..dbd6022 100644 (file)
@@ -49,7 +49,7 @@ errcode_t ext2fs_create_extent_table(ext2_extent *ret_extent, int size)
        retval = ext2fs_get_mem(sizeof(struct ext2_extent_entry) *
                                extent->size, (void **) &extent->list);
        if (retval) {
-               free(extent);
+               ext2fs_free_mem((void **) &extent);
                return retval;
        }
        memset(extent->list, 0,
@@ -121,7 +121,7 @@ errcode_t ext2fs_add_extent_entry(ext2_extent extent, __u32 old_loc, __u32 new_l
 /*
  * Helper function for qsort
  */
-static int extent_cmp(const void *a, const void *b)
+static EXT2_QSORT_TYPE extent_cmp(const void *a, const void *b)
 {
        const struct ext2_extent_entry *db_a;
        const struct ext2_extent_entry *db_b;