mirror of https://github.com/OpenTTD/OpenTTD
Fix: Signedness issue in midi driver
parent
fe9731d32c
commit
3cc6b7f725
|
@ -369,7 +369,7 @@ const char *MusicDriver_Win32::Start(const char * const *parm)
|
||||||
DEBUG(driver, 2, "Win32-MIDI: Start: initializing");
|
DEBUG(driver, 2, "Win32-MIDI: Start: initializing");
|
||||||
|
|
||||||
int resolution = GetDriverParamInt(parm, "resolution", 5);
|
int resolution = GetDriverParamInt(parm, "resolution", 5);
|
||||||
int port = GetDriverParamInt(parm, "port", -1);
|
uint port = (uint)GetDriverParamInt(parm, "port", UINT_MAX);
|
||||||
const char *portname = GetDriverParam(parm, "portname");
|
const char *portname = GetDriverParam(parm, "portname");
|
||||||
|
|
||||||
/* Enumerate ports either for selecting port by name, or for debug output */
|
/* Enumerate ports either for selecting port by name, or for debug output */
|
||||||
|
@ -392,7 +392,7 @@ const char *MusicDriver_Win32::Start(const char * const *parm)
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT devid;
|
UINT devid;
|
||||||
if (port < 0) {
|
if (port == UINT_MAX) {
|
||||||
devid = MIDI_MAPPER;
|
devid = MIDI_MAPPER;
|
||||||
} else {
|
} else {
|
||||||
devid = (UINT)port;
|
devid = (UINT)port;
|
||||||
|
|
Loading…
Reference in New Issue