Skip to content

Commit bbdd562

Browse files
authored
Merge pull request #246 from jrfondren/silence-contract-deprecations
s/body/do/ in contracts, valid for ~4 years
2 parents 852b3d9 + 35f9c27 commit bbdd562

File tree

6 files changed

+34
-34
lines changed

6 files changed

+34
-34
lines changed

source/mysql/connection.d

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ package:
424424
{
425425
assert(_open == OpenState.authenticated);
426426
}
427-
body
427+
do
428428
{
429429
initConnection();
430430
auto greeting = this.parseGreeting();
@@ -600,7 +600,7 @@ public:
600600
case MySQLSocketType.vibed: assert(openSocketVibeD !is null); break;
601601
}
602602
}
603-
body
603+
do
604604
{
605605
enforce!MYX(capFlags & SvrCapFlags.PROTOCOL41, "This client only supports protocol v4.1");
606606
enforce!MYX(capFlags & SvrCapFlags.SECURE_CONNECTION, "This client only supports protocol v4.1 connection");
@@ -724,7 +724,7 @@ public:
724724
{
725725
assert(_open == OpenState.authenticated);
726726
}
727-
body
727+
do
728728
{
729729
this.sendCmd(CommandType.QUIT, []);
730730
// No response is sent for a quit packet

source/mysql/prepared.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ package struct PreparedRegistrations(Payload)
373373
// let's make sure that doesn't change.
374374
assert(!info.queuedForRelease);
375375
}
376-
body
376+
do
377377
{
378378
if(auto pInfo = sql in directLookup)
379379
{

source/mysql/protocol/comms.d

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ out(result)
602602
{
603603
assert(result.length == numFields);
604604
}
605-
body
605+
do
606606
{
607607
bool[] nulls;
608608
nulls.length = numFields;
@@ -642,7 +642,7 @@ in
642642
{
643643
assert(rh.fieldCount <= uint.max);
644644
}
645-
body
645+
do
646646
{
647647
scope(failure) conn.kill();
648648

@@ -716,7 +716,7 @@ in
716716
{
717717
assert(packet.length > 4); // at least 1 byte more than header
718718
}
719-
body
719+
do
720720
{
721721
_socket.write(packet);
722722
}
@@ -726,7 +726,7 @@ in
726726
{
727727
assert(header.length == 4 || header.length == 5/*command type included*/);
728728
}
729-
body
729+
do
730730
{
731731
_socket.write(header);
732732
if(data.length)
@@ -756,7 +756,7 @@ out
756756
// at this point we should have sent a command
757757
assert(conn.pktNumber == 1);
758758
}
759-
body
759+
do
760760
{
761761
scope(failure) conn.kill();
762762

@@ -797,7 +797,7 @@ in
797797
{
798798
assert(token.length == 20);
799799
}
800-
body
800+
do
801801
{
802802
ubyte[] packet;
803803
packet.reserve(4/*header*/ + 4 + 4 + 1 + 23 + conn._user.length+1 + token.length+1 + conn._db.length+1);
@@ -981,7 +981,7 @@ out
981981
{
982982
assert(conn._open == Connection.OpenState.authenticated);
983983
}
984-
body
984+
do
985985
{
986986
auto token = makeToken(conn._pwd, greeting);
987987
auto authPacket = conn.buildAuthPacket(token);

source/mysql/protocol/packet_helpers.d

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ in
354354
{
355355
assert(packet.length >= N);
356356
}
357-
body
357+
do
358358
{
359359
return cast(string)packet.consume(N);
360360
}
@@ -365,7 +365,7 @@ in
365365
{
366366
assert(packet.length >= N);
367367
}
368-
body
368+
do
369369
{
370370
auto result = packet[0..N];
371371
packet = packet[N..$];
@@ -404,7 +404,7 @@ in
404404
{
405405
static assert(N == T.sizeof);
406406
}
407-
body
407+
do
408408
{
409409
enforce!MYXProtocol(packet.length, "Supplied byte array is zero length");
410410
uint length = packet.front;
@@ -427,7 +427,7 @@ in
427427
{
428428
static assert(N == T.sizeof);
429429
}
430-
body
430+
do
431431
{
432432
return toDate(packet.consume(5));
433433
}
@@ -438,7 +438,7 @@ in
438438
assert(packet.length);
439439
assert(N == T.sizeof);
440440
}
441-
body
441+
do
442442
{
443443
auto numBytes = packet.consume!ubyte();
444444
if(numBytes == 0)
@@ -468,7 +468,7 @@ in
468468
{
469469
static assert(T.sizeof >= N, T.stringof~" not large enough to store "~to!string(N)~" bytes");
470470
}
471-
body
471+
do
472472
{
473473
return packet.length >= N;
474474
}
@@ -481,7 +481,7 @@ in
481481
static assert(T.sizeof >= N, T.stringof~" not large enough to store "~to!string(N)~" bytes");
482482
assert(packet.hasEnoughBytes!(T,N), "packet not long enough to contain all bytes needed for "~T.stringof);
483483
}
484-
body
484+
do
485485
{
486486
T value = 0;
487487
static if(N == 8) // 64 bit
@@ -518,7 +518,7 @@ in
518518
static assert(T.sizeof >= N, T.stringof~" not large enough to store "~to!string(N)~" bytes");
519519
assert(packet.hasEnoughBytes!(T,N), "packet not long enough to contain all bytes needed for "~T.stringof);
520520
}
521-
body
521+
do
522522
{
523523
// The uncommented line triggers a template deduction error,
524524
// so we need to store a temporary first
@@ -548,7 +548,7 @@ in
548548
static assert((is(T == float) && N == float.sizeof)
549549
|| is(T == double) && N == double.sizeof);
550550
}
551-
body
551+
do
552552
{
553553
T result = 0;
554554
(cast(ubyte*)&result)[0..T.sizeof] = packet[0..T.sizeof];
@@ -562,7 +562,7 @@ in
562562
static assert((is(T == float) && N == float.sizeof)
563563
|| is(T == double) && N == double.sizeof);
564564
}
565-
body
565+
do
566566
{
567567
return packet.consume(T.sizeof).decode!T();
568568
}
@@ -785,7 +785,7 @@ in
785785
{
786786
assert(packet.length >= 1, "packet has to include at least the LCB length byte");
787787
}
788-
body
788+
do
789789
{
790790
auto lcb = packet.decodeLCBHeader();
791791
if(lcb.isNull || lcb.isIncomplete)
@@ -809,7 +809,7 @@ in
809809
{
810810
assert(packet.length >= 1, "packet has to include at least the LCB length byte");
811811
}
812-
body
812+
do
813813
{
814814
LCB lcb;
815815
lcb.numBytes = getNumLCBBytes(packet.front);
@@ -849,7 +849,7 @@ in
849849
{
850850
assert(packet.length >= 1, "packet has to include at least the LCB length byte");
851851
}
852-
body
852+
do
853853
{
854854
auto lcb = packet.decodeLCBHeader();
855855
if(lcb.isNull || lcb.isIncomplete)
@@ -879,7 +879,7 @@ in
879879
{
880880
assert(packet.length >= 1, "LCS packet needs to store at least the LCB header");
881881
}
882-
body
882+
do
883883
{
884884
auto lcb = packet.consumeIfComplete!LCB();
885885
assert(!lcb.isIncomplete);
@@ -898,7 +898,7 @@ in
898898
{
899899
assert(n <= array.length);
900900
}
901-
body
901+
do
902902
{
903903
array = array[n..$];
904904
return array;
@@ -921,7 +921,7 @@ in
921921
else
922922
assert(array.length >= T.sizeof, "Not enough space to unpack "~T.stringof);
923923
}
924-
body
924+
do
925925
{
926926
static if(T.sizeof >= 1)
927927
{
@@ -957,7 +957,7 @@ out(result)
957957
{
958958
assert(result.length >= 1);
959959
}
960-
body
960+
do
961961
{
962962
ubyte[] t;
963963
if (!l)
@@ -1122,7 +1122,7 @@ in
11221122
// packet should include header, and possibly data
11231123
assert(packet.length >= 4);
11241124
}
1125-
body
1125+
do
11261126
{
11271127
auto dataLength = packet.length - 4; // don't include header in calculated size
11281128
assert(dataLength <= uint.max);
@@ -1137,7 +1137,7 @@ in
11371137
// Length is always a 24-bit int
11381138
assert(dataLength <= 0xffff_ffff_ffff);
11391139
}
1140-
body
1140+
do
11411141
{
11421142
dataLength.packInto!(uint, true)(packet);
11431143
packet[3] = packetNumber;

source/mysql/protocol/packets.d

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public:
124124
{
125125
assert(!packet.length, "not all bytes read during FieldDescription construction");
126126
}
127-
body
127+
do
128128
{
129129
packet.skip(4); // Skip catalog - it's always 'def'
130130
_db = packet.consume!LCS();
@@ -245,7 +245,7 @@ in
245245
{
246246
assert(!packet.empty);
247247
}
248-
body
248+
do
249249
{
250250
return packet.front == ResultPacketMarker.eof && packet.length < 9;
251251
}
@@ -286,7 +286,7 @@ public:
286286
{
287287
assert(!packet.length);
288288
}
289-
body
289+
do
290290
{
291291
packet.popFront(); // eof marker
292292
_warnings = packet.consume!short();

source/mysql/result.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ public:
287287
/// Explicitly clean up the MySQL resources and cancel pending results
288288
void close()
289289
out{ assert(!isValid); }
290-
body
290+
do
291291
{
292292
if(isValid)
293293
_con.purgeResult();

0 commit comments

Comments
 (0)