This commit is contained in:
Amaury Chamayou 2020-01-29 14:41:42 +00:00 коммит произвёл GitHub
Родитель 3e8d0dd87b
Коммит a247e1bcd2
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
16 изменённых файлов: 419 добавлений и 22 удалений

1
.gitignore поставляемый
Просмотреть файл

@ -17,6 +17,5 @@ obj/
tests/env/ tests/env/
getting_started/create_vm/generated getting_started/create_vm/generated
sphinx/env/ sphinx/env/
debug/
html/ html/
latex/ latex/

16
3rdparty/msgpack-c/msgpack/adaptor/cpp11/timespec.hpp~ поставляемый Normal file
Просмотреть файл

@ -0,0 +1,16 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2019 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_TYPE_CPP17_TIMESPEC_HPP
#define MSGPACK_TYPE_CPP17_TIMESPEC_HPP
#include "msgpack/v1/adaptor/cpp17/timespec.hpp"
#endif // MSGPACK_TYPE_CPP17_TIMESPEC_HPP

2
3rdparty/msgpack-c/msgpack/fbuffer.h поставляемый
Просмотреть файл

@ -25,7 +25,7 @@ extern "C" {
static inline int msgpack_fbuffer_write(void* data, const char* buf, size_t len) static inline int msgpack_fbuffer_write(void* data, const char* buf, size_t len)
{ {
return (len == fwrite(buf, len, 1, (FILE *)data)) ? 0 : -1; return (1 == fwrite(buf, len, 1, (FILE *)data)) ? 0 : -1;
} }
/** @} */ /** @} */

2
3rdparty/msgpack-c/msgpack/sysdep.h поставляемый
Просмотреть файл

@ -14,7 +14,7 @@
#include <stddef.h> #include <stddef.h>
#if defined(_MSC_VER) && _MSC_VER <= 1800 #if defined(_MSC_VER) && _MSC_VER <= 1800
# define snprintf(buf, len, format,...) _snprintf_s(buf, len, len, format, __VA_ARGS__) # define snprintf(buf, len, format,...) _snprintf_s(buf, len, _TRUNCATE, format, __VA_ARGS__)
#endif #endif
#if defined(_MSC_VER) && _MSC_VER < 1600 #if defined(_MSC_VER) && _MSC_VER < 1600

177
3rdparty/msgpack-c/msgpack/v1/adaptor/cpp11/timespec.hpp~ поставляемый Normal file
Просмотреть файл

@ -0,0 +1,177 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2018 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_V1_TYPE_TIMESPEC_HPP
#define MSGPACK_V1_TYPE_TIMESPEC_HPP
#if __cplusplus >= 201703
#include "msgpack/versioning.hpp"
#include "msgpack/adaptor/adaptor_base.hpp"
#include "msgpack/object.hpp"
#include <ctime>
namespace msgpack {
/// @cond
MSGPACK_API_VERSION_NAMESPACE(v1) {
/// @endcond
namespace adaptor {
template <>
struct as<std::timespec> {
typename std::timespec operator()(msgpack::object const& o) const {
if(o.type != msgpack::type::EXT) { throw msgpack::type_error(); }
if(o.via.ext.type() != -1) { throw msgpack::type_error(); }
std::timespec ts{0, 0};
switch(o.via.ext.size) {
case 4: {
uint32_t sec;
_msgpack_load32(uint32_t, o.via.ext.data(), &sec);
ts.tv_sec = sec;
} break;
case 8: {
uint64_t value;
_msgpack_load64(uint64_t, o.via.ext.data(), &value);
ts.tv_sec = value & 0x00000003ffffffffLL;
ts.tv_nsec = static_cast<uint32_t>(value >> 34);
} break;
case 12: {
uint32_t nanosec;
_msgpack_load32(uint32_t, o.via.ext.data(), &nanosec);
int64_t sec;
_msgpack_load64(int64_t, o.via.ext.data() + 4, &sec);
ts.tv_sec = sec;
ts.tv_nsec = nanosec;
} break;
default:
throw msgpack::type_error();
}
return ts;
}
};
template <>
struct convert<std::timespec> {
msgpack::object const& operator()(msgpack::object const& o, std::timespec& v) const {
if(o.type != msgpack::type::EXT) { throw msgpack::type_error(); }
if(o.via.ext.type() != -1) { throw msgpack::type_error(); }
switch(o.via.ext.size) {
case 4: {
uint32_t sec;
_msgpack_load32(uint32_t, o.via.ext.data(), &sec);
v.tv_sec = sec;
v.tv_nsec = 0;
} break;
case 8: {
uint64_t value;
_msgpack_load64(uint64_t, o.via.ext.data(), &value);
v.tv_sec = value & 0x00000003ffffffffLL;
v.tv_nsec= static_cast<uint32_t>(value >> 34);
} break;
case 12: {
uint32_t nanosec;
_msgpack_load32(uint32_t, o.via.ext.data(), &nanosec);
int64_t sec;
_msgpack_load64(int64_t, o.via.ext.data() + 4, &sec);
v.tv_sec = sec;
v.tv_nsec = nanosec;
} break;
default:
throw msgpack::type_error();
}
return o;
}
};
template <>
struct pack<std::timespec> {
template <typename Stream>
msgpack::packer<Stream>& operator()(msgpack::packer<Stream>& o, const std::timespec& v) const {
if ((v.tv_sec >> 34) == 0) {
uint64_t data64 = (static_cast<uint64_t>(v.tv_nsec) << 34) | static_cast<uint64_t>(v.tv_sec);
if ((data64 & 0xffffffff00000000L) == 0) {
// timestamp 32
o.pack_ext(4, -1);
uint32_t data32 = static_cast<uint32_t>(data64);
char buf[4];
_msgpack_store32(buf, data32);
o.pack_ext_body(buf, 4);
}
else {
// timestamp 64
o.pack_ext(8, -1);
char buf[8];
_msgpack_store64(buf, data64);
o.pack_ext_body(buf, 8);
}
}
else {
// timestamp 96
o.pack_ext(12, -1);
char buf[12];
_msgpack_store32(&buf[0], static_cast<uint32_t>(v.tv_nsec));
_msgpack_store64(&buf[4], v.tv_sec);
o.pack_ext_body(buf, 12);
}
return o;
}
};
template <>
struct object_with_zone<std::timespec> {
void operator()(msgpack::object::with_zone& o, const std::timespec& v) const {
if ((v.tv_sec >> 34) == 0) {
uint64_t data64 = (static_cast<uint64_t>(v.tv_nsec) << 34) | static_cast<uint64_t>(v.tv_sec);
if ((data64 & 0xffffffff00000000L) == 0) {
// timestamp 32
o.type = msgpack::type::EXT;
o.via.ext.size = 4;
char* p = static_cast<char*>(o.zone.allocate_no_align(o.via.ext.size + 1));
p[0] = static_cast<char>(-1);
uint32_t data32 = static_cast<uint32_t>(data64);
_msgpack_store32(&p[1], data32);
o.via.ext.ptr = p;
}
else {
// timestamp 64
o.type = msgpack::type::EXT;
o.via.ext.size = 8;
char* p = static_cast<char*>(o.zone.allocate_no_align(o.via.ext.size + 1));
p[0] = static_cast<char>(-1);
_msgpack_store64(&p[1], data64);
o.via.ext.ptr = p;
}
}
else {
// timestamp 96
o.type = msgpack::type::EXT;
o.via.ext.size = 12;
char* p = static_cast<char*>(o.zone.allocate_no_align(o.via.ext.size + 1));
p[0] = static_cast<char>(-1);
_msgpack_store32(&p[1], static_cast<uint32_t>(v.tv_nsec));
_msgpack_store64(&p[1 + 4], v.tv_sec);
o.via.ext.ptr = p;
}
}
};
} // namespace adaptor
/// @cond
} // MSGPACK_API_VERSION_NAMESPACE(v1)
/// @endcond
} // namespace msgpack
#endif // __cplusplus >= 201703
#endif // MSGPACK_V1_TYPE_TIMESPEC_HPP

74
3rdparty/msgpack-c/msgpack/v1/adaptor/cpp17/timespec.hpp~ поставляемый Normal file
Просмотреть файл

@ -0,0 +1,74 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2018 KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_V1_TYPE_TIMESPEC_HPP
#define MSGPACK_V1_TYPE_TIMESPEC_HPP
#if __cplusplus >= 201703
#include "msgpack/versioning.hpp"
#include "msgpack/adaptor/adaptor_base.hpp"
#include "msgpack/adaptor/adaptor_base.hpp"
#include "msgpack/adaptor/int_decl.hpp"
#include "msgpack/object.hpp"
#include <ctime>
namespace msgpack {
/// @cond
MSGPACK_API_VERSION_NAMESPACE(v1) {
/// @endcond
namespace adaptor {
template <>
struct convert<std::timespec> {
msgpack::object const& operator()(msgpack::object const& o, std::timespec& v) const {
v = static_cast<std::timespec>(type::detail::convert_integer<unsigned char>(o));
return o;
}
};
template <>
struct pack<std::timespec> {
template <typename Stream>
msgpack::packer<Stream>& operator()(msgpack::packer<Stream>& o, std::timespec v) const {
o.pack_unsigned_char(static_cast<unsigned char>(v));
return o;
}
};
template <>
struct object<std::timespec> {
void operator()(msgpack::object& o, std::timespec v) const {
o.type = msgpack::type::POSITIVE_INTEGER;
o.via.u64 = static_cast<unsigned char>(v);
}
};
template <>
struct object_with_zone<std::timespec> {
void operator()(msgpack::object::with_zone& o, const std::timespec& v) const {
static_cast<msgpack::object&>(o) << v;
}
};
} // namespace adaptor
/// @cond
} // MSGPACK_API_VERSION_NAMESPACE(v1)
/// @endcond
} // namespace msgpack
#endif // __cplusplus >= 201703
#endif // MSGPACK_V1_TYPE_TIMESPEC_HPP

121
3rdparty/msgpack-c/msgpack/v1/adaptor/wstring.hpp~ поставляемый Normal file
Просмотреть файл

@ -0,0 +1,121 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2008-2015 FURUHASHI Sadayuki and KONDO Takatoshi
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef MSGPACK_V1_TYPE_VECTOR_HPP
#define MSGPACK_V1_TYPE_VECTOR_HPP
#include "msgpack/versioning.hpp"
#include "msgpack/adaptor/adaptor_base.hpp"
#include "msgpack/adaptor/check_container_size.hpp"
#include <vector>
namespace msgpack {
/// @cond
MSGPACK_API_VERSION_NAMESPACE(v1) {
/// @endcond
namespace adaptor {
#if !defined(MSGPACK_USE_CPP03)
template <>
struct as<std::wstring> {
std::wstring operator()(const msgpack::object& o) const {
if (o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
std::wstring v;
v.reserve(o.via.array.size);
if (o.via.array.size > 0) {
msgpack::object* p = o.via.array.ptr;
msgpack::object* const pend = o.via.array.ptr + o.via.array.size;
do {
v.push_back(p->as<wchar_t>());
++p;
} while (p < pend);
}
return v;
}
};
#endif // !defined(MSGPACK_USE_CPP03)
template <>
struct convert<std::wstring> {
msgpack::object const& operator()(msgpack::object const& o, std::wstring& v) const {
if (o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
v.resize(o.via.array.size);
if (o.via.array.size > 0) {
msgpack::object* p = o.via.array.ptr;
msgpack::object* const pend = o.via.array.ptr + o.via.array.size;
typename std::wstring::iterator it = v.begin();
do {
p->convert(*it);
++p;
++it;
} while(p < pend);
}
return o;
}
};
template <>
struct pack<std::wstring> {
template <typename Stream>
msgpack::packer<Stream>& operator()(msgpack::packer<Stream>& o, const std::wstring& v) const {
uint32_t size = checked_get_container_size(v.size());
o.pack_array(size);
for (typename std::wstring::const_iterator it(v.begin()), it_end(v.end());
it != it_end; ++it) {
o.pack(*it);
}
return o;
}
};
template <>
struct object_with_zone<std::wstring> {
void operator()(msgpack::object::with_zone& o, const std::wstring& v) const {
o.type = msgpack::type::ARRAY;
if (v.empty()) {
o.via.array.ptr = MSGPACK_NULLPTR;
o.via.array.size = 0;
}
else {
uint32_t size = checked_get_container_size(v.size());
msgpack::object* p = static_cast<msgpack::object*>(o.zone.allocate_align(sizeof(msgpack::object)*size, MSGPACK_ZONE_ALIGNOF(msgpack::object)));
msgpack::object* const pend = p + size;
o.via.array.ptr = p;
o.via.array.size = size;
typename std::wstring::const_iterator it(v.begin());
do {
#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)) && !defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif // (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)) && !defined(__clang__)
*p = msgpack::object(*it, o.zone);
#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif // (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)) && !defined(__clang__)
++p;
++it;
} while(p < pend);
}
}
};
} // namespace adaptor
/// @cond
} // MSGPACK_API_VERSION_NAMESPACE(v1)
/// @endcond
} // namespace msgpack
#endif // MSGPACK_V1_TYPE_VECTOR_HPP

19
3rdparty/msgpack-c/msgpack/v1/unpack.hpp поставляемый
Просмотреть файл

@ -113,10 +113,13 @@ struct unpack_array {
if (n > u.limit().array()) throw msgpack::array_size_overflow("array size overflow"); if (n > u.limit().array()) throw msgpack::array_size_overflow("array size overflow");
o.type = msgpack::type::ARRAY; o.type = msgpack::type::ARRAY;
o.via.array.size = 0; o.via.array.size = 0;
size_t size = n*sizeof(msgpack::object);
if (size / sizeof(msgpack::object) != n) { #if SIZE_MAX == UINT_MAX
if (n > SIZE_MAX/sizeof(msgpack::object))
throw msgpack::array_size_overflow("array size overflow"); throw msgpack::array_size_overflow("array size overflow");
} #endif // SIZE_MAX == UINT_MAX
size_t size = n*sizeof(msgpack::object);
o.via.array.ptr = static_cast<msgpack::object*>(u.zone().allocate_align(size, MSGPACK_ZONE_ALIGNOF(msgpack::object))); o.via.array.ptr = static_cast<msgpack::object*>(u.zone().allocate_align(size, MSGPACK_ZONE_ALIGNOF(msgpack::object)));
} }
}; };
@ -125,6 +128,7 @@ inline void unpack_array_item(msgpack::object& c, msgpack::object const& o)
{ {
#if defined(__GNUC__) && !defined(__clang__) #if defined(__GNUC__) && !defined(__clang__)
std::memcpy(&c.via.array.ptr[c.via.array.size++], &o, sizeof(msgpack::object)); std::memcpy(&c.via.array.ptr[c.via.array.size++], &o, sizeof(msgpack::object));
#else /* __GNUC__ && !__clang__ */ #else /* __GNUC__ && !__clang__ */
c.via.array.ptr[c.via.array.size++] = o; c.via.array.ptr[c.via.array.size++] = o;
#endif /* __GNUC__ && !__clang__ */ #endif /* __GNUC__ && !__clang__ */
@ -135,10 +139,13 @@ struct unpack_map {
if (n > u.limit().map()) throw msgpack::map_size_overflow("map size overflow"); if (n > u.limit().map()) throw msgpack::map_size_overflow("map size overflow");
o.type = msgpack::type::MAP; o.type = msgpack::type::MAP;
o.via.map.size = 0; o.via.map.size = 0;
size_t size = n*sizeof(msgpack::object_kv);
if (size / sizeof(msgpack::object_kv) != n) { #if SIZE_MAX == UINT_MAX
if (n > SIZE_MAX/sizeof(msgpack::object_kv))
throw msgpack::map_size_overflow("map size overflow"); throw msgpack::map_size_overflow("map size overflow");
} #endif // SIZE_MAX == UINT_MAX
size_t size = n*sizeof(msgpack::object_kv);
o.via.map.ptr = static_cast<msgpack::object_kv*>(u.zone().allocate_align(size, MSGPACK_ZONE_ALIGNOF(msgpack::object_kv))); o.via.map.ptr = static_cast<msgpack::object_kv*>(u.zone().allocate_align(size, MSGPACK_ZONE_ALIGNOF(msgpack::object_kv)));
} }
}; };

1
3rdparty/msgpack-c/msgpack/v1/zbuffer.hpp поставляемый
Просмотреть файл

@ -69,6 +69,7 @@ public:
case Z_STREAM_END: case Z_STREAM_END:
return m_data; return m_data;
case Z_OK: case Z_OK:
case Z_BUF_ERROR:
if(!expand()) { if(!expand()) {
throw std::bad_alloc(); throw std::bad_alloc();
} }

Просмотреть файл

@ -163,10 +163,13 @@ public:
obj->via.array.ptr = MSGPACK_NULLPTR; obj->via.array.ptr = MSGPACK_NULLPTR;
} }
else { else {
size_t size = num_elements*sizeof(msgpack::object);
if (size / sizeof(msgpack::object) != num_elements) { #if SIZE_MAX == UINT_MAX
if (num_elements > SIZE_MAX/sizeof(msgpack::object))
throw msgpack::array_size_overflow("array size overflow"); throw msgpack::array_size_overflow("array size overflow");
} #endif // SIZE_MAX == UINT_MAX
size_t size = num_elements*sizeof(msgpack::object);
obj->via.array.ptr = obj->via.array.ptr =
static_cast<msgpack::object*>(m_zone->allocate_align(size, MSGPACK_ZONE_ALIGNOF(msgpack::object))); static_cast<msgpack::object*>(m_zone->allocate_align(size, MSGPACK_ZONE_ALIGNOF(msgpack::object)));
} }
@ -194,10 +197,12 @@ public:
obj->via.map.ptr = MSGPACK_NULLPTR; obj->via.map.ptr = MSGPACK_NULLPTR;
} }
else { else {
size_t size = num_kv_pairs*sizeof(msgpack::object_kv);
if (size / sizeof(msgpack::object_kv) != num_kv_pairs) { #if SIZE_MAX == UINT_MAX
if (num_kv_pairs > SIZE_MAX/sizeof(msgpack::object_kv))
throw msgpack::map_size_overflow("map size overflow"); throw msgpack::map_size_overflow("map size overflow");
} #endif // SIZE_MAX == UINT_MAX
size_t size = num_kv_pairs*sizeof(msgpack::object_kv);
obj->via.map.ptr = obj->via.map.ptr =
static_cast<msgpack::object_kv*>(m_zone->allocate_align(size, MSGPACK_ZONE_ALIGNOF(msgpack::object_kv))); static_cast<msgpack::object_kv*>(m_zone->allocate_align(size, MSGPACK_ZONE_ALIGNOF(msgpack::object_kv)));
} }

2
3rdparty/msgpack-c/msgpack/v2/parse.hpp поставляемый
Просмотреть файл

@ -241,8 +241,6 @@ inline parse_return context<VisitorHolder>::execute(const char* data, std::size_
const char* const pe = data + len; const char* const pe = data + len;
const char* n = MSGPACK_NULLPTR; const char* n = MSGPACK_NULLPTR;
msgpack::object obj;
if(m_current == pe) { if(m_current == pe) {
off = static_cast<std::size_t>(m_current - m_start); off = static_cast<std::size_t>(m_current - m_start);
return PARSE_CONTINUE; return PARSE_CONTINUE;

2
3rdparty/msgpack-c/msgpack/v3/parse.hpp поставляемый
Просмотреть файл

@ -250,8 +250,6 @@ inline parse_return context<VisitorHolder>::execute(const char* data, std::size_
const char* const pe = data + len; const char* const pe = data + len;
const char* n = MSGPACK_NULLPTR; const char* n = MSGPACK_NULLPTR;
msgpack::object obj;
if(m_current == pe) { if(m_current == pe) {
off = static_cast<std::size_t>(m_current - m_start); off = static_cast<std::size_t>(m_current - m_start);
return PARSE_CONTINUE; return PARSE_CONTINUE;

2
3rdparty/msgpack-c/msgpack/version_master.h поставляемый
Просмотреть файл

@ -1,3 +1,3 @@
#define MSGPACK_VERSION_MAJOR 3 #define MSGPACK_VERSION_MAJOR 3
#define MSGPACK_VERSION_MINOR 2 #define MSGPACK_VERSION_MINOR 2
#define MSGPACK_VERSION_REVISION 0 #define MSGPACK_VERSION_REVISION 1

2
3rdparty/msgpack-c/msgpack/vrefbuffer.h поставляемый
Просмотреть файл

@ -13,7 +13,7 @@
#include "zone.h" #include "zone.h"
#include <stdlib.h> #include <stdlib.h>
#if defined(unix) || defined(__unix) || defined(__APPLE__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__QNX__) || defined(__QNXTO__) #if defined(unix) || defined(__unix) || defined(__linux__) || defined(__APPLE__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__QNX__) || defined(__QNXTO__) || defined(__HAIKU__)
#include <sys/uio.h> #include <sys/uio.h>
#else #else
struct iovec { struct iovec {

1
3rdparty/msgpack-c/msgpack/zbuffer.h поставляемый
Просмотреть файл

@ -146,6 +146,7 @@ static inline char* msgpack_zbuffer_flush(msgpack_zbuffer* zbuf)
case Z_STREAM_END: case Z_STREAM_END:
return zbuf->data; return zbuf->data;
case Z_OK: case Z_OK:
case Z_BUF_ERROR:
if(!msgpack_zbuffer_expand(zbuf)) { if(!msgpack_zbuffer_expand(zbuf)) {
return NULL; return NULL;
} }

Просмотреть файл

@ -59,7 +59,7 @@
"type": "git", "type": "git",
"git": { "git": {
"repositoryUrl": "https://github.com/msgpack/msgpack-c.git", "repositoryUrl": "https://github.com/msgpack/msgpack-c.git",
"commitHash": "29b9505cb76710802e130d5b8403ec1b40de1c8d" "commitHash": "8085ab8721090a447cf98bb802d1406ad7afe420"
} }
} }
}, },