]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
liblzma: Move a few __attribute__ uses in function declarations.
authorLasse Collin <lasse.collin@tukaani.org>
Mon, 11 Sep 2023 15:47:26 +0000 (18:47 +0300)
committerLasse Collin <lasse.collin@tukaani.org>
Tue, 7 May 2024 12:58:21 +0000 (15:58 +0300)
The API headers have many attributes but these were left
as is for now.

(cherry picked from commit e3478ae4f36cd06522a2fef023860893f068434d)

src/liblzma/common/common.c
src/liblzma/common/common.h
src/liblzma/common/memcmplen.h

index 407dd5844dbccebaf20a88115c0de98309312335..926dfa653191537ccf9c42da98ad9557540881ef 100644 (file)
@@ -35,7 +35,8 @@ lzma_version_string(void)
 // Memory allocation //
 ///////////////////////
 
-extern void * lzma_attr_alloc_size(1)
+lzma_attr_alloc_size(1)
+extern void *
 lzma_alloc(size_t size, const lzma_allocator *allocator)
 {
        // Some malloc() variants return NULL if called with size == 0.
@@ -53,7 +54,8 @@ lzma_alloc(size_t size, const lzma_allocator *allocator)
 }
 
 
-extern void * lzma_attr_alloc_size(1)
+lzma_attr_alloc_size(1)
+extern void *
 lzma_alloc_zero(size_t size, const lzma_allocator *allocator)
 {
        // Some calloc() variants return NULL if called with size == 0.
index 41754cc8e02f0d568797964ba8155a1017644624..300f0be11e6a50a47a7fffb8e6fb35f45303766e 100644 (file)
@@ -279,14 +279,14 @@ struct lzma_internal_s {
 
 
 /// Allocates memory
-extern void *lzma_alloc(size_t size, const lzma_allocator *allocator)
-               lzma_attr_alloc_size(1);
+lzma_attr_alloc_size(1)
+extern void *lzma_alloc(size_t size, const lzma_allocator *allocator);
 
 /// Allocates memory and zeroes it (like calloc()). This can be faster
 /// than lzma_alloc() + memzero() while being backward compatible with
 /// custom allocators.
-extern void * lzma_attr_alloc_size(1)
-               lzma_alloc_zero(size_t size, const lzma_allocator *allocator);
+lzma_attr_alloc_size(1)
+extern void *lzma_alloc_zero(size_t size, const lzma_allocator *allocator);
 
 /// Frees memory
 extern void lzma_free(void *ptr, const lzma_allocator *allocator);
index e1c78857bd99389ae63583bea0b0efdae97638ba..1d97908daee875bbfe721da7188b8de38e819050 100644 (file)
@@ -49,7 +49,8 @@
 ///             It's rounded up to 2^n. This extra amount needs to be
 ///             allocated in the buffers being used. It needs to be
 ///             initialized too to keep Valgrind quiet.
-static inline uint32_t lzma_attribute((__always_inline__))
+lzma_attribute((__always_inline__))
+static inline uint32_t
 lzma_memcmplen(const uint8_t *buf1, const uint8_t *buf2,
                uint32_t len, uint32_t limit)
 {