Code style

This commit is contained in:
Simon Long 2024-05-03 13:27:17 +01:00
parent 6038c87d03
commit ea3674faf0
2 changed files with 17 additions and 8 deletions

View file

@ -25,7 +25,7 @@ enum magnify_dir {
MAGNIFY_DECREASE MAGNIFY_DECREASE
}; };
void magnify_toggle (void); void magnify_toggle(void);
void magnify_set_scale (enum magnify_dir dir); void magnify_set_scale(enum magnify_dir dir);
#endif /* LABWC_SCENE_HELPERS_H */ #endif /* LABWC_SCENE_HELPERS_H */

View file

@ -749,10 +749,19 @@ set_adaptive_sync_mode(const char *str, enum adaptive_sync_mode *variable)
static bool parse_rgb(const char *str, int *r, int *g, int *b) static bool parse_rgb(const char *str, int *r, int *g, int *b)
{ {
int rr, rg, rb; int rr, rg, rb;
if (!str) return false;
if (strlen(str) != 7) return false; if (!str) {
if (str[0] != '#') return false; return false;
if (sscanf(str, "#%2X%2X%2X", &rr, &rg, &rb) != 3) return false; }
if (strlen(str) != 7) {
return false;
}
if (str[0] != '#') {
return false;
}
if (sscanf(str, "#%2X%2X%2X", &rr, &rg, &rb) != 3) {
return false;
}
*r = rr; *r = rr;
*g = rg; *g = rg;
*b = rb; *b = rb;