]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: omit function defn extern
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 19 Feb 2025 04:09:10 +0000 (20:09 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 19 Feb 2025 04:10:19 +0000 (20:10 -0800)
* src/chown-core.c, src/copy.c, src/cp-hash.c, src/csplit.c:
* src/expand-common.c, src/find-mount-point.c, src/force-link.c:
* src/group-list.c, src/iopoll.c, src/operand2sig.c:
* src/show-date.c, src/wc_avx2.c:
Omit unnecessary ‘extern ’ at the start of function defns.
This is less wordy, makes it a bit easier to grep for issues such
as the missing consistency checking in cksum.

12 files changed:
src/chown-core.c
src/copy.c
src/cp-hash.c
src/csplit.c
src/expand-common.c
src/find-mount-point.c
src/force-link.c
src/group-list.c
src/iopoll.c
src/operand2sig.c
src/show-date.c
src/wc_avx2.c

index 0e08f93e609c5de8fa271b4e982df4608a663d97..cb7f9093fdfb798c40d0fd6dd85165668d7c209b 100644 (file)
@@ -54,7 +54,7 @@ enum RCH_status
     RC_error
   };
 
-extern void
+void
 chopt_init (struct Chown_option *chopt)
 {
   chopt->verbosity = V_off;
@@ -66,7 +66,7 @@ chopt_init (struct Chown_option *chopt)
   chopt->group_name = nullptr;
 }
 
-extern void
+void
 chopt_free (struct Chown_option *chopt)
 {
   free (chopt->user_name);
@@ -99,7 +99,7 @@ gid_to_str (gid_t gid)
    and return it.  If there's no corresponding group name, use the decimal
    representation of the ID.  */
 
-extern char *
+char *
 gid_to_name (gid_t gid)
 {
   struct group *grp = getgrgid (gid);
@@ -110,7 +110,7 @@ gid_to_name (gid_t gid)
    and return it.  If there's no corresponding user name, use the decimal
    representation of the ID.  */
 
-extern char *
+char *
 uid_to_name (uid_t uid)
 {
   struct passwd *pwd = getpwuid (uid);
@@ -532,7 +532,7 @@ change_file_owner (FTS *fts, FTSENT *ent,
    If REQUIRED_UID and/or REQUIRED_GID is not -1, then change only
    files with user ID and group ID that match the non-(-1) value(s).
    Return true if successful.  */
-extern bool
+bool
 chown_files (char **files, int bit_flags,
              uid_t uid, gid_t gid,
              uid_t required_uid, gid_t required_gid,
index 22d9830ba6a01f72f27669e3013239c33f83279e..bb98ff7359d08e3de42b127c08ae75d09e75c766 100644 (file)
@@ -2017,7 +2017,7 @@ overwrite_ok (struct cp_options const *x, char const *dst_name,
 
 /* Initialize the hash table implementing a set of F_triple entries
    corresponding to destination files.  */
-extern void
+void
 dest_info_init (struct cp_options *x)
 {
   x->dest_info
@@ -2032,7 +2032,7 @@ dest_info_init (struct cp_options *x)
 
 /* Initialize the hash table implementing a set of F_triple entries
    corresponding to source files listed on the command line.  */
-extern void
+void
 src_info_init (struct cp_options *x)
 {
 
@@ -3374,7 +3374,7 @@ valid_options (const struct cp_options *co)
    the source was simply renamed to the destination.
    Return true if successful.  */
 
-extern bool
+bool
 copy (char const *src_name, char const *dst_name,
       int dst_dirfd, char const *dst_relname,
       int nonexistent_dst, const struct cp_options *options,
@@ -3402,7 +3402,7 @@ copy (char const *src_name, char const *dst_name,
 
 /* Set *X to the default options for a value of type struct cp_options.  */
 
-extern void
+void
 cp_options_default (struct cp_options *x)
 {
   memset (x, 0, sizeof *x);
@@ -3428,7 +3428,7 @@ cp_options_default (struct cp_options *x)
    the error number that chown failed with and X is the copying
    option set.  */
 
-extern bool
+bool
 chown_failure_ok (struct cp_options const *x)
 {
   /* If non-root uses -p, it's ok if we can't preserve ownership.
@@ -3462,7 +3462,7 @@ owner_failure_ok (struct cp_options const *x)
    some operating systems (e.g., GNU/Linux's "POSIX" ACLs) use that
    ACL's mask rather than the process umask.  Currently, the callers
    of cached_umask incorrectly assume that this situation cannot occur.  */
-extern mode_t
+mode_t
 cached_umask (void)
 {
   static mode_t mask = (mode_t) -1;
index e42bd7e3002cfd05956333c09efddfff15a24500..c6f77521810ddb82b14e395fcab3fc2a40e885cd 100644 (file)
@@ -78,7 +78,7 @@ src_to_dest_free (void *x)
 
 /* Remove the entry matching INO/DEV from the table
    that maps source ino/dev to destination file name.  */
-extern void
+void
 forget_created (ino_t ino, dev_t dev)
 {
   struct Src_to_dest probe;
@@ -96,7 +96,7 @@ forget_created (ino_t ino, dev_t dev)
 /* If INO/DEV correspond to an already-copied source file, return the
    name of the corresponding destination file.  Otherwise, return nullptr.  */
 
-extern char *
+char *
 src_to_dest_lookup (ino_t ino, dev_t dev)
 {
   struct Src_to_dest ent;
@@ -111,7 +111,7 @@ src_to_dest_lookup (ino_t ino, dev_t dev)
    to the list of files we have copied.
    Return nullptr if inserted, otherwise a non-null pointer. */
 
-extern char *
+char *
 remember_copied (char const *name, ino_t ino, dev_t dev)
 {
   struct Src_to_dest *ent;
@@ -143,7 +143,7 @@ remember_copied (char const *name, ino_t ino, dev_t dev)
 }
 
 /* Initialize the hash table.  */
-extern void
+void
 hash_init (void)
 {
   src_to_dest = hash_initialize (INITIAL_TABLE_SIZE, nullptr,
index 9119dcf5a32522796bd6e4e43dc803432097cf29..f706ca4c7e621b2b36c141818cb1052fd93dbcb8 100644 (file)
@@ -221,7 +221,7 @@ cleanup_fatal (void)
   exit (EXIT_FAILURE);
 }
 
-extern void
+void
 xalloc_die (void)
 {
   error (0, 0, "%s", _("memory exhausted"));
index 2dbbbe492ecd38278408a74de6b910b2a7e29166..5526929f0a711656045f3c6343566872ccbb6770 100644 (file)
@@ -72,7 +72,7 @@ int exit_status = EXIT_SUCCESS;
 
 
 /* Add tab stop TABVAL to the end of 'tab_list'.  */
-extern void
+void
 add_tab_stop (colno tabval)
 {
   colno prev_column = first_free_tab ? tab_list[first_free_tab - 1] : 0;
@@ -125,7 +125,7 @@ set_increment_size (colno tabval)
 
 /* Add the comma or blank separated list of tab stops STOPS
    to the list of tab stops.  */
-extern void
+void
 parse_tab_stops (char const *stops)
 {
   bool have_tabval = false;
@@ -256,7 +256,7 @@ validate_tab_stops (colno const *tabs, idx_t entries)
    tab-stops = N (if value N specified as the only value).
    tab-stops = distinct values given on command line (if multiple values given).
 */
-extern void
+void
 finalize_tab_stops (void)
 {
   validate_tab_stops (tab_list, first_free_tab);
@@ -276,7 +276,7 @@ finalize_tab_stops (void)
    amny multiple tab-sizes.  Set *LAST_TAB depending on whether we are
    returning COLUMN + 1 merely because we're past the last tab.
    If the number would overflow, diagnose this and exit.  */
-extern colno
+colno
 get_next_tab_column (colno column, idx_t *tab_index, bool *last_tab)
 {
   *last_tab = false;
@@ -321,7 +321,7 @@ get_next_tab_column (colno column, idx_t *tab_index, bool *last_tab)
 
 
 /* Sets new file-list */
-extern void
+void
 set_file_list (char **list)
 {
   have_read_stdin = false;
@@ -337,7 +337,7 @@ set_file_list (char **list)
    Open a filename of '-' as the standard input.
    Return nullptr if there are no more input files.  */
 
-extern FILE *
+FILE *
 next_file (FILE *fp)
 {
   static char *prev_file;
@@ -381,7 +381,7 @@ next_file (FILE *fp)
 }
 
 /* */
-extern void
+void
 cleanup_file_list_stdin (void)
 {
     if (have_read_stdin && fclose (stdin) != 0)
@@ -389,7 +389,7 @@ cleanup_file_list_stdin (void)
 }
 
 
-extern void
+void
 emit_tab_list_info (void)
 {
   /* suppress syntax check for emit_mandatory_arg_note() */
index 732e3cba72dc1091757639d79ba7365a264c5011..c6fc15af308eac2b3782b9cd29c17caa1ebe0c0a 100644 (file)
@@ -26,7 +26,7 @@
    malloced storage.  FILE_STAT should be the result of stating FILE.
    Give a diagnostic and return nullptr if unable to determine the mount point.
    Exit if unable to restore current working directory.  */
-extern char *
+char *
 find_mount_point (char const *file, struct stat const *file_stat)
 {
   struct saved_cwd cwd;
index f173ebc9f2af2dc32610652ad40efa62e9868032..8c38165bbd212105714e00822ddd676d4390454f 100644 (file)
@@ -91,7 +91,7 @@ try_link (char *dest, void *arg)
    -1 if successful and DSTNAME already existed,
    0 if successful and DSTNAME did not already exist, and
    a positive errno value on failure.  */
-extern int
+int
 force_linkat (int srcdir, char const *srcname,
               int dstdir, char const *dstname, int flags, bool force,
               int linkat_errno)
@@ -148,7 +148,7 @@ try_symlink (char *dest, void *arg)
    -1 if successful and DSTNAME already existed,
    0 if successful and DSTNAME did not already exist, and
    a positive errno value on failure.  */
-extern int
+int
 force_symlinkat (char const *srcname, int dstdir, char const *dstname,
                  bool force, int symlinkat_errno)
 {
index 184941117f82eb8f3dd4a094e98285904bbd7a5e..872a23d42a24561e1575359ac28ddfa4a6507dc2 100644 (file)
@@ -31,7 +31,7 @@
 
 
 /* Print all of the distinct groups the user is in. */
-extern bool
+bool
 print_group_list (char const *username,
                   uid_t ruid, gid_t rgid, gid_t egid,
                   bool use_names, char delim)
@@ -87,7 +87,7 @@ print_group_list (char const *username,
 }
 
 /* Print the name or value of group ID GID. */
-extern bool
+bool
 print_group (gid_t gid, bool use_name)
 {
   struct group *grp = nullptr;
index 32b086635e98fb562e9a4f13db8101b8882a1209..180dd32aa329b8ec8712478f0e4477423b9cc1d9 100644 (file)
@@ -135,7 +135,7 @@ iopoll_internal (int fdin, int fdout, bool block, bool broken_output)
   return IOPOLL_ERROR;
 }
 
-extern int
+int
 iopoll (int fdin, int fdout, bool block)
 {
   return iopoll_internal (fdin, fdout, block, true);
@@ -147,7 +147,7 @@ iopoll (int fdin, int fdout, bool block)
    An fd is not relevant for iopoll() if it is always ready for reading,
    which is the case for a regular file or block device.  */
 
-extern bool
+bool
 iopoll_input_ok (int fdin)
 {
   struct stat st;
@@ -160,7 +160,7 @@ iopoll_input_ok (int fdin)
 /* Return true if fdout is suitable for iopoll().
    Namely, fdout refers to a pipe.  */
 
-extern bool
+bool
 iopoll_output_ok (int fdout)
 {
   return isapipe (fdout) > 0;
@@ -203,7 +203,7 @@ fail:
 
 /* wrapper for fclose() that also waits for F if non blocking.  */
 
-extern bool
+bool
 fclose_wait (FILE *f)
 {
   for (;;)
@@ -221,7 +221,7 @@ fclose_wait (FILE *f)
 
 /* wrapper for fwrite() that also waits for F if non blocking.  */
 
-extern bool
+bool
 fwrite_wait (char const *buf, ssize_t size, FILE *f)
 {
   for (;;)
index 9c69de633784d8d4037a4eb69526f2a5516e9958..a0e7cda1cf4860ab4a638804ff31d3a2d26ec81b 100644 (file)
@@ -32,7 +32,7 @@
 #include "sig2str.h"
 #include "operand2sig.h"
 
-extern int
+int
 operand2sig (char const *operand)
 {
   int signum;
index ffa3d02b7cb4ca7b8140e250ae93c3e00d06fe4a..c87a73a85c8b147fdeab85ee17264d44ce3b2f46 100644 (file)
@@ -16,7 +16,7 @@
    If unsuccessful and ON_ERROR_PRINT_UNFORMATTED, also prints WHEN.TV_SEC
    to STDOUT.  */
 
-extern bool
+bool
 show_date (char const *format, struct timespec when, timezone_t tz)
 {
   struct tm tm;
index d75e5eac42a29e35cbf76edf4c6d5cb75fcb2a4b..452e48a43de87c66756cd84ef0de537d173750e6 100644 (file)
@@ -23,7 +23,7 @@
 #include <x86intrin.h>
 
 /* Read FD and return a summary.  */
-extern struct wc_lines
+struct wc_lines
 wc_lines_avx2 (int fd)
 {
   intmax_t lines = 0;