ctemp

Set color temperature
git clone git://git.akobets.xyz/ctemp
Log | Files | Refs | README | LICENSE

commit c99330628084b1e4a79cc09dc95f66fdede3852c
parent 4536b19fa8e6642c0fdc5c9afdc003cab760c8f1
Author: Artem Kobets <artem@akobets.xyz>
Date:   Thu,  5 Mar 2020 22:22:20 +0200

Remove unneeded constants

Diffstat:
Mcolors.c | 6+++++-
Mconfig.mk | 2--
Mctemp.c | 16+++++++---------
3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/colors.c b/colors.c @@ -3,7 +3,11 @@ /* Cribbed from Redshift. This table data * was released into public domain * and originally provided by Ingo Thies, 2013 */ -const struct { float r; float g; float b; } whitepoints[] = { +const struct { + float r; + float g; + float b; +} whitepoints[] = { { 1.00000000, 0.18172716, 0.00000000, }, /* 1000K */ { 1.00000000, 0.25503671, 0.00000000, }, /* 1100K */ { 1.00000000, 0.30942099, 0.00000000, }, /* 1200K */ diff --git a/config.mk b/config.mk @@ -1,4 +1,3 @@ -# ctemp version VERSION = 0.1.1 # Customize below to fit your system @@ -10,7 +9,6 @@ ENABLE_QUARTZ = OFF # X11 support ENABLE_X = ON -# paths PREFIX = /usr/local MANPREFIX = $(PREFIX)/share/man diff --git a/ctemp.c b/ctemp.c @@ -14,7 +14,6 @@ #include "arg.h" #define LEN(x) (sizeof(x) / sizeof(x[0])) -#define MAX_INTERFACE_STR_LEN 1024 #define TEMP_MIN 1000 #define TEMP_MAX 25000 @@ -49,24 +48,23 @@ Interface interfaces[] = { #endif }; -extern const struct { float r; float g; float b; } whitepoints[]; +extern const struct { + float r; + float g; + float b; +} whitepoints[]; char *argv0; #ifdef DRM_SUPPORT #include <xf86drm.h> #include <xf86drmMode.h> -#define MAX_DRM_NODE_LEN (sizeof(DRM_DIR_NAME) + 1 /* slash */ \ - + sizeof(DRM_PRIMARY_MINOR_NAME) \ - + sizeof("15") /* highest possible node number */ \ - + 1) /* NULL-terminator */ - static void drm_handler(int temp) { unsigned int i; float ratio_red, ratio_green, ratio_blue; - char dev_name[MAX_DRM_NODE_LEN]; + char dev_name[64]; int fd; drmModeResPtr res; uint16_t *colors, *red, *green, *blue; @@ -255,7 +253,7 @@ die(const char *fmt, ...) static void usage() { - char ifStr[MAX_INTERFACE_STR_LEN]; + char ifStr[64]; unsigned int i; ifStr[0] = '\0';