From 10ae1711470749d10c2aee32d3e79f7568e5dcf7 Mon Sep 17 00:00:00 2001 From: Thiago Farina Date: Mon, 15 Nov 2010 18:40:03 -0200 Subject: [PATCH] uemacs: Move NBLOCK constant into line.c This constant is only used in line.c. So just keep it there. Signed-off-by: Thiago Farina Signed-off-by: Linus Torvalds --- estruct.h | 1 - line.c | 8 +++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/estruct.h b/estruct.h index 21ed08e..6f84c15 100644 --- a/estruct.h +++ b/estruct.h @@ -236,7 +236,6 @@ #define NLOCKS 100 /* max # of file locks active */ #define NCOLORS 8 /* number of supported colors */ #define KBLOCK 250 /* sizeof kill buffer chunks */ -#define NBLOCK 16 /* line block chunk size */ #define CONTROL 0x0100 /* Control flag, or'ed in */ #define META 0x0200 /* Meta flag, or'ed in */ diff --git a/line.c b/line.c index f96b259..f1aa084 100644 --- a/line.c +++ b/line.c @@ -21,6 +21,8 @@ #include "edef.h" #include "efunc.h" +#define BLOCK_SIZE 16 /* Line block chunk size. */ + /* * This routine allocates a block of memory large enough to hold a struct line * containing "used" characters. The block is always rounded up a bit. Return @@ -32,9 +34,9 @@ struct line *lalloc(int used) struct line *lp; int size; - size = (used + NBLOCK - 1) & ~(NBLOCK - 1); - if (size == 0) /* Assume that an empty */ - size = NBLOCK; /* line is for type-in. */ + size = (used + BLOCK_SIZE - 1) & ~(BLOCK_SIZE - 1); + if (size == 0) /* Assume that is an empty. */ + size = BLOCK_SIZE; /* Line is for type-in. */ if ((lp = (struct line *)malloc(sizeof(struct line) + size)) == NULL) { mlwrite("(OUT OF MEMORY)"); return NULL;