From: Daniel Axtens Date: Fri, 1 May 2015 05:30:05 +0000 (+1000) Subject: Remove unneeded and confusing alwaysinline X-Git-Tag: 1.9.9-b1~868^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a1910cf452321bec1074d2db2e01f9c3fd16e9f6;p=thirdparty%2Fzlib-ng.git Remove unneeded and confusing alwaysinline alwaysinline expands to __attribute__((always_inline)). This does not force gcc to inline the function. Instead, it allows gcc to inline the function when complied without optimisations. (Normally, inline functions are only inlined when compiled with optimisations.)[0] alwaysinline was only used for bulk_insert_str, and it seems to be using it in an attempt to force the function to be inlined. That won't work. Furthermore, bulk_insert_str wasn't even declared inline, causing warnings. Remove alwaysinline and replace with inline. Remove the #defines, as they're no longer used. [0] https://gcc.gnu.org/onlinedocs/gcc-4.7.2/gcc/Function-Attributes.html Signed-off-by: Daniel Axtens --- diff --git a/deflate.c b/deflate.c index 09d486c43..323b8d281 100644 --- a/deflate.c +++ b/deflate.c @@ -213,7 +213,7 @@ local inline Pos insert_string(deflate_state *z_const s, z_const Pos str) #ifndef NOT_TWEAK_COMPILER -alwaysinline local void +local inline void bulk_insert_str(deflate_state *s, Pos startpos, uInt count) { uInt idx; for (idx = 0; idx < count; idx++) { diff --git a/zutil.h b/zutil.h index d0cab4973..5feddb24e 100644 --- a/zutil.h +++ b/zutil.h @@ -96,12 +96,6 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ But it provides __inline instead, so use that. */ #if defined(_MSC_VER) && !defined(inline) # define inline __inline -#endif - -#if defined(_MSC_VER) -# define alwaysinline __forceinline -#else -# define alwaysinline __attribute__ ((always_inline)) #endif /* common defaults */