Small code fix up
- Moved memcmp function to temporary libc/mem.h - I/O functions are inlined - ATA_DEVICE read function won't print the 512 bytes by default
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
#pragma once
|
||||
// NOTE: These should not be inline
|
||||
inline void* memset (void* ptr, int value, size_t num){
|
||||
for( int i = 0; i < num; i++ )
|
||||
{
|
||||
@ -6,3 +8,23 @@ inline void* memset (void* ptr, int value, size_t num){
|
||||
}
|
||||
return ptr;
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline int memcmp( const void* ptr1, const void* ptr2, size_t num)
|
||||
{
|
||||
const unsigned char * cs = (const unsigned char*) ptr1;
|
||||
const unsigned char * ct = (const unsigned char*) ptr2;
|
||||
|
||||
|
||||
for (int i = 0 ; i < num ; i++, cs++, ct++ ){
|
||||
if( *cs < *ct){
|
||||
return -1;
|
||||
} else if( *cs > *ct){
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
Reference in New Issue
Block a user