mirror of https://github.com/PCSX2/pcsx2.git
USB: make dev_index u32 for simpler check if it is valid
This commit is contained in:
parent
17cbb835ce
commit
91d4c4aa37
|
@ -54,8 +54,8 @@ typedef struct
|
|||
struct usb_packet
|
||||
{
|
||||
USBEndpoint ep; //usb packet endpoint
|
||||
int dev_index;
|
||||
int data_size;
|
||||
u32 dev_index;
|
||||
u32 data_size;
|
||||
} usb_packet;
|
||||
} USBfreezeData;
|
||||
|
||||
|
@ -461,9 +461,9 @@ s32 USBfreeze(int mode, freezeData* data)
|
|||
ptr += usbd.device[i].size;
|
||||
}
|
||||
|
||||
int dev_index = usbd.usb_packet.dev_index;
|
||||
u32 dev_index = usbd.usb_packet.dev_index;
|
||||
|
||||
if (usb_device[dev_index])
|
||||
if (dev_index < countof(usb_device) && usb_device[dev_index])
|
||||
{
|
||||
USBPacket* p = &qemu_ohci->usb_packet;
|
||||
p->actual_length = usbd.usb_packet.data_size;
|
||||
|
@ -495,10 +495,6 @@ s32 USBfreeze(int mode, freezeData* data)
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
//TODO straight copying of structs can break cross-platform/cross-compiler save states 'cause padding 'n' stuff
|
||||
|
|
Loading…
Reference in New Issue