Skip to contentSkip to conversation

opw: libxl: use macro GCNEW in libxl_qmp.c

PATCH In review Kelley Nielsen 2 participants 2 messages Nov 11, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 opw: libxl: use macro GCNEW in libxl_qmp.c

The new coding style uses the convenience macro GCNEW as declared in libxl_internal.h. Substitute an invocation of this macro for its body at the one place it occurs in libxl_qmp.c.

---
 tools/libxl/libxl_qmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/libxl/libxl_qmp.c +1 -1
index 8d3215c..359b7c7 100644
@@ -639,7 +639,7 @@ static void qmp_parameters_common_add(libxl__gc *gc,
         *param = libxl__json_object_alloc(gc, JSON_MAP);
     }
 
-    arg = libxl__zalloc(gc, sizeof(*arg));
+    GCNEW(arg);
 
     arg->map_key = libxl__strdup(gc, name);
     arg->obj = obj;
Signature · 1 line
1.8.1.2
#1 lore raw
Quoted 6 lines · Kelley Nielsen

The new coding style uses the convenience macro GCNEW as declared in libxl_internal.h. Substitute an invocation of this macro for its body at the one place it occurs in libxl_qmp.c.

acked + applied. thanks.

Quoted 17 lines
---
 tools/libxl/libxl_qmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/libxl/libxl_qmp.c +1 -1
index 8d3215c..359b7c7 100644
@@ -639,7 +639,7 @@ static void qmp_parameters_common_add(libxl__gc *gc,
         *param = libxl__json_object_alloc(gc, JSON_MAP);
     }
 
-    arg = libxl__zalloc(gc, sizeof(*arg));
+    GCNEW(arg);
 
     arg->map_key = libxl__strdup(gc, name);
     arg->obj = obj;