Skip to content
This repository has been archived by the owner on Aug 15, 2019. It is now read-only.

Commit

Permalink
#11: fix compilation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
hellerve committed Sep 5, 2017
1 parent 42410f7 commit 30f13de
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/editor.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/syntax.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/syntax.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 30f13de

Please sign in to comment.