# HG changeset patch # User Jim Meyering # Date 1309775465 -7200 # Node ID 03e2cd1cbbe82e5a9ff7b101b3315a785716d1e5 # Parent 787a6021ecd519a9c29f10d076ba62aa6d978c84 maint: indent with spaces, not TABs, and add a rule to check this * tests/test-userspec.c: Indent with spaces, not TABs. * tests/test-argp.c: Likewise. * tests/test-c-stack2.sh: Likewise. * tests/test-parse-duration.sh: Likewise * m4/strtod.m4: Likewise. * m4/alloca.m4: Likewise. * m4/pselect.m4: Likewise. * Makefile (sc_prohibit_leading_TABs): Prohibit leading TABs. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2011-07-04 Jim Meyering + + maint: indent with spaces, not TABs, and add a rule to check this + * tests/test-userspec.c: Indent with spaces, not TABs. + * tests/test-argp.c: Likewise. + * tests/test-c-stack2.sh: Likewise. + * tests/test-parse-duration.sh: Likewise + * m4/strtod.m4: Likewise. + * m4/alloca.m4: Likewise. + * m4/pselect.m4: Likewise. + * Makefile (sc_prohibit_leading_TABs): Prohibit leading TABs. + 2011-07-03 Jim Meyering maint.mk: correct omissions in prohibit_argmatch_without_use check diff --git a/Makefile b/Makefile --- a/Makefile +++ b/Makefile @@ -32,6 +32,16 @@ in modules/ 1>&2; exit 1; } || : \ else :; fi +sc_prohibit_leading_TABs: + if test -d .git; then \ + url=FIXME; \ + git grep -l '^ * ' lib m4 tests \ + | grep -Ev '^m4/po\.m4|^lib/reg|Makefile|test-update-copyright' \ + | grep . \ + && { printf '*** %s\n' 'indent with spaces, not TABs;' \ + 1>&2; exit 1; } || : \ + else :; fi + sc_prohibit_augmenting_PATH_via_TESTS_ENVIRONMENT: if test -d .git; then \ url=http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/22874; \ diff --git a/m4/alloca.m4 b/m4/alloca.m4 --- a/m4/alloca.m4 +++ b/m4/alloca.m4 @@ -1,4 +1,4 @@ -# alloca.m4 serial 12 +# alloca.m4 serial 13 dnl Copyright (C) 2002-2004, 2006-2007, 2009-2011 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation @@ -76,17 +76,17 @@ if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do AC_CHECK_FUNC($ac_func, - [AC_DEFINE_UNQUOTED(CRAY_STACKSEG_END, $ac_func, - [Define to one of `_getb67', `GETB67', - `getb67' for Cray-2 and Cray-YMP - systems. This function is required for - `alloca.c' support on those systems.]) + [AC_DEFINE_UNQUOTED(CRAY_STACKSEG_END, $ac_func, + [Define to one of `_getb67', `GETB67', + `getb67' for Cray-2 and Cray-YMP + systems. This function is required for + `alloca.c' support on those systems.]) break]) done fi AC_CACHE_CHECK([stack direction for C alloca], - [ac_cv_c_stack_direction], + [ac_cv_c_stack_direction], [AC_RUN_IFELSE([AC_LANG_SOURCE( [AC_INCLUDES_DEFAULT int @@ -105,16 +105,16 @@ { return find_stack_direction (0, argc + !argv + 20) < 0; }])], - [ac_cv_c_stack_direction=1], - [ac_cv_c_stack_direction=-1], - [ac_cv_c_stack_direction=0])]) + [ac_cv_c_stack_direction=1], + [ac_cv_c_stack_direction=-1], + [ac_cv_c_stack_direction=0])]) AH_VERBATIM([STACK_DIRECTION], [/* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at runtime. - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown */ + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ @%:@undef STACK_DIRECTION])dnl AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction) ])# _AC_LIBOBJ_ALLOCA diff --git a/m4/pselect.m4 b/m4/pselect.m4 --- a/m4/pselect.m4 +++ b/m4/pselect.m4 @@ -14,15 +14,15 @@ AC_CACHE_CHECK([whether signature of pselect conforms to POSIX], gl_cv_sig_pselect, [AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [[#include - ]], - [[int (*p) (int, fd_set *, fd_set *, fd_set *restrict, - struct timespec const *restrict, - sigset_t const *restrict) = pselect; - return !p;]])], - [gl_cv_sig_pselect=yes], - [gl_cv_sig_pselect=no])]) + [AC_LANG_PROGRAM( + [[#include + ]], + [[int (*p) (int, fd_set *, fd_set *, fd_set *restrict, + struct timespec const *restrict, + sigset_t const *restrict) = pselect; + return !p;]])], + [gl_cv_sig_pselect=yes], + [gl_cv_sig_pselect=no])]) fi if test $ac_cv_func_pselect = no || test $gl_cv_sig_pselect = no; then diff --git a/m4/strtod.m4 b/m4/strtod.m4 --- a/m4/strtod.m4 +++ b/m4/strtod.m4 @@ -101,7 +101,7 @@ [gl_cv_func_strtod_works=yes], [gl_cv_func_strtod_works=no], [dnl The last known bugs in glibc strtod(), as of this writing, - dnl were fixed in version 2.8 + dnl were fixed in version 2.8 AC_EGREP_CPP([Lucky user], [ #include diff --git a/tests/test-argp.c b/tests/test-argp.c --- a/tests/test-argp.c +++ b/tests/test-argp.c @@ -226,7 +226,7 @@ { case ARGP_KEY_INIT: for (i = 0; state->root_argp->children[i].argp; i++) - state->child_inputs[i] = args; + state->child_inputs[i] = args; break; case 't': @@ -346,7 +346,7 @@ void test_optional (struct argp *argp, int argc, char **argv, - struct test_args *args, const char *val, const char *a) + struct test_args *args, const char *val, const char *a) { int index; if (argp_parse (argp, argc, argv, 0, &index, args)) @@ -357,7 +357,7 @@ if (!val) { if (args->optional) - fail ("option processed incorrectly"); + fail ("option processed incorrectly"); } else if (strcmp (args->optional, val)) fail ("option processed incorrectly"); @@ -365,9 +365,9 @@ if (a) { if (index == argc) - fail ("expected command line argument not found"); + fail ("expected command line argument not found"); else if (strcmp (argv[index], a)) - fail ("expected command line argument does not match"); + fail ("expected command line argument does not match"); } } diff --git a/tests/test-c-stack2.sh b/tests/test-c-stack2.sh --- a/tests/test-c-stack2.sh +++ b/tests/test-c-stack2.sh @@ -11,16 +11,16 @@ case $? in 77) if grep 'stack overflow' t-c-stack2.tmp >/dev/null ; then - if test -z "$LIBSIGSEGV"; then - echo 'cannot tell stack overflow from crash; consider installing libsigsegv' >&2 - exit 77 - else - echo 'cannot tell stack overflow from crash, in spite of libsigsegv' >&2 - exit 1 - fi + if test -z "$LIBSIGSEGV"; then + echo 'cannot tell stack overflow from crash; consider installing libsigsegv' >&2 + exit 77 + else + echo 'cannot tell stack overflow from crash, in spite of libsigsegv' >&2 + exit 1 + fi else - cat t-c-stack2.tmp >&2 - exit 77 + cat t-c-stack2.tmp >&2 + exit 77 fi ;; 0) (exit 1); exit 1 ;; diff --git a/tests/test-parse-duration.sh b/tests/test-parse-duration.sh --- a/tests/test-parse-duration.sh +++ b/tests/test-parse-duration.sh @@ -50,14 +50,14 @@ tmpf="${tmp}/tests.txt" cat > "${tmpf}" <<- _EOF_ - 1 Y 2 M 3 W 4 d 5 h 6 m 7 s - P 00010225 T 05:06:07 - P 1Y2M3W4D T 5H6M7S - 1 Y 2 M 25 D 5:6:7 - 1 Y 2 M 25 d 5h 6:7 - 1 Y 2 M 25 d 5h 6m 7 - P 1-2-25 T 5:6:7 - _EOF_ + 1 Y 2 M 3 W 4 d 5 h 6 m 7 s + P 00010225 T 05:06:07 + P 1Y2M3W4D T 5H6M7S + 1 Y 2 M 25 D 5:6:7 + 1 Y 2 M 25 d 5h 6:7 + 1 Y 2 M 25 d 5h 6m 7 + P 1-2-25 T 5:6:7 + _EOF_ exec 3< "${tmpf}" while read line <&3 diff --git a/tests/test-userspec.c b/tests/test-userspec.c --- a/tests/test-userspec.c +++ b/tests/test-userspec.c @@ -144,7 +144,7 @@ char *user_name; char *group_name; char const *diag = parse_user_spec (T[i].in, &uid, &gid, - &user_name, &group_name); + &user_name, &group_name); free (user_name); free (group_name); if (!same_diag (diag, T[i].result)) @@ -161,8 +161,8 @@ if (uid != T[i].uid || gid != T[i].gid) { printf ("%s mismatch (-: expected uid,gid; +:actual)\n" - "-%3lu,%3lu\n+%3lu,%3lu\n", - T[i].in, + "-%3lu,%3lu\n+%3lu,%3lu\n", + T[i].in, (unsigned long int) T[i].uid, (unsigned long int) T[i].gid, (unsigned long int) uid, @@ -175,8 +175,8 @@ { printf ("%s diagnostic mismatch (-: expected uid,gid; +:actual)\n" - "-%s\n+%s\n", - T[i].in, T[i].result, diag); + "-%s\n+%s\n", + T[i].in, T[i].result, diag); fail = 1; } }