From: Pierre Habouzit Date: Sat, 11 Nov 2006 14:19:58 +0000 (+0100) Subject: no more stupid warnings. X-Git-Url: http://git.madism.org/?a=commitdiff_plain;h=4c6f4529ecff234efdae624f210e350dc42bb259;p=apps%2Fmadtty.git no more stupid warnings. also set the char type to int rather than car, so that we can do utf-8 Signed-off-by: Pierre Habouzit --- diff --git a/madtty/inject.c b/madtty/inject.c index 14bde65..14ce8a1 100644 --- a/madtty/inject.c +++ b/madtty/inject.c @@ -568,13 +568,19 @@ static void interpret_csi_DECSTBM(RoteTerm *rt, int param[], int pcount) rt->pd->scrollbottom = newbottom; } -static void interpret_csi_SAVECUR(RoteTerm *rt, int param[], int pcount) +static void +interpret_csi_SAVECUR(RoteTerm *rt, + int param[] __attribute__((unused)), + int pcount __attribute__((unused))) { rt->pd->saved_x = rt->ccol; rt->pd->saved_y = rt->crow; } -static void interpret_csi_RESTORECUR(RoteTerm *rt, int param[], int pcount) +static void +interpret_csi_RESTORECUR(RoteTerm *rt, + int param[] __attribute__((unused)), + int pcount __attribute__((unused))) { rt->ccol = rt->pd->saved_x; rt->crow = rt->pd->saved_y; diff --git a/madtty/madtty.c b/madtty/madtty.c index 959204d..b124c8f 100644 --- a/madtty/madtty.c +++ b/madtty/madtty.c @@ -275,8 +275,10 @@ void *rote_vt_take_snapshot(RoteTerm *rt) void *ptr = buf; int i; - for (i = 0; i < rt->rows; i++, ptr += bytes_per_row) + for (i = 0; i < rt->rows; i++) { memcpy(ptr, rt->cells[i], bytes_per_row); + ptr = (char *)ptr + bytes_per_row; + } return buf; } @@ -287,9 +289,10 @@ void rote_vt_restore_snapshot(RoteTerm *rt, void *snapbuf) int i; - for (i = 0; i < rt->rows; i++, snapbuf += bytes_per_row) { + for (i = 0; i < rt->rows; i++) { rt->line_dirty[i] = true; memcpy(rt->cells[i], snapbuf, bytes_per_row); + snapbuf = (char *)snapbuf + bytes_per_row; } } diff --git a/madtty/madtty.h b/madtty/madtty.h index 2ad212e..63dc94b 100644 --- a/madtty/madtty.h +++ b/madtty/madtty.h @@ -85,7 +85,7 @@ /* Represents each of the text cells in the terminal screen */ typedef struct RoteCell_ { - unsigned char ch; /* >= 32, that is, control characters are not + unsigned int ch; /* >= 32, that is, control characters are not * allowed to be on the virtual screen */ unsigned char attr; /* a color attribute, as described previously */