]> 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>
Fri, 22 Sep 2023 17:06:27 +0000 (20:06 +0300)
The API headers have many attributes but these were left
as is for now.

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

index 02a10641d0706a4c3ba7a7ab50c2e98ce07723ea..adb50d785d52befe2355f91449bb22f55488114f 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 cea9f9b3a6d03ae487bdff4b19164ce4ba86409f..176c3a8fb9ae5726b17504258846018750422fec 100644 (file)
@@ -297,14 +297,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 3c12422beaaf80148a191c2002129d6e90570c6f..abf01d51af879efea4acd2198bef5ae7f37f938a 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)
 {