Minor cleanups.

This commit is contained in:
Markus F.X.J. Oberhumer
2016-10-09 03:12:19 +02:00
parent 554f8a376c
commit 22178f2224
3 changed files with 6 additions and 14 deletions
+3 -11
View File
@@ -75,21 +75,13 @@ bool mem_size_valid_bytes(upx_uint64_t bytes);
#define New(type, n) new type[mem_size_get_n(sizeof(type), n)]
int ptr_diff(const char *p1, const char *p2);
inline int ptr_diff(const unsigned char *p1, const unsigned char *p2) {
return ptr_diff((const char *) p1, (const char *) p2);
}
inline int ptr_diff(const void *p1, const void *p2) {
return ptr_diff((const char *) p1, (const char *) p2);
}
int ptr_diff(const void *p1, const void *p2);
template <class T1, class T2>
inline int ptr_udiff(const T1 &p1, const T2 &p2) {
inline unsigned ptr_udiff(const T1 &p1, const T2 &p2) {
int d = ptr_diff(p1, p2);
assert(d >= 0);
return d;
return ACC_ICONV(unsigned, d);
}
/*************************************************************************