~csurbhi/ubuntu/maverick/e2fsprogs/e2fsprogs.fix-505719

« back to all changes in this revision

Viewing changes to e2fsck/ea_refcount.c

  • Committer: Bazaar Package Importer
  • Author(s): Matt Zimmerman
  • Date: 2004-09-19 09:43:14 UTC
  • mto: (8.1.1 lenny) (1.2.3 upstream)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20040919094314-2tafd19i76fhu6ei
Tags: upstream-1.35
ImportĀ upstreamĀ versionĀ 1.35

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
struct ea_refcount {
29
29
        blk_t           count;
30
30
        blk_t           size;
31
 
        int             cursor;
 
31
        blk_t           cursor;
32
32
        struct ea_refcount_el   *list;
33
33
};
34
34
 
38
38
                return;
39
39
 
40
40
        if (refcount->list)
41
 
                ext2fs_free_mem((void **) &refcount->list);
42
 
        ext2fs_free_mem((void **) &refcount);
 
41
                ext2fs_free_mem(&refcount->list);
 
42
        ext2fs_free_mem(&refcount);
43
43
}
44
44
 
45
45
errcode_t ea_refcount_create(int size, ext2_refcount_t *ret)
48
48
        errcode_t       retval;
49
49
        size_t          bytes;
50
50
 
51
 
        retval = ext2fs_get_mem(sizeof(struct ea_refcount),
52
 
                                (void **) &refcount);
 
51
        retval = ext2fs_get_mem(sizeof(struct ea_refcount), &refcount);
53
52
        if (retval)
54
53
                return retval;
55
54
        memset(refcount, 0, sizeof(struct ea_refcount));
62
61
        printf("Refcount allocated %d entries, %d bytes.\n",
63
62
               refcount->size, bytes);
64
63
#endif
65
 
        retval = ext2fs_get_mem(bytes, (void **) &refcount->list);
 
64
        retval = ext2fs_get_mem(bytes, &refcount->list);
66
65
        if (retval)
67
66
                goto errout;
68
67
        memset(refcount->list, 0, bytes);
84
83
 */
85
84
static void refcount_collapse(ext2_refcount_t refcount)
86
85
{
87
 
        int     i, j;
 
86
        unsigned int    i, j;
88
87
        struct ea_refcount_el   *list;
89
88
 
90
89
        list = refcount->list;
124
123
                                           sizeof(struct ea_refcount_el),
125
124
                                           (size_t) new_size *
126
125
                                           sizeof(struct ea_refcount_el),
127
 
                                           (void **) &refcount->list);
 
126
                                           &refcount->list);
128
127
                if (retval)
129
128
                        return 0;
130
129
                refcount->size = new_size;