output/winmm: eliminate "goto"
This commit is contained in:
parent
2f41eba100
commit
a261442279
@ -96,8 +96,13 @@ get_device_id(const char *device_name, UINT *device_id, Error &error)
|
|||||||
char *endptr;
|
char *endptr;
|
||||||
UINT id = strtoul(device_name, &endptr, 0);
|
UINT id = strtoul(device_name, &endptr, 0);
|
||||||
if (endptr > device_name && *endptr == 0) {
|
if (endptr > device_name && *endptr == 0) {
|
||||||
if (id >= numdevs)
|
if (id >= numdevs) {
|
||||||
goto fail;
|
error.Format(winmm_output_domain,
|
||||||
|
"device \"%s\" is not found",
|
||||||
|
device_name);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
*device_id = id;
|
*device_id = id;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -116,7 +121,6 @@ get_device_id(const char *device_name, UINT *device_id, Error &error)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fail:
|
|
||||||
error.Format(winmm_output_domain,
|
error.Format(winmm_output_domain,
|
||||||
"device \"%s\" is not found", device_name);
|
"device \"%s\" is not found", device_name);
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user