~smlavine/navipage

e43939dd843ea7deed52dce6c7019773e14314d8 — Sebastian LaVine a month ago ed7cfaa
Remove MAX() and MIN() macros

The MAX() macro was never used and the MIN() macro was only used once.
The place it was used already has an explanatory comment, which helps to
offset the ugliness of the ternary operator.
1 files changed, 1 insertions(+), 4 deletions(-)

M main.c
M main.c => main.c +1 -4
@@ 35,9 35,6 @@

#include "err.h"

#define MAX(A, B) ((A) > (B) ? (A) : (B))
#define MIN(A, B) ((A) < (B) ? (A) : (B))

/* TODO: move these defines to appropriate places when main.c is split. */
#define ST_SIZE_INCR 10
#define FILEL_SIZE_INCR 4


@@ 387,7 384,7 @@ display_buffer(const Buffer *const b)
	 * print the amount of lines in the file if that is less than
	 * `rows - 1`, to avoid a segfault.
	 */
	linestoprint = MIN(b->st_amt, rows - 1);
	linestoprint = (b->st_amt < rows - 1 ? b->st_amt : rows - 1);

	for (i = 0; i < linestoprint; i++) {
		int linelen;