]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: use GNU style for spacing
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 18 Dec 2021 17:34:31 +0000 (09:34 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 18 Dec 2021 17:35:04 +0000 (09:35 -0800)
39 files changed:
gl/lib/heap.c
gl/lib/mbsalign.c
gl/lib/randperm.c
gl/lib/xdectoint.c
src/basenc.c
src/blake2/blake2.h
src/blake2/blake2b-ref.c
src/chroot.c
src/cksum.c
src/cksum_pclmul.c
src/copy.c
src/coreutils-vdir.c
src/cp.c
src/csplit.c
src/df.c
src/digest.c
src/expand-common.c
src/expr.c
src/factor.c
src/ioblksize.h
src/join.c
src/libstdbuf.c
src/ls.c
src/make-prime-list.c
src/mktemp.c
src/mv.c
src/ptx.c
src/relpath.c
src/rmdir.c
src/seq.c
src/set-fields.c
src/shred.c
src/sleep.c
src/stat.c
src/stty.c
src/sum.h
src/test.c
src/timeout.c
src/touch.c

index 3de3550d5fdc4e1e29384270bdfdf88e62068b82..b0c58ad8d7d7f958b6ef0a4b4371a6a13373a42b 100644 (file)
@@ -118,7 +118,7 @@ heapify_down (void **array, size_t count, size_t initial,
     {
       size_t child = 2 * parent;
 
-      if (child < count && compare (array[child], array[child+1]) < 0)
+      if (child < count && compare (array[child], array[child + 1]) < 0)
         child++;
 
       if (compare (array[child], element) <= 0)
@@ -141,9 +141,9 @@ heapify_up (void **array, size_t count,
   size_t k = count;
   void *new_element = array[k];
 
-  while (k != 1 && compare (array[k/2], new_element) <= 0)
+  while (k != 1 && compare (array[k / 2], new_element) <= 0)
     {
-      array[k] = array[k/2];
+      array[k] = array[k / 2];
       k /= 2;
     }
 
index 0ef9f8d129f061431e2fc111a1f48bed8ac944b6..61a4c2a98a5aad78bc531eddd9205d81cb23ff08 100644 (file)
@@ -82,8 +82,8 @@ wc_truncate (wchar_t *wc, size_t width)
    is always added to DEST.
    A pointer to the terminating NUL is returned.  */
 
-static char*
-mbs_align_pad (char *dest, const chardest_end, size_t n_spaces)
+static char *
+mbs_align_pad (char *dest, const char *dest_end, size_t n_spaces)
 {
   /* FIXME: Should we pad with "figure space" (\u2007)
      if non ascii data present?  */
index bce7a2daf53c2e2df26df678c8fe0f0c10966c98..61f29662d22350f675225ea385e14f4b574ba630 100644 (file)
@@ -118,7 +118,7 @@ sparse_new (size_t size_hint)
    index I in array V.  */
 
 static void
-sparse_swap (sparse_map *sv, size_tv, size_t i, size_t j)
+sparse_swap (sparse_map *sv, size_t *v, size_t i, size_t j)
 {
   struct sparse_ent_ *v1 = hash_remove (sv, &(struct sparse_ent_) {i,0});
   struct sparse_ent_ *v2 = hash_remove (sv, &(struct sparse_ent_) {j,0});
index 04f5c7035a8793f72c558495be8ed70647d9c385..784fb7c6ae7c70fa214818075110dfb512deab59 100644 (file)
@@ -48,10 +48,10 @@ __xnumtoint (char const *n_str, int base, __xdectoint_t min, __xdectoint_t max,
           s_err = LONGINT_OVERFLOW;
           /* Use have the INT range as a heuristic to distinguish
              type overflow rather than other min/max limits.  */
-          if (tnum > INT_MAX/2)
+          if (tnum > INT_MAX / 2)
             errno = EOVERFLOW;
 #if __xdectoint_signed
-          else if (tnum < INT_MIN/2)
+          else if (tnum < INT_MIN / 2)
             errno = EOVERFLOW;
 #endif
           else
index f4ca8726710764576996f96e9a581009919a0039..892112db78840ca34088fea698344d421db7e2d1 100644 (file)
@@ -175,13 +175,13 @@ from any other non-alphabet bytes in the encoded stream.\n"),
   exit (status);
 }
 
-#define ENC_BLOCKSIZE (1024*3*10)
+#define ENC_BLOCKSIZE (1024 * 3 * 10)
 
 #if BASE_TYPE == 32
 # define BASE_LENGTH BASE32_LENGTH
 /* Note that increasing this may decrease performance if --ignore-garbage
    is used, because of the memmove operation below.  */
-# define DEC_BLOCKSIZE (1024*5)
+# define DEC_BLOCKSIZE (1024 * 5)
 
 /* Ensure that BLOCKSIZE is a multiple of 5 and 8.  */
 verify (ENC_BLOCKSIZE % 40 == 0);  /* So padding chars only on last block.  */
@@ -196,7 +196,7 @@ verify (DEC_BLOCKSIZE % 40 == 0);  /* So complete encoded blocks are used.  */
 # define BASE_LENGTH BASE64_LENGTH
 /* Note that increasing this may decrease performance if --ignore-garbage
    is used, because of the memmove operation below.  */
-# define DEC_BLOCKSIZE (1024*3)
+# define DEC_BLOCKSIZE (1024 * 3)
 
 /* Ensure that BLOCKSIZE is a multiple of 3 and 4.  */
 verify (ENC_BLOCKSIZE % 12 == 0);  /* So padding chars only on last block.  */
@@ -310,7 +310,7 @@ base64url_encode (char const *restrict in, idx_t inlen,
 {
   base64_encode (in, inlen, out, outlen);
   /* translate 62nd and 63rd characters */
-  charp = out;
+  char *p = out;
   while (outlen--)
     {
       if (*p == '+')
@@ -346,7 +346,7 @@ base64url_decode_ctx_wrapper (struct base_decode_context *ctx,
 
   /* translate 62nd and 63rd characters */
   idx_t i = inlen;
-  charp = ctx->inbuf;
+  char *p = ctx->inbuf;
   while (i--)
     {
       if (*p == '+' || *p == '/')
@@ -395,7 +395,7 @@ base32_decode_ctx_wrapper (struct base_decode_context *ctx,
 /* ABCDEFGHIJKLMNOPQRSTUVWXYZ234567
      to
    0123456789ABCDEFGHIJKLMNOPQRSTUV */
-static const char base32_norm_to_hex[32+9] = {
+static const char base32_norm_to_hex[32 + 9] = {
 /*0x32, 0x33, 0x34, 0x35, 0x36, 0x37, */
   'Q',  'R',  'S',  'T',  'U',  'V',
 
@@ -417,7 +417,7 @@ static const char base32_norm_to_hex[32+9] = {
 /* 0123456789ABCDEFGHIJKLMNOPQRSTUV
      to
    ABCDEFGHIJKLMNOPQRSTUVWXYZ234567 */
-static const char base32_hex_to_norm[32+9] = {
+static const char base32_hex_to_norm[32 + 9] = {
   /* from: 0x30 .. 0x39 ('0' to '9') */
   /* to:*/ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
 
@@ -581,7 +581,7 @@ static int
 z85_length (int len)
 {
   /* Z85 does not allow padding, so no need to round to highest integer.  */
-  int outlen = (len*5)/4;
+  int outlen = (len * 5) / 4;
   return outlen;
 }
 
@@ -1209,7 +1209,7 @@ main (int argc, char **argv)
 
   if (argc - optind > 1)
     {
-      error (0, 0, _("extra operand %s"), quote (argv[optind+1]));
+      error (0, 0, _("extra operand %s"), quote (argv[optind + 1]));
       usage (EXIT_FAILURE);
     }
 
index e56879ac2b341faf05183a7bbdebf781d1562853..be8b176d7e1d05faedabdb49bd59fa06a4cc7e02 100644 (file)
@@ -139,8 +139,8 @@ extern "C" {
 
   /* Padded structs result in a compile-time error */
   enum {
-    BLAKE2_DUMMY_1 = 1/(sizeof(blake2s_param) == BLAKE2S_OUTBYTES),
-    BLAKE2_DUMMY_2 = 1/(sizeof(blake2b_param) == BLAKE2B_OUTBYTES)
+    BLAKE2_DUMMY_1 = 1 / (sizeof (blake2s_param) == BLAKE2S_OUTBYTES),
+    BLAKE2_DUMMY_2 = 1 / (sizeof (blake2b_param) == BLAKE2B_OUTBYTES)
   };
 
   /* Streaming API */
index 74cbf1fb410f44b9fedb879871b6f254e448e624..436edca428024daa50c319f9feddead725b8792d 100644 (file)
@@ -156,11 +156,11 @@ int blake2b_init_key( blake2b_state *S, size_t outlen, const void *key, size_t k
 
 #define G(r,i,a,b,c,d)                      \
   do {                                      \
-    a = a + b + m[blake2b_sigma[r][2*i+0]]; \
+    a = a + b + m[blake2b_sigma[r][2 * i + 0]]; \
     d = rotr64(d ^ a, 32);                  \
     c = c + d;                              \
     b = rotr64(b ^ c, 24);                  \
-    a = a + b + m[blake2b_sigma[r][2*i+1]]; \
+    a = a + b + m[blake2b_sigma[r][2 * i + 1]]; \
     d = rotr64(d ^ a, 16);                  \
     c = c + d;                              \
     b = rotr64(b ^ c, 63);                  \
index e5aa7c0b2cc25515b8f42f57014d04e00411c407..fcfe45eda0118345433827c493553b96c273331b 100644 (file)
@@ -169,7 +169,7 @@ parse_additional_groups (char const *groups, GETGROUPS_T **pgids,
    could be bind mounted to a separate location.  */
 
 static bool
-is_root (const chardir)
+is_root (const char *dir)
 {
   char *resolved = canonicalize_file_name (dir);
   bool is_res_root = resolved && STREQ ("/", resolved);
index 2209807cb39062a116ff17fb3b7af822b6018336..6f49f915e1984fd307b4c5e62e2126dab30e1d53 100644 (file)
@@ -192,7 +192,7 @@ pclmul_supported (void)
 static bool
 cksum_slice8 (FILE *fp, uint_fast32_t *crc_out, uintmax_t *length_out)
 {
-  uint32_t buf[BUFLEN/sizeof (uint32_t)];
+  uint32_t buf[BUFLEN / sizeof (uint32_t)];
   uint_fast32_t crc = 0;
   uintmax_t length = 0;
   size_t bytes_read;
index d0e5ecc514190a399ecdc815f0060dd266cfb50b..bff660052e4ac88777adc59dbf452a0ad9a990c8 100644 (file)
@@ -86,7 +86,7 @@ cksum_pclmul (FILE *fp, uint_fast32_t *crc_out, uintmax_t *length_out)
       datap = (__m128i *)buf;
 
       /* Fold in parallel eight 16-byte blocks into four 16-byte blocks */
-      if (bytes_read >= 16*8)
+      if (bytes_read >= 16 * 8)
         {
           data = _mm_loadu_si128 (datap);
           data = _mm_shuffle_epi8 (data, shuffle_constant);
@@ -95,15 +95,15 @@ cksum_pclmul (FILE *fp, uint_fast32_t *crc_out, uintmax_t *length_out)
           xor_crc = _mm_set_epi32 (crc, 0, 0, 0);
           crc = 0;
           data = _mm_xor_si128 (data, xor_crc);
-          data3 = _mm_loadu_si128 (datap+1);
+          data3 = _mm_loadu_si128 (datap + 1);
           data3 = _mm_shuffle_epi8 (data3, shuffle_constant);
-          data5 = _mm_loadu_si128 (datap+2);
+          data5 = _mm_loadu_si128 (datap + 2);
           data5 = _mm_shuffle_epi8 (data5, shuffle_constant);
-          data7 = _mm_loadu_si128 (datap+3);
+          data7 = _mm_loadu_si128 (datap + 3);
           data7 = _mm_shuffle_epi8 (data7, shuffle_constant);
 
 
-          while (bytes_read >= 16*8)
+          while (bytes_read >= 16 * 8)
             {
               datap += 4;
 
@@ -128,17 +128,17 @@ cksum_pclmul (FILE *fp, uint_fast32_t *crc_out, uintmax_t *length_out)
               data = _mm_xor_si128 (data, data2);
 
               data3 = _mm_xor_si128 (data3, data4);
-              data4 = _mm_loadu_si128 (datap+1);
+              data4 = _mm_loadu_si128 (datap + 1);
               data4 = _mm_shuffle_epi8 (data4, shuffle_constant);
               data3 = _mm_xor_si128 (data3, data4);
 
               data5 = _mm_xor_si128 (data5, data6);
-              data6 = _mm_loadu_si128 (datap+2);
+              data6 = _mm_loadu_si128 (datap + 2);
               data6 = _mm_shuffle_epi8 (data6, shuffle_constant);
               data5 = _mm_xor_si128 (data5, data6);
 
               data7 = _mm_xor_si128 (data7, data8);
-              data8 = _mm_loadu_si128 (datap+3);
+              data8 = _mm_loadu_si128 (datap + 3);
               data8 = _mm_shuffle_epi8 (data8, shuffle_constant);
               data7 = _mm_xor_si128 (data7, data8);
 
@@ -149,11 +149,11 @@ cksum_pclmul (FILE *fp, uint_fast32_t *crc_out, uintmax_t *length_out)
           data = _mm_shuffle_epi8 (data, shuffle_constant);
           _mm_storeu_si128 (datap, data);
           data3 = _mm_shuffle_epi8 (data3, shuffle_constant);
-          _mm_storeu_si128 (datap+1, data3);
+          _mm_storeu_si128 (datap + 1, data3);
           data5 = _mm_shuffle_epi8 (data5, shuffle_constant);
-          _mm_storeu_si128 (datap+2, data5);
+          _mm_storeu_si128 (datap + 2, data5);
           data7 = _mm_shuffle_epi8 (data7, shuffle_constant);
-          _mm_storeu_si128 (datap+3, data7);
+          _mm_storeu_si128 (datap + 3, data7);
         }
 
       /* Fold two 16-byte blocks into one 16-byte block */
index 0f9aa524474789bd33ea0f7f04ed238218600bda..f6ac94ba8517aebe579e773029caa74e56555480 100644 (file)
@@ -301,7 +301,7 @@ functional_copy_file_range (void)
    print a diagnostic and return false upon error.
    Note that for best results, BUF should be "well"-aligned.
    BUF must have sizeof(uintptr_t)-1 bytes of additional space
-   beyond BUF[BUF_SIZE-1].
+   beyond BUF[BUF_SIZE - 1].
    Set *LAST_WRITE_MADE_HOLE to true if the final operation on
    DEST_FD introduced a hole.  Set *TOTAL_N_READ to the number of
    bytes read.  */
index 544f70d037cc305b08ffda5be0b0a2fcd25817c1..5e1a1bc9707c39ad3ae901537757f771d0e62de1 100644 (file)
@@ -26,7 +26,7 @@ int single_binary_main_ls (int argc, char **argv);
 int single_binary_main_vdir (int argc, char **argv);
 
 int
-single_binary_main_vdir (int argc, char** argv)
+single_binary_main_vdir (int argc, char **argv)
 {
   ls_mode = LS_LONG_FORMAT;
   return single_binary_main_ls (argc, argv);
index c97a675631a359e26eeb6076d685b74aa588e1dd..ae73160f997b723bdd59bfa1f5989b711c007b5c 100644 (file)
--- a/src/cp.c
+++ b/src/cp.c
@@ -857,7 +857,7 @@ decode_preserve_arg (char const *arg, struct cp_options *x, bool on_off)
       PRESERVE_ALL
     };
   /* Valid arguments to the '--preserve' option. */
-  static char constconst preserve_args[] =
+  static char const *const preserve_args[] =
     {
       "mode", "timestamps",
       "ownership", "links", "context", "xattr", "all", NULL
index be356df674b369c227be6df7bf3411e3e1c93a36..50ff5fbf693eb6be2444369c9977c08367ca805a 100644 (file)
@@ -1104,7 +1104,7 @@ parse_repeat_count (int argnum, struct control *p, char *str)
          quote (str));
   *end = '\0';
 
-  if (str+1 == end-1 && *(str+1) == '*')
+  if (str + 1 == end - 1 && *(str + 1) == '*')
     p->repeat_forever = true;
   else
     {
index 4689493821bb553dfa5d0cd0f6a094bbb37b1a02..dfc132c4680875d0f0b7eb9ad7e880628f9df3cb 100644 (file)
--- a/src/df.c
+++ b/src/df.c
@@ -1028,7 +1028,7 @@ add_to_grand_total (struct field_values_t *bv, struct field_values_t *iv)
    when df is invoked with no non-option argument.  See below for details.  */
 
 static void
-get_dev (char const *device, char const *mount_point, char constfile,
+get_dev (char const *device, char const *mount_point, char const *file,
          char const *stat_file, char const *fstype,
          bool me_dummy, bool me_remote,
          const struct fs_usage *force_fsu,
@@ -1282,7 +1282,7 @@ get_dev (char const *device, char const *mount_point, char const* file,
 /* Scan the mount list returning the _last_ device found for MOUNT.
    NULL is returned if MOUNT not found.  The result is malloced.  */
 static char *
-last_device_for_mount (char constmount)
+last_device_for_mount (char const *mount)
 {
   struct mount_entry const *me;
   struct mount_entry const *le = NULL;
index 85e2909b4b8cafee569debb6ed33189e7191265c..22e8622850d5aa4cbd0b1fdecd7c8ebecc82b81d 100644 (file)
@@ -209,7 +209,7 @@ static unsigned char digest_delim = '\n';
 static uintmax_t digest_length;
 #endif /* HASH_ALGO_BLAKE2 */
 
-typedef void (*digest_output_fn)(char const*, int, void const*,
+typedef void (*digest_output_fn)(char const *, int, void const *,
                                  bool, unsigned char, bool, uintmax_t);
 #if HASH_ALGO_SUM
 enum Algorithm
@@ -725,7 +725,7 @@ split_3 (char *s, size_t s_len,
 #if HASH_ALGO_CKSUM
   if (! algorithm_specified)
     {
-      ptrdiff_t algo_tag = algorithm_from_tag (s+i);
+      ptrdiff_t algo_tag = algorithm_from_tag (s + i);
       if (algo_tag >= 0)
         {
           if (algo_tag <= crc)
@@ -1270,15 +1270,15 @@ main (int argc, char **argv)
   setvbuf (stdout, NULL, _IOLBF, 0);
 
 #if HASH_ALGO_SUM
-  const charshort_opts = "rs";
+  const char *short_opts = "rs";
 #elif HASH_ALGO_CKSUM
-  const charshort_opts = "a:l:bctwz";
-  const chardigest_length_str = "";
+  const char *short_opts = "a:l:bctwz";
+  const char *digest_length_str = "";
 #elif HASH_ALGO_BLAKE2
-  const charshort_opts = "l:bctwz";
-  const chardigest_length_str = "";
+  const char *short_opts = "l:bctwz";
+  const char *digest_length_str = "";
 #else
-  const charshort_opts = "bctwz";
+  const char *short_opts = "bctwz";
 #endif
 
   while ((opt = getopt_long (argc, argv, short_opts, long_options, NULL)) != -1)
index 4deb7bd8a6de1332027c34f7e9f5a7bc91f2c311..33bdebf08a00b05d34c0095f4f0f5efa7f89a0fa 100644 (file)
@@ -275,8 +275,8 @@ finalize_tab_stops (void)
 
 
 extern uintmax_t
-get_next_tab_column (const uintmax_t column, size_ttab_index,
-                     boollast_tab)
+get_next_tab_column (const uintmax_t column, size_t *tab_index,
+                     bool *last_tab)
 {
   *last_tab = false;
 
index e60fb70dc10ac2aa7a6f53f0c7a06242eb90fa34..86e35492999aeafe0026993f03dad277f47c3afa 100644 (file)
@@ -558,7 +558,7 @@ require_more_args (void)
 {
   if (nomoreargs ())
     die (EXPR_INVALID, 0, _("syntax error: missing argument after %s"),
-         quotearg_n_style (0, locale_quoting_style, *(args-1)));
+         quotearg_n_style (0, locale_quoting_style, *(args - 1)));
 }
 
 
@@ -674,7 +674,7 @@ eval7 (bool evaluate)
       v = eval (evaluate);
       if (nomoreargs ())
         die (EXPR_INVALID, 0, _("syntax error: expecting ')' after %s"),
-             quotearg_n_style (0, locale_quoting_style, *(args-1)));
+             quotearg_n_style (0, locale_quoting_style, *(args - 1)));
       if (!nextarg (")"))
         die (EXPR_INVALID, 0, _("syntax error: expecting ')' instead of %s"),
              quotearg_n_style (0, locale_quoting_style, *args));
index 7fc30717a781ff924569272c195b89759322e24e..b79a3b855b0f5fec0589d439312cdec2fac00d25 100644 (file)
@@ -949,7 +949,7 @@ static const unsigned char  binvert_table[128] =
     else                                                                \
       {                                                                 \
         _r1 = 0; _r0 = (x);                                             \
-        _i = 2*W_TYPE_SIZE;                                             \
+        _i = 2 * W_TYPE_SIZE;                                           \
       }                                                                 \
     while (_i-- > 0)                                                    \
       {                                                                 \
@@ -1775,7 +1775,7 @@ isqrt (uintmax_t n)
 
   for (;;)
     {
-      uintmax_t y = (x + n/x) / 2;
+      uintmax_t y = (x + n / x) / 2;
       if (y >= x)
         return x;
 
@@ -1849,7 +1849,7 @@ is_square (uintmax_t x)
       && ((MAGIC11 >> (x % 11) & 1)))
     {
       uintmax_t r = isqrt (x);
-      if (r*r == x)
+      if (r * r == x)
         return r;
     }
   return 0;
@@ -1897,7 +1897,7 @@ static const unsigned short invtab[0x81] =
             _dinv = invtab[((d) >> (W_TYPE_SIZE - 8 - _cnt)) - 0x7f];   \
             _q = _dinv * (_r >> (W_TYPE_SIZE - 3 - _cnt)) >> 11;        \
           }                                                             \
-        _r -= _q*(d);                                                   \
+        _r -= _q * (d);                                                 \
                                                                         \
         _mask = -(uintmax_t) (_r >= (d));                               \
         (r) = _r - (_mask & (d));                                       \
@@ -1913,11 +1913,11 @@ static const unsigned short invtab[0x81] =
   } while (0)
 
 /* Notes: Example N = 22117019.  After first phase we find Q1 = 6314, Q
-   = 3025, P = 1737, representing F_{18} = (-6314, 2* 1737, 3025),
+   = 3025, P = 1737, representing F_{18} = (-6314, 2 * 1737, 3025),
    with 3025 = 55^2.
 
    Constructing the square root, we get Q1 = 55, Q = 8653, P = 4652,
-   representing G_0 = (-55, 2*4652, 8653).
+   representing G_0 = (-55, 2 * 4652, 8653).
 
    In the notation of the paper:
 
@@ -2011,7 +2011,7 @@ factor_using_squfof (uintmax_t n1, uintmax_t n0, struct factors *factors)
                 }
               /* Duplicate the new factors */
               for (unsigned int i = 0; i < f.nfactors; i++)
-                factor_insert_multiplicity (factors, f.p[i], 2*f.e[i]);
+                factor_insert_multiplicity (factors, f.p[i], 2 * f.e[i]);
             }
           return true;
         }
@@ -2040,7 +2040,7 @@ factor_using_squfof (uintmax_t n1, uintmax_t n0, struct factors *factors)
          Requiring 64 mu^3 < n seems sufficient.  */
       if (n1 == 0)
         {
-          if ((uintmax_t) mu*mu*mu >= n0 / 64)
+          if ((uintmax_t) mu * mu * mu >= n0 / 64)
             continue;
         }
       else
@@ -2060,10 +2060,10 @@ factor_using_squfof (uintmax_t n1, uintmax_t n0, struct factors *factors)
       P = S;
 
       /* Square root remainder fits in one word, so ignore high part.  */
-      Q = Dl - P*P;
+      Q = Dl - P * P;
       /* FIXME: When can this differ from floor (sqrt (2 * sqrt (D)))?  */
-      L = isqrt (2*S);
-      B = 2*L;
+      L = isqrt (2 * S);
+      B = 2 * L;
       L1 = mu * 2 * L;
 
       /* The form is (+/- Q1, 2P, -/+ Q), of discriminant 4 (P^2 + Q Q1) =
@@ -2073,7 +2073,7 @@ factor_using_squfof (uintmax_t n1, uintmax_t n0, struct factors *factors)
         {
           uintmax_t q, P1, t, rem;
 
-          div_smallq (q, rem, S+P, Q);
+          div_smallq (q, rem, S + P, Q);
           P1 = S - rem; /* P1 = q*Q - P */
 
           IF_LINT (assert (q > 0 && Q > 0));
@@ -2162,7 +2162,7 @@ factor_using_squfof (uintmax_t n1, uintmax_t n0, struct factors *factors)
                          floor([S+P]/\hat Q), but looking at the equations
                          in Sec. 3.1, it should be q <-- floor([S+P] / Q).
                          (In this code, \hat Q is Q1).  */
-                      div_smallq (q, rem, S+P, Q);
+                      div_smallq (q, rem, S + P, Q);
                       P1 = S - rem;     /* P1 = q*Q - P */
 
 # if STAT_SQUFOF
index 5d359d642ed8d9a8c371ca064de3307c7ef07d12..cb59b0a8a191cffd1f7959692accf09ec8f666b5 100644 (file)
@@ -70,7 +70,7 @@
    In the future we could use the above method if available
    and default to io_blksize() if not.
  */
-enum { IO_BUFSIZE = 128*1024 };
+enum { IO_BUFSIZE = 128 * 1024 };
 static inline size_t
 io_blksize (struct stat sb)
 {
index f22ffda53069995cb4853e472117001c1a689b04..4d88630e84555ccb3b99b6405235c7c83404dd54 100644 (file)
@@ -398,7 +398,7 @@ check_order (const struct line *prev,
   if (check_input_order != CHECK_ORDER_DISABLED
       && ((check_input_order == CHECK_ORDER_ENABLED) || seen_unpairable))
     {
-      if (!issued_disorder_warning[whatfile-1])
+      if (!issued_disorder_warning[whatfile - 1])
         {
           size_t join_field = whatfile == 1 ? join_field_1 : join_field_2;
           if (keycmp (prev, current, join_field, join_field) > 0)
@@ -420,7 +420,7 @@ check_order (const struct line *prev,
 
               /* If we get to here, the message was merely a warning.
                  Arrange to issue it only once per file.  */
-              issued_disorder_warning[whatfile-1] = true;
+              issued_disorder_warning[whatfile - 1] = true;
             }
         }
     }
index e7642aebea2a5ee882c913f63da30f2d933ea828..900c74570339f3250de6ccc8ff83998b0453ebdd 100644 (file)
@@ -32,7 +32,7 @@
    the buffer size, and more problematically does not give any indication
    that the new size request was ignored:
 
-       setvbuf (stdout, (char*)NULL, _IOFBF, 8192);
+       setvbuf (stdout, NULL, _IOFBF, 8192);
 
    The ISO C99 standard section 7.19.5.6 on the setvbuf function says:
 
index 77d94072b1836b0f8a6f50f0b955b6e4c629ac5e..36ab42aad281aa0f9f3806644a7da23844630961 100644 (file)
--- a/src/ls.c
+++ b/src/ls.c
@@ -3312,7 +3312,7 @@ has_capability_cache (char const *file, struct fileinfo *f)
 }
 
 static bool
-needs_quoting (char constname)
+needs_quoting (char const *name)
 {
   char test[2];
   size_t len = quotearg_buffer (test, sizeof test , name, -1,
@@ -4809,7 +4809,7 @@ print_name_with_quoting (const struct fileinfo *f,
                          struct obstack *stack,
                          size_t start_col)
 {
-  const charname = symlink_target ? f->linkname : f->name;
+  const char *name = symlink_target ? f->linkname : f->name;
 
   const struct bin_str *color = print_with_color ?
                                 get_color_indicator (f, symlink_target) : NULL;
@@ -4953,7 +4953,7 @@ get_color_indicator (const struct fileinfo *f, bool symlink_target)
   struct color_ext_type *ext;  /* Color extension */
   size_t len;                  /* Length of name */
 
-  const charname;
+  const char *name;
   mode_t mode;
   int linkok;
   if (symlink_target)
index 579d3d89e8257f7a91bcfbc6d33ef82da14cb218..70e4964746d7d3977d70db98fdb29c2d03de52a6 100644 (file)
@@ -60,10 +60,10 @@ ATTRIBUTE_CONST
 static wide_uint
 binvert (wide_uint a)
 {
-  wide_uint x = 0xf5397db1 >> (4*((a/2) & 0x7));
+  wide_uint x = 0xf5397db1 >> (4 * ((a / 2) & 0x7));
   for (;;)
     {
-      wide_uint y = 2*x - x*x*a;
+      wide_uint y = 2 * x - x * x * a;
       if (y == x)
         return x;
       x = y;
@@ -198,7 +198,7 @@ main (int argc, char **argv)
   if ( !(limit & 1))
     limit--;
 
-  size = (limit-1)/2;
+  size = (limit - 1) / 2;
   /* sieve[i] represents 3+2*i */
   sieve = xalloc (size);
   memset (sieve, 1, size);
@@ -208,12 +208,12 @@ main (int argc, char **argv)
 
   for (i = 0; i < size;)
     {
-      unsigned p = 3+2*i;
+      unsigned p = 3 + 2 * i;
       unsigned j;
 
       process_prime (&prime_list[nprimes++], p);
 
-      for (j = (p*p - 3)/2; j < size; j+= p)
+      for (j = (p * p - 3) / 2; j < size; j += p)
         sieve[j] = 0;
 
       while (++i < size && sieve[i] == 0)
index c1344ca7cbfd0fcdde8f7db69b627f8950124943..49c32639a292cf946b2a6f57fc26e6b18e818696 100644 (file)
@@ -107,7 +107,7 @@ static size_t
 count_consecutive_X_s (char const *s, size_t len)
 {
   size_t n = 0;
-  for ( ; len && s[len-1] == 'X'; len--)
+  for ( ; len && s[len - 1] == 'X'; len--)
     ++n;
   return n;
 }
index 7d81b59a7dd764a5a555adbecc1486558782ee73..2b782671f1c5babdb1f403ace8475e654aca3b77 100644 (file)
--- a/src/mv.c
+++ b/src/mv.c
@@ -235,7 +235,7 @@ do_move (char const *source, char const *dest, const struct cp_options *x)
           dir[0] = dir_to_remove;
           dir[1] = NULL;
 
-          status = rm ((void*) dir, &rm_options);
+          status = rm ((void *) dir, &rm_options);
           assert (VALID_STATUS (status));
           if (status == RM_ERROR)
             ok = false;
index 497767fd5a34dfcaefd4c881da51e460b8c028c0..9cab2cdc36823a8daa4126860793fa08761c6510 100644 (file)
--- a/src/ptx.c
+++ b/src/ptx.c
@@ -1786,7 +1786,7 @@ static struct option const long_options[] =
   {NULL, 0, NULL, 0},
 };
 
-static char constconst format_args[] =
+static char const *const format_args[] =
 {
   "roff", "tex", NULL
 };
index 6a5275f78d5b6034307bde507a86431a0667dd3e..2798f6385924a3bc289435410d09bc6bfcb90b4b 100644 (file)
@@ -64,7 +64,7 @@ path_common_prefix (char const *path1, char const *path2)
    and adjust *PLEN to reflect the remaining space.
    Return TRUE on failure.  */
 static bool
-buffer_or_output (const charstr, char **pbuf, size_t *plen)
+buffer_or_output (const char *str, char **pbuf, size_t *plen)
 {
   if (*pbuf)
     {
index c6e2aba0f2f00bc1662890830878d810a708dc58..77f08cbfb193e2bbf5485bf0d05d1b9b0a7b0f74 100644 (file)
@@ -144,7 +144,7 @@ remove_parents (char *dir)
             }
           else
             {
-              char consterror_msg;
+              char const *error_msg;
               if (rmdir_errno != ENOTDIR)
                 {
                   /* Barring race conditions,
@@ -266,7 +266,7 @@ main (int argc, char **argv)
                       || (ret == 0 && S_ISDIR (st.st_mode)))
                     {
                       /* Ensure the last component was a symlink.  */
-                      chardir_arg = xstrdup (dir);
+                      char *dir_arg = xstrdup (dir);
                       strip_trailing_slashes (dir);
                       ret = lstat (dir, &st);
                       if (ret == 0 && S_ISLNK (st.st_mode))
index 1032b548b6d1e7d1fa4973343a1ac917474d17bb..2774492a4372a2ba31a864231f8c54c6b49cf0ab 100644 (file)
--- a/src/seq.c
+++ b/src/seq.c
@@ -693,7 +693,7 @@ main (int argc, char **argv)
           if (step.value == 0)
             {
               error (0, 0, _("invalid Zero increment value: %s"),
-                     quote (argv[optind-1]));
+                     quote (argv[optind - 1]));
               usage (EXIT_FAILURE);
             }
 
index a214ff21e1e7a5e7a6303ca0721b343d15f45fb7..611f208d8b0602b0eff01474f4fc5418905e0298 100644 (file)
@@ -82,14 +82,14 @@ complement_rp (void)
 
   for (size_t i = 1; i < n; ++i)
     {
-      if (c[i-1].hi + 1 == c[i].lo)
+      if (c[i - 1].hi + 1 == c[i].lo)
         continue;
 
-      add_range_pair (c[i-1].hi + 1, c[i].lo - 1);
+      add_range_pair (c[i - 1].hi + 1, c[i].lo - 1);
     }
 
-  if (c[n-1].hi < UINTMAX_MAX)
-    add_range_pair (c[n-1].hi + 1, UINTMAX_MAX);
+  if (c[n - 1].hi < UINTMAX_MAX)
+    add_range_pair (c[n - 1].hi + 1, UINTMAX_MAX);
 
   free (c);
 }
index ca7835512ea32139b0ee2cbb72478137617f440a..adc6de1b61313c177c62c9b9b31adbcb4649628a 100644 (file)
@@ -770,7 +770,7 @@ genpattern (int *dest, size_t num, struct randint_source *s)
         }
     }
   top = num - randpasses;      /* Top of initialized data */
-  /* assert (d == dest+top); */
+  /* assert (d == dest + top); */
 
   /*
    * We now have fixed patterns in the dest buffer up to
index 2d3e26bbaad209300a4e7819bef69bdc40e6169b..9b2b6dd61fd34016efdaaf546f44ef71b40012cc 100644 (file)
@@ -125,7 +125,7 @@ main (int argc, char **argv)
           /* Nonnegative interval.  */
           || ! (0 <= s)
           /* No extra chars after the number and an optional s,m,h,d char.  */
-          || (*p && *(p+1))
+          || (*p && *(p + 1))
           /* Check any suffix char and update S based on the suffix.  */
           || ! apply_suffix (&s, *p))
         {
index 7849b54dc27eae0ac0026d7fbfd5074ff27a660c..9ca175e78ab3de5001bb650fe91056af7d96e9b0 100644 (file)
@@ -1115,7 +1115,7 @@ print_esc_char (char c)
 
 ATTRIBUTE_PURE
 static size_t
-format_code_offset (char constdirective)
+format_code_offset (char const *directive)
 {
   size_t len = strspn (directive + 1, printf_flags);
   char const *fmt_char = directive + len + 1;
index fa5a0dc546b6c8a3b40bfbfcbe53ec0c8d73f251..ee61d37811138d761a12ca1a3132564a0a411958 100644 (file)
@@ -1090,7 +1090,7 @@ apply_settings (bool checking, char const *device_name,
 #define check_argument(arg)                                            \
   do                                                                   \
     {                                                                  \
-      if (k == n_settings - 1 || ! settings[k+1])                      \
+      if (k == n_settings - 1 || ! settings[k + 1])                    \
         {                                                              \
           error (0, 0, _("missing argument to %s"), quote (arg));      \
           usage (EXIT_FAILURE);                                                \
index 7e46b871ce7bef849d65f8ca340732e23df1c79c..e1cf8a706dccd12fee22f6177f3f2a954b381f68 100644 (file)
--- a/src/sum.h
+++ b/src/sum.h
@@ -4,7 +4,7 @@ bsd_sum_stream (FILE *stream, void *resstream, uintmax_t *length);
 extern int
 sysv_sum_stream (FILE *stream, void *resstream, uintmax_t *length);
 
-typedef int (*sumfn)(FILE *, void *, uintmax_t*);
+typedef int (*sumfn)(FILE *, void *, uintmax_t *);
 
 
 extern void
index 79dc8d2133af2ffe4831fc3ddc30dc9d40053dbc..00393ddd3ba499492880f9567fd73bd495ff98a8 100644 (file)
@@ -628,7 +628,7 @@ three_arguments (void)
   else if (STREQ (argv[pos + 1], "-a") || STREQ (argv[pos + 1], "-o"))
     value = expr ();
   else
-    test_syntax_error (_("%s: binary operator expected"), quote (argv[pos+1]));
+    test_syntax_error (_("%s: binary operator expected"), quote (argv[pos + 1]));
   return (value);
 }
 
index 65056346172b918c10b7b9542991cbb3ada162c6..0eb178723982246b1d5407b1cdb27e28ac1e1a2e 100644 (file)
@@ -84,7 +84,7 @@ static double kill_after;
 static bool foreground;      /* whether to use another program group.  */
 static bool preserve_status; /* whether to use a timeout status or not.  */
 static bool verbose;         /* whether to diagnose timeouts or not.  */
-static char constcommand;
+static char const *command;
 
 /* for long options with no corresponding short option, use enum */
 enum
index 46ddd86bb9ddd1814cf82d3e8332803ae94e3f67..65606564f71b0e779553431745ed2cf0eaa2e2b9 100644 (file)
@@ -94,7 +94,7 @@ static struct option const longopts[] =
 };
 
 /* Valid arguments to the '--time' option. */
-static char constconst time_args[] =
+static char const *const time_args[] =
 {
   "atime", "access", "use", "mtime", "modify", NULL
 };