Fix some Sparc32 compile warnings

git-svn-id: svn://coreboot.org/openbios/openbios-devel@189 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
Blue Swirl
2008-07-07 18:35:51 +00:00
parent a7b1d8e657
commit 5205e45840
33 changed files with 169 additions and 159 deletions

View File

@@ -15,7 +15,7 @@
#include "openbios/kernel.h"
/* Format a string and print it on the screen, just like the libc
* function printf.
* function printf.
*/
int printk( const char *fmt, ... )
{
@@ -92,12 +92,13 @@ void *malloc(int size)
if (size > ALLOC_BLOCK)
alloc_size = size;
// Recover possible leftover
if (ofmem.left > sizeof(alloc_desc_t) + 4) {
alloc_desc_t *d;
if ((size_t)ofmem.left > sizeof(alloc_desc_t) + 4) {
alloc_desc_t *d_leftover;
d = (alloc_desc_t*)ofmem.next_malloc;
d->size = ofmem.left - sizeof(alloc_desc_t);
free((unsigned long)d + sizeof(alloc_desc_t));
d_leftover = (alloc_desc_t*)ofmem.next_malloc;
d_leftover->size = ofmem.left - sizeof(alloc_desc_t);
free((void *)((unsigned long)d_leftover +
sizeof(alloc_desc_t)));
}
ofmem.next_malloc = mem_alloc(&cmem, alloc_size, 4);