From 30f13de2c4538aa74d4053d27d784a2404158306 Mon Sep 17 00:00:00 2001 From: hellerve Date: Tue, 5 Sep 2017 18:18:00 +0200 Subject: [PATCH] #11: fix compilation issues --- src/editor.c | 8 ++++---- src/syntax.c | 4 ++-- src/syntax.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/editor.c b/src/editor.c index dc092e9..995b60f 100644 --- a/src/editor.c +++ b/src/editor.c @@ -21,14 +21,14 @@ void enable_raw_mode(e_context* ctx) { void e_die(const char* s) { - write(STDOUT_FILENO, "\x1b[2J\x1b[?47l\x1b""8", 12); + (void)write(STDOUT_FILENO, "\x1b[2J\x1b[?47l\x1b""8", 12); perror(s); exit(1); } void e_exit() { - write(STDOUT_FILENO, "\x1b[2J\x1b[?47l\x1b""8", 12); + (void)write(STDOUT_FILENO, "\x1b[2J\x1b[?47l\x1b""8", 12); exit(0); } @@ -211,7 +211,7 @@ void e_clear_screen(e_context* ctx) { ansi_append(&ab, buf, strlen(buf)); ansi_append(&ab, "?25h", 4); - write(STDOUT_FILENO, ab.b, ab.len); + (void)write(STDOUT_FILENO, ab.b, ab.len); ab_free(&ab); } @@ -1211,7 +1211,7 @@ e_context* e_setup() { e_context* ctx = malloc(sizeof(e_context)); if (tcgetattr(STDIN_FILENO, &ctx->orig) == -1) e_die("tcgetattr"); - write(STDOUT_FILENO, "\x1b""7\x1b[?47h", 8); + (void)write(STDOUT_FILENO, "\x1b""7\x1b[?47h", 8); e_get_win_size(ctx); enable_raw_mode(ctx); ctx->rx = 0; diff --git a/src/syntax.c b/src/syntax.c index 4abb347..6491f22 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -23,7 +23,7 @@ void syntax_read_extensions(syntax* c, FILE* f, char* line) { regcomp(reg, line, REG_EXTENDED); while (fpeek(f) == ' ' || fpeek(f) == '\t') { - fgets(line, MAX_LINE_WIDTH, f); + (void)fgets(line, MAX_LINE_WIDTH, f); ln = strlen(line)-1; line[ln] = '\0'; // replace newline reg = realloc(reg, sizeof(regex_t) * ++regl); @@ -52,7 +52,7 @@ void syntax_read_pattern(syntax* c, FILE* f, char* key, char* value) { if (err) exit(err); if (fpeek(f) == ' ' || fpeek(f) == '\t') { - fgets(line, MAX_LINE_WIDTH, f); + (void)fgets(line, MAX_LINE_WIDTH, f); char* l = strtriml(line); ln = strlen(l)-1; memmove(l+1, l, ln); diff --git a/src/syntax.h b/src/syntax.h index 7df4df2..96b173a 100644 --- a/src/syntax.h +++ b/src/syntax.h @@ -7,7 +7,7 @@ #include "colors.h" #include "util.h" -#define MAX_LINE_WIDTH 512 +#define MAX_LINE_WIDTH 1025 typedef struct pattern { regex_t pattern;