Cleanup: Cleanup: style, use braces for GHOST (X11/SDL)

This commit is contained in:
Campbell Barton
2019-06-04 11:30:31 +10:00
parent 0dbd05ffdd
commit 935c9ab0de
29 changed files with 439 additions and 222 deletions

View File

@@ -46,10 +46,11 @@ GHOST_NDOFManagerUnix::GHOST_NDOFManagerUnix(GHOST_System &sys)
char line[MAX_LINE_LENGTH] = {0};
while (fgets(line, MAX_LINE_LENGTH, command_output)) {
unsigned short vendor_id = 0, product_id = 0;
if (sscanf(line, "Bus %*d Device %*d: ID %hx:%hx", &vendor_id, &product_id) == 2)
if (sscanf(line, "Bus %*d Device %*d: ID %hx:%hx", &vendor_id, &product_id) == 2) {
if (setDevice(vendor_id, product_id)) {
break; /* stop looking once the first 3D mouse is found */
}
}
}
pclose(command_output);
}
@@ -58,8 +59,9 @@ GHOST_NDOFManagerUnix::GHOST_NDOFManagerUnix(GHOST_System &sys)
GHOST_NDOFManagerUnix::~GHOST_NDOFManagerUnix()
{
if (m_available)
if (m_available) {
spnav_close();
}
}
bool GHOST_NDOFManagerUnix::available()