g13d: Run clang-format to clean things up a bit

This commit is contained in:
June Tate-Gans 2021-04-25 14:04:12 -05:00
parent 70e77c2b3b
commit 516423ae16
3 changed files with 57 additions and 57 deletions

View File

@ -177,25 +177,25 @@ void G13_LCD::image_test(int x, int y) {
} else { } else {
image_clear(); image_clear();
switch (x) { switch (x) {
case 1: case 1:
for (row = 0; row < G13_LCD_ROWS; ++row) { for (row = 0; row < G13_LCD_ROWS; ++row) {
col = row; col = row;
image_setpixel(row, col); image_setpixel(row, col);
image_setpixel(row, G13_LCD_COLUMNS - col); image_setpixel(row, G13_LCD_COLUMNS - col);
} }
break; break;
case 2: case 2:
default: default:
for (row = 0; row < G13_LCD_ROWS; ++row) { for (row = 0; row < G13_LCD_ROWS; ++row) {
col = row; col = row;
image_setpixel(row, 8); image_setpixel(row, 8);
image_setpixel(row, G13_LCD_COLUMNS - 8); image_setpixel(row, G13_LCD_COLUMNS - 8);
image_setpixel(row, G13_LCD_COLUMNS / 2); image_setpixel(row, G13_LCD_COLUMNS / 2);
image_setpixel(row, col); image_setpixel(row, col);
image_setpixel(row, G13_LCD_COLUMNS - col); image_setpixel(row, G13_LCD_COLUMNS - col);
} }
break; break;
} }
} }
image_send(); image_send();

View File

@ -57,10 +57,10 @@ void G13_Stick::set_mode(stick_mode_t m) {
} }
_stick_mode = m; _stick_mode = m;
switch (_stick_mode) { switch (_stick_mode) {
case STICK_CALBOUNDS: case STICK_CALBOUNDS:
_bounds.tl = G13_StickCoord(255, 255); _bounds.tl = G13_StickCoord(255, 255);
_bounds.br = G13_StickCoord(0, 0); _bounds.br = G13_StickCoord(0, 0);
break; break;
} }
} }
@ -116,17 +116,17 @@ void G13_Stick::parse_joystick(unsigned char *buf) {
// update targets if we're in calibration mode // update targets if we're in calibration mode
switch (_stick_mode) { switch (_stick_mode) {
case STICK_CALCENTER: case STICK_CALCENTER:
_center_pos = _current_pos; _center_pos = _current_pos;
return; return;
case STICK_CALNORTH: case STICK_CALNORTH:
_north_pos = _current_pos; _north_pos = _current_pos;
return; return;
case STICK_CALBOUNDS: case STICK_CALBOUNDS:
_bounds.expand(_current_pos); _bounds.expand(_current_pos);
return; return;
}; };
// determine our normalized position // determine our normalized position

View File

@ -41,34 +41,34 @@ void string_repr_out::write_on(std::ostream &o) const {
while (cp < end) { while (cp < end) {
switch (*cp) { switch (*cp) {
case '\n': case '\n':
o << "\\n"; o << "\\n";
break; break;
case '\r': case '\r':
o << "\\r"; o << "\\r";
break; break;
case '\0': case '\0':
o << "\\0"; o << "\\0";
break; break;
case '\t': case '\t':
o << "\\t"; o << "\\t";
break; break;
case '\\': case '\\':
case '\'': case '\'':
case '\"': case '\"':
o << "\\" << *cp; o << "\\" << *cp;
break; break;
default: { default: {
char c = *cp; char c = *cp;
if (c < 32) { if (c < 32) {
char hi = '0' + (c & 0x0f); char hi = '0' + (c & 0x0f);
char lo = '0' + ((c >> 4) & 0x0f); char lo = '0' + ((c >> 4) & 0x0f);
o << "\\x" << hi << lo; o << "\\x" << hi << lo;
} else { } else {
o << c; o << c;
}
} }
} }
}
cp++; cp++;
} }