Skip to content

Commit 47d5e54

Browse files
authored
Merge pull request #27 from s-ludwig/fix_deprecations
Fix all deprecation warnings
2 parents b174329 + 9313647 commit 47d5e54

11 files changed

Lines changed: 22 additions & 21 deletions

File tree

engine/source/dmdscript/RandAA.d

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ struct aard (K, V, bool useRandom = false)
8080
assert(0);
8181
}
8282

83-
V* opIn_r(K k)
83+
84+
V* opBinaryRight(string op : "in")(K k)
8485
{
8586
if(imp_ is null)
8687
return null;
@@ -153,7 +154,7 @@ struct aard (K, V, bool useRandom = false)
153154

154155
V get(K k)
155156
{
156-
V* p = opIn_r(k);
157+
V* p = k in this;
157158
if(p !is null)
158159
{
159160
return *p;
@@ -165,7 +166,7 @@ struct aard (K, V, bool useRandom = false)
165166
{
166167
if(imp_ !is null)
167168
{
168-
V* p = opIn_r(k);
169+
V* p = k in this;
169170
if(p !is null)
170171
{
171172
val = *p;
@@ -728,7 +729,7 @@ public:
728729
}
729730
}
730731
/**Returns null if index is not found.*/
731-
V* opIn_r(K index)
732+
V* opBinaryRight(string op : "in")(K index)
732733
{
733734
size_t i = findExisting(index);
734735
if(i == size_t.max)

engine/source/dmdscript/darray.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -753,8 +753,8 @@ void *Darray_prototype_sort(Dobject pthis, CallContext *cc, Dobject othis, Value
753753
}
754754
}
755755

756-
delete p1;
757-
delete p2;
756+
destroy(p1);
757+
destroy(p2);
758758

759759
ret.putVobject(othis);
760760
return null;

engine/source/dmdscript/ddeclaredfunction.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ class DdeclaredFunction : Dfunction
148148

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

151-
delete p1;
151+
destroy(p1);
152152

153153
cc.callerf = callerfsave;
154154
cc.caller = callersave;

engine/source/dmdscript/dfunction.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ void* Dfunction_prototype_apply(Dobject pthis, CallContext *cc, Dobject othis, V
224224

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

227-
delete p1;
227+
destroy(p1);
228228
}
229229
return v;
230230
}

engine/source/dmdscript/dglobal.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ void* Dglobal_eval(Dobject pthis, CallContext *cc, Dobject othis, Value* ret, Va
155155
assert(cc.callerothis);
156156
result = IR.call(cc, cc.callerothis, fd.code, ret, locals.ptr);
157157
if(p1)
158-
delete p1;
158+
destroy(p1);
159159
fd = null;
160160
// if (result) writef("result = '%s'\n", (cast(Value* )result).toString());
161161
return result;

engine/source/dmdscript/irstate.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ struct IRstate
6262
{
6363
assert(codebuf.offset <= codebuf.data.length);
6464
if(codebuf.data.length > codebuf.data.capacity)
65-
printf("ptr %p, length %d, capacity %d\n", codebuf.data.ptr, codebuf.data.length, core.memory.GC.sizeOf(codebuf.data.ptr));
65+
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));
6666
assert(codebuf.data.length <= codebuf.data.capacity);
6767
for(uint u = 0; u < codebuf.offset; )
6868
{
@@ -485,7 +485,7 @@ struct IRstate
485485
}
486486
}
487487

488-
delete p1;
488+
destroy(p1);
489489

490490
//return;
491491
// Remove all IRnop's

engine/source/dmdscript/iterator.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ struct Iterator
8484
{
8585
while(keyindex == keys.length)
8686
{
87-
delete keys;
87+
destroy(keys);
8888
o = getPrototype(o);
8989
if(!o)
9090
return null;

engine/source/dmdscript/outbuffer.d

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class OutBuffer
7575
{
7676
assert(offset + nbytes <= data.length);
7777
}
78-
body
78+
do
7979
{
8080
//c.stdio.printf("OutBuffer.reserve: length = %d, offset = %d, nbytes = %d\n", data.length, offset, nbytes);
8181
if (data.length < offset + nbytes)
@@ -210,7 +210,7 @@ class OutBuffer
210210
{
211211
assert((offset & (alignsize - 1)) == 0);
212212
}
213-
body
213+
do
214214
{ uint nbytes;
215215

216216
nbytes = offset & (alignsize - 1);
@@ -261,7 +261,7 @@ class OutBuffer
261261
{
262262
assert(index <= offset);
263263
}
264-
body
264+
do
265265
{
266266
reserve(nbytes);
267267

engine/source/dmdscript/parse.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class Parser : Lexer
9898
if(p.errinfo.message)
9999
goto Lreturn;
100100

101-
delete p;
101+
destroy(p);
102102

103103
// Parse StatementList
104104
p = new Parser("anonymous", bdy, 0);
@@ -119,7 +119,7 @@ class Parser : Lexer
119119
pfd = fd;
120120
perrinfo = p.errinfo;
121121
result = (p.errinfo.message != null);
122-
delete p;
122+
destroy(p);
123123
p = null;
124124
return result;
125125
}

engine/source/dmdscript/program.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,13 +227,13 @@ class Program
227227

228228
result.getErrInfo(cc, &errinfo, cc.linnum);
229229
cc.linnum = 0;
230-
delete p1;
230+
destroy(p1);
231231
throw new ScriptException(&errinfo);
232232
}
233233
//writef("-Program.execute()\n");
234234

235235

236-
delete p1;
236+
destroy(p1);
237237
}
238238

239239
void toBuffer(ref tchar[] buf)

0 commit comments

Comments
 (0)