+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
#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
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); */
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;
* %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"
+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
#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
}
-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;
#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 {
+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):
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,
/*
* 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;