From: Bruno Haible Date: Mon, 25 Jun 2018 19:45:23 +0000 (+0200) Subject: Continue to use spaces for indentation, not tabs. X-Git-Tag: v1.0~5541 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=d7cf3b8d27f6b7ccbcdcdd9d18d7e12208795e3d;p=gnulib.git Continue to use spaces for indentation, not tabs. --- diff --git a/ChangeLog b/ChangeLog index 40abb3fce3..74484ac03d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,28 @@ +2018-06-25 Bruno Haible + + Continue to use spaces for indentation, not tabs. + * MODULES.html.sh: Untabify. + * doc/regex.texi: Likewise. + * lib/acl-internal.c: Likewise. + * lib/dfa.c: Likewise. + * lib/exclude.c: Likewise. + * lib/exclude.h: Likewise. + * lib/get-permissions.c: Likewise. + * lib/gettimeofday.c: Likewise. + * lib/parse-datetime.y: Likewise. + * lib/pselect.c: Likewise. + * lib/set-permissions.c: Likewise. + * lib/time.in.h: Likewise. + * m4/canonicalize.m4: Likewise. + * m4/gc.m4: Likewise. + * m4/gnulib-common.m4: Likewise. + * m4/pthread_sigmask.m4: Likewise. + * m4/vararrays.m4: Likewise. + * tests/test-digest.h: Likewise. + * tests/test-fcntl-h.c: Likewise. + * tests/test-timespec.c: Likewise. + * tests/uniwbrk/test-uc-wordbreaks.c: Likewise. + 2018-06-25 Bruno Haible manywarnings: Don't enable -Wjump-misses-init warnings by default. diff --git a/MODULES.html.sh b/MODULES.html.sh index a4e94c3a48..2cb4cd30f8 100755 --- a/MODULES.html.sh +++ b/MODULES.html.sh @@ -3637,8 +3637,8 @@ func_all_modules gnulib-tool --list > "$tmp/all-modules" missed_modules=`for module in $seen_modules; do echo $module; done \ - | LC_ALL=C sort -u \ - | LC_ALL=C join -v 2 - "$tmp/all-modules"` + | LC_ALL=C sort -u \ + | LC_ALL=C join -v 2 - "$tmp/all-modules"` if test -n "$missed_modules"; then @@ -3657,8 +3657,8 @@ fi { find lib -type f -print; find m4 -type f -print; } | LC_ALL=C sort | sed -e '/\/\./d' -e /README/d -e /ChangeLog/d -e /Makefile/d -e /TODO/d -e '/tags$/d' -e '/TAGS$/d' -e '/~$/d' > "$tmp/all-files" missed_files=`for file in $seen_files; do echo $file; done \ - | LC_ALL=C sort -u \ - | LC_ALL=C join -v 2 - "$tmp/all-files"` + | LC_ALL=C sort -u \ + | LC_ALL=C join -v 2 - "$tmp/all-files"` if test -n "$missed_files"; then diff --git a/doc/regex.texi b/doc/regex.texi index 9810092299..41a69b10cb 100644 --- a/doc/regex.texi +++ b/doc/regex.texi @@ -1901,9 +1901,9 @@ The function: @example void re_set_registers (struct re_pattern_buffer *@var{buffer}, - struct re_registers *@var{regs}, - size_t @var{num_regs}, - regoff_t *@var{starts}, regoff_t *@var{ends}) + struct re_registers *@var{regs}, + size_t @var{num_regs}, + regoff_t *@var{starts}, regoff_t *@var{ends}) @end example @noindent sets @var{regs} to hold @var{num_regs} registers, storing diff --git a/lib/acl-internal.c b/lib/acl-internal.c index 383c5ddb6f..c62adb0d9d 100644 --- a/lib/acl-internal.c +++ b/lib/acl-internal.c @@ -355,7 +355,7 @@ acl_nontrivial (int count, struct acl_entry *entries) struct acl_entry *ace = &entries[i]; if (ace->uid != ACL_NSUSER && ace->gid != ACL_NSGROUP) - return 1; + return 1; } return 0; } diff --git a/lib/dfa.c b/lib/dfa.c index 0b694e1067..37628fb407 100644 --- a/lib/dfa.c +++ b/lib/dfa.c @@ -780,7 +780,7 @@ emptyset (charclass const *s) static void * xpalloc (void *pa, ptrdiff_t *nitems, ptrdiff_t nitems_incr_min, - ptrdiff_t nitems_max, ptrdiff_t item_size) + ptrdiff_t nitems_max, ptrdiff_t item_size) { ptrdiff_t n0 = *nitems; @@ -814,8 +814,8 @@ xpalloc (void *pa, ptrdiff_t *nitems, ptrdiff_t nitems_incr_min, *nitems = 0; if (n - n0 < nitems_incr_min && (INT_ADD_WRAPV (n0, nitems_incr_min, &n) - || (0 <= nitems_max && nitems_max < n) - || INT_MULTIPLY_WRAPV (n, item_size, &nbytes))) + || (0 <= nitems_max && nitems_max < n) + || INT_MULTIPLY_WRAPV (n, item_size, &nbytes))) xalloc_die (); pa = xrealloc (pa, nbytes); *nitems = n; diff --git a/lib/exclude.c b/lib/exclude.c index 993be74cc7..88f81879e8 100644 --- a/lib/exclude.c +++ b/lib/exclude.c @@ -146,20 +146,20 @@ fnmatch_pattern_has_wildcards (const char *str, int options) { switch (*str++) { - case '.': - case '{': - case '}': - case '(': - case ')': - if (options & EXCLUDE_REGEX) - return true; - break; + case '.': + case '{': + case '}': + case '(': + case ')': + if (options & EXCLUDE_REGEX) + return true; + break; case '\\': - if (options & EXCLUDE_REGEX) - continue; - else - str += ! (options & FNM_NOESCAPE) && *str; + if (options & EXCLUDE_REGEX) + continue; + else + str += ! (options & FNM_NOESCAPE) && *str; break; case '+': case '@': case '!': @@ -287,10 +287,10 @@ free_exclude_segment (struct exclude_segment *seg) { case exclude_pattern: for (i = 0; i < seg->v.pat.exclude_count; i++) - { - if (seg->v.pat.exclude[i].options & EXCLUDE_REGEX) - regfree (&seg->v.pat.exclude[i].v.re); - } + { + if (seg->v.pat.exclude[i].options & EXCLUDE_REGEX) + regfree (&seg->v.pat.exclude[i].v.re); + } free (seg->v.pat.exclude); break; @@ -387,7 +387,7 @@ exclude_fnmatch (char const *pattern, char const *f, int options) if (! (options & EXCLUDE_ANCHORED)) for (p = f; *p && ! matched; p++) if (*p == '/' && p[1] != '/') - matched = ((*matcher) (pattern, p + 1, options) == 0); + matched = ((*matcher) (pattern, p + 1, options) == 0); return matched; } @@ -525,9 +525,9 @@ add_exclude (struct exclude *ex, char const *pattern, int options) && fnmatch_pattern_has_wildcards (pattern, options)) { if (! (ex->head && ex->head->type == exclude_pattern - && ((ex->head->options & EXCLUDE_INCLUDE) - == (options & EXCLUDE_INCLUDE)))) - new_exclude_segment (ex, exclude_pattern, options); + && ((ex->head->options & EXCLUDE_INCLUDE) + == (options & EXCLUDE_INCLUDE)))) + new_exclude_segment (ex, exclude_pattern, options); seg = ex->head; @@ -539,48 +539,48 @@ add_exclude (struct exclude *ex, char const *pattern, int options) patopts->options = options; if (options & EXCLUDE_REGEX) - { - int rc; - int cflags = REG_NOSUB|REG_EXTENDED| - ((options & FNM_CASEFOLD) ? REG_ICASE : 0); - - if (options & FNM_LEADING_DIR) - { - char *tmp; - size_t len = strlen (pattern); - - while (len > 0 && ISSLASH (pattern[len-1])) - --len; - - if (len == 0) - rc = 1; - else - { - tmp = xmalloc (len + 7); - memcpy (tmp, pattern, len); - strcpy (tmp + len, "(/.*)?"); - rc = regcomp (&patopts->v.re, tmp, cflags); - free (tmp); - } - } - else - rc = regcomp (&patopts->v.re, pattern, cflags); - - if (rc) - { - pat->exclude_count--; - return; - } - } + { + int rc; + int cflags = REG_NOSUB|REG_EXTENDED| + ((options & FNM_CASEFOLD) ? REG_ICASE : 0); + + if (options & FNM_LEADING_DIR) + { + char *tmp; + size_t len = strlen (pattern); + + while (len > 0 && ISSLASH (pattern[len-1])) + --len; + + if (len == 0) + rc = 1; + else + { + tmp = xmalloc (len + 7); + memcpy (tmp, pattern, len); + strcpy (tmp + len, "(/.*)?"); + rc = regcomp (&patopts->v.re, tmp, cflags); + free (tmp); + } + } + else + rc = regcomp (&patopts->v.re, pattern, cflags); + + if (rc) + { + pat->exclude_count--; + return; + } + } else - { - if (options & EXCLUDE_ALLOC) - { - pattern = xstrdup (pattern); - exclude_add_pattern_buffer (ex, (char*) pattern); - } - patopts->v.pattern = pattern; - } + { + if (options & EXCLUDE_ALLOC) + { + pattern = xstrdup (pattern); + exclude_add_pattern_buffer (ex, (char*) pattern); + } + patopts->v.pattern = pattern; + } } else { @@ -609,9 +609,9 @@ add_exclude (struct exclude *ex, char const *pattern, int options) int add_exclude_fp (void (*add_func) (struct exclude *, char const *, int, void *), - struct exclude *ex, FILE *fp, int options, - char line_end, - void *data) + struct exclude *ex, FILE *fp, int options, + char line_end, + void *data) { char *buf = NULL; char *p; @@ -674,8 +674,8 @@ call_addfn (struct exclude *ex, char const *pattern, int options, void *data) int add_exclude_file (void (*add_func) (struct exclude *, char const *, int), - struct exclude *ex, char const *file_name, int options, - char line_end) + struct exclude *ex, char const *file_name, int options, + char line_end) { bool use_stdin = file_name[0] == '-' && !file_name[1]; FILE *in; diff --git a/lib/exclude.h b/lib/exclude.h index cac872f295..0bb9a8cb19 100644 --- a/lib/exclude.h +++ b/lib/exclude.h @@ -54,7 +54,7 @@ void add_exclude (struct exclude *, char const *, int); int add_exclude_file (void (*) (struct exclude *, char const *, int), struct exclude *, char const *, int, char); int add_exclude_fp (void (*) (struct exclude *, char const *, int, void *), - struct exclude *, FILE *, int, char, void *); + struct exclude *, FILE *, int, char, void *); bool excluded_file_name (struct exclude const *, char const *); void exclude_add_pattern_buffer (struct exclude *ex, char *buf); bool exclude_fnmatch (char const *, char const *, int); diff --git a/lib/get-permissions.c b/lib/get-permissions.c index bb1af5dbdf..83ba2639a1 100644 --- a/lib/get-permissions.c +++ b/lib/get-permissions.c @@ -31,7 +31,7 @@ int get_permissions (const char *name, int desc, mode_t mode, - struct permission_context *ctx) + struct permission_context *ctx) { memset (ctx, 0, sizeof *ctx); ctx->mode = mode; @@ -57,7 +57,7 @@ get_permissions (const char *name, int desc, mode_t mode, { ctx->default_acl = acl_get_file (name, ACL_TYPE_DEFAULT); if (ctx->default_acl == NULL) - return -1; + return -1; } # if HAVE_ACL_TYPE_NFS4 /* FreeBSD */ @@ -115,16 +115,16 @@ get_permissions (const char *name, int desc, mode_t mode, int ret; if (desc != -1) - ret = facl (desc, ACE_GETACLCNT, 0, NULL); + ret = facl (desc, ACE_GETACLCNT, 0, NULL); else - ret = acl (name, ACE_GETACLCNT, 0, NULL); + ret = acl (name, ACE_GETACLCNT, 0, NULL); if (ret < 0) - { - if (errno == ENOSYS || errno == EINVAL) - ret = 0; - else - return -1; - } + { + if (errno == ENOSYS || errno == EINVAL) + ret = 0; + else + return -1; + } ctx->ace_count = ret; if (ctx->ace_count == 0) @@ -138,15 +138,15 @@ get_permissions (const char *name, int desc, mode_t mode, } if (desc != -1) - ret = facl (desc, ACE_GETACL, ctx->ace_count, ctx->ace_entries); + ret = facl (desc, ACE_GETACL, ctx->ace_count, ctx->ace_entries); else - ret = acl (name, ACE_GETACL, ctx->ace_count, ctx->ace_entries); + ret = acl (name, ACE_GETACL, ctx->ace_count, ctx->ace_entries); if (ret < 0) { if (errno == ENOSYS || errno == EINVAL) { - free (ctx->ace_entries); - ctx->ace_entries = NULL; + free (ctx->ace_entries); + ctx->ace_entries = NULL; ctx->ace_count = 0; break; } @@ -154,10 +154,10 @@ get_permissions (const char *name, int desc, mode_t mode, return -1; } if (ret <= ctx->ace_count) - { - ctx->ace_count = ret; - break; - } + { + ctx->ace_count = ret; + break; + } /* Huh? The number of ACL entries has increased since the last call. Repeat. */ free (ctx->ace_entries); @@ -170,20 +170,20 @@ get_permissions (const char *name, int desc, mode_t mode, int ret; if (desc != -1) - ret = facl (desc, GETACLCNT, 0, NULL); + ret = facl (desc, GETACLCNT, 0, NULL); else - ret = acl (name, GETACLCNT, 0, NULL); + ret = acl (name, GETACLCNT, 0, NULL); if (ret < 0) - { - if (errno == ENOSYS || errno == ENOTSUP || errno == EOPNOTSUPP) - ret = 0; - else - return -1; - } + { + if (errno == ENOSYS || errno == ENOTSUP || errno == EOPNOTSUPP) + ret = 0; + else + return -1; + } ctx->count = ret; if (ctx->count == 0) - break; + break; ctx->entries = (aclent_t *) malloc (ctx->count * sizeof (aclent_t)); if (ctx->entries == NULL) @@ -193,26 +193,26 @@ get_permissions (const char *name, int desc, mode_t mode, } if (desc != -1) - ret = facl (desc, GETACL, ctx->count, ctx->entries); + ret = facl (desc, GETACL, ctx->count, ctx->entries); else - ret = acl (name, GETACL, ctx->count, ctx->entries); + ret = acl (name, GETACL, ctx->count, ctx->entries); if (ret < 0) - { - if (errno == ENOSYS || errno == ENOTSUP || errno == EOPNOTSUPP) - { - free (ctx->entries); - ctx->entries = NULL; - ctx->count = 0; - break; - } - else - return -1; - } + { + if (errno == ENOSYS || errno == ENOTSUP || errno == EOPNOTSUPP) + { + free (ctx->entries); + ctx->entries = NULL; + ctx->count = 0; + break; + } + else + return -1; + } if (ret <= ctx->count) - { - ctx->count = ret; - break; - } + { + ctx->count = ret; + break; + } /* Huh? The number of ACL entries has increased since the last call. Repeat. */ free (ctx->entries); diff --git a/lib/gettimeofday.c b/lib/gettimeofday.c index ba0410b9d1..bff40d7964 100644 --- a/lib/gettimeofday.c +++ b/lib/gettimeofday.c @@ -45,7 +45,7 @@ initialize (void) if (kernel32 != NULL) { GetSystemTimePreciseAsFileTimeFunc = - (GetSystemTimePreciseAsFileTimeFuncType) GetProcAddress (kernel32, "GetSystemTimePreciseAsFileTime"); + (GetSystemTimePreciseAsFileTimeFuncType) GetProcAddress (kernel32, "GetSystemTimePreciseAsFileTime"); } initialized = TRUE; } diff --git a/lib/parse-datetime.y b/lib/parse-datetime.y index 00ecb7fcae..aad5be834a 100644 --- a/lib/parse-datetime.y +++ b/lib/parse-datetime.y @@ -492,7 +492,7 @@ debug_print_current_time (char const *item, parser_control *pc) if (pc->local_zones_seen && !pc->debug_local_zones_seen) { fprintf (stderr, &" isdst=%d%s"[!space], - pc->local_isdst, pc->dsts_seen ? " DST" : ""); + pc->local_isdst, pc->dsts_seen ? " DST" : ""); pc->debug_local_zones_seen = true; space = true; } @@ -1966,7 +1966,7 @@ parse_datetime2 (struct timespec *result, char const *p, fprintf (stderr, ", dst"); if (pc.zones_seen) - fprintf (stderr, " (%s)", time_zone_str (pc.time_zone, time_zone_buf)); + fprintf (stderr, " (%s)", time_zone_str (pc.time_zone, time_zone_buf)); fputc ('\n', stderr); } diff --git a/lib/pselect.c b/lib/pselect.c index 0566fdd904..f569a3355b 100644 --- a/lib/pselect.c +++ b/lib/pselect.c @@ -83,9 +83,9 @@ pselect (int nfds, fd_set *restrict rfds, int rpl_pselect (int nfds, fd_set *restrict rfds, - fd_set *restrict wfds, fd_set *restrict xfds, + fd_set *restrict wfds, fd_set *restrict xfds, struct timespec const *restrict timeout, - sigset_t const *restrict sigmask) + sigset_t const *restrict sigmask) { int i; diff --git a/lib/set-permissions.c b/lib/set-permissions.c index 4b7371c9b4..d42335aa50 100644 --- a/lib/set-permissions.c +++ b/lib/set-permissions.c @@ -229,14 +229,14 @@ set_acls_from_mode (const char *name, int desc, mode_t mode, bool *must_chmod) if (ret < 0 && errno != EINVAL && errno != ENOTSUP) { if (errno == ENOSYS) - { - *must_chmod = true; - return 0; - } + { + *must_chmod = true; + return 0; + } return -1; } if (ret == 0) - return 0; + return 0; } # endif @@ -256,18 +256,18 @@ set_acls_from_mode (const char *name, int desc, mode_t mode, bool *must_chmod) if (desc != -1) ret = facl (desc, SETACL, - sizeof (entries) / sizeof (aclent_t), entries); + sizeof (entries) / sizeof (aclent_t), entries); else ret = acl (name, SETACL, - sizeof (entries) / sizeof (aclent_t), entries); + sizeof (entries) / sizeof (aclent_t), entries); if (ret < 0) { - if (errno == ENOSYS || errno == EOPNOTSUPP) - { - *must_chmod = true; - return 0; - } - return -1; + if (errno == ENOSYS || errno == EOPNOTSUPP) + { + *must_chmod = true; + return 0; + } + return -1; } return 0; } @@ -483,7 +483,7 @@ context_acl_from_mode (struct permission_context *ctx) static int set_acls (struct permission_context *ctx, const char *name, int desc, - int from_mode, bool *must_chmod, bool *acls_set) + int from_mode, bool *must_chmod, bool *acls_set) { int ret = 0; @@ -503,43 +503,43 @@ set_acls (struct permission_context *ctx, const char *name, int desc, if (! ctx->acls_not_supported) { if (ret == 0 && from_mode) - { - if (ctx->acl) - acl_free (ctx->acl); - ctx->acl = acl_from_mode (ctx->mode); - if (ctx->acl == NULL) - ret = -1; - } + { + if (ctx->acl) + acl_free (ctx->acl); + ctx->acl = acl_from_mode (ctx->mode); + if (ctx->acl == NULL) + ret = -1; + } if (ret == 0 && ctx->acl) - { - if (HAVE_ACL_SET_FD && desc != -1) - ret = acl_set_fd (desc, ctx->acl); - else - ret = acl_set_file (name, ACL_TYPE_ACCESS, ctx->acl); - if (ret != 0) - { - if (! acl_errno_valid (errno)) - { - ctx->acls_not_supported = true; - if (from_mode || acl_access_nontrivial (ctx->acl) == 0) - ret = 0; - } - } - else - { - *acls_set = true; - if (S_ISDIR(ctx->mode)) - { - if (! from_mode && ctx->default_acl && - acl_default_nontrivial (ctx->default_acl)) - ret = acl_set_file (name, ACL_TYPE_DEFAULT, - ctx->default_acl); - else - ret = acl_delete_def_file (name); - } - } - } + { + if (HAVE_ACL_SET_FD && desc != -1) + ret = acl_set_fd (desc, ctx->acl); + else + ret = acl_set_file (name, ACL_TYPE_ACCESS, ctx->acl); + if (ret != 0) + { + if (! acl_errno_valid (errno)) + { + ctx->acls_not_supported = true; + if (from_mode || acl_access_nontrivial (ctx->acl) == 0) + ret = 0; + } + } + else + { + *acls_set = true; + if (S_ISDIR(ctx->mode)) + { + if (! from_mode && ctx->default_acl && + acl_default_nontrivial (ctx->default_acl)) + ret = acl_set_file (name, ACL_TYPE_DEFAULT, + ctx->default_acl); + else + ret = acl_delete_def_file (name); + } + } + } } # if HAVE_ACL_TYPE_NFS4 /* FreeBSD */ @@ -573,38 +573,38 @@ set_acls (struct permission_context *ctx, const char *name, int desc, /* Remove ACLs if the file has ACLs. */ if (HAVE_ACL_GET_FD && desc != -1) - acl = acl_get_fd (desc); + acl = acl_get_fd (desc); else - acl = acl_get_file (name, ACL_TYPE_EXTENDED); + acl = acl_get_file (name, ACL_TYPE_EXTENDED); if (acl) - { - acl_free (acl); - - acl = acl_init (0); - if (acl) - { - if (HAVE_ACL_SET_FD && desc != -1) - ret = acl_set_fd (desc, acl); - else - ret = acl_set_file (name, ACL_TYPE_EXTENDED, acl); - acl_free (acl); - } - else - ret = -1; - } + { + acl_free (acl); + + acl = acl_init (0); + if (acl) + { + if (HAVE_ACL_SET_FD && desc != -1) + ret = acl_set_fd (desc, acl); + else + ret = acl_set_file (name, ACL_TYPE_EXTENDED, acl); + acl_free (acl); + } + else + ret = -1; + } } else { if (HAVE_ACL_SET_FD && desc != -1) - ret = acl_set_fd (desc, ctx->acl); + ret = acl_set_fd (desc, ctx->acl); else - ret = acl_set_file (name, ACL_TYPE_EXTENDED, ctx->acl); + ret = acl_set_file (name, ACL_TYPE_EXTENDED, ctx->acl); if (ret != 0) - { - if (! acl_errno_valid (errno) - && ! acl_extended_nontrivial (ctx->acl)) - ret = 0; - } + { + if (! acl_errno_valid (errno) + && ! acl_extended_nontrivial (ctx->acl)) + ret = 0; + } } *acls_set = true; @@ -626,34 +626,34 @@ set_acls (struct permission_context *ctx, const char *name, int desc, if (ret == 0 && ctx->count) { if (desc != -1) - ret = facl (desc, SETACL, ctx->count, ctx->entries); + ret = facl (desc, SETACL, ctx->count, ctx->entries); else - ret = acl (name, SETACL, ctx->count, ctx->entries); + ret = acl (name, SETACL, ctx->count, ctx->entries); if (ret < 0) - { - if ((errno == ENOSYS || errno == EOPNOTSUPP || errno == EINVAL) - && acl_nontrivial (ctx->count, ctx->entries) == 0) - ret = 0; - } + { + if ((errno == ENOSYS || errno == EOPNOTSUPP || errno == EINVAL) + && acl_nontrivial (ctx->count, ctx->entries) == 0) + ret = 0; + } else - *acls_set = true; + *acls_set = true; } # ifdef ACE_GETACL if (ret == 0 && ctx->ace_count) { if (desc != -1) - ret = facl (desc, ACE_SETACL, ctx->ace_count, ctx->ace_entries); + ret = facl (desc, ACE_SETACL, ctx->ace_count, ctx->ace_entries); else - ret = acl (name, ACE_SETACL, ctx->ace_count, ctx->ace_entries); + ret = acl (name, ACE_SETACL, ctx->ace_count, ctx->ace_entries); if (ret < 0) - { - if ((errno == ENOSYS || errno == EINVAL || errno == ENOTSUP) - && acl_ace_nontrivial (ctx->ace_count, ctx->ace_entries) == 0) - ret = 0; - } + { + if ((errno == ENOSYS || errno == EINVAL || errno == ENOTSUP) + && acl_ace_nontrivial (ctx->ace_count, ctx->ace_entries) == 0) + ret = 0; + } else - *acls_set = true; + *acls_set = true; } # endif @@ -665,17 +665,17 @@ set_acls (struct permission_context *ctx, const char *name, int desc, if (ret == 0 && ctx->count > 0) { if (desc != -1) - ret = fsetacl (desc, ctx->count, ctx->entries); + ret = fsetacl (desc, ctx->count, ctx->entries); else - ret = setacl (name, ctx->count, ctx->entries); + ret = setacl (name, ctx->count, ctx->entries); if (ret < 0) - { - if ((errno == ENOSYS || errno == EOPNOTSUPP || errno == ENOTSUP) - && (from_mode || !acl_nontrivial (ctx->count, ctx->entries))) - ret = 0; - } + { + if ((errno == ENOSYS || errno == EOPNOTSUPP || errno == ENOTSUP) + && (from_mode || !acl_nontrivial (ctx->count, ctx->entries))) + ret = 0; + } else - *acls_set = true; + *acls_set = true; } # if HAVE_ACLV_H @@ -686,13 +686,13 @@ set_acls (struct permission_context *ctx, const char *name, int desc, { ret = acl ((char *) name, ACL_SET, ctx->aclv_count, ctx->aclv_entries); if (ret < 0) - { - if ((errno == ENOSYS || errno == EOPNOTSUPP || errno == EINVAL) - && (from_mode || !aclv_nontrivial (ctx->aclv_count, ctx->aclv_entries))) - ret = 0; - } + { + if ((errno == ENOSYS || errno == EOPNOTSUPP || errno == EINVAL) + && (from_mode || !aclv_nontrivial (ctx->aclv_count, ctx->aclv_entries))) + ret = 0; + } else - *acls_set = true; + *acls_set = true; } # endif @@ -711,16 +711,16 @@ set_acls (struct permission_context *ctx, const char *name, int desc, if (ret == 0 && ctx->have_u) { if (desc != -1) - ret = fchacl (desc, &ctx->u.a, ctx->u.a.acl_len); + ret = fchacl (desc, &ctx->u.a, ctx->u.a.acl_len); else - ret = chacl ((char *) name, &ctx->u.a, ctx->u.a.acl_len); + ret = chacl ((char *) name, &ctx->u.a, ctx->u.a.acl_len); if (ret < 0) - { - if (errno == ENOSYS && from_mode) - ret = 0; - } + { + if (errno == ENOSYS && from_mode) + ret = 0; + } else - *acls_set = true; + *acls_set = true; } # elif HAVE_ACLSORT /* NonStop Kernel */ @@ -732,12 +732,12 @@ set_acls (struct permission_context *ctx, const char *name, int desc, { ret = acl ((char *) name, ACL_SET, ctx->count, ctx->entries); if (ret != 0) - { - if (!acl_nontrivial (ctx->count, ctx->entries)) - ret = 0; - } + { + if (!acl_nontrivial (ctx->count, ctx->entries)) + ret = 0; + } else - *acls_set = true; + *acls_set = true; } # else /* No ACLs */ @@ -805,7 +805,7 @@ set_permissions (struct permission_context *ctx, const char *name, int desc) { ret = chmod_or_fchmod (name, desc, ctx->mode); if (ret != 0) - return -1; + return -1; } #if USE_ACL @@ -815,18 +815,18 @@ set_permissions (struct permission_context *ctx, const char *name, int desc) int saved_errno = ret ? errno : 0; /* If we can't set an acl which we expect to be able to set, try setting - the permissions to ctx->mode. Due to possible inherited permissions, - we cannot simply chmod. */ + the permissions to ctx->mode. Due to possible inherited permissions, + we cannot simply chmod. */ ret = set_acls (ctx, name, desc, true, &must_chmod, &acls_set); if (! acls_set) - must_chmod = true; + must_chmod = true; if (saved_errno) - { - errno = saved_errno; - ret = -1; - } + { + errno = saved_errno; + ret = -1; + } } #endif @@ -837,10 +837,10 @@ set_permissions (struct permission_context *ctx, const char *name, int desc) ret = chmod_or_fchmod (name, desc, ctx->mode); if (saved_errno) - { - errno = saved_errno; - ret = -1; - } + { + errno = saved_errno; + ret = -1; + } } return ret; diff --git a/lib/time.in.h b/lib/time.in.h index 37e3c663af..44ba9bca3f 100644 --- a/lib/time.in.h +++ b/lib/time.in.h @@ -212,7 +212,7 @@ _GL_CXXALIASWARN (gmtime_r); # define localtime rpl_localtime # endif _GL_FUNCDECL_RPL (localtime, struct tm *, (time_t const *__timer) - _GL_ARG_NONNULL ((1))); + _GL_ARG_NONNULL ((1))); _GL_CXXALIAS_RPL (localtime, struct tm *, (time_t const *__timer)); # else _GL_CXXALIAS_SYS (localtime, struct tm *, (time_t const *__timer)); diff --git a/m4/canonicalize.m4 b/m4/canonicalize.m4 index 9de4f13a2b..0c238946be 100644 --- a/m4/canonicalize.m4 +++ b/m4/canonicalize.m4 @@ -35,8 +35,8 @@ AC_DEFUN([gl_CANONICALIZE_LGPL], HAVE_REALPATH=0 else case "$gl_cv_func_realpath_works" in - *yes) ;; - *) REPLACE_REALPATH=1 ;; + *yes) ;; + *) REPLACE_REALPATH=1 ;; esac fi else diff --git a/m4/gc.m4 b/m4/gc.m4 index 2739f33ea9..6b1792e630 100644 --- a/m4/gc.m4 +++ b/m4/gc.m4 @@ -16,7 +16,7 @@ AC_DEFUN([gl_GC], gl_good_gcrypt=no m4_ifdef([AM_PATH_LIBGCRYPT], [AM_PATH_LIBGCRYPT([1.4.4], [gl_good_gcrypt=yes], - [AC_MSG_ERROR([libgcrypt is too old])])]) + [AC_MSG_ERROR([libgcrypt is too old])])]) if test "x$gl_good_gcrypt" != xno; then AC_LIB_HAVE_LINKFLAGS([gcrypt], [gpg-error], [#include ]) else diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4 index 736e421016..5f07855acf 100644 --- a/m4/gnulib-common.m4 +++ b/m4/gnulib-common.m4 @@ -354,16 +354,16 @@ AC_DEFUN([AC_C_RESTRICT], for ac_kw in __restrict __restrict__ _Restrict restrict; do AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( - [[typedef int *int_ptr; - int foo (int_ptr $ac_kw ip) { return ip[0]; } - int bar (int [$ac_kw]); /* Catch GCC bug 14050. */ - int bar (int ip[$ac_kw]) { return ip[0]; } - ]], - [[int s[1]; - int *$ac_kw t = s; - t[0] = 0; - return foo (t) + bar (t); - ]])], + [[typedef int *int_ptr; + int foo (int_ptr $ac_kw ip) { return ip[0]; } + int bar (int [$ac_kw]); /* Catch GCC bug 14050. */ + int bar (int ip[$ac_kw]) { return ip[0]; } + ]], + [[int s[1]; + int *$ac_kw t = s; + t[0] = 0; + return foo (t) + bar (t); + ]])], [ac_cv_c_restrict=$ac_kw]) test "$ac_cv_c_restrict" != no && break done diff --git a/m4/pthread_sigmask.m4 b/m4/pthread_sigmask.m4 index a33b433c0e..585b80a40f 100644 --- a/m4/pthread_sigmask.m4 +++ b/m4/pthread_sigmask.m4 @@ -124,41 +124,41 @@ AC_DEFUN([gl_FUNC_PTHREAD_SIGMASK], case " $LIBS " in *' -pthread '*) ;; *' -lpthread '*) ;; - *) - AC_CACHE_CHECK([whether pthread_sigmask works without -lpthread], - [gl_cv_func_pthread_sigmask_in_libc_works], - [ - AC_RUN_IFELSE( - [AC_LANG_SOURCE([[ - #include - #include - #include - int main () - { - sigset_t set; - sigemptyset (&set); - return pthread_sigmask (1729, &set, NULL) != 0; - }]])], - [gl_cv_func_pthread_sigmask_in_libc_works=no], - [gl_cv_func_pthread_sigmask_in_libc_works=yes], - [ - changequote(,)dnl - case "$host_os" in - freebsd* | hpux* | solaris | solaris2.[2-9]*) - gl_cv_func_pthread_sigmask_in_libc_works="guessing no";; - *) - gl_cv_func_pthread_sigmask_in_libc_works="guessing yes";; - esac - changequote([,])dnl - ]) - ]) - case "$gl_cv_func_pthread_sigmask_in_libc_works" in - *no) - REPLACE_PTHREAD_SIGMASK=1 - AC_DEFINE([PTHREAD_SIGMASK_INEFFECTIVE], [1], - [Define to 1 if pthread_sigmask may return 0 and have no effect.]) - ;; - esac;; + *) + AC_CACHE_CHECK([whether pthread_sigmask works without -lpthread], + [gl_cv_func_pthread_sigmask_in_libc_works], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ + #include + #include + #include + int main () + { + sigset_t set; + sigemptyset (&set); + return pthread_sigmask (1729, &set, NULL) != 0; + }]])], + [gl_cv_func_pthread_sigmask_in_libc_works=no], + [gl_cv_func_pthread_sigmask_in_libc_works=yes], + [ + changequote(,)dnl + case "$host_os" in + freebsd* | hpux* | solaris | solaris2.[2-9]*) + gl_cv_func_pthread_sigmask_in_libc_works="guessing no";; + *) + gl_cv_func_pthread_sigmask_in_libc_works="guessing yes";; + esac + changequote([,])dnl + ]) + ]) + case "$gl_cv_func_pthread_sigmask_in_libc_works" in + *no) + REPLACE_PTHREAD_SIGMASK=1 + AC_DEFINE([PTHREAD_SIGMASK_INEFFECTIVE], [1], + [Define to 1 if pthread_sigmask may return 0 and have no effect.]) + ;; + esac;; esac fi diff --git a/m4/vararrays.m4 b/m4/vararrays.m4 index 329eb490c3..17563b519b 100644 --- a/m4/vararrays.m4 +++ b/m4/vararrays.m4 @@ -18,44 +18,44 @@ AC_DEFUN([AC_C_VARARRAYS], ac_cv_c_vararrays, [AC_EGREP_CPP([defined], [#ifdef __STDC_NO_VLA__ - defined - #endif + defined + #endif ], [ac_cv_c_vararrays='no: __STDC_NO_VLA__ is defined'], [AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[/* Test for VLA support. This test is partly inspired - from examples in the C standard. Use at least two VLA - functions to detect the GCC 3.4.3 bug described in: - https://lists.gnu.org/r/bug-gnulib/2014-08/msg00014.html - */ - #ifdef __STDC_NO_VLA__ - syntax error; - #else - extern int n; - int B[100]; - int fvla (int m, int C[m][m]); + [AC_LANG_PROGRAM( + [[/* Test for VLA support. This test is partly inspired + from examples in the C standard. Use at least two VLA + functions to detect the GCC 3.4.3 bug described in: + https://lists.gnu.org/r/bug-gnulib/2014-08/msg00014.html + */ + #ifdef __STDC_NO_VLA__ + syntax error; + #else + extern int n; + int B[100]; + int fvla (int m, int C[m][m]); - int - simple (int count, int all[static count]) - { - return all[count - 1]; - } + int + simple (int count, int all[static count]) + { + return all[count - 1]; + } - int - fvla (int m, int C[m][m]) - { - typedef int VLA[m][m]; - VLA x; - int D[m]; - static int (*q)[m] = &B; - int (*s)[n] = q; - return C && &x[0][0] == &D[0] && &D[0] == s[0]; - } - #endif - ]])], - [ac_cv_c_vararrays=yes], - [ac_cv_c_vararrays=no])])]) + int + fvla (int m, int C[m][m]) + { + typedef int VLA[m][m]; + VLA x; + int D[m]; + static int (*q)[m] = &B; + int (*s)[n] = q; + return C && &x[0][0] == &D[0] && &D[0] == s[0]; + } + #endif + ]])], + [ac_cv_c_vararrays=yes], + [ac_cv_c_vararrays=no])])]) if test "$ac_cv_c_vararrays" = yes; then dnl This is for compatibility with Autoconf 2.61-2.69. AC_DEFINE([HAVE_C_VARARRAYS], 1, diff --git a/tests/test-digest.h b/tests/test-digest.h index c58d3dad87..e0c0126b73 100644 --- a/tests/test-digest.h +++ b/tests/test-digest.h @@ -84,7 +84,7 @@ test_digest_on_files (int (*streamfunc) (FILE *, void *), { case 0: expected = expected_for_empty_file; break; case 1: case 2: expected = expected_for_small_file; break; - case 3: case 4: expected = expected_for_large_file; break; + case 3: case 4: expected = expected_for_large_file; break; default: abort (); } diff --git a/tests/test-fcntl-h.c b/tests/test-fcntl-h.c index 50318660e8..d861f514b7 100644 --- a/tests/test-fcntl-h.c +++ b/tests/test-fcntl-h.c @@ -22,8 +22,8 @@ /* Check that the various O_* macros are defined. */ int o = (O_DIRECT | O_DIRECTORY | O_DSYNC | O_IGNORE_CTTY | O_NDELAY | O_NOATIME - | O_NONBLOCK | O_NOCTTY | O_NOFOLLOW | O_NOLINK | O_NOLINKS | O_NOTRANS - | O_RSYNC | O_SYNC | O_TTY_INIT | O_BINARY | O_TEXT); + | O_NONBLOCK | O_NOCTTY | O_NOFOLLOW | O_NOLINK | O_NOLINKS | O_NOTRANS + | O_RSYNC | O_SYNC | O_TTY_INIT | O_BINARY | O_TEXT); /* Check that the various SEEK_* macros are defined. */ int sk[] = { SEEK_CUR, SEEK_END, SEEK_SET }; diff --git a/tests/test-timespec.c b/tests/test-timespec.c index 40645eada7..4acc1aee48 100644 --- a/tests/test-timespec.c +++ b/tests/test-timespec.c @@ -84,8 +84,8 @@ static bool extremal (struct timespec a) { return ((a.tv_sec == TYPE_MINIMUM (time_t) && a.tv_nsec == 0) - || (a.tv_sec == TYPE_MAXIMUM (time_t) - && a.tv_nsec == TIMESPEC_RESOLUTION - 1)); + || (a.tv_sec == TYPE_MAXIMUM (time_t) + && a.tv_nsec == TIMESPEC_RESOLUTION - 1)); } int @@ -103,12 +103,12 @@ main (void) { int s = prototype[i].s; if (TYPE_SIGNED (time_t) || 0 <= s) - { - time_t t = (s <= INT_MIN + 1 ? s - INT_MIN + TYPE_MINIMUM (time_t) - : INT_MAX - 1 <= s ? s - INT_MAX + TYPE_MAXIMUM (time_t) - : s); - test[ntests++] = make_timespec (t, prototype[i].ns); - } + { + time_t t = (s <= INT_MIN + 1 ? s - INT_MIN + TYPE_MINIMUM (time_t) + : INT_MAX - 1 <= s ? s - INT_MAX + TYPE_MAXIMUM (time_t) + : s); + test[ntests++] = make_timespec (t, prototype[i].ns); + } } for (i = 0; i < LOG10_TIMESPEC_RESOLUTION; i++) @@ -127,40 +127,40 @@ main (void) ASSERT (sign (timespec_sign (a)) == cmp (a, make_timespec (0, 0))); if (valid (a)) - for (j = 0; j < ntests; j++) - { - struct timespec b = test[j]; - if (valid (b)) - { - struct timespec sum = timespec_add (a, b); - struct timespec diff = timespec_sub (a, b); - struct timespec rdiff = timespec_sub (b, a); - ASSERT (cmp (a, b) == sign (i - j)); - ASSERT (eq (sum, timespec_add (b, a))); - if (! extremal (sum)) - { - ASSERT (eq (a, timespec_sub (sum, b))); - ASSERT (eq (b, timespec_sub (sum, a))); - - for (k = 0; k < ntests; k++) - { - struct timespec c = test[k]; - if (valid (c)) - { - struct timespec sumbc = timespec_add (b, c); - if (! extremal (sumbc)) - ASSERT (eq (timespec_add (a, sumbc), - timespec_add (sum, c))); - } - } - } - if (! extremal (diff)) - ASSERT (eq (a, timespec_add (diff, b))); - if (! extremal (rdiff)) - ASSERT (eq (b, timespec_add (rdiff, a))); - - } - } + for (j = 0; j < ntests; j++) + { + struct timespec b = test[j]; + if (valid (b)) + { + struct timespec sum = timespec_add (a, b); + struct timespec diff = timespec_sub (a, b); + struct timespec rdiff = timespec_sub (b, a); + ASSERT (cmp (a, b) == sign (i - j)); + ASSERT (eq (sum, timespec_add (b, a))); + if (! extremal (sum)) + { + ASSERT (eq (a, timespec_sub (sum, b))); + ASSERT (eq (b, timespec_sub (sum, a))); + + for (k = 0; k < ntests; k++) + { + struct timespec c = test[k]; + if (valid (c)) + { + struct timespec sumbc = timespec_add (b, c); + if (! extremal (sumbc)) + ASSERT (eq (timespec_add (a, sumbc), + timespec_add (sum, c))); + } + } + } + if (! extremal (diff)) + ASSERT (eq (a, timespec_add (diff, b))); + if (! extremal (rdiff)) + ASSERT (eq (b, timespec_add (rdiff, a))); + + } + } } return 0; diff --git a/tests/uniwbrk/test-uc-wordbreaks.c b/tests/uniwbrk/test-uc-wordbreaks.c index 7dbb1ec012..30683e565d 100644 --- a/tests/uniwbrk/test-uc-wordbreaks.c +++ b/tests/uniwbrk/test-uc-wordbreaks.c @@ -114,12 +114,12 @@ main (int argc, char *argv[]) p += strspn (p, " \t\r\n"); if (!strncmp (p, "\303\267" /* ÷ */, 2)) { - breaks_expected[i] = 1; + breaks_expected[i] = 1; p += 2; } else if (!strncmp (p, "\303\227" /* × */, 2)) { - breaks_expected[i] = 0; + breaks_expected[i] = 0; p += 2; } else @@ -144,11 +144,11 @@ main (int argc, char *argv[]) } p += n; - input[i] = next_int; - } + input[i] = next_int; + } p += strspn (p, " \t\r\n"); - i++; + i++; } while (*p != '\0'); @@ -157,29 +157,29 @@ main (int argc, char *argv[]) /* u32_wordbreaks always set BREAKS[0] to 0. */ breaks[0] = breaks_expected[0] = 1; if (memcmp (breaks, breaks_expected, i - 1) != 0) - { - int j; - - fprintf (stderr, "%s:%d: expected: ", filename, lineno); - for (j = 0; j < i - 1; j++) - { - int input_wbp = uc_wordbreak_property (input[j]); - fprintf (stderr, "%s U+%04X (%s) ", - breaks_expected[j] == 1 ? "\303\267" : "\303\227", - input[j], wordbreakproperty_to_string (input_wbp)); - } - fprintf (stderr, "\n"); - fprintf (stderr, "%s:%d: actual: ", filename, lineno); - for (j = 0; j < i - 1; j++) - { - int input_wbp = uc_wordbreak_property (input[j]); - fprintf (stderr, "%s U+%04X (%s) ", - breaks[j] == 1 ? "\303\267" : "\303\227", - input[j], wordbreakproperty_to_string (input_wbp)); - } - fprintf (stderr, "\n"); - exit_code = 1; - } + { + int j; + + fprintf (stderr, "%s:%d: expected: ", filename, lineno); + for (j = 0; j < i - 1; j++) + { + int input_wbp = uc_wordbreak_property (input[j]); + fprintf (stderr, "%s U+%04X (%s) ", + breaks_expected[j] == 1 ? "\303\267" : "\303\227", + input[j], wordbreakproperty_to_string (input_wbp)); + } + fprintf (stderr, "\n"); + fprintf (stderr, "%s:%d: actual: ", filename, lineno); + for (j = 0; j < i - 1; j++) + { + int input_wbp = uc_wordbreak_property (input[j]); + fprintf (stderr, "%s U+%04X (%s) ", + breaks[j] == 1 ? "\303\267" : "\303\227", + input[j], wordbreakproperty_to_string (input_wbp)); + } + fprintf (stderr, "\n"); + exit_code = 1; + } } return exit_code;