annotate runtime/ftplugin/occam.vim @ 33404:9b35b4c6df4c v9.0.1960

patch 9.0.1960: Make CI checks more strict Commit: https://github.com/vim/vim/commit/f7f746b1672909ae57d2eec97253d6627f6c0887 Author: Yee Cheng Chin <ychin.git@gmail.com> Date: Sat Sep 30 12:28:50 2023 +0200 patch 9.0.1960: Make CI checks more strict Problem: Make CI checks more strict Solution: Add -Wstrict-prototypes -Wmissing-prototypes to CI, fix uncovered problems Add -Wstrict-prototypes -Wmissing-prototypes warnings check to CI Add two new warnings to CI, silence some Perl related build-warnings: - `strict-prototypes` helps prevent declaring a function with an empty argument list, e.g. `int func()`. In C++, that's equivalent to `int func(void)`, but in C, that means a function that can take any number of arguments which is rarely what we want. - `missing-prototypes` makes sure we use `static` for file-only internal functions. Non-static functions should have been declared on a prototype file. - Add `no-compound-token-split-by-macro` to the perl cflags, since it throws out a bunch of perl-related warnings that make the CI log unnecessary verbose and hard to read. This seems to happen only with clang 12 and above. When applying those changes, it already uncovered a few warnings, so fix up the code as well (fix prototypes, make the code static, remove shadowed var declaration) GTK header needs to have #pragma warning suppressiong because GTK2 headers will warn on `-Wstrict-prototypes`, and it's included by gui.h and so we can't just turn off the warning in a couple files. closes: #13223 closes: #13226 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
author Christian Brabandt <cb@256bit.org>
date Sat, 30 Sep 2023 12:45:05 +0200
parents dd6c2497c997
children 8ae680be2a51
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim filetype plugin file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: occam
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Copyright: Christian Jacobsen <clj3@kent.ac.uk>, Mario Schweigler <ms44@kent.ac.uk>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 " Maintainer: Mario Schweigler <ms44@kent.ac.uk>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 " Last Change: 23 April 2003
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 " Only do this when not done yet for this buffer
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 if exists("b:did_ftplugin")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 let b:did_ftplugin = 1
3526
dd6c2497c997 Fix more 'cpo' issues in runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
12 let s:keepcpo= &cpo
dd6c2497c997 Fix more 'cpo' issues in runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
13 set cpo&vim
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 "{{{ Indent settings
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 " Set shift width for indent
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 setlocal shiftwidth=2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 " Set the tab key size to two spaces
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 setlocal softtabstop=2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 " Let tab keys always be expanded to spaces
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 setlocal expandtab
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 "}}}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 "{{{ Formatting
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 " Break comment lines and insert comment leader in this case
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 setlocal formatoptions-=t formatoptions+=cql
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 setlocal comments+=:--
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 " Maximum length of comments is 78
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 setlocal textwidth=78
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 "}}}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 "{{{ File browsing filters
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 " Win32 can filter files in the browse dialog
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 if has("gui_win32") && !exists("b:browsefilter")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 let b:browsefilter = "All Occam Files (*.occ *.inc)\t*.occ;*.inc\n" .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 \ "Occam Include Files (*.inc)\t*.inc\n" .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 \ "Occam Source Files (*.occ)\t*.occ\n" .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 \ "All Files (*.*)\t*.*\n"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 "}}}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41
3410
94601b379f38 Updated runtime files. Add Dutch translations.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
42 "{{{ Undo settings
94601b379f38 Updated runtime files. Add Dutch translations.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
43 let b:undo_ftplugin = "setlocal shiftwidth< softtabstop< expandtab<"
94601b379f38 Updated runtime files. Add Dutch translations.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
44 \ . " formatoptions< comments< textwidth<"
94601b379f38 Updated runtime files. Add Dutch translations.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
45 \ . "| unlet! b:browsefiler"
94601b379f38 Updated runtime files. Add Dutch translations.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
46 "}}}
3526
dd6c2497c997 Fix more 'cpo' issues in runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
47
dd6c2497c997 Fix more 'cpo' issues in runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
48 let &cpo = s:keepcpo
dd6c2497c997 Fix more 'cpo' issues in runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
49 unlet s:keepcpo