From 7622263b457be5cc46ebd1747dcc3faa46faa9bf Mon Sep 17 00:00:00 2001 From: Thiago Farina Date: Thu, 26 Aug 2010 13:20:25 -0300 Subject: [PATCH] uemacs: Make getgoal function private to basic.c. This functions is only used internally by basic.c, so marking it static, to make it private. Signed-off-by: Thiago Farina Signed-off-by: Linus Torvalds --- basic.c | 68 ++++++++++++++++++++++++++++----------------------------- efunc.h | 16 ++++++-------- 2 files changed, 41 insertions(+), 43 deletions(-) diff --git a/basic.c b/basic.c index e99bd12..8acce79 100644 --- a/basic.c +++ b/basic.c @@ -14,6 +14,36 @@ #include "edef.h" #include "efunc.h" +/* + * This routine, given a pointer to a struct line, and the current cursor goal + * column, return the best choice for the offset. The offset is returned. + * Used by "C-N" and "C-P". + */ +static int getgoal(struct line *dlp) +{ + int c; + int col; + int newcol; + int dbo; + + col = 0; + dbo = 0; + while (dbo != llength(dlp)) { + c = lgetc(dlp, dbo); + newcol = col; + if (c == '\t') + newcol |= tabmask; + else if (c < 0x20 || c == 0x7F) + ++newcol; + ++newcol; + if (newcol > curgoal) + break; + col = newcol; + ++dbo; + } + return dbo; +} + /* * Move the cursor to the beginning of the current line. */ @@ -315,36 +345,6 @@ int gotoeop(int f, int n) } #endif -/* - * This routine, given a pointer to a struct line, and the current cursor goal - * column, return the best choice for the offset. The offset is returned. - * Used by "C-N" and "C-P". - */ -int getgoal(struct line *dlp) -{ - int c; - int col; - int newcol; - int dbo; - - col = 0; - dbo = 0; - while (dbo != llength(dlp)) { - c = lgetc(dlp, dbo); - newcol = col; - if (c == '\t') - newcol |= tabmask; - else if (c < 0x20 || c == 0x7F) - ++newcol; - ++newcol; - if (newcol > curgoal) - break; - col = newcol; - ++dbo; - } - return (dbo); -} - /* * Scroll forward by a specified number of lines, or by a full page if no * argument. Bound to "C-V". The "2" in the arithmetic on the window size is @@ -368,7 +368,7 @@ int forwpage(int f, int n) if (n <= 0) /* Forget the overlap. */ n = 1; /* If tiny window. */ } else if (n < 0) - return (backpage(f, -n)); + return backpage(f, -n); #if CVMVAS else /* Convert from pages. */ n *= curwp->w_ntrows; /* To lines. */ @@ -410,10 +410,10 @@ int backpage(int f, int n) if (n <= 0) /* Don't blow up if the. */ n = 1; /* Window is tiny. */ } else if (n < 0) - return (forwpage(f, -n)); + return forwpage(f, -n); #if CVMVAS - else /* Convert from pages */ - n *= curwp->w_ntrows; /* to lines. */ + else /* Convert from pages. */ + n *= curwp->w_ntrows; /* To lines. */ #endif lp = curwp->w_linep; while (n-- && lback(lp) != curbp->b_linep) diff --git a/efunc.h b/efunc.h index 4453bb4..050f4a8 100644 --- a/efunc.h +++ b/efunc.h @@ -1,16 +1,15 @@ -/* EFUNC.H +/* efunc.h * - * Function declarations and names + * Function declarations and names. * - * This file list all the C code functions used - * and the names to use to bind keys to them. To add functions, - * declare it here in both the extern function list and the name - * binding table. + * This file list all the C code functions used and the names to use + * to bind keys to them. To add functions, declare it here in both the + * extern function list and the name binding table. * * modified by Petri Kutvonen */ -/* External function declarations */ +/* External function declarations. */ /* word.c */ extern int wrapword(int f, int n); @@ -78,14 +77,13 @@ extern int forwline(int f, int n); extern int backline(int f, int n); extern int gotobop(int f, int n); extern int gotoeop(int f, int n); -extern int getgoal(struct line *dlp); extern int forwpage(int f, int n); extern int backpage(int f, int n); extern int setmark(int f, int n); extern int swapmark(int f, int n); /* random.c */ -extern int tabsize; /* Tab size (0: use real tabs) */; +extern int tabsize; /* Tab size (0: use real tabs). */ extern int setfillcol(int f, int n); extern int showcpos(int f, int n); extern int getcline(void);