X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Fsbitmap.c;h=689cf97557668b26ac4062b45b9ae83976dd5e0e;hb=9eea98519ce1991e7b67865014b99dd77e6b7114;hp=cab4ec0e0ed4040716a56b33c8c5d664d9326139;hpb=349621f075f6bdfb362a743f4f4d47e0bb53c7c0;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/sbitmap.c b/gcc/sbitmap.c index cab4ec0e0ed..689cf975576 100644 --- a/gcc/sbitmap.c +++ b/gcc/sbitmap.c @@ -79,7 +79,7 @@ sbitmap_alloc (unsigned int n_elms) bytes = size * sizeof (SBITMAP_ELT_TYPE); amt = (sizeof (struct simple_bitmap_def) + bytes - sizeof (SBITMAP_ELT_TYPE)); - bmap = xmalloc (amt); + bmap = (sbitmap) xmalloc (amt); bmap->n_bits = n_elms; bmap->size = size; bmap->popcount = NULL; @@ -92,7 +92,7 @@ sbitmap sbitmap_alloc_with_popcount (unsigned int n_elms) { sbitmap const bmap = sbitmap_alloc (n_elms); - bmap->popcount = xmalloc (bmap->size * sizeof (unsigned char)); + bmap->popcount = XNEWVEC (unsigned char, bmap->size); return bmap; } @@ -112,10 +112,9 @@ sbitmap_resize (sbitmap bmap, unsigned int n_elms, int def) { amt = (sizeof (struct simple_bitmap_def) + bytes - sizeof (SBITMAP_ELT_TYPE)); - bmap = xrealloc (bmap, amt); + bmap = (sbitmap) xrealloc (bmap, amt); if (bmap->popcount) - bmap->popcount = xrealloc (bmap->popcount, - size * sizeof (unsigned char)); + bmap->popcount = XRESIZEVEC (unsigned char, bmap->popcount, size); } if (n_elms > bmap->n_bits) @@ -218,7 +217,7 @@ sbitmap_vector_alloc (unsigned int n_vecs, unsigned int n_elms) } amt = vector_bytes + (n_vecs * elm_bytes); - bitmap_vector = xmalloc (amt); + bitmap_vector = (sbitmap *) xmalloc (amt); for (i = 0, offset = vector_bytes; i < n_vecs; i++, offset += elm_bytes) {