diff options
author | Mattias Andrée <m@maandree.se> | 2025-03-06 16:57:49 +0100 |
---|---|---|
committer | Mattias Andrée <m@maandree.se> | 2025-03-06 16:57:49 +0100 |
commit | 4c3cd7fde636946bb806d9b2d025c59418fa4e85 (patch) | |
tree | 5fccfab94b4ee535c4627be80a9ea92e5ae291b2 /src/gamma-vidmode.c | |
parent | Style (diff) | |
download | redshift-ng-4c3cd7fde636946bb806d9b2d025c59418fa4e85.tar.gz redshift-ng-4c3cd7fde636946bb806d9b2d025c59418fa4e85.tar.bz2 redshift-ng-4c3cd7fde636946bb806d9b2d025c59418fa4e85.tar.xz |
style and some minor fixes
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'src/gamma-vidmode.c')
-rw-r--r-- | src/gamma-vidmode.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/src/gamma-vidmode.c b/src/gamma-vidmode.c index 1fda89a..8cd5e04 100644 --- a/src/gamma-vidmode.c +++ b/src/gamma-vidmode.c @@ -44,7 +44,7 @@ vidmode_init(struct gamma_state **state) /* Open display */ s->display = XOpenDisplay(NULL); if (!s->display) { - weprintf(_("X request failed: %s\n"), "XOpenDisplay"); + weprintf(_("X request failed: %s"), "XOpenDisplay"); return -1; } @@ -68,19 +68,19 @@ vidmode_start(struct gamma_state *state, enum program_mode mode) /* Query extension version */ r = XF86VidModeQueryVersion(state->display, &major, &minor); if (!r) { - weprintf(_("X request failed: %s\n"), "XF86VidModeQueryVersion"); + weprintf(_("X request failed: %s"), "XF86VidModeQueryVersion"); return -1; } /* Request size of gamma ramps */ r = XF86VidModeGetGammaRampSize(state->display, state->screen_num, &state->ramp_size); if (!r) { - weprintf(_("X request failed: %s\n"), "XF86VidModeGetGammaRampSize"); + weprintf(_("X request failed: %s"), "XF86VidModeGetGammaRampSize"); return -1; } if (!state->ramp_size) { - weprintf(_("Gamma ramp size too small: %i\n"), state->ramp_size); + weprintf(_("Gamma ramp size too small: %i"), state->ramp_size); return -1; } @@ -95,7 +95,7 @@ vidmode_start(struct gamma_state *state, enum program_mode mode) r = XF86VidModeGetGammaRamp(state->display, state->screen_num, state->ramp_size, gamma_r, gamma_g, gamma_b); if (!r) { - weprintf(_("X request failed: %s\n"), "XF86VidModeGetGammaRamp"); + weprintf(_("X request failed: %s"), "XF86VidModeGetGammaRamp"); return -1; } @@ -105,12 +105,8 @@ vidmode_start(struct gamma_state *state, enum program_mode mode) static void vidmode_free(struct gamma_state *state) { - /* Free saved ramps */ free(state->saved_ramps); - - /* Close display connection */ XCloseDisplay(state->display); - free(state); } @@ -131,10 +127,9 @@ vidmode_set_option(struct gamma_state *state, const char *key, const char *value if (!strcasecmp(key, "screen")) { state->screen_num = atoi(value); } else if (!strcasecmp(key, "preserve")) { - weprintf(_("Parameter `%s` is now always on; Use the `%s` " - "command-line option to disable.\n"), key, "-P"); + weprintf(_("Parameter `%s' is now always on; use the `%s' command-line option to disable."), key, "-P"); } else { - weprintf(_("Unknown method parameter: `%s'.\n"), key); + weprintf(_("Unknown method parameter: `%s'."), key); return -1; } @@ -153,7 +148,7 @@ vidmode_restore(struct gamma_state *state) r = XF86VidModeSetGammaRamp(state->display, state->screen_num, state->ramp_size, gamma_r, gamma_g, gamma_b); if (!r) - weprintf(_("X request failed: %s\n"), "XF86VidModeSetGammaRamp"); + weprintf(_("X request failed: %s"), "XF86VidModeSetGammaRamp"); } static int @@ -190,7 +185,7 @@ vidmode_set_temperature( r = XF86VidModeSetGammaRamp(state->display, state->screen_num, state->ramp_size, gamma_r, gamma_g, gamma_b); if (!r) { - weprintf(_("X request failed: %s\n"), "XF86VidModeSetGammaRamp"); + weprintf(_("X request failed: %s"), "XF86VidModeSetGammaRamp"); free(gamma_ramps); return -1; } |