fix more warings

This commit is contained in:
Stanislav Shwartsman 2011-09-30 21:02:09 +00:00
parent f425400af5
commit 391b4d9eee

View File

@ -2090,8 +2090,6 @@ void bx_hard_drive_c::write(Bit32u address, Bit32u value, unsigned io_len)
case 0xec: // IDENTIFY DEVICE
{
Bit16u temp16;
BX_DEBUG(("Drive ID Command issued : 0xec "));
if (!BX_SELECTED_IS_PRESENT(channel)) {
@ -2122,7 +2120,7 @@ void bx_hard_drive_c::write(Bit32u address, Bit32u value, unsigned io_len)
// now convert the id_drive array (native 256 word format) to
// the controller buffer (512 bytes)
for (i=0; i<=255; i++) {
temp16 = BX_SELECTED_DRIVE(channel).id_drive[i];
Bit16u temp16 = BX_SELECTED_DRIVE(channel).id_drive[i];
BX_SELECTED_CONTROLLER(channel).buffer[i*2] = temp16 & 0x00ff;
BX_SELECTED_CONTROLLER(channel).buffer[i*2+1] = temp16 >> 8;
}
@ -2233,8 +2231,6 @@ void bx_hard_drive_c::write(Bit32u address, Bit32u value, unsigned io_len)
// ATAPI commands
case 0xa1: // IDENTIFY PACKET DEVICE
{
Bit16u temp16;
if (BX_SELECTED_IS_CD(channel)) {
BX_SELECTED_CONTROLLER(channel).current_command = value;
BX_SELECTED_CONTROLLER(channel).error_register = 0;
@ -2254,7 +2250,7 @@ void bx_hard_drive_c::write(Bit32u address, Bit32u value, unsigned io_len)
// now convert the id_drive array (native 256 word format) to
// the controller buffer (512 bytes)
for (i = 0; i <= 255; i++) {
temp16 = BX_SELECTED_DRIVE(channel).id_drive[i];
Bit16u temp16 = BX_SELECTED_DRIVE(channel).id_drive[i];
BX_SELECTED_CONTROLLER(channel).buffer[i*2] = temp16 & 0x00ff;
BX_SELECTED_CONTROLLER(channel).buffer[i*2+1] = temp16 >> 8;
}
@ -3438,12 +3434,11 @@ error_recovery_t::error_recovery_t()
int get_device_handle_from_param(bx_param_c *param)
{
char pname[BX_PATHNAME_LEN];
int handle;
bx_list_c *base = (bx_list_c*) param->get_parent();
base->get_param_path(pname, BX_PATHNAME_LEN);
if (!strncmp(pname, "ata.", 4)) {
handle = (pname[4] - '0') << 1;
int handle = (pname[4] - '0') << 1;
if (!strcmp(base->get_name(), "slave")) {
handle |= 1;
}
@ -3455,10 +3450,8 @@ int get_device_handle_from_param(bx_param_c *param)
Bit64s bx_hard_drive_c::cdrom_status_handler(bx_param_c *param, int set, Bit64s val)
{
int handle;
if (set) {
handle = get_device_handle_from_param(param);
int handle = get_device_handle_from_param(param);
if (handle >= 0) {
if (!strcmp(param->get_name(), "status")) {
BX_HD_THIS channels[handle/2].drives[handle%2].status_changed = 1;
@ -3473,13 +3466,11 @@ Bit64s bx_hard_drive_c::cdrom_status_handler(bx_param_c *param, int set, Bit64s
const char *bx_hard_drive_c::cdrom_path_handler(bx_param_string_c *param, int set,
const char *oldval, const char *val, int maxlen)
{
int handle;
if (set) {
if (strlen(val) < 1) {
val = "none";
}
handle = get_device_handle_from_param(param);
int handle = get_device_handle_from_param(param);
if (handle >= 0) {
if (!strcmp(param->get_name(), "path")) {
BX_HD_THIS channels[handle/2].drives[handle%2].status_changed = 1;