diff options
Diffstat (limited to 'src/lib/utils/mem_ops.h')
-rw-r--r-- | src/lib/utils/mem_ops.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/lib/utils/mem_ops.h b/src/lib/utils/mem_ops.h index 3274bfaf6..ed4d6cb27 100644 --- a/src/lib/utils/mem_ops.h +++ b/src/lib/utils/mem_ops.h @@ -117,6 +117,26 @@ inline void set_mem(T* ptr, size_t n, uint8_t val) } } +inline const uint8_t* cast_char_ptr_to_uint8(const char* s) + { + return reinterpret_cast<const uint8_t*>(s); + } + +inline const char* cast_uint8_ptr_to_char(const uint8_t* b) + { + return reinterpret_cast<const char*>(b); + } + +inline uint8_t* cast_char_ptr_to_uint8(char* s) + { + return reinterpret_cast<uint8_t*>(s); + } + +inline char* cast_uint8_ptr_to_char(uint8_t* b) + { + return reinterpret_cast<char*>(b); + } + /** * Memory comparison, input insensitive * @param p1 a pointer to an array |