This series introduce syntax-check rule for below:
1. For incorrect indentation of the first line in function body
int foo(int a0, ...)
{
[NOT 4 spaces]int first-line;
... ...
}
2. For empty first line of function body
int foo(int a0, ...)
{
[empty line]
int second-line;
... ...
}
And it *ignores* the conditions as below:
1. For macros just as #if/#ifdef
int foo(int a0, ...)
{
#if ANYTHING
int second-line;
... ...
}
2. For comments
int foo(int a0, ...)
{
/* comments */
int second-line;
... ...
}
3. For empty function body
int foo(void)
{
}
^ This function has NO content
4. For labels
{
readmore:
int second-line;
... ...
goto readmore;
... ...
}
Shi Lei (4):
cfg.mk: Introduce syntax-check rule for incorrect indentation or empty
line in function body
src: fix incorrect indentation or empty first line in function body
tests: fix incorrect indentation or empty first line in function body
tools: fix incorrect indentation or empty first line in function body
cfg.mk | 11 +++
src/bhyve/bhyve_command.c | 3 -
src/bhyve/bhyve_conf.c | 6 +-
src/bhyve/bhyve_driver.c | 33 ++++---
src/bhyve/bhyve_monitor.c | 1 -
src/bhyve/bhyve_process.c | 1 -
src/conf/cpu_conf.c | 1 -
src/conf/domain_capabilities.c | 1 -
src/conf/domain_conf.c | 12 +--
src/conf/network_conf.c | 2 -
src/cpu/cpu_s390.c | 82 ++++++++---------
src/cpu/cpu_x86.c | 1 -
src/esx/esx_vi_types.c | 2 +-
src/locking/lock_driver_nop.c | 1 -
src/network/bridge_driver.c | 1 -
src/network/bridge_driver_linux.c | 1 -
src/nwfilter/nwfilter_learnipaddr.c | 1 -
src/phyp/phyp_driver.c | 1 -
src/qemu/qemu_alias.c | 1 -
src/qemu/qemu_domain_address.c | 1 -
src/qemu/qemu_driver.c | 1 -
src/qemu/qemu_monitor.c | 1 -
src/qemu/qemu_monitor_json.c | 1 -
src/qemu/qemu_process.c | 1 -
src/storage/storage_backend_sheepdog.c | 3 -
src/storage/storage_driver.c | 1 -
src/storage/storage_util.c | 1 -
src/test/test_driver.c | 2 -
src/util/vircommand.c | 6 +-
src/util/virdbuspriv.h | 18 ++--
src/util/virdnsmasq.c | 1 -
src/util/virfile.c | 1 -
src/util/virnetdev.c | 55 ++++++------
src/util/virnetdevmacvlan.c | 11 ++-
src/util/virnetdevvportprofile.c | 2 +-
src/util/virstoragefile.c | 1 -
src/util/virutil.c | 3 +-
src/vbox/vbox_storage.c | 1 -
src/vz/vz_driver.c | 1 -
src/vz/vz_sdk.c | 1 -
src/xenapi/xenapi_driver.c | 2 -
src/xenconfig/xen_common.c | 9 +-
tests/qemuxml2argvmock.c | 2 +-
tests/sexpr2xmltest.c | 30 +++----
tests/virnetdevmock.c | 1 -
tests/virnettlshelpers.c | 18 ++--
tests/virshtest.c | 118 ++++++++++++-------------
tests/vshtabletest.c | 3 -
tests/xml2sexprtest.c | 24 ++---
tools/virsh-volume.c | 1 -
tools/virt-admin.c | 1 -
51 files changed, 218 insertions(+), 266 deletions(-)
--
2.17.1