mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-12 02:43:14 +01:00
Change custom allocator new size argument to size_t instead of uint. See #175.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user