]> git.ipfire.org Git - thirdparty/e2fsprogs.git/blobdiff - resize/sim_progress.c
resize2fs: moving xattr inodes is not supported
[thirdparty/e2fsprogs.git] / resize / sim_progress.c
index 850c860b39e3a2ab80c5ff3ccea118cf609bbb09..d4206ba2814afee7717aed116ffd5eaaa7e38d0b 100644 (file)
@@ -1,7 +1,18 @@
 /*
  * sim_progress.c --- simple progress meter
+ *
+ * Copyright (C) 1997, 1998 by Theodore Ts'o and
+ *     PowerQuest, Inc.
+ *
+ * Copyright (C) 1999, 2000 by Theosore Ts'o
+ *
+ * %Begin-Header%
+ * This file may be redistributed under the terms of the GNU Public
+ * License.
+ * %End-Header%
  */
 
+#include "config.h"
 #include "resize2fs.h"
 
 struct ext2_sim_progress {
@@ -48,7 +59,7 @@ void ext2fs_progress_update(ext2_sim_progmeter prog, __u32 current)
        num = level - old_level;
        if (num == 0)
                return;
-       
+
        if (num > 0) {
                for (i=0; i < num; i++)
                        putc('X', prog->f);
@@ -72,13 +83,12 @@ errcode_t ext2fs_progress_init(ext2_sim_progmeter *ret_prog,
        ext2_sim_progmeter      prog;
        errcode_t               retval;
 
-       retval = ext2fs_get_mem(sizeof(struct ext2_sim_progress),
-                               (void **) &prog);
-       if (!prog)
+       retval = ext2fs_get_mem(sizeof(struct ext2_sim_progress), &prog);
+       if (retval)
                return retval;
        memset(prog, 0, sizeof(struct ext2_sim_progress));
 
-       retval = ext2fs_get_mem(strlen(label)+1, (void **) &prog->label);
+       retval = ext2fs_get_mem(strlen(label)+1, &prog->label);
        if (retval) {
                free(prog);
                return retval;
@@ -91,7 +101,7 @@ errcode_t ext2fs_progress_init(ext2_sim_progmeter *ret_prog,
        prog->current = 0;
        prog->shown = 0;
        prog->f = stdout;
-       
+
        *ret_prog = prog;
 
        return ext2fs_progress_display(prog);
@@ -101,8 +111,8 @@ void ext2fs_progress_close(ext2_sim_progmeter prog)
 {
 
        if (prog->label)
-               ext2fs_free_mem((void **) &prog->label);
-       ext2fs_free_mem((void **) &prog);
+               ext2fs_free_mem(&prog->label);
+       ext2fs_free_mem(&prog);
        printf("\n");
        return;
 }