]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0633: Compilation warnings with `-Wunused-parameter` v9.1.0633
authorDominique Pellé <dominique.pelle@gmail.com>
Sun, 28 Jul 2024 19:12:20 +0000 (21:12 +0200)
committerChristian Brabandt <cb@256bit.org>
Sun, 28 Jul 2024 19:12:20 +0000 (21:12 +0200)
Problem:  Compilation warnings with `-Wunused-parameter`
Solution: Add the `UNUSED` macro where needed, and remove some
          superfluous ones (Dominique Pellé)

Change fixes these kind of warnings when building without the channel
feature:

```
eval.c:6122:15: warning: unused parameter ‘tv’ [-Wunused-parameter]
     typval_T *tv,
               ^
eval.c:6123:14: warning: unused parameter ‘tofree’ [-Wunused-parameter]
     char_u **tofree,
              ^
eval.c:6124:13: warning: unused parameter ‘numbuf’ [-Wunused-parameter]
     char_u *numbuf,
             ^
eval.c:6125:10: warning: unused parameter ‘composite_val’ [-Wunused-parameter]
     int  composite_val)
```

closes: #15378

Signed-off-by: Dominique Pellé <dominique.pelle@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
12 files changed:
src/eval.c
src/misc2.c
src/strings.c
src/terminal.c
src/textprop.c
src/typval.c
src/undo.c
src/version.c
src/vim9class.c
src/vim9cmds.c
src/viminfo.c
src/window.c

index a001bba6a079882a86987a340f6bdb5df030ef8d..4f5646377d77aa2acb752930eddb06e3b8555b73 100644 (file)
@@ -6119,10 +6119,10 @@ dict_tv2string(
  */
     static char_u *
 jobchan_tv2string(
-    typval_T   *tv,
-    char_u     **tofree,
-    char_u     *numbuf,
-    int                composite_val)
+    typval_T   *tv UNUSED,
+    char_u     **tofree UNUSED,
+    char_u     *numbuf UNUSED,
+    int                composite_val UNUSED)
 {
     char_u     *r = NULL;
 
index c07ed8065ca9b55523c71e243d70e54be7a7ddc9..b5044fb366ea6d958cc3ff3aac2d48720a3e168a 100644 (file)
@@ -72,7 +72,7 @@ coladvance_force(colnr_T wcol)
  * Get the screen position of character col with a coladd in the cursor line.
  */
     int
-getviscol2(colnr_T col, colnr_T coladd UNUSED)
+getviscol2(colnr_T col, colnr_T coladd)
 {
     colnr_T    x;
     pos_T      pos;
index 6b2ff0a011842f0a237f9b496aed044e9da6c344..20ca65d429fcd18c9d57ec9c6607888be78ec8ed 100644 (file)
@@ -1037,7 +1037,7 @@ string_reduce(
  * Implementation of "byteidx()" and "byteidxcomp()" functions
  */
     static void
-byteidx_common(typval_T *argvars, typval_T *rettv, int comp UNUSED)
+byteidx_common(typval_T *argvars, typval_T *rettv, int comp)
 {
     rettv->vval.v_number = -1;
 
index 648fc7872897641318801fbfb66dd5d8eede358f..c681f3a432c35a1df86f787dcf1fc30292e12b7c 100644 (file)
@@ -6299,7 +6299,7 @@ f_term_getsize(typval_T *argvars, typval_T *rettv)
  * "term_setsize(buf, rows, cols)" function
  */
     void
-f_term_setsize(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
+f_term_setsize(typval_T *argvars, typval_T *rettv UNUSED)
 {
     buf_T      *buf;
     term_T     *term;
index 83c42a371c1bf388d5b3ef704d7de385218fe7a9..fe0c8d20cbd4604c88091844bfa679d2ef1a6379 100644 (file)
@@ -2060,7 +2060,7 @@ list_types(hashtab_T *ht, list_T *l)
  * prop_type_list([{bufnr}])
  */
     void
-f_prop_type_list(typval_T *argvars, typval_T *rettv UNUSED)
+f_prop_type_list(typval_T *argvars, typval_T *rettv)
 {
     buf_T *buf = NULL;
 
index e50e96af0fd5396d17bc98d2cc534989529adb28..01ffef5e5d896b407117424fc2f98d27b0b7f432 100644 (file)
@@ -2214,7 +2214,7 @@ eval_number(
        char_u      **arg,
        typval_T    *rettv,
        int         evaluate,
-       int         want_string UNUSED)
+       int         want_string)
 {
     int                len;
     int                skip_quotes = !in_old_script(4);
index 1cd8912823a0d1efad42797e712507534a76e3cd..8c2783acd5145ae9387416fe24bdb8c27f407ac4 100644 (file)
@@ -3683,7 +3683,7 @@ u_eval_tree(buf_T *buf, u_header_T *first_uhp, list_T *list)
  * "undofile(name)" function
  */
     void
-f_undofile(typval_T *argvars UNUSED, typval_T *rettv)
+f_undofile(typval_T *argvars, typval_T *rettv)
 {
     if (in_vim9script() && check_for_string_arg(argvars, 0) == FAIL)
        return;
@@ -3738,7 +3738,7 @@ u_undofile_reset_and_delete(buf_T *buf)
  * "undotree(expr)" function
  */
     void
-f_undotree(typval_T *argvars UNUSED, typval_T *rettv)
+f_undotree(typval_T *argvars, typval_T *rettv)
 {
     if (in_vim9script() && check_for_opt_buffer_arg(argvars, 0) == FAIL)
        return;
index 398b4821ad0ae266076f8ab27d99c071bdcf5347..373cd8cb5c67e0d8df98affecea7a609bbe3d42a 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    633,
 /**/
     632,
 /**/
index 70f2405f01b97e54a91175e6cb82387b1c33166c..d8813c6f20f78529e202fb7ec25b9d34601ebaa4 100644 (file)
@@ -2665,7 +2665,7 @@ typealias_unref(typealias_T *ta)
  * Handle ":type".  Create an alias for a type specification.
  */
     void
-ex_type(exarg_T *eap UNUSED)
+ex_type(exarg_T *eap)
 {
     char_u     *arg = eap->arg;
 
index 694bb3349f57d5ef229aa2c13d8bb37d2f5295df..c7fa60aa4f29de01d0eee8c5ce76d82540277d5d 100644 (file)
@@ -1639,7 +1639,7 @@ compile_try(char_u *arg, cctx_T *cctx)
  * Compile "catch {expr}".
  */
     char_u *
-compile_catch(char_u *arg, cctx_T *cctx UNUSED)
+compile_catch(char_u *arg, cctx_T *cctx)
 {
     scope_T    *scope = cctx->ctx_scope;
     garray_T   *instr = &cctx->ctx_instr;
@@ -1923,7 +1923,7 @@ compile_endtry(char_u *arg, cctx_T *cctx)
  * compile "throw {expr}"
  */
     char_u *
-compile_throw(char_u *arg, cctx_T *cctx UNUSED)
+compile_throw(char_u *arg, cctx_T *cctx)
 {
     char_u *p = skipwhite(arg);
 
index 540422c8ca57e32fe874d20ba551eeaea004f7bf..11a2946816935487ae47aa0a8630b91bc34fa6e0 100644 (file)
@@ -251,7 +251,7 @@ barline_writestring(FILE *fd, char_u *s, int remaining_start)
 viminfo_readstring(
     vir_T      *virp,
     int                off,                // offset for virp->vir_line
-    int                convert UNUSED)     // convert the string
+    int                convert)            // convert the string
 {
     char_u     *retval = NULL;
     char_u     *s, *d;
index db0bb1b628c099c9363e4be865d0936928ada4a4..7ca29d46a587667062d9451ad915fa2764d37264 100644 (file)
@@ -1708,7 +1708,7 @@ win_count(void)
     int
 make_windows(
     int                count,
-    int                vertical UNUSED)  // split windows vertically if TRUE
+    int                vertical)  // split windows vertically if TRUE
 {
     int                maxcount;
     int                todo;
@@ -3486,7 +3486,7 @@ win_free_all(void)
     win_T *
 winframe_remove(
     win_T      *win,
-    int                *dirp UNUSED,   // set to 'v' or 'h' for direction if 'ea'
+    int                *dirp,          // set to 'v' or 'h' for direction if 'ea'
     tabpage_T  *tp,            // tab page "win" is in, NULL for current
     frame_T    **unflat_altfr) // if not NULL, set to pointer of frame that got
                                // the space, and it is not flattened
@@ -4855,8 +4855,8 @@ tabpage_index(tabpage_T *ftp)
  */
     static int
 leave_tabpage(
-    buf_T      *new_curbuf UNUSED,    // what is going to be the new curbuf,
-                                      // NULL if unknown
+    buf_T      *new_curbuf,            // what is going to be the new curbuf,
+                                       // NULL if unknown
     int                trigger_leave_autocmds)
 {
     tabpage_T  *tp = curtab;
@@ -4908,7 +4908,7 @@ leave_tabpage(
     static void
 enter_tabpage(
     tabpage_T  *tp,
-    buf_T      *old_curbuf UNUSED,
+    buf_T      *old_curbuf,
     int                trigger_enter_autocmds,
     int                trigger_leave_autocmds)
 {
@@ -7855,7 +7855,7 @@ get_win_number(win_T *wp, win_T *first_win)
 }
 
     int
-get_tab_number(tabpage_T *tp UNUSED)
+get_tab_number(tabpage_T *tp)
 {
     int                i = 1;
     tabpage_T  *t;