aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2021-03-07 13:22:52 +0100
committerTeddy Wing2021-03-07 13:22:52 +0100
commit0ddc422df631d85b4981f03d7ac93535e563a794 (patch)
tree641dc19a051a1d084686cc162af9df16637f2720
parent5fd5ad3d85ff91b2c3bcf8fd6db26bdde4cc7646 (diff)
downloadRe-Good-Catalina-Invert-Colours-0ddc422df631d85b4981f03d7ac93535e563a794.tar.bz2
Invert: Move `inverted_gamma` to static const
Since this is a literal, it can be declared statically.
-rw-r--r--Invert.m10
1 files changed, 5 insertions, 5 deletions
diff --git a/Invert.m b/Invert.m
index b5675eb..240c022 100644
--- a/Invert.m
+++ b/Invert.m
@@ -2,6 +2,8 @@
#define MAX_DISPLAYS 8
+static const CGGammaValue INVERTED_GAMMA[2] = {1, 0};
+
@implementation Invert
- (id)init
@@ -31,8 +33,6 @@
- (void)invertColors
{
- const CGGammaValue inverted_gamma[2] = {1, 0};
-
CGDirectDisplayID active_displays[MAX_DISPLAYS];
uint32_t display_count;
@@ -49,9 +49,9 @@
error = CGSetDisplayTransferByTable(
active_displays[i],
2,
- inverted_gamma,
- inverted_gamma,
- inverted_gamma
+ INVERTED_GAMMA,
+ INVERTED_GAMMA,
+ INVERTED_GAMMA
);
if (error != kCGErrorSuccess) {
// TODO: error handling