maint: enforce cpp indentation policy

* cfg.mk (sc_preprocessor_indentation): New test, from libvirt.
Exempt 3 files from new cppi test.
* gl/lib/randread.c: Adjust cpp indentation to comply.
* src/extent-scan.c (extent_need_sync): Likewise.
This commit is contained in:
Jim Meyering committed 2011-05-26 22:10:46 +02:00
1 parent 3f98fe3155
commit d7e2365203
3 files changed
+17 -4

No files matched your search

+13
View File
@@ -326,6 +326,16 @@ sc_prohibit_strncmp:
{ echo '$(ME): use STREQ_LEN or STRPREFIX instead of str''ncmp' \
1>&2; exit 1; } || :
# Enforce recommended preprocessor indentation style.
sc_preprocessor_indentation:
@if cppi --version >/dev/null 2>&1; then \
$(VC_LIST_EXCEPT) | grep '\.[ch]$$' | xargs cppi -a -c \
|| { echo '$(ME): incorrect preprocessor indentation' 1>&2; \
exit 1; }; \
else \
echo '$(ME): skipping test $@: cppi not installed' 1>&2; \
fi
# Override the default Cc: used in generating an announcement.
announcement_Cc_ = $(translation_project_), \
coreutils@gnu.org, coreutils-announce@gnu.org
@@ -365,6 +375,9 @@ exclude_file_name_regexp--sc_prohibit_fail_0 = \
exclude_file_name_regexp--sc_prohibit_atoi_atof = ^lib/euidaccess-stat\.c$$
exclude_file_name_regexp--sc_prohibit_tab_based_indentation = \
^tests/pr/|(^gl/lib/reg.*\.c\.diff|Makefile(\.am)?|\.mk|^man/help2man)$$
exclude_file_name_regexp--sc_preprocessor_indentation = \
^(gl/lib/rand-isaac\.[ch]|gl/tests/test-rand-isaac\.c)$$
exclude_file_name_regexp--sc_prohibit_stat_st_blocks = \
^(src/system\.h|tests/du/2g)$$
+2 -2
View File
@@ -64,7 +64,7 @@
#endif
#ifndef NAME_OF_NONCE_DEVICE
#define NAME_OF_NONCE_DEVICE "/dev/urandom"
# define NAME_OF_NONCE_DEVICE "/dev/urandom"
#endif
/* The maximum buffer size used for reads of random data. Using the
@@ -162,7 +162,7 @@ get_nonce (void *buffer, size_t bufsize, size_t bytes_bound)
/* If there's no nonce device, use a poor approximation
by getting the time of day, etc. */
# define ISAAC_SEED(type, initialize_v) \
#define ISAAC_SEED(type, initialize_v) \
if (seeded < bufsize) \
{ \
type v; \
+2 -2
View File
@@ -50,7 +50,7 @@ extent_need_sync (void)
struct utsname name;
need_sync = 0; /* No workaround by default. */
#ifdef __linux__
# ifdef __linux__
if (uname (&name) != -1 && STRNCMP_LIT (name.release, "2.6.") == 0)
{
unsigned long val;
@@ -60,7 +60,7 @@ extent_need_sync (void)
need_sync = 1;
}
}
#endif
# endif
}
return need_sync;