aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Farina <tfransosi@gmail.com>2010-11-15 18:40:03 -0200
committerLinus Torvalds <torvalds@linux-foundation.org>2010-11-15 14:07:43 -0800
commit10ae1711470749d10c2aee32d3e79f7568e5dcf7 (patch)
treebaa385448acb31eb3702e0d93467c53bc3114118
parentaf19da1a99c37bc8b5e82f1d272673260f0a976f (diff)
downloaduemacs-10ae1711470749d10c2aee32d3e79f7568e5dcf7.tar.gz
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 <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--estruct.h1
-rw-r--r--line.c8
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;