To: [email protected]
Subject: Patch 5.6a.014
Fcc: outbox
From: Bram Moolenaar <[email protected]>
------------

Patch 5.6a.014
Problem:    Various warning messages when compiling and running lint with
           different combinations of features.
Solution:   Fix the warning messages.
Files:      src/eval.c, src/ex_cmds.c, src/ex_docmd.c, src/gui_gtk_x11.c,
           src/option.c, src/screen.c, src/search.c, src/syntax.c,
           src/feature.h, src/globals.h


*** ../vim-5.6a.13/src/eval.c   Wed Dec 22 10:39:40 1999
--- src/eval.c  Mon Dec 27 16:46:09 1999
***************
*** 238,243 ****
--- 238,244 ----
 static void call_func __ARGS((struct ufunc *fp, int argcount, VAR argvars, VAR retvar, linenr_t firstline, linenr_t lastline));


+ #if defined(STATUSLINE) || defined(PROTO)
 /*
  * Set an internal variable to a string value. Creates the variable if it does
  * not already exist.
***************
*** 261,266 ****
--- 262,268 ----
       }
     }
 }
+ #endif

 /*
  * Top level evaluation function, returning a boolean.
***************
*** 2388,2393 ****
--- 2390,2396 ----
 /*
  * "byte2line(byte)" function
  */
+ /*ARGSUSED*/
     static void
 f_byte2line(argvars, retvar)
     VAR               argvars;
***************
*** 2439,2444 ****
--- 2442,2448 ----
 /*
  * "confirm(message, buttons[, default [, type]])" function
  */
+ /*ARGSUSED*/
     static void
 f_confirm(argvars, retvar)
     VAR               argvars;
***************
*** 3375,3380 ****
--- 3379,3385 ----
 /*
  * "line2byte(lnum)" function
  */
+ /*ARGSUSED*/
     static void
 f_line2byte(argvars, retvar)
     VAR               argvars;
***************
*** 3705,3710 ****
--- 3710,3716 ----
 /*
  * "synID(line, col, trans)" function
  */
+ /*ARGSUSED*/
     static void
 f_synID(argvars, retvar)
     VAR               argvars;
***************
*** 3731,3736 ****
--- 3737,3743 ----
 /*
  * "synIDattr(id, what [, mode])" function
  */
+ /*ARGSUSED*/
     static void
 f_synIDattr(argvars, retvar)
     VAR               argvars;
***************
*** 3818,3823 ****
--- 3825,3831 ----
 /*
  * "synIDtrans(id)" function
  */
+ /*ARGSUSED*/
     static void
 f_synIDtrans(argvars, retvar)
     VAR               argvars;
***************
*** 4502,4508 ****
       p = (char_u *)"";
     else
       p = vimvars[i].val;
!     list_one_var_a((char_u *)"v:", vimvars[i].name, vimvars[i].type, p);
 }

     static void
--- 4510,4517 ----
       p = (char_u *)"";
     else
       p = vimvars[i].val;
!     list_one_var_a((char_u *)"v:", (char_u *)vimvars[i].name,
!                                                         vimvars[i].type, p);
 }

     static void
***************
*** 5362,5367 ****
--- 5371,5404 ----
     return ((struct funccall *)cookie)->func->flags & FC_ABORT;
 }

+ #if defined(VIMINFO) || defined(MKSESSION)
+ typedef enum
+ {
+     VAR_FLAVOUR_DEFAULT,
+     VAR_FLAVOUR_SESSION,
+     VAR_FLAVOUR_VIMINFO
+ } VAR_FLAVOUR;
+
+ static VAR_FLAVOUR var_flavour __ARGS((char_u *varname));
+
+     static VAR_FLAVOUR
+ var_flavour(varname)
+     char_u *varname;
+ {
+     char_u *p = varname;
+
+     if (isupper(*p))
+     {
+       while (*(++p))
+           if (islower(*p))
+               return VAR_FLAVOUR_SESSION;
+       return VAR_FLAVOUR_VIMINFO;
+     }
+     else
+       return VAR_FLAVOUR_DEFAULT;
+ }
+ #endif
+
 #ifdef VIMINFO
 /*
  * Restore global vars that start with a capital from the viminfo file
***************
*** 5416,5447 ****
     }

     return vim_fgets(line, LSIZE, fp);
- }
-
- typedef enum
- {
-     VAR_FLAVOUR_DEFAULT,
-     VAR_FLAVOUR_SESSION,
-     VAR_FLAVOUR_VIMINFO
- } VAR_FLAVOUR;
-
- static VAR_FLAVOUR var_flavour __ARGS((char_u *varname));
-
-     static VAR_FLAVOUR
- var_flavour(varname)
-     char_u *varname;
- {
-     char_u *p = varname;
-
-     if (isupper(*p))
-     {
-       while (*(++p))
-           if (islower(*p))
-               return VAR_FLAVOUR_SESSION;
-       return VAR_FLAVOUR_VIMINFO;
-     }
-     else
-       return VAR_FLAVOUR_DEFAULT;
 }

 /*
--- 5453,5458 ----
*** ../vim-5.6a.13/src/ex_cmds.c        Mon Dec 20 09:59:10 1999
--- src/ex_cmds.c       Fri Dec 24 12:15:29 1999
***************
*** 31,41 ****
 static void delbuf_msg __ARGS((char_u *name));
 #endif
 static int do_sub_msg __ARGS((void));
 static int
! #ifdef __BORLANDC__
! _RTLENTRYF
 #endif
- help_compare __ARGS((const void *s1, const void *s2));

     void
 do_ascii()
--- 31,43 ----
 static void delbuf_msg __ARGS((char_u *name));
 #endif
 static int do_sub_msg __ARGS((void));
+ #ifdef HAVE_QSORT
 static int
! # ifdef __BORLANDC__
!     _RTLENTRYF
! # endif
!       help_compare __ARGS((const void *s1, const void *s2));
 #endif

     void
 do_ascii()
***************
*** 2277,2287 ****
 #ifdef AUTOCMD
     int               auto_buf = FALSE;       /* TRUE if autocommands brought us
                                          into the buffer unexpectedly */
 #endif
     BUF               *buf;
 #if defined(AUTOCMD) || defined(GUI_DIALOG) || defined(CON_DIALOG)
     BUF               *old_curbuf = curbuf;
-     char_u    *new_name = NULL;
 #endif
     char_u    *free_fname = NULL;
 #ifdef USE_BROWSE
--- 2279,2289 ----
 #ifdef AUTOCMD
     int               auto_buf = FALSE;       /* TRUE if autocommands brought us
                                          into the buffer unexpectedly */
+     char_u    *new_name = NULL;
 #endif
     BUF               *buf;
 #if defined(AUTOCMD) || defined(GUI_DIALOG) || defined(CON_DIALOG)
     BUF               *old_curbuf = curbuf;
 #endif
     char_u    *free_fname = NULL;
 #ifdef USE_BROWSE
***************
*** 3938,3943 ****
--- 3940,3946 ----
     return (int)(100 * num_letters + STRLEN(matched_string) + offset);
 }

+ #ifdef HAVE_QSORT
 /*
  * Compare functions for qsort() below, that checks the help heuristics number
  * that has been put after the tagname by find_tags().
***************
*** 3957,3962 ****
--- 3960,3966 ----
     p2 = *(char **)s2 + strlen(*(char **)s2) + 1;
     return strcmp(p1, p2);
 }
+ #endif

 /*
  * Find all help tags matching "arg", sort them and return in matches[], with
*** ../vim-5.6a.13/src/ex_docmd.c       Mon Dec 27 14:43:22 1999
--- src/ex_docmd.c      Mon Dec 27 13:56:40 1999
***************
*** 2509,2515 ****
     int                       i = 0;
     CMDIDX            cmdidx;
     long              argt = 0;
! #ifdef USER_COMMANDS
     int                       compl = EXPAND_NOTHING;
 #endif
     char_u            delim;
--- 2509,2515 ----
     int                       i = 0;
     CMDIDX            cmdidx;
     long              argt = 0;
! #if defined(USER_COMMANDS) && defined(CMDLINE_COMPL)
     int                       compl = EXPAND_NOTHING;
 #endif
     char_u            delim;
***************
*** 2672,2678 ****
--- 2672,2680 ----

                       cmdidx = CMD_USER;
                       argt = c->uc_argt;
+ #ifdef CMDLINE_COMPL
                       compl = c->uc_compl;
+ #endif

                       matchlen = k;

***************
*** 2866,2872 ****
           expand_context = EXPAND_HELP;
           expand_pattern = arg;
           break;
! #ifdef USER_COMMANDS
       case CMD_command:
           /* Check for attributes */
           while (*arg == '-')
--- 2868,2885 ----
           expand_context = EXPAND_HELP;
           expand_pattern = arg;
           break;
! #ifdef USE_BROWSE
!       case CMD_browse:
! #endif
!       case CMD_confirm:
!           return arg;
!
! #ifdef CMDLINE_COMPL
! /*
!  * All completion for the +cmdline_compl feature goes here.
!  */
!
! # ifdef USER_COMMANDS
       case CMD_command:
           /* Check for attributes */
           while (*arg == '-')
***************
*** 2921,2935 ****
           expand_context = EXPAND_USER_COMMANDS;
           expand_pattern = arg;
           break;
! #endif

- #ifdef USE_BROWSE
-       case CMD_browse:
- #endif
-       case CMD_confirm:
-           return arg;
-
- #ifdef CMDLINE_COMPL
       case CMD_global:
       case CMD_vglobal:
           delim = *arg;           /* get the delimiter */
--- 2934,2941 ----
           expand_context = EXPAND_USER_COMMANDS;
           expand_pattern = arg;
           break;
! # endif

       case CMD_global:
       case CMD_vglobal:
           delim = *arg;           /* get the delimiter */
*** ../vim-5.6a.13/src/gui_gtk_x11.c    Mon Dec 20 09:59:10 1999
--- src/gui_gtk_x11.c   Thu Dec 23 12:07:31 1999
***************
*** 774,779 ****
--- 774,780 ----
 /*
  * Setup the window icon after the main window has bee realized.
  */
+ /*ARGSUSED*/
 static void
 mainwin_realize(GtkWidget *widget)
 {
***************
*** 1119,1124 ****
--- 1120,1126 ----
     return TRUE;
 }

+ /*ARGSUSED*/
 static gint
 client_event_cb(GtkWidget *widget, GdkEventClient *event)
 {
***************
*** 2890,2895 ****
--- 2892,2898 ----
       gtk_main_quit();
 }

+ /*ARGSUSED*/
 static void
 font_sel_cancel(GtkWidget *wgt, gpointer cbdata)
 {
*** ../vim-5.6a.13/src/option.c Tue Dec 21 16:19:46 1999
--- src/option.c        Mon Dec 27 12:58:12 1999
***************
*** 3428,3434 ****
     else if (varp == &p_titlestring
                || varp == &p_iconstring)
     {
! #ifdef STATUSLINE
       int     flagval = (varp == &p_titlestring) ? STL_IN_TITLE : STL_IN_ICON;

       /* NULL => statusline syntax */
--- 3428,3434 ----
     else if (varp == &p_titlestring
                || varp == &p_iconstring)
     {
! # ifdef STATUSLINE
       int     flagval = (varp == &p_titlestring) ? STL_IN_TITLE : STL_IN_ICON;

       /* NULL => statusline syntax */
***************
*** 3436,3442 ****
           stl_syntax |= flagval;
       else
           stl_syntax &= ~flagval;
! #endif
       did_set_title(varp == &p_iconstring);

     }
--- 3436,3442 ----
           stl_syntax |= flagval;
       else
           stl_syntax &= ~flagval;
! # endif
       did_set_title(varp == &p_iconstring);

     }
*** ../vim-5.6a.13/src/screen.c Thu Dec 23 11:13:43 1999
--- src/screen.c        Mon Dec 27 12:57:25 1999
***************
*** 2538,2543 ****
--- 2538,2544 ----
     screen_puts(p, row, col, curattr);
 }

+ # if defined(WANT_TITLE) || defined(PROTO)
     int
 build_stl_str(wp, out, fmt, fillchar, maxlen)
     WIN               *wp;
***************
*** 2548,2553 ****
--- 2549,2555 ----
 {
     return build_stl_str_hl(wp, out, fmt, fillchar, maxlen, NULL);
 }
+ # endif

 /*
  * Build a string from the status line items in fmt, return length of string.
*** ../vim-5.6a.13/src/search.c Mon Dec 20 09:59:07 1999
--- src/search.c        Thu Dec 23 16:17:55 1999
***************
*** 3045,3055 ****
  * Find identifiers or defines in included files.
  * if p_ic && (continue_status & CONT_SOL) then ptr must be in lowercase.
  */
     void
 find_pattern_in_path(ptr, dir, len, whole, skip_comments,
                                   type, count, action, start_lnum, end_lnum)
     char_u    *ptr;           /* pointer to search pattern */
!     int               dir;            /* direction of expantion */
     int               len;            /* length of search pattern */
     int               whole;          /* match whole words only */
     int               skip_comments;  /* don't match inside comments */
--- 3045,3056 ----
  * Find identifiers or defines in included files.
  * if p_ic && (continue_status & CONT_SOL) then ptr must be in lowercase.
  */
+ /*ARGSUSED*/
     void
 find_pattern_in_path(ptr, dir, len, whole, skip_comments,
                                   type, count, action, start_lnum, end_lnum)
     char_u    *ptr;           /* pointer to search pattern */
!     int               dir;            /* direction of expansion */
     int               len;            /* length of search pattern */
     int               whole;          /* match whole words only */
     int               skip_comments;  /* don't match inside comments */
***************
*** 3723,3729 ****
--- 3724,3732 ----
     int               off_end = FALSE;
     long      off = 0;
     int               setlast = FALSE;
+ #ifdef EXTRA_SEARCH
     static int        hlsearch_on = FALSE;
+ #endif
     char_u    *val;

     /*
*** ../vim-5.6a.13/src/syntax.c Mon Dec 20 09:59:11 1999
--- src/syntax.c        Thu Dec 23 22:54:40 1999
***************
*** 197,204 ****
--- 197,206 ----
  * The attributes of the syntax item that has been recognized.
  */
 static int current_attr = 0;      /* attr of current syntax word */
+ #ifdef WANT_EVAL
 static int current_id = 0;        /* ID of current char for syn_get_id() */
 static int current_trans_id = 0;    /* idem, transparancy removed */
+ #endif

 struct syn_cluster
 {
***************
*** 1521,1528 ****
--- 1523,1532 ----
      * If not, use attributes from the current-but-one state, etc.
      */
     current_attr = 0;
+ #ifdef WANT_EVAL
     current_id = 0;
     current_trans_id = 0;
+ #endif
     if (cur_si != NULL)
     {
       for (idx = current_state.ga_len - 1; idx >= 0; --idx)
***************
*** 1532,1539 ****
--- 1536,1545 ----
                                     && (int)current_col <= sip->si_h_endcol)
           {
               current_attr = sip->si_attr;
+ #ifdef WANT_EVAL
               current_id = sip->si_id;
               current_trans_id = sip->si_trans_id;
+ #endif
               break;
           }
       }
*** ../vim-5.6a.13/src/feature.h        Mon Dec 20 09:59:09 1999
--- src/feature.h       Mon Dec 27 19:46:25 1999
***************
*** 275,280 ****
--- 275,283 ----
 # ifndef CMDLINE_INFO
 #  define CMDLINE_INFO        /* 'ruler' is required for 'statusline' */
 # endif
+ #endif
+
+ #ifndef MIN_FEAT
 # define BYTE_OFFSET
 #endif

*** ../vim-5.6a.13/src/globals.h        Mon Dec 20 09:59:07 1999
--- src/globals.h       Mon Dec 27 12:58:44 1999
***************
*** 651,660 ****
 /* table to store parsed 'wildmode' */
 EXTERN char_u wim_flags[4];

! #ifdef STATUSLINE
 /* whether titlestring and iconstring contains statusline syntax */
! #define STL_IN_ICON   1
! #define STL_IN_TITLE  2
 EXTERN int      stl_syntax INIT(= 0);
 #endif

--- 651,660 ----
 /* table to store parsed 'wildmode' */
 EXTERN char_u wim_flags[4];

! #if defined(WANT_TITLE) && defined(STATUSLINE)
 /* whether titlestring and iconstring contains statusline syntax */
! # define STL_IN_ICON  1
! # define STL_IN_TITLE 2
 EXTERN int      stl_syntax INIT(= 0);
 #endif

*** ../vim-5.6a.13/src/version.c        Wed Dec 29 11:19:28 1999
--- src/version.c       Wed Dec 29 12:00:43 1999
***************
*** 420,421 ****
--- 420,423 ----
 {   /* Add new patch number below this line */
+ /**/
+     14,
 /**/

--
Any resemblance between the above views and those of my employer, my terminal,
or the view out my window are purely coincidental.  Any resemblance between
the above and my own views is non-deterministic.  The question of the
existence of views in the absence of anyone to hold them is left as an
exercise for the reader.  The question of the existence of the reader is left
as an exercise for the second god coefficient.  (A discussion of
non-orthogonal, non-integral polytheism is beyond the scope of this article.)
                                               (Ralph Jennings)

--/-/---- Bram Moolenaar ---- [email protected] ---- [email protected] ---\-\--
 \ \    www.vim.org/iccf      www.moolenaar.net       www.vim.org    / /