To: vim-dev@vim.org Subject: Patch 6.2.263 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.2.263 Problem: Lint warnings: Duplicate function prototypes, duplicate macros, use of a zero character instead of a zero pointer, unused variable. Clearing allocated memory in a complicated way. Solution: Remove the function prototypes from farsi.h. Remove the duplicated lines in keymap.h. Change getvcol() argument from NUL to NULL. Remove the "col" variable in regmatch(). Use lalloc_clear() instead of lalloc(). (Walter Briscoe) Files: src/farsi.h, src/keymap.h, src/ops.c, src/regexp.c, src/search.c *** ../vim-6.2.262/src/farsi.h Sat Apr 14 22:20:29 2001 --- src/farsi.h Wed Feb 11 15:12:51 2004 *************** *** 184,206 **** #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[] --- 184,189 ---- *** ../vim-6.2.262/src/keymap.h Sun May 4 22:43:37 2003 --- src/keymap.h Wed Feb 11 15:14:54 2004 *************** *** 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 ---- *** ../vim-6.2.262/src/ops.c Sun Jan 25 20:37:29 2004 --- src/ops.c Wed Feb 11 15:17:11 2004 *************** *** 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 *** ../vim-6.2.262/src/regexp.c Tue Feb 3 16:55:34 2004 --- src/regexp.c Wed Feb 11 15:20:02 2004 *************** *** 2800,2808 **** if (SETJMP(lc_jump_env) != 0) { mch_didjmp(); ! #ifdef SIGHASARG if (lc_signal != SIGINT) ! #endif EMSG(_("E361: Crash intercepted; regexp too complex?")); retval = 0L; goto theend; --- 2800,2808 ---- if (SETJMP(lc_jump_env) != 0) { mch_didjmp(); ! # ifdef SIGHASARG if (lc_signal != SIGINT) ! # endif EMSG(_("E361: Crash intercepted; regexp too complex?")); retval = 0L; goto theend; *************** *** 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)) *** ../vim-6.2.262/src/search.c Sun Jan 25 20:21:35 2004 --- src/search.c Wed Feb 11 15:22:04 2004 *************** *** 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; *** ../vim-6.2.262/src/version.c Sun Feb 15 13:47:16 2004 --- src/version.c Sun Feb 15 13:48:35 2004 *************** *** 639,640 **** --- 639,642 ---- { /* Add new patch number below this line */ + /**/ + 263, /**/ -- hundred-and-one symptoms of being an internet addict: 148. You find it easier to dial-up the National Weather Service Weather/your_town/now.html than to simply look out the window. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///