mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-17 18:02:09 +03:00
maint: use "char const *" rather than "const char *"
* cfg.mk (sc_prohibit-const-char): Add a new syntax-check to enforce this style. * *.[ch]: sed -i 's/const char \*/char const */g'
This commit is contained in:
1 parent
34ed19eed8
commit
ef772bf97f
76 files changed
+334
-327
No files matched your search
@@ -325,6 +325,13 @@ sc_prohibit-gl-attributes:
|
||||
halt='Use _GL... attribute macros' \
|
||||
$(_sc_search_regexp)
|
||||
|
||||
# Prefer the const declaration form, with const following the type
|
||||
sc_prohibit-const-char:
|
||||
@prohibit='const char \*' \
|
||||
in_vc_files='\.[ch]$$' \
|
||||
halt='Use char const *, not const char *' \
|
||||
$(_sc_search_regexp)
|
||||
|
||||
# Look for lines longer than 80 characters, except omit:
|
||||
# - urls
|
||||
# - the fdl.texi file copied from gnulib,
|
||||
|
||||
+3
-3
@@ -109,14 +109,14 @@ mbs_align_pad (char *dest, const char* dest_end, size_t n_spaces)
|
||||
Update *WIDTH to indicate how many columns were used before padding. */
|
||||
|
||||
size_t
|
||||
mbsalign (const char *src, char *dest, size_t dest_size,
|
||||
mbsalign (char const *src, char *dest, size_t dest_size,
|
||||
size_t *width, mbs_align_t align, int flags)
|
||||
{
|
||||
size_t ret = SIZE_MAX;
|
||||
size_t src_size = strlen (src) + 1;
|
||||
char *newstr = NULL;
|
||||
wchar_t *str_wc = NULL;
|
||||
const char *str_to_print = src;
|
||||
char const *str_to_print = src;
|
||||
size_t n_cols = src_size - 1;
|
||||
size_t n_used_bytes = n_cols; /* Not including NUL */
|
||||
size_t n_spaces = 0;
|
||||
@@ -245,7 +245,7 @@ mbsalign_cleanup:
|
||||
Return NULL on failure. */
|
||||
|
||||
char *
|
||||
ambsalign (const char *src, size_t *width, mbs_align_t align, int flags)
|
||||
ambsalign (char const *src, size_t *width, mbs_align_t align, int flags)
|
||||
{
|
||||
size_t orig_width = *width;
|
||||
size_t size = *width; /* Start with enough for unibyte mode. */
|
||||
|
||||
+2
-2
@@ -52,8 +52,8 @@ enum {
|
||||
};
|
||||
|
||||
size_t
|
||||
mbsalign (const char *src, char *dest, size_t dest_size,
|
||||
mbsalign (char const *src, char *dest, size_t dest_size,
|
||||
size_t *width, mbs_align_t align, int flags);
|
||||
|
||||
char *
|
||||
ambsalign (const char *src, size_t *width, mbs_align_t align, int flags);
|
||||
ambsalign (char const *src, size_t *width, mbs_align_t align, int flags);
|
||||
+1
-1
@@ -29,7 +29,7 @@ smack_new_label_from_self (char **label)
|
||||
}
|
||||
|
||||
static inline int
|
||||
smack_set_label_for_self (const char *label)
|
||||
smack_set_label_for_self (char const *label)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
+4
-4
@@ -33,8 +33,8 @@
|
||||
ERR is printed along with N_STR on error. */
|
||||
|
||||
__xdectoint_t
|
||||
__xnumtoint (const char *n_str, int base, __xdectoint_t min, __xdectoint_t max,
|
||||
const char *suffixes, const char *err, int err_exit)
|
||||
__xnumtoint (char const *n_str, int base, __xdectoint_t min, __xdectoint_t max,
|
||||
char const *suffixes, char const *err, int err_exit)
|
||||
{
|
||||
strtol_error s_err;
|
||||
|
||||
@@ -79,8 +79,8 @@ __xnumtoint (const char *n_str, int base, __xdectoint_t min, __xdectoint_t max,
|
||||
ERR is printed along with N_STR on error. */
|
||||
|
||||
__xdectoint_t
|
||||
__xdectoint (const char *n_str, __xdectoint_t min, __xdectoint_t max,
|
||||
const char *suffixes, const char *err, int err_exit)
|
||||
__xdectoint (char const *n_str, __xdectoint_t min, __xdectoint_t max,
|
||||
char const *suffixes, char const *err, int err_exit)
|
||||
{
|
||||
return __xnumtoint (n_str, 10, min, max, suffixes, err, err_exit);
|
||||
}
|
||||
+4
-4
@@ -21,11 +21,11 @@
|
||||
# include <inttypes.h>
|
||||
|
||||
# define _DECLARE_XDECTOINT(name, type) \
|
||||
type name (const char *n_str, type min, type max, \
|
||||
const char *suffixes, const char *err, int err_exit);
|
||||
type name (char const *n_str, type min, type max, \
|
||||
char const *suffixes, char const *err, int err_exit);
|
||||
# define _DECLARE_XNUMTOINT(name, type) \
|
||||
type name (const char *n_str, int base, type min, type max, \
|
||||
const char *suffixes, const char *err, int err_exit);
|
||||
type name (char const *n_str, int base, type min, type max, \
|
||||
char const *suffixes, char const *err, int err_exit);
|
||||
|
||||
_DECLARE_XDECTOINT (xdectoimax, intmax_t)
|
||||
_DECLARE_XDECTOINT (xdectoumax, uintmax_t)
|
||||
|
||||
+4
-4
@@ -82,10 +82,10 @@ Examples:\n\
|
||||
consists entirely of SUFFIX. */
|
||||
|
||||
static void
|
||||
remove_suffix (char *name, const char *suffix)
|
||||
remove_suffix (char *name, char const *suffix)
|
||||
{
|
||||
char *np;
|
||||
const char *sp;
|
||||
char const *sp;
|
||||
|
||||
np = name + strlen (name);
|
||||
sp = suffix + strlen (suffix);
|
||||
@@ -101,7 +101,7 @@ remove_suffix (char *name, const char *suffix)
|
||||
the trailing SUFFIX. Finally, output the result string. */
|
||||
|
||||
static void
|
||||
perform_basename (const char *string, const char *suffix, bool use_nuls)
|
||||
perform_basename (char const *string, char const *suffix, bool use_nuls)
|
||||
{
|
||||
char *name = base_name (string);
|
||||
strip_trailing_slashes (name);
|
||||
@@ -125,7 +125,7 @@ main (int argc, char **argv)
|
||||
{
|
||||
bool multiple_names = false;
|
||||
bool use_nuls = false;
|
||||
const char *suffix = NULL;
|
||||
char const *suffix = NULL;
|
||||
|
||||
initialize_main (&argc, &argv);
|
||||
set_program_name (argv[0]);
|
||||
|
||||
+18
-18
@@ -217,7 +217,7 @@ verify (DEC_BLOCKSIZE % 12 == 0); /* So complete encoded blocks are used. */
|
||||
|
||||
static int (*base_length) (int i);
|
||||
static bool (*isbase) (char ch);
|
||||
static void (*base_encode) (const char *restrict in, size_t inlen,
|
||||
static void (*base_encode) (char const *restrict in, size_t inlen,
|
||||
char *restrict out, size_t outlen);
|
||||
|
||||
struct base16_decode_context
|
||||
@@ -252,7 +252,7 @@ struct base_decode_context
|
||||
};
|
||||
static void (*base_decode_ctx_init) (struct base_decode_context *ctx);
|
||||
static bool (*base_decode_ctx) (struct base_decode_context *ctx,
|
||||
const char *restrict in, size_t inlen,
|
||||
char const *restrict in, size_t inlen,
|
||||
char *restrict out, size_t *outlen);
|
||||
#endif
|
||||
|
||||
@@ -275,7 +275,7 @@ base64_decode_ctx_init_wrapper (struct base_decode_context *ctx)
|
||||
|
||||
static bool
|
||||
base64_decode_ctx_wrapper (struct base_decode_context *ctx,
|
||||
const char *restrict in, size_t inlen,
|
||||
char const *restrict in, size_t inlen,
|
||||
char *restrict out, size_t *outlen)
|
||||
{
|
||||
bool b = base64_decode_ctx (&ctx->ctx.base64, in, inlen, out, outlen);
|
||||
@@ -302,7 +302,7 @@ prepare_inbuf (struct base_decode_context *ctx, size_t inlen)
|
||||
|
||||
|
||||
static void
|
||||
base64url_encode (const char *restrict in, size_t inlen,
|
||||
base64url_encode (char const *restrict in, size_t inlen,
|
||||
char *restrict out, size_t outlen)
|
||||
{
|
||||
base64_encode (in, inlen, out, outlen);
|
||||
@@ -335,7 +335,7 @@ base64url_decode_ctx_init_wrapper (struct base_decode_context *ctx)
|
||||
|
||||
static bool
|
||||
base64url_decode_ctx_wrapper (struct base_decode_context *ctx,
|
||||
const char *restrict in, size_t inlen,
|
||||
char const *restrict in, size_t inlen,
|
||||
char *restrict out, size_t *outlen)
|
||||
{
|
||||
prepare_inbuf (ctx, inlen);
|
||||
@@ -381,7 +381,7 @@ base32_decode_ctx_init_wrapper (struct base_decode_context *ctx)
|
||||
|
||||
static bool
|
||||
base32_decode_ctx_wrapper (struct base_decode_context *ctx,
|
||||
const char *restrict in, size_t inlen,
|
||||
char const *restrict in, size_t inlen,
|
||||
char *restrict out, size_t *outlen)
|
||||
{
|
||||
bool b = base32_decode_ctx (&ctx->ctx.base32, in, inlen, out, outlen);
|
||||
@@ -439,7 +439,7 @@ isbase32hex (char ch)
|
||||
|
||||
|
||||
static void
|
||||
base32hex_encode (const char *restrict in, size_t inlen,
|
||||
base32hex_encode (char const *restrict in, size_t inlen,
|
||||
char *restrict out, size_t outlen)
|
||||
{
|
||||
base32_encode (in, inlen, out, outlen);
|
||||
@@ -462,7 +462,7 @@ base32hex_decode_ctx_init_wrapper (struct base_decode_context *ctx)
|
||||
|
||||
static bool
|
||||
base32hex_decode_ctx_wrapper (struct base_decode_context *ctx,
|
||||
const char *restrict in, size_t inlen,
|
||||
char const *restrict in, size_t inlen,
|
||||
char *restrict out, size_t *outlen)
|
||||
{
|
||||
prepare_inbuf (ctx, inlen);
|
||||
@@ -502,7 +502,7 @@ base16_length (int len)
|
||||
static const char base16[16] = "0123456789ABCDEF";
|
||||
|
||||
static void
|
||||
base16_encode (const char *restrict in, size_t inlen,
|
||||
base16_encode (char const *restrict in, size_t inlen,
|
||||
char *restrict out, size_t outlen)
|
||||
{
|
||||
while (inlen--)
|
||||
@@ -526,7 +526,7 @@ base16_decode_ctx_init (struct base_decode_context *ctx)
|
||||
|
||||
static bool
|
||||
base16_decode_ctx (struct base_decode_context *ctx,
|
||||
const char *restrict in, size_t inlen,
|
||||
char const *restrict in, size_t inlen,
|
||||
char *restrict out, size_t *outlen)
|
||||
{
|
||||
bool ignore_lines = true; /* for now, always ignore them */
|
||||
@@ -597,7 +597,7 @@ static char const z85_encoding[85] =
|
||||
".-:+=^!/*?&<>()[]{}@%$#";
|
||||
|
||||
static void
|
||||
z85_encode (const char *restrict in, size_t inlen,
|
||||
z85_encode (char const *restrict in, size_t inlen,
|
||||
char *restrict out, size_t outlen)
|
||||
{
|
||||
int i = 0;
|
||||
@@ -697,7 +697,7 @@ static unsigned char z85_decoding[93] = {
|
||||
|
||||
static bool
|
||||
z85_decode_ctx (struct base_decode_context *ctx,
|
||||
const char *restrict in, size_t inlen,
|
||||
char const *restrict in, size_t inlen,
|
||||
char *restrict out, size_t *outlen)
|
||||
{
|
||||
bool ignore_lines = true; /* for now, always ignore them */
|
||||
@@ -794,7 +794,7 @@ base2_length (int len)
|
||||
|
||||
|
||||
inline static void
|
||||
base2msbf_encode (const char *restrict in, size_t inlen,
|
||||
base2msbf_encode (char const *restrict in, size_t inlen,
|
||||
char *restrict out, size_t outlen)
|
||||
{
|
||||
while (inlen--)
|
||||
@@ -811,7 +811,7 @@ base2msbf_encode (const char *restrict in, size_t inlen,
|
||||
}
|
||||
|
||||
inline static void
|
||||
base2lsbf_encode (const char *restrict in, size_t inlen,
|
||||
base2lsbf_encode (char const *restrict in, size_t inlen,
|
||||
char *restrict out, size_t outlen)
|
||||
{
|
||||
while (inlen--)
|
||||
@@ -839,7 +839,7 @@ base2_decode_ctx_init (struct base_decode_context *ctx)
|
||||
|
||||
static bool
|
||||
base2lsbf_decode_ctx (struct base_decode_context *ctx,
|
||||
const char *restrict in, size_t inlen,
|
||||
char const *restrict in, size_t inlen,
|
||||
char *restrict out, size_t *outlen)
|
||||
{
|
||||
bool ignore_lines = true; /* for now, always ignore them */
|
||||
@@ -883,7 +883,7 @@ base2lsbf_decode_ctx (struct base_decode_context *ctx,
|
||||
|
||||
static bool
|
||||
base2msbf_decode_ctx (struct base_decode_context *ctx,
|
||||
const char *restrict in, size_t inlen,
|
||||
char const *restrict in, size_t inlen,
|
||||
char *restrict out, size_t *outlen)
|
||||
{
|
||||
bool ignore_lines = true; /* for now, always ignore them */
|
||||
@@ -932,7 +932,7 @@ base2msbf_decode_ctx (struct base_decode_context *ctx,
|
||||
|
||||
|
||||
static void
|
||||
wrap_write (const char *buffer, size_t len,
|
||||
wrap_write (char const *buffer, size_t len,
|
||||
uintmax_t wrap_column, size_t *current_column, FILE *out)
|
||||
{
|
||||
size_t written;
|
||||
@@ -1087,7 +1087,7 @@ main (int argc, char **argv)
|
||||
{
|
||||
int opt;
|
||||
FILE *input_fh;
|
||||
const char *infile;
|
||||
char const *infile;
|
||||
|
||||
/* True if --decode has been given and we should decode data. */
|
||||
bool decode = false;
|
||||
|
||||
+1
-1
@@ -76,7 +76,7 @@ static struct option const long_options[] =
|
||||
/* Return the group ID of NAME, or -1 if no name was specified. */
|
||||
|
||||
static gid_t
|
||||
parse_group (const char *name)
|
||||
parse_group (char const *name)
|
||||
{
|
||||
gid_t gid = -1;
|
||||
|
||||
|
||||
+2
-2
@@ -139,12 +139,12 @@ mode_changed (int dir_fd, char const *file, char const *file_full_name,
|
||||
CHANGED describes what (if anything) has happened. */
|
||||
|
||||
static void
|
||||
describe_change (const char *file, mode_t old_mode, mode_t mode,
|
||||
describe_change (char const *file, mode_t old_mode, mode_t mode,
|
||||
enum Change_status changed)
|
||||
{
|
||||
char perms[12]; /* "-rwxrwxrwx" ls-style modes. */
|
||||
char old_perms[12];
|
||||
const char *fmt;
|
||||
char const *fmt;
|
||||
|
||||
if (changed == CH_NOT_APPLIED)
|
||||
{
|
||||
|
||||
+2
-2
@@ -133,11 +133,11 @@ user_group_str (char const *user, char const *group)
|
||||
CHANGED describes what (if anything) has happened. */
|
||||
|
||||
static void
|
||||
describe_change (const char *file, enum Change_status changed,
|
||||
describe_change (char const *file, enum Change_status changed,
|
||||
char const *old_user, char const *old_group,
|
||||
char const *user, char const *group)
|
||||
{
|
||||
const char *fmt;
|
||||
char const *fmt;
|
||||
char *old_spec;
|
||||
char *spec;
|
||||
|
||||
|
||||
+2
-2
@@ -227,7 +227,7 @@ main (int argc, char **argv)
|
||||
|
||||
case FROM_OPTION:
|
||||
{
|
||||
const char *e = parse_user_spec (optarg,
|
||||
char const *e = parse_user_spec (optarg,
|
||||
&required_uid, &required_gid,
|
||||
NULL, NULL);
|
||||
if (e)
|
||||
@@ -297,7 +297,7 @@ main (int argc, char **argv)
|
||||
}
|
||||
else
|
||||
{
|
||||
const char *e = parse_user_spec (argv[optind], &uid, &gid,
|
||||
char const *e = parse_user_spec (argv[optind], &uid, &gid,
|
||||
&chopt.user_name, &chopt.group_name);
|
||||
if (e)
|
||||
die (EXIT_FAILURE, 0, "%s: %s", e, quote (argv[optind]));
|
||||
|
||||
+4
-4
@@ -172,10 +172,10 @@ static struct option const longopts[] =
|
||||
static bool have_read_stdin;
|
||||
|
||||
static bool
|
||||
cksum_slice8 (FILE *fp, const char *file, uint_fast32_t *crc_out,
|
||||
cksum_slice8 (FILE *fp, char const *file, uint_fast32_t *crc_out,
|
||||
uintmax_t *length_out);
|
||||
static bool
|
||||
(*cksum_fp)(FILE *, const char *, uint_fast32_t *,
|
||||
(*cksum_fp)(FILE *, char const *, uint_fast32_t *,
|
||||
uintmax_t *) = cksum_slice8;
|
||||
|
||||
# if USE_PCLMUL_CRC32
|
||||
@@ -209,7 +209,7 @@ pclmul_supported (void)
|
||||
# endif /* USE_PCLMUL_CRC32 */
|
||||
|
||||
static bool
|
||||
cksum_slice8 (FILE *fp, const char *file, uint_fast32_t *crc_out,
|
||||
cksum_slice8 (FILE *fp, char const *file, uint_fast32_t *crc_out,
|
||||
uintmax_t *length_out)
|
||||
{
|
||||
uint32_t buf[BUFLEN/sizeof (uint32_t)];
|
||||
@@ -269,7 +269,7 @@ cksum_slice8 (FILE *fp, const char *file, uint_fast32_t *crc_out,
|
||||
Return true if successful. */
|
||||
|
||||
static bool
|
||||
cksum (const char *file, bool print_name)
|
||||
cksum (char const *file, bool print_name)
|
||||
{
|
||||
uint_fast32_t crc = 0;
|
||||
uintmax_t length = 0;
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
# define __CKSUM_H__
|
||||
|
||||
extern bool
|
||||
cksum_pclmul (FILE *fp, const char *file, uint_fast32_t *crc_out,
|
||||
cksum_pclmul (FILE *fp, char const *file, uint_fast32_t *crc_out,
|
||||
uintmax_t *length_out);
|
||||
|
||||
extern uint_fast32_t const crctab[8][256];
|
||||
|
||||
+2
-2
@@ -29,13 +29,13 @@
|
||||
extern uint_fast32_t const crctab[8][256];
|
||||
|
||||
extern bool
|
||||
cksum_pclmul (FILE *fp, const char *file, uint_fast32_t *crc_out,
|
||||
cksum_pclmul (FILE *fp, char const *file, uint_fast32_t *crc_out,
|
||||
uintmax_t *length_out);
|
||||
|
||||
/* Calculate CRC32 using PCLMULQDQ CPU instruction found in x86/x64 CPUs */
|
||||
|
||||
bool
|
||||
cksum_pclmul (FILE *fp, const char *file, uint_fast32_t *crc_out,
|
||||
cksum_pclmul (FILE *fp, char const *file, uint_fast32_t *crc_out,
|
||||
uintmax_t *length_out)
|
||||
{
|
||||
__m128i buf[BUFLEN / sizeof (__m128i)];
|
||||
|
||||
+3
-3
@@ -855,7 +855,7 @@ copy_attr_free (struct error_context *ctx _GL_UNUSED,
|
||||
FIXME: Should we handle POSIX ACLs similarly?
|
||||
Return zero to skip. */
|
||||
static int
|
||||
check_selinux_attr (const char *name, struct error_context *ctx)
|
||||
check_selinux_attr (char const *name, struct error_context *ctx)
|
||||
{
|
||||
return STRNCMP_LIT (name, "security.selinux")
|
||||
&& attr_copy_check_permissions (name, ctx);
|
||||
@@ -1062,7 +1062,7 @@ set_owner (const struct cp_options *x, char const *dst_name, int dest_desc,
|
||||
DEST_NAME if defined. */
|
||||
|
||||
static void
|
||||
set_author (const char *dst_name, int dest_desc, const struct stat *src_sb)
|
||||
set_author (char const *dst_name, int dest_desc, const struct stat *src_sb)
|
||||
{
|
||||
#if HAVE_STRUCT_STAT_ST_AUTHOR
|
||||
/* FIXME: Modify the following code so that it does not
|
||||
@@ -2382,7 +2382,7 @@ copy_internal (char const *src_name, char const *dst_name,
|
||||
if (x->backup_type != numbered_backups
|
||||
&& source_is_dst_backup (srcbase, &src_sb, dst_name))
|
||||
{
|
||||
const char *fmt;
|
||||
char const *fmt;
|
||||
fmt = (x->move_mode
|
||||
? _("backing up %s might destroy source; %s not moved")
|
||||
: _("backing up %s might destroy source; %s not copied"));
|
||||
|
||||
+1
-1
@@ -282,7 +282,7 @@ struct cp_options
|
||||
on systems with a rename function that fails for a source file name
|
||||
specified with a trailing slash. */
|
||||
# if RENAME_TRAILING_SLASH_BUG
|
||||
int rpl_rename (const char *, const char *);
|
||||
int rpl_rename (char const *, char const *);
|
||||
# undef rename
|
||||
# define rename rpl_rename
|
||||
# endif
|
||||
|
||||
+1
-1
@@ -93,7 +93,7 @@ Use: '%s --coreutils-prog=PROGRAM_NAME --help' for individual program help.\n"),
|
||||
}
|
||||
|
||||
static void
|
||||
launch_program (const char *prog_name, int prog_argc, char **prog_argv)
|
||||
launch_program (char const *prog_name, int prog_argc, char **prog_argv)
|
||||
{
|
||||
int (*prog_main) (int, char **) = NULL;
|
||||
|
||||
|
||||
+1
-1
@@ -112,7 +112,7 @@ src_to_dest_lookup (ino_t ino, dev_t dev)
|
||||
Return NULL if inserted, otherwise non-NULL. */
|
||||
|
||||
extern char *
|
||||
remember_copied (const char *name, ino_t ino, dev_t dev)
|
||||
remember_copied (char const *name, ino_t ino, dev_t dev)
|
||||
{
|
||||
struct Src_to_dest *ent;
|
||||
struct Src_to_dest *ent_from_table;
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
void hash_init (void);
|
||||
void forget_all (void);
|
||||
void forget_created (ino_t ino, dev_t dev);
|
||||
char *remember_copied (const char *node, ino_t ino, dev_t dev);
|
||||
char *remember_copied (char const *node, ino_t ino, dev_t dev);
|
||||
char *src_to_dest_lookup (ino_t ino, dev_t dev);
|
||||
@@ -590,7 +590,7 @@ target_directory_operand (char const *file, struct stat *st,
|
||||
Return true if successful. */
|
||||
|
||||
static bool
|
||||
do_copy (int n_files, char **file, const char *target_directory,
|
||||
do_copy (int n_files, char **file, char const *target_directory,
|
||||
bool no_target_directory, struct cp_options *x)
|
||||
{
|
||||
struct stat sb;
|
||||
|
||||
+4
-4
@@ -649,7 +649,7 @@ no_more_lines (void)
|
||||
/* Open NAME as standard input. */
|
||||
|
||||
static void
|
||||
set_input_file (const char *name)
|
||||
set_input_file (char const *name)
|
||||
{
|
||||
if (! STREQ (name, "-") && fd_reopen (STDIN_FILENO, name, O_RDONLY, 0) < 0)
|
||||
die (EXIT_FAILURE, errno, _("cannot open %s for reading"),
|
||||
@@ -986,7 +986,7 @@ delete_all_files (bool in_signal_handler)
|
||||
|
||||
for (unsigned int i = 0; i < files_created; i++)
|
||||
{
|
||||
const char *name = make_filename (i);
|
||||
char const *name = make_filename (i);
|
||||
if (unlink (name) != 0 && !in_signal_handler)
|
||||
error (0, errno, "%s", quotef (name));
|
||||
}
|
||||
@@ -1083,7 +1083,7 @@ new_control_record (void)
|
||||
NUM is the numeric part of STR. */
|
||||
|
||||
static void
|
||||
check_for_offset (struct control *p, const char *str, const char *num)
|
||||
check_for_offset (struct control *p, char const *str, char const *num)
|
||||
{
|
||||
if (xstrtoimax (num, NULL, 10, &p->offset, "") != LONGINT_OK)
|
||||
die (EXIT_FAILURE, 0, _("%s: integer expected after delimiter"),
|
||||
@@ -1136,7 +1136,7 @@ extract_regexp (int argnum, bool ignore, char const *str)
|
||||
char delim = *str;
|
||||
char const *closing_delim;
|
||||
struct control *p;
|
||||
const char *err;
|
||||
char const *err;
|
||||
|
||||
closing_delim = strrchr (str + 1, delim);
|
||||
if (closing_delim == NULL)
|
||||
|
||||
+5
-5
@@ -39,7 +39,7 @@
|
||||
|
||||
#define AUTHORS proper_name ("David MacKenzie")
|
||||
|
||||
static bool show_date (const char *, struct timespec, timezone_t);
|
||||
static bool show_date (char const *, struct timespec, timezone_t);
|
||||
|
||||
enum Time_spec
|
||||
{
|
||||
@@ -287,7 +287,7 @@ Show the local time for 9AM next Friday on the west coast of the US\n\
|
||||
Return true if successful. */
|
||||
|
||||
static bool
|
||||
batch_convert (const char *input_filename, const char *format,
|
||||
batch_convert (char const *input_filename, char const *format,
|
||||
timezone_t tz, char const *tzstring)
|
||||
{
|
||||
bool ok;
|
||||
@@ -348,8 +348,8 @@ int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
int optc;
|
||||
const char *datestr = NULL;
|
||||
const char *set_datestr = NULL;
|
||||
char const *datestr = NULL;
|
||||
char const *set_datestr = NULL;
|
||||
struct timespec when;
|
||||
bool set_date = false;
|
||||
char const *format = NULL;
|
||||
@@ -580,7 +580,7 @@ main (int argc, char **argv)
|
||||
in FORMAT, followed by a newline. Return true if successful. */
|
||||
|
||||
static bool
|
||||
show_date (const char *format, struct timespec when, timezone_t tz)
|
||||
show_date (char const *format, struct timespec when, timezone_t tz)
|
||||
{
|
||||
struct tm tm;
|
||||
|
||||
|
||||
@@ -536,7 +536,7 @@ maybe_close_stdout (void)
|
||||
/* Like the 'error' function but handle any pending newline. */
|
||||
|
||||
static void _GL_ATTRIBUTE_FORMAT ((__printf__, 3, 4))
|
||||
nl_error (int status, int errnum, const char *fmt, ...)
|
||||
nl_error (int status, int errnum, char const *fmt, ...)
|
||||
{
|
||||
if (0 < progress_len)
|
||||
{
|
||||
@@ -1445,7 +1445,7 @@ parse_symbols (char const *str, struct symbol_value const *table,
|
||||
number in this format. */
|
||||
|
||||
static uintmax_t
|
||||
parse_integer (const char *str, strtol_error *invalid)
|
||||
parse_integer (char const *str, strtol_error *invalid)
|
||||
{
|
||||
uintmax_t n;
|
||||
char *suffix;
|
||||
@@ -1961,7 +1961,7 @@ advance_input_after_read_error (size_t nbytes)
|
||||
static void
|
||||
copy_simple (char const *buf, size_t nread)
|
||||
{
|
||||
const char *start = buf; /* First uncopied char in BUF. */
|
||||
char const *start = buf; /* First uncopied char in BUF. */
|
||||
|
||||
do
|
||||
{
|
||||
|
||||
@@ -170,7 +170,7 @@ struct field_data_t
|
||||
display_field_t field;
|
||||
char const *arg;
|
||||
field_type_t field_type;
|
||||
const char *caption;/* NULL means to use the default header of this field. */
|
||||
char const *caption;/* NULL means to use the default header of this field. */
|
||||
size_t width; /* Auto adjusted (up) widths used to align columns. */
|
||||
mbs_align_t align; /* Alignment for this field. */
|
||||
bool used;
|
||||
@@ -395,7 +395,7 @@ print_table (void)
|
||||
can then be accessed with standard array notation. */
|
||||
|
||||
static void
|
||||
alloc_field (int f, const char *c)
|
||||
alloc_field (int f, char const *c)
|
||||
{
|
||||
ncolumns++;
|
||||
columns = xnrealloc (columns, ncolumns, sizeof (struct field_data_t *));
|
||||
@@ -632,7 +632,7 @@ get_header (void)
|
||||
/* Is FSTYPE a type of file system that should be listed? */
|
||||
|
||||
static bool _GL_ATTRIBUTE_PURE
|
||||
selected_fstype (const char *fstype)
|
||||
selected_fstype (char const *fstype)
|
||||
{
|
||||
const struct fs_type_list *fsp;
|
||||
|
||||
@@ -647,7 +647,7 @@ selected_fstype (const char *fstype)
|
||||
/* Is FSTYPE a type of file system that should be omitted? */
|
||||
|
||||
static bool _GL_ATTRIBUTE_PURE
|
||||
excluded_fstype (const char *fstype)
|
||||
excluded_fstype (char const *fstype)
|
||||
{
|
||||
const struct fs_type_list *fsp;
|
||||
|
||||
@@ -1353,7 +1353,7 @@ get_disk (char const *disk)
|
||||
and show its disk usage.
|
||||
STATP must be the result of 'stat (POINT, STATP)'. */
|
||||
static void
|
||||
get_point (const char *point, const struct stat *statp)
|
||||
get_point (char const *point, const struct stat *statp)
|
||||
{
|
||||
struct stat disk_stats;
|
||||
struct mount_entry *me;
|
||||
@@ -1478,7 +1478,7 @@ get_all_entries (void)
|
||||
/* Add FSTYPE to the list of file system types to display. */
|
||||
|
||||
static void
|
||||
add_fs_type (const char *fstype)
|
||||
add_fs_type (char const *fstype)
|
||||
{
|
||||
struct fs_type_list *fsp;
|
||||
|
||||
@@ -1491,7 +1491,7 @@ add_fs_type (const char *fstype)
|
||||
/* Add FSTYPE to the list of file system types to be omitted. */
|
||||
|
||||
static void
|
||||
add_excluded_fs_type (const char *fstype)
|
||||
add_excluded_fs_type (char const *fstype)
|
||||
{
|
||||
struct fs_type_list *fsp;
|
||||
|
||||
@@ -1590,7 +1590,7 @@ main (int argc, char **argv)
|
||||
/* If true, use the POSIX output format. */
|
||||
bool posix_format = false;
|
||||
|
||||
const char *msg_mut_excl = _("options %s and %s are mutually exclusive");
|
||||
char const *msg_mut_excl = _("options %s and %s are mutually exclusive");
|
||||
|
||||
while (true)
|
||||
{
|
||||
@@ -1799,7 +1799,7 @@ main (int argc, char **argv)
|
||||
{
|
||||
status = EXIT_FAILURE;
|
||||
}
|
||||
const char *warning = (status == 0 ? _("Warning: ") : "");
|
||||
char const *warning = (status == 0 ? _("Warning: ") : "");
|
||||
error (status, errno, "%s%s", warning,
|
||||
_("cannot read table of mounted file systems"));
|
||||
}
|
||||
|
||||
+7
-7
@@ -59,7 +59,7 @@ enum Shell_syntax
|
||||
variable. */
|
||||
static struct obstack lsc_obstack;
|
||||
|
||||
static const char *const slack_codes[] =
|
||||
static char const *const slack_codes[] =
|
||||
{
|
||||
"NORMAL", "NORM", "FILE", "RESET", "DIR", "LNK", "LINK",
|
||||
"SYMLINK", "ORPHAN", "MISSING", "FIFO", "PIPE", "SOCK", "BLK", "BLOCK",
|
||||
@@ -69,7 +69,7 @@ static const char *const slack_codes[] =
|
||||
"MULTIHARDLINK", "CLRTOEOL", NULL
|
||||
};
|
||||
|
||||
static const char *const ls_codes[] =
|
||||
static char const *const ls_codes[] =
|
||||
{
|
||||
"no", "no", "fi", "rs", "di", "ln", "ln", "ln", "or", "mi", "pi", "pi",
|
||||
"so", "bd", "bd", "cd", "cd", "do", "ex", "lc", "lc", "rc", "rc", "ec", "ec",
|
||||
@@ -192,7 +192,7 @@ parse_line (char const *line, char **keyword, char **arg)
|
||||
sequences like unescaped : and = characters. */
|
||||
|
||||
static void
|
||||
append_quoted (const char *str)
|
||||
append_quoted (char const *str)
|
||||
{
|
||||
bool need_backslash = true;
|
||||
|
||||
@@ -236,7 +236,7 @@ append_quoted (const char *str)
|
||||
Return true if successful. */
|
||||
|
||||
static bool
|
||||
dc_parse_stream (FILE *fp, const char *filename)
|
||||
dc_parse_stream (FILE *fp, char const *filename)
|
||||
{
|
||||
size_t line_number = 0;
|
||||
char const *next_G_line = G_line;
|
||||
@@ -371,7 +371,7 @@ dc_parse_stream (FILE *fp, const char *filename)
|
||||
}
|
||||
|
||||
static bool
|
||||
dc_parse_file (const char *filename)
|
||||
dc_parse_file (char const *filename)
|
||||
{
|
||||
bool ok;
|
||||
|
||||
@@ -486,8 +486,8 @@ main (int argc, char **argv)
|
||||
{
|
||||
size_t len = obstack_object_size (&lsc_obstack);
|
||||
char *s = obstack_finish (&lsc_obstack);
|
||||
const char *prefix;
|
||||
const char *suffix;
|
||||
char const *prefix;
|
||||
char const *suffix;
|
||||
|
||||
if (syntax == SHELL_SYNTAX_BOURNE)
|
||||
{
|
||||
|
||||
@@ -377,7 +377,7 @@ hash_ins (struct di_set *di_set, ino_t ino, dev_t dev)
|
||||
in FORMAT. */
|
||||
|
||||
static void
|
||||
show_date (const char *format, struct timespec when, timezone_t tz)
|
||||
show_date (char const *format, struct timespec when, timezone_t tz)
|
||||
{
|
||||
struct tm tm;
|
||||
if (localtime_rz (tz, &when.tv_sec, &tm))
|
||||
@@ -407,7 +407,7 @@ print_only_size (uintmax_t n_bytes)
|
||||
/* Print size (and optionally time) indicated by *PDUI, followed by STRING. */
|
||||
|
||||
static void
|
||||
print_size (const struct duinfo *pdui, const char *string)
|
||||
print_size (const struct duinfo *pdui, char const *string)
|
||||
{
|
||||
print_only_size (opt_inodes
|
||||
? pdui->inodes
|
||||
@@ -503,7 +503,7 @@ process_file (FTS *fts, FTSENT *ent)
|
||||
directory at the specified level. */
|
||||
static struct dulevel *dulvl;
|
||||
|
||||
const char *file = ent->fts_path;
|
||||
char const *file = ent->fts_path;
|
||||
const struct stat *sb = ent->fts_statp;
|
||||
int info = ent->fts_info;
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
proper_name ("Assaf Gordon")
|
||||
|
||||
/* Array of envvars to unset. */
|
||||
static const char **usvars;
|
||||
static char const **usvars;
|
||||
static size_t usvars_alloc;
|
||||
static idx_t usvars_used;
|
||||
|
||||
@@ -167,7 +167,7 @@ comma-separated.\n\
|
||||
}
|
||||
|
||||
static void
|
||||
append_unset_var (const char *var)
|
||||
append_unset_var (char const *var)
|
||||
{
|
||||
if (usvars_used == usvars_alloc)
|
||||
usvars = x2nrealloc (usvars, &usvars_alloc, sizeof *usvars);
|
||||
@@ -197,12 +197,12 @@ unset_envvars (void)
|
||||
First letter in VARNAME must be alpha or underscore,
|
||||
rest of letters are alnum or underscore.
|
||||
Any other character is an error. */
|
||||
static const char * _GL_ATTRIBUTE_PURE
|
||||
scan_varname (const char *str)
|
||||
static char const * _GL_ATTRIBUTE_PURE
|
||||
scan_varname (char const *str)
|
||||
{
|
||||
if (str[1] == '{' && (c_isalpha (str[2]) || str[2] == '_'))
|
||||
{
|
||||
const char *end = str + 3;
|
||||
char const *end = str + 3;
|
||||
while (c_isalnum (*end) || *end == '_')
|
||||
++end;
|
||||
if (*end == '}')
|
||||
@@ -218,10 +218,10 @@ scan_varname (const char *str)
|
||||
The returned pointer should not be freed.
|
||||
Return NULL if not a valid ${VARNAME} syntax. */
|
||||
static char *
|
||||
extract_varname (const char *str)
|
||||
extract_varname (char const *str)
|
||||
{
|
||||
idx_t i;
|
||||
const char *p;
|
||||
char const *p;
|
||||
|
||||
p = scan_varname (str);
|
||||
if (!p)
|
||||
@@ -353,7 +353,7 @@ splitbuf_finishup (struct splitbuf *ss)
|
||||
and the complexity of keeping track of the storage that may have been
|
||||
allocated via multiple calls to build_argv is not worth the hassle. */
|
||||
static char **
|
||||
build_argv (const char *str, int extra_argc, int *argc)
|
||||
build_argv (char const *str, int extra_argc, int *argc)
|
||||
{
|
||||
bool dq = false, sq = false;
|
||||
struct splitbuf ss;
|
||||
@@ -512,7 +512,7 @@ build_argv (const char *str, int extra_argc, int *argc)
|
||||
argc will be updated from 4 to 6.
|
||||
optind will be reset to 0 to force getopt_long to rescan all arguments. */
|
||||
static void
|
||||
parse_split_string (const char *str, int *orig_optind,
|
||||
parse_split_string (char const *str, int *orig_optind,
|
||||
int *orig_argc, char ***orig_argv)
|
||||
{
|
||||
int extra_argc = *orig_argc - *orig_optind, newargc;
|
||||
@@ -542,7 +542,7 @@ parse_split_string (const char *str, int *orig_optind,
|
||||
}
|
||||
|
||||
static void
|
||||
parse_signal_action_params (const char *optarg, bool set_default)
|
||||
parse_signal_action_params (char const *optarg, bool set_default)
|
||||
{
|
||||
char signame[SIG2STR_MAX];
|
||||
char *opt_sig;
|
||||
@@ -624,7 +624,7 @@ reset_signal_handlers (void)
|
||||
|
||||
|
||||
static void
|
||||
parse_block_signal_params (const char *optarg, bool block)
|
||||
parse_block_signal_params (char const *optarg, bool block)
|
||||
{
|
||||
char signame[SIG2STR_MAX];
|
||||
char *opt_sig;
|
||||
@@ -674,7 +674,7 @@ set_signal_proc_mask (void)
|
||||
{
|
||||
/* Get the existing signal mask */
|
||||
sigset_t set;
|
||||
const char *debug_act;
|
||||
char const *debug_act;
|
||||
|
||||
sigemptyset (&set);
|
||||
|
||||
|
||||
+4
-4
@@ -114,7 +114,7 @@ static void printv (VALUE *v);
|
||||
mbs_logical_cspn ('\xCE\xB1bc','\xCE\xB1') => 1
|
||||
mbs_logical_cspn ('\xCE\xB1bc','c') => 3 */
|
||||
static size_t
|
||||
mbs_logical_cspn (const char *s, const char *accept)
|
||||
mbs_logical_cspn (char const *s, char const *accept)
|
||||
{
|
||||
size_t idx = 0;
|
||||
|
||||
@@ -166,7 +166,7 @@ mbs_logical_cspn (const char *s, const char *accept)
|
||||
Upon exit, sets v->s to the new string.
|
||||
The new string might be empty if POS/LEN are invalid. */
|
||||
static char *
|
||||
mbs_logical_substr (const char *s, size_t pos, size_t len)
|
||||
mbs_logical_substr (char const *s, size_t pos, size_t len)
|
||||
{
|
||||
char *v, *vlim;
|
||||
|
||||
@@ -221,7 +221,7 @@ mbs_logical_substr (const char *s, size_t pos, size_t len)
|
||||
up to the first 4 bytes (The U+2767 which occupies 3 bytes and 'x'):
|
||||
mbs_count_to_offset ("\xE2\x9D\xA7xyz", 4) => 2 */
|
||||
static size_t
|
||||
mbs_offset_to_chars (const char *s, size_t ofs)
|
||||
mbs_offset_to_chars (char const *s, size_t ofs)
|
||||
{
|
||||
mbui_iterator_t iter;
|
||||
size_t c = 0;
|
||||
@@ -584,7 +584,7 @@ static VALUE *
|
||||
docolon (VALUE *sv, VALUE *pv)
|
||||
{
|
||||
VALUE *v IF_LINT ( = NULL);
|
||||
const char *errmsg;
|
||||
char const *errmsg;
|
||||
struct re_pattern_buffer re_buffer;
|
||||
char fastmap[UCHAR_MAX + 1];
|
||||
struct re_registers re_regs;
|
||||
|
||||
+3
-3
@@ -2256,7 +2256,7 @@ mp_factor (mpz_t t, struct mp_factors *factors)
|
||||
}
|
||||
|
||||
static strtol_error
|
||||
strto2uintmax (uintmax_t *hip, uintmax_t *lop, const char *s)
|
||||
strto2uintmax (uintmax_t *hip, uintmax_t *lop, char const *s)
|
||||
{
|
||||
unsigned int lo_carry;
|
||||
uintmax_t hi = 0, lo = 0;
|
||||
@@ -2264,7 +2264,7 @@ strto2uintmax (uintmax_t *hip, uintmax_t *lop, const char *s)
|
||||
strtol_error err = LONGINT_INVALID;
|
||||
|
||||
/* Initial scan for invalid digits. */
|
||||
const char *p = s;
|
||||
char const *p = s;
|
||||
for (;;)
|
||||
{
|
||||
unsigned int c = *p++;
|
||||
@@ -2461,7 +2461,7 @@ print_factors_single (uintmax_t t1, uintmax_t t0)
|
||||
has enough digits, because the algorithm is better. The turnover point
|
||||
depends on the value. */
|
||||
static bool
|
||||
print_factors (const char *input)
|
||||
print_factors (char const *input)
|
||||
{
|
||||
/* Skip initial spaces and '+'. */
|
||||
char const *str = input;
|
||||
|
||||
@@ -133,7 +133,7 @@ struct Word
|
||||
|
||||
/* Static attributes determined during input. */
|
||||
|
||||
const char *text; /* the text of the word */
|
||||
char const *text; /* the text of the word */
|
||||
int length; /* length of this word */
|
||||
int space; /* the size of the following space */
|
||||
unsigned int paren:1; /* starts with open paren */
|
||||
@@ -183,7 +183,7 @@ static bool split;
|
||||
static bool uniform;
|
||||
|
||||
/* Prefix minus leading and trailing spaces (default ""). */
|
||||
static const char *prefix;
|
||||
static char const *prefix;
|
||||
|
||||
/* User-supplied maximum line width (default WIDTH). The only output
|
||||
lines longer than this will each comprise a single word. */
|
||||
@@ -618,7 +618,7 @@ get_paragraph (FILE *f)
|
||||
static int
|
||||
copy_rest (FILE *f, int c)
|
||||
{
|
||||
const char *s;
|
||||
char const *s;
|
||||
|
||||
out_column = 0;
|
||||
if (in_column > next_prefix_indent || (c != '\n' && c != EOF))
|
||||
@@ -725,7 +725,7 @@ get_prefix (FILE *f)
|
||||
prefix_lead_space : in_column;
|
||||
else
|
||||
{
|
||||
const char *p;
|
||||
char const *p;
|
||||
next_prefix_indent = in_column;
|
||||
for (p = prefix; *p != '\0'; p++)
|
||||
{
|
||||
@@ -994,7 +994,7 @@ put_line (WORD *w, int indent)
|
||||
static void
|
||||
put_word (WORD *w)
|
||||
{
|
||||
const char *s;
|
||||
char const *s;
|
||||
int n;
|
||||
|
||||
s = w->text;
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@
|
||||
|
||||
/* Print all of the distinct groups the user is in. */
|
||||
extern bool
|
||||
print_group_list (const char *username,
|
||||
print_group_list (char const *username,
|
||||
uid_t ruid, gid_t rgid, gid_t egid,
|
||||
bool use_names, char delim)
|
||||
{
|
||||
|
||||
+1
-1
@@ -16,4 +16,4 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
bool print_group (gid_t, bool);
|
||||
bool print_group_list (const char *, uid_t, gid_t, gid_t, bool, char);
|
||||
bool print_group_list (char const *, uid_t, gid_t, gid_t, bool, char);
|
||||
+11
-11
@@ -165,7 +165,7 @@ diagnose_copy_fd_failure (enum Copy_fd_status err, char const *filename)
|
||||
}
|
||||
|
||||
static void
|
||||
write_header (const char *filename)
|
||||
write_header (char const *filename)
|
||||
{
|
||||
static bool first_file = true;
|
||||
|
||||
@@ -245,7 +245,7 @@ elseek (int fd, off_t offset, int whence, char const *filename)
|
||||
Return true upon success.
|
||||
Give a diagnostic and return false upon error. */
|
||||
static bool
|
||||
elide_tail_bytes_pipe (const char *filename, int fd, uintmax_t n_elide_0,
|
||||
elide_tail_bytes_pipe (char const *filename, int fd, uintmax_t n_elide_0,
|
||||
off_t current_pos)
|
||||
{
|
||||
size_t n_elide = n_elide_0;
|
||||
@@ -462,7 +462,7 @@ elide_tail_bytes_pipe (const char *filename, int fd, uintmax_t n_elide_0,
|
||||
the length determination and the actual reading, then head fails. */
|
||||
|
||||
static bool
|
||||
elide_tail_bytes_file (const char *filename, int fd, uintmax_t n_elide,
|
||||
elide_tail_bytes_file (char const *filename, int fd, uintmax_t n_elide,
|
||||
struct stat const *st, off_t current_pos)
|
||||
{
|
||||
off_t size = st->st_size;
|
||||
@@ -495,7 +495,7 @@ elide_tail_bytes_file (const char *filename, int fd, uintmax_t n_elide,
|
||||
adding them as needed. Return true if successful. */
|
||||
|
||||
static bool
|
||||
elide_tail_lines_pipe (const char *filename, int fd, uintmax_t n_elide,
|
||||
elide_tail_lines_pipe (char const *filename, int fd, uintmax_t n_elide,
|
||||
off_t current_pos)
|
||||
{
|
||||
struct linebuffer
|
||||
@@ -644,7 +644,7 @@ free_lbuffers:
|
||||
Unfortunately, factoring out some common core looks like it'd result
|
||||
in a less efficient implementation or a messy interface. */
|
||||
static bool
|
||||
elide_tail_lines_seekable (const char *pretty_filename, int fd,
|
||||
elide_tail_lines_seekable (char const *pretty_filename, int fd,
|
||||
uintmax_t n_lines,
|
||||
off_t start_pos, off_t size)
|
||||
{
|
||||
@@ -751,7 +751,7 @@ elide_tail_lines_seekable (const char *pretty_filename, int fd,
|
||||
Give a diagnostic and return nonzero upon error. */
|
||||
|
||||
static bool
|
||||
elide_tail_lines_file (const char *filename, int fd, uintmax_t n_elide,
|
||||
elide_tail_lines_file (char const *filename, int fd, uintmax_t n_elide,
|
||||
struct stat const *st, off_t current_pos)
|
||||
{
|
||||
off_t size = st->st_size;
|
||||
@@ -771,7 +771,7 @@ elide_tail_lines_file (const char *filename, int fd, uintmax_t n_elide,
|
||||
}
|
||||
|
||||
static bool
|
||||
head_bytes (const char *filename, int fd, uintmax_t bytes_to_write)
|
||||
head_bytes (char const *filename, int fd, uintmax_t bytes_to_write)
|
||||
{
|
||||
char buffer[BUFSIZ];
|
||||
size_t bytes_to_read = BUFSIZ;
|
||||
@@ -796,7 +796,7 @@ head_bytes (const char *filename, int fd, uintmax_t bytes_to_write)
|
||||
}
|
||||
|
||||
static bool
|
||||
head_lines (const char *filename, int fd, uintmax_t lines_to_write)
|
||||
head_lines (char const *filename, int fd, uintmax_t lines_to_write)
|
||||
{
|
||||
char buffer[BUFSIZ];
|
||||
|
||||
@@ -833,7 +833,7 @@ head_lines (const char *filename, int fd, uintmax_t lines_to_write)
|
||||
}
|
||||
|
||||
static bool
|
||||
head (const char *filename, int fd, uintmax_t n_units, bool count_lines,
|
||||
head (char const *filename, int fd, uintmax_t n_units, bool count_lines,
|
||||
bool elide_from_end)
|
||||
{
|
||||
if (print_headers)
|
||||
@@ -867,7 +867,7 @@ head (const char *filename, int fd, uintmax_t n_units, bool count_lines,
|
||||
}
|
||||
|
||||
static bool
|
||||
head_file (const char *filename, uintmax_t n_units, bool count_lines,
|
||||
head_file (char const *filename, uintmax_t n_units, bool count_lines,
|
||||
bool elide_from_end)
|
||||
{
|
||||
int fd;
|
||||
@@ -907,7 +907,7 @@ head_file (const char *filename, uintmax_t n_units, bool count_lines,
|
||||
of lines. It is used solely to give a more specific diagnostic. */
|
||||
|
||||
static uintmax_t
|
||||
string_to_integer (bool count_lines, const char *n_string)
|
||||
string_to_integer (bool count_lines, char const *n_string)
|
||||
{
|
||||
return xdectoumax (n_string, 0, UINTMAX_MAX, "bkKmMGTPEZY0",
|
||||
count_lines ? _("invalid number of lines")
|
||||
|
||||
@@ -69,8 +69,8 @@ static gid_t rgid, egid;
|
||||
static char *context = NULL;
|
||||
|
||||
static void print_user (uid_t uid);
|
||||
static void print_full_info (const char *username);
|
||||
static void print_stuff (const char *pw_name);
|
||||
static void print_full_info (char const *username);
|
||||
static void print_stuff (char const *pw_name);
|
||||
|
||||
static struct option const longopts[] =
|
||||
{
|
||||
@@ -236,7 +236,7 @@ main (int argc, char **argv)
|
||||
for (; optind < n_ids; optind++)
|
||||
{
|
||||
struct passwd *pwd = NULL;
|
||||
const char *spec = argv[optind];
|
||||
char const *spec = argv[optind];
|
||||
/* Disallow an empty spec here as parse_user_spec() doesn't
|
||||
give an error for that as it seems it's a valid way to
|
||||
specify a noop or "reset special bits" depending on the system. */
|
||||
@@ -354,7 +354,7 @@ print_user (uid_t uid)
|
||||
/* Print all of the info about the user's user and group IDs. */
|
||||
|
||||
static void
|
||||
print_full_info (const char *username)
|
||||
print_full_info (char const *username)
|
||||
{
|
||||
struct passwd *pwd;
|
||||
struct group *grp;
|
||||
@@ -429,7 +429,7 @@ print_full_info (const char *username)
|
||||
/* Print information about the user based on the arguments passed. */
|
||||
|
||||
static void
|
||||
print_stuff (const char *pw_name)
|
||||
print_stuff (char const *pw_name)
|
||||
{
|
||||
if (just_user)
|
||||
print_user (use_real ? ruid : euid);
|
||||
|
||||
+6
-6
@@ -167,7 +167,7 @@ extra_mode (mode_t input)
|
||||
|
||||
/* Return true if copy of file SRC_NAME to file DEST_NAME is necessary. */
|
||||
static bool
|
||||
need_copy (const char *src_name, const char *dest_name,
|
||||
need_copy (char const *src_name, char const *dest_name,
|
||||
const struct cp_options *x)
|
||||
{
|
||||
struct stat src_sb, dest_sb;
|
||||
@@ -435,7 +435,7 @@ process_dir (char *dir, struct savewd *wd, void *options)
|
||||
Return true if successful. */
|
||||
|
||||
static bool
|
||||
copy_file (const char *from, const char *to, const struct cp_options *x)
|
||||
copy_file (char const *from, char const *to, const struct cp_options *x)
|
||||
{
|
||||
bool copy_into_self;
|
||||
|
||||
@@ -658,7 +658,7 @@ In the 4th form, create all components of the given DIRECTORY(ies).\n\
|
||||
Return true if successful. */
|
||||
|
||||
static bool
|
||||
install_file_in_file (const char *from, const char *to,
|
||||
install_file_in_file (char const *from, char const *to,
|
||||
const struct cp_options *x)
|
||||
{
|
||||
struct stat from_sb;
|
||||
@@ -739,10 +739,10 @@ install_file_in_file_parents (char const *from, char *to,
|
||||
Return true if successful. */
|
||||
|
||||
static bool
|
||||
install_file_in_dir (const char *from, const char *to_dir,
|
||||
install_file_in_dir (char const *from, char const *to_dir,
|
||||
const struct cp_options *x, bool mkdir_and_install)
|
||||
{
|
||||
const char *from_base = last_component (from);
|
||||
char const *from_base = last_component (from);
|
||||
char *to = file_name_concat (to_dir, from_base, NULL);
|
||||
bool ret = true;
|
||||
|
||||
@@ -759,7 +759,7 @@ main (int argc, char **argv)
|
||||
{
|
||||
int optc;
|
||||
int exit_status = EXIT_SUCCESS;
|
||||
const char *specified_mode = NULL;
|
||||
char const *specified_mode = NULL;
|
||||
bool make_backups = false;
|
||||
char const *backup_suffix = NULL;
|
||||
char *version_control_string = NULL;
|
||||
|
||||
+1
-1
@@ -857,7 +857,7 @@ string_to_join_field (char const *str)
|
||||
If S is valid, return true. Otherwise, give a diagnostic and exit. */
|
||||
|
||||
static void
|
||||
decode_field_spec (const char *s, int *file_index, size_t *field_index)
|
||||
decode_field_spec (char const *s, int *file_index, size_t *field_index)
|
||||
{
|
||||
/* The first character must be 0, 1, or 2. */
|
||||
switch (s[0])
|
||||
|
||||
+3
-3
@@ -65,10 +65,10 @@
|
||||
However I think it's just a buggy implementation due to the various
|
||||
inconsistencies with write sizes and subsequent writes. */
|
||||
|
||||
static const char *
|
||||
static char const *
|
||||
fileno_to_name (const int fd)
|
||||
{
|
||||
const char *ret = NULL;
|
||||
char const *ret = NULL;
|
||||
|
||||
switch (fd)
|
||||
{
|
||||
@@ -90,7 +90,7 @@ fileno_to_name (const int fd)
|
||||
}
|
||||
|
||||
static void
|
||||
apply_mode (FILE *stream, const char *mode)
|
||||
apply_mode (FILE *stream, char const *mode)
|
||||
{
|
||||
char *buf = NULL;
|
||||
int setvbuf_mode;
|
||||
|
||||
@@ -129,7 +129,7 @@ errnoize (int status)
|
||||
The result is malloced. */
|
||||
|
||||
static char *
|
||||
convert_abs_rel (const char *from, const char *target)
|
||||
convert_abs_rel (char const *from, char const *target)
|
||||
{
|
||||
/* Get dirname to generate paths relative to. We don't resolve
|
||||
the full TARGET as the last component could be an existing symlink. */
|
||||
|
||||
@@ -249,7 +249,7 @@ struct fileinfo
|
||||
struct bin_str
|
||||
{
|
||||
size_t len; /* Number of bytes */
|
||||
const char *string; /* Pointer to the same */
|
||||
char const *string; /* Pointer to the same */
|
||||
};
|
||||
|
||||
#if ! HAVE_TCGETPGRP
|
||||
@@ -276,8 +276,8 @@ static const struct bin_str * get_color_indicator (const struct fileinfo *f,
|
||||
bool symlink_target);
|
||||
static bool print_color_indicator (const struct bin_str *ind);
|
||||
static void put_indicator (const struct bin_str *ind);
|
||||
static void add_ignore_pattern (const char *pattern);
|
||||
static void attach (char *dest, const char *dirname, const char *name);
|
||||
static void add_ignore_pattern (char const *pattern);
|
||||
static void attach (char *dest, char const *dirname, char const *name);
|
||||
static void clear_files (void);
|
||||
static void extract_dirs_from_files (char const *dirname,
|
||||
bool command_line_arg);
|
||||
@@ -310,7 +310,7 @@ static void parse_ls_color (void);
|
||||
|
||||
static void getenv_quoting_style (void);
|
||||
|
||||
static size_t quote_name_width (const char *name,
|
||||
static size_t quote_name_width (char const *name,
|
||||
struct quoting_options const *options,
|
||||
int needs_general_quoting);
|
||||
|
||||
@@ -602,7 +602,7 @@ enum indicator_no
|
||||
C_CLR_TO_EOL
|
||||
};
|
||||
|
||||
static const char *const indicator_name[]=
|
||||
static char const *const indicator_name[]=
|
||||
{
|
||||
"lc", "rc", "ec", "rs", "no", "fi", "di", "ln", "pi", "so",
|
||||
"bd", "cd", "mi", "or", "ex", "do", "su", "sg", "st",
|
||||
@@ -700,7 +700,7 @@ static enum
|
||||
|
||||
struct ignore_pattern
|
||||
{
|
||||
const char *pattern;
|
||||
char const *pattern;
|
||||
struct ignore_pattern *next;
|
||||
};
|
||||
|
||||
@@ -1064,7 +1064,7 @@ dev_ino_pop (void)
|
||||
a space-separated list of the integers stored in OS all on one line. */
|
||||
|
||||
static void
|
||||
dired_dump_obstack (const char *prefix, struct obstack *os)
|
||||
dired_dump_obstack (char const *prefix, struct obstack *os)
|
||||
{
|
||||
size_t n_pos;
|
||||
|
||||
@@ -1158,7 +1158,7 @@ calc_req_mask (void)
|
||||
}
|
||||
|
||||
static int
|
||||
do_statx (int fd, const char *name, struct stat *st, int flags,
|
||||
do_statx (int fd, char const *name, struct stat *st, int flags,
|
||||
unsigned int mask)
|
||||
{
|
||||
struct statx stx;
|
||||
@@ -1182,26 +1182,26 @@ do_statx (int fd, const char *name, struct stat *st, int flags,
|
||||
}
|
||||
|
||||
static inline int
|
||||
do_stat (const char *name, struct stat *st)
|
||||
do_stat (char const *name, struct stat *st)
|
||||
{
|
||||
return do_statx (AT_FDCWD, name, st, 0, calc_req_mask ());
|
||||
}
|
||||
|
||||
static inline int
|
||||
do_lstat (const char *name, struct stat *st)
|
||||
do_lstat (char const *name, struct stat *st)
|
||||
{
|
||||
return do_statx (AT_FDCWD, name, st, AT_SYMLINK_NOFOLLOW, calc_req_mask ());
|
||||
}
|
||||
|
||||
static inline int
|
||||
stat_for_mode (const char *name, struct stat *st)
|
||||
stat_for_mode (char const *name, struct stat *st)
|
||||
{
|
||||
return do_statx (AT_FDCWD, name, st, 0, STATX_MODE);
|
||||
}
|
||||
|
||||
/* dev+ino should be static, so no need to sync with backing store */
|
||||
static inline int
|
||||
stat_for_ino (const char *name, struct stat *st)
|
||||
stat_for_ino (char const *name, struct stat *st)
|
||||
{
|
||||
return do_statx (AT_FDCWD, name, st, 0, STATX_INO);
|
||||
}
|
||||
@@ -1213,25 +1213,25 @@ fstat_for_ino (int fd, struct stat *st)
|
||||
}
|
||||
#else
|
||||
static inline int
|
||||
do_stat (const char *name, struct stat *st)
|
||||
do_stat (char const *name, struct stat *st)
|
||||
{
|
||||
return stat (name, st);
|
||||
}
|
||||
|
||||
static inline int
|
||||
do_lstat (const char *name, struct stat *st)
|
||||
do_lstat (char const *name, struct stat *st)
|
||||
{
|
||||
return lstat (name, st);
|
||||
}
|
||||
|
||||
static inline int
|
||||
stat_for_mode (const char *name, struct stat *st)
|
||||
stat_for_mode (char const *name, struct stat *st)
|
||||
{
|
||||
return stat (name, st);
|
||||
}
|
||||
|
||||
static inline int
|
||||
stat_for_ino (const char *name, struct stat *st)
|
||||
stat_for_ino (char const *name, struct stat *st)
|
||||
{
|
||||
return stat (name, st);
|
||||
}
|
||||
@@ -2468,7 +2468,7 @@ decode_switches (int argc, char **argv)
|
||||
the input string, respectively. */
|
||||
|
||||
static bool
|
||||
get_funky_string (char **dest, const char **src, bool equals_end,
|
||||
get_funky_string (char **dest, char const **src, bool equals_end,
|
||||
size_t *output_count)
|
||||
{
|
||||
char num; /* For numerical codes */
|
||||
@@ -2476,7 +2476,7 @@ get_funky_string (char **dest, const char **src, bool equals_end,
|
||||
enum {
|
||||
ST_GND, ST_BACKSLASH, ST_OCTAL, ST_HEX, ST_CARET, ST_END, ST_ERROR
|
||||
} state;
|
||||
const char *p;
|
||||
char const *p;
|
||||
char *q;
|
||||
|
||||
p = *src; /* We don't want to double-indirect */
|
||||
@@ -2699,7 +2699,7 @@ known_term_type (void)
|
||||
static void
|
||||
parse_ls_color (void)
|
||||
{
|
||||
const char *p; /* Pointer to character being parsed */
|
||||
char const *p; /* Pointer to character being parsed */
|
||||
char *buf; /* color_buf buffer pointer */
|
||||
int ind_no; /* Indicator number */
|
||||
char label[3]; /* Indicator label */
|
||||
@@ -3059,7 +3059,7 @@ print_dir (char const *name, char const *realname, bool command_line_arg)
|
||||
|
||||
if (format == long_format || print_block_size)
|
||||
{
|
||||
const char *p;
|
||||
char const *p;
|
||||
char buf[LONGEST_HUMAN_READABLE + 1];
|
||||
|
||||
DIRED_INDENT ();
|
||||
@@ -3080,7 +3080,7 @@ print_dir (char const *name, char const *realname, bool command_line_arg)
|
||||
not listed. */
|
||||
|
||||
static void
|
||||
add_ignore_pattern (const char *pattern)
|
||||
add_ignore_pattern (char const *pattern)
|
||||
{
|
||||
struct ignore_pattern *ignore;
|
||||
|
||||
@@ -3687,7 +3687,7 @@ make_link_name (char const *name, char const *linkname)
|
||||
This is so we don't try to recurse on '././././. ...' */
|
||||
|
||||
static bool
|
||||
basename_is_dot_or_dotdot (const char *name)
|
||||
basename_is_dot_or_dotdot (char const *name)
|
||||
{
|
||||
char const *base = last_component (name);
|
||||
return dot_or_dotdot (base);
|
||||
@@ -4681,7 +4681,7 @@ quote_name_buf (char **inbuf, size_t bufsize, char *name,
|
||||
}
|
||||
|
||||
static size_t
|
||||
quote_name_width (const char *name, struct quoting_options const *options,
|
||||
quote_name_width (char const *name, struct quoting_options const *options,
|
||||
int needs_general_quoting)
|
||||
{
|
||||
char smallbuf[BUFSIZ];
|
||||
@@ -4703,7 +4703,7 @@ quote_name_width (const char *name, struct quoting_options const *options,
|
||||
/* %XX escape any input out of range as defined in RFC3986,
|
||||
and also if PATH, convert all path separators to '/'. */
|
||||
static char *
|
||||
file_escape (const char *str, bool path)
|
||||
file_escape (char const *str, bool path)
|
||||
{
|
||||
char *esc = xnmalloc (3, strlen (str) + 1);
|
||||
char *p = esc;
|
||||
@@ -5235,9 +5235,9 @@ indent (size_t from, size_t to)
|
||||
non-malloc'ing version of file_name_concat. */
|
||||
|
||||
static void
|
||||
attach (char *dest, const char *dirname, const char *name)
|
||||
attach (char *dest, char const *dirname, char const *name)
|
||||
{
|
||||
const char *dirnamep = dirname;
|
||||
char const *dirnamep = dirname;
|
||||
|
||||
/* Copy dirname if it is not ".". */
|
||||
if (dirname[0] != '.' || dirname[1] != 0)
|
||||
|
||||
+2
-2
@@ -588,7 +588,7 @@ print_filename (char const *file, bool escape)
|
||||
Return true if successful. */
|
||||
|
||||
static bool
|
||||
digest_file (const char *filename, int *binary, unsigned char *bin_result,
|
||||
digest_file (char const *filename, int *binary, unsigned char *bin_result,
|
||||
bool *missing)
|
||||
{
|
||||
FILE *fp;
|
||||
@@ -649,7 +649,7 @@ digest_file (const char *filename, int *binary, unsigned char *bin_result,
|
||||
}
|
||||
|
||||
static bool
|
||||
digest_check (const char *checkfile_name)
|
||||
digest_check (char const *checkfile_name)
|
||||
{
|
||||
FILE *checkfile_stream;
|
||||
uintmax_t n_misformatted_lines = 0;
|
||||
|
||||
+1
-1
@@ -192,7 +192,7 @@ process_dir (char *dir, struct savewd *wd, void *options)
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
const char *specified_mode = NULL;
|
||||
char const *specified_mode = NULL;
|
||||
int optc;
|
||||
char const *scontext = NULL;
|
||||
struct mkdir_options options;
|
||||
|
||||
+2
-2
@@ -36,7 +36,7 @@
|
||||
proper_name ("Jim Meyering"), \
|
||||
proper_name ("Eric Blake")
|
||||
|
||||
static const char *default_template = "tmp.XXXXXXXXXX";
|
||||
static char const *default_template = "tmp.XXXXXXXXXX";
|
||||
|
||||
/* For long options that have no equivalent short option, use a
|
||||
non-character as a pseudo short option, starting with CHAR_MAX + 1. */
|
||||
@@ -104,7 +104,7 @@ Files are created u+rw, and directories u+rwx, minus umask restrictions.\n\
|
||||
}
|
||||
|
||||
static size_t
|
||||
count_consecutive_X_s (const char *s, size_t len)
|
||||
count_consecutive_X_s (char const *s, size_t len)
|
||||
{
|
||||
size_t n = 0;
|
||||
for ( ; len && s[len-1] == 'X'; len--)
|
||||
|
||||
@@ -166,7 +166,7 @@ target_directory_operand (char const *file)
|
||||
Return true if successful. */
|
||||
|
||||
static bool
|
||||
do_move (const char *source, const char *dest, const struct cp_options *x)
|
||||
do_move (char const *source, char const *dest, const struct cp_options *x)
|
||||
{
|
||||
bool copy_into_self;
|
||||
bool rename_succeeded;
|
||||
|
||||
+12
-12
@@ -171,7 +171,7 @@ static enum scale_type scale_from = scale_none;
|
||||
static enum scale_type scale_to = scale_none;
|
||||
static enum round_type round_style = round_from_zero;
|
||||
static enum inval_type inval_style = inval_abort;
|
||||
static const char *suffix = NULL;
|
||||
static char const *suffix = NULL;
|
||||
static uintmax_t from_unit_size = 1;
|
||||
static uintmax_t to_unit_size = 1;
|
||||
static int grouping = 0;
|
||||
@@ -180,7 +180,7 @@ static size_t padding_buffer_size = 0;
|
||||
static long int padding_width = 0;
|
||||
static long int zero_padding_width = 0;
|
||||
static long int user_precision = -1;
|
||||
static const char *format_str = NULL;
|
||||
static char const *format_str = NULL;
|
||||
static char *format_str_prefix = NULL;
|
||||
static char *format_str_suffix = NULL;
|
||||
|
||||
@@ -206,7 +206,7 @@ static uintmax_t header = 0;
|
||||
static bool debug;
|
||||
|
||||
/* will be set according to the current locale. */
|
||||
static const char *decimal_point;
|
||||
static char const *decimal_point;
|
||||
static int decimal_point_length;
|
||||
|
||||
/* debugging for developers. Enables devmsg(). */
|
||||
@@ -233,7 +233,7 @@ default_scale_base (enum scale_type scale)
|
||||
static inline int
|
||||
valid_suffix (const char suf)
|
||||
{
|
||||
static const char *valid_suffixes = "KMGTPEZY";
|
||||
static char const *valid_suffixes = "KMGTPEZY";
|
||||
return (strchr (valid_suffixes, suf) != NULL);
|
||||
}
|
||||
|
||||
@@ -271,7 +271,7 @@ suffix_power (const char suf)
|
||||
}
|
||||
}
|
||||
|
||||
static inline const char *
|
||||
static inline char const *
|
||||
suffix_power_char (unsigned int power)
|
||||
{
|
||||
switch (power)
|
||||
@@ -463,7 +463,7 @@ enum simple_strtod_error
|
||||
SSE_OVERFLOW - if more than 27 digits (999Y) were used.
|
||||
SSE_INVALID_NUMBER - if no digits were found. */
|
||||
static enum simple_strtod_error
|
||||
simple_strtod_int (const char *input_str,
|
||||
simple_strtod_int (char const *input_str,
|
||||
char **endptr, long double *value, bool *negative)
|
||||
{
|
||||
enum simple_strtod_error e = SSE_OK;
|
||||
@@ -528,7 +528,7 @@ simple_strtod_int (const char *input_str,
|
||||
SSE_OVERFLOW - if more than 27 digits (999Y) were used.
|
||||
SSE_INVALID_NUMBER - if no digits were found. */
|
||||
static enum simple_strtod_error
|
||||
simple_strtod_float (const char *input_str,
|
||||
simple_strtod_float (char const *input_str,
|
||||
char **endptr,
|
||||
long double *value,
|
||||
size_t *precision)
|
||||
@@ -604,7 +604,7 @@ simple_strtod_float (const char *input_str,
|
||||
SSE_INVALID_SUFFIX
|
||||
SSE_MISSING_I_SUFFIX */
|
||||
static enum simple_strtod_error
|
||||
simple_strtod_human (const char *input_str,
|
||||
simple_strtod_human (char const *input_str,
|
||||
char **endptr, long double *value, size_t *precision,
|
||||
enum scale_type allowed_scaling)
|
||||
{
|
||||
@@ -821,15 +821,15 @@ double_to_human (long double val, int precision,
|
||||
Upon successful conversion, return that value.
|
||||
If it cannot be converted, give a diagnostic and exit. */
|
||||
static uintmax_t
|
||||
unit_to_umax (const char *n_string)
|
||||
unit_to_umax (char const *n_string)
|
||||
{
|
||||
strtol_error s_err;
|
||||
const char *c_string = n_string;
|
||||
char const *c_string = n_string;
|
||||
char *t_string = NULL;
|
||||
size_t n_len = strlen (n_string);
|
||||
char *end = NULL;
|
||||
uintmax_t n;
|
||||
const char *suffixes = "KMGTPEZY";
|
||||
char const *suffixes = "KMGTPEZY";
|
||||
|
||||
/* Adjust suffixes so K=1000, Ki=1024, KiB=invalid. */
|
||||
if (n_len && ! c_isdigit (n_string[n_len - 1]))
|
||||
@@ -1164,7 +1164,7 @@ parse_format_string (char const *fmt)
|
||||
If there are any trailing characters after the number
|
||||
(besides a valid suffix) - exits with an error. */
|
||||
static enum simple_strtod_error
|
||||
parse_human_number (const char *str, long double /*output */ *value,
|
||||
parse_human_number (char const *str, long double /*output */ *value,
|
||||
size_t *precision)
|
||||
{
|
||||
char *ptr = NULL;
|
||||
|
||||
@@ -448,7 +448,7 @@ N (size_t fields, size_t blank, void const *block, \
|
||||
char b[sizeof (T)]; \
|
||||
} u; \
|
||||
for (j = 0; j < sizeof (T); j++) \
|
||||
u.b[j] = ((const char *) p)[sizeof (T) - 1 - j]; \
|
||||
u.b[j] = ((char const *) p)[sizeof (T) - 1 - j]; \
|
||||
x = u.x; \
|
||||
} \
|
||||
else \
|
||||
@@ -484,7 +484,7 @@ PRINT_FLOATTYPE (print_long_double, long double, ldtoastr, LDBL_BUFSIZE_BOUND)
|
||||
#undef PRINT_FLOATTYPE
|
||||
|
||||
static void
|
||||
dump_hexl_mode_trailer (size_t n_bytes, const char *block)
|
||||
dump_hexl_mode_trailer (size_t n_bytes, char const *block)
|
||||
{
|
||||
fputs (" >", stdout);
|
||||
for (size_t i = n_bytes; i > 0; i--)
|
||||
@@ -498,7 +498,7 @@ dump_hexl_mode_trailer (size_t n_bytes, const char *block)
|
||||
|
||||
static void
|
||||
print_named_ascii (size_t fields, size_t blank, void const *block,
|
||||
const char *unused_fmt_string _GL_UNUSED,
|
||||
char const *unused_fmt_string _GL_UNUSED,
|
||||
int width, int pad)
|
||||
{
|
||||
unsigned char const *p = block;
|
||||
@@ -508,7 +508,7 @@ print_named_ascii (size_t fields, size_t blank, void const *block,
|
||||
{
|
||||
int next_pad = pad * (i - 1) / fields;
|
||||
int masked_c = *p++ & 0x7f;
|
||||
const char *s;
|
||||
char const *s;
|
||||
char buf[2];
|
||||
|
||||
if (masked_c == 127)
|
||||
@@ -529,7 +529,7 @@ print_named_ascii (size_t fields, size_t blank, void const *block,
|
||||
|
||||
static void
|
||||
print_ascii (size_t fields, size_t blank, void const *block,
|
||||
const char *unused_fmt_string _GL_UNUSED, int width,
|
||||
char const *unused_fmt_string _GL_UNUSED, int width,
|
||||
int pad)
|
||||
{
|
||||
unsigned char const *p = block;
|
||||
@@ -539,7 +539,7 @@ print_ascii (size_t fields, size_t blank, void const *block,
|
||||
{
|
||||
int next_pad = pad * (i - 1) / fields;
|
||||
unsigned char c = *p++;
|
||||
const char *s;
|
||||
char const *s;
|
||||
char buf[4];
|
||||
|
||||
switch (c)
|
||||
@@ -595,7 +595,7 @@ print_ascii (size_t fields, size_t blank, void const *block,
|
||||
the result of the conversion and return true. */
|
||||
|
||||
static bool
|
||||
simple_strtoul (const char *s, const char **p, unsigned long int *val)
|
||||
simple_strtoul (char const *s, char const **p, unsigned long int *val)
|
||||
{
|
||||
unsigned long int sum;
|
||||
|
||||
@@ -632,7 +632,7 @@ simple_strtoul (const char *s, const char **p, unsigned long int *val)
|
||||
*/
|
||||
|
||||
static bool
|
||||
decode_one_format (const char *s_orig, const char *s, const char **next,
|
||||
decode_one_format (char const *s_orig, char const *s, char const **next,
|
||||
struct tspec *tspec)
|
||||
{
|
||||
enum size_spec size_spec;
|
||||
@@ -640,7 +640,7 @@ decode_one_format (const char *s_orig, const char *s, const char **next,
|
||||
enum output_format fmt;
|
||||
void (*print_function) (size_t, size_t, void const *, char const *,
|
||||
int, int);
|
||||
const char *p;
|
||||
char const *p;
|
||||
char c;
|
||||
int field_width;
|
||||
|
||||
@@ -979,14 +979,14 @@ check_and_close (int in_errno)
|
||||
necessary. Return true if S is valid. */
|
||||
|
||||
static bool
|
||||
decode_format_string (const char *s)
|
||||
decode_format_string (char const *s)
|
||||
{
|
||||
const char *s_orig = s;
|
||||
char const *s_orig = s;
|
||||
assert (s != NULL);
|
||||
|
||||
while (*s != '\0')
|
||||
{
|
||||
const char *next;
|
||||
char const *next;
|
||||
|
||||
if (n_specs_allocated <= n_specs)
|
||||
spec = X2NREALLOC (spec, &n_specs_allocated);
|
||||
@@ -1186,7 +1186,7 @@ format_address_label (uintmax_t address, char c)
|
||||
|
||||
static void
|
||||
write_block (uintmax_t current_offset, size_t n_bytes,
|
||||
const char *prev_block, const char *curr_block)
|
||||
char const *prev_block, char const *curr_block)
|
||||
{
|
||||
static bool first = true;
|
||||
static bool prev_pair_equal = false;
|
||||
@@ -1332,7 +1332,7 @@ get_lcm (void)
|
||||
leading '+' return true and set *OFFSET to the offset it denotes. */
|
||||
|
||||
static bool
|
||||
parse_old_offset (const char *s, uintmax_t *offset)
|
||||
parse_old_offset (char const *s, uintmax_t *offset)
|
||||
{
|
||||
int radix;
|
||||
|
||||
|
||||
+8
-8
@@ -82,7 +82,7 @@ static struct option const longopts[] =
|
||||
/* Count and return the number of ampersands in STR. */
|
||||
|
||||
static size_t _GL_ATTRIBUTE_PURE
|
||||
count_ampersands (const char *str)
|
||||
count_ampersands (char const *str)
|
||||
{
|
||||
size_t count = 0;
|
||||
do
|
||||
@@ -100,7 +100,7 @@ count_ampersands (const char *str)
|
||||
this function. */
|
||||
|
||||
static char *
|
||||
create_fullname (const char *gecos_name, const char *user_name)
|
||||
create_fullname (char const *gecos_name, char const *user_name)
|
||||
{
|
||||
size_t rsize = strlen (gecos_name) + 1;
|
||||
char *result;
|
||||
@@ -122,7 +122,7 @@ create_fullname (const char *gecos_name, const char *user_name)
|
||||
{
|
||||
if (*gecos_name == '&')
|
||||
{
|
||||
const char *uname = user_name;
|
||||
char const *uname = user_name;
|
||||
if (islower (to_uchar (*uname)))
|
||||
*r++ = toupper (to_uchar (*uname++));
|
||||
while (*uname)
|
||||
@@ -143,7 +143,7 @@ create_fullname (const char *gecos_name, const char *user_name)
|
||||
/* Return a string representing the time between WHEN and the time
|
||||
that this function is first run. */
|
||||
|
||||
static const char *
|
||||
static char const *
|
||||
idle_string (time_t when)
|
||||
{
|
||||
static time_t now = 0;
|
||||
@@ -171,7 +171,7 @@ idle_string (time_t when)
|
||||
}
|
||||
|
||||
/* Return a time string. */
|
||||
static const char *
|
||||
static char const *
|
||||
time_string (const STRUCT_UTMP *utmp_ent)
|
||||
{
|
||||
static char buf[INT_STRLEN_BOUND (intmax_t) + sizeof "-%m-%d %H:%M"];
|
||||
@@ -348,7 +348,7 @@ print_long_entry (const char name[])
|
||||
{
|
||||
FILE *stream;
|
||||
char buf[1024];
|
||||
const char *const baseproject = "/.project";
|
||||
char const *const baseproject = "/.project";
|
||||
char *const project =
|
||||
xmalloc (strlen (pw->pw_dir) + strlen (baseproject) + 1);
|
||||
stpcpy (stpcpy (project, pw->pw_dir), baseproject);
|
||||
@@ -372,7 +372,7 @@ print_long_entry (const char name[])
|
||||
{
|
||||
FILE *stream;
|
||||
char buf[1024];
|
||||
const char *const baseplan = "/.plan";
|
||||
char const *const baseplan = "/.plan";
|
||||
char *const plan =
|
||||
xmalloc (strlen (pw->pw_dir) + strlen (baseplan) + 1);
|
||||
stpcpy (stpcpy (plan, pw->pw_dir), baseplan);
|
||||
@@ -458,7 +458,7 @@ scan_entries (size_t n, const STRUCT_UTMP *utmp_buf,
|
||||
/* Display a list of who is on the system, according to utmp file FILENAME. */
|
||||
|
||||
static void
|
||||
short_pinky (const char *filename,
|
||||
short_pinky (char const *filename,
|
||||
const int argc_names, char *const argv_names[])
|
||||
{
|
||||
size_t n_users;
|
||||
|
||||
@@ -426,8 +426,8 @@ static bool skip_to_page (uintmax_t page);
|
||||
static void print_header (void);
|
||||
static void pad_across_to (int position);
|
||||
static void add_line_number (COLUMN *p);
|
||||
static void getoptnum (const char *n_str, int min, int *num,
|
||||
const char *errfmt);
|
||||
static void getoptnum (char const *n_str, int min, int *num,
|
||||
char const *errfmt);
|
||||
static void getoptarg (char *arg, char switch_char, char *character,
|
||||
int *number);
|
||||
static void print_files (int number_of_files, char **av);
|
||||
@@ -445,7 +445,7 @@ static void skip_read (COLUMN *p, int column_number);
|
||||
static void print_char (char c);
|
||||
static void cleanup (void);
|
||||
static void print_sep_string (void);
|
||||
static void separator_string (const char *optarg_S);
|
||||
static void separator_string (char const *optarg_S);
|
||||
|
||||
/* All of the columns to print. */
|
||||
static COLUMN *column_vector;
|
||||
@@ -845,7 +845,7 @@ parse_column_count (char const *s)
|
||||
/* Estimate length of col_sep_string with option -S. */
|
||||
|
||||
static void
|
||||
separator_string (const char *optarg_S)
|
||||
separator_string (char const *optarg_S)
|
||||
{
|
||||
size_t len = strlen (optarg_S);
|
||||
if (INT_MAX < len)
|
||||
@@ -1153,7 +1153,7 @@ main (int argc, char **argv)
|
||||
/* Parse numeric arguments, ensuring MIN <= number <= INT_MAX. */
|
||||
|
||||
static void
|
||||
getoptnum (const char *n_str, int min, int *num, const char *err)
|
||||
getoptnum (char const *n_str, int min, int *num, char const *err)
|
||||
{
|
||||
intmax_t tnum = xdectoimax (n_str, min, INT_MAX, "", err, 0);
|
||||
*num = tnum;
|
||||
|
||||
+8
-8
@@ -142,7 +142,7 @@ ARGUMENTs converted to proper type first. Variable widths are handled.\n\
|
||||
}
|
||||
|
||||
static void
|
||||
verify_numeric (const char *s, const char *end)
|
||||
verify_numeric (char const *s, char const *end)
|
||||
{
|
||||
if (errno)
|
||||
{
|
||||
@@ -237,9 +237,9 @@ print_esc_char (char c)
|
||||
is an octal digit; otherwise they are of the form \ooo. */
|
||||
|
||||
static int
|
||||
print_esc (const char *escstart, bool octal_0)
|
||||
print_esc (char const *escstart, bool octal_0)
|
||||
{
|
||||
const char *p = escstart + 1;
|
||||
char const *p = escstart + 1;
|
||||
int esc_value = 0; /* Value of \nnn escape. */
|
||||
int esc_length; /* Length of \nnn escape. */
|
||||
|
||||
@@ -310,7 +310,7 @@ print_esc (const char *escstart, bool octal_0)
|
||||
/* Print string STR, evaluating \ escapes. */
|
||||
|
||||
static void
|
||||
print_esc_string (const char *str)
|
||||
print_esc_string (char const *str)
|
||||
{
|
||||
for (; *str; str++)
|
||||
if (*str == '\\')
|
||||
@@ -328,7 +328,7 @@ print_esc_string (const char *str)
|
||||
be formatted. */
|
||||
|
||||
static void
|
||||
print_direc (const char *start, size_t length, char conversion,
|
||||
print_direc (char const *start, size_t length, char conversion,
|
||||
bool have_field_width, int field_width,
|
||||
bool have_precision, int precision,
|
||||
char const *argument)
|
||||
@@ -475,11 +475,11 @@ print_direc (const char *start, size_t length, char conversion,
|
||||
Return the number of elements of ARGV used. */
|
||||
|
||||
static int
|
||||
print_formatted (const char *format, int argc, char **argv)
|
||||
print_formatted (char const *format, int argc, char **argv)
|
||||
{
|
||||
int save_argc = argc; /* Preserve original value. */
|
||||
const char *f; /* Pointer into 'format'. */
|
||||
const char *direc_start; /* Start of % directive. */
|
||||
char const *f; /* Pointer into 'format'. */
|
||||
char const *direc_start; /* Start of % directive. */
|
||||
size_t direc_length; /* Length of % directive. */
|
||||
bool have_field_width; /* True if FIELD_WIDTH is valid. */
|
||||
int field_width = 0; /* Arg to first '*'. */
|
||||
|
||||
@@ -78,16 +78,16 @@ static bool input_reference = false; /* refs at beginning of input lines */
|
||||
static bool right_reference = false; /* output refs after right context */
|
||||
static ptrdiff_t line_width = 72; /* output line width in characters */
|
||||
static ptrdiff_t gap_size = 3; /* number of spaces between output fields */
|
||||
static const char *truncation_string = "/";
|
||||
static char const *truncation_string = "/";
|
||||
/* string used to mark line truncations */
|
||||
static const char *macro_name = "xx"; /* macro name for roff or TeX output */
|
||||
static char const *macro_name = "xx"; /* macro name for roff or TeX output */
|
||||
static enum Format output_format = UNKNOWN_FORMAT;
|
||||
/* output format */
|
||||
|
||||
static bool ignore_case = false; /* fold lower to upper for sorting */
|
||||
static const char *break_file = NULL; /* name of the 'Break chars' file */
|
||||
static const char *only_file = NULL; /* name of the 'Only words' file */
|
||||
static const char *ignore_file = NULL; /* name of the 'Ignore words' file */
|
||||
static char const *break_file = NULL; /* name of the 'Break chars' file */
|
||||
static char const *only_file = NULL; /* name of the 'Only words' file */
|
||||
static char const *ignore_file = NULL; /* name of the 'Ignore words' file */
|
||||
|
||||
/* Options that use regular expressions. */
|
||||
struct regex_data
|
||||
@@ -162,7 +162,7 @@ static WORD_TABLE only_table; /* table of words to select */
|
||||
|
||||
static int number_input_files; /* number of text input files */
|
||||
static intmax_t total_line_count; /* total number of lines seen so far */
|
||||
static const char **input_file_name; /* array of text input file names */
|
||||
static char const **input_file_name; /* array of text input file names */
|
||||
static intmax_t *file_line_count; /* array of line count values at end */
|
||||
|
||||
static BLOCK *text_buffers; /* files to study */
|
||||
@@ -295,7 +295,7 @@ matcher_error (void)
|
||||
/* Loosely adapted from GNU sh-utils printf.c code. */
|
||||
|
||||
static char *
|
||||
copy_unescaped_string (const char *string)
|
||||
copy_unescaped_string (char const *string)
|
||||
{
|
||||
char *result; /* allocated result */
|
||||
char *cursor; /* cursor in result */
|
||||
@@ -510,7 +510,7 @@ initialize_regex (void)
|
||||
`------------------------------------------------------------------------*/
|
||||
|
||||
static void
|
||||
swallow_file_in_memory (const char *file_name, BLOCK *block)
|
||||
swallow_file_in_memory (char const *file_name, BLOCK *block)
|
||||
{
|
||||
size_t used_length; /* used length in memory buffer */
|
||||
|
||||
@@ -648,7 +648,7 @@ sort_found_occurs (void)
|
||||
`----------------------------------------------------------------------*/
|
||||
|
||||
static void
|
||||
digest_break_file (const char *file_name)
|
||||
digest_break_file (char const *file_name)
|
||||
{
|
||||
BLOCK file_contents; /* to receive a copy of the file */
|
||||
char *cursor; /* cursor in file copy */
|
||||
@@ -688,7 +688,7 @@ digest_break_file (const char *file_name)
|
||||
`-----------------------------------------------------------------------*/
|
||||
|
||||
static void
|
||||
digest_word_file (const char *file_name, WORD_TABLE *table)
|
||||
digest_word_file (char const *file_name, WORD_TABLE *table)
|
||||
{
|
||||
BLOCK file_contents; /* to receive a copy of the file */
|
||||
char *cursor; /* cursor in file copy */
|
||||
@@ -1099,7 +1099,7 @@ fix_output_parameters (void)
|
||||
intmax_t line_ordinal; /* line ordinal value for reference */
|
||||
ptrdiff_t reference_width; /* width for the whole reference */
|
||||
int character; /* character ordinal */
|
||||
const char *cursor; /* cursor in some constant strings */
|
||||
char const *cursor; /* cursor in some constant strings */
|
||||
|
||||
/* In auto reference mode, the maximum width of this field is
|
||||
precomputed and subtracted from the overall line width. Add one for
|
||||
@@ -1250,10 +1250,10 @@ define_all_fields (OCCURS *occurs)
|
||||
char *left_context_start; /* start of left context */
|
||||
char *right_context_end; /* end of right context */
|
||||
char *left_field_start; /* conservative start for 'head'/'before' */
|
||||
const char *file_name; /* file name for reference */
|
||||
char const *file_name; /* file name for reference */
|
||||
intmax_t line_ordinal; /* line ordinal for reference */
|
||||
const char *buffer_start; /* start of buffered file for this occurs */
|
||||
const char *buffer_end; /* end of buffered file for this occurs */
|
||||
char const *buffer_start; /* start of buffered file for this occurs */
|
||||
char const *buffer_end; /* end of buffered file for this occurs */
|
||||
|
||||
/* Define 'keyafter', start of left context and end of right context.
|
||||
'keyafter' starts at the saved position for keyword and extend to the
|
||||
|
||||
+1
-1
@@ -155,7 +155,7 @@ main (int argc, char **argv)
|
||||
|
||||
for (; optind < argc; ++optind)
|
||||
{
|
||||
const char *fname = argv[optind];
|
||||
char const *fname = argv[optind];
|
||||
char *value = (can_mode != -1
|
||||
? canonicalize_filename_mode (fname, can_mode)
|
||||
: areadlink_with_size (fname, 63));
|
||||
|
||||
+8
-8
@@ -41,8 +41,8 @@ enum
|
||||
static bool verbose = true;
|
||||
static bool logical;
|
||||
static bool use_nuls;
|
||||
static const char *can_relative_to;
|
||||
static const char *can_relative_base;
|
||||
static char const *can_relative_to;
|
||||
static char const *can_relative_base;
|
||||
|
||||
static struct option const longopts[] =
|
||||
{
|
||||
@@ -96,7 +96,7 @@ all but the last component must exist\n\
|
||||
/* A wrapper around canonicalize_filename_mode(),
|
||||
to call it twice when in LOGICAL mode. */
|
||||
static char *
|
||||
realpath_canon (const char *fname, int can_mode)
|
||||
realpath_canon (char const *fname, int can_mode)
|
||||
{
|
||||
char *can_fname = canonicalize_filename_mode (fname, can_mode);
|
||||
if (logical && can_fname) /* canonicalize again to resolve symlinks. */
|
||||
@@ -111,7 +111,7 @@ realpath_canon (const char *fname, int can_mode)
|
||||
|
||||
/* Test whether canonical prefix is parent or match of path. */
|
||||
static bool _GL_ATTRIBUTE_PURE
|
||||
path_prefix (const char *prefix, const char *path)
|
||||
path_prefix (char const *prefix, char const *path)
|
||||
{
|
||||
/* We already know prefix[0] and path[0] are '/'. */
|
||||
prefix++;
|
||||
@@ -138,7 +138,7 @@ path_prefix (const char *prefix, const char *path)
|
||||
}
|
||||
|
||||
static bool
|
||||
isdir (const char *path)
|
||||
isdir (char const *path)
|
||||
{
|
||||
struct stat sb;
|
||||
if (stat (path, &sb) != 0)
|
||||
@@ -147,7 +147,7 @@ isdir (const char *path)
|
||||
}
|
||||
|
||||
static bool
|
||||
process_path (const char *fname, int can_mode)
|
||||
process_path (char const *fname, int can_mode)
|
||||
{
|
||||
char *can_fname = realpath_canon (fname, can_mode);
|
||||
if (!can_fname)
|
||||
@@ -174,8 +174,8 @@ main (int argc, char **argv)
|
||||
{
|
||||
bool ok = true;
|
||||
int can_mode = CAN_ALL_BUT_LAST;
|
||||
const char *relative_to = NULL;
|
||||
const char *relative_base = NULL;
|
||||
char const *relative_to = NULL;
|
||||
char const *relative_base = NULL;
|
||||
|
||||
initialize_main (&argc, &argv);
|
||||
set_program_name (argv[0]);
|
||||
|
||||
+4
-4
@@ -27,7 +27,7 @@
|
||||
of canonical PATH1 and PATH2, ensuring only full path components
|
||||
are matched. Return 0 on no match. */
|
||||
static int _GL_ATTRIBUTE_PURE
|
||||
path_common_prefix (const char *path1, const char *path2)
|
||||
path_common_prefix (char const *path1, char const *path2)
|
||||
{
|
||||
int i = 0;
|
||||
int ret = 0;
|
||||
@@ -85,7 +85,7 @@ buffer_or_output (const char* str, char **pbuf, size_t *plen)
|
||||
/* Output the relative representation if possible.
|
||||
If BUF is non-NULL, write to that buffer rather than to stdout. */
|
||||
bool
|
||||
relpath (const char *can_fname, const char *can_reldir, char *buf, size_t len)
|
||||
relpath (char const *can_fname, char const *can_reldir, char *buf, size_t len)
|
||||
{
|
||||
bool buf_err = false;
|
||||
|
||||
@@ -94,8 +94,8 @@ relpath (const char *can_fname, const char *can_reldir, char *buf, size_t len)
|
||||
if (!common_index)
|
||||
return false;
|
||||
|
||||
const char *relto_suffix = can_reldir + common_index;
|
||||
const char *fname_suffix = can_fname + common_index;
|
||||
char const *relto_suffix = can_reldir + common_index;
|
||||
char const *fname_suffix = can_fname + common_index;
|
||||
|
||||
/* Skip over extraneous '/'. */
|
||||
if (*relto_suffix == '/')
|
||||
|
||||
+1
-1
@@ -20,6 +20,6 @@
|
||||
# define _RELPATH_H
|
||||
|
||||
extern bool
|
||||
relpath (const char *can_fname, const char *can_reldir, char *buf, size_t len);
|
||||
relpath (char const *can_fname, char const *can_reldir, char *buf, size_t len);
|
||||
|
||||
#endif
|
||||
+2
-2
@@ -114,7 +114,7 @@ defaultcon (struct selabel_handle *selabel_handle,
|
||||
char *scon = NULL;
|
||||
char *tcon = NULL;
|
||||
context_t scontext = 0, tcontext = 0;
|
||||
const char *contype;
|
||||
char const *contype;
|
||||
char *constr;
|
||||
char *newpath = NULL;
|
||||
|
||||
@@ -182,7 +182,7 @@ restorecon_private (struct selabel_handle *selabel_handle, char const *path)
|
||||
char *scon = NULL;
|
||||
char *tcon = NULL;
|
||||
context_t scontext = 0, tcontext = 0;
|
||||
const char *contype;
|
||||
char const *contype;
|
||||
char *constr;
|
||||
int fd;
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@ struct layout
|
||||
Return if the string is correct else signal error. */
|
||||
|
||||
static operand
|
||||
scan_arg (const char *arg)
|
||||
scan_arg (char const *arg)
|
||||
{
|
||||
operand ret;
|
||||
|
||||
|
||||
+1
-1
@@ -135,7 +135,7 @@ complement_rp (void)
|
||||
{ .lo = UINTMAX_MAX, .hi = UINTMAX_MAX } ];
|
||||
*/
|
||||
void
|
||||
set_fields (const char *fieldstr, unsigned int options)
|
||||
set_fields (char const *fieldstr, unsigned int options)
|
||||
{
|
||||
uintmax_t initial = 1; /* Value of first number in a range. */
|
||||
uintmax_t value = 0; /* If nonzero, a number being accumulated. */
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ enum
|
||||
};
|
||||
|
||||
/* allocates and initializes the FRP array and N_FRP count */
|
||||
extern void set_fields (const char *fieldstr, unsigned int options);
|
||||
extern void set_fields (char const *fieldstr, unsigned int options);
|
||||
|
||||
/* frees memory allocated by set_fields() */
|
||||
extern void reset_fields (void);
|
||||
|
||||
+1
-1
@@ -120,7 +120,7 @@ main (int argc, char **argv)
|
||||
for (int i = optind; i < argc; i++)
|
||||
{
|
||||
double s;
|
||||
const char *p;
|
||||
char const *p;
|
||||
if (! (xstrtod (argv[i], &p, &s, cl_strtod) || errno == ERANGE)
|
||||
/* Nonnegative interval. */
|
||||
|| ! (0 <= s)
|
||||
|
||||
+2
-2
@@ -370,9 +370,9 @@ static unsigned int nmerge = NMERGE_DEFAULT;
|
||||
This can be used safely from signal handlers,
|
||||
and between fork and exec of multithreaded processes. */
|
||||
|
||||
static void async_safe_die (int, const char *) ATTRIBUTE_NORETURN;
|
||||
static void async_safe_die (int, char const *) ATTRIBUTE_NORETURN;
|
||||
static void
|
||||
async_safe_die (int errnum, const char *errstr)
|
||||
async_safe_die (int errnum, char const *errstr)
|
||||
{
|
||||
ignore_value (write (STDERR_FILENO, errstr, strlen (errstr)));
|
||||
|
||||
|
||||
+3
-3
@@ -84,7 +84,7 @@ static size_t suffix_length;
|
||||
static char const *suffix_alphabet = "abcdefghijklmnopqrstuvwxyz";
|
||||
|
||||
/* Numerical suffix start value. */
|
||||
static const char *numeric_suffix_start;
|
||||
static char const *numeric_suffix_start;
|
||||
|
||||
/* Additional suffix to append to output file names. */
|
||||
static char const *additional_suffix;
|
||||
@@ -454,7 +454,7 @@ new_name:
|
||||
/* Create or truncate a file. */
|
||||
|
||||
static int
|
||||
create (const char *name)
|
||||
create (char const *name)
|
||||
{
|
||||
if (!filter_command)
|
||||
{
|
||||
@@ -594,7 +594,7 @@ closeout (FILE *fp, int fd, pid_t pid, char const *name)
|
||||
Return true if successful. */
|
||||
|
||||
static bool
|
||||
cwrite (bool new_file_flag, const char *bp, size_t bytes)
|
||||
cwrite (bool new_file_flag, char const *bp, size_t bytes)
|
||||
{
|
||||
if (new_file_flag)
|
||||
{
|
||||
|
||||
+1
-1
@@ -1343,7 +1343,7 @@ do_stat (char const *filename, char const *format, char const *format2)
|
||||
int flags = 0;
|
||||
struct stat st;
|
||||
struct statx stx = { 0, };
|
||||
const char *pathname = filename;
|
||||
char const *pathname = filename;
|
||||
struct print_args pa;
|
||||
pa.st = &st;
|
||||
pa.btime = (struct timespec) {-1, -1};
|
||||
|
||||
+1
-1
@@ -133,7 +133,7 @@ and are thus unaffected by 'stdbuf' settings.\n\
|
||||
dladdr(), pstat_getpathname(), etc. */
|
||||
|
||||
static void
|
||||
set_program_path (const char *arg)
|
||||
set_program_path (char const *arg)
|
||||
{
|
||||
if (strchr (arg, '/')) /* Use absolute or relative paths directly. */
|
||||
{
|
||||
|
||||
+18
-18
@@ -197,7 +197,7 @@ enum mode_type
|
||||
/* Each mode. */
|
||||
struct mode_info
|
||||
{
|
||||
const char *name; /* Name given on command line. */
|
||||
char const *name; /* Name given on command line. */
|
||||
enum mode_type type; /* Which structure element to change. */
|
||||
char flags; /* Setting and display options. */
|
||||
unsigned long bits; /* Bits to set for this mode. */
|
||||
@@ -383,7 +383,7 @@ static struct mode_info const mode_info[] =
|
||||
/* Control character settings. */
|
||||
struct control_info
|
||||
{
|
||||
const char *name; /* Name given on command line. */
|
||||
char const *name; /* Name given on command line. */
|
||||
cc_t saneval; /* Value to set for 'stty sane'. */
|
||||
size_t offset; /* Offset in c_cc. */
|
||||
};
|
||||
@@ -443,22 +443,22 @@ static bool recover_mode (char const *arg, struct termios *mode);
|
||||
static int screen_columns (void);
|
||||
static bool set_mode (struct mode_info const *info, bool reversed,
|
||||
struct termios *mode);
|
||||
static unsigned long int integer_arg (const char *s, unsigned long int max);
|
||||
static speed_t string_to_baud (const char *arg);
|
||||
static unsigned long int integer_arg (char const *s, unsigned long int max);
|
||||
static speed_t string_to_baud (char const *arg);
|
||||
static tcflag_t *mode_type_flag (enum mode_type type, struct termios *mode);
|
||||
static void display_all (struct termios *mode, char const *device_name);
|
||||
static void display_changed (struct termios *mode);
|
||||
static void display_recoverable (struct termios *mode);
|
||||
static void display_settings (enum output_type output_type,
|
||||
struct termios *mode,
|
||||
const char *device_name);
|
||||
char const *device_name);
|
||||
static void display_speed (struct termios *mode, bool fancy);
|
||||
static void display_window_size (bool fancy, char const *device_name);
|
||||
static void sane_mode (struct termios *mode);
|
||||
static void set_control_char (struct control_info const *info,
|
||||
const char *arg,
|
||||
char const *arg,
|
||||
struct termios *mode);
|
||||
static void set_speed (enum speed_setting type, const char *arg,
|
||||
static void set_speed (enum speed_setting type, char const *arg,
|
||||
struct termios *mode);
|
||||
static void set_window_size (int rows, int cols, char const *device_name);
|
||||
|
||||
@@ -481,7 +481,7 @@ static struct option const longopts[] =
|
||||
{NULL, 0, NULL, 0}
|
||||
};
|
||||
|
||||
static void wrapf (const char *message, ...)
|
||||
static void wrapf (char const *message, ...)
|
||||
__attribute__ ((__format__ (__printf__, 1, 2)));
|
||||
|
||||
/* Print format string MESSAGE and optional args.
|
||||
@@ -489,7 +489,7 @@ static void wrapf (const char *message, ...)
|
||||
Print a space first unless MESSAGE will start a new line. */
|
||||
|
||||
static void
|
||||
wrapf (const char *message,...)
|
||||
wrapf (char const *message,...)
|
||||
{
|
||||
va_list args;
|
||||
char *buf;
|
||||
@@ -1084,7 +1084,7 @@ settings, CHAR is taken literally, or coded as in ^c, 0x37, 0177 or\n\
|
||||
with a device, and only validates specified settings. */
|
||||
|
||||
static void
|
||||
apply_settings (bool checking, const char *device_name,
|
||||
apply_settings (bool checking, char const *device_name,
|
||||
char * const *settings, int n_settings,
|
||||
struct termios *mode, bool *speed_was_set,
|
||||
bool *require_set_attr)
|
||||
@@ -1281,7 +1281,7 @@ main (int argc, char **argv)
|
||||
bool recoverable_output;
|
||||
bool noargs = true;
|
||||
char *file_name = NULL;
|
||||
const char *device_name;
|
||||
char const *device_name;
|
||||
|
||||
initialize_main (&argc, &argv);
|
||||
set_program_name (argv[0]);
|
||||
@@ -1672,7 +1672,7 @@ set_mode (struct mode_info const *info, bool reversed, struct termios *mode)
|
||||
}
|
||||
|
||||
static void
|
||||
set_control_char (struct control_info const *info, const char *arg,
|
||||
set_control_char (struct control_info const *info, char const *arg,
|
||||
struct termios *mode)
|
||||
{
|
||||
unsigned long int value;
|
||||
@@ -1696,7 +1696,7 @@ set_control_char (struct control_info const *info, const char *arg,
|
||||
}
|
||||
|
||||
static void
|
||||
set_speed (enum speed_setting type, const char *arg, struct termios *mode)
|
||||
set_speed (enum speed_setting type, char const *arg, struct termios *mode)
|
||||
{
|
||||
speed_t baud;
|
||||
|
||||
@@ -2133,7 +2133,7 @@ recover_mode (char const *arg, struct termios *mode)
|
||||
|
||||
struct speed_map
|
||||
{
|
||||
const char *string; /* ASCII representation. */
|
||||
char const *string; /* ASCII representation. */
|
||||
speed_t speed; /* Internal form. */
|
||||
unsigned long int value; /* Numeric value. */
|
||||
};
|
||||
@@ -2208,7 +2208,7 @@ static struct speed_map const speeds[] =
|
||||
};
|
||||
|
||||
static speed_t _GL_ATTRIBUTE_PURE
|
||||
string_to_baud (const char *arg)
|
||||
string_to_baud (char const *arg)
|
||||
{
|
||||
for (int i = 0; speeds[i].string != NULL; ++i)
|
||||
if (STREQ (arg, speeds[i].string))
|
||||
@@ -2263,7 +2263,7 @@ sane_mode (struct termios *mode)
|
||||
/* Return a string that is the printable representation of character CH. */
|
||||
/* Adapted from 'cat' by Torbjorn Granlund. */
|
||||
|
||||
static const char *
|
||||
static char const *
|
||||
visible (cc_t ch)
|
||||
{
|
||||
static char buf[10];
|
||||
@@ -2308,7 +2308,7 @@ visible (cc_t ch)
|
||||
*bpout++ = ch + 64;
|
||||
}
|
||||
*bpout = '\0';
|
||||
return (const char *) buf;
|
||||
return (char const *) buf;
|
||||
}
|
||||
|
||||
/* Parse string S as an integer, using decimal radix by default,
|
||||
@@ -2316,7 +2316,7 @@ visible (cc_t ch)
|
||||
larger than MAXVAL. */
|
||||
|
||||
static unsigned long int
|
||||
integer_arg (const char *s, unsigned long int maxval)
|
||||
integer_arg (char const *s, unsigned long int maxval)
|
||||
{
|
||||
return xnumtoumax (s, 0, 0, maxval, "bB", _("invalid integer argument"), 0);
|
||||
}
|
||||
@@ -85,7 +85,7 @@ Print checksum and block counts for each FILE.\n\
|
||||
Return true if successful. */
|
||||
|
||||
static bool
|
||||
bsd_sum_file (const char *file, int print_name)
|
||||
bsd_sum_file (char const *file, int print_name)
|
||||
{
|
||||
FILE *fp;
|
||||
int checksum = 0; /* The checksum mod 2^16. */
|
||||
@@ -149,7 +149,7 @@ bsd_sum_file (const char *file, int print_name)
|
||||
Return true if successful. */
|
||||
|
||||
static bool
|
||||
sysv_sum_file (const char *file, int print_name)
|
||||
sysv_sum_file (char const *file, int print_name)
|
||||
{
|
||||
int fd;
|
||||
unsigned char buf[8192];
|
||||
@@ -223,7 +223,7 @@ main (int argc, char **argv)
|
||||
bool ok;
|
||||
int optc;
|
||||
int files_given;
|
||||
bool (*sum_func) (const char *, int) = bsd_sum_file;
|
||||
bool (*sum_func) (char const *, int) = bsd_sum_file;
|
||||
|
||||
initialize_main (&argc, &argv);
|
||||
set_program_name (argv[0]);
|
||||
|
||||
+2
-2
@@ -453,7 +453,7 @@ enum
|
||||
# define ASSIGN_STRDUPA(DEST, S) \
|
||||
do \
|
||||
{ \
|
||||
const char *s_ = (S); \
|
||||
char const *s_ = (S); \
|
||||
size_t len_ = strlen (s_) + 1; \
|
||||
char *tmp_dest_ = alloca (len_); \
|
||||
DEST = memcpy (tmp_dest_, s_, len_); \
|
||||
@@ -656,7 +656,7 @@ emit_ancillary_info (char const *program)
|
||||
|
||||
/* Don't output this redundant message for English locales.
|
||||
Note we still output for 'C' so that it gets included in the man page. */
|
||||
const char *lc_messages = setlocale (LC_MESSAGES, NULL);
|
||||
char const *lc_messages = setlocale (LC_MESSAGES, NULL);
|
||||
if (lc_messages && STRNCMP_LIT (lc_messages, "en_"))
|
||||
{
|
||||
/* TRANSLATORS: Replace LANG_CODE in this URL with your language code
|
||||
|
||||
@@ -156,7 +156,7 @@ Write each FILE to standard output, last line first.\n\
|
||||
If START is NULL, just flush the buffer. */
|
||||
|
||||
static void
|
||||
output (const char *start, const char *past_end)
|
||||
output (char const *start, char const *past_end)
|
||||
{
|
||||
static char buffer[WRITESIZE];
|
||||
static size_t bytes_in_buffer = 0;
|
||||
@@ -190,7 +190,7 @@ output (const char *start, const char *past_end)
|
||||
Return true if successful. */
|
||||
|
||||
static bool
|
||||
tac_seekable (int input_fd, const char *file, off_t file_pos)
|
||||
tac_seekable (int input_fd, char const *file, off_t file_pos)
|
||||
{
|
||||
/* Pointer to the location in 'G_buffer' where the search for
|
||||
the next separator will begin. */
|
||||
@@ -393,7 +393,7 @@ tac_seekable (int input_fd, const char *file, off_t file_pos)
|
||||
But this isn't a big deal, since the code is used only on WOE/DOS
|
||||
systems, and few people invoke tac on that many nonseekable files. */
|
||||
|
||||
static const char *file_to_remove;
|
||||
static char const *file_to_remove;
|
||||
static FILE *fp_to_close;
|
||||
|
||||
static void
|
||||
@@ -543,7 +543,7 @@ copy_to_temp (FILE **g_tmp, char **g_tempfile, int input_fd, char const *file)
|
||||
Return true if successful. */
|
||||
|
||||
static bool
|
||||
tac_nonseekable (int input_fd, const char *file)
|
||||
tac_nonseekable (int input_fd, char const *file)
|
||||
{
|
||||
FILE *tmp_stream;
|
||||
char *tmp_file;
|
||||
@@ -560,7 +560,7 @@ tac_nonseekable (int input_fd, const char *file)
|
||||
Return true if successful. */
|
||||
|
||||
static bool
|
||||
tac_file (const char *filename)
|
||||
tac_file (char const *filename)
|
||||
{
|
||||
bool ok;
|
||||
off_t file_size;
|
||||
@@ -602,7 +602,7 @@ tac_file (const char *filename)
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
const char *error_message; /* Return value from re_compile_pattern. */
|
||||
char const *error_message; /* Return value from re_compile_pattern. */
|
||||
int optc;
|
||||
bool ok;
|
||||
size_t half_buffer_size;
|
||||
|
||||
+15
-15
@@ -409,7 +409,7 @@ record_open_fd (struct File_spec *f, int fd,
|
||||
/* Close the file with descriptor FD and name FILENAME. */
|
||||
|
||||
static void
|
||||
close_fd (int fd, const char *filename)
|
||||
close_fd (int fd, char const *filename)
|
||||
{
|
||||
if (fd != -1 && fd != STDIN_FILENO && close (fd))
|
||||
{
|
||||
@@ -418,7 +418,7 @@ close_fd (int fd, const char *filename)
|
||||
}
|
||||
|
||||
static void
|
||||
write_header (const char *pretty_filename)
|
||||
write_header (char const *pretty_filename)
|
||||
{
|
||||
static bool first_file = true;
|
||||
|
||||
@@ -446,7 +446,7 @@ xwrite_stdout (char const *buffer, size_t n_bytes)
|
||||
Return the number of bytes read from the file. */
|
||||
|
||||
static uintmax_t
|
||||
dump_remainder (bool want_header, const char *pretty_filename, int fd,
|
||||
dump_remainder (bool want_header, char const *pretty_filename, int fd,
|
||||
uintmax_t n_bytes)
|
||||
{
|
||||
uintmax_t n_written;
|
||||
@@ -532,7 +532,7 @@ xlseek (int fd, off_t offset, int whence, char const *filename)
|
||||
Return true if successful. */
|
||||
|
||||
static bool
|
||||
file_lines (const char *pretty_filename, int fd, uintmax_t n_lines,
|
||||
file_lines (char const *pretty_filename, int fd, uintmax_t n_lines,
|
||||
off_t start_pos, off_t end_pos, uintmax_t *read_pos)
|
||||
{
|
||||
char buffer[BUFSIZ];
|
||||
@@ -620,7 +620,7 @@ file_lines (const char *pretty_filename, int fd, uintmax_t n_lines,
|
||||
Return true if successful. */
|
||||
|
||||
static bool
|
||||
pipe_lines (const char *pretty_filename, int fd, uintmax_t n_lines,
|
||||
pipe_lines (char const *pretty_filename, int fd, uintmax_t n_lines,
|
||||
uintmax_t *read_pos)
|
||||
{
|
||||
struct linebuffer
|
||||
@@ -759,7 +759,7 @@ free_lbuffers:
|
||||
Return true if successful. */
|
||||
|
||||
static bool
|
||||
pipe_bytes (const char *pretty_filename, int fd, uintmax_t n_bytes,
|
||||
pipe_bytes (char const *pretty_filename, int fd, uintmax_t n_bytes,
|
||||
uintmax_t *read_pos)
|
||||
{
|
||||
struct charbuffer
|
||||
@@ -860,7 +860,7 @@ free_cbuffers:
|
||||
Return 1 on error, 0 if ok, -1 if EOF. */
|
||||
|
||||
static int
|
||||
start_bytes (const char *pretty_filename, int fd, uintmax_t n_bytes,
|
||||
start_bytes (char const *pretty_filename, int fd, uintmax_t n_bytes,
|
||||
uintmax_t *read_pos)
|
||||
{
|
||||
char buffer[BUFSIZ];
|
||||
@@ -895,7 +895,7 @@ start_bytes (const char *pretty_filename, int fd, uintmax_t n_bytes,
|
||||
Return 1 on error, 0 if ok, -1 if EOF. */
|
||||
|
||||
static int
|
||||
start_lines (const char *pretty_filename, int fd, uintmax_t n_lines,
|
||||
start_lines (char const *pretty_filename, int fd, uintmax_t n_lines,
|
||||
uintmax_t *read_pos)
|
||||
{
|
||||
if (n_lines == 0)
|
||||
@@ -935,7 +935,7 @@ start_lines (const char *pretty_filename, int fd, uintmax_t n_lines,
|
||||
If fstatfs fails, give a diagnostic and return true.
|
||||
If fstatfs cannot be called, return true. */
|
||||
static bool
|
||||
fremote (int fd, const char *name)
|
||||
fremote (int fd, char const *name)
|
||||
{
|
||||
bool remote = true; /* be conservative (poll by default). */
|
||||
|
||||
@@ -1841,7 +1841,7 @@ tail_forever_inotify (int wd, struct File_spec *f, size_t n_files,
|
||||
Return true if successful. */
|
||||
|
||||
static bool
|
||||
tail_bytes (const char *pretty_filename, int fd, uintmax_t n_bytes,
|
||||
tail_bytes (char const *pretty_filename, int fd, uintmax_t n_bytes,
|
||||
uintmax_t *read_pos)
|
||||
{
|
||||
struct stat stats;
|
||||
@@ -1904,7 +1904,7 @@ tail_bytes (const char *pretty_filename, int fd, uintmax_t n_bytes,
|
||||
Return true if successful. */
|
||||
|
||||
static bool
|
||||
tail_lines (const char *pretty_filename, int fd, uintmax_t n_lines,
|
||||
tail_lines (char const *pretty_filename, int fd, uintmax_t n_lines,
|
||||
uintmax_t *read_pos)
|
||||
{
|
||||
struct stat stats;
|
||||
@@ -1966,7 +1966,7 @@ tail_lines (const char *pretty_filename, int fd, uintmax_t n_lines,
|
||||
Return true if successful. */
|
||||
|
||||
static bool
|
||||
tail (const char *filename, int fd, uintmax_t n_units,
|
||||
tail (char const *filename, int fd, uintmax_t n_units,
|
||||
uintmax_t *read_pos)
|
||||
{
|
||||
*read_pos = 0;
|
||||
@@ -2089,9 +2089,9 @@ tail_file (struct File_spec *f, uintmax_t n_units)
|
||||
static bool
|
||||
parse_obsolete_option (int argc, char * const *argv, uintmax_t *n_units)
|
||||
{
|
||||
const char *p;
|
||||
const char *n_string;
|
||||
const char *n_string_end;
|
||||
char const *p;
|
||||
char const *n_string;
|
||||
char const *n_string_end;
|
||||
int default_count = DEFAULT_N_LINES;
|
||||
bool t_from_start;
|
||||
bool t_count_lines = true;
|
||||
|
||||
+2
-2
@@ -349,10 +349,10 @@ apply_time_suffix (double *x, char suffix_char)
|
||||
}
|
||||
|
||||
static double
|
||||
parse_duration (const char *str)
|
||||
parse_duration (char const *str)
|
||||
{
|
||||
double duration;
|
||||
const char *ep;
|
||||
char const *ep;
|
||||
|
||||
if (! (xstrtod (str, &ep, &duration, cl_strtod) || errno == ERANGE)
|
||||
/* Nonnegative interval. */
|
||||
|
||||
+1
-1
@@ -120,7 +120,7 @@ get_reldate (struct timespec *result,
|
||||
Return true if successful. */
|
||||
|
||||
static bool
|
||||
touch (const char *file)
|
||||
touch (char const *file)
|
||||
{
|
||||
bool ok;
|
||||
int fd = -1;
|
||||
|
||||
+4
-4
@@ -52,7 +52,7 @@ struct successor
|
||||
/* Each string is held in core as the head of a list of successors. */
|
||||
struct item
|
||||
{
|
||||
const char *str;
|
||||
char const *str;
|
||||
struct item *left, *right;
|
||||
int balance; /* -1, 0, or +1 */
|
||||
size_t count;
|
||||
@@ -99,7 +99,7 @@ Write totally ordered list consistent with the partial ordering in FILE.\n\
|
||||
|
||||
/* Create a new item/node for STR. */
|
||||
static struct item *
|
||||
new_item (const char *str)
|
||||
new_item (char const *str)
|
||||
{
|
||||
struct item *k = xmalloc (sizeof *k);
|
||||
|
||||
@@ -124,7 +124,7 @@ new_item (const char *str)
|
||||
Volume 3/Searching and Sorting, pages 455--457. */
|
||||
|
||||
static struct item *
|
||||
search_item (struct item *root, const char *str)
|
||||
search_item (struct item *root, char const *str)
|
||||
{
|
||||
struct item *p, *q, *r, *s, *t;
|
||||
int a;
|
||||
@@ -433,7 +433,7 @@ walk_tree (struct item *root, bool (*action) (struct item *))
|
||||
/* Do a topological sort on FILE. Return true if successful. */
|
||||
|
||||
static bool
|
||||
tsort (const char *file)
|
||||
tsort (char const *file)
|
||||
{
|
||||
bool ok = true;
|
||||
struct item *root;
|
||||
|
||||
+1
-1
@@ -317,7 +317,7 @@ writeline (struct linebuffer const *line,
|
||||
If either is "-", use the standard I/O stream for it instead. */
|
||||
|
||||
static void
|
||||
check_file (const char *infile, const char *outfile, char delimiter)
|
||||
check_file (char const *infile, char const *outfile, char delimiter)
|
||||
{
|
||||
struct linebuffer lb1, lb2;
|
||||
struct linebuffer *thisline, *prevline;
|
||||
|
||||
+1
-1
@@ -174,7 +174,7 @@ print_uptime (size_t n, const STRUCT_UTMP *this)
|
||||
utmp file. */
|
||||
|
||||
static void
|
||||
uptime (const char *filename, int options)
|
||||
uptime (char const *filename, int options)
|
||||
{
|
||||
size_t n_users;
|
||||
STRUCT_UTMP *utmp_buf = NULL;
|
||||
|
||||
+1
-1
@@ -82,7 +82,7 @@ list_entries_users (size_t n, const STRUCT_UTMP *this)
|
||||
Use read_utmp OPTIONS to read FILENAME. */
|
||||
|
||||
static void
|
||||
users (const char *filename, int options)
|
||||
users (char const *filename, int options)
|
||||
{
|
||||
size_t n_users;
|
||||
STRUCT_UTMP *utmp_buf;
|
||||
|
||||
@@ -173,7 +173,7 @@ write_counts (uintmax_t lines,
|
||||
uintmax_t chars,
|
||||
uintmax_t bytes,
|
||||
uintmax_t linelength,
|
||||
const char *file)
|
||||
char const *file)
|
||||
{
|
||||
static char const format_sp_int[] = " %*s";
|
||||
char const *format_int = format_sp_int + 1;
|
||||
@@ -379,7 +379,7 @@ wc (int fd, char const *file_x, struct fstatus *fstatus, off_t current_pos)
|
||||
|
||||
while ((bytes_read = safe_read (fd, buf + prev, BUFFER_SIZE - prev)) > 0)
|
||||
{
|
||||
const char *p;
|
||||
char const *p;
|
||||
# if SUPPORT_OLD_MBRTOWC
|
||||
mbstate_t backup_state;
|
||||
# endif
|
||||
@@ -519,7 +519,7 @@ wc (int fd, char const *file_x, struct fstatus *fstatus, off_t current_pos)
|
||||
|
||||
while ((bytes_read = safe_read (fd, buf, BUFFER_SIZE)) > 0)
|
||||
{
|
||||
const char *p = buf;
|
||||
char const *p = buf;
|
||||
if (bytes_read == SAFE_READ_ERROR)
|
||||
{
|
||||
error (0, errno, "%s", quotef (file));
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
sprintf (Var, "%ld", (long int) (Utmp_ent->ut_pid))
|
||||
#else
|
||||
# define PIDSTR_DECL_AND_INIT(Var, Utmp_ent) \
|
||||
const char *Var = ""
|
||||
char const *Var = ""
|
||||
#endif
|
||||
|
||||
#if HAVE_STRUCT_XTMP_UT_ID
|
||||
@@ -184,7 +184,7 @@ static struct option const longopts[] =
|
||||
/* Return a string representing the time between WHEN and now.
|
||||
BOOTTIME is the time of last reboot.
|
||||
FIXME: locale? */
|
||||
static const char *
|
||||
static char const *
|
||||
idle_string (time_t when, time_t boottime)
|
||||
{
|
||||
static time_t now = TYPE_MINIMUM (time_t);
|
||||
@@ -214,7 +214,7 @@ idle_string (time_t when, time_t boottime)
|
||||
}
|
||||
|
||||
/* Return a time string. */
|
||||
static const char *
|
||||
static char const *
|
||||
time_string (const STRUCT_UTMP *utmp_ent)
|
||||
{
|
||||
static char buf[INT_STRLEN_BOUND (intmax_t) + sizeof "-%m-%d %H:%M"];
|
||||
@@ -241,10 +241,10 @@ time_string (const STRUCT_UTMP *utmp_ent)
|
||||
will need tweaking if any of the localization stuff is done, or for 64 bit
|
||||
pids, etc. */
|
||||
static void
|
||||
print_line (int userlen, const char *user, const char state,
|
||||
int linelen, const char *line,
|
||||
const char *time_str, const char *idle, const char *pid,
|
||||
const char *comment, const char *exitstr)
|
||||
print_line (int userlen, char const *user, const char state,
|
||||
int linelen, char const *line,
|
||||
char const *time_str, char const *idle, char const *pid,
|
||||
char const *comment, char const *exitstr)
|
||||
{
|
||||
static char mesg[3] = { ' ', 'x', '\0' };
|
||||
char *buf;
|
||||
@@ -618,7 +618,7 @@ scan_entries (size_t n, const STRUCT_UTMP *utmp_buf)
|
||||
/* Display a list of who is on the system, according to utmp file FILENAME.
|
||||
Use read_utmp OPTIONS to read the file. */
|
||||
static void
|
||||
who (const char *filename, int options)
|
||||
who (char const *filename, int options)
|
||||
{
|
||||
size_t n_users;
|
||||
STRUCT_UTMP *utmp_buf;
|
||||
|
||||
Reference in new issue
Block a user