summaryrefslogtreecommitdiff
path: root/mro.c
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-04-19 17:15:25 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-04-19 17:15:25 +0000
commit9fe4aecf05bd9db46d8bc10b5508a11d745944f5 (patch)
tree3f9eb03a44a47accda6c95a7e79264a5309bdf5c /mro.c
parentcac9886002c78b71182c4087f3db8da5be9364c1 (diff)
downloadperl-9fe4aecf05bd9db46d8bc10b5508a11d745944f5.tar.gz
Use Newxc instead of casting by hand
p4raw-id: //depot/perl@30987
Diffstat (limited to 'mro.c')
-rw-r--r--mro.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/mro.c b/mro.c
index 5c4b1e5cdb..9a750fe0c8 100644
--- a/mro.c
+++ b/mro.c
@@ -26,14 +26,14 @@ These functions are related to the method resolution order of perl classes
struct mro_meta*
Perl_mro_meta_init(pTHX_ HV* stash)
{
- void* newmeta;
+ struct mro_meta* newmeta;
assert(stash);
assert(HvAUX(stash));
assert(!(HvAUX(stash)->xhv_mro_meta));
- Newxz(newmeta, sizeof(struct mro_meta), char);
- HvAUX(stash)->xhv_mro_meta = (struct mro_meta*)newmeta;
- ((struct mro_meta*)newmeta)->sub_generation = 1;
+ Newxc(newmeta, sizeof(struct mro_meta), char, struct mro_meta);
+ HvAUX(stash)->xhv_mro_meta = newmeta;
+ newmeta->sub_generation = 1;
/* Manually flag UNIVERSAL as being universal.
This happens early in perl booting (when universal.c
@@ -54,13 +54,11 @@ Perl_mro_meta_init(pTHX_ HV* stash)
struct mro_meta*
Perl_mro_meta_dup(pTHX_ struct mro_meta* smeta, CLONE_PARAMS* param)
{
- void* newmeta_void;
struct mro_meta* newmeta;
assert(smeta);
- Newx(newmeta_void, sizeof(struct mro_meta), char);
- newmeta = (struct mro_meta*)newmeta_void;
+ Newxc(newmeta, sizeof(struct mro_meta), char, struct mro_meta);
newmeta->mro_which = smeta->mro_which;
newmeta->sub_generation = smeta->sub_generation;