all: minor updates

This commit is contained in:
Markus F.X.J. Oberhumer
2023-05-08 16:05:03 +02:00
parent 08a72d5251
commit 900afd1c8c
17 changed files with 138 additions and 93 deletions
+10 -6
View File
@@ -31,21 +31,23 @@
template <class T, class U> \
inline XSPAN_REQUIRES_CONVERTIBLE_ANY_DIRECTION(T, U, RType)
#ifndef XSPAN_FWD_C_IS_MEMBUFFER
template <class T, class U>
inline typename std::enable_if<std::is_integral<U>::value, void *>::type operator+(U, const C<T> &)
DELETED_FUNCTION;
#endif // XSPAN_FWD_C_IS_MEMBUFFER
/*************************************************************************
// overloads for standard functions
**************************************************************************/
template <class T>
inline void *memchr(const C<T> &a, int c, size_t n) {
return memchr(a.raw_bytes(n), c, n);
inline void *memchr(const C<T> &a, int v, size_t n) {
return memchr(a.raw_bytes(n), v, n);
}
template <class T>
inline const void *memchr(const C<const T> &a, int c, size_t n) {
return memchr(a.raw_bytes(n), c, n);
inline const void *memchr(const C<const T> &a, int v, size_t n) {
return memchr(a.raw_bytes(n), v, n);
}
template <class T>
@@ -115,8 +117,8 @@ XSPAN_FWD_TU(void *) memmove(const C<T> &a, const E<U> &b, size_t n) {
#endif
template <class T>
inline void *memset(const C<T> &a, int c, size_t n) {
return memset(a.raw_bytes(n), c, n);
inline void *memset(const C<T> &a, int v, size_t n) {
return memset(a.raw_bytes(n), v, n);
}
/*************************************************************************
@@ -255,6 +257,7 @@ void set_le64(const C<T> &a, upx_uint64_t v) {
return set_le64(a.raw_bytes(8), v);
}
#ifndef XSPAN_FWD_C_IS_MEMBUFFER
template <class T>
inline C<T> operator+(const C<T> &a, const BE16 &v) {
return a + unsigned(v);
@@ -288,6 +291,7 @@ template <class T>
inline C<T> operator-(const C<T> &a, const LE32 &v) {
return a - unsigned(v);
}
#endif // XSPAN_FWD_C_IS_MEMBUFFER
template <class T>
typename std::enable_if<sizeof(T) == 1, upx_rsize_t>::type upx_safe_strlen(const C<T> &a) {