[xen master] libxl: Replace open-coded __attribute__ with NN() macro

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[xen master] libxl: Replace open-coded __attribute__ with NN() macro

commit 1f2c7894dfe3d52f33655de202bd474999a1637b
Author:     Ian Jackson <[hidden email]>
AuthorDate: Fri Oct 20 11:42:42 2017 +0100
Commit:     Ian Jackson <[hidden email]>
CommitDate: Mon Oct 23 15:23:32 2017 +0100

    libxl: Replace open-coded __attribute__ with NN() macro
    Inspired by
      #define __nonnull(...) __attribute__((__nonnull__(__VA_ARGS__)))
    which is used in the hypervisor.
    These annotations may well become very common in libxl, so we choose a
    short name.
    Signed-off-by: Ian Jackson <[hidden email]>
    Release-acked-by: Julien Grall <[hidden email]>
    Acked-by: Wei Liu <[hidden email]>
    CC: Andrew Cooper <[hidden email]>
 tools/libxl/libxl_internal.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 9fe472e..bfa95d8 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -635,6 +635,7 @@ static inline int libxl__gc_is_real(const libxl__gc *gc)
 /* register ptr in gc for free on exit from outermost libxl callframe. */
+#define NN(...) __attribute__((nonnull(__VA_ARGS__)))
 #define NN1 __attribute__((nonnull(1)))
  /* It used to be legal to pass NULL for gc_opt.  Get the compiler to
   * warn about this if any slip through. */
@@ -1711,7 +1712,7 @@ _hidden char *libxl__domid_to_name(libxl__gc *gc, uint32_t domid);
 _hidden char *libxl__cpupoolid_to_name(libxl__gc *gc, uint32_t poolid);
 _hidden int libxl__enum_from_string(const libxl_enum_string_table *t,
-                                    const char *s, int *e) __attribute__((nonnull(2)));
+                                    const char *s, int *e) NN(2);
 _hidden yajl_gen_status libxl__yajl_gen_asciiz(yajl_gen hand, const char *str);
generated by git-patchbot for /home/xen/git/xen.git#master

Xen-changelog mailing list
[hidden email]