Skip to content

Commit

Permalink
Merge pull request #151 from edgar-bonet/no-gethw
Browse files Browse the repository at this point in the history
Remove function gethw()
  • Loading branch information
edgar-bonet authored Dec 13, 2023
2 parents 2c1d0ed + 40f442e commit 96f20fe
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions ttyplot.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,6 @@ static void getminmax(int pw, double *values, double *min, double *max, double *
*avg=tot/i;
}

static void gethw(void) {
#ifdef NOGETMAXYX
height=LINES;
width=COLS;
#else
getmaxyx(stdscr, height, width);
#endif
}

static void draw_axes(int h, int ph, int pw, double max, double min, char *unit) {
mvhline(h-3, 2, T_HLINE, pw);
mvvline(2, 2, T_VLINE, ph);
Expand Down Expand Up @@ -231,7 +222,7 @@ static void show_window_size_error(void) {

static void paint_plot(void) {
erase();
gethw();
getmaxyx(stdscr, height, width);

plotheight=height-4;
plotwidth=width-4;
Expand Down Expand Up @@ -621,7 +612,7 @@ int main(int argc, char *argv[]) {
curs_set(FALSE);
erase();
refresh();
gethw();
getmaxyx(stdscr, height, width);

redraw_screen(errstr);

Expand Down Expand Up @@ -669,7 +660,7 @@ int main(int argc, char *argv[]) {
initscr();
erase();
refresh();
gethw();
getmaxyx(stdscr, height, width);
redraw_needed = true;
}
}
Expand Down

0 comments on commit 96f20fe

Please sign in to comment.