From 0ef23319995c99783e9050efdf17dc917e626499 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 13 Sep 2014 12:15:47 +0200 Subject: readability MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/test/test.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/test/test.c b/src/test/test.c index 34e99ab..0bdadf9 100644 --- a/src/test/test.c +++ b/src/test/test.c @@ -151,7 +151,7 @@ int main(void) #define X(R) \ libgamma_crtc_get_gamma_##R(crtc_state, &old_##R); \ - if (r = libgamma_crtc_get_gamma_##R(crtc_state, &R), r) \ + if ((r = libgamma_crtc_get_gamma_##R(crtc_state, &R))) \ { \ libgamma_perror("libgamma_crtc_get_gamma_" #R, r); \ goto done; \ @@ -166,12 +166,9 @@ int main(void) printf("Current gamma ramps (" #R "):\n"); \ for (i = 0; i < n; i++) \ { \ - if (i < R.red_size) Y(R, red); \ - else printf(" "); \ - if (i < R.green_size) Y(R, green); \ - else printf(" "); \ - if (i < R.blue_size) Y(R, blue); \ - else printf(" "); \ + if (i < R.red_size) Y(R, red); else printf(" "); \ + if (i < R.green_size) Y(R, green); else printf(" "); \ + if (i < R.blue_size) Y(R, blue); else printf(" "); \ printf("\n"); \ } \ printf("\n"); \ @@ -180,12 +177,10 @@ int main(void) R.red[i] /= 2; \ \ printf("Dimming monitor for 1 second...\n"); \ - r = libgamma_crtc_set_gamma_##R(crtc_state, R); \ - if (r) \ + if ((r = libgamma_crtc_set_gamma_##R(crtc_state, R))) \ libgamma_perror("libgamma_crtc_set_gamma_" #R, r); \ sleep(1); \ - r = libgamma_crtc_set_gamma_##R(crtc_state, old_##R); \ - if (r) \ + if ((r = libgamma_crtc_set_gamma_##R(crtc_state, old_##R))) \ libgamma_perror("libgamma_crtc_set_gamma_" #R, r); \ printf("Done!\n"); \ printf("Sleeping for 1 second...\n"); \ -- cgit v1.2.3-70-g09d2