mirror of
https://github.com/bkaradzic/bx.git
synced 2026-02-18 13:03:06 +01:00
Cleanup.
This commit is contained in:
@@ -63,7 +63,7 @@ namespace bx
|
||||
void memSet(void* _dst, uint8_t _ch, size_t _numBytes);
|
||||
|
||||
///
|
||||
int32_t memCmp(const char* _lhs, const char* _rhs, size_t _numBytes);
|
||||
int32_t memCmp(const void* _lhs, const void* _rhs, size_t _numBytes);
|
||||
|
||||
} // namespace bx
|
||||
|
||||
|
||||
14
src/crt.cpp
14
src/crt.cpp
@@ -121,19 +121,21 @@ namespace bx
|
||||
#endif // BX_CRT_NONE
|
||||
}
|
||||
|
||||
int32_t memCmpRef(const char* _lhs, const char* _rhs, size_t _numBytes)
|
||||
int32_t memCmpRef(const void* _lhs, const void* _rhs, size_t _numBytes)
|
||||
{
|
||||
const char* lhs = (const char*)_lhs;
|
||||
const char* rhs = (const char*)_rhs;
|
||||
for (
|
||||
; 0 < _numBytes && *_lhs == *_rhs
|
||||
; ++_lhs, ++_rhs, --_numBytes
|
||||
; 0 < _numBytes && *lhs == *rhs
|
||||
; ++lhs, ++rhs, --_numBytes
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
return 0 == _numBytes ? 0 : *_lhs - *_rhs;
|
||||
return 0 == _numBytes ? 0 : *lhs - *rhs;
|
||||
}
|
||||
|
||||
int32_t memCmp(const char* _lhs, const char* _rhs, size_t _numBytes)
|
||||
int32_t memCmp(const void* _lhs, const void* _rhs, size_t _numBytes)
|
||||
{
|
||||
#if BX_CRT_NONE
|
||||
return memCmpRef(_lhs, _rhs, _numBytes);
|
||||
@@ -443,7 +445,7 @@ extern "C" void* memset(void* _dst, int _ch, size_t _numBytes)
|
||||
return _dst;
|
||||
}
|
||||
|
||||
extern "C" int32_t memcmp(const char* _lhs, const char* _rhs, size_t _numBytes)
|
||||
extern "C" int32_t memcmp(const void* _lhs, const void* _rhs, size_t _numBytes)
|
||||
{
|
||||
return bx::memCmp(_lhs, _rhs, _numBytes);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user