mirror of
https://github.com/TomHarte/CLK.git
synced 2025-11-23 21:17:42 +00:00
Resolve syntax error, fix line lengths.
This commit is contained in:
@@ -151,7 +151,7 @@ template <typename Type> Type get(const Struct &target, const std::string &name,
|
|||||||
|
|
||||||
template <typename Owner> class StructImpl: public Struct {
|
template <typename Owner> class StructImpl: public Struct {
|
||||||
public:
|
public:
|
||||||
StructImpl<Owner>() {
|
StructImpl() {
|
||||||
static std::once_flag once;
|
static std::once_flag once;
|
||||||
std::call_once(once, [this] {
|
std::call_once(once, [this] {
|
||||||
static_cast<Owner *>(this)->declare_fields();
|
static_cast<Owner *>(this)->declare_fields();
|
||||||
@@ -177,7 +177,11 @@ public:
|
|||||||
const auto iterator = contents_.find(name);
|
const auto iterator = contents_.find(name);
|
||||||
if(iterator == contents_.end()) return;
|
if(iterator == contents_.end()) return;
|
||||||
assert(offset < iterator->second.count);
|
assert(offset < iterator->second.count);
|
||||||
memcpy(reinterpret_cast<uint8_t *>(this) + iterator->second.offset + offset * iterator->second.size, value, iterator->second.size);
|
memcpy(
|
||||||
|
reinterpret_cast<uint8_t *>(this) + iterator->second.offset + offset * iterator->second.size,
|
||||||
|
value,
|
||||||
|
iterator->second.size
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -338,7 +342,12 @@ private:
|
|||||||
contents_.emplace(
|
contents_.emplace(
|
||||||
std::make_pair(
|
std::make_pair(
|
||||||
name,
|
name,
|
||||||
Field(typeid(Type), reinterpret_cast<uint8_t *>(t) - reinterpret_cast<uint8_t *>(this), sizeof(Type), count)
|
Field(
|
||||||
|
typeid(Type),
|
||||||
|
reinterpret_cast<uint8_t *>(t) - reinterpret_cast<uint8_t *>(this),
|
||||||
|
sizeof(Type),
|
||||||
|
count
|
||||||
|
)
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user