From 2c36f5e6c77a059523da7e264bc02f016a591131 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Mon, 18 Apr 2005 09:17:27 +0000 Subject: [PATCH] Save a few bytes by using naturally-sized ints. --- src/arch/i386/firmware/pcbios/basemem.c | 8 ++++---- src/arch/i386/include/basemem.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/arch/i386/firmware/pcbios/basemem.c b/src/arch/i386/firmware/pcbios/basemem.c index 1d900b78..0bc9ca98 100644 --- a/src/arch/i386/firmware/pcbios/basemem.c +++ b/src/arch/i386/firmware/pcbios/basemem.c @@ -29,7 +29,7 @@ static void free_unused_base_memory ( void ); * Return amount of free base memory in bytes * */ -uint32_t get_free_base_memory ( void ) { +unsigned int get_free_base_memory ( void ) { return fbms << 10; } @@ -39,7 +39,7 @@ uint32_t get_free_base_memory ( void ) { * */ void * alloc_base_memory ( size_t size ) { - uint16_t size_kb = ( size + 1023 ) >> 10; + unsigned int size_kb = ( size + 1023 ) >> 10; void *ptr; DBG ( "Trying to allocate %d bytes of base memory from %d kB free\n", @@ -99,8 +99,8 @@ void * alloc_base_memory ( size_t size ) { * */ void free_base_memory ( void *ptr, size_t size ) { - uint16_t remainder = virt_to_phys ( ptr ) & 1023; - uint16_t size_kb = ( size + remainder + 1023 ) >> 10; + unsigned int remainder = virt_to_phys ( ptr ) & 1023; + unsigned int size_kb = ( size + remainder + 1023 ) >> 10; union free_base_memory_block *free_block = ( ( void * ) ( ptr - remainder ) ); diff --git a/src/arch/i386/include/basemem.h b/src/arch/i386/include/basemem.h index 84c7a490..6e7c22dd 100644 --- a/src/arch/i386/include/basemem.h +++ b/src/arch/i386/include/basemem.h @@ -24,7 +24,7 @@ union free_base_memory_block { }; /* Function prototypes */ -extern uint32_t get_free_base_memory ( void ); +extern unsigned int get_free_base_memory ( void ); extern void * alloc_base_memory ( size_t size ); extern void free_base_memory ( void *ptr, size_t size );