mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-17 18:02:09 +03:00
maint: use GNU style for spacing
This commit is contained in:
1 parent
3bf118dad0
commit
8621e44cda
39 files changed
+96
-96
No files matched your search
+3
-3
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -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 char* dest_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? */
|
||||
|
||||
+1
-1
@@ -118,7 +118,7 @@ sparse_new (size_t size_hint)
|
||||
index I in array V. */
|
||||
|
||||
static void
|
||||
sparse_swap (sparse_map *sv, size_t* v, 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});
|
||||
|
||||
+2
-2
@@ -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
|
||||
|
||||
+9
-9
@@ -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 */
|
||||
char* p = 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;
|
||||
char* p = 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);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -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 */
|
||||
|
||||
@@ -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); \
|
||||
|
||||
+1
-1
@@ -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 char* dir)
|
||||
is_root (const char *dir)
|
||||
{
|
||||
char *resolved = canonicalize_file_name (dir);
|
||||
bool is_res_root = resolved && STREQ ("/", resolved);
|
||||
|
||||
+1
-1
@@ -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;
|
||||
|
||||
+11
-11
@@ -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 */
|
||||
|
||||
+1
-1
@@ -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. */
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 const* const preserve_args[] =
|
||||
static char const *const preserve_args[] =
|
||||
{
|
||||
"mode", "timestamps",
|
||||
"ownership", "links", "context", "xattr", "all", NULL
|
||||
|
||||
+1
-1
@@ -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
|
||||
{
|
||||
|
||||
@@ -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 const* file,
|
||||
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 const* mount)
|
||||
last_device_for_mount (char const *mount)
|
||||
{
|
||||
struct mount_entry const *me;
|
||||
struct mount_entry const *le = NULL;
|
||||
|
||||
+8
-8
@@ -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 char* short_opts = "rs";
|
||||
const char *short_opts = "rs";
|
||||
#elif HASH_ALGO_CKSUM
|
||||
const char* short_opts = "a:l:bctwz";
|
||||
const char* digest_length_str = "";
|
||||
const char *short_opts = "a:l:bctwz";
|
||||
const char *digest_length_str = "";
|
||||
#elif HASH_ALGO_BLAKE2
|
||||
const char* short_opts = "l:bctwz";
|
||||
const char* digest_length_str = "";
|
||||
const char *short_opts = "l:bctwz";
|
||||
const char *digest_length_str = "";
|
||||
#else
|
||||
const char* short_opts = "bctwz";
|
||||
const char *short_opts = "bctwz";
|
||||
#endif
|
||||
|
||||
while ((opt = getopt_long (argc, argv, short_opts, long_options, NULL)) != -1)
|
||||
|
||||
+2
-2
@@ -275,8 +275,8 @@ finalize_tab_stops (void)
|
||||
|
||||
|
||||
extern uintmax_t
|
||||
get_next_tab_column (const uintmax_t column, size_t* tab_index,
|
||||
bool* last_tab)
|
||||
get_next_tab_column (const uintmax_t column, size_t *tab_index,
|
||||
bool *last_tab)
|
||||
{
|
||||
*last_tab = false;
|
||||
|
||||
|
||||
+2
-2
@@ -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));
|
||||
|
||||
+13
-13
@@ -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
|
||||
|
||||
+1
-1
@@ -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)
|
||||
{
|
||||
|
||||
+2
-2
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -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:
|
||||
|
||||
|
||||
@@ -3312,7 +3312,7 @@ has_capability_cache (char const *file, struct fileinfo *f)
|
||||
}
|
||||
|
||||
static bool
|
||||
needs_quoting (char const* name)
|
||||
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 char* name = 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 char* name;
|
||||
const char *name;
|
||||
mode_t mode;
|
||||
int linkok;
|
||||
if (symlink_target)
|
||||
|
||||
@@ -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)
|
||||
|
||||
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1786,7 +1786,7 @@ static struct option const long_options[] =
|
||||
{NULL, 0, NULL, 0},
|
||||
};
|
||||
|
||||
static char const* const format_args[] =
|
||||
static char const *const format_args[] =
|
||||
{
|
||||
"roff", "tex", NULL
|
||||
};
|
||||
|
||||
+1
-1
@@ -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 char* str, char **pbuf, size_t *plen)
|
||||
buffer_or_output (const char *str, char **pbuf, size_t *plen)
|
||||
{
|
||||
if (*pbuf)
|
||||
{
|
||||
|
||||
+2
-2
@@ -144,7 +144,7 @@ remove_parents (char *dir)
|
||||
}
|
||||
else
|
||||
{
|
||||
char const* error_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. */
|
||||
char* dir_arg = xstrdup (dir);
|
||||
char *dir_arg = xstrdup (dir);
|
||||
strip_trailing_slashes (dir);
|
||||
ret = lstat (dir, &st);
|
||||
if (ret == 0 && S_ISLNK (st.st_mode))
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -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);
|
||||
}
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
+1
-1
@@ -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))
|
||||
{
|
||||
|
||||
+1
-1
@@ -1115,7 +1115,7 @@ print_esc_char (char c)
|
||||
|
||||
ATTRIBUTE_PURE
|
||||
static size_t
|
||||
format_code_offset (char const* directive)
|
||||
format_code_offset (char const *directive)
|
||||
{
|
||||
size_t len = strspn (directive + 1, printf_flags);
|
||||
char const *fmt_char = directive + len + 1;
|
||||
|
||||
+1
-1
@@ -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); \
|
||||
|
||||
@@ -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
|
||||
|
||||
+1
-1
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -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 const* command;
|
||||
static char const *command;
|
||||
|
||||
/* for long options with no corresponding short option, use enum */
|
||||
enum
|
||||
|
||||
+1
-1
@@ -94,7 +94,7 @@ static struct option const longopts[] =
|
||||
};
|
||||
|
||||
/* Valid arguments to the '--time' option. */
|
||||
static char const* const time_args[] =
|
||||
static char const *const time_args[] =
|
||||
{
|
||||
"atime", "access", "use", "mtime", "modify", NULL
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user