]> git.ipfire.org Git - thirdparty/libvirt.git/commit
build: add syntax check for proper flags use
authorEric Blake <eblake@redhat.com>
Thu, 7 Jul 2011 17:57:43 +0000 (11:57 -0600)
committerEric Blake <eblake@redhat.com>
Fri, 15 Jul 2011 22:37:30 +0000 (16:37 -0600)
commit761bbb17c7b7b3bf4a89e9f932c4340986aba278
tree2487ea8f5213c69aba90c6a4c83aea3164689088
parent6a713b310a08a4f28d21bd59fa216a0f8a571536
build: add syntax check for proper flags use

Enforce the recent flags cleanups - we want to use 'unsigned int flags'
in any of our APIs (except where backwards compatibility is important,
in the public migration APIs), and that all flags are checked for
validity (except when there are stub functions that completely
ignore the flags argument).

There are a few minor tweaks done here to avoid false positives:
signed arguments passed to open() are renamed oflags, and flags
arguments that are legitimately ignored are renamed flags_unused.

* cfg.mk (sc_flags_usage): New rule.
(exclude_file_name_regexp--sc_flags_usage): And a few exemptions.
(sc_flags_debug): Tweak wording.
* src/util/iohelper.c (runIO, main): Rename variable.
* src/util/util.c (virSetInherit): Likewise.
* src/fdstream.h (virFDStreamOpenFile, virFDStreamCreateFile):
Likewise.
* src/fdstream.c (virFDStreamOpenFileInternal)
(virFDStreamOpenFile, virFDStreamCreateFile): Likewise.
* src/util/command.c (virExecWithHook) [WIN32]: Likewise.
* src/util/util.c (virFileOpenAs, virDirCreate) [WIN32]: Likewise.
* src/locking/lock_manager.c (virLockManagerPluginNew)
[!HAVE_DLFCN_H]: Likewise.
* src/locking/lock_driver_nop.c (virLockManagerNopNew)
(virLockManagerNopAddResource, virLockManagerNopAcquire)
(virLockManagerNopRelease, virLockManagerNopInquire): Likewise.
cfg.mk
src/fdstream.c
src/fdstream.h
src/locking/lock_driver_nop.c
src/locking/lock_manager.c
src/util/command.c
src/util/iohelper.c
src/util/util.c