]> git.ipfire.org Git - thirdparty/tar.git/commitdiff
Omit most uses of ‘inline’
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 28 Feb 2021 21:34:55 +0000 (13:34 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 1 Mar 2021 08:18:44 +0000 (00:18 -0800)
With today’s compilers ‘inline’ is typically not needed for
performance (at least the way GNU Tar uses it) and it gets in the
way of portability.
* configure.ac: Omit AC_C_INLINE; no longer needed here.
* lib/attr-xattr.in.h (setxattr, lsetxattr, fsetxattr, getxattr)
(lgetxattr, fgetxattr, listxattr, llistxattr, flistxattr):
* lib/wordsplit.c (skip_delim_internal, skip_delim)
(skip_delim_real, exptab_matches):
* src/delete.c (flush_file):
* src/extract.c (safe_dir_mode):
* src/misc.c (ptr_align):
Now just static, not static inline.
* lib/wordsplit.h (wordsplit_getwords): Remove; no longer used.
* src/common.h (name_more_files): Now COMMON_INLINE, not
extern inline - which is not portable according to C99,
the way we were using it.

configure.ac
lib/attr-xattr.in.h
lib/wordsplit.c
lib/wordsplit.h
src/common.h
src/delete.c
src/extract.c
src/misc.c

index 75594ecf72e086acc67c3720bbc5c295b74f82c5..87f690873d8c17efafc77eea1c1b0a32795d6b2b 100644 (file)
@@ -35,7 +35,6 @@ gl_EARLY
 AC_CHECK_TOOLS([AR], [ar])
 
 AC_SYS_LARGEFILE
-AC_C_INLINE
 
 AC_CHECK_HEADERS_ONCE(fcntl.h linux/fd.h memory.h net/errno.h \
   sgtty.h string.h \
index d1f48b6e56b679f21c35fe06dfe85b2d268530ea..4fc27f8fc9bea15bc244d496d59d99a69ae78ea9 100644 (file)
 #endif
 
 /* setting */
-static inline int setxattr (const char *path, const char *name, const void
-                            *value, size_t size, int flags)
+static int setxattr (const char *path, const char *name, const void
+                    *value, size_t size, int flags)
 { errno = ENOTSUP; return -1; }
 
-static inline int lsetxattr (const char *path, const char *name, const void
-                             *value, size_t size, int flags)
+static int lsetxattr (const char *path, const char *name, const void
+                     *value, size_t size, int flags)
 { errno = ENOTSUP; return -1; }
 
-static inline int fsetxattr (int filedes, const char *name, const void *value,
-                             size_t size, int flags)
+static int fsetxattr (int filedes, const char *name, const void *value,
+                     size_t size, int flags)
 { errno = ENOTSUP; return -1; }
 
 
 /* getting */
-static inline ssize_t getxattr (const char *path, const char *name, void *value,
-                                size_t size)
+static ssize_t getxattr (const char *path, const char *name, void *value,
+                        size_t size)
 { errno = ENOTSUP; return -1; }
-static inline ssize_t lgetxattr (const char *path, const char *name, void
-                                 *value, size_t size)
+static ssize_t lgetxattr (const char *path, const char *name, void
+                         *value, size_t size)
 { errno = ENOTSUP; return -1; }
-static inline ssize_t fgetxattr (int filedes, const char *name, void *value,
-                                 size_t size)
+static ssize_t fgetxattr (int filedes, const char *name, void *value,
+                         size_t size)
 { errno = ENOTSUP; return -1; }
 
 
 /* listing */
-static inline ssize_t listxattr (const char *path, char *list, size_t size)
+static ssize_t listxattr (const char *path, char *list, size_t size)
 { errno = ENOTSUP; return -1; }
 
-static inline ssize_t llistxattr (const char *path, char *list, size_t size)
+static ssize_t llistxattr (const char *path, char *list, size_t size)
 { errno = ENOTSUP; return -1; }
 
-static inline ssize_t flistxattr (int filedes, char *list, size_t size)
+static ssize_t flistxattr (int filedes, char *list, size_t size)
 { errno = ENOTSUP; return -1; }
 
 #endif
index d8ce1247c61b4d261acc6f0cf100aa7d3ddf72f7..cf8a4990412f40f45ab7daeb53bee5f90dfa87da 100644 (file)
@@ -1911,19 +1911,19 @@ skip_sed_expr (const char *command, size_t i, size_t len)
 
 /* wsp->ws_endp points to a delimiter character. If RETURN_DELIMS
    is true, return its value, otherwise return the index past it. */
-static inline size_t
+static size_t
 skip_delim_internal (struct wordsplit *wsp, int return_delims)
 {
   return return_delims ? wsp->ws_endp : wsp->ws_endp + 1;
 }
 
-static inline size_t
+static size_t
 skip_delim (struct wordsplit *wsp)
 {
   return skip_delim_internal (wsp, WSP_RETURN_DELIMS (wsp));
 }
 
-static inline size_t
+static size_t
 skip_delim_real (struct wordsplit *wsp)
 {
   return skip_delim_internal (wsp, wsp->ws_flags & WRDSF_RETURN_DELIMS);
@@ -2316,8 +2316,8 @@ static struct exptab exptab[] = {
   { NULL }
 };
 
-static inline int
-exptab_matches(struct exptab *p, struct wordsplit *wsp)
+static int
+exptab_matches (struct exptab *p, struct wordsplit *wsp)
 {
   int result;
 
index bca3b6dc340061cad3215c882bae8ed3e6444b4f..ac95c9b75b467c06910a42121a7b10075b2167a8 100644 (file)
@@ -248,15 +248,6 @@ void wordsplit_free_words (wordsplit_t *ws);
 void wordsplit_free_envbuf (wordsplit_t *ws);
 int wordsplit_get_words (wordsplit_t *ws, size_t *wordc, char ***wordv);
 
-static inline void wordsplit_getwords (wordsplit_t *ws, size_t *wordc, char ***wordv)
-  DEPRECATED;
-
-static inline void
-wordsplit_getwords (wordsplit_t *ws, size_t *wordc, char ***wordv)
-{
-  wordsplit_get_words (ws, wordc, wordv);
-}
-
 int wordsplit_append (wordsplit_t *wsp, int argc, char **argv);
 
 int wordsplit_c_unquote_char (int c);
index 4b0ba2b2e1e6ce8830cf6ff934830b725ffc1dc4..40ccdd12c34abd0b5f93b1168fdad57329c8098f 100644 (file)
@@ -748,7 +748,7 @@ enum files_count
 extern enum files_count filename_args;
 
 /* Return true if there are file names in the list */
-static inline bool
+COMMON_INLINE bool
 name_more_files (void)
 {
   return filename_args != FILES_NONE;
@@ -762,7 +762,6 @@ void uid_to_uname (uid_t uid, char **uname);
 int uname_to_uid (char const *uname, uid_t *puid);
 
 void name_init (void);
-bool name_more_files (void);
 void name_add_name (const char *name);
 void name_term (void);
 const char *name_next (int change_dirs);
index f52970aeb44d9af94f9376ba29caf39d4b6130af..c4a8da16c21e8dd44cfb844d085b33f9f13f084c 100644 (file)
@@ -147,7 +147,7 @@ write_recent_bytes (char *data, size_t bytes)
     write_record (1);
 }
 
-static inline void
+static void
 flush_file (void)
 {
   off_t blocks_to_skip;
index 85a6f1b26daea5b93699433d828a20e5f05c1a8d..060692b3bd92e74cefcba0e59d85c348dd9e9e31 100644 (file)
@@ -994,7 +994,7 @@ is_directory_link (const char *file_name)
    If not root, though, make the directory writeable and searchable at first,
    so that files can be created under it.
 */
-static inline int
+static int
 safe_dir_mode (struct stat const *st)
 {
   return ((st->st_mode
index 3e6ce78fbc8907b4e7946b8b740fc8333e7cb47b..f14d938c01e92f611ae4fc6a048099ab2514ea94 100644 (file)
@@ -1214,7 +1214,7 @@ xpipe (int fd[2])
    PTR) through ((char *) PTR + ALIGNMENT - 1) to be addressable
    locations.  */
 
-static inline void *
+static void *
 ptr_align (void *ptr, size_t alignment)
 {
   char *p0 = ptr;