aboutsummaryrefslogtreecommitdiffhomepage
path: root/builtin.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-02-07 22:10:35 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-02-07 22:10:35 -0800
commit006523ac59e42bc4ed2339ef31d2f6b41bdb190e (patch)
tree3786298ddf2451e4fad4033d69d22b15cd40e3d0 /builtin.cpp
parentc0e783eb6e8c12d12c9dfbc62c4d5f820e6df61d (diff)
Replaced void*data with auto_ptr<function_data_t>, eliminating antoher halloc.
Diffstat (limited to 'builtin.cpp')
-rw-r--r--builtin.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin.cpp b/builtin.cpp
index b9b05a79..c1168ae5 100644
--- a/builtin.cpp
+++ b/builtin.cpp
@@ -1792,7 +1792,7 @@ static int builtin_function( parser_t &parser, wchar_t **argv )
}
else
{
- function_data_t * d = (function_data_t *)halloc( parser.current_block, sizeof( function_data_t ));
+ function_data_t *d = new function_data_t();
d->name=halloc_wcsdup( parser.current_block, name);
d->description=desc?halloc_wcsdup( parser.current_block, desc):0;
@@ -1806,7 +1806,7 @@ static int builtin_function( parser_t &parser, wchar_t **argv )
e->function_name = d->name;
}
- parser.current_block->data = d;
+ parser.current_block->function_data.reset(d);
}
@@ -3270,7 +3270,7 @@ static int builtin_end( parser_t &parser, wchar_t **argv )
case FUNCTION_DEF:
{
- function_data_t *d = (function_data_t *)parser.current_block->data;
+ function_data_t *d = parser.current_block->function_data.get();
if( d )
{