Loading ...
Sorry, an error occurred while loading the content.

small patch preventing a gcc warning

Expand Messages
  • Christian Brabandt
    Bram, the following patch fixes this gcc warning: buffer.c: In Funktion »set_curbuf«: buffer.c:1367:12: Warnung: Deklaration von »prevwin« überdeckt eine
    Message 1 of 2 , Jul 6, 2012
    • 0 Attachment
      Bram,
      the following patch fixes this gcc warning:

      buffer.c: In Funktion »set_curbuf«:
      buffer.c:1367:12: Warnung: Deklaration von »prevwin« überdeckt eine globale Deklaration [-Wshadow]
      globals.h:535:15: Warnung: verdeckte Deklaration ist hier [-Wshadow]

      It also moves the declaration of the win_T variable a little bit further
      down, since it is only needed in one single block.

      diff --git a/src/buffer.c b/src/buffer.c
      --- a/src/buffer.c
      +++ b/src/buffer.c
      @@ -1363,9 +1363,6 @@
      int action;
      {
      buf_T *prevbuf;
      -#ifdef FEAT_WINDOWS
      - win_T *prevwin;
      -#endif
      int unload = (action == DOBUF_UNLOAD || action == DOBUF_DEL
      || action == DOBUF_WIPE);

      @@ -1406,7 +1403,7 @@
      #endif
      {
      #ifdef FEAT_WINDOWS
      - prevwin = curwin;
      + win_T *previouswin = curwin;
      #endif
      if (prevbuf == curbuf)
      u_sync(FALSE);
      @@ -1415,9 +1412,9 @@
      && !P_HID(prevbuf)
      && !bufIsChanged(prevbuf)) ? DOBUF_UNLOAD : 0, FALSE);
      #ifdef FEAT_WINDOWS
      - if (curwin != prevwin && win_valid(prevwin))
      + if (curwin != previouswin && win_valid(previouswin))
      /* autocommands changed curwin, Grr! */
      - curwin = prevwin;
      + curwin = previouswin;
      #endif
      }
      }

      regards,
      Christian

      --
      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Bram Moolenaar
      ... Thanks, I ll include it. -- ... /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net /// sponsor Vim, vote for features --
      Message 2 of 2 , Jul 6, 2012
      • 0 Attachment
        Christian Brabandt wrote:

        > the following patch fixes this gcc warning:
        >
        > buffer.c: In Funktion »set_curbuf«:
        > buffer.c:1367:12: Warnung: Deklaration von »prevwin« überdeckt eine globale Deklaration [-Wshadow]
        > globals.h:535:15: Warnung: verdeckte Deklaration ist hier [-Wshadow]
        >
        > It also moves the declaration of the win_T variable a little bit further
        > down, since it is only needed in one single block.

        Thanks, I'll include it.


        --
        From "know your smileys":
        :-F Bucktoothed vampire with one tooth missing

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
        \\\ an exciting new programming language -- http://www.Zimbu.org ///
        \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

        --
        You received this message from the "vim_dev" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      Your message has been successfully submitted and would be delivered to recipients shortly.