Change custom allocator new size argument to size_t instead of uint. See #175.

This commit is contained in:
Christian Kamm
2009-01-18 13:10:19 +01:00
parent 4042f90800
commit 4e05607355
2 changed files with 5 additions and 5 deletions

View File

@@ -3617,8 +3617,8 @@ Lagain:
if (cd->aggNew)
{
// Prepend the uint size argument to newargs[]
Expression *e = new IntegerExp(loc, cd->size(loc), Type::tuns32);
// Prepend the size_t size argument to newargs[]
Expression *e = new IntegerExp(loc, cd->size(loc), Type::tsize_t);
if (!newargs)
newargs = new Expressions();
newargs->shift(e);

View File

@@ -2818,13 +2818,13 @@ void NewDeclaration::semantic(Scope *sc)
TypeFunction *tf = (TypeFunction *)type;
if (Argument::dim(tf->parameters) < 1)
{
error("at least one argument of type uint expected");
error("at least one argument of type size_t expected");
}
else
{
Argument *a = Argument::getNth(tf->parameters, 0);
if (!a->type->equals(Type::tuns32))
error("first argument must be type uint, not %s", a->type->toChars());
if (!a->type->equals(Type::tsize_t))
error("first argument must be type size_t, not %s", a->type->toChars());
}
FuncDeclaration::semantic(sc);