浏览代码

compiler.h: replace QEMU_SENTINEL with G_GNUC_NULL_TERMINATED

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>
Marc-André Lureau 3 年之前
父节点
当前提交
887ce500ef
共有 4 个文件被更改,包括 5 次插入7 次删除
  1. 0 2
      include/qemu/compiler.h
  2. 3 3
      include/qom/object.h
  3. 1 1
      scripts/checkpatch.pl
  4. 1 1
      scripts/cocci-macro-file.h

+ 0 - 2
include/qemu/compiler.h

@@ -19,8 +19,6 @@
 
 
 #define QEMU_NORETURN __attribute__ ((__noreturn__))
 #define QEMU_NORETURN __attribute__ ((__noreturn__))
 
 
-#define QEMU_SENTINEL __attribute__((sentinel))
-
 #if defined(_WIN32) && (defined(__x86_64__) || defined(__i386__))
 #if defined(_WIN32) && (defined(__x86_64__) || defined(__i386__))
 # define QEMU_PACKED __attribute__((gcc_struct, packed))
 # define QEMU_PACKED __attribute__((gcc_struct, packed))
 #else
 #else

+ 3 - 3
include/qom/object.h

@@ -616,7 +616,7 @@ Object *object_new_with_props(const char *typename,
                               Object *parent,
                               Object *parent,
                               const char *id,
                               const char *id,
                               Error **errp,
                               Error **errp,
-                              ...) QEMU_SENTINEL;
+                              ...) G_GNUC_NULL_TERMINATED;
 
 
 /**
 /**
  * object_new_with_propv:
  * object_new_with_propv:
@@ -676,7 +676,7 @@ void object_apply_compat_props(Object *obj);
  *
  *
  * Returns: %true on success, %false on error.
  * Returns: %true on success, %false on error.
  */
  */
-bool object_set_props(Object *obj, Error **errp, ...) QEMU_SENTINEL;
+bool object_set_props(Object *obj, Error **errp, ...) G_GNUC_NULL_TERMINATED;
 
 
 /**
 /**
  * object_set_propv:
  * object_set_propv:
@@ -728,7 +728,7 @@ void object_initialize(void *obj, size_t size, const char *typename);
 bool object_initialize_child_with_props(Object *parentobj,
 bool object_initialize_child_with_props(Object *parentobj,
                              const char *propname,
                              const char *propname,
                              void *childobj, size_t size, const char *type,
                              void *childobj, size_t size, const char *type,
-                             Error **errp, ...) QEMU_SENTINEL;
+                             Error **errp, ...) G_GNUC_NULL_TERMINATED;
 
 
 /**
 /**
  * object_initialize_child_with_propsv:
  * object_initialize_child_with_propsv:

+ 1 - 1
scripts/checkpatch.pl

@@ -225,7 +225,7 @@ our $Attribute	= qr{
 			volatile|
 			volatile|
 			QEMU_NORETURN|
 			QEMU_NORETURN|
 			G_GNUC_WARN_UNUSED_RESULT|
 			G_GNUC_WARN_UNUSED_RESULT|
-			QEMU_SENTINEL|
+			G_GNUC_NULL_TERMINATED|
 			QEMU_PACKED|
 			QEMU_PACKED|
 			G_GNUC_PRINTF
 			G_GNUC_PRINTF
 		  }x;
 		  }x;

+ 1 - 1
scripts/cocci-macro-file.h

@@ -21,7 +21,7 @@
 /* From qemu/compiler.h */
 /* From qemu/compiler.h */
 #define QEMU_NORETURN __attribute__ ((__noreturn__))
 #define QEMU_NORETURN __attribute__ ((__noreturn__))
 #define G_GNUC_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
 #define G_GNUC_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
-#define QEMU_SENTINEL __attribute__((sentinel))
+#define G_GNUC_NULL_TERMINATED __attribute__((sentinel))
 
 
 #if defined(_WIN32) && (defined(__x86_64__) || defined(__i386__))
 #if defined(_WIN32) && (defined(__x86_64__) || defined(__i386__))
 # define QEMU_PACKED __attribute__((gcc_struct, packed))
 # define QEMU_PACKED __attribute__((gcc_struct, packed))