diff -uNr dmd-0.149/dmd/src/dmd/aggregate.h dmd-0.150/dmd/src/dmd/aggregate.h
--- dmd-0.149/dmd/src/dmd/aggregate.h 2006-02-21 21:53:28.000000000 +0100
+++ dmd-0.150/dmd/src/dmd/aggregate.h 2006-03-12 11:59:56.000000000 +0100
@@ -146,7 +146,7 @@
BaseClass(Type *type, enum PROT protection);
int fillVtbl(ClassDeclaration *cd, Array *vtbl, int newinstance);
- void copyBaseInterfaces(Array *);
+ void copyBaseInterfaces(BaseClasses *);
};
#define CLASSINFO_SIZE 0x3C // value of ClassInfo.size
@@ -162,14 +162,14 @@
FuncDeclaration *staticDtor;
Array vtbl; // Array of FuncDeclaration's making up the vtbl[]
- Array baseclasses; // Array of BaseClass's; first is super,
+ BaseClasses baseclasses; // Array of BaseClass's; first is super,
// rest are Interface's
int interfaces_dim;
BaseClass **interfaces; // interfaces[interfaces_dim] for this class
// (does not include baseClass)
- Array *vtblInterfaces; // array of base interfaces that have
+ BaseClasses *vtblInterfaces; // array of base interfaces that have
// their own vtbl[]
ClassInfoDeclaration *vclassinfo; // the ClassInfo object for this ClassDeclaration
@@ -180,7 +180,7 @@
int isnested; // !=0 if is nested
VarDeclaration *vthis; // 'this' parameter if this class is nested
- ClassDeclaration(Loc loc, Identifier *id, Array *baseclasses);
+ ClassDeclaration(Loc loc, Identifier *id, BaseClasses *baseclasses);
Dsymbol *syntaxCopy(Dsymbol *s);
void semantic(Scope *sc);
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
@@ -202,7 +202,7 @@
PROT getAccess(Dsymbol *smember); // determine access to smember
- void addLocalClass(Array *);
+ void addLocalClass(ClassDeclarations *);
// Back end
void toObjFile(); // compile to .obj file
@@ -220,7 +220,7 @@
struct InterfaceDeclaration : ClassDeclaration
{
- InterfaceDeclaration(Loc loc, Identifier *id, Array *baseclasses);
+ InterfaceDeclaration(Loc loc, Identifier *id, BaseClasses *baseclasses);
Dsymbol *syntaxCopy(Dsymbol *s);
void semantic(Scope *sc);
int isBaseOf(ClassDeclaration *cd, int *poffset);
diff -uNr dmd-0.149/dmd/src/dmd/attrib.c dmd-0.150/dmd/src/dmd/attrib.c
--- dmd-0.149/dmd/src/dmd/attrib.c 2006-02-27 22:32:42.000000000 +0100
+++ dmd-0.150/dmd/src/dmd/attrib.c 2006-03-12 12:00:34.000000000 +0100
@@ -238,7 +238,7 @@
/****************************************
*/
-void AttribDeclaration::addLocalClass(Array *aclasses)
+void AttribDeclaration::addLocalClass(ClassDeclarations *aclasses)
{ unsigned i;
Array *d = include(NULL, NULL);
@@ -657,7 +657,7 @@
/********************************* PragmaDeclaration ****************************/
-PragmaDeclaration::PragmaDeclaration(Loc loc, Identifier *ident, Array *args, Array *decl)
+PragmaDeclaration::PragmaDeclaration(Loc loc, Identifier *ident, Expressions *args, Array *decl)
: AttribDeclaration(decl)
{
this->loc = loc;
diff -uNr dmd-0.149/dmd/src/dmd/attrib.h dmd-0.150/dmd/src/dmd/attrib.h
--- dmd-0.149/dmd/src/dmd/attrib.h 2006-02-27 22:26:38.000000000 +0100
+++ dmd-0.150/dmd/src/dmd/attrib.h 2006-03-12 12:00:12.000000000 +0100
@@ -1,5 +1,5 @@
-// Copyright (c) 1999-2002 by Digital Mars
+// Copyright (c) 1999-2006 by Digital Mars
// All Rights Reserved
// written by Walter Bright
// www.digitalmars.com
@@ -44,7 +44,7 @@
char *kind();
int oneMember(Dsymbol **ps);
void checkCtorConstInit();
- void addLocalClass(Array *);
+ void addLocalClass(ClassDeclarations *);
void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
AttribDeclaration *isAttribDeclaration() { return this; }
@@ -107,9 +107,9 @@
struct PragmaDeclaration : AttribDeclaration
{
- Array *args; // array of Expression's
+ Expressions *args; // array of Expression's
- PragmaDeclaration(Loc loc, Identifier *ident, Array *args, Array *decl);
+ PragmaDeclaration(Loc loc, Identifier *ident, Expressions *args, Array *decl);
Dsymbol *syntaxCopy(Dsymbol *s);
void semantic(Scope *sc);
int oneMember(Dsymbol **ps);
diff -uNr dmd-0.149/dmd/src/dmd/cast.c dmd-0.150/dmd/src/dmd/cast.c
--- dmd-0.149/dmd/src/dmd/cast.c 2006-03-05 00:57:24.000000000 +0100
+++ dmd-0.150/dmd/src/dmd/cast.c 2006-03-12 23:51:58.000000000 +0100
@@ -786,6 +786,7 @@
toChars(), type->toChars(), t->toChars());
#endif
Expression *e = this;
+ static char msg[] = "cannot form delegate due to covariant return type";
tb = t->toBasetype();
type = type->toBasetype();
@@ -802,14 +803,23 @@
f = func->overloadExactMatch(tb->next);
if (f)
{
+ if (f->tintro)
+ error(msg);
e = new DelegateExp(loc, e1, f);
e->type = t;
return e;
}
+ if (func->tintro)
+ error(msg);
}
}
e = Expression::castTo(t);
}
+ else
+ {
+ if (func->tintro)
+ error(msg);
+ }
e->type = t;
return e;
}
diff -uNr dmd-0.149/dmd/src/dmd/class.c dmd-0.150/dmd/src/dmd/class.c
--- dmd-0.149/dmd/src/dmd/class.c 2006-02-13 23:01:56.000000000 +0100
+++ dmd-0.150/dmd/src/dmd/class.c 2006-03-18 15:14:20.000000000 +0100
@@ -1,6 +1,5 @@
-
-// Copyright (c) 1999-2004 by Digital Mars
+// Copyright (c) 1999-2006 by Digital Mars
// All Rights Reserved
// written by Walter Bright
// www.digitalmars.com
@@ -31,7 +30,7 @@
ClassDeclaration *ClassDeclaration::classinfo;
-ClassDeclaration::ClassDeclaration(Loc loc, Identifier *id, Array *baseclasses)
+ClassDeclaration::ClassDeclaration(Loc loc, Identifier *id, BaseClasses *baseclasses)
: AggregateDeclaration(loc, id)
{
if (baseclasses)
@@ -451,7 +450,7 @@
{
//printf("Creating default this(){} for class %s\n", toChars());
ctor = new CtorDeclaration(0, 0, NULL, 0);
- ctor->fbody = new CompoundStatement(0, new Array());
+ ctor->fbody = new CompoundStatement(0, new Statements());
members->push(ctor);
ctor->addMember(sc, this, 1);
*sc = scsave;
@@ -645,15 +644,21 @@
FuncDeclaration *ClassDeclaration::findFunc(Identifier *ident, TypeFunction *tf)
{
- unsigned i;
+ //printf("ClassDeclaration::findFunc(%s, %s) %s\n", ident->toChars(), tf->toChars(), toChars());
- for (i = 0; i < vtbl.dim; i++)
+ for (size_t i = 0; i < vtbl.dim; i++)
{
FuncDeclaration *fd = (FuncDeclaration *)vtbl.data[i];
+ //printf("\t[%d] = %s\n", i, fd->toChars());
if (ident == fd->ident &&
- tf->equals(fd->type))
+ //tf->equals(fd->type)
+ fd->type->covariant(tf) == 1
+ )
+ { //printf("\t\tfound\n");
return fd;
+ }
+ //else printf("\t\t%d\n", fd->type->covariant(tf));
}
return NULL;
@@ -662,7 +667,7 @@
void ClassDeclaration::interfaceSemantic(Scope *sc)
{ int i;
- vtblInterfaces = new Array();
+ vtblInterfaces = new BaseClasses();
vtblInterfaces->reserve(interfaces_dim);
for (i = 0; i < interfaces_dim; i++)
@@ -742,14 +747,14 @@
/****************************************
*/
-void ClassDeclaration::addLocalClass(Array *aclasses)
+void ClassDeclaration::addLocalClass(ClassDeclarations *aclasses)
{
aclasses->push(this);
}
/********************************* InterfaceDeclaration ****************************/
-InterfaceDeclaration::InterfaceDeclaration(Loc loc, Identifier *id, Array *baseclasses)
+InterfaceDeclaration::InterfaceDeclaration(Loc loc, Identifier *id, BaseClasses *baseclasses)
: ClassDeclaration(loc, id, baseclasses)
{
com = 0;
@@ -1081,7 +1086,7 @@
return result;
}
-void BaseClass::copyBaseInterfaces(Array *vtblInterfaces)
+void BaseClass::copyBaseInterfaces(BaseClasses *vtblInterfaces)
{
//printf("+copyBaseInterfaces(), %s\n", base->toChars());
// if (baseInterfaces_dim)
diff -uNr dmd-0.149/dmd/src/dmd/cond.c dmd-0.150/dmd/src/dmd/cond.c
--- dmd-0.149/dmd/src/dmd/cond.c 2006-03-03 01:40:08.000000000 +0100
+++ dmd-0.150/dmd/src/dmd/cond.c 2006-03-07 17:56:24.000000000 +0100
@@ -309,7 +309,7 @@
MATCH m;
TemplateTypeParameter tp(loc, id, NULL, NULL);
- Array parameters;
+ TemplateParameters parameters;
parameters.setDim(1);
parameters.data[0] = (void *)&tp;
diff -uNr dmd-0.149/dmd/src/dmd/constfold.c dmd-0.150/dmd/src/dmd/constfold.c
--- dmd-0.149/dmd/src/dmd/constfold.c 2006-02-24 00:30:44.000000000 +0100
+++ dmd-0.150/dmd/src/dmd/constfold.c 2006-03-18 12:06:34.000000000 +0100
@@ -229,7 +229,58 @@
}
else if (type->iscomplex())
{
- e = new ComplexExp(loc, e1->toComplex() + e2->toComplex(), type);
+ // This rigamarole is necessary so that -0.0 doesn't get
+ // converted to +0.0 by doing an extraneous add with +0.0
+ complex_t c1;
+ real_t r1;
+ real_t i1;
+
+ complex_t c2;
+ real_t r2;
+ real_t i2;
+
+ complex_t v;
+ int x;
+
+ if (e1->type->isreal())
+ { r1 = e1->toReal();
+ x = 0;
+ }
+ else if (e1->type->isimaginary())
+ { i1 = e1->toImaginary();
+ x = 3;
+ }
+ else
+ { c1 = e1->toComplex();
+ x = 6;
+ }
+
+ if (e2->type->isreal())
+ { r2 = e2->toReal();
+ }
+ else if (e2->type->isimaginary())
+ { i2 = e2->toImaginary();
+ x += 1;
+ }
+ else
+ { c2 = e2->toComplex();
+ x += 2;
+ }
+
+ switch (x)
+ {
+ case 0+0: v = (complex_t) (r1 + r2); break;
+ case 0+1: v = r1 + i2 * I; break;
+ case 0+2: v = r1 + c2; break;
+ case 3+0: v = i1 * I + r2; break;
+ case 3+1: v = (complex_t) ((i1 + i2) * I); break;
+ case 3+2: v = i1 * I + c2; break;
+ case 6+0: v = c1 + r2; break;
+ case 6+1: v = c1 + i2 * I; break;
+ case 6+2: v = c1 + c2; break;
+ default: assert(0);
+ }
+ e = new ComplexExp(loc, v, type);
}
else if (e1->op == TOKsymoff)
{
@@ -266,7 +317,58 @@
}
else if (type->iscomplex())
{
- e = new ComplexExp(loc, e1->toComplex() - e2->toComplex(), type);
+ // This rigamarole is necessary so that -0.0 doesn't get
+ // converted to +0.0 by doing an extraneous add with +0.0
+ complex_t c1;
+ real_t r1;
+ real_t i1;
+
+ complex_t c2;
+ real_t r2;
+ real_t i2;
+
+ complex_t v;
+ int x;
+
+ if (e1->type->isreal())
+ { r1 = e1->toReal();
+ x = 0;
+ }
+ else if (e1->type->isimaginary())
+ { i1 = e1->toImaginary();
+ x = 3;
+ }
+ else
+ { c1 = e1->toComplex();
+ x = 6;
+ }
+
+ if (e2->type->isreal())
+ { r2 = e2->toReal();
+ }
+ else if (e2->type->isimaginary())
+ { i2 = e2->toImaginary();
+ x += 1;
+ }
+ else
+ { c2 = e2->toComplex();
+ x += 2;
+ }
+
+ switch (x)
+ {
+ case 0+0: v = (complex_t) (r1 - r2); break;
+ case 0+1: v = r1 - i2 * I; break;
+ case 0+2: v = r1 - c2; break;
+ case 3+0: v = i1 * I - r2; break;
+ case 3+1: v = (complex_t) ((i1 - i2) * I); break;
+ case 3+2: v = i1 * I - c2; break;
+ case 6+0: v = c1 - r2; break;
+ case 6+1: v = c1 - i2 * I; break;
+ case 6+2: v = c1 - c2; break;
+ default: assert(0);
+ }
+ e = new ComplexExp(loc, v, type);
}
else if (e1->op == TOKsymoff)
{
diff -uNr dmd-0.149/dmd/src/dmd/declaration.c dmd-0.150/dmd/src/dmd/declaration.c
--- dmd-0.149/dmd/src/dmd/declaration.c 2006-02-20 13:02:02.000000000 +0100
+++ dmd-0.150/dmd/src/dmd/declaration.c 2006-03-07 18:04:42.000000000 +0100
@@ -843,7 +843,7 @@
{ FuncDeclaration *fd;
Expression *efd;
Expression *ec;
- Array *arguments;
+ Expressions *arguments;
/* Generate:
* _d_callfinalizer(this)
@@ -851,7 +851,7 @@
fd = FuncDeclaration::genCfunc(Type::tvoid, "_d_callfinalizer");
efd = new VarExp(loc, fd);
ec = new VarExp(loc, this);
- arguments = new Array();
+ arguments = new Expressions();
arguments->push(ec);
e = new CallExp(loc, efd, arguments);
e->type = fd->type->next;
diff -uNr dmd-0.149/dmd/src/dmd/declaration.h dmd-0.150/dmd/src/dmd/declaration.h
--- dmd-0.149/dmd/src/dmd/declaration.h 2006-02-12 22:03:50.000000000 +0100
+++ dmd-0.150/dmd/src/dmd/declaration.h 2006-03-12 13:36:32.000000000 +0100
@@ -65,7 +65,7 @@
FuncDeclaration *anyf; // pick a func, any func, to use for error recovery
};
-void overloadResolveX(Match *m, FuncDeclaration *f, Array *arguments);
+void overloadResolveX(Match *m, FuncDeclaration *f, Expressions *arguments);
/**************************************************************/
@@ -368,8 +368,11 @@
int inlineNest; // !=0 if nested inline
int semanticRun; // !=0 if semantic3() had been run
int nestedFrameRef; // !=0 if nested variables referenced frame ptr
- int introducing; // !=0 if 'introducing' function
ForeachStatement *fes; // if foreach body, this is the foreach
+ int introducing; // !=0 if 'introducing' function
+ Type *tintro; // if !=NULL, then this is the type
+ // of the 'introducing' function
+ // this one is overriding
// Things that should really go into Scope
int hasReturnExp; // if there's a return exp; statement
@@ -383,7 +386,7 @@
int overrides(FuncDeclaration *fd);
int overloadInsert(Dsymbol *s);
FuncDeclaration *overloadExactMatch(Type *t);
- FuncDeclaration *overloadResolve(Loc loc, Array *arguments);
+ FuncDeclaration *overloadResolve(Loc loc, Expressions *arguments);
LabelDsymbol *searchLabel(Identifier *ident);
AggregateDeclaration *isThis();
AggregateDeclaration *isMember2();
diff -uNr dmd-0.149/dmd/src/dmd/doc.c dmd-0.150/dmd/src/dmd/doc.c
--- dmd-0.149/dmd/src/dmd/doc.c 2006-02-12 22:05:04.000000000 +0100
+++ dmd-0.150/dmd/src/dmd/doc.c 2006-03-08 10:34:28.000000000 +0100
@@ -418,6 +418,7 @@
void Declaration::emitComment(Scope *sc)
{
//printf("Declaration::emitComment(%p '%s'), comment = '%s'\n", this, toChars(), comment);
+ //printf("type = %p\n", type);
if (protection == PROTprivate || !ident ||
(!type && !isCtorDeclaration()))
@@ -599,6 +600,7 @@
void Declaration::toDocBuffer(OutBuffer *buf)
{
+ //printf("Declaration::toDocbuffer()\n");
if (ident)
{
if (isDeprecated())
@@ -615,8 +617,11 @@
buf->writestring("synchronized ");
if (type)
{ HdrGenState hgs;
+ hgs.ddoc = 1;
type->toCBuffer(buf, ident, &hgs);
}
+ else
+ buf->writestring(ident->toChars());
buf->writestring(";\n");
}
}
diff -uNr dmd-0.149/dmd/src/dmd/dsymbol.h dmd-0.150/dmd/src/dmd/dsymbol.h
--- dmd-0.149/dmd/src/dmd/dsymbol.h 2006-02-27 22:26:16.000000000 +0100
+++ dmd-0.150/dmd/src/dmd/dsymbol.h 2006-03-12 12:02:22.000000000 +0100
@@ -18,6 +18,7 @@
#include "stringtable.h"
#include "mars.h"
+#include "arraytypes.h"
struct Identifier;
struct Scope;
@@ -142,7 +143,7 @@
virtual Dsymbol *syntaxCopy(Dsymbol *s); // copy only syntax trees
virtual int oneMember(Dsymbol **ps);
static int oneMembers(Array *members, Dsymbol **ps);
- virtual void addLocalClass(Array *) { }
+ virtual void addLocalClass(ClassDeclarations *) { }
virtual void checkCtorConstInit() { }
virtual void addComment(unsigned char *comment);
diff -uNr dmd-0.149/dmd/src/dmd/expression.c dmd-0.150/dmd/src/dmd/expression.c
--- dmd-0.149/dmd/src/dmd/expression.c 2006-03-06 21:00:38.000000000 +0100
+++ dmd-0.150/dmd/src/dmd/expression.c 2006-03-12 18:47:56.000000000 +0100
@@ -3069,7 +3069,7 @@
MATCH m;
TemplateTypeParameter tp(loc, id, NULL, NULL);
- Array parameters;
+ TemplateParameters parameters;
parameters.setDim(1);
parameters.data[0] = (void *)&tp;
@@ -3995,6 +3995,7 @@
}
Lagain:
+ f = NULL;
if (e1->op == TOKthis || e1->op == TOKsuper)
{
// semantic() run later for these
@@ -4275,6 +4276,13 @@
functionArguments(loc, sc, tf, arguments);
assert(type);
+
+ if (f && f->tintro)
+ { Type *t = type;
+ type = f->tintro->next;
+ return castTo(t);
+ }
+
return this;
}
@@ -5253,7 +5261,7 @@
fd = search_function(ad, Id::indexass);
if (fd)
{ Expression *e = new DotIdExp(loc, ae->e1, Id::indexass);
- Expressions *a = ae->arguments->copy();
+ Expressions *a = (Expressions *)ae->arguments->copy();
a->insert(0, e2);
e = new CallExp(loc, e, a);
diff -uNr dmd-0.149/dmd/src/dmd/expression.h dmd-0.150/dmd/src/dmd/expression.h
--- dmd-0.149/dmd/src/dmd/expression.h 2006-03-06 20:54:38.000000000 +0100
+++ dmd-0.150/dmd/src/dmd/expression.h 2006-03-07 18:44:50.000000000 +0100
@@ -13,6 +13,7 @@
#include "mars.h"
#include "identifier.h"
#include "lexer.h"
+#include "arraytypes.h"
struct Type;
struct Scope;
@@ -42,8 +43,6 @@
struct IRState;
struct dt_t;
-typedef Array Expressions;
-
#ifdef IN_GCC
union tree_node; typedef union tree_node elem;
#else
diff -uNr dmd-0.149/dmd/src/dmd/func.c dmd-0.150/dmd/src/dmd/func.c
--- dmd-0.149/dmd/src/dmd/func.c 2006-03-01 11:09:14.000000000 +0100
+++ dmd-0.150/dmd/src/dmd/func.c 2006-03-18 15:14:02.000000000 +0100
@@ -62,8 +62,9 @@
inlineAsm = 0;
semanticRun = 0;
nestedFrameRef = 0;
- introducing = 0;
fes = NULL;
+ introducing = 0;
+ tintro = NULL;
}
Dsymbol *FuncDeclaration::syntaxCopy(Dsymbol *s)
@@ -276,6 +277,28 @@
}
cd->vtbl.data[vi] = (void *)this;
vtblIndex = vi;
+
+ /* This works by whenever this function is called,
+ * it actually returns tintro, which gets dynamically
+ * cast to type. But we know that tintro is a base
+ * of type, so we could optimize it by not doing a
+ * dynamic cast, but just subtracting the isBaseOf()
+ * offset if the value is != null.
+ */
+
+ if (fdv->tintro)
+ tintro = fdv->tintro;
+ else if (!type->equals(fdv->type))
+ {
+ /* Only need to have a tintro if the vptr
+ * offsets differ
+ */
+ int offset;
+ if (fdv->type->next->isBaseOf(type->next, &offset) && offset)
+ {
+ tintro = fdv->type;
+ }
+ }
goto L1;
}
}
@@ -296,6 +319,51 @@
}
L1: ;
+
+ /* Go through all the interface bases.
+ * If this function is covariant with any members of those interface
+ * functions, set the tintro.
+ */
+ for (int i = 0; i < cd->interfaces_dim; i++)
+ {
+ BaseClass *b = cd->interfaces[i];
+ for (vi = 0; vi < b->base->vtbl.dim; vi++)
+ {
+ Dsymbol *s = (Dsymbol *)b->base->vtbl.data[vi];
+ //printf("[%d] %p %s\n", vi, s, s->toChars());
+ FuncDeclaration *fdv = s->isFuncDeclaration();
+ if (fdv && fdv->ident == ident)
+ {
+ int cov = type->covariant(fdv->type);
+ if (cov == 1)
+ { Type *ti = NULL;
+
+ if (fdv->tintro)
+ ti = fdv->tintro;
+ else if (!type->equals(fdv->type))
+ {
+ /* Only need to have a tintro if the vptr
+ * offsets differ
+ */
+ int offset;
+ if (fdv->type->next->isBaseOf(type->next, &offset) && offset)
+ {
+ ti = fdv->type;
+ }
+ }
+ if (ti)
+ {
+ if (tintro && !tintro->equals(ti))
+ {
+ error("incompatible covariant types %s and %s", tintro->toChars(), ti->toChars());
+ }
+ tintro = ti;
+ }
+ }
+ }
+ }
+ }
+
}
else if (isOverride() && !parent->isTemplateInstance())
error("override only applies to class member functions");
@@ -743,7 +811,7 @@
}
{
- Array *a = new Array();
+ Statements *a = new Statements();
// Merge in initialization of 'out' parameters
if (parameters)
@@ -849,6 +917,10 @@
// Create: return vresult;
assert(vresult);
Expression *e = new VarExp(0, vresult);
+ if (tintro)
+ { e = e->implicitCastTo(tintro->next);
+ e = e->semantic(sc);
+ }
ReturnStatement *s = new ReturnStatement(0, e);
a->push(s);
}
@@ -1030,7 +1102,7 @@
// Recursive helper function
-void overloadResolveX(Match *m, FuncDeclaration *fstart, Array *arguments)
+void overloadResolveX(Match *m, FuncDeclaration *fstart, Expressions *arguments)
{
MATCH match;
Declaration *d;
@@ -1108,7 +1180,7 @@
}
}
-FuncDeclaration *FuncDeclaration::overloadResolve(Loc loc, Array *arguments)
+FuncDeclaration *FuncDeclaration::overloadResolve(Loc loc, Expressions *arguments)
{
TypeFunction *tf;
Match m;
@@ -1294,9 +1366,9 @@
{ CompoundStatement *cs;
if (!fbody)
- { Array *a;
+ { Statements *a;
- a = new Array();
+ a = new Statements();
fbody = new CompoundStatement(0, a);
}
cs = fbody->isCompoundStatement();
diff -uNr dmd-0.149/dmd/src/dmd/hdrgen.h dmd-0.150/dmd/src/dmd/hdrgen.h
--- dmd-0.149/dmd/src/dmd/hdrgen.h 2005-12-12 00:32:14.000000000 +0100
+++ dmd-0.150/dmd/src/dmd/hdrgen.h 2006-03-08 10:32:22.000000000 +0100
@@ -11,6 +11,7 @@
struct HdrGenState
{
int hdrgen; // 1 if generating header file
+ int ddoc; // 1 if generating Ddoc file
int tpltMember;
int inCallExp;
int inPtrExp;
diff -uNr dmd-0.149/dmd/src/dmd/inline.c dmd-0.150/dmd/src/dmd/inline.c
--- dmd-0.149/dmd/src/dmd/inline.c 2006-01-07 18:53:16.000000000 +0100
+++ dmd-0.150/dmd/src/dmd/inline.c 2006-03-07 18:41:04.000000000 +0100
@@ -336,12 +336,12 @@
* Perform doInline() on an array of Expressions.
*/
-Array *arrayExpressiondoInline(Array *a, InlineDoState *ids)
-{ Array *newa = NULL;
+Expressions *arrayExpressiondoInline(Expressions *a, InlineDoState *ids)
+{ Expressions *newa = NULL;
if (a)
{
- newa = new Array();
+ newa = new Expressions();
newa->setDim(a->dim);
for (int i = 0; i < a->dim; i++)
diff -uNr dmd-0.149/dmd/src/dmd/mars.c dmd-0.150/dmd/src/dmd/mars.c
--- dmd-0.149/dmd/src/dmd/mars.c 2006-02-27 21:27:46.000000000 +0100
+++ dmd-0.150/dmd/src/dmd/mars.c 2006-03-07 18:46:00.000000000 +0100
@@ -53,7 +53,7 @@
copyright = "Copyright (c) 1999-2006 by Digital Mars";
written = "written by Walter Bright";
- version = "v0.149";
+ version = "v0.150";
global.structalign = 8;
memset(¶ms, 0, sizeof(Param));
diff -uNr dmd-0.149/dmd/src/dmd/mtype.c dmd-0.150/dmd/src/dmd/mtype.c
--- dmd-0.149/dmd/src/dmd/mtype.c 2006-03-05 01:07:40.000000000 +0100
+++ dmd-0.150/dmd/src/dmd/mtype.c 2006-03-18 13:22:16.000000000 +0100
@@ -123,6 +123,7 @@
(t && deco == t->deco) && // deco strings are unique
deco != NULL) // and semantic() has been run
{
+ //printf("deco = '%s', t->deco = '%s'\n", deco, t->deco);
return 1;
}
//if (deco && t && t->deco) printf("deco = '%s', t->deco = '%s'\n", deco, t->deco);
@@ -476,7 +477,7 @@
return 0; // assume not
}
-int Type::isBaseOf(Type *t)
+int Type::isBaseOf(Type *t, int *poffset)
{
return 0; // assume not
}
@@ -1354,10 +1355,10 @@
if (flags & TFLAGScomplex && !(tob->flags & TFLAGScomplex))
return MATCHnomatch;
- // Allow implicit conversion of real or imaginary to complex
+ // Disallow implicit conversion of real or imaginary to complex
if (flags & (TFLAGSreal | TFLAGSimaginary) &&
tob->flags & TFLAGScomplex)
- return MATCHconvert;
+ return MATCHnomatch;
// Disallow implicit conversion to-from real and imaginary
if ((flags & (TFLAGSreal | TFLAGSimaginary)) !=
@@ -1390,7 +1391,7 @@
{
Expression *ec;
FuncDeclaration *fd;
- Array *arguments;
+ Expressions *arguments;
char *nm;
static char *name[2] = { "_adReverseChar", "_adReverseWchar" };
@@ -1398,7 +1399,7 @@
fd = FuncDeclaration::genCfunc(Type::tindex, nm);
ec = new VarExp(0, fd);
e = e->castTo(n->arrayOf()); // convert to dynamic array
- arguments = new Array();
+ arguments = new Expressions();
arguments->push(e);
e = new CallExp(e->loc, ec, arguments);
e->type = next->arrayOf();
@@ -1407,7 +1408,7 @@
{
Expression *ec;
FuncDeclaration *fd;
- Array *arguments;
+ Expressions *arguments;
int size = next->size(e->loc);
char *nm;
static char *name[2][2] = { { "_adReverse", "_adDup" },
@@ -1418,7 +1419,7 @@
fd = FuncDeclaration::genCfunc(Type::tindex, nm);
ec = new VarExp(0, fd);
e = e->castTo(n->arrayOf()); // convert to dynamic array
- arguments = new Array();
+ arguments = new Expressions();
arguments->push(e);
if (next->ty != Tbit)
arguments->push(new IntegerExp(0, size, Type::tint32));
@@ -1429,13 +1430,13 @@
{
Expression *ec;
FuncDeclaration *fd;
- Array *arguments;
+ Expressions *arguments;
fd = FuncDeclaration::genCfunc(tint32->arrayOf(),
(char*)(n->ty == Tbit ? "_adSortBit" : "_adSort"));
ec = new VarExp(0, fd);
e = e->castTo(n->arrayOf()); // convert to dynamic array
- arguments = new Array();
+ arguments = new Expressions();
arguments->push(e);
if (next->ty != Tbit)
arguments->push(n->ty == Tsarray
@@ -1809,7 +1810,7 @@
}
if (to->ty == Tarray)
{
- if (to->next->isBaseOf(next) || to->next->ty == Tvoid)
+ if (to->next->isBaseOf(next, NULL) || to->next->ty == Tvoid)
return MATCHconvert;
}
return Type::implicitConvTo(to);
@@ -1938,11 +1939,11 @@
{
Expression *ec;
FuncDeclaration *fd;
- Array *arguments;
+ Expressions *arguments;
fd = FuncDeclaration::genCfunc(Type::tsize_t, "_aaLen");
ec = new VarExp(0, fd);
- arguments = new Array();
+ arguments = new Expressions();
arguments->push(e);
e = new CallExp(e->loc, ec, arguments);
e->type = fd->type->next;
@@ -1951,7 +1952,7 @@
{
Expression *ec;
FuncDeclaration *fd;
- Array *arguments;
+ Expressions *arguments;
char aakeys[7+3*sizeof(int)+1];
int size = key->size(e->loc);
@@ -1967,7 +1968,7 @@
strcpy(aakeys, "_aaKeys");
fd = FuncDeclaration::genCfunc(Type::tindex, aakeys);
ec = new VarExp(0, fd);
- arguments = new Array();
+ arguments = new Expressions();
arguments->push(e);
if (size)
arguments->push(new IntegerExp(0, size, Type::tint32));
@@ -1978,11 +1979,11 @@
{
Expression *ec;
FuncDeclaration *fd;
- Array *arguments;
+ Expressions *arguments;
fd = FuncDeclaration::genCfunc(Type::tindex, "_aaValues");
ec = new VarExp(0, fd);
- arguments = new Array();
+ arguments = new Expressions();
arguments->push(e);
arguments->push(new IntegerExp(0, key->size(e->loc), Type::tint32));
arguments->push(new IntegerExp(0, next->size(e->loc), Type::tint32));
@@ -1993,11 +1994,11 @@
{
Expression *ec;
FuncDeclaration *fd;
- Array *arguments;
+ Expressions *arguments;
fd = FuncDeclaration::genCfunc(Type::tint64, "_aaRehash");
ec = new VarExp(0, fd);
- arguments = new Array();
+ arguments = new Expressions();
arguments->push(e->addressOf());
arguments->push(key->getInternalTypeInfo(sc));
e = new CallExp(e->loc, ec, arguments);
@@ -2291,12 +2292,15 @@
}
Lcovariant:
+ //printf("\tcovaraint: 1\n");
return 1;
Ldistinct:
+ //printf("\tcovaraint: 0\n");
return 0;
Lnotcovariant:
+ //printf("\tcovaraint: 2\n");
return 2;
}
@@ -2343,17 +2347,20 @@
void TypeFunction::toCBuffer2(OutBuffer *buf, Identifier *ident, HdrGenState *hgs)
{
- char *p;
+ char *p = NULL;
- switch (linkage)
+ if (hgs->ddoc != 1)
{
- case LINKd: p = NULL; break;
- case LINKc: p = "C "; break;
- case LINKwindows: p = "Windows "; break;
- case LINKpascal: p = "Pascal "; break;
- case LINKcpp: p = "C++ "; break;
- default:
- assert(0);
+ switch (linkage)
+ {
+ case LINKd: p = NULL; break;
+ case LINKc: p = "C "; break;
+ case LINKwindows: p = "Windows "; break;
+ case LINKpascal: p = "Pascal "; break;
+ case LINKcpp: p = "C++ "; break;
+ default:
+ assert(0);
+ }
}
if (buf->offset)
@@ -4060,13 +4067,13 @@
return sym->isauto;
}
-int TypeClass::isBaseOf(Type *t)
+int TypeClass::isBaseOf(Type *t, int *poffset)
{
if (t->ty == Tclass)
{ ClassDeclaration *cd;
cd = ((TypeClass *)t)->sym;
- if (sym->isBaseOf(cd, NULL))
+ if (sym->isBaseOf(cd, poffset))
return 1;
}
return 0;
@@ -4129,7 +4136,7 @@
Argument *Argument::syntaxCopy()
{
Argument *a = new Argument(inout,
- type->syntaxCopy(),
+ type ? type->syntaxCopy() : NULL,
ident,
defaultArg ? defaultArg->syntaxCopy() : NULL);
return a;
diff -uNr dmd-0.149/dmd/src/dmd/mtype.h dmd-0.150/dmd/src/dmd/mtype.h
--- dmd-0.149/dmd/src/dmd/mtype.h 2006-03-03 01:33:26.000000000 +0100
+++ dmd-0.150/dmd/src/dmd/mtype.h 2006-03-18 13:18:00.000000000 +0100
@@ -1,5 +1,5 @@
-// Copyright (c) 1999-2005 by Digital Mars
+// Copyright (c) 1999-2006 by Digital Mars
// All Rights Reserved
// written by Walter Bright
// www.digitalmars.com
@@ -17,6 +17,7 @@
#include "root.h"
#include "stringtable.h"
+#include "arraytypes.h"
#include "expression.h"
struct Scope;
@@ -214,7 +215,7 @@
Type *arrayOf();
virtual Dsymbol *toDsymbol(Scope *sc);
virtual Type *toBasetype();
- virtual int isBaseOf(Type *t);
+ virtual int isBaseOf(Type *t, int *poffset);
virtual int implicitConvTo(Type *to);
virtual ClassDeclaration *isClassHandle();
virtual Expression *getProperty(Loc loc, Identifier *ident);
@@ -224,7 +225,7 @@
virtual int isZeroInit(); // if initializer is 0
virtual dt_t **toDt(dt_t **pdt);
Identifier *getTypeInfoIdent(int internal);
- virtual MATCH deduceType(Scope *sc, Type *tparam, Array *parameters, Array *atypes);
+ virtual MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Array *atypes);
virtual void resolve(Loc loc, Scope *sc, Expression **pe, Type **pt, Dsymbol **ps);
Expression *getInternalTypeInfo(Scope *sc);
Expression *getTypeInfo(Scope *sc);
@@ -301,7 +302,7 @@
int implicitConvTo(Type *to);
Expression *defaultInit();
dt_t **toDt(dt_t **pdt);
- MATCH deduceType(Scope *sc, Type *tparam, Array *parameters, Array *atypes);
+ MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Array *atypes);
TypeInfoDeclaration *getTypeInfoDeclaration();
type *toCtype();
@@ -343,7 +344,7 @@
void toPrettyBracket(OutBuffer *buf, HdrGenState *hgs);
Expression *dotExp(Scope *sc, Expression *e, Identifier *ident);
Expression *defaultInit();
- MATCH deduceType(Scope *sc, Type *tparam, Array *parameters, Array *atypes);
+ MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Array *atypes);
int checkBoolean();
TypeInfoDeclaration *getTypeInfoDeclaration();
@@ -398,7 +399,7 @@
Type *semantic(Loc loc, Scope *sc);
void toDecoBuffer(OutBuffer *buf);
void toCBuffer2(OutBuffer *buf, Identifier *ident, HdrGenState *hgs);
- MATCH deduceType(Scope *sc, Type *tparam, Array *parameters, Array *atypes);
+ MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Array *atypes);
TypeInfoDeclaration *getTypeInfoDeclaration();
int callMatch(Array *toargs);
@@ -449,7 +450,7 @@
void resolve(Loc loc, Scope *sc, Expression **pe, Type **pt, Dsymbol **ps);
Dsymbol *toDsymbol(Scope *sc);
Type *semantic(Loc loc, Scope *sc);
- MATCH deduceType(Scope *sc, Type *tparam, Array *parameters, Array *atypes);
+ MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Array *atypes);
};
/* Similar to TypeIdentifier, but with a TemplateInstance as the root
@@ -465,7 +466,7 @@
void toCBuffer2(OutBuffer *buf, Identifier *ident, HdrGenState *hgs);
void resolve(Loc loc, Scope *sc, Expression **pe, Type **pt, Dsymbol **ps);
Type *semantic(Loc loc, Scope *sc);
- MATCH deduceType(Scope *sc, Type *tparam, Array *parameters, Array *atypes);
+ MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Array *atypes);
};
struct TypeTypeof : TypeQualified
@@ -500,7 +501,7 @@
int isZeroInit();
int checkBoolean();
dt_t **toDt(dt_t **pdt);
- MATCH deduceType(Scope *sc, Type *tparam, Array *parameters, Array *atypes);
+ MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Array *atypes);
TypeInfoDeclaration *getTypeInfoDeclaration();
type *toCtype();
@@ -529,7 +530,7 @@
Type *toBasetype();
Expression *defaultInit();
int isZeroInit();
- MATCH deduceType(Scope *sc, Type *tparam, Array *parameters, Array *atypes);
+ MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Array *atypes);
TypeInfoDeclaration *getTypeInfoDeclaration();
type *toCtype();
@@ -564,7 +565,7 @@
Expression *defaultInit();
int isZeroInit();
dt_t **toDt(dt_t **pdt);
- MATCH deduceType(Scope *sc, Type *tparam, Array *parameters, Array *atypes);
+ MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Array *atypes);
TypeInfoDeclaration *getTypeInfoDeclaration();
type *toCtype();
@@ -585,11 +586,11 @@
void toCBuffer2(OutBuffer *buf, Identifier *ident, HdrGenState *hgs);
Expression *dotExp(Scope *sc, Expression *e, Identifier *ident);
ClassDeclaration *isClassHandle();
- int isBaseOf(Type *t);
+ int isBaseOf(Type *t, int *poffset);
int implicitConvTo(Type *to);
Expression *defaultInit();
int isZeroInit();
- MATCH deduceType(Scope *sc, Type *tparam, Array *parameters, Array *atypes);
+ MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Array *atypes);
int isauto();
int checkBoolean();
TypeInfoDeclaration *getTypeInfoDeclaration();
diff -uNr dmd-0.149/dmd/src/dmd/opover.c dmd-0.150/dmd/src/dmd/opover.c
--- dmd-0.149/dmd/src/dmd/opover.c 2006-02-22 00:21:26.000000000 +0100
+++ dmd-0.150/dmd/src/dmd/opover.c 2006-03-07 18:41:30.000000000 +0100
@@ -203,8 +203,8 @@
Identifier *id_r = opId_r();
Match m;
- Array args1;
- Array args2;
+ Expressions args1;
+ Expressions args2;
int argsset = 0;
AggregateDeclaration *ad1;
diff -uNr dmd-0.149/dmd/src/dmd/parse.c dmd-0.150/dmd/src/dmd/parse.c
--- dmd-0.149/dmd/src/dmd/parse.c 2006-03-05 10:55:42.000000000 +0100
+++ dmd-0.150/dmd/src/dmd/parse.c 2006-03-12 11:22:44.000000000 +0100
@@ -280,6 +280,8 @@
s = v;
if (token.value != TOKsemicolon)
error("semicolon expected following auto declaration, not '%s'", token.toChars());
+ else
+ nextToken();
}
else
{ a = parseBlock();
@@ -339,7 +341,7 @@
case TOKpragma:
{ Identifier *ident;
- Array *args = NULL;
+ Expressions *args = NULL;
nextToken();
check(TOKlparen);
@@ -1016,7 +1018,7 @@
int anon = 0;
enum TOK tok;
Identifier *id;
- Array *tpl = NULL;
+ TemplateParameters *tpl = NULL;
//printf("Parser::parseAggregate()\n");
tok = token.value;
@@ -1045,7 +1047,7 @@
error("anonymous classes not allowed");
// Collect base class(es)
- Array *baseclasses = NULL;
+ BaseClasses *baseclasses = NULL;
if (token.value == TOKcolon)
{
nextToken();
@@ -1123,10 +1125,10 @@
/*******************************************
*/
-Array *Parser::parseBaseClasses()
+BaseClasses *Parser::parseBaseClasses()
{
enum PROT protection = PROTpublic;
- Array *baseclasses = new Array();
+ BaseClasses *baseclasses = new BaseClasses();
for (; 1; nextToken())
{
@@ -1167,7 +1169,7 @@
{
TemplateDeclaration *tempdecl;
Identifier *id;
- Array *tpl;
+ TemplateParameters *tpl;
Array *decldefs;
Loc loc = this->loc;
@@ -1208,18 +1210,18 @@
* Parse template parameter list.
*/
-Array *Parser::parseTemplateParameterList()
+TemplateParameters *Parser::parseTemplateParameterList()
{
- Array *tpl;
+ TemplateParameters *tpl;
if (token.value != TOKlparen)
{ error("parenthesized TemplateParameterList expected following TemplateIdentifier");
goto Lerr;
}
- tpl = new Array();
+ tpl = new TemplateParameters();
nextToken();
- // Get TemplateParameterList
+ // Get array of TemplateParameters
if (token.value != TOKrparen)
{
while (1)
@@ -2481,7 +2483,7 @@
a = parseDeclarations();
if (a->dim > 1)
{
- Array *as = new Array();
+ Statements *as = new Statements();
as->reserve(a->dim);
for (int i = 0; i < a->dim; i++)
{
@@ -2531,10 +2533,10 @@
}
case TOKlcurly:
- { Array *statements;
+ { Statements *statements;
nextToken();
- statements = new Array();
+ statements = new Statements();
while (token.value != TOKrcurly)
{
statements->push(parseStatement(PSsemi | PScurlyscope));
@@ -2815,7 +2817,7 @@
case TOKpragma:
{ Identifier *ident;
- Array *args = NULL;
+ Expressions *args = NULL;
Statement *body;
nextToken();
@@ -2850,7 +2852,7 @@
case TOKcase:
{ Expression *exp;
- Array *statements;
+ Statements *statements;
Array cases; // array of Expression's
while (1)
@@ -2863,7 +2865,7 @@
}
check(TOKcolon);
- statements = new Array();
+ statements = new Statements();
while (token.value != TOKcase &&
token.value != TOKdefault &&
token.value != TOKrcurly)
@@ -2884,12 +2886,12 @@
case TOKdefault:
{
- Array *statements;
+ Statements *statements;
nextToken();
check(TOKcolon);
- statements = new Array();
+ statements = new Statements();
while (token.value != TOKcase &&
token.value != TOKdefault &&
token.value != TOKrcurly)
@@ -3075,12 +3077,12 @@
case TOKvolatile:
nextToken();
- s = parseStatement(PSsemi | PSscope);
+ s = parseStatement(PSsemi | PScurlyscope);
s = new VolatileStatement(loc, s);
break;
case TOKasm:
- { Array *statements;
+ { Statements *statements;
Identifier *label;
Loc labelloc;
Token *toklist;
@@ -3096,7 +3098,7 @@
toklist = NULL;
ptoklist = &toklist;
label = NULL;
- statements = new Array();
+ statements = new Statements();
while (1)
{
switch (token.value)
@@ -4029,7 +4031,7 @@
}
else
{ // array[index, i2, i3, i4, ...]
- Array *arguments = new Array();
+ Expressions *arguments = new Expressions();
arguments->push(index);
if (token.value == TOKcomma)
{
@@ -4563,12 +4565,12 @@
* Assume current token is '('.
*/
-Array *Parser::parseArguments()
+Expressions *Parser::parseArguments()
{ // function call
- Array *arguments;
+ Expressions *arguments;
Expression *arg;
- arguments = new Array();
+ arguments = new Expressions();
//if (token.value == TOKlparen)
{
nextToken();
@@ -4593,8 +4595,8 @@
Expression *Parser::parseNewExp()
{ Type *t;
- Array *newargs;
- Array *arguments = NULL;
+ Expressions *newargs;
+ Expressions *arguments = NULL;
Expression *e;
Loc loc = this->loc;
@@ -4612,7 +4614,7 @@
if (token.value == TOKlparen)
arguments = parseArguments();
- Array *baseclasses = parseBaseClasses();
+ BaseClasses *baseclasses = parseBaseClasses();
Identifier *id = NULL;
ClassDeclaration *cd = new ClassDeclaration(loc, id, baseclasses);
@@ -4656,7 +4658,7 @@
e = new DotIdExp(loc, e, id);
}
- arguments = new Array();
+ arguments = new Expressions();
arguments->push(e);
t = new TypeDArray(t->next);
}
@@ -4671,7 +4673,7 @@
TypeSArray *tsa = (TypeSArray *)t;
Expression *e = tsa->dim;
- arguments = new Array();
+ arguments = new Expressions();
arguments->push(e);
t = new TypeDArray(t->next);
}
diff -uNr dmd-0.149/dmd/src/dmd/parse.h dmd-0.150/dmd/src/dmd/parse.h
--- dmd-0.149/dmd/src/dmd/parse.h 2006-03-04 16:15:26.000000000 +0100
+++ dmd-0.150/dmd/src/dmd/parse.h 2006-03-12 11:19:40.000000000 +0100
@@ -14,6 +14,7 @@
#pragma once
#endif /* __DMC__ */
+#include "arraytypes.h"
#include "lexer.h"
#include "enum.h"
@@ -53,7 +54,7 @@
Array *parseDeclDefs(int once);
Array *parseBlock();
TemplateDeclaration *parseTemplateDeclaration();
- Array *parseTemplateParameterList();
+ TemplateParameters *parseTemplateParameterList();
TemplateInstance *parseTemplateInstance();
Dsymbol *parseMixin();
Array *parseTemplateArgumentList();
@@ -74,7 +75,7 @@
Array *parseParameters(int *pvarargs);
EnumDeclaration *parseEnum();
Dsymbol *parseAggregate();
- Array *parseBaseClasses();
+ BaseClasses *parseBaseClasses();
Import *parseImport(Array *decldefs);
Type *parseBasicType();
Type *parseBasicType2(Type *t);
@@ -110,7 +111,7 @@
Expression *parseCondExp();
Expression *parseAssignExp();
- Array *parseArguments();
+ Expressions *parseArguments();
Expression *parseNewExp();
diff -uNr dmd-0.149/dmd/src/dmd/statement.c dmd-0.150/dmd/src/dmd/statement.c
--- dmd-0.149/dmd/src/dmd/statement.c 2006-03-07 11:02:26.000000000 +0100
+++ dmd-0.150/dmd/src/dmd/statement.c 2006-03-12 17:37:52.000000000 +0100
@@ -161,7 +161,7 @@
* Returns NULL if no flattening necessary.
*/
-Array *Statement::flatten()
+Statements *Statement::flatten()
{
return NULL;
}
@@ -405,7 +405,7 @@
* s; try { s1; s2; } finally { sfinally; }
*/
Statement *body;
- Array *a = new Array();
+ Statements *a = new Statements();
for (int j = i + 1; j < statements->dim; j++)
{
@@ -427,7 +427,7 @@
return this;
}
-Array *CompoundStatement::flatten()
+Statements *CompoundStatement::flatten()
{
return statements;
}
@@ -518,7 +518,7 @@
//printf("ScopeStatement::semantic(sc = %p)\n", sc);
if (statement)
- { Array *a;
+ { Statements *a;
sym = new ScopeDsymbol();
sym->parent = sc->scopesym;
@@ -835,6 +835,8 @@
this->key = NULL;
this->value = NULL;
+
+ this->func = NULL;
}
Statement *ForeachStatement::syntaxCopy()
@@ -857,6 +859,10 @@
Type *tn = NULL;
Type *tnv = NULL;
+ func = sc->func;
+ if (func->fes)
+ func = func->fes->func;
+
aggr = aggr->semantic(sc);
aggr = resolveProperties(sc, aggr);
@@ -979,7 +985,7 @@
case Tstruct:
Lapply:
{ FuncDeclaration *fdapply;
- Array *args;
+ Expressions *args;
Expression *ec;
Expression *e;
FuncLiteralDeclaration *fld;
@@ -987,12 +993,15 @@
Type *t;
Expression *flde;
Identifier *id;
+ Type *tret;
+
+ tret = func->type->next;
// Need a variable to hold value from any return statements in body.
- if (!sc->func->vresult && sc->func->type->next != Type::tvoid)
+ if (!sc->func->vresult && tret != Type::tvoid)
{ VarDeclaration *v;
- v = new VarDeclaration(loc, sc->func->type->next, Id::result, NULL);
+ v = new VarDeclaration(loc, tret, Id::result, NULL);
v->noauto = 1;
v->semantic(sc);
if (!sc->insert(v))
@@ -1004,7 +1013,7 @@
/* Turn body into the function literal:
* int delegate(inout T arg) { body }
*/
- args = new Array();
+ args = new Expressions();
for (i = 0; i < dim; i++)
{ Argument *arg = (Argument *)arguments->data[i];
@@ -1071,7 +1080,7 @@
else
fdapply = FuncDeclaration::genCfunc(Type::tindex, "_aaApply");
ec = new VarExp(0, fdapply);
- args = new Array();
+ args = new Expressions();
args->push(aggr);
args->push(new IntegerExp(0, taa->key->size(), Type::tint32));
args->push(flde);
@@ -1110,7 +1119,7 @@
fdapply = FuncDeclaration::genCfunc(Type::tindex, fdname);
ec = new VarExp(0, fdapply);
- args = new Array();
+ args = new Expressions();
if (tab->ty == Tsarray)
aggr = aggr->castTo(tn->arrayOf());
args->push(aggr);
@@ -1124,7 +1133,7 @@
* aggr.apply(flde)
*/
ec = new DotIdExp(loc, aggr, Id::apply);
- args = new Array();
+ args = new Expressions();
args->push(flde);
e = new CallExp(loc, ec, args);
e = e->semantic(sc);
@@ -1138,7 +1147,7 @@
else
{ // Construct a switch statement around the return value
// of the apply function.
- Array *a = new Array();
+ Statements *a = new Statements();
// default: break; takes care of cases 0 and 1
s = new BreakStatement(0, NULL);
@@ -1398,7 +1407,7 @@
/******************************** PragmaStatement ***************************/
-PragmaStatement::PragmaStatement(Loc loc, Identifier *ident, Array *args, Statement *body)
+PragmaStatement::PragmaStatement(Loc loc, Identifier *ident, Expressions *args, Statement *body)
: Statement(loc)
{
this->ident = ident;
@@ -1593,7 +1602,7 @@
}
// Generate runtime error if the default is hit
- Array *a = new Array();
+ Statements *a = new Statements();
CompoundStatement *cs;
Statement *s;
@@ -1928,6 +1937,8 @@
FuncDeclaration *fd = sc->parent->isFuncDeclaration();
FuncDeclaration *fdx = fd;
Type *tret = fd->type->next;
+ if (fd->tintro)
+ tret = fd->tintro->next;
Type *tbret = tret->toBasetype();
if (!exp && tbret->ty == Tvoid && fd->isMain())
@@ -1948,10 +1959,12 @@
}
}
+ tret = fdx->type->next;
+
if (exp)
{ exp = exp->semantic(sc);
exp = resolveProperties(sc, exp);
- exp = exp->implicitCastTo(fdx->type->next);
+ exp = exp->implicitCastTo(tret);
}
if (!exp || exp->op == TOKint64 || exp->op == TOKfloat64 ||
exp->op == TOKimaginary80 || exp->op == TOKcomplex80 ||
@@ -2663,8 +2676,8 @@
{ int result;
result = body->fallOffEnd();
- if (finalbody)
- result = finalbody->fallOffEnd();
+// if (finalbody)
+// result = finalbody->fallOffEnd();
return result;
}
@@ -2811,9 +2824,9 @@
return this;
}
-Array *VolatileStatement::flatten()
+Statements *VolatileStatement::flatten()
{
- Array *a;
+ Statements *a;
a = statement->flatten();
if (a)
@@ -2876,7 +2889,7 @@
* so we can patch it later, and add it to a 'look at this later'
* list.
*/
- Array *a = new Array();
+ Statements *a = new Statements();
Statement *s;
a->push(this);
@@ -2940,9 +2953,9 @@
return this;
}
-Array *LabelStatement::flatten()
+Statements *LabelStatement::flatten()
{
- Array *a;
+ Statements *a;
a = statement->flatten();
if (a)
diff -uNr dmd-0.149/dmd/src/dmd/statement.h dmd-0.150/dmd/src/dmd/statement.h
--- dmd-0.149/dmd/src/dmd/statement.h 2006-03-07 00:09:28.000000000 +0100
+++ dmd-0.150/dmd/src/dmd/statement.h 2006-03-08 14:51:12.000000000 +0100
@@ -16,6 +16,7 @@
#include "root.h"
+#include "arraytypes.h"
#include "dsymbol.h"
struct OutBuffer;
@@ -42,8 +43,6 @@
struct TryCatchStatement;
struct HdrGenState;
-typedef Array Statements;
-
// Back end
struct IRState;
struct Blockx;
@@ -251,6 +250,8 @@
VarDeclaration *key;
VarDeclaration *value;
+ FuncDeclaration *func; // function we're lexically in
+
Array cases; // put breaks, continues, gotos and returns here
Array gotos; // forward referenced goto's go here
@@ -308,10 +309,10 @@
struct PragmaStatement : Statement
{
Identifier *ident;
- Array *args; // array of Expression's
+ Expressions *args; // array of Expression's
Statement *body;
- PragmaStatement(Loc loc, Identifier *ident, Array *args, Statement *body);
+ PragmaStatement(Loc loc, Identifier *ident, Expressions *args, Statement *body);
Statement *syntaxCopy();
Statement *semantic(Scope *sc);
int usesEH();
diff -uNr dmd-0.149/dmd/src/dmd/struct.c dmd-0.150/dmd/src/dmd/struct.c
--- dmd-0.149/dmd/src/dmd/struct.c 2006-02-21 21:53:18.000000000 +0100
+++ dmd-0.150/dmd/src/dmd/struct.c 2006-03-07 17:59:06.000000000 +0100
@@ -314,7 +314,7 @@
FuncDeclaration *fdptr = new FuncDeclaration(loc, loc, fdx->ident, STCundefined, tfeqptr);
Expression *e = new IdentifierExp(loc, Id::p);
e = new PtrExp(loc, e);
- Array *args = new Array();
+ Expressions *args = new Expressions();
args->push(e);
e = new IdentifierExp(loc, id);
e = new CallExp(loc, e, args);
diff -uNr dmd-0.149/dmd/src/dmd/template.c dmd-0.150/dmd/src/dmd/template.c
--- dmd-0.149/dmd/src/dmd/template.c 2006-03-04 00:25:38.000000000 +0100
+++ dmd-0.150/dmd/src/dmd/template.c 2006-03-07 18:02:18.000000000 +0100
@@ -63,7 +63,7 @@
/* ======================== TemplateDeclaration ============================= */
-TemplateDeclaration::TemplateDeclaration(Loc loc, Identifier *id, Array *parameters, Array *decldefs)
+TemplateDeclaration::TemplateDeclaration(Loc loc, Identifier *id, TemplateParameters *parameters, Array *decldefs)
: ScopeDsymbol(id)
{
#if LOG
@@ -92,13 +92,13 @@
Dsymbol *TemplateDeclaration::syntaxCopy(Dsymbol *)
{
TemplateDeclaration *td;
- Array *p;
+ TemplateParameters *p;
Array *d;
p = NULL;
if (parameters)
{
- p = new Array();
+ p = new TemplateParameters();
p->setDim(parameters->dim);
for (int i = 0; i < p->dim; i++)
{ TemplateParameter *tp = (TemplateParameter *)parameters->data[i];
@@ -622,7 +622,7 @@
* fargs arguments to function
*/
-FuncDeclaration *TemplateDeclaration::deduce(Scope *sc, Loc loc, Array *targsi, Array *fargs)
+FuncDeclaration *TemplateDeclaration::deduce(Scope *sc, Loc loc, Array *targsi, Expressions *fargs)
{
MATCH m_best = MATCHnomatch;
TemplateDeclaration *td_ambig = NULL;
@@ -793,7 +793,7 @@
* dedtypes = [ int ] // Array of Expression/Type's
*/
-MATCH Type::deduceType(Scope *sc, Type *tparam, Array *parameters, Array *dedtypes)
+MATCH Type::deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Array *dedtypes)
{
//printf("Type::deduceType()\n");
//printf("\tthis = %d, ", ty); print();
@@ -861,7 +861,7 @@
return MATCHnomatch;
}
-MATCH TypeSArray::deduceType(Scope *sc, Type *tparam, Array *parameters, Array *dedtypes)
+MATCH TypeSArray::deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Array *dedtypes)
{
//printf("TypeSArray::deduceType()\n");
//printf("\tthis = %d, ", ty); print();
@@ -916,7 +916,7 @@
return MATCHnomatch;
}
-MATCH TypeAArray::deduceType(Scope *sc, Type *tparam, Array *parameters, Array *dedtypes)
+MATCH TypeAArray::deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Array *dedtypes)
{
//printf("TypeAArray::deduceType()\n");
//printf("\tthis = %d, ", ty); print();
@@ -932,7 +932,7 @@
return Type::deduceType(sc, tparam, parameters, dedtypes);
}
-MATCH TypeFunction::deduceType(Scope *sc, Type *tparam, Array *parameters, Array *dedtypes)
+MATCH TypeFunction::deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Array *dedtypes)
{
// Extra check that function characteristics must match
if (tparam && tparam->ty == Tfunction)
@@ -954,7 +954,7 @@
return Type::deduceType(sc, tparam, parameters, dedtypes);
}
-MATCH TypeIdentifier::deduceType(Scope *sc, Type *tparam, Array *parameters, Array *dedtypes)
+MATCH TypeIdentifier::deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Array *dedtypes)
{
// Extra check
if (tparam && tparam->ty == Tident)
@@ -973,7 +973,7 @@
return Type::deduceType(sc, tparam, parameters, dedtypes);
}
-MATCH TypeInstance::deduceType(Scope *sc, Type *tparam, Array *parameters, Array *dedtypes)
+MATCH TypeInstance::deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Array *dedtypes)
{
// Extra check
if (tparam && tparam->ty == Tinstance)
@@ -1001,7 +1001,7 @@
return Type::deduceType(sc, tparam, parameters, dedtypes);
}
-MATCH TypeStruct::deduceType(Scope *sc, Type *tparam, Array *parameters, Array *dedtypes)
+MATCH TypeStruct::deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Array *dedtypes)
{
//printf("TypeStruct::deduceType()\n");
//printf("\tthis->parent = %s, ", sym->parent->toChars()); print();
@@ -1018,7 +1018,7 @@
return Type::deduceType(sc, tparam, parameters, dedtypes);
}
-MATCH TypeEnum::deduceType(Scope *sc, Type *tparam, Array *parameters, Array *dedtypes)
+MATCH TypeEnum::deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Array *dedtypes)
{
// Extra check
if (tparam && tparam->ty == Tenum)
@@ -1031,7 +1031,7 @@
return Type::deduceType(sc, tparam, parameters, dedtypes);
}
-MATCH TypeTypedef::deduceType(Scope *sc, Type *tparam, Array *parameters, Array *dedtypes)
+MATCH TypeTypedef::deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Array *dedtypes)
{
// Extra check
if (tparam && tparam->ty == Ttypedef)
@@ -1044,7 +1044,7 @@
return Type::deduceType(sc, tparam, parameters, dedtypes);
}
-MATCH TypeClass::deduceType(Scope *sc, Type *tparam, Array *parameters, Array *dedtypes)
+MATCH TypeClass::deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Array *dedtypes)
{
//printf("TypeClass::deduceType()\n");
@@ -1151,7 +1151,7 @@
MATCH TemplateTypeParameter::matchArg(Scope *sc, Object *oarg,
- int i, Array *parameters, Array *dedtypes, Declaration **psparam)
+ int i, TemplateParameters *parameters, Array *dedtypes, Declaration **psparam)
{
//printf("TemplateTypeParameter::matchArg()\n");
@@ -1334,7 +1334,7 @@
}
MATCH TemplateAliasParameter::matchArg(Scope *sc,
- Object *oarg, int i, Array *parameters, Array *dedtypes, Declaration **psparam)
+ Object *oarg, int i, TemplateParameters *parameters, Array *dedtypes, Declaration **psparam)
{
Dsymbol *sa;
@@ -1541,7 +1541,7 @@
MATCH TemplateValueParameter::matchArg(Scope *sc,
- Object *oarg, int i, Array *parameters, Array *dedtypes, Declaration **psparam)
+ Object *oarg, int i, TemplateParameters *parameters, Array *dedtypes, Declaration **psparam)
{
//printf("TemplateValueParameter::matchArg()\n");
diff -uNr dmd-0.149/dmd/src/dmd/template.h dmd-0.150/dmd/src/dmd/template.h
--- dmd-0.149/dmd/src/dmd/template.h 2006-03-04 00:25:46.000000000 +0100
+++ dmd-0.150/dmd/src/dmd/template.h 2006-03-07 18:02:42.000000000 +0100
@@ -15,8 +15,10 @@
#endif /* __DMC__ */
#include "root.h"
+#include "arraytypes.h"
#include "dsymbol.h"
+
struct OutBuffer;
struct Identifier;
struct TemplateInstance;
@@ -34,14 +36,14 @@
struct TemplateDeclaration : ScopeDsymbol
{
- Array *parameters; // array of TemplateParameter's
+ TemplateParameters *parameters; // array of TemplateParameter's
Array instances; // array of TemplateInstance's
TemplateDeclaration *overnext; // next overloaded TemplateDeclaration
Scope *scope;
Dsymbol *onemember; // if !=NULL then one member of this template
- TemplateDeclaration(Loc loc, Identifier *id, Array *parameters, Array *decldefs);
+ TemplateDeclaration(Loc loc, Identifier *id, TemplateParameters *parameters, Array *decldefs);
Dsymbol *syntaxCopy(Dsymbol *);
void semantic(Scope *sc);
int overloadInsert(Dsymbol *s);
@@ -56,7 +58,7 @@
int leastAsSpecialized(TemplateDeclaration *td2);
MATCH deduceMatch(Array *targsi, Array *fargs, Array *dedargs);
- FuncDeclaration *deduce(Scope *sc, Loc loc, Array *targsi, Array *fargs);
+ FuncDeclaration *deduce(Scope *sc, Loc loc, Array *targsi, Expressions *fargs);
void declareParameter(Scope *sc, TemplateParameter *tp, Object *o);
TemplateDeclaration *isTemplateDeclaration() { return this; }
@@ -96,7 +98,7 @@
/* Match actual argument against parameter.
*/
- virtual MATCH matchArg(Scope *sc, Object *oarg, int i, Array *parameters, Array *dedtypes, Declaration **psparam) = 0;
+ virtual MATCH matchArg(Scope *sc, Object *oarg, int i, TemplateParameters *parameters, Array *dedtypes, Declaration **psparam) = 0;
/* Create dummy argument based on parameter.
*/
@@ -121,7 +123,7 @@
Object *specialization();
Object *defaultArg(Scope *sc);
int overloadMatch(TemplateParameter *);
- MATCH matchArg(Scope *sc, Object *oarg, int i, Array *parameters, Array *dedtypes, Declaration **psparam);
+ MATCH matchArg(Scope *sc, Object *oarg, int i, TemplateParameters *parameters, Array *dedtypes, Declaration **psparam);
void *dummyArg();
};
@@ -147,7 +149,7 @@
Object *specialization();
Object *defaultArg(Scope *sc);
int overloadMatch(TemplateParameter *);
- MATCH matchArg(Scope *sc, Object *oarg, int i, Array *parameters, Array *dedtypes, Declaration **psparam);
+ MATCH matchArg(Scope *sc, Object *oarg, int i, TemplateParameters *parameters, Array *dedtypes, Declaration **psparam);
void *dummyArg();
};
@@ -174,7 +176,7 @@
Object *specialization();
Object *defaultArg(Scope *sc);
int overloadMatch(TemplateParameter *);
- MATCH matchArg(Scope *sc, Object *oarg, int i, Array *parameters, Array *dedtypes, Declaration **psparam);
+ MATCH matchArg(Scope *sc, Object *oarg, int i, TemplateParameters *parameters, Array *dedtypes, Declaration **psparam);
void *dummyArg();
};
diff -uNr dmd-0.149/dmd/src/dmd/toobj.c dmd-0.150/dmd/src/dmd/toobj.c
--- dmd-0.149/dmd/src/dmd/toobj.c 2006-01-03 02:01:06.000000000 +0100
+++ dmd-0.150/dmd/src/dmd/toobj.c 2006-03-12 11:59:42.000000000 +0100
@@ -80,7 +80,7 @@
dtdword(&dt, namelen);
dtabytes(&dt, TYnptr, 0, namelen + 1, name);
- Array aclasses;
+ ClassDeclarations aclasses;
int i;
//printf("members->dim = %d\n", members->dim);
diff -uNr dmd-0.149/dmd/src/dmd/total.h dmd-0.150/dmd/src/dmd/total.h
--- dmd-0.149/dmd/src/dmd/total.h 2005-05-14 22:15:32.000000000 +0200
+++ dmd-0.150/dmd/src/dmd/total.h 2006-03-07 17:52:50.000000000 +0100
@@ -1,5 +1,5 @@
-// Copyright (c) 1999-2002 by Digital Mars
+// Copyright (c) 1999-2006 by Digital Mars
// All Rights Reserved
// written by Walter Bright
// www.digitalmars.com
@@ -23,6 +23,7 @@
#include "root.h"
#include "stringtable.h"
+#include "arraytypes.h"
#include "mars.h"
#include "lexer.h"
#include "parse.h"
diff -uNr dmd-0.149/dmd/src/phobos/internal/aaA.d dmd-0.150/dmd/src/phobos/internal/aaA.d
--- dmd-0.149/dmd/src/phobos/internal/aaA.d 2006-03-07 14:58:12.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/internal/aaA.d 2006-03-18 23:51:32.000000000 +0100
@@ -4,6 +4,7 @@
import std.c.stdio;
import std.c.stdlib;
+import std.c.string;
import std.string;
import std.outofmemory;
diff -uNr dmd-0.149/dmd/src/phobos/internal/adi.d dmd-0.150/dmd/src/phobos/internal/adi.d
--- dmd-0.149/dmd/src/phobos/internal/adi.d 2006-03-07 14:58:12.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/internal/adi.d 2006-03-18 23:51:32.000000000 +0100
@@ -30,6 +30,7 @@
import std.stdio;
import std.c.stdio;
import std.c.stdlib;
+import std.c.string;
import std.string;
import std.outofmemory;
diff -uNr dmd-0.149/dmd/src/phobos/internal/arraycat.d dmd-0.150/dmd/src/phobos/internal/arraycat.d
--- dmd-0.149/dmd/src/phobos/internal/arraycat.d 2006-03-07 14:58:12.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/internal/arraycat.d 2006-03-18 23:51:32.000000000 +0100
@@ -25,6 +25,7 @@
import object;
import std.string;
+import std.c.string;
import std.c.stdio;
extern (C):
diff -uNr dmd-0.149/dmd/src/phobos/internal/dmain2.d dmd-0.150/dmd/src/phobos/internal/dmain2.d
--- dmd-0.149/dmd/src/phobos/internal/dmain2.d 2006-03-07 14:58:12.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/internal/dmain2.d 2006-03-18 23:51:32.000000000 +0100
@@ -6,6 +6,7 @@
import object;
import std.c.stdio;
+import std.c.string;
import std.c.stdlib;
import std.string;
diff -uNr dmd-0.149/dmd/src/phobos/internal/gc/gcbits.d dmd-0.150/dmd/src/phobos/internal/gc/gcbits.d
--- dmd-0.149/dmd/src/phobos/internal/gc/gcbits.d 2006-03-07 14:58:12.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/internal/gc/gcbits.d 2006-03-18 23:51:32.000000000 +0100
@@ -4,7 +4,7 @@
// www.digitalmars.com
// Written by Walter Bright
-import std.string;
+import std.c.string;
import std.c.stdlib;
import std.outofmemory;
import std.intrinsic;
diff -uNr dmd-0.149/dmd/src/phobos/internal/gc/gc.d dmd-0.150/dmd/src/phobos/internal/gc/gc.d
--- dmd-0.149/dmd/src/phobos/internal/gc/gc.d 2006-03-07 14:58:12.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/internal/gc/gc.d 2006-03-18 23:51:32.000000000 +0100
@@ -30,7 +30,7 @@
import std.c.stdarg;
import std.c.stdlib;
-import std.string;
+import std.c.string;
import gcx;
import std.outofmemory;
import gcstats;
diff -uNr dmd-0.149/dmd/src/phobos/internal/gc/gcx.d dmd-0.150/dmd/src/phobos/internal/gc/gcx.d
--- dmd-0.149/dmd/src/phobos/internal/gc/gcx.d 2006-03-07 14:58:12.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/internal/gc/gcx.d 2006-03-18 23:51:32.000000000 +0100
@@ -31,6 +31,7 @@
import std.c.stdio;
import std.c.stdlib;
+import std.c.string;
import gcbits;
import std.outofmemory;
import std.gc;
diff -uNr dmd-0.149/dmd/src/phobos/internal/llmath.d dmd-0.150/dmd/src/phobos/internal/llmath.d
--- dmd-0.149/dmd/src/phobos/internal/llmath.d 2006-03-07 14:58:12.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/internal/llmath.d 2006-03-18 23:51:32.000000000 +0100
@@ -221,6 +221,19 @@
}
}
+// Same as __U64_LDBL, but return result as double in [EDX,EAX]
+ulong __ULLNGDBL()
+{
+ asm
+ { naked ;
+ call __U64_LDBL ;
+ sub ESP,8 ;
+ fstp double ptr [ESP] ;
+ pop EAX ;
+ pop EDX ;
+ ret ;
+ }
+}
// Convert double to ulong
diff -uNr dmd-0.149/dmd/src/phobos/internal/switch.d dmd-0.150/dmd/src/phobos/internal/switch.d
--- dmd-0.149/dmd/src/phobos/internal/switch.d 2006-03-07 14:58:12.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/internal/switch.d 2006-03-18 23:51:32.000000000 +0100
@@ -23,6 +23,7 @@
import std.c.stdio;
+import std.c.string;
import std.string;
/******************************************************
diff -uNr dmd-0.149/dmd/src/phobos/internal/trace.d dmd-0.150/dmd/src/phobos/internal/trace.d
--- dmd-0.149/dmd/src/phobos/internal/trace.d 2006-03-07 14:58:12.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/internal/trace.d 2006-03-18 23:51:32.000000000 +0100
@@ -1,7 +1,7 @@
/* Trace dynamic profiler.
* For use with the Digital Mars DMD compiler.
- * Copyright (C) 1995-2005 by Digital Mars
+ * Copyright (C) 1995-2006 by Digital Mars
* All Rights Reserved
* Written by Walter Bright
* www.digitalmars.com
@@ -12,6 +12,7 @@
import std.stdio;
import std.ctype;
import std.string;
+import std.c.string;
import std.c.stdlib;
extern (C):
diff -uNr dmd-0.149/dmd/src/phobos/linux.mak dmd-0.150/dmd/src/phobos/linux.mak
--- dmd-0.149/dmd/src/phobos/linux.mak 2006-03-07 14:58:10.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/linux.mak 2006-03-18 23:51:32.000000000 +0100
@@ -103,7 +103,7 @@
std/boxer.d std/cstream.d std/demangle.d std/cover.d std/bitarray.d
SRC_STD_C= std/c/process.d std/c/stdlib.d std/c/time.d std/c/stdio.d \
- std/c/math.d std/c/stdarg.d std/c/stddef.d std/c/fenv.d
+ std/c/math.d std/c/stdarg.d std/c/stddef.d std/c/fenv.d std/c/string.d
SRC_TI= \
std/typeinfo/ti_wchar.d std/typeinfo/ti_uint.d \
diff -uNr dmd-0.149/dmd/src/phobos/std/bitarray.d dmd-0.150/dmd/src/phobos/std/bitarray.d
--- dmd-0.149/dmd/src/phobos/std/bitarray.d 2006-03-07 14:58:10.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/std/bitarray.d 2006-03-18 23:51:32.000000000 +0100
@@ -120,6 +120,7 @@
for (size_t i = 0; i < len; i++)
{ bool b = opIndex(i);
result = dg(b);
+ (*this)[i] = b;
if (result)
break;
}
@@ -134,6 +135,7 @@
for (size_t i = 0; i < len; i++)
{ bool b = opIndex(i);
result = dg(i, b);
+ (*this)[i] = b;
if (result)
break;
}
diff -uNr dmd-0.149/dmd/src/phobos/std/c/fenv.d dmd-0.150/dmd/src/phobos/std/c/fenv.d
--- dmd-0.149/dmd/src/phobos/std/c/fenv.d 2006-03-07 14:58:10.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/std/c/fenv.d 2006-03-18 23:51:32.000000000 +0100
@@ -48,22 +48,22 @@
/// The various floating point exceptions
enum
{
- FE_INVALID = 1,
- FE_DENORMAL = 2,
- FE_DIVBYZERO = 4,
- FE_OVERFLOW = 8,
- FE_UNDERFLOW = 0x10,
- FE_INEXACT = 0x20,
+ FE_INVALID = 1, ///
+ FE_DENORMAL = 2, ///
+ FE_DIVBYZERO = 4, ///
+ FE_OVERFLOW = 8, ///
+ FE_UNDERFLOW = 0x10, ///
+ FE_INEXACT = 0x20, ///
FE_ALL_EXCEPT = 0x3F, /// Mask of all the exceptions
}
/// Rounding modes
enum
{
- FE_TONEAREST = 0,
- FE_UPWARD = 0x800,
- FE_DOWNWARD = 0x400,
- FE_TOWARDZERO = 0xC00,
+ FE_TONEAREST = 0, ///
+ FE_UPWARD = 0x800, ///
+ FE_DOWNWARD = 0x400, ///
+ FE_TOWARDZERO = 0xC00, ///
}
version (Windows)
@@ -73,7 +73,7 @@
/// Default floating point environment
fenv_t* FE_DFL_ENV = &_FE_DFL_ENV;
}
-else version (linux
+else version (linux)
{
/// Default floating point environment
fenv_t* FE_DFL_ENV = cast(fenv_t*)(-1);
@@ -86,27 +86,27 @@
/// Floating point precision
enum
{
- FE_FLTPREC = 0,
- FE_DBLPREC = 0x200,
- FE_LDBLPREC = 0x300,
-}
-
-int fetestexcept(int excepts);
-int feraiseexcept(int excepts);
-int feclearexcept(int excepts);
-//int fegetexcept(fexcept_t *flagp,int excepts);
-//int fesetexcept(fexcept_t *flagp,int excepts);
-int fegetround();
-int fesetround(int round);
-int fegetprec();
-int fesetprec(int prec);
-int fegetenv(fenv_t *envp);
-int fesetenv(fenv_t *envp);
-//void feprocentry(fenv_t *envp);
-//void feprocexit(const fenv_t *envp);
-
-int fegetexceptflag(fexcept_t *flagp,int excepts);
-int fesetexceptflag(fexcept_t *flagp,int excepts);
-int feholdexcept(fenv_t *envp);
-int feupdateenv(fenv_t *envp);
+ FE_FLTPREC = 0, ///
+ FE_DBLPREC = 0x200, ///
+ FE_LDBLPREC = 0x300, ///
+}
+
+int fetestexcept(int excepts); ///
+int feraiseexcept(int excepts); ///
+int feclearexcept(int excepts); ///
+//int fegetexcept(fexcept_t *flagp,int excepts); ///
+//int fesetexcept(fexcept_t *flagp,int excepts); ///
+int fegetround(); ///
+int fesetround(int round); ///
+int fegetprec(); ///
+int fesetprec(int prec); ///
+int fegetenv(fenv_t *envp); ///
+int fesetenv(fenv_t *envp); ///
+//void feprocentry(fenv_t *envp); ///
+//void feprocexit(const fenv_t *envp); ///
+
+int fegetexceptflag(fexcept_t *flagp,int excepts); ///
+int fesetexceptflag(fexcept_t *flagp,int excepts); ///
+int feholdexcept(fenv_t *envp); ///
+int feupdateenv(fenv_t *envp); ///
diff -uNr dmd-0.149/dmd/src/phobos/std/c/math.d dmd-0.150/dmd/src/phobos/std/c/math.d
--- dmd-0.149/dmd/src/phobos/std/c/math.d 2006-03-07 14:58:10.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/std/c/math.d 2006-03-18 23:51:32.000000000 +0100
@@ -1,286 +1,291 @@
/**
- * Standard C math.h
- *
- * Copyright: Public Domain
- */
-
-/* www.digitalmars.com
+ * C's <math.h>
+ * Authors: Walter Bright, Digital Mars, www.digitalmars.com
+ * License: Public Domain
+ * Macros:
+ * WIKI=Phobos/StdCMath
*/
module std.c.math;
extern (C):
-alias float float_t;
-alias double double_t;
+alias float float_t; ///
+alias double double_t; ///
-const double HUGE_VAL = double.infinity;
-const double HUGE_VALF = float.infinity;
-const double HUGE_VALL = real.infinity;
+const double HUGE_VAL = double.infinity; ///
+const float HUGE_VALF = float.infinity; /// ditto
+const real HUGE_VALL = real.infinity; /// ditto
-const float INFINITY = float.infinity;
-const float NAN = float.nan;
+const float INFINITY = float.infinity; ///
+const float NAN = float.nan; ///
enum
{
FP_NANS, // extension
FP_NANQ, // extension
- FP_INFINITE,
- FP_NAN = FP_NANQ,
- FP_NORMAL = 3,
- FP_SUBNORMAL = 4,
- FP_ZERO = 5,
+ FP_INFINITE, ///
+ FP_NAN = FP_NANQ, ///
+ FP_NORMAL = 3, ///
+ FP_SUBNORMAL = 4, ///
+ FP_ZERO = 5, ///
FP_EMPTY = 6, // extension
FP_UNSUPPORTED = 7, // extension
}
enum
{
- FP_FAST_FMA = 0,
- FP_FAST_FMAF = 0,
- FP_FAST_FMAL = 0,
+ FP_FAST_FMA = 0, ///
+ FP_FAST_FMAF = 0, ///
+ FP_FAST_FMAL = 0, ///
}
-const int FP_ILOGB0 = int.min;
-const int FP_ILOGBNAN = int.min;
+const int FP_ILOGB0 = int.min; ///
+const int FP_ILOGBNAN = int.min; ///
-const int MATH_ERRNO = 1;
-const int MATH_ERREXCEPT = 2;
-const int math_errhandling = MATH_ERRNO | MATH_ERREXCEPT;
-
-double acos(double x);
-float acosf(float x);
-real acosl(real x);
-
-double asin(double x);
-float asinf(float x);
-real asinl(real x);
-
-double atan(double x);
-float atanf(float x);
-real atanl(real x);
-
-double atan2(double y, double x);
-float atan2f(float y, float x);
-real atan2l(real y, real x);
-
-double cos(double x);
-float cosf(float x);
-real cosl(real x);
-
-double sin(double x);
-float sinf(float x);
-real sinl(real x);
-
-double tan(double x);
-float tanf(float x);
-real tanl(real x);
-
-double acosh(double x);
-float acoshf(float x);
-real acoshl(real x);
-
-double asinh(double x);
-float asinhf(float x);
-real asinhl(real x);
-
-double atanh(double x);
-float atanhf(float x);
-real atanhl(real x);
-
-double cosh(double x);
-float coshf(float x);
-real coshl(real x);
-
-double sinh(double x);
-float sinhf(float x);
-real sinhl(real x);
-
-double tanh(double x);
-float tanhf(float x);
-real tanhl(real x);
-
-double exp(double x);
-float expf(float x);
-real expl(real x);
-
-double exp2(double x);
-float exp2f(float x);
-real exp2l(real x);
-
-double expm1(double x);
-float expm1f(float x);
-real expm1l(real x);
-
-double frexp(double value, int *exp);
-float frexpf(float value, int *exp);
-real frexpl(real value, int *exp);
-
-int ilogb(double x);
-int ilogbf(float x);
-int ilogbl(real x);
-
-double ldexp(double x, int exp);
-float ldexpf(float x, int exp);
-real ldexpl(real x, int exp);
-
-double log(double x);
-float logf(float x);
-real logl(real x);
-
-double log10(double x);
-float log10f(float x);
-real log10l(real x);
-
-double log1p(double x);
-float log1pf(float x);
-real log1pl(real x);
-
-double log2(double x);
-float log2f(float x);
-real log2l(real x);
-
-double logb(double x);
-float logbf(float x);
-real logbl(real x);
-
-double modf(double value, double *iptr);
-float modff(float value, float *iptr);
-real modfl(real value, real *iptr);
-
-double scalbn(double x, int n);
-float scalbnf(float x, int n);
-real scalbnl(real x, int n);
-
-double scalbln(double x, int n);
-float scalblnf(float x, int n);
-real scalblnl(real x, int n);
-
-double cbrt(double x);
-float cbrtf(float x);
-real cbrtl(real x);
-
-double fabs(double x);
-float fabsf(float x);
-real fabsl(real x);
-
-double hypot(double x, double y);
-float hypotf(float x, float y);
-real hypotl(real x, real y);
-
-double pow(double x, double y);
-float powf(float x, float y);
-real powl(real x, real y);
-
-double sqrt(double x);
-float sqrtf(float x);
-real sqrtl(real x);
-
-double erf(double x);
-float erff(float x);
-real erfl(real x);
-
-double erfc(double x);
-float erfcf(float x);
-real erfcl(real x);
-
-double lgamma(double x);
-float lgammaf(float x);
-real lgammal(real x);
-
-double tgamma(double x);
-float tgammaf(float x);
-real tgammal(real x);
-
-double ceil(double x);
-float ceilf(float x);
-real ceill(real x);
-
-double floor(double x);
-float floorf(float x);
-real floorl(real x);
-
-double nearbyint(double x);
-float nearbyintf(float x);
-real nearbyintl(real x);
-
-double rint(double x);
-float rintf(float x);
-real rintl(real x);
-
-int lrint(double x);
-int lrintf(float x);
-int lrintl(real x);
-
-long llrint(double x);
-long llrintf(float x);
-long llrintl(real x);
-
-double round(double x);
-float roundf(float x);
-real roundl(real x);
-
-int lround(double x);
-int lroundf(float x);
-int lroundl(real x);
-
-long llround(double x);
-long llroundf(float x);
-long llroundl(real x);
-
-double trunc(double x);
-float truncf(float x);
-real truncl(real x);
-
-double fmod(double x, double y);
-float fmodf(float x, float y);
-real fmodl(real x, real y);
-
-double remainder(double x, double y);
-float remainderf(float x, float y);
-real remainderl(real x, real y);
-
-double remquo(double x, double y, int *quo);
-float remquof(float x, float y, int *quo);
-real remquol(real x, real y, int *quo);
-
-double copysign(double x, double y);
-float copysignf(float x, float y);
-real copysignl(real x, real y);
-
-double nan(char *tagp);
-float nanf(char *tagp);
-real nanl(char *tagp);
-
-double nextafter(double x, double y);
-float nextafterf(float x, float y);
-real nextafterl(real x, real y);
-
-double nexttoward(double x, real y);
-float nexttowardf(float x, real y);
-real nexttowardl(real x, real y);
-
-double fdim(double x, double y);
-float fdimf(float x, float y);
-real fdiml(real x, real y);
-
-double fmax(double x, double y);
-float fmaxf(float x, float y);
-real fmaxl(real x, real y);
-
-double fmin(double x, double y);
-float fminf(float x, float y);
-real fminl(real x, real y);
-
-double fma(double x, double y, double z);
-float fmaf(float x, float y, float z);
-real fmal(real x, real y, real z);
+const int MATH_ERRNO = 1; ///
+const int MATH_ERREXCEPT = 2; ///
+const int math_errhandling = MATH_ERRNO | MATH_ERREXCEPT; ///
+
+double acos(double x); ///
+float acosf(float x); /// ditto
+real acosl(real x); /// ditto
+
+double asin(double x); ///
+float asinf(float x); /// ditto
+real asinl(real x); /// ditto
+
+double atan(double x); ///
+float atanf(float x); /// ditto
+real atanl(real x); /// ditto
+
+double atan2(double y, double x); ///
+float atan2f(float y, float x); /// ditto
+real atan2l(real y, real x); /// ditto
+
+double cos(double x); ///
+float cosf(float x); /// ditto
+real cosl(real x); /// ditto
+
+double sin(double x); ///
+float sinf(float x); /// ditto
+real sinl(real x); /// ditto
+
+double tan(double x); ///
+float tanf(float x); /// ditto
+real tanl(real x); /// ditto
+
+double acosh(double x); ///
+float acoshf(float x); /// ditto
+real acoshl(real x); /// ditto
+
+double asinh(double x); ///
+float asinhf(float x); /// ditto
+real asinhl(real x); /// ditto
+
+double atanh(double x); ///
+float atanhf(float x); /// ditto
+real atanhl(real x); /// ditto
+
+double cosh(double x); ///
+float coshf(float x); /// ditto
+real coshl(real x); /// ditto
+
+double sinh(double x); ///
+float sinhf(float x); /// ditto
+real sinhl(real x); /// ditto
+
+double tanh(double x); ///
+float tanhf(float x); /// ditto
+real tanhl(real x); /// ditto
+
+double exp(double x); ///
+float expf(float x); /// ditto
+real expl(real x); /// ditto
+
+double exp2(double x); ///
+float exp2f(float x); /// ditto
+real exp2l(real x); /// ditto
+
+double expm1(double x); ///
+float expm1f(float x); /// ditto
+real expm1l(real x); /// ditto
+
+double frexp(double value, int *exp); ///
+float frexpf(float value, int *exp); /// ditto
+real frexpl(real value, int *exp); /// ditto
+
+int ilogb(double x); ///
+int ilogbf(float x); /// ditto
+int ilogbl(real x); /// ditto
+
+double ldexp(double x, int exp); ///
+float ldexpf(float x, int exp); /// ditto
+real ldexpl(real x, int exp); /// ditto
+
+double log(double x); ///
+float logf(float x); /// ditto
+real logl(real x); /// ditto
+
+double log10(double x); ///
+float log10f(float x); /// ditto
+real log10l(real x); /// ditto
+
+double log1p(double x); ///
+float log1pf(float x); /// ditto
+real log1pl(real x); /// ditto
+
+double log2(double x); ///
+float log2f(float x); /// ditto
+real log2l(real x); /// ditto
+
+double logb(double x); ///
+float logbf(float x); /// ditto
+real logbl(real x); /// ditto
+
+double modf(double value, double *iptr); ///
+float modff(float value, float *iptr); /// ditto
+real modfl(real value, real *iptr); /// ditto
+
+double scalbn(double x, int n); ///
+float scalbnf(float x, int n); /// ditto
+real scalbnl(real x, int n); /// ditto
+
+double scalbln(double x, int n); ///
+float scalblnf(float x, int n); /// ditto
+real scalblnl(real x, int n); /// ditto
+
+double cbrt(double x); ///
+float cbrtf(float x); /// ditto
+real cbrtl(real x); /// ditto
+
+double fabs(double x); ///
+float fabsf(float x); /// ditto
+real fabsl(real x); /// ditto
+
+double hypot(double x, double y); ///
+float hypotf(float x, float y); /// ditto
+real hypotl(real x, real y); /// ditto
+
+double pow(double x, double y); ///
+float powf(float x, float y); /// ditto
+real powl(real x, real y); /// ditto
+
+double sqrt(double x); ///
+float sqrtf(float x); /// ditto
+real sqrtl(real x); /// ditto
+
+double erf(double x); ///
+float erff(float x); /// ditto
+real erfl(real x); /// ditto
+
+double erfc(double x); ///
+float erfcf(float x); /// ditto
+real erfcl(real x); /// ditto
+
+double lgamma(double x); ///
+float lgammaf(float x); /// ditto
+real lgammal(real x); /// ditto
+
+double tgamma(double x); ///
+float tgammaf(float x); /// ditto
+real tgammal(real x); /// ditto
+
+double ceil(double x); ///
+float ceilf(float x); /// ditto
+real ceill(real x); /// ditto
+
+double floor(double x); ///
+float floorf(float x); /// ditto
+real floorl(real x); /// ditto
+
+double nearbyint(double x); ///
+float nearbyintf(float x); /// ditto
+real nearbyintl(real x); /// ditto
+
+double rint(double x); ///
+float rintf(float x); /// ditto
+real rintl(real x); /// ditto
+
+int lrint(double x); ///
+int lrintf(float x); /// ditto
+int lrintl(real x); /// ditto
+
+long llrint(double x); ///
+long llrintf(float x); /// ditto
+long llrintl(real x); /// ditto
+
+double round(double x); ///
+float roundf(float x); /// ditto
+real roundl(real x); /// ditto
+
+int lround(double x); ///
+int lroundf(float x); /// ditto
+int lroundl(real x); /// ditto
+
+long llround(double x); ///
+long llroundf(float x); /// ditto
+long llroundl(real x); /// ditto
+
+double trunc(double x); ///
+float truncf(float x); /// ditto
+real truncl(real x); /// ditto
+
+double fmod(double x, double y); ///
+float fmodf(float x, float y); /// ditto
+real fmodl(real x, real y); /// ditto
+
+double remainder(double x, double y); ///
+float remainderf(float x, float y); /// ditto
+real remainderl(real x, real y); /// ditto
+
+double remquo(double x, double y, int *quo); ///
+float remquof(float x, float y, int *quo); /// ditto
+real remquol(real x, real y, int *quo); /// ditto
+
+double copysign(double x, double y); ///
+float copysignf(float x, float y); /// ditto
+real copysignl(real x, real y); /// ditto
+
+double nan(char *tagp); ///
+float nanf(char *tagp); /// ditto
+real nanl(char *tagp); /// ditto
+
+double nextafter(double x, double y); ///
+float nextafterf(float x, float y); /// ditto
+real nextafterl(real x, real y); /// ditto
+
+double nexttoward(double x, real y); ///
+float nexttowardf(float x, real y); /// ditto
+real nexttowardl(real x, real y); /// ditto
+
+double fdim(double x, double y); ///
+float fdimf(float x, float y); /// ditto
+real fdiml(real x, real y); /// ditto
+
+double fmax(double x, double y); ///
+float fmaxf(float x, float y); /// ditto
+real fmaxl(real x, real y); /// ditto
+
+double fmin(double x, double y); ///
+float fminf(float x, float y); /// ditto
+real fminl(real x, real y); /// ditto
+
+double fma(double x, double y, double z); ///
+float fmaf(float x, float y, float z); /// ditto
+real fmal(real x, real y, real z); /// ditto
+///
int isgreater(real x, real y) { return !(x !> y); }
+///
int isgreaterequal(real x, real y) { return !(x !>= y); }
+///
int isless(real x, real y) { return !(x !< y); }
+///
int islessequal(real x, real y) { return !(x !<= y); }
+///
int islessgreater(real x, real y) { return !(x !<> y); }
+///
int isunordered(real x, real y) { return (x !<>= y); }
diff -uNr dmd-0.149/dmd/src/phobos/std/c/process.d dmd-0.150/dmd/src/phobos/std/c/process.d
--- dmd-0.149/dmd/src/phobos/std/c/process.d 2006-03-07 14:58:10.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/std/c/process.d 2006-03-18 23:51:32.000000000 +0100
@@ -1,10 +1,15 @@
-/* Interface to the C header file process.h
+/**
+ * C's <process.h>
+ * Authors: Walter Bright, Digital Mars, www.digitalmars.com
+ * License: Public Domain
+ * Macros:
+ * WIKI=Phobos/StdCProcess
*/
module std.c.process;
-import std.c.stddef;
+private import std.c.stddef;
extern (C):
diff -uNr dmd-0.149/dmd/src/phobos/std/c/stdarg.d dmd-0.150/dmd/src/phobos/std/c/stdarg.d
--- dmd-0.149/dmd/src/phobos/std/c/stdarg.d 2006-03-07 14:58:10.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/std/c/stdarg.d 2006-03-18 23:51:32.000000000 +0100
@@ -1,6 +1,10 @@
-/*
- * Placed in public domain.
- * Written by Hauke Duden and Walter Bright
+
+/**
+ * C's <stdarg.h>
+ * Authors: Hauke Duden and Walter Bright, Digital Mars, www.digitalmars.com
+ * License: Public Domain
+ * Macros:
+ * WIKI=Phobos/StdCStdarg
*/
/* This is for use with extern(C) variable argument lists. */
diff -uNr dmd-0.149/dmd/src/phobos/std/c/stddef.d dmd-0.150/dmd/src/phobos/std/c/stddef.d
--- dmd-0.149/dmd/src/phobos/std/c/stddef.d 2006-03-07 14:58:10.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/std/c/stddef.d 2006-03-18 23:51:32.000000000 +0100
@@ -1,8 +1,10 @@
-/*
- * Written by Walter Bright
- * Digital Mars
- * www.digitalmars.com
- * Placed into Public Domain.
+
+/**
+ * C's <stddef.h>
+ * Authors: Walter Bright, Digital Mars, www.digitalmars.com
+ * License: Public Domain
+ * Macros:
+ * WIKI=Phobos/StdCStddef
*/
module std.c.stddef;
diff -uNr dmd-0.149/dmd/src/phobos/std/c/stdio.d dmd-0.150/dmd/src/phobos/std/c/stdio.d
--- dmd-0.149/dmd/src/phobos/std/c/stdio.d 2006-03-07 14:58:10.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/std/c/stdio.d 2006-03-18 23:51:32.000000000 +0100
@@ -1,8 +1,10 @@
-/*
- * Written by Walter Bright
- * Digital Mars
- * www.digitalmars.com
- * Placed into Public Domain.
+
+/**
+ * C's <stdio.h>
+ * Authors: Walter Bright, Digital Mars, www.digitalmars.com
+ * License: Public Domain
+ * Macros:
+ * WIKI=Phobos/StdCStdio
*/
@@ -16,15 +18,15 @@
version (Win32)
{
- const int _NFILE = 60;
- const int BUFSIZ = 0x4000;
- const int EOF = -1;
- const int FOPEN_MAX = 20;
- const int FILENAME_MAX = 256; // 255 plus NULL
- const int TMP_MAX = 32767;
- const int _SYS_OPEN = 20;
- const int SYS_OPEN = _SYS_OPEN;
- const wchar WEOF = 0xFFFF;
+ const int _NFILE = 60; ///
+ const int BUFSIZ = 0x4000; ///
+ const int EOF = -1; ///
+ const int FOPEN_MAX = 20; ///
+ const int FILENAME_MAX = 256; /// 255 plus NULL
+ const int TMP_MAX = 32767; ///
+ const int _SYS_OPEN = 20; ///
+ const int SYS_OPEN = _SYS_OPEN; ///
+ const wchar WEOF = 0xFFFF; ///
}
version (linux)
@@ -77,7 +79,7 @@
}
}
-alias _iobuf FILE;
+alias _iobuf FILE; ///
enum
{
@@ -131,11 +133,11 @@
version (Win32)
{
- const FILE *stdin = &_iob[0];
- const FILE *stdout = &_iob[1];
- const FILE *stderr = &_iob[2];
- const FILE *stdaux = &_iob[3];
- const FILE *stdprn = &_iob[4];
+ const FILE *stdin = &_iob[0]; ///
+ const FILE *stdout = &_iob[1]; ///
+ const FILE *stderr = &_iob[2]; ///
+ const FILE *stdaux = &_iob[3]; ///
+ const FILE *stdprn = &_iob[4]; ///
}
version (linux)
@@ -152,63 +154,72 @@
const int L_tmpnam = _P_tmpdir.length + 12;
}
-alias int fpos_t;
+alias int fpos_t; ///
-char * tmpnam(char *);
-FILE * fopen(char *,char *);
-FILE * _fsopen(char *,char *,int );
-FILE * freopen(char *,char *,FILE *);
-int fseek(FILE *,int,int);
-int ftell(FILE *);
-char * fgets(char *,int,FILE *);
-int fgetc(FILE *);
-int _fgetchar();
-int fflush(FILE *);
-int fclose(FILE *);
-int fputs(char *,FILE *);
-char * gets(char *);
-int fputc(int,FILE *);
-int _fputchar(int);
-int puts(char *);
-int ungetc(int,FILE *);
-size_t fread(void *,size_t,size_t,FILE *);
-size_t fwrite(void *,size_t,size_t,FILE *);
-//int printf(char *,...);
-int fprintf(FILE *,char *,...);
-int vfprintf(FILE *,char *,va_list);
-int vprintf(char *,va_list);
-int sprintf(char *,char *,...);
-int vsprintf(char *,char *,va_list);
-int scanf(char *,...);
-int fscanf(FILE *,char *,...);
-int sscanf(char *,char *,...);
-void setbuf(FILE *,char *);
-int setvbuf(FILE *,char *,int,size_t);
-int remove(char *);
-int rename(char *,char *);
-void perror(char *);
-int fgetpos(FILE *,fpos_t *);
-int fsetpos(FILE *,fpos_t *);
-FILE * tmpfile();
+char * tmpnam(char *); ///
+FILE * fopen(char *,char *); ///
+FILE * _fsopen(char *,char *,int ); ///
+FILE * freopen(char *,char *,FILE *); ///
+int fseek(FILE *,int,int); ///
+int ftell(FILE *); ///
+char * fgets(char *,int,FILE *); ///
+int fgetc(FILE *); ///
+int _fgetchar(); ///
+int fflush(FILE *); ///
+int fclose(FILE *); ///
+int fputs(char *,FILE *); ///
+char * gets(char *); ///
+int fputc(int,FILE *); ///
+int _fputchar(int); ///
+int puts(char *); ///
+int ungetc(int,FILE *); ///
+size_t fread(void *,size_t,size_t,FILE *); ///
+size_t fwrite(void *,size_t,size_t,FILE *); ///
+//int printf(char *,...); ///
+int fprintf(FILE *,char *,...); ///
+int vfprintf(FILE *,char *,va_list); ///
+int vprintf(char *,va_list); ///
+int sprintf(char *,char *,...); ///
+int vsprintf(char *,char *,va_list); ///
+int scanf(char *,...); ///
+int fscanf(FILE *,char *,...); ///
+int sscanf(char *,char *,...); ///
+void setbuf(FILE *,char *); ///
+int setvbuf(FILE *,char *,int,size_t); ///
+int remove(char *); ///
+int rename(char *,char *); ///
+void perror(char *); ///
+int fgetpos(FILE *,fpos_t *); ///
+int fsetpos(FILE *,fpos_t *); ///
+FILE * tmpfile(); ///
int _rmtmp();
int _fillbuf(FILE *);
int _flushbu(int, FILE *);
-int getw(FILE *FHdl);
-int putw(int Word, FILE *FilePtr);
+int getw(FILE *FHdl); ///
+int putw(int Word, FILE *FilePtr); ///
+///
int getchar() { return getc(stdin); }
+///
int putchar(int c) { return putc(c,stdout); }
+///
int getc(FILE *fp) { return fgetc(fp); }
+///
int putc(int c,FILE *fp) { return fputc(c,fp); }
version (Win32)
{
+ ///
int ferror(FILE *fp) { return fp._flag&_IOERR; }
+ ///
int feof(FILE *fp) { return fp._flag&_IOEOF; }
+ ///
void clearerr(FILE *fp) { fp._flag &= ~(_IOERR|_IOEOF); }
+ ///
void rewind(FILE *fp) { fseek(fp,0L,SEEK_SET); fp._flag&=~_IOERR; }
int _bufsize(FILE *fp) { return fp._bufsiz; }
+ ///
int fileno(FILE *fp) { return fp._file; }
int _snprintf(char *,size_t,char *,...);
int _vsnprintf(char *,size_t,char *,va_list);
@@ -226,50 +237,54 @@
int vsnprintf(char *,size_t,char *,va_list);
}
-int unlink(char *);
-FILE * fdopen(int, char *);
-int fgetchar();
-int fputchar(int);
-int fcloseall();
-int filesize(char *);
-int flushall();
-int getch();
-int getche();
-int kbhit();
-char * tempnam (char *dir, char *pfx);
+int unlink(char *); ///
+FILE * fdopen(int, char *); ///
+int fgetchar(); ///
+int fputchar(int); ///
+int fcloseall(); ///
+int filesize(char *); ///
+int flushall(); ///
+int getch(); ///
+int getche(); ///
+int kbhit(); ///
+char * tempnam (char *dir, char *pfx); ///
-wchar_t * _wtmpnam(wchar_t *);
+wchar_t * _wtmpnam(wchar_t *); ///
FILE * _wfopen(wchar_t *, wchar_t *);
FILE * _wfsopen(wchar_t *, wchar_t *, int);
FILE * _wfreopen(wchar_t *, wchar_t *, FILE *);
-wchar_t * fgetws(wchar_t *, int, FILE *);
-int fputws(wchar_t *, FILE *);
+wchar_t * fgetws(wchar_t *, int, FILE *); ///
+int fputws(wchar_t *, FILE *); ///
wchar_t * _getws(wchar_t *);
int _putws(wchar_t *);
-int wprintf(wchar_t *, ...);
-int fwprintf(FILE *, wchar_t *, ...);
-int vwprintf(wchar_t *, va_list);
-int vfwprintf(FILE *, wchar_t *, va_list);
-int swprintf(wchar_t *, wchar_t *, ...);
-int vswprintf(wchar_t *, wchar_t *, va_list);
+int wprintf(wchar_t *, ...); ///
+int fwprintf(FILE *, wchar_t *, ...); ///
+int vwprintf(wchar_t *, va_list); ///
+int vfwprintf(FILE *, wchar_t *, va_list); ///
+int swprintf(wchar_t *, wchar_t *, ...); ///
+int vswprintf(wchar_t *, wchar_t *, va_list); ///
int _snwprintf(wchar_t *, size_t, wchar_t *, ...);
int _vsnwprintf(wchar_t *, size_t, wchar_t *, va_list);
-int wscanf(wchar_t *, ...);
-int fwscanf(FILE *, wchar_t *, ...);
-int swscanf(wchar_t *, wchar_t *, ...);
+int wscanf(wchar_t *, ...); ///
+int fwscanf(FILE *, wchar_t *, ...); ///
+int swscanf(wchar_t *, wchar_t *, ...); ///
int _wremove(wchar_t *);
void _wperror(wchar_t *);
FILE * _wfdopen(int, wchar_t *);
wchar_t * _wtempnam(wchar_t *, wchar_t *);
-wchar_t fgetwc(FILE *);
+wchar_t fgetwc(FILE *); ///
wchar_t _fgetwchar_t();
-wchar_t fputwc(wchar_t, FILE *);
+wchar_t fputwc(wchar_t, FILE *); ///
wchar_t _fputwchar_t(wchar_t);
-wchar_t ungetwc(wchar_t, FILE *);
+wchar_t ungetwc(wchar_t, FILE *); ///
+///
wchar_t getwchar_t() { return fgetwc(stdin); }
+///
wchar_t putwchar_t(wchar_t c) { return fputwc(c,stdout); }
+///
wchar_t getwc(FILE *fp) { return fgetwc(fp); }
+///
wchar_t putwc(wchar_t c, FILE *fp) { return fputwc(c, fp); }
-int fwide(FILE* fp, int mode);
+int fwide(FILE* fp, int mode); ///
diff -uNr dmd-0.149/dmd/src/phobos/std/c/stdlib.d dmd-0.150/dmd/src/phobos/std/c/stdlib.d
--- dmd-0.149/dmd/src/phobos/std/c/stdlib.d 2006-03-07 14:58:10.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/std/c/stdlib.d 2006-03-18 23:51:32.000000000 +0100
@@ -1,6 +1,16 @@
+/**
+ * C's <stdlib.h>
+ * Authors: Walter Bright, Digital Mars, www.digitalmars.com
+ * License: Public Domain
+ * Macros:
+ * WIKI=Phobos/StdCStdlib
+ */
+
module std.c.stdlib;
+private import std.c.stddef;
+
extern (C):
enum
@@ -12,59 +22,67 @@
_MAX_EXT = 256,
}
+///
struct div_t { int quot,rem; }
+///
struct ldiv_t { int quot,rem; }
+///
struct lldiv_t { long quot,rem; }
- div_t div(int,int);
- ldiv_t ldiv(int,int);
- lldiv_t lldiv(long, long);
-
- const int EXIT_SUCCESS = 0;
- const int EXIT_FAILURE = 1;
-
- int atexit(void (*)());
- void exit(int);
- void _exit(int);
-
- void *alloca(uint);
-
- void *calloc(uint, uint);
- void *malloc(uint);
- void *realloc(void *, uint);
- void free(void *);
+ div_t div(int,int); ///
+ ldiv_t ldiv(int,int); /// ditto
+ lldiv_t lldiv(long, long); /// ditto
+
+ const int EXIT_SUCCESS = 0; ///
+ const int EXIT_FAILURE = 1; /// ditto
+
+ int atexit(void (*)()); ///
+ void exit(int); /// ditto
+ void _exit(int); /// ditto
+
+ void *alloca(uint); ///
+
+ void *calloc(size_t, size_t); ///
+ void *malloc(size_t); /// ditto
+ void *realloc(void *, size_t); /// ditto
+ void free(void *); /// ditto
void *bsearch(void *,void *,size_t,size_t,
- int function(void *,void *));
- void qsort(void *base, uint nelems, uint elemsize,
- int (*compare)(void *elem1, void *elem2));
-
- char* getenv(char*);
- int setenv(char*, char*, int);
- void unsetenv(char*);
-
- int rand();
- void srand(uint);
- int random(int num);
- void randomize();
+ int function(void *,void *)); ///
+ void qsort(void *base, size_t nelems, size_t elemsize,
+ int (*compare)(void *elem1, void *elem2)); /// ditto
+
+ char* getenv(char*); ///
+ int setenv(char*, char*, int); /// ditto
+ void unsetenv(char*); /// ditto
+
+ int rand(); ///
+ void srand(uint); /// ditto
+ int random(int num); /// ditto
+ void randomize(); /// ditto
- int getErrno();
- int setErrno(int);
+ int getErrno(); /// ditto
+ int setErrno(int); /// ditto
const int ERANGE = 34; // on both Windows and linux
-double atof(char *);
-int atoi(char *);
-int atol(char *);
-float strtof(char *,char **);
-double strtod(char *,char **);
-real strtold(char *,char **);
-long strtol(char *,char **,int);
-uint strtoul(char *,char **,int);
-long atoll(char *);
-long strtoll(char *,char **,int);
-ulong strtoull(char *,char **,int);
-
-char* itoa(int, char*, int);
-char* ultoa(uint, char*, int);
-
+double atof(char *); ///
+int atoi(char *); /// ditto
+int atol(char *); /// ditto
+float strtof(char *,char **); /// ditto
+double strtod(char *,char **); /// ditto
+real strtold(char *,char **); /// ditto
+long strtol(char *,char **,int); /// ditto
+uint strtoul(char *,char **,int); /// ditto
+long atoll(char *); /// ditto
+long strtoll(char *,char **,int); /// ditto
+ulong strtoull(char *,char **,int); /// ditto
+
+char* itoa(int, char*, int); ///
+char* ultoa(uint, char*, int); /// ditto
+
+int mblen(char *s, size_t n); ///
+int mbtowc(wchar_t *pwc, char *s, size_t n); /// ditto
+int wctomb(char *s, wchar_t wc); /// ditto
+size_t mbstowcs(wchar_t *pwcs, char *s, size_t n); /// ditto
+size_t wcstombs(char *s, wchar_t *pwcs, size_t n); /// ditto
diff -uNr dmd-0.149/dmd/src/phobos/std/c/string.d dmd-0.150/dmd/src/phobos/std/c/string.d
--- dmd-0.149/dmd/src/phobos/std/c/string.d 1970-01-01 01:00:00.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/std/c/string.d 2006-03-18 23:51:32.000000000 +0100
@@ -0,0 +1,40 @@
+
+/**
+ * C's <string.h>
+ * Authors: Walter Bright, Digital Mars, www.digitalmars.com
+ * License: Public Domain
+ * Macros:
+ * WIKI=Phobos/StdCString
+ */
+
+module std.c.string;
+
+extern (C):
+
+void* memcpy(void* s1, void* s2, size_t n); ///
+void* memmove(void* s1, void* s2, size_t n); ///
+char* strcpy(char* s1, char* s2); ///
+char* strncpy(char* s1, char* s2, size_t n); ///
+char* strncat(char* s1, char* s2, size_t n); ///
+int strcoll(char* s1, char* s2); ///
+int strncmp(char* s1, char* s2, size_t n); ///
+size_t strxfrm(char* s1, char* s2, size_t n); ///
+void* memchr(void* s, int c, size_t n); ///
+char* strchr(char* s, int c); ///
+size_t strcspn(char* s1, char* s2); ///
+char* strpbrk(char* s1, char* s2); ///
+char* strrchr(char* s, int c); ///
+size_t strspn(char* s1, char* s2); ///
+char* strstr(char* s1, char* s2); ///
+char* strtok(char* s1, char* s2); ///
+void* memset(void* s, int c, size_t n); ///
+char* strerror(int errnum); ///
+int strlen(char* s); ///
+int strcmp(char* s1, char* s2); ///
+char* strcat(char* s1, char* s2); ///
+int memcmp(void* s1, void* s2, size_t n); ///
+
+version (Windows)
+{
+ int memicmp(char* s1, char* s2, size_t n); ///
+}
diff -uNr dmd-0.149/dmd/src/phobos/std/c/time.d dmd-0.150/dmd/src/phobos/std/c/time.d
--- dmd-0.149/dmd/src/phobos/std/c/time.d 2006-03-07 14:58:10.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/std/c/time.d 2006-03-18 23:51:32.000000000 +0100
@@ -1,12 +1,15 @@
-/* Written by Walter Bright
- * www.digitalmars.com
- * Placed into public domain.
+/**
+ * C's <time.h>
+ * Authors: Walter Bright, Digital Mars, www.digitalmars.com
+ * License: Public Domain
+ * Macros:
+ * WIKI=Phobos/StdCString
*/
module std.c.time;
-import std.c.stddef;
+private import std.c.stddef;
extern (C):
diff -uNr dmd-0.149/dmd/src/phobos/std/format.d dmd-0.150/dmd/src/phobos/std/format.d
--- dmd-0.149/dmd/src/phobos/std/format.d 2006-03-07 14:58:10.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/std/format.d 2006-03-18 23:51:32.000000000 +0100
@@ -36,6 +36,7 @@
private import std.utf;
private import std.c.stdlib;
+private import std.c.string;
private import std.string;
version (Windows)
diff -uNr dmd-0.149/dmd/src/phobos/std/loader.d dmd-0.150/dmd/src/phobos/std/loader.d
--- dmd-0.149/dmd/src/phobos/std/loader.d 2006-03-07 14:58:10.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/std/loader.d 2006-03-18 23:51:32.000000000 +0100
@@ -71,6 +71,7 @@
*/
private import std.string;
+private import std.c.string;
private import std.c.stdlib;
private import std.c.stdio;
diff -uNr dmd-0.149/dmd/src/phobos/std/md5.d dmd-0.150/dmd/src/phobos/std/md5.d
--- dmd-0.149/dmd/src/phobos/std/md5.d 2006-03-07 14:58:10.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/std/md5.d 2006-03-18 23:51:32.000000000 +0100
@@ -29,10 +29,12 @@
// This code is derived from the
// RSA Data Security, Inc. MD5 Message-Digest Algorithm.
-import std.md5;
-import std.string;
-import std.c.stdio;
-import std.stdio;
+module std.md5;
+
+private import std.stdio;
+private import std.string;
+private import std.c.stdio;
+private import std.c.string;
int main(char[][] args)
{
@@ -243,7 +245,7 @@
/* Transform as many times as possible. */
if (inputLen >= partLen)
{
- memcpy(&buffer[index], input, partLen);
+ std.c.string.memcpy(&buffer[index], input, partLen);
transform (buffer);
for (i = partLen; i + 63 < inputLen; i += 64)
@@ -256,7 +258,7 @@
/* Buffer remaining input */
if (inputLen - i)
- memcpy(&buffer[index], &input[i], inputLen-i);
+ std.c.string.memcpy(&buffer[index], &input[i], inputLen-i);
}
/** MD5 finalization. Ends an MD5 message-digest operation, writing the
@@ -285,7 +287,7 @@
Encode (digest, state, 16);
/* Zeroize sensitive information. */
- memset (this, 0, MD5_CTX.sizeof);
+ std.c.string.memset (this, 0, MD5_CTX.sizeof);
}
/* MD5 basic transformation. Transforms state based on block.
diff -uNr dmd-0.149/dmd/src/phobos/std/process.d dmd-0.150/dmd/src/phobos/std/process.d
--- dmd-0.149/dmd/src/phobos/std/process.d 2006-03-07 14:58:10.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/std/process.d 2006-03-18 23:51:32.000000000 +0100
@@ -29,6 +29,7 @@
module std.process;
private import std.c.stdlib;
+private import std.c.string;
private import std.string;
private import std.c.process;
diff -uNr dmd-0.149/dmd/src/phobos/std/regexp.d dmd-0.150/dmd/src/phobos/std/regexp.d
--- dmd-0.149/dmd/src/phobos/std/regexp.d 2006-03-07 14:58:10.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/std/regexp.d 2006-03-18 23:51:32.000000000 +0100
@@ -24,14 +24,14 @@
*/
/**********************************************
- * $(LINK2 "../../ctg/regular.html", Regular expressions)
+ * $(LINK2 ../../../ctg/regular.html, Regular expressions)
* are a powerful method of string pattern matching.
* The regular expression
* language used is the same as that commonly used, however, some of the very
* advanced forms may behave slightly differently.
*
* In the following guide, $(I pattern)[] refers to a
- * $(LINK2 "../../ctg/regular.html", regular expression).
+ * $(LINK2 ../../../ctg/regular.html, regular expression).
* The $(I attributes)[] refers to
a string controlling the interpretation
of the regular expression.
@@ -97,6 +97,7 @@
{
import std.c.stdio;
import std.c.stdlib;
+ import std.c.string;
import std.string;
import std.ctype;
import std.outbuffer;
diff -uNr dmd-0.149/dmd/src/phobos/std/socket.d dmd-0.150/dmd/src/phobos/std/socket.d
--- dmd-0.149/dmd/src/phobos/std/socket.d 2006-03-07 14:58:10.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/std/socket.d 2006-03-18 23:51:32.000000000 +0100
@@ -26,7 +26,7 @@
module std.socket;
-private import std.string, std.stdint, std.c.stdlib;
+private import std.string, std.stdint, std.c.string, std.c.stdlib;
version(linux)
diff -uNr dmd-0.149/dmd/src/phobos/std/stdint.d dmd-0.150/dmd/src/phobos/std/stdint.d
--- dmd-0.149/dmd/src/phobos/std/stdint.d 2006-03-07 14:58:10.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/std/stdint.d 2006-03-18 23:51:32.000000000 +0100
@@ -1,7 +1,120 @@
-/* Written by Walter Bright
- * www.digitalmars.com
- * Placed into Public Domain
+/**
+ *
+ D constrains integral types to specific sizes. But efficiency
+ of different sizes varies from machine to machine,
+ pointer sizes vary, and the maximum integer size varies.
+ stdint offers a portable way of trading off size
+ vs efficiency, in a manner compatible with the stdint.h
+ definitions in C.
+
+ The exact aliases are types of exactly the specified number of bits.
+ The at least aliases are at least the specified number of bits
+ large, and can be larger.
+ The fast aliases are the fastest integral type supported by the
+ processor that is at least as wide as the specified number of bits.
+
+ The aliases are:
+
+
+ Exact Alias
+ | Description
+ | At Least Alias
+ | Description
+ | Fast Alias
+ | Description
+ |
+ int8_t
+ | exactly 8 bits signed
+ | int_least8_t
+ | at least 8 bits signed
+ | int_fast8_t
+ | fast 8 bits signed
+ |
+ uint8_t
+ | exactly 8 bits unsigned
+ | uint_least8_t
+ | at least 8 bits unsigned
+ | uint_fast8_t
+ | fast 8 bits unsigned
+
+ |
+ int16_t
+ | exactly 16 bits signed
+ | int_least16_t
+ | at least 16 bits signed
+ | int_fast16_t
+ | fast 16 bits signed
+ |
+ uint16_t
+ | exactly 16 bits unsigned
+ | uint_least16_t
+ | at least 16 bits unsigned
+ | uint_fast16_t
+ | fast 16 bits unsigned
+
+ |
+ int32_t
+ | exactly 32 bits signed
+ | int_least32_t
+ | at least 32 bits signed
+ | int_fast32_t
+ | fast 32 bits signed
+ |
+ uint32_t
+ | exactly 32 bits unsigned
+ | uint_least32_t
+ | at least 32 bits unsigned
+ | uint_fast32_t
+ | fast 32 bits unsigned
+
+ |
+ int64_t
+ | exactly 64 bits signed
+ | int_least64_t
+ | at least 64 bits signed
+ | int_fast64_t
+ | fast 64 bits signed
+ |
+ uint64_t
+ | exactly 64 bits unsigned
+ | uint_least64_t
+ | at least 64 bits unsigned
+ | uint_fast64_t
+ | fast 64 bits unsigned
+ |
+
+ The ptr aliases are integral types guaranteed to be large enough
+ to hold a pointer without losing bits:
+
+
+ Alias
+ | Description
+ |
+ intptr_t
+ | signed integral type large enough to hold a pointer
+ |
+ uintptr_t
+ | unsigned integral type large enough to hold a pointer
+ |
+
+ The max aliases are the largest integral types:
+
+
+ Alias
+ | Description
+ |
+ intmax_t
+ | the largest signed integral type
+ |
+ uintmax_t
+ | the largest unsigned integral type
+ |
+
+ * Authors: Walter Bright, www.digitalmars.com
+ * License: Public Domain
+ * Macros:
+ * WIKI=Phobos/StdStdint
*/
module std.stdint;
diff -uNr dmd-0.149/dmd/src/phobos/std/string.d dmd-0.150/dmd/src/phobos/std/string.d
--- dmd-0.149/dmd/src/phobos/std/string.d 2006-03-07 14:58:10.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/std/string.d 2006-03-18 23:51:32.000000000 +0100
@@ -30,6 +30,7 @@
private import std.stdio;
private import std.c.stdio;
private import std.c.stdlib;
+private import std.c.string;
private import std.utf;
private import std.uni;
private import std.array;
@@ -39,21 +40,6 @@
extern (C)
{
- // Functions from the C library.
- int strlen(char *);
- int strcmp(char *, char *);
- char* strcat(char *, char *);
- int memcmp(void *, void *, uint);
- int memicmp(char *, char *, uint);
- char *strcpy(char *, char *);
- char *strstr(char *, char *);
- char *strchr(char *, char);
- char *strrchr(char *, char);
- char *memchr(char *, char, uint);
- void *memcpy(void *, void *, uint);
- void *memmove(void *, void *, uint);
- void *memset(void *, uint, uint);
- char* strerror(int);
int wcslen(wchar *);
int wcscmp(wchar *, wchar *);
@@ -290,7 +276,7 @@
if (c <= 0x7F)
{ // Plain old ASCII
- p = memchr(s, c, s.length);
+ p = cast(char*)memchr(s, c, s.length);
if (p)
return p - cast(char *)s;
else
@@ -526,7 +512,7 @@
char c = sub[0];
if (sublength == 1)
{
- char *p = memchr(s, c, s.length);
+ char *p = cast(char*)memchr(s, c, s.length);
if (p)
return p - &s[0];
}
@@ -540,7 +526,7 @@
for (size_t i = 0; i < imax; i++)
{
- char *p = memchr(&s[i], c, imax - i);
+ char *p = cast(char*)memchr(&s[i], c, imax - i);
if (!p)
break;
i = p - &s[0];
@@ -1254,7 +1240,7 @@
while (true)
{
nwords++;
- p = memchr(p, c, pend - p);
+ p = cast(char*)memchr(p, c, pend - p);
if (!p)
break;
p++;
@@ -1269,7 +1255,7 @@
i = 0;
while (true)
{
- p = memchr(&s[i], c, s.length - i);
+ p = cast(char*)memchr(&s[i], c, s.length - i);
if (!p)
{
words[wordi] = s[i .. s.length];
diff -uNr dmd-0.149/dmd/src/phobos/std/syserror.d dmd-0.150/dmd/src/phobos/std/syserror.d
--- dmd-0.149/dmd/src/phobos/std/syserror.d 2006-03-07 14:58:10.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/std/syserror.d 2006-03-18 23:51:32.000000000 +0100
@@ -10,6 +10,7 @@
deprecated class SysError
{
private import std.c.stdio;
+ private import std.c.string;
private import std.string;
static char[] msg(uint errcode)
diff -uNr dmd-0.149/dmd/src/phobos/std/thread.d dmd-0.150/dmd/src/phobos/std/thread.d
--- dmd-0.149/dmd/src/phobos/std/thread.d 2006-03-07 14:58:10.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/std/thread.d 2006-03-18 23:51:32.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2002-2004 by Digital Mars, www.digitalmars.com
+ * Copyright (C) 2002-2006 by Digital Mars, www.digitalmars.com
* Written by Walter Bright
*
* This software is provided 'as-is', without any express or implied
@@ -20,6 +20,18 @@
* distribution.
*/
+/**************************
+ * The thread module defines the class $(B Thread).
+ *
+ * $(B Thread) is the basis
+ * for writing multithreaded applications. Each thread
+ * has a unique instance of class $(B Thread) associated with it.
+ * It is important to use the $(B Thread) class to create and manage
+ * threads as the garbage collector needs to know about all the threads.
+ * Macros:
+ * WIKI=Phobos/StdThread
+ */
+
module std.thread;
//debug=thread;
@@ -112,6 +124,12 @@
return dg();
}
+ /*****************************
+ * Wait for this thread to terminate.
+ * Simply returns if thread has already terminated.
+ * Throws: $(B ThreadError) if the thread hasn't begun yet or
+ * is called on itself.
+ */
void wait()
{
if (this is getThis())
@@ -123,6 +141,13 @@
}
}
+ /******************************
+ * Wait for this thread to terminate or until milliseconds time has
+ * elapsed, whichever occurs first.
+ * Simply returns if thread has already terminated.
+ * Throws: $(B ThreadError) if the thread hasn't begun yet or
+ * is called on itself.
+ */
void wait(uint milliseconds)
{
if (this is getThis())
diff -uNr dmd-0.149/dmd/src/phobos/std/typeinfo/ti_Aa.d dmd-0.150/dmd/src/phobos/std/typeinfo/ti_Aa.d
--- dmd-0.149/dmd/src/phobos/std/typeinfo/ti_Aa.d 2006-03-07 14:58:12.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/std/typeinfo/ti_Aa.d 2006-03-18 23:51:32.000000000 +0100
@@ -2,6 +2,7 @@
module std.typeinfo.Aa;
private import std.string;
+private import std.c.string;
// char[]
diff -uNr dmd-0.149/dmd/src/phobos/std/typeinfo/ti_Adchar.d dmd-0.150/dmd/src/phobos/std/typeinfo/ti_Adchar.d
--- dmd-0.149/dmd/src/phobos/std/typeinfo/ti_Adchar.d 2006-03-07 14:58:10.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/std/typeinfo/ti_Adchar.d 2006-03-18 23:51:32.000000000 +0100
@@ -1,7 +1,7 @@
module std.typeinfo.ti_Adchar;
-private import std.string;
+private import std.c.string;
// dchar[]
diff -uNr dmd-0.149/dmd/src/phobos/std/typeinfo/ti_Ag.d dmd-0.150/dmd/src/phobos/std/typeinfo/ti_Ag.d
--- dmd-0.149/dmd/src/phobos/std/typeinfo/ti_Ag.d 2006-03-07 14:58:12.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/std/typeinfo/ti_Ag.d 2006-03-18 23:51:32.000000000 +0100
@@ -2,6 +2,7 @@
module std.typeinfo.ti_Ag;
private import std.string;
+private import std.c.string;
// byte[]
diff -uNr dmd-0.149/dmd/src/phobos/std/typeinfo/ti_Aint.d dmd-0.150/dmd/src/phobos/std/typeinfo/ti_Aint.d
--- dmd-0.149/dmd/src/phobos/std/typeinfo/ti_Aint.d 2006-03-07 14:58:12.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/std/typeinfo/ti_Aint.d 2006-03-18 23:51:32.000000000 +0100
@@ -1,7 +1,7 @@
module std.typeinfo.ti_Aint;
-private import std.string;
+private import std.c.string;
// int[]
diff -uNr dmd-0.149/dmd/src/phobos/std/typeinfo/ti_Along.d dmd-0.150/dmd/src/phobos/std/typeinfo/ti_Along.d
--- dmd-0.149/dmd/src/phobos/std/typeinfo/ti_Along.d 2006-03-07 14:58:12.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/std/typeinfo/ti_Along.d 2006-03-18 23:51:32.000000000 +0100
@@ -1,7 +1,7 @@
module std.typeinfo.ti_Along;
-private import std.string;
+private import std.c.string;
// long[]
diff -uNr dmd-0.149/dmd/src/phobos/std/typeinfo/ti_Ashort.d dmd-0.150/dmd/src/phobos/std/typeinfo/ti_Ashort.d
--- dmd-0.149/dmd/src/phobos/std/typeinfo/ti_Ashort.d 2006-03-07 14:58:12.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/std/typeinfo/ti_Ashort.d 2006-03-18 23:51:32.000000000 +0100
@@ -2,6 +2,7 @@
module std.typeinfo.ti_Ashort;
private import std.string;
+private import std.c.string;
// short[]
diff -uNr dmd-0.149/dmd/src/phobos/std/typeinfo/ti_Aubyte.d dmd-0.150/dmd/src/phobos/std/typeinfo/ti_Aubyte.d
--- dmd-0.149/dmd/src/phobos/std/typeinfo/ti_Aubyte.d 2006-03-07 14:58:12.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/std/typeinfo/ti_Aubyte.d 2006-03-18 23:51:32.000000000 +0100
@@ -1,6 +1,7 @@
module std.typeinfo.ti_Aubyte;
+private import std.c.string;
private import std.string;
// ubyte[]
diff -uNr dmd-0.149/dmd/src/phobos/std/typeinfo/ti_Auint.d dmd-0.150/dmd/src/phobos/std/typeinfo/ti_Auint.d
--- dmd-0.149/dmd/src/phobos/std/typeinfo/ti_Auint.d 2006-03-07 14:58:12.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/std/typeinfo/ti_Auint.d 2006-03-18 23:51:32.000000000 +0100
@@ -1,7 +1,7 @@
module std.typeinfo.ti_Auint;
-private import std.string;
+private import std.c.string;
// uint[]
diff -uNr dmd-0.149/dmd/src/phobos/std/typeinfo/ti_Aulong.d dmd-0.150/dmd/src/phobos/std/typeinfo/ti_Aulong.d
--- dmd-0.149/dmd/src/phobos/std/typeinfo/ti_Aulong.d 2006-03-07 14:58:12.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/std/typeinfo/ti_Aulong.d 2006-03-18 23:51:32.000000000 +0100
@@ -1,7 +1,7 @@
module std.typeinfo.ti_Aulong;
-private import std.string;
+private import std.c.string;
// ulong[]
diff -uNr dmd-0.149/dmd/src/phobos/std/typeinfo/ti_Aushort.d dmd-0.150/dmd/src/phobos/std/typeinfo/ti_Aushort.d
--- dmd-0.149/dmd/src/phobos/std/typeinfo/ti_Aushort.d 2006-03-07 14:58:12.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/std/typeinfo/ti_Aushort.d 2006-03-18 23:51:32.000000000 +0100
@@ -1,6 +1,7 @@
module std.typeinfo.ti_Aushort;
+private import std.c.string;
private import std.string;
// ushort[]
diff -uNr dmd-0.149/dmd/src/phobos/std/typeinfo/ti_Awchar.d dmd-0.150/dmd/src/phobos/std/typeinfo/ti_Awchar.d
--- dmd-0.149/dmd/src/phobos/std/typeinfo/ti_Awchar.d 2006-03-07 14:58:12.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/std/typeinfo/ti_Awchar.d 2006-03-18 23:51:32.000000000 +0100
@@ -1,7 +1,7 @@
module std.typeinfo.ti_Awchar;
-private import std.string;
+private import std.c.string;
// wchar[]
diff -uNr dmd-0.149/dmd/src/phobos/std.ddoc dmd-0.150/dmd/src/phobos/std.ddoc
--- dmd-0.149/dmd/src/phobos/std.ddoc 2006-03-07 14:58:10.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/std.ddoc 2006-03-18 23:51:32.000000000 +0100
@@ -83,15 +83,22 @@
std.utf
std.zip
std.zlib
+ std.c.fenv
+ std.c.math
+ std.c.process
+ std.c.stdarg
+ std.c.stddef
+ std.c.stdio
+ std.c.stdlib
+ std.c.string
+ std.c.time
+ std.c.wcharh
std.windows.charset
std.windows
std.linux
-std.c
- std.c.stdio
-
std.c.windows
std.c.linux
diff -uNr dmd-0.149/dmd/src/phobos/win32.mak dmd-0.150/dmd/src/phobos/win32.mak
--- dmd-0.149/dmd/src/phobos/win32.mak 2006-03-07 14:58:10.000000000 +0100
+++ dmd-0.150/dmd/src/phobos/win32.mak 2006-03-18 23:51:32.000000000 +0100
@@ -101,7 +101,17 @@
$(DOC)\std_regexp.html \
$(DOC)\std_bitarray.html \
$(DOC)\std_stdio.html \
- $(DOC)\std_windows_charset.html
+ $(DOC)\std_windows_charset.html \
+ $(DOC)\std_c_fenv.html \
+ $(DOC)\std_c_math.html \
+ $(DOC)\std_c_process.html \
+ $(DOC)\std_c_stdarg.html \
+ $(DOC)\std_c_stddef.html \
+ $(DOC)\std_c_stdio.html \
+ $(DOC)\std_c_stdlib.html \
+ $(DOC)\std_c_string.html \
+ $(DOC)\std_c_time.html \
+ $(DOC)\std_c_wcharh.html
SRC= errno.c object.d unittest.d crc32.d gcstats.d
@@ -117,7 +127,7 @@
std\cstream.d std\demangle.d std\cover.d std\bitarray.d
SRC_STD_C= std\c\process.d std\c\stdlib.d std\c\time.d std\c\stdio.d \
- std\c\math.d std\c\stdarg.d std\c\stddef.d std\c\fenv.d
+ std\c\math.d std\c\stdarg.d std\c\stddef.d std\c\fenv.d std\c\string.d
SRC_TI= \
std\typeinfo\ti_wchar.d std\typeinfo\ti_uint.d \
@@ -842,6 +852,36 @@
$(DOC)\object.html : std.ddoc internal\object.d
$(DMD) -c -o- $(DFLAGS) -Df$(DOC)\object.html std.ddoc internal\object.d
+$(DOC)\std_c_fenv.html : std.ddoc std\c\fenv.d
+ $(DMD) -c -o- $(DFLAGS) -Df$(DOC)\std_c_fenv.html std.ddoc std\c\fenv.d
+
+$(DOC)\std_c_math.html : std.ddoc std\c\math.d
+ $(DMD) -c -o- $(DFLAGS) -Df$(DOC)\std_c_math.html std.ddoc std\c\math.d
+
+$(DOC)\std_c_process.html : std.ddoc std\c\process.d
+ $(DMD) -c -o- $(DFLAGS) -Df$(DOC)\std_c_process.html std.ddoc std\c\process.d
+
+$(DOC)\std_c_stdarg.html : std.ddoc std\c\stdarg.d
+ $(DMD) -c -o- $(DFLAGS) -Df$(DOC)\std_c_stdarg.html std.ddoc std\c\stdarg.d
+
+$(DOC)\std_c_stddef.html : std.ddoc std\c\stddef.d
+ $(DMD) -c -o- $(DFLAGS) -Df$(DOC)\std_c_stddef.html std.ddoc std\c\stddef.d
+
+$(DOC)\std_c_stdio.html : std.ddoc std\c\stdio.d
+ $(DMD) -c -o- $(DFLAGS) -Df$(DOC)\std_c_stdio.html std.ddoc std\c\stdio.d
+
+$(DOC)\std_c_stdlib.html : std.ddoc std\c\stdlib.d
+ $(DMD) -c -o- $(DFLAGS) -Df$(DOC)\std_c_stdlib.html std.ddoc std\c\stdlib.d
+
+$(DOC)\std_c_string.html : std.ddoc std\c\string.d
+ $(DMD) -c -o- $(DFLAGS) -Df$(DOC)\std_c_string.html std.ddoc std\c\string.d
+
+$(DOC)\std_c_time.html : std.ddoc std\c\time.d
+ $(DMD) -c -o- $(DFLAGS) -Df$(DOC)\std_c_time.html std.ddoc std\c\time.d
+
+$(DOC)\std_c_wcharh.html : std.ddoc std\c\wcharh.d
+ $(DMD) -c -o- $(DFLAGS) -Df$(DOC)\std_c_wcharh.html std.ddoc std\c\wcharh.d
+
######################################################