mirror of
https://gitlab.com/qemu-project/openbios.git
synced 2024-02-13 08:34:06 +08:00
Use standard types
Replace uchar, uint, ulong, u_char, u_int, u_long, u_int* with their standard equivalents. Fixes warnings like these on OpenBSD: CC target/arch/unix/unix.o In file included from ../arch/unix/unix.c:29: ../include/config.h:26: warning: redefinition of `ulong' /usr/include/sys/types.h:56: warning: `ulong' previously declared here ../include/config.h:26: warning: redundant redeclaration of `ulong' in same scope Signed-off-by: Blue Swirl <blauwirbel@gmail.com> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@830 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
@@ -382,7 +382,7 @@ go_up:
|
||||
pos = n = strlen( buf );
|
||||
break;
|
||||
}
|
||||
if( (uint)ch < 32 )
|
||||
if( (unsigned int)ch < 32 )
|
||||
drop = 1;
|
||||
|
||||
if( !drop && n < ci->ncol ) {
|
||||
|
||||
@@ -35,7 +35,7 @@ typedef struct {
|
||||
xt_t seek_xt, read_xt;
|
||||
ucell offs_hi, offs_lo;
|
||||
ucell size_hi, size_lo;
|
||||
uint blocksize;
|
||||
unsigned int blocksize;
|
||||
phandle_t filesystem_ph;
|
||||
} macparts_info_t;
|
||||
|
||||
@@ -144,10 +144,10 @@ macparts_open( macparts_info_t *di )
|
||||
|
||||
if (str == NULL || parnum == 0) {
|
||||
/* According to the spec, partition 0 as well as no arguments means the whole disk */
|
||||
offs = (llong)0;
|
||||
size = (llong)__be32_to_cpu(dmap.sbBlkCount) * bs;
|
||||
offs = (long long)0;
|
||||
size = (long long)__be32_to_cpu(dmap.sbBlkCount) * bs;
|
||||
|
||||
di->blocksize = (uint)bs;
|
||||
di->blocksize = (unsigned int)bs;
|
||||
|
||||
di->offs_hi = offs >> BITS;
|
||||
di->offs_lo = offs & (ucell) -1;
|
||||
@@ -177,8 +177,8 @@ macparts_open( macparts_info_t *di )
|
||||
if( (__be32_to_cpu(par.pmPartStatus) & kPartitionAUXIsValid) &&
|
||||
(__be32_to_cpu(par.pmPartStatus) & kPartitionAUXIsAllocated) &&
|
||||
(__be32_to_cpu(par.pmPartStatus) & kPartitionAUXIsReadable) ) {
|
||||
offs = (llong)__be32_to_cpu(par.pmPyPartStart) * bs;
|
||||
size = (llong)__be32_to_cpu(par.pmPartBlkCnt) * bs;
|
||||
offs = (long long)__be32_to_cpu(par.pmPyPartStart) * bs;
|
||||
size = (long long)__be32_to_cpu(par.pmPartBlkCnt) * bs;
|
||||
|
||||
goto found;
|
||||
}
|
||||
@@ -194,8 +194,8 @@ macparts_open( macparts_info_t *di )
|
||||
(__be32_to_cpu(par.pmPartStatus) & kPartitionAUXIsAllocated) &&
|
||||
(__be32_to_cpu(par.pmPartStatus) & kPartitionAUXIsReadable) ) {
|
||||
|
||||
offs = (llong)__be32_to_cpu(par.pmPyPartStart) * bs;
|
||||
size = (llong)__be32_to_cpu(par.pmPartBlkCnt) * bs;
|
||||
offs = (long long)__be32_to_cpu(par.pmPyPartStart) * bs;
|
||||
size = (long long)__be32_to_cpu(par.pmPartBlkCnt) * bs;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -209,12 +209,12 @@ found:
|
||||
|
||||
/* If the filename was set to %BOOT, we actually want the bootcode instead */
|
||||
if (want_bootcode) {
|
||||
offs += (llong)__be32_to_cpu(par.pmLgBootStart) * bs;
|
||||
size = (llong)__be32_to_cpu(par.pmBootSize);
|
||||
offs += (long long)__be32_to_cpu(par.pmLgBootStart) * bs;
|
||||
size = (long long)__be32_to_cpu(par.pmBootSize);
|
||||
}
|
||||
|
||||
ret = -1;
|
||||
di->blocksize = (uint)bs;
|
||||
di->blocksize = (unsigned int)bs;
|
||||
|
||||
di->offs_hi = offs >> BITS;
|
||||
di->offs_lo = offs & (ucell) -1;
|
||||
@@ -293,8 +293,8 @@ macparts_initialize( macparts_info_t *di )
|
||||
static void
|
||||
macparts_seek(macparts_info_t *di )
|
||||
{
|
||||
llong pos = DPOP();
|
||||
llong offs, size;
|
||||
long long pos = DPOP();
|
||||
long long offs, size;
|
||||
|
||||
DPRINTF("macparts_seek %llx:\n", pos);
|
||||
|
||||
|
||||
@@ -35,10 +35,10 @@ do { printk("NVRAM: " fmt , ##args); } while (0)
|
||||
|
||||
|
||||
typedef struct {
|
||||
uchar signature;
|
||||
uchar checksum;
|
||||
uchar len_hi;
|
||||
uchar len_lo;
|
||||
unsigned char signature;
|
||||
unsigned char checksum;
|
||||
unsigned char len_hi;
|
||||
unsigned char len_lo;
|
||||
char name[12];
|
||||
char data[0];
|
||||
} nvpart_t;
|
||||
@@ -225,8 +225,8 @@ nvconf_init( void )
|
||||
/************************************************************************/
|
||||
|
||||
typedef struct {
|
||||
uint mark_hi;
|
||||
uint mark_lo;
|
||||
unsigned int mark_hi;
|
||||
unsigned int mark_lo;
|
||||
} nvram_ibuf_t;
|
||||
|
||||
DECLARE_UNNAMED_NODE( nvram, INSTALL_OPEN, sizeof(nvram_ibuf_t ));
|
||||
|
||||
@@ -168,11 +168,11 @@ pcparts_open( pcparts_info_t *di )
|
||||
RET( 0 );
|
||||
}
|
||||
|
||||
offs = (llong)(__le32_to_cpu(p->start_sect)) * bs;
|
||||
offs = (long long)(__le32_to_cpu(p->start_sect)) * bs;
|
||||
di->offs_hi = offs >> BITS;
|
||||
di->offs_lo = offs & (ucell) -1;
|
||||
|
||||
size = (llong)(__le32_to_cpu(p->nr_sects)) * bs;
|
||||
size = (long long)(__le32_to_cpu(p->nr_sects)) * bs;
|
||||
di->size_hi = size >> BITS;
|
||||
di->size_lo = size & (ucell) -1;
|
||||
|
||||
@@ -226,11 +226,11 @@ pcparts_open( pcparts_info_t *di )
|
||||
RET( 0 );
|
||||
}
|
||||
|
||||
offs = (llong)(cur_table+__le32_to_cpu(p->start_sect)) * bs;
|
||||
offs = (long long)(cur_table+__le32_to_cpu(p->start_sect)) * bs;
|
||||
di->offs_hi = offs >> BITS;
|
||||
di->offs_lo = offs & (ucell) -1;
|
||||
|
||||
size = (llong)__le32_to_cpu(p->nr_sects) * bs;
|
||||
size = (long long)__le32_to_cpu(p->nr_sects) * bs;
|
||||
di->size_hi = size >> BITS;
|
||||
di->size_lo = size & (ucell) -1;
|
||||
|
||||
@@ -332,8 +332,8 @@ pcparts_initialize( pcparts_info_t *di )
|
||||
static void
|
||||
pcparts_seek(pcparts_info_t *di )
|
||||
{
|
||||
llong pos = DPOP();
|
||||
llong offs, size;
|
||||
long long pos = DPOP();
|
||||
long long offs, size;
|
||||
|
||||
DPRINTF("pcparts_seek %llx:\n", pos);
|
||||
|
||||
|
||||
@@ -185,18 +185,18 @@ sunparts_open( sunparts_info_t *di )
|
||||
|
||||
DPRINTF("Selected partition %d\n", parnum);
|
||||
|
||||
offs = (llong)__be32_to_cpu(p->partitions[parnum].start_cylinder) *
|
||||
offs = (long long)__be32_to_cpu(p->partitions[parnum].start_cylinder) *
|
||||
__be16_to_cpu(p->ntrks) * __be16_to_cpu(p->nsect) * bs;
|
||||
|
||||
di->offs_hi = offs >> BITS;
|
||||
di->offs_lo = offs & (ucell) -1;
|
||||
size = (llong)__be32_to_cpu(p->partitions[parnum].num_sectors) * bs;
|
||||
size = (long long)__be32_to_cpu(p->partitions[parnum].num_sectors) * bs;
|
||||
di->size_hi = size >> BITS;
|
||||
di->size_lo = size & (ucell) -1;
|
||||
di->type = __be32_to_cpu(p->infos[parnum].id);
|
||||
|
||||
DPRINTF("Found Sun partition, offs %lld size %lld\n",
|
||||
(llong)offs, (llong)size);
|
||||
(long long)offs, (long long)size);
|
||||
|
||||
/* Probe for filesystem at current offset */
|
||||
DPRINTF("sun-parts: about to probe for fs\n");
|
||||
@@ -264,8 +264,8 @@ sunparts_initialize( __attribute__((unused))sunparts_info_t *di )
|
||||
static void
|
||||
sunparts_seek(sunparts_info_t *di )
|
||||
{
|
||||
llong pos = DPOP();
|
||||
llong offs, size;;
|
||||
long long pos = DPOP();
|
||||
long long offs, size;;
|
||||
|
||||
DPRINTF("sunparts_seek %llx:\n", pos);
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ typedef struct osi_fb_info {
|
||||
static struct {
|
||||
int has_video;
|
||||
osi_fb_info_t fb;
|
||||
ulong *pal; /* 256 elements */
|
||||
unsigned long *pal; /* 256 elements */
|
||||
} video;
|
||||
|
||||
|
||||
@@ -83,11 +83,11 @@ startup_splash( void )
|
||||
|
||||
for( y=0 ; y<height; y++, pp += video.fb.rb ) {
|
||||
if( video.fb.depth >= 24 ) {
|
||||
ulong *d = (ulong*)pp;
|
||||
unsigned long *d = (unsigned long*)pp;
|
||||
for( x=0; x<width; x++, p+=3, d++ )
|
||||
*d = ((int)p[0] << 16) | ((int)p[1] << 8) | p[2];
|
||||
} else if( video.fb.depth == 15 ) {
|
||||
ushort *d = (ushort*)pp;
|
||||
unsigned short *d = (unsigned short*)pp;
|
||||
for( x=0; x<width; x++, p+=3, d++ ) {
|
||||
int col = ((int)p[0] << 16) | ((int)p[1] << 8) | p[2];
|
||||
*d = ((col>>9) & 0x7c00) | ((col>>6) & 0x03e0) | ((col>>3) & 0x1f);
|
||||
@@ -102,10 +102,10 @@ startup_splash( void )
|
||||
#endif
|
||||
}
|
||||
|
||||
static ulong
|
||||
static unsigned long
|
||||
get_color( int col_ind )
|
||||
{
|
||||
ulong col;
|
||||
unsigned long col;
|
||||
if( !video.has_video || col_ind < 0 || col_ind > 255 )
|
||||
return 0;
|
||||
if( video.fb.depth == 8 )
|
||||
@@ -129,7 +129,7 @@ draw_pixel( int x, int y, int colind )
|
||||
color = get_color( colind );
|
||||
|
||||
if( d >= 24 )
|
||||
*((ulong*)p + x) = color;
|
||||
*((unsigned long*)p + x) = color;
|
||||
else if( d >= 15 )
|
||||
*((short*)p + x) = color;
|
||||
else
|
||||
@@ -140,7 +140,7 @@ static void
|
||||
fill_rect( int col_ind, int x, int y, int w, int h )
|
||||
{
|
||||
char *pp;
|
||||
ulong col = get_color(col_ind);
|
||||
unsigned long col = get_color(col_ind);
|
||||
|
||||
if( !video.has_video || x < 0 || y < 0 || x+w > video.fb.w || y+h > video.fb.h )
|
||||
return;
|
||||
@@ -149,15 +149,15 @@ fill_rect( int col_ind, int x, int y, int w, int h )
|
||||
for( ; h--; pp += video.fb.rb ) {
|
||||
int ww = w;
|
||||
if( video.fb.depth == 24 || video.fb.depth == 32 ) {
|
||||
ulong *p = (ulong*)pp + x;
|
||||
unsigned long *p = (unsigned long*)pp + x;
|
||||
while( ww-- )
|
||||
*p++ = col;
|
||||
} else if( video.fb.depth == 16 || video.fb.depth == 15 ) {
|
||||
ushort *p = (ushort*)pp + x;
|
||||
unsigned short *p = (unsigned short*)pp + x;
|
||||
while( ww-- )
|
||||
*p++ = col;
|
||||
} else {
|
||||
char *p = (char *)((ushort*)pp + x);
|
||||
char *p = (char *)((unsigned short*)pp + x);
|
||||
|
||||
while( ww-- )
|
||||
*p++ = col;
|
||||
@@ -175,7 +175,7 @@ refresh_palette( void )
|
||||
}
|
||||
|
||||
void
|
||||
set_color( int ind, ulong color )
|
||||
set_color( int ind, unsigned long color )
|
||||
{
|
||||
if( !video.has_video || ind < 0 || ind > 255 )
|
||||
return;
|
||||
@@ -240,11 +240,11 @@ video_set_colors( void )
|
||||
{
|
||||
int count = POP();
|
||||
int start = POP();
|
||||
uchar *p = (uchar*)POP();
|
||||
unsigned char *p = (unsigned char*)POP();
|
||||
int i;
|
||||
|
||||
for( i=0; i<count; i++, p+=3 ) {
|
||||
ulong col = (p[0] << 16) | (p[1] << 8) | p[2];
|
||||
unsigned long col = (p[0] << 16) | (p[1] << 8) | p[2];
|
||||
set_color( i + start, col );
|
||||
}
|
||||
refresh_palette();
|
||||
@@ -258,7 +258,7 @@ video_color_bang( void )
|
||||
int b = POP();
|
||||
int g = POP();
|
||||
int r = POP();
|
||||
ulong col = ((r << 16) & 0xff0000) | ((g << 8) & 0x00ff00) | (b & 0xff);
|
||||
unsigned long col = ((r << 16) & 0xff0000) | ((g << 8) & 0x00ff00) | (b & 0xff);
|
||||
/* printk("color!: %08lx %08lx %08lx %08lx\n", r, g, b, index ); */
|
||||
set_color( index, col );
|
||||
refresh_palette();
|
||||
@@ -327,7 +327,7 @@ init_video( unsigned long fb, int width, int height, int depth, int rb )
|
||||
set_int_property( ph, "address", video.fb.mphys );
|
||||
}
|
||||
video.has_video = 1;
|
||||
video.pal = malloc( 256 * sizeof(ulong) );
|
||||
video.pal = malloc( 256 * sizeof(unsigned long) );
|
||||
|
||||
#ifdef CONFIG_PPC
|
||||
s = (video.fb.mphys & 0xfff);
|
||||
|
||||
Reference in New Issue
Block a user