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:
Brian Anderson 2011-08-20 10:51:31 -07:00
parent 6751d40c60
commit 4aa165553b
2 changed files with 18 additions and 18 deletions

View file

@ -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

View file

@ -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