Move bump_dp, get_dp from rust_shape.cpp to rust_shape.h
Put out the darwin fire for real
This commit is contained in:
parent
6751d40c60
commit
4aa165553b
2 changed files with 18 additions and 18 deletions
|
|
@ -35,24 +35,6 @@ const uint8_t CMP_LE = 2u;
|
|||
|
||||
namespace shape {
|
||||
|
||||
// NB: This function does not align.
|
||||
template<typename T>
|
||||
inline data_pair<T>
|
||||
bump_dp(ptr_pair &ptr) {
|
||||
data_pair<T> data(*reinterpret_cast<T *>(ptr.fst),
|
||||
*reinterpret_cast<T *>(ptr.snd));
|
||||
ptr += sizeof(T);
|
||||
return data;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline data_pair<T>
|
||||
get_dp(ptr_pair &ptr) {
|
||||
data_pair<T> data(*reinterpret_cast<T *>(ptr.fst),
|
||||
*reinterpret_cast<T *>(ptr.snd));
|
||||
return data;
|
||||
}
|
||||
|
||||
// A shape printer, useful for debugging
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -665,6 +665,24 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
// NB: This function does not align.
|
||||
template<typename T>
|
||||
inline data_pair<T>
|
||||
bump_dp(ptr_pair &ptr) {
|
||||
data_pair<T> data(*reinterpret_cast<T *>(ptr.fst),
|
||||
*reinterpret_cast<T *>(ptr.snd));
|
||||
ptr += sizeof(T);
|
||||
return data;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline data_pair<T>
|
||||
get_dp(ptr_pair &ptr) {
|
||||
data_pair<T> data(*reinterpret_cast<T *>(ptr.fst),
|
||||
*reinterpret_cast<T *>(ptr.snd));
|
||||
return data;
|
||||
}
|
||||
|
||||
} // end namespace shape
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue