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

Some ancient changes

Expand Messages
  • Walter Briscoe
    Vim has served me well without problem for the last six months. I had a problem a couple of days ago which suggests I should do some work on it. I have many
    Message 1 of 1 , Feb 9 8:28 AM
    • 0 Attachment
      Vim has served me well without problem for the last six months.
      I had a problem a couple of days ago which suggests I should do some
      work on it. I have many changes outstanding which I should have
      delivered some time ago. I propose a few of the simplest here so I can
      simplify my environment. None is earth-shattering or rocket science.
      I shall gradually submit others when time permits.

      1) Redundant declarations in farsi.h.
      The following were identified by PC-Lint. I filter the report and supply
      the patch.

      c:\lint\lint-nt +v -ic:\lint\ std.lnt c:\wfb\bin\c0-delta.lnt +os(_lint.tmp) -u -iproto -dWIN32 -d_DEBUG -e1776 -e961 -e960 version.c

      --- Module: version.c
      ...
      int fkmap __ARGS((int c));
      ^
      farsi.h(189) : Info 762: Redundantly declared symbol 'fkmap(int)' previously declared at line 12, file proto\main.pro
      ...

      *** src/0farsi.h Sat Apr 14 20:20:30 2001
      --- src/farsi.h Mon Mar 24 10:29:12 2003
      ***************
      *** 183,206 ****
      #define W_CONV 0x1
      #define W_R_L 0x2

      -
      - /* prototypes */
      -
      - int fkmap __ARGS((int c));
      - int toF_TyA __ARGS((int c));
      - int F_isalpha __ARGS((int c));
      - int F_isdigit __ARGS((int c));
      - int F_ischar __ARGS((int c));
      - int cmdl_fkmap __ARGS((int c));
      - void cmd_pchar __ARGS((int c, int offset));
      - int cmd_gchar __ARGS((int offset));
      - void conv_to_pvim __ARGS((void));
      - void conv_to_pstd __ARGS((void));
      - char_u *lrswap __ARGS((char_u *ibuf));
      - char_u *lrFswap __ARGS((char_u *cmdbuf, int len));
      - char_u *lrF_sub __ARGS((char_u *ibuf));
      - void farsi_fkey __ARGS((cmdarg_T *cap));
      -
      /* special Farsi text messages */

      EXTERN char_u farsi_text_1[]
      --- 183,188 ----

      2) keymap.h
      This has several redundant definitions.
      ...
      #define K_XF1 TERMCAP2KEY(KS_EXTRA, KE_XF1)
      ^
      keymap.h(274) : Info 760: Redundant macro 'K_XF1' defined identically at line 268
      ...
      *** src/0keymap.h Sun May 4 21:43:38 2003
      --- src/keymap.h Thu May 8 17:21:10 2003
      ***************
      *** 270,281 ****
      #define K_XF3 TERMCAP2KEY(KS_EXTRA, KE_XF3)
      #define K_XF4 TERMCAP2KEY(KS_EXTRA, KE_XF4)

      - /* extra set of function keys F1-F4, for vt100 compatible xterm */
      - #define K_XF1 TERMCAP2KEY(KS_EXTRA, KE_XF1)
      - #define K_XF2 TERMCAP2KEY(KS_EXTRA, KE_XF2)
      - #define K_XF3 TERMCAP2KEY(KS_EXTRA, KE_XF3)
      - #define K_XF4 TERMCAP2KEY(KS_EXTRA, KE_XF4)
      -
      #define K_F1 TERMCAP2KEY('k', '1') /* function keys */
      #define K_F2 TERMCAP2KEY('k', '2')
      #define K_F3 TERMCAP2KEY('k', '3')
      --- 270,275 ----
      ***************
      *** 437,443 ****
      #define K_RIGHTMOUSE TERMCAP2KEY(KS_EXTRA, KE_RIGHTMOUSE)
      #define K_RIGHTDRAG TERMCAP2KEY(KS_EXTRA, KE_RIGHTDRAG)
      #define K_RIGHTRELEASE TERMCAP2KEY(KS_EXTRA, KE_RIGHTRELEASE)
      - #define K_X1MOUSE TERMCAP2KEY(KS_EXTRA, KE_X1MOUSE)
      #define K_X1MOUSE TERMCAP2KEY(KS_EXTRA, KE_X1MOUSE)
      #define K_X1DRAG TERMCAP2KEY(KS_EXTRA, KE_X1DRAG)
      #define K_X1RELEASE TERMCAP2KEY(KS_EXTRA, KE_X1RELEASE)
      --- 431,436 ----

      3) ops.c
      There are a few uses of NUL where NULL is more plausible.
      *** src/ops.c.0 Fri May 23 10:15:36 2003
      --- src/ops.c Sun May 25 22:13:58 2003
      ***************
      *** 2696,2702 ****
      #ifdef FEAT_VIRTUALEDIT
      if (virtual_op)
      {
      ! getvcol(curwin, &oap->start, &cs, NUL, &ce);
      if (ce != cs && oap->start.coladd > 0)
      {
      /* Part of a tab selected -- but don't
      --- 2696,2702 ----
      #ifdef FEAT_VIRTUALEDIT
      if (virtual_op)
      {
      ! getvcol(curwin, &oap->start, &cs, NULL, &ce);
      if (ce != cs && oap->start.coladd > 0)
      {
      /* Part of a tab selected -- but don't
      ***************
      *** 2715,2721 ****
      #ifdef FEAT_VIRTUALEDIT
      if (virtual_op)
      {
      ! getvcol(curwin, &oap->end, &cs, NUL, &ce);
      if (p[endcol] == NUL || (cs + oap->end.coladd < ce
      # ifdef FEAT_MBYTE
      /* Don't add space for double-wide
      --- 2715,2721 ----
      #ifdef FEAT_VIRTUALEDIT
      if (virtual_op)
      {
      ! getvcol(curwin, &oap->end, &cs, NULL, &ce);
      if (p[endcol] == NUL || (cs + oap->end.coladd < ce
      # ifdef FEAT_MBYTE
      /* Don't add space for double-wide

      4) regexp.c
      The variable col is redundant.
      *** src/regexp.c.0 Sun May 18 15:43:00 2003
      --- src/regexp.c Mon May 19 11:10:10 2003
      ***************
      *** 4101,4107 ****
      regsave_T save_after, save_start;
      regsave_T save_behind_pos;
      int needmatch = (op == BEHIND);
      - long col;

      /*
      * Look back in the input of the operand matches or not. This
      --- 4101,4106 ----
      ***************
      *** 4124,4130 ****
      * will match it. */
      save_behind_pos = behind_pos;
      behind_pos = save_start;
      ! for (col = 0; ; ++col)
      {
      reg_restore(&save_start);
      if (regmatch(OPERAND(scan))
      --- 4123,4129 ----
      * will match it. */
      save_behind_pos = behind_pos;
      behind_pos = save_start;
      ! for (;;)
      {
      reg_restore(&save_start);
      if (regmatch(OPERAND(scan))

      5) search.c
      lalloc() and a clearing loop are used rather than lalloc_clear().
      *** src/search.c.0 Sun May 18 18:31:28 2003
      --- src/search.c Mon May 19 11:14:28 2003
      ***************
      *** 3655,3671 ****
      goto fpip_end;
      def_regmatch.rm_ic = FALSE; /* don't ignore case in define pat. */
      }
      ! files = (SearchedFile *)lalloc((long_u)
      (max_path_depth * sizeof(SearchedFile)), TRUE);
      if (files == NULL)
      goto fpip_end;
      - for (i = 0; i < max_path_depth; i++)
      - {
      - files[i].fp = NULL;
      - files[i].name = NULL;
      - files[i].lnum = 0;
      - files[i].matched = FALSE;
      - }
      old_files = max_path_depth;
      depth = depth_displayed = -1;

      --- 3655,3664 ----
      goto fpip_end;
      def_regmatch.rm_ic = FALSE; /* don't ignore case in define pat. */
      }
      ! files = (SearchedFile *)lalloc_clear((long_u)
      (max_path_depth * sizeof(SearchedFile)), TRUE);
      if (files == NULL)
      goto fpip_end;
      old_files = max_path_depth;
      depth = depth_displayed = -1;

      --
      Walter Briscoe
    Your message has been successfully submitted and would be delivered to recipients shortly.