]> git.proxmox.com Git - mirror_qemu.git/commitdiff
compiler.h: replace QEMU_WARN_UNUSED_RESULT with G_GNUC_WARN_UNUSED_RESULT
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Wed, 23 Feb 2022 20:58:22 +0000 (00:58 +0400)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Tue, 22 Mar 2022 10:40:51 +0000 (14:40 +0400)
One less qemu-specific macro. It also helps to make some headers/units
only depend on glib, and thus moved in standalone projects eventually.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
block/qcow2-refcount.c
include/qemu-common.h
include/qemu/compiler.h
include/qemu/range.h
scripts/checkpatch.pl
scripts/cocci-macro-file.h

index 94033972bedc7ac904f89fd6b436c55b3619c1ad..b91499410c0c5b4dae32f809482b18ff4c656d0f 100644 (file)
 
 static int64_t alloc_clusters_noref(BlockDriverState *bs, uint64_t size,
                                     uint64_t max);
-static int QEMU_WARN_UNUSED_RESULT update_refcount(BlockDriverState *bs,
-                            int64_t offset, int64_t length, uint64_t addend,
-                            bool decrease, enum qcow2_discard_type type);
+
+G_GNUC_WARN_UNUSED_RESULT
+static int update_refcount(BlockDriverState *bs,
+                           int64_t offset, int64_t length, uint64_t addend,
+                           bool decrease, enum qcow2_discard_type type);
 
 static uint64_t get_refcount_ro0(const void *refcount_array, uint64_t index);
 static uint64_t get_refcount_ro1(const void *refcount_array, uint64_t index);
@@ -803,12 +805,12 @@ found:
 /* XXX: cache several refcount block clusters ? */
 /* @addend is the absolute value of the addend; if @decrease is set, @addend
  * will be subtracted from the current refcount, otherwise it will be added */
-static int QEMU_WARN_UNUSED_RESULT update_refcount(BlockDriverState *bs,
-                                                   int64_t offset,
-                                                   int64_t length,
-                                                   uint64_t addend,
-                                                   bool decrease,
-                                                   enum qcow2_discard_type type)
+static int update_refcount(BlockDriverState *bs,
+                           int64_t offset,
+                           int64_t length,
+                           uint64_t addend,
+                           bool decrease,
+                           enum qcow2_discard_type type)
 {
     BDRVQcow2State *s = bs->opaque;
     int64_t start, last, cluster_offset;
index 9c04fa94e89aad832470434404453b3c6a4191d6..19e254dbe53ecdd7be85b348ca51d333090c1506 100644 (file)
@@ -27,7 +27,7 @@ int qemu_main(int argc, char **argv, char **envp);
 #endif
 
 ssize_t qemu_write_full(int fd, const void *buf, size_t count)
-    QEMU_WARN_UNUSED_RESULT;
+    G_GNUC_WARN_UNUSED_RESULT;
 
 #ifndef _WIN32
 int qemu_pipe(int pipefd[2]);
index f2bd050e3b9aa8809f20a1b8e3c575b61112743f..8385e477c18e5c1896030dc5cc4678daa681a613 100644 (file)
@@ -19,8 +19,6 @@
 
 #define QEMU_NORETURN __attribute__ ((__noreturn__))
 
-#define QEMU_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
-
 #define QEMU_SENTINEL __attribute__((sentinel))
 
 #if defined(_WIN32) && (defined(__x86_64__) || defined(__i386__))
index f62b363e0d1240b476a66383b46caf6497cacaeb..7e2b1cc447afe373695a011755dcf79a6dacf14f 100644 (file)
@@ -114,8 +114,8 @@ static inline uint64_t range_upb(Range *range)
  * @size may be 0. If the range would overflow, returns -ERANGE, otherwise
  * 0.
  */
-static inline int QEMU_WARN_UNUSED_RESULT range_init(Range *range, uint64_t lob,
-                                                     uint64_t size)
+G_GNUC_WARN_UNUSED_RESULT
+static inline int range_init(Range *range, uint64_t lob, uint64_t size)
 {
     if (lob + size < lob) {
         return -ERANGE;
index a07f0effb54089cce6c1dc63c1196582a716c53d..797738a8e83959b3ea969c109d2975ecc4a443bb 100755 (executable)
@@ -224,7 +224,7 @@ our $Attribute      = qr{
                        const|
                        volatile|
                        QEMU_NORETURN|
-                       QEMU_WARN_UNUSED_RESULT|
+                       G_GNUC_WARN_UNUSED_RESULT|
                        QEMU_SENTINEL|
                        QEMU_PACKED|
                        G_GNUC_PRINTF
index c2fcea8e77a2d5bf9e3ea13e59b0479ef38fabff..9daec24d78250724ffa44e5987f53dfefd946aab 100644 (file)
@@ -20,7 +20,7 @@
 
 /* From qemu/compiler.h */
 #define QEMU_NORETURN __attribute__ ((__noreturn__))
-#define QEMU_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
+#define G_GNUC_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
 #define QEMU_SENTINEL __attribute__((sentinel))
 
 #if defined(_WIN32) && (defined(__x86_64__) || defined(__i386__))