remove all comile warning of kernel

This commit is contained in:
Wang_Weigen
2021-04-29 16:15:11 +08:00
parent c4280d9488
commit e424932163
9 changed files with 21 additions and 15 deletions

View File

@@ -160,7 +160,7 @@ struct statfs {
int statfs(const char *path, struct statfs *buf);
#endif
void Userprintf(const char *fmt, ...);
int Userprintf(const char *fmt, ...);
#define printf Userprintf

View File

@@ -159,7 +159,7 @@ struct statfs {
int statfs(const char *path, struct statfs *buf);
#endif
void UserPrintf(const char *fmt, ...);
int UserPrintf(const char *fmt, ...);
#else
struct utask

View File

@@ -57,7 +57,7 @@
*/
struct DynamicAllocNode
{
uint32 size; /* the size of dynamicAllocNode */
x_size_t size; /* the size of dynamicAllocNode */
uint32 prev_adj_size; /* the size of the previous adjacent node, (dynamic alloc node or dynamic free node */
};
@@ -480,7 +480,7 @@ static void SmallMemInit(struct ByteMemory *byte_memory)
for(offset = 0; offset < item->block_total_count; offset++) {
node = PTR2ALLOCNODE((char*)item->freelist + offset * (SIZEOF_32B + SIZEOF_DYNAMICALLOCNODE_MEM));
node->size =(uint64) ((char*)item->freelist + (offset + 1) * (SIZEOF_32B + SIZEOF_DYNAMICALLOCNODE_MEM));
node->size =(x_size_t) ((char*)item->freelist + (offset + 1) * (SIZEOF_32B + SIZEOF_DYNAMICALLOCNODE_MEM));
node->prev_adj_size = STATIC_BLOCK_MASK;
}
node->size = NONE;
@@ -501,7 +501,7 @@ static void SmallMemInit(struct ByteMemory *byte_memory)
for(offset = 0; offset < item->block_total_count; offset++) {
node = PTR2ALLOCNODE((char*)item->freelist + offset * (SIZEOF_64B + SIZEOF_DYNAMICALLOCNODE_MEM));
node->size =(uint64) ((char*)item->freelist + (offset + 1) * (SIZEOF_64B + SIZEOF_DYNAMICALLOCNODE_MEM));
node->size =(x_size_t) ((char*)item->freelist + (offset + 1) * (SIZEOF_64B + SIZEOF_DYNAMICALLOCNODE_MEM));
node->prev_adj_size = STATIC_BLOCK_MASK;
}
node->size = NONE;
@@ -527,10 +527,10 @@ static void SmallMemFree(void *pointer)
/* get the allocNode */
node = PTR2ALLOCNODE((char*)pointer-SIZEOF_DYNAMICALLOCNODE_MEM);
StaticSegment = (struct segment*)(uint64)node->size;
StaticSegment = (struct segment*)(x_size_t)node->size;
/* update the statistic information of StaticSegment */
node->size = (uint64)StaticSegment->freelist;
node->size = (x_size_t)StaticSegment->freelist;
StaticSegment->freelist = (uint8 *)node;
StaticSegment->block_free_count++;

View File

@@ -500,9 +500,11 @@ int VsnPrintf(char *buf, int32 size, const char *fmt, va_list args)
width = sizeof(void *) * 2;
flags |= ZEROPAD | CAPITAL;
/* Determine the machine word length */
#ifdef ARCH_CPU_64BIT
if(sizeof(long) == sizeof(long long))
pointer = LonglongToChar(buf, (unsigned long long)va_arg(args, void*), flags, precision, 16, width, 0, pointer, size);
else
#endif
pointer = LongToChar(buf, (unsigned long)va_arg(args, void*), flags, precision, 16, width, 0, pointer, size);
if(pointer >= size) {