Skip to content

Commit

Permalink
Merge pull request #27 from s-ludwig/fix_deprecations
Browse files Browse the repository at this point in the history
Fix all deprecation warnings
  • Loading branch information
WalterBright authored Dec 16, 2021
2 parents b174329 + 9313647 commit 47d5e54
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 21 deletions.
9 changes: 5 additions & 4 deletions engine/source/dmdscript/RandAA.d
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ struct aard (K, V, bool useRandom = false)
assert(0);
}

V* opIn_r(K k)

V* opBinaryRight(string op : "in")(K k)
{
if(imp_ is null)
return null;
Expand Down Expand Up @@ -153,7 +154,7 @@ struct aard (K, V, bool useRandom = false)

V get(K k)
{
V* p = opIn_r(k);
V* p = k in this;
if(p !is null)
{
return *p;
Expand All @@ -165,7 +166,7 @@ struct aard (K, V, bool useRandom = false)
{
if(imp_ !is null)
{
V* p = opIn_r(k);
V* p = k in this;
if(p !is null)
{
val = *p;
Expand Down Expand Up @@ -728,7 +729,7 @@ public:
}
}
/**Returns null if index is not found.*/
V* opIn_r(K index)
V* opBinaryRight(string op : "in")(K index)
{
size_t i = findExisting(index);
if(i == size_t.max)
Expand Down
4 changes: 2 additions & 2 deletions engine/source/dmdscript/darray.d
Original file line number Diff line number Diff line change
Expand Up @@ -753,8 +753,8 @@ void *Darray_prototype_sort(Dobject pthis, CallContext *cc, Dobject othis, Value
}
}

delete p1;
delete p2;
destroy(p1);
destroy(p2);

ret.putVobject(othis);
return null;
Expand Down
2 changes: 1 addition & 1 deletion engine/source/dmdscript/ddeclaredfunction.d
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class DdeclaredFunction : Dfunction

result = IR.call(cc, othis, fd.code, ret, locals.ptr);

delete p1;
destroy(p1);

cc.callerf = callerfsave;
cc.caller = callersave;
Expand Down
2 changes: 1 addition & 1 deletion engine/source/dmdscript/dfunction.d
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ void* Dfunction_prototype_apply(Dobject pthis, CallContext *cc, Dobject othis, V

v = othis.Call(cc, o, ret, alist);

delete p1;
destroy(p1);
}
return v;
}
Expand Down
2 changes: 1 addition & 1 deletion engine/source/dmdscript/dglobal.d
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ void* Dglobal_eval(Dobject pthis, CallContext *cc, Dobject othis, Value* ret, Va
assert(cc.callerothis);
result = IR.call(cc, cc.callerothis, fd.code, ret, locals.ptr);
if(p1)
delete p1;
destroy(p1);
fd = null;
// if (result) writef("result = '%s'\n", (cast(Value* )result).toString());
return result;
Expand Down
4 changes: 2 additions & 2 deletions engine/source/dmdscript/irstate.d
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ struct IRstate
{
assert(codebuf.offset <= codebuf.data.length);
if(codebuf.data.length > codebuf.data.capacity)
printf("ptr %p, length %d, capacity %d\n", codebuf.data.ptr, codebuf.data.length, core.memory.GC.sizeOf(codebuf.data.ptr));
printf("ptr %p, length %d, capacity %d\n", codebuf.data.ptr, cast(uint)codebuf.data.length, cast(uint)core.memory.GC.sizeOf(codebuf.data.ptr));
assert(codebuf.data.length <= codebuf.data.capacity);
for(uint u = 0; u < codebuf.offset; )
{
Expand Down Expand Up @@ -485,7 +485,7 @@ struct IRstate
}
}

delete p1;
destroy(p1);

//return;
// Remove all IRnop's
Expand Down
2 changes: 1 addition & 1 deletion engine/source/dmdscript/iterator.d
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ struct Iterator
{
while(keyindex == keys.length)
{
delete keys;
destroy(keys);
o = getPrototype(o);
if(!o)
return null;
Expand Down
6 changes: 3 additions & 3 deletions engine/source/dmdscript/outbuffer.d
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class OutBuffer
{
assert(offset + nbytes <= data.length);
}
body
do
{
//c.stdio.printf("OutBuffer.reserve: length = %d, offset = %d, nbytes = %d\n", data.length, offset, nbytes);
if (data.length < offset + nbytes)
Expand Down Expand Up @@ -210,7 +210,7 @@ class OutBuffer
{
assert((offset & (alignsize - 1)) == 0);
}
body
do
{ uint nbytes;

nbytes = offset & (alignsize - 1);
Expand Down Expand Up @@ -261,7 +261,7 @@ class OutBuffer
{
assert(index <= offset);
}
body
do
{
reserve(nbytes);

Expand Down
4 changes: 2 additions & 2 deletions engine/source/dmdscript/parse.d
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class Parser : Lexer
if(p.errinfo.message)
goto Lreturn;

delete p;
destroy(p);

// Parse StatementList
p = new Parser("anonymous", bdy, 0);
Expand All @@ -119,7 +119,7 @@ class Parser : Lexer
pfd = fd;
perrinfo = p.errinfo;
result = (p.errinfo.message != null);
delete p;
destroy(p);
p = null;
return result;
}
Expand Down
4 changes: 2 additions & 2 deletions engine/source/dmdscript/program.d
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,13 @@ class Program

result.getErrInfo(cc, &errinfo, cc.linnum);
cc.linnum = 0;
delete p1;
destroy(p1);
throw new ScriptException(&errinfo);
}
//writef("-Program.execute()\n");


delete p1;
destroy(p1);
}

void toBuffer(ref tchar[] buf)
Expand Down
4 changes: 2 additions & 2 deletions engine/source/dmdscript/value.d
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ struct Value
{
assert(b == 1 || b == 0);
}
body
do
{ vtype = V_BOOLEAN;
dbool = b; }

Expand Down Expand Up @@ -178,7 +178,7 @@ struct Value
static void copy(Value* to, Value* from)
in { }
out { assert(memcmp(to, from, Value.sizeof) == 0); }
body
do

{
/+version(all /*UseAsm*/)
Expand Down

0 comments on commit 47d5e54

Please sign in to comment.