nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nano-devel] Patch to solve compilation on NetBSD 3.0


From: Adam Wysocki via ArcaBit
Subject: [Nano-devel] Patch to solve compilation on NetBSD 3.0
Date: Tue, 25 Jul 2006 23:08:11 +0200 (CEST)

Hi there,

- nano 1.3.12
- NetBSD 3.0

nano.h:167: error: `UP' redeclared as different kind of symbol
/usr/include/termcap.h:69: error: previous declaration of `UP'

Following patch fixes this.

diff -urN nano-1.3.12/src/move.c nano-1.3.12-new/src/move.c
--- nano-1.3.12/src/move.c      2006-05-22 04:08:49.000000000 +0200
+++ nano-1.3.12-new/src/move.c  2006-07-26 01:06:33.000000000 +0200
@@ -85,7 +85,7 @@
        openfile->placewewant);
 
     /* Scroll the edit window up a page. */
-    edit_scroll(UP, editwinrows - 2);
+    edit_scroll(SCROLL_UP, 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(SCROLL_DOWN, 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(SCROLL_UP,
 #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(SCROLL_UP, 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(SCROLL_DOWN,
 #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(SCROLL_DOWN, 1);
 }
 #endif /* !NANO_TINY */
 
diff -urN nano-1.3.12/src/nano.h nano-1.3.12-new/src/nano.h
--- nano-1.3.12/src/nano.h      2006-06-09 18:57:41.000000000 +0200
+++ nano-1.3.12-new/src/nano.h  2006-07-26 01:06:33.000000000 +0200
@@ -164,7 +164,7 @@
 } append_type;
 
 typedef enum {
-    UP, DOWN
+    SCROLL_UP, SCROLL_DOWN
 } scroll_dir;
 
 typedef enum {
diff -urN nano-1.3.12/src/winio.c nano-1.3.12-new/src/winio.c
--- nano-1.3.12/src/winio.c     2006-06-21 22:51:36.000000000 +0200
+++ nano-1.3.12-new/src/winio.c 2006-07-26 01:06:33.000000000 +0200
@@ -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 == SCROLL_UP) {
            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 == SCROLL_UP) ? -nlines : nlines);
     scrollok(edit, FALSE);
 
     /* Part 2: nlines is the number of lines in the scrolled region of
@@ -2746,8 +2746,8 @@
 
     /* 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 -
+    if ((direction == SCROLL_UP && openfile->edittop == openfile->fileage) ||
+       (direction == SCROLL_DOWN && openfile->edittop->lineno + editwinrows -
        1 >= openfile->filebot->lineno))
        nlines = editwinrows;
 
@@ -2767,7 +2767,7 @@
 
     /* If we scrolled down, move down to the line before the scrolled
      * region. */
-    if (direction == DOWN) {
+    if (direction == SCROLL_DOWN) {
        for (i = editwinrows - nlines; i > 0 && foo != NULL; i--)
            foo = foo->next;
     }
@@ -2778,7 +2778,7 @@
      * 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 &&
+       if ((i == nlines && direction == SCROLL_DOWN) || (i == 1 &&
                direction == UP)) {
            if (do_redraw)
                update_line(foo, (foo == openfile->current) ?
@@ -2855,9 +2855,9 @@
        /* Scroll the edit window up or down until edittop is in range
         * of current. */
        if (nlines < 0)
-           edit_scroll(UP, -nlines);
+           edit_scroll(SCROLL_UP, -nlines);
        else
-           edit_scroll(DOWN, nlines);
+           edit_scroll(SCROLL_DOWN, nlines);
 
 #ifndef NANO_TINY
        /* If the mark is on, update all the lines between the old first

-- 
[ Adam Wysocki :: www.chmurka.net :: +48 514 710 213 ]
[ Software Development Department, ArcaBit Sp. z o.o ]
[ Ul. Fortuny 9 :: 01-339 Warszawa :: www.arcabit.pl ]




reply via email to

[Prev in Thread] Current Thread [Next in Thread]