Skip to content

Commit

Permalink
Merge pull request #108 from BBasile/dip25
Browse files Browse the repository at this point in the history
fix annotations to support the `-dip25` switch
  • Loading branch information
repeatedly committed Jan 10, 2019
2 parents 19d9245 + 4a413d1 commit 6741be3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
3 changes: 2 additions & 1 deletion dub.json
Expand Up @@ -7,5 +7,6 @@
"copyright": "Copyright (c) 2010- Masahiro Nakagawa",

"importPaths": ["src"],
"targetType": "library"
"targetType": "library",
"dflags": ["-dip25"]
}
2 changes: 1 addition & 1 deletion src/msgpack/buffer.d
Expand Up @@ -99,7 +99,7 @@ struct RefBuffer
* the array of iovec struct that stores references.
*/
@property @safe
nothrow ref iovec[] vector()
nothrow ref iovec[] vector() return
{
return vecList_;
}
Expand Down
12 changes: 6 additions & 6 deletions src/msgpack/packer.d
Expand Up @@ -694,7 +694,7 @@ struct PackerImpl(Stream) if (isOutputRange!(Stream, ubyte) && isOutputRange!(St
* Returns:
* seld, i.e. for method chaining.
*/
ref PackerImpl packExt(in byte type, const ubyte[] data)
ref PackerImpl packExt(in byte type, const ubyte[] data) return
{
ref PackerImpl packExtFixed(int fmt)
{
Expand Down Expand Up @@ -791,7 +791,7 @@ struct PackerImpl(Stream) if (isOutputRange!(Stream, ubyte) && isOutputRange!(St
* Returns:
* self, i.e. for method chaining.
*/
ref PackerImpl beginArray(in size_t length)
ref PackerImpl beginArray(in size_t length) return
{
if (length < 16) {
const ubyte temp = Format.ARRAY | cast(ubyte)length;
Expand All @@ -815,7 +815,7 @@ struct PackerImpl(Stream) if (isOutputRange!(Stream, ubyte) && isOutputRange!(St


/// ditto
ref PackerImpl beginMap(in size_t length)
ref PackerImpl beginMap(in size_t length) return
{
if (length < 16) {
const ubyte temp = Format.MAP | cast(ubyte)length;
Expand All @@ -842,7 +842,7 @@ struct PackerImpl(Stream) if (isOutputRange!(Stream, ubyte) && isOutputRange!(St
/*
* Serializes the nil value.
*/
ref PackerImpl packNil()
ref PackerImpl packNil() return
{
stream_.put(Format.NIL);
return this;
Expand All @@ -864,7 +864,7 @@ alias PackerImpl!(Appender!(ubyte[])) Packer; // should be pure struct?
* Returns:
* a $(D Packer) object instantiated and initialized according to the arguments.
*/
PackerImpl!(Stream) packer(Stream)(Stream stream, bool withFieldName = false)
PackerImpl!(Stream) packer(Stream)(Stream stream, bool withFieldName = false) return
{
return typeof(return)(stream, withFieldName);
}
Expand Down Expand Up @@ -1137,7 +1137,7 @@ unittest
// using malloc because - hopefully - this means we don't
// actually physically allocate such a huge amount of memory
import core.stdc.stdlib;
auto len = 0xffffffffUL + 1;
auto len = 0xffffffffUL + 1;
auto bins = (cast(byte*)malloc(len))[0 .. len];
assert(bins);
scope(exit) free(bins.ptr);
Expand Down
2 changes: 1 addition & 1 deletion src/msgpack/unpacker.d
Expand Up @@ -884,7 +884,7 @@ struct Unpacker
* is thrown if the lengths do not match. If $(D data) is null, a new slice
* is returned.
*/
ref Unpacker unpackExt(ref byte type, ref ubyte[] data)
ref Unpacker unpackExt(ref byte type, ref ubyte[] data) return
{
import std.conv : text;

Expand Down

0 comments on commit 6741be3

Please sign in to comment.