2012-11-29 Paul Eggert <eggert@cs.ucla.edu>
+ dup, execute, fatal-signal, etc.: no 'static inline'
+ * lib/dup.c (dup_nothrow):
+ * lib/execute.c (nonintr_close, nonintr_open):
+ * lib/fatal-signal.c (uninstall_handlers, install_handlers):
+ * lib/fopen.c (orig_fopen):
+ * lib/freadseek.c (freadptrinc):
+ * lib/freopen.c (orig_freopen):
+ * lib/fstat.c (orig_fstat, fstat_nothrow):
+ * lib/get-rusage-as.c (get_rusage_as_via_setrlimit)
+ (get_rusage_as_via_iterator):
+ * lib/get-rusage-data.c (get_rusage_data_via_setrlimit):
+ * lib/getdtablesize.c (_setmaxstdio_nothrow):
+ * lib/isatty.c (_isatty_nothrow):
+ * lib/open.c (orig_open):
+ * lib/read.c (read_nothrow):
+ * lib/sigprocmask.c (signal_nothrow):
+ * lib/spawn-pipe.c (nonintr_close, nonintr_open):
+ * lib/vasnprintf.c (MAX_ROOM_NEEDED):
+ * lib/wait-process.c (unregister_slave_subprocess):
+ * lib/write.c (write_nothrow):
+ Now static, not static inline.
+ * lib/spawn-pipe.c (nonintr_open): Define only if
+ (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__.
+ * m4/dup.m4 (gl_PREREQ_DUP):
+ * m4/execute.m4 (gl_EXECUTE):
+ * m4/fatal-signal.m4 (gl_FATAL_SIGNAL):
+ * m4/fopen.m4 (gl_PREREQ_FOPEN):
+ * m4/freadseek.m4 (gl_FUNC_FREADSEEK):
+ * m4/freopen.m4 (gl_PREREQ_FREOPEN):
+ * m4/fstat.m4 (gl_PREREQ_FSTAT):
+ * m4/getdtablesize.m4 (gl_PREREQ_GETDTABLESIZE):
+ * m4/isatty.m4 (gl_PREREQ_ISATTY):
+ * m4/open.m4 (gl_PREREQ_OPEN):
+ * m4/read.m4 (gl_PREREQ_READ):
+ * m4/signalblocking.m4 (gl_PREREQ_SIGPROCMASK):
+ * m4/spawn-pipe.m4 (gl_SPAWN_PIPE):
+ * m4/vasnprintf.m4 (gl_PREREQ_VASNPRINTF):
+ * m4/wait-process.m4 (gl_WAIT_PROCESS):
+ * m4/write.m4 (gl_PREREQ_WRITE):
+ * modules/get-rusage-as, modules/get-rusage-data (configure.ac):
+ Do not require AC_C_INLINE.
+
+ c-strtod, memcoll, readutmp: no 'static inline'
+ * lib/c-strtod.c (c_locale):
+ * lib/memcoll.c (strcoll_loop):
+ * lib/readutmp.c (desirable_utmp_entry):
+ Now static, not static inline.
+ * m4/c-strtod.m4 (gl_C_STRTOD, gl_C_STRTOLD):
+ * m4/memcoll.m4 (gl_MEMCOLL):
+ * m4/readutmp.m4 (gl_READUTMP):
+ Do not require AC_C_INLINE.
+
+ arctwo, md4, md5, sha1, sha256, sha512: no 'static inline'
+ * lib/arctwo.c (to_uchar):
+ * lib/md4.c (set_uint32):
+ * lib/md5.c (set_uint32):
+ * lib/sha1.c (set_uint32):
+ * lib/sha256.c (set_uint32):
+ * lib/sha512.c (set_uint64):
+ Now static, not static inline. This is a bit simpler, and doesn't
+ affect performance with GCC and default optimization.
+ * m4/arctwo.m4 (gl_ARCTWO):
+ * m4/md4.m4 (gl_MD4):
+ * m4/md5.m4 (gl_MD5):
+ * m4/sha1.m4 (gl_SHA1):
+ * m4/sha256.m4 (gl_SHA256):
+ * m4/sha512.m4 (gl_SHA512):
+ Do not require AC_C_INLINE.
+
+ cond, lock, thread: better 'inline'
+ * lib/glthread/cond.c, lib/glthread/cond.h (_GLTHREAD_COND_INLINE):
+ * lib/glthread/thread.c, lib/glthread/thread.h (_GLTHREAD_THREAD_INLINE):
+ New macros. Use them instead of static inline, for header functions.
+ * lib/glthread/cond.c (gl_waitqueue_init, gl_waitqueue_remove)
+ (gl_waitqueue_notify_first, gl_waitqueue_notify_all):
+ * lib/glthread/lock.c (gl_waitqueue_init)
+ (gl_waitqueue_notify_first, gl_waitqueue_notify_all):
+ * lib/glthread/thread.c (get_current_thread_handle):
+ Change 'static inline' to 'inline'.
+ * lib/glthread/cond.h, lib/glthread/thread.h:
+ Use _GL_INLINE_HEADER_BEGIN, _GL_INLINE_HEADER_END.
+ * m4/cond.m4 (gl_COND):
+ * m4/lock.m4 (gl_PREREQ_LOCK):
+ * m4/thread.m4 (gl_THREAD):
+ Do not require AC_C_INLINE.
+ * modules/cond, modules/thread (Depends-on): Add extern-inline.
+
+ chdir-long, cycle-check, savewd: better 'inline'
+ * lib/chdir-long.c (cdb_init, cdb_fchdir, cdb_free)
+ (find_non_slash):
+ * lib/cycle-check.c (is_zero_or_power_of_two):
+ * lib/savewd.c (savewd_delegating):
+ Change 'static inline' to 'inline'.
+ * lib/savewd.c, lib/savewd.h (SAVEWD_INLINE): New macro.
+ Replace all remaining uses of 'static inline' with it.
+ * lib/savewd.h:
+ Use _GL_INLINE_HEADER_BEGIN, _GL_INLINE_HEADER_END.
+ * m4/chdir-long.m4 (gl_PREREQ_CHDIR_LONG):
+ * m4/cycle-check.m4 (gl_CYCLE_CHECK):
+ * m4/savewd.m4 (gl_SAVEWD):
+ Do not require AC_C_INLINE.
+ * modules/savewd (Depends-on): Add extern-inline.
+
+ base32, base64: no need for 'inline'
+ * lib/base32.c (to_uchar, get_8, decode_8):
+ * lib/base64.c (to_uchar, get_4, decode_4):
+ Change 'static inline' to 'inline'.
+ * m4/base32.m4 (gl_PREREQ_BASE32):
+ * m4/base64.m4 (gl_PREREQ_BASE64):
+ Do not require AC_C_INLINE.
+
+ array-oset, linkedhash-list, rbtree-oset: no need for 'inline'
+ * lib/gl_array_oset.c (gl_array_nx_add_at):
+ (gl_array_remove_at):
+ * lib/gl_linkedhash_list.c (hash_resize_after_add)
+ (add_to_bucket, remove_from_bucket):
+ * lib/gl_rbtree_oset.c (rotate_left, rotate_right):
+ Change 'static inline' to 'static', as it's simpler to omit
+ 'inline' unless there's a significant performance advantage.
+
+ list, oset, xlist, xoset, xsublist: simplify via extern inline
+ * lib/gl_list.h, lib/gl_list.c (GL_LIST_INLINE):
+ * lib/gl_oset.c, lib/gl_oset.h (GL_OSET_INLINE):
+ * lib/gl_xlist.c, lib/gl_xlist.h (GL_XLIST_INLINE):
+ * lib/gl_xoset.c, lib/gl_xoset.h (GL_XOSET_INLINE):
+ * lib/gl_xsublist.c, lib/gl_xsublist.h (GL_XSUBLIST_INLINE):
+ New macro. Replace all uses of 'static inline' with it.
+ [HAVE_INLINE]: Implement functions as *_INLINE functions,
+ instead of as macros FOO that are defined to static inline
+ functions FOO_inline.
+ * lib/gl_list.c, lib/gl_oset.c, lib/gl_xlist.c, lib/gl_xoset.c:
+ * lib/gl_xsublist.c:
+ Reimplement from scratch, by defining the corresponding *_INLINE
+ macro and including the corresponding .h file. This is simpler.
+ * modules/list, modules/oset, modules/xlist, modules/xoset:
+ (Files): Remove m4/gl_list.m4.
+ (configure.ac): Remove gl_LIST.
+ * m4/gl_list.m4: Remove.
+ * modules/list, modules/oset, modules/xlist, modules/xoset:
+ * modules/xsublist:
+ (Depends-on): Depend on extern-inline, not inline.
+
+ xalloc: better 'inline'
+ * lib/xmalloc.c, lib/xalloc.h (XALLOC_INLINE):
+ New macro. Replace all uses of 'static inline' with it.
+ (static_inline): Remove.
+ * lib/xalloc.h (xnmalloc, xnrealloc, x2nrealloc, xcharalloc):
+ Let 'extern inline' do the work automatically, instead of doing
+ it by hand.
+ * m4/xalloc.m4 (gl_PREREQ_XALLOC, gl_PREREQ_XMALLOC):
+ Remove. All uses removed.
+ * modules/xalloc (Depends-on): Remove 'inline'. Add 'extern-inline'.
+
+ gethrxtime: better 'inline'
+ * lib/xtime.c: New file.
+ * lib/gethrxtime.c, lib/gethrxtime.h (GETHRXTIME_INLINE):
+ * lib/xtime.h (XTIME_INCLUDE):
+ New macros. Replace all uses of 'static inline' with them.
+ * lib/gethrxtime.c (gethrxtime): Define only if
+ ! (HAVE_ARITHMETIC_HRTIME_T && HAVE_DECL_GETHRTIME), since
+ this source file is now always compiled, because of the extern inline.
+ * lib/gethrxtime.h, lib/xtime.h:
+ Use _GL_INLINE_HEADER_BEGIN, _GL_INLINE_HEADER_END.
+ * m4/gethrxtime.m4 (gl_GETHRXTIME): Do not check for clock macros
+ if gethrtime works, as they're not needed in that case.
+ (gl_XTIME): Do not require AC_C_INLINE.
+ (gl_PREREQ_GETHRXTIME): Remove; all uses removed, as it's always
+ compiled now. Move the check into gl_GETHRXTIME.
+ * modules/gethrxtime (Files, lib_SOURCES): Add lib/xtime.c.
+ (Depends-on): Add extern-inline.
+ (configure.ac): gethrxtime is always compiled now.
+ (lib_SOURCES): Add gethrxtime.c.
+
+ wctype-h: better 'inline'
+ * lib/wctype-h.c: New file.
+ * lib/wctype.in.h (_GL_WCTYPE_INLINE):
+ New macro. Replace all uses of 'static inline' with it.
+ Use _GL_INLINE_HEADER_BEGIN, _GL_INLINE_HEADER_END.
+ * m4/wctype_h.m4 (gl_WCTYPE_H): Do not require AC_C_INLINE.
+ * modules/wctype-h (Files, lib_SOURCES): Add lib/wctype-h.c.
+ (Depends-on): Add extern-inline.
+
+ unistd: better 'inline'
+ * lib/unistd.c: New file.
+ * lib/unistd.in.h (_GL_UNISTD_INLINE):
+ New macro. Replace all uses of 'static inline' with it.
+ Use _GL_INLINE_HEADER_BEGIN, _GL_INLINE_HEADER_END.
+ * m4/unistd_h.m4 (gl_UNISTD_H): Do not require AC_C_INLINE.
+ * modules/unistd (Files, lib_SOURCES): Add lib/unistd.c.
+ (Depends-on): Add extern-inline.
+
+ sys_socket: better 'inline'
+ * lib/sys_socket.c: New file.
+ * lib/sys_socket.in.h (_GL_SYS_SOCKET_INLINE):
+ New macro. Replace all uses of 'static inline' with it.
+ Use _GL_INLINE_HEADER_BEGIN, _GL_INLINE_HEADER_END.
+ * m4/sys_socket_h.m4 (gl_HEADER_SYS_SOCKET): Do not require AC_C_INLINE.
+ * modules/sys_socket (Files, lib_SOURCES): Add lib/sys_socket.c.
+ (Depends-on): Add extern-inline.
+
+ stdio: better 'inline'
+ * lib/stdio.c: New file.
+ * lib/stdio.in.h (_GL_STDIO_INLINE):
+ New macro. Replace all uses of 'static inline' with it.
+ Use _GL_INLINE_HEADER_BEGIN, _GL_INLINE_HEADER_END.
+ * m4/stdio_h.m4 (gl_STDIO_H): Do not require AC_C_INLINE.
+ * modules/stdio (Files, lib_SOURCES): Add lib/stdio.c.
+ (Depends-on): Add extern-inline.
+
+ sigaction: better 'inline'
+ * lib/sig-handler.c: New file.
+ * lib/sig-handler.h (SIG_HANDLER_INLINE):
+ New macro. Replace all uses of 'static inline' with it.
+ Use _GL_INLINE_HEADER_BEGIN, _GL_INLINE_HEADER_END.
+ * m4/sigaction.m4 (gl_PREREQ_SIG_HANDLER_H): Do not require AC_C_INLINE.
+ * modules/sigaction (Files, lib_SOURCES): Add lib/sig-handler.c.
+ (Depends-on): Add extern-inline.
+
+ selinux-h: better 'inline'
+ * lib/se-context.c, lib/se-selinux.c: New files.
+ * lib/getfilecon.c (map_to_failure): Omit 'inline' for static function.
+ * lib/se-context.in.h (SE_CONTEXT_INLINE):
+ New macro. Replace all uses of 'static inline' with it.
+ Use _GL_INLINE_HEADER_BEGIN, _GL_INLINE_HEADER_END.
+ * lib/se-selinux.in.h (SE_SELINUX_INLINE):
+ New macro. Replace all uses of 'static inline' with it.
+ Use _GL_INLINE_HEADER_BEGIN, _GL_INLINE_HEADER_END.
+ * modules/selinux-h (Files, lib_SOURCES):
+ Add lib/se-context.c, lib/se-selinux.c.
+ (Depends-on): Add extern-inline.
+ (configure.ac): Do not require AC_C_INLINE.
+
+ pthread: better 'inline'
+ * lib/pthread.c: New file.
+ * lib/pthread.in.h (_GL_PTHREAD_INLINE):
+ New macro. Replace all uses of 'static inline' with it.
+ Use _GL_INLINE_HEADER_BEGIN, _GL_INLINE_HEADER_END.
+ * m4/pthread.m4 (gl_PTHREAD_CHECK):
+ Add AC_LIBOBJ([pthread]). Do not require AC_C_INLINE.
+ * modules/pthread (Files): Add lib/pthread.c.
+ (Depends-on): Add extern-inline.
+
+ math: better 'inline'
+ * lib/math.c: New file.
+ * lib/math.in.h (_GL_MATH_INLINE):
+ New macro. Replace all uses of 'static inline' with it.
+ Use _GL_INLINE_HEADER_BEGIN, _GL_INLINE_HEADER_END.
+ * m4/math_h.m4 (gl_MATH_H):
+ Do not require AC_C_INLINE.
+ * modules/math (Files, lib_SOURCES):
+ Add lib/math.c.
+ (Depends-on): Add extern-inline.
+
+ count-one-bits: better 'inline'
+ * lib/count-one-bits.c: New file.
+ * lib/count-one-bits.h (COUNT_ONE_BITS_INLINE):
+ New macro. Replace all uses of 'static inline' with it.
+ Use _GL_INLINE_HEADER_BEGIN, _GL_INLINE_HEADER_END.
+ * m4/count-one-bits.m4 (gl_COUNT_ONE_BITS):
+ Do not require AC_C_INLINE.
+ * modules/count-one-bits (Files, lib_SOURCES):
+ Add lib/count-one-bits.c.
+ (Depends-on): Add extern-inline.
+
count-leading-zeros: better 'inline'
* lib/count-leading-zeros.c: New file.
* lib/count-leading-zeros.h (COUNT_LEADING_ZEROS_INLINE):