Browse Source

Avoid unused variable warnings with getyx

June 3 weeks ago
parent
commit
cc30e13e9f
Signed by: Curtis McEnroe <june@causal.agency> GPG Key ID: CEA2F97ADCFCD77C
1 changed files with 5 additions and 3 deletions
  1. 5
    3
      ui.c

+ 5
- 3
ui.c View File

@@ -130,6 +130,8 @@ static int logHeight(void) {
130 130
 	return LINES - 2;
131 131
 }
132 132
 
133
+static int _;
134
+
133 135
 void uiDraw(void) {
134 136
 	if (ui.hide) return;
135 137
 	wnoutrefresh(ui.status);
@@ -139,7 +141,7 @@ void uiDraw(void) {
139 141
 		1, 0,
140 142
 		lastLine() - 1, lastCol()
141 143
 	);
142
-	int _, x;
144
+	int x;
143 145
 	getyx(ui.input, _, x);
144 146
 	pnoutrefresh(
145 147
 		ui.input,
@@ -201,7 +203,7 @@ static int addWrap(WINDOW *win, const wchar_t *str) {
201 203
 		size_t word = 1 + wcscspn(&format.str[1], L" ");
202 204
 		if (word < format.len) format.len = word;
203 205
 
204
-		int _, x, xMax;
206
+		int x, xMax;
205 207
 		getyx(win, _, x);
206 208
 		getmaxyx(win, _, xMax);
207 209
 		if (xMax - x - 1 < printWidth(format.str, word)) {
@@ -548,7 +550,7 @@ void uiPrompt(void) {
548 550
 	if (prompt) addWrap(ui.input, prompt);
549 551
 	free(prompt);
550 552
 
551
-	int _, x = 0;
553
+	int x = 0;
552 554
 	struct Format format = { .str = input };
553 555
 	formatReset(&format);
554 556
 	while (formatParse(&format, editTail())) {

Loading…
Cancel
Save