Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #97 from klickverbot/property
Browse files Browse the repository at this point in the history
Strict @Property syntax compliance (-property)
  • Loading branch information
complexmath committed Dec 2, 2011
2 parents 70f5abd + 6ce26bf commit e419fc9
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion import/object.di
Expand Up @@ -459,7 +459,7 @@ void clear(T)(ref T obj) if (is(T == struct))
{
typeid(T).destroy(&obj);
auto buf = (cast(ubyte*) &obj)[0 .. T.sizeof];
auto init = cast(ubyte[])typeid(T).init;
auto init = cast(ubyte[])typeid(T).init();
if(init.ptr is null) // null ptr means initialize to 0s
buf[] = 0;
else
Expand Down
4 changes: 2 additions & 2 deletions posix.mak
Expand Up @@ -27,8 +27,8 @@ IMPDIR=import

MODEL=32

DFLAGS=-m$(MODEL) -O -release -inline -nofloat -w -d -Isrc -Iimport
UDFLAGS=-m$(MODEL) -O -release -nofloat -w -d -Isrc -Iimport
DFLAGS=-m$(MODEL) -O -release -inline -nofloat -w -d -Isrc -Iimport -property
UDFLAGS=-m$(MODEL) -O -release -nofloat -w -d -Isrc -Iimport -property

CFLAGS=-m$(MODEL) -O

Expand Down
6 changes: 3 additions & 3 deletions src/core/time.d
Expand Up @@ -2596,9 +2596,9 @@ public:
auto fs = FracSec(12);
const cfs = FracSec(12);
immutable ifs = FracSec(12);
assert(fs.toString == "12 hnsecs");
assert(cfs.toString == "12 hnsecs");
assert(ifs.toString == "12 hnsecs");
assert(fs.toString() == "12 hnsecs");
assert(cfs.toString() == "12 hnsecs");
assert(ifs.toString() == "12 hnsecs");
}


Expand Down
14 changes: 7 additions & 7 deletions src/object_.d
Expand Up @@ -924,7 +924,7 @@ class TypeInfo_Struct : TypeInfo
return this is o ||
((s = cast(TypeInfo_Struct)o) !is null &&
this.name == s.name &&
this.init.length == s.init.length);
this.init().length == s.init().length);
}

override hash_t getHash(in void* p)
Expand All @@ -938,7 +938,7 @@ class TypeInfo_Struct : TypeInfo
else
{
debug(PRINTF) printf("getHash() using default hash\n");
return hashOf(p, init.length);
return hashOf(p, init().length);
}
}

Expand All @@ -952,7 +952,7 @@ class TypeInfo_Struct : TypeInfo
return true;
else
// BUG: relies on the GC not moving objects
return memcmp(p1, p2, init.length) == 0;
return memcmp(p1, p2, init().length) == 0;
}

override int compare(in void* p1, in void* p2)
Expand All @@ -968,7 +968,7 @@ class TypeInfo_Struct : TypeInfo
return (*xopCmp)(p2, p1);
else
// BUG: relies on the GC not moving objects
return memcmp(p1, p2, init.length);
return memcmp(p1, p2, init().length);
}
else
return -1;
Expand All @@ -978,7 +978,7 @@ class TypeInfo_Struct : TypeInfo

@property override size_t tsize() nothrow pure
{
return init.length;
return init().length;
}

override void[] init() nothrow pure { return m_init; }
Expand Down Expand Up @@ -1153,7 +1153,7 @@ class TypeInfo_Const : TypeInfo

@property override TypeInfo next() nothrow pure { return base.next; }
@property override uint flags() nothrow pure { return base.flags; }
override void[] init() nothrow pure { return base.init; }
override void[] init() nothrow pure { return base.init(); }

@property override size_t talign() nothrow pure { return base.talign(); }

Expand Down Expand Up @@ -2614,7 +2614,7 @@ version(unittest) unittest
destroyed ++;
}
}

struct B
{
C c;
Expand Down
4 changes: 2 additions & 2 deletions win32.mak
Expand Up @@ -6,8 +6,8 @@ CC=dmc
DOCDIR=doc
IMPDIR=import

DFLAGS=-O -release -inline -nofloat -w -d -Isrc -Iimport
UDFLAGS=-O -release -nofloat -w -d -Isrc -Iimport
DFLAGS=-O -release -inline -nofloat -w -d -Isrc -Iimport -property
UDFLAGS=-O -release -nofloat -w -d -Isrc -Iimport -property

CFLAGS=

Expand Down

0 comments on commit e419fc9

Please sign in to comment.