[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Nano-devel] Re: Fwd: Error compiling 1.3.12 on Tru64
From: |
David Lawrence Ramsey |
Subject: |
[Nano-devel] Re: Fwd: Error compiling 1.3.12 on Tru64 |
Date: |
Tue, 18 Jul 2006 10:35:22 -0400 |
User-agent: |
Thunderbird 1.5.0.4 (X11/20060516) |
Daniel Richard G. wrote:
> Hello,
>
> The list-bot doesn't like me :] AUTHORS says you're the development
> series maintainer, so the attached message seems like it should go to
> you.
Right.
<snip>
> Just a quick note: The nano.h header has this bit...
>
> typedef enum {
> UP, DOWN
> } scroll_dir;
>
> ...which loses on Tru64, because UP is already declared as a symbol:
>
> ---- BEGIN /usr/include/curses.h excerpt ----
> /*
> * Capabilities from termcap
> */
<snip info>
> #undef'ing UP doesn't fix the problem. "#define UP NANO_UP" right before
> the enum does, for what it's worth.
The cleanest way to deal with this is probably to rename the UP and DOWN
enums. The attached patch renames them to UP_DIR and DOWN_DIR. Does it
fix your compilation problems?
<snip>
> P.S.: Please Cc: any replies, as I am not subscribed to this list.
Done.
Only in nano-1.3.12-fixed/: ChangeLog~
diff -ur nano-1.3.12/src/move.c nano-1.3.12-fixed/src/move.c
--- nano-1.3.12/src/move.c 2006-05-21 22:08:49.000000000 -0400
+++ nano-1.3.12-fixed/src/move.c 2006-07-18 10:24:14.000000000 -0400
@@ -85,7 +85,7 @@
openfile->placewewant);
/* Scroll the edit window up a page. */
- edit_scroll(UP, editwinrows - 2);
+ edit_scroll(UP_DIR, editwinrows - 2);
}
/* Move down one page. */
@@ -121,7 +121,7 @@
openfile->placewewant);
/* Scroll the edit window down a page. */
- edit_scroll(DOWN, editwinrows - 2);
+ edit_scroll(DOWN_DIR, editwinrows - 2);
}
#ifndef DISABLE_JUSTIFY
@@ -489,7 +489,7 @@
* window up one line if we're in smooth scrolling mode, or up half
* a page if we're not. */
if (openfile->current_y == 0)
- edit_scroll(UP,
+ edit_scroll(UP_DIR,
#ifndef NANO_TINY
ISSET(SMOOTH_SCROLL) ? 1 :
#endif
@@ -520,7 +520,7 @@
openfile->placewewant);
/* Scroll the edit window up one line. */
- edit_scroll(UP, 1);
+ edit_scroll(UP_DIR, 1);
}
#endif /* !NANO_TINY */
@@ -542,7 +542,7 @@
* window down one line if we're in smooth scrolling mode, or down
* half a page if we're not. */
if (openfile->current_y == editwinrows - 1)
- edit_scroll(DOWN,
+ edit_scroll(DOWN_DIR,
#ifndef NANO_TINY
ISSET(SMOOTH_SCROLL) ? 1 :
#endif
@@ -573,7 +573,7 @@
openfile->placewewant);
/* Scroll the edit window down one line. */
- edit_scroll(DOWN, 1);
+ edit_scroll(DOWN_DIR, 1);
}
#endif /* !NANO_TINY */
Only in nano-1.3.12-fixed/src: move.c.rej
diff -ur nano-1.3.12/src/nano.h nano-1.3.12-fixed/src/nano.h
--- nano-1.3.12/src/nano.h 2006-06-09 12:57:41.000000000 -0400
+++ nano-1.3.12-fixed/src/nano.h 2006-07-18 10:23:32.000000000 -0400
@@ -164,7 +164,7 @@
} append_type;
typedef enum {
- UP, DOWN
+ UP_DIR, DOWN_DIR
} scroll_dir;
typedef enum {
diff -ur nano-1.3.12/src/winio.c nano-1.3.12-fixed/src/winio.c
--- nano-1.3.12/src/winio.c 2006-06-21 16:51:36.000000000 -0400
+++ nano-1.3.12-fixed/src/winio.c 2006-07-18 10:23:32.000000000 -0400
@@ -2689,10 +2689,10 @@
/* Scroll the edit window in the given direction and the given number
* of lines, and draw new lines on the blank lines left after the
- * scrolling. direction is the direction to scroll, either UP or DOWN,
- * and nlines is the number of lines to scroll. We change edittop, and
- * assume that current and current_x are up to date. We also assume
- * that scrollok(edit) is FALSE. */
+ * scrolling. direction is the direction to scroll, either UP_DIR or
+ * DOWN_DIR, and nlines is the number of lines to scroll. We change
+ * edittop, and assume that current and current_x are up to date. We
+ * also assume that scrollok(edit) is FALSE. */
void edit_scroll(scroll_dir direction, ssize_t nlines)
{
bool do_redraw = need_vertical_update(0);
@@ -2710,7 +2710,7 @@
* value of direction) nlines lines, or as many lines as we can if
* there are fewer than nlines lines available. */
for (i = nlines; i > 0; i--) {
- if (direction == UP) {
+ if (direction == UP_DIR) {
if (openfile->edittop == openfile->fileage)
break;
openfile->edittop = openfile->edittop->prev;
@@ -2738,7 +2738,7 @@
/* Scroll the text of the edit window up or down nlines lines,
* depending on the value of direction. */
scrollok(edit, TRUE);
- wscrl(edit, (direction == UP) ? -nlines : nlines);
+ wscrl(edit, (direction == UP_DIR) ? -nlines : nlines);
scrollok(edit, FALSE);
/* Part 2: nlines is the number of lines in the scrolled region of
@@ -2746,9 +2746,10 @@
/* If the top or bottom line of the file is now visible in the edit
* window, we need to draw the entire edit window. */
- if ((direction == UP && openfile->edittop == openfile->fileage) ||
- (direction == DOWN && openfile->edittop->lineno + editwinrows -
- 1 >= openfile->filebot->lineno))
+ if ((direction == UP_DIR && openfile->edittop ==
+ openfile->fileage) || (direction == DOWN_DIR &&
+ openfile->edittop->lineno + editwinrows - 1 >=
+ openfile->filebot->lineno))
nlines = editwinrows;
/* If the scrolled region contains only one line, and the line
@@ -2767,7 +2768,7 @@
/* If we scrolled down, move down to the line before the scrolled
* region. */
- if (direction == DOWN) {
+ if (direction == DOWN_DIR) {
for (i = editwinrows - nlines; i > 0 && foo != NULL; i--)
foo = foo->next;
}
@@ -2778,8 +2779,8 @@
* blank, so we don't need to draw it unless the mark is on or we're
* not on the first page. */
for (i = nlines; i > 0 && foo != NULL; i--) {
- if ((i == nlines && direction == DOWN) || (i == 1 &&
- direction == UP)) {
+ if ((i == nlines && direction == DOWN_DIR) || (i == 1 &&
+ direction == UP_DIR)) {
if (do_redraw)
update_line(foo, (foo == openfile->current) ?
openfile->current_x : 0);
@@ -2855,9 +2856,9 @@
/* Scroll the edit window up or down until edittop is in range
* of current. */
if (nlines < 0)
- edit_scroll(UP, -nlines);
+ edit_scroll(UP_DIR, -nlines);
else
- edit_scroll(DOWN, nlines);
+ edit_scroll(DOWN_DIR, nlines);
#ifndef NANO_TINY
/* If the mark is on, update all the lines between the old first
- [Nano-devel] Re: Fwd: Error compiling 1.3.12 on Tru64,
David Lawrence Ramsey <=