Skip to content

Commit a13d396

Browse files
committed
clang format
1 parent 6773c6d commit a13d396

File tree

1 file changed

+38
-39
lines changed

1 file changed

+38
-39
lines changed

ttyplot.c

Lines changed: 38 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@
6161
#endif
6262

6363
// Define standard curses color constants for better readability
64-
#define C_BLACK 0
65-
#define C_RED 1
66-
#define C_GREEN 2
67-
#define C_YELLOW 3
68-
#define C_BLUE 4
64+
#define C_BLACK 0
65+
#define C_RED 1
66+
#define C_GREEN 2
67+
#define C_YELLOW 3
68+
#define C_BLUE 4
6969
#define C_MAGENTA 5
70-
#define C_CYAN 6
71-
#define C_WHITE 7
70+
#define C_CYAN 6
71+
#define C_WHITE 7
7272

7373
// Define color element indices
7474
enum ColorElement {
@@ -157,36 +157,36 @@ static void version(void) {
157157
static void set_color_scheme(const char *scheme_name) {
158158
if (strcmp(scheme_name, "dark1") == 0) {
159159
// Blue-cyan-yellow scheme for dark terminals
160-
colors[LINE_COLOR] = C_BLUE; // Blue for plot line
161-
colors[AXES_COLOR] = C_CYAN; // Cyan for axes
162-
colors[TEXT_COLOR] = C_WHITE; // White for text
163-
colors[TITLE_COLOR] = C_YELLOW; // Yellow for title
164-
colors[MAX_ERROR_COLOR] = C_RED; // Red for max error
165-
colors[MIN_ERROR_COLOR] = C_GREEN; // Green for min error
160+
colors[LINE_COLOR] = C_BLUE; // Blue for plot line
161+
colors[AXES_COLOR] = C_CYAN; // Cyan for axes
162+
colors[TEXT_COLOR] = C_WHITE; // White for text
163+
colors[TITLE_COLOR] = C_YELLOW; // Yellow for title
164+
colors[MAX_ERROR_COLOR] = C_RED; // Red for max error
165+
colors[MIN_ERROR_COLOR] = C_GREEN; // Green for min error
166166
} else if (strcmp(scheme_name, "dark2") == 0) {
167167
// Purple-yellow-green scheme for dark terminals
168-
colors[LINE_COLOR] = C_MAGENTA; // Magenta for plot line
169-
colors[AXES_COLOR] = C_YELLOW; // Yellow for axes
170-
colors[TEXT_COLOR] = C_CYAN; // Cyan for text
171-
colors[TITLE_COLOR] = C_GREEN; // Green for title
172-
colors[MAX_ERROR_COLOR] = C_RED; // Red for max error
173-
colors[MIN_ERROR_COLOR] = C_BLUE; // Blue for min error
168+
colors[LINE_COLOR] = C_MAGENTA; // Magenta for plot line
169+
colors[AXES_COLOR] = C_YELLOW; // Yellow for axes
170+
colors[TEXT_COLOR] = C_CYAN; // Cyan for text
171+
colors[TITLE_COLOR] = C_GREEN; // Green for title
172+
colors[MAX_ERROR_COLOR] = C_RED; // Red for max error
173+
colors[MIN_ERROR_COLOR] = C_BLUE; // Blue for min error
174174
} else if (strcmp(scheme_name, "light1") == 0) {
175175
// Green-blue-red scheme for light terminals
176-
colors[LINE_COLOR] = C_GREEN; // Green for plot line
177-
colors[AXES_COLOR] = C_BLUE; // Blue for axes
178-
colors[TEXT_COLOR] = C_BLACK; // Black for text
179-
colors[TITLE_COLOR] = C_RED; // Red for title
180-
colors[MAX_ERROR_COLOR] = C_RED; // Red for max error
181-
colors[MIN_ERROR_COLOR] = C_MAGENTA; // Magenta for min error
176+
colors[LINE_COLOR] = C_GREEN; // Green for plot line
177+
colors[AXES_COLOR] = C_BLUE; // Blue for axes
178+
colors[TEXT_COLOR] = C_BLACK; // Black for text
179+
colors[TITLE_COLOR] = C_RED; // Red for title
180+
colors[MAX_ERROR_COLOR] = C_RED; // Red for max error
181+
colors[MIN_ERROR_COLOR] = C_MAGENTA; // Magenta for min error
182182
} else if (strcmp(scheme_name, "light2") == 0) {
183183
// Blue-green-yellow scheme for light terminals
184-
colors[LINE_COLOR] = C_BLUE; // Blue for plot line
185-
colors[AXES_COLOR] = C_GREEN; // Green for axes
186-
colors[TEXT_COLOR] = C_BLACK; // Black for text
187-
colors[TITLE_COLOR] = C_YELLOW; // Yellow for title
188-
colors[MAX_ERROR_COLOR] = C_RED; // Red for max error
189-
colors[MIN_ERROR_COLOR] = C_MAGENTA; // Magenta for min error
184+
colors[LINE_COLOR] = C_BLUE; // Blue for plot line
185+
colors[AXES_COLOR] = C_GREEN; // Green for axes
186+
colors[TEXT_COLOR] = C_BLACK; // Black for text
187+
colors[TITLE_COLOR] = C_YELLOW; // Yellow for title
188+
colors[MAX_ERROR_COLOR] = C_RED; // Red for max error
189+
colors[MIN_ERROR_COLOR] = C_MAGENTA; // Magenta for min error
190190
}
191191
}
192192

@@ -321,16 +321,17 @@ static void draw_line(int x, int ph, int l1, int l2, cchar_t *c1, cchar_t *c2,
321321
mvvline_set(ph + 1 - l2, x, &c2r, l2);
322322
}
323323

324-
// Reset all color attributes (COLOR_PAIR indexes are LINE_COLOR+1 through MIN_ERROR_COLOR+1)
325-
const attr_t color_mask = COLOR_PAIR(LINE_COLOR + 1) |
324+
// Reset all color attributes (COLOR_PAIR indexes are LINE_COLOR+1 through
325+
// MIN_ERROR_COLOR+1)
326+
const attr_t color_mask = COLOR_PAIR(LINE_COLOR + 1) |
326327
COLOR_PAIR(MAX_ERROR_COLOR + 1) |
327328
COLOR_PAIR(MIN_ERROR_COLOR + 1);
328-
329+
329330
c1->attr &= ~color_mask;
330331
c2->attr &= ~color_mask;
331332
c1r.attr &= ~color_mask;
332333
c2r.attr &= ~color_mask;
333-
334+
334335
if (colors[LINE_COLOR] != -1) {
335336
space.attr &= ~COLOR_PAIR(LINE_COLOR + 1);
336337
}
@@ -803,10 +804,8 @@ int main(int argc, char *argv[]) {
803804
break;
804805
case 'C': {
805806
// Check if it's a predefined color scheme
806-
if (strcmp(optarg, "dark1") == 0 ||
807-
strcmp(optarg, "dark2") == 0 ||
808-
strcmp(optarg, "light1") == 0 ||
809-
strcmp(optarg, "light2") == 0) {
807+
if (strcmp(optarg, "dark1") == 0 || strcmp(optarg, "dark2") == 0 ||
808+
strcmp(optarg, "light1") == 0 || strcmp(optarg, "light2") == 0) {
810809
set_color_scheme(optarg);
811810
} else {
812811
// Process comma-separated color values

0 commit comments

Comments
 (0)