Skip to content

Commit

Permalink
Update library return types to match druntime.
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuclaw committed Jun 17, 2013
1 parent 2aaa85e commit 40491f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/mtype.c
Expand Up @@ -3518,7 +3518,7 @@ Expression *TypeArray::dotExp(Scope *sc, Expression *e, Identifier *ident, int f
static const char *name[2] = { "_adReverseChar", "_adReverseWchar" };

const char *nm = name[n->ty == Twchar];
FuncDeclaration *fd = FuncDeclaration::genCfunc(Type::tindex, nm);
FuncDeclaration *fd = FuncDeclaration::genCfunc(n->arrayOf(), nm);
Expression *ec = new VarExp(Loc(), fd);
e = e->castTo(sc, n->arrayOf()); // convert to dynamic array
Expressions *arguments = new Expressions();
Expand All @@ -3529,7 +3529,7 @@ Expression *TypeArray::dotExp(Scope *sc, Expression *e, Identifier *ident, int f
else if (ident == Id::sort && (n->ty == Tchar || n->ty == Twchar))
{
const char *nm = n->ty == Twchar ? "_adSortWchar" : "_adSortChar";
FuncDeclaration *fd = FuncDeclaration::genCfunc(Type::tindex, nm);
FuncDeclaration *fd = FuncDeclaration::genCfunc(n->arrayOf(), nm);
Expression *ec = new VarExp(Loc(), fd);
e = e->castTo(sc, n->arrayOf()); // convert to dynamic array
Expressions *arguments = new Expressions();
Expand All @@ -3548,7 +3548,7 @@ Expression *TypeArray::dotExp(Scope *sc, Expression *e, Identifier *ident, int f
Expression *olde = e;
assert(size);
dup = (ident == Id::dup || ident == Id::idup);
fd = FuncDeclaration::genCfunc(Type::tindex, dup ? Id::adDup : Id::adReverse);
fd = FuncDeclaration::genCfunc(tvoid->arrayOf(), dup ? Id::adDup : Id::adReverse);
ec = new VarExp(Loc(), fd);
e = e->castTo(sc, n->arrayOf()); // convert to dynamic array
arguments = new Expressions();
Expand Down Expand Up @@ -3586,7 +3586,7 @@ Expression *TypeArray::dotExp(Scope *sc, Expression *e, Identifier *ident, int f
FuncDeclaration *fd;
Expressions *arguments;

fd = FuncDeclaration::genCfunc(tint32->arrayOf(), "_adSort");
fd = FuncDeclaration::genCfunc(tvoid->arrayOf(), "_adSort");
ec = new VarExp(Loc(), fd);
e = e->castTo(sc, n->arrayOf()); // convert to dynamic array
arguments = new Expressions();
Expand Down
6 changes: 3 additions & 3 deletions src/statement.c
Expand Up @@ -2072,9 +2072,9 @@ Statement *ForeachStatement::semantic(Scope *sc)
*/
FuncDeclaration *fdapply;
if (dim == 2)
fdapply = FuncDeclaration::genCfunc(Type::tindex, "_aaApply2");
fdapply = FuncDeclaration::genCfunc(Type::tint32, "_aaApply2");
else
fdapply = FuncDeclaration::genCfunc(Type::tindex, "_aaApply");
fdapply = FuncDeclaration::genCfunc(Type::tint32, "_aaApply");
ec = new VarExp(Loc(), fdapply);
Expressions *exps = new Expressions();
exps->push(aggr);
Expand Down Expand Up @@ -2115,7 +2115,7 @@ Statement *ForeachStatement::semantic(Scope *sc)
const char *r = (op == TOKforeach_reverse) ? "R" : "";
int j = sprintf(fdname, "_aApply%s%.*s%llu", r, 2, fntab[flag], (ulonglong)dim);
assert(j < sizeof(fdname) / sizeof(fdname[0]));
FuncDeclaration *fdapply = FuncDeclaration::genCfunc(Type::tindex, fdname);
FuncDeclaration *fdapply = FuncDeclaration::genCfunc(Type::tint32, fdname);

ec = new VarExp(Loc(), fdapply);
Expressions *exps = new Expressions();
Expand Down

0 comments on commit 40491f0

Please sign in to comment.