From 9021488a5b65f6c22fab3b83473f0bbed135a501 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Thu, 4 Jul 2013 12:21:16 +0200 Subject: [PATCH] Adapt to VIR_ALLOC and virAsprintf in docs/ --- HACKING | 20 +++++--------------- docs/hacking.html.in | 20 +++++--------------- 2 files changed, 10 insertions(+), 30 deletions(-) diff --git a/HACKING b/HACKING index 7db7d3b8fc..9a421b0c3e 100644 --- a/HACKING +++ b/HACKING @@ -528,10 +528,8 @@ routines, use the macros from viralloc.h. virDomainPtr domain; - if (VIR_ALLOC(domain) < 0) { - virReportOOMError(); + if (VIR_ALLOC(domain) < 0) return NULL; - } @@ -540,10 +538,8 @@ routines, use the macros from viralloc.h. virDomainPtr domains; size_t ndomains = 10; - if (VIR_ALLOC_N(domains, ndomains) < 0) { - virReportOOMError(); + if (VIR_ALLOC_N(domains, ndomains) < 0) return NULL; - } @@ -552,10 +548,8 @@ routines, use the macros from viralloc.h. virDomainPtr *domains; size_t ndomains = 10; - if (VIR_ALLOC_N(domains, ndomains) < 0) { - virReportOOMError(); + if (VIR_ALLOC_N(domains, ndomains) < 0) return NULL; - } @@ -566,10 +560,8 @@ recommended only for smaller arrays): virDomainPtr domains; size_t ndomains = 0; - if (VIR_EXPAND_N(domains, ndomains, 1) < 0) { - virReportOOMError(); + if (VIR_EXPAND_N(domains, ndomains, 1) < 0) return NULL; - } domains[ndomains - 1] = domain; @@ -581,10 +573,8 @@ scales better, but requires tracking allocation separately from usage) size_t ndomains = 0; size_t ndomains_max = 0; - if (VIR_RESIZE_N(domains, ndomains_max, ndomains, 1) < 0) { - virReportOOMError(); + if (VIR_RESIZE_N(domains, ndomains_max, ndomains, 1) < 0) return NULL; - } domains[ndomains++] = domain; diff --git a/docs/hacking.html.in b/docs/hacking.html.in index ba51e233c8..700eb3ad5a 100644 --- a/docs/hacking.html.in +++ b/docs/hacking.html.in @@ -663,10 +663,8 @@
   virDomainPtr domain;
 
-  if (VIR_ALLOC(domain) < 0) {
-      virReportOOMError();
+  if (VIR_ALLOC(domain) < 0)
       return NULL;
-  }
 
@@ -675,10 +673,8 @@ virDomainPtr domains; size_t ndomains = 10; - if (VIR_ALLOC_N(domains, ndomains) < 0) { - virReportOOMError(); + if (VIR_ALLOC_N(domains, ndomains) < 0) return NULL; - } @@ -687,10 +683,8 @@ virDomainPtr *domains; size_t ndomains = 10; - if (VIR_ALLOC_N(domains, ndomains) < 0) { - virReportOOMError(); + if (VIR_ALLOC_N(domains, ndomains) < 0) return NULL; - } @@ -702,10 +696,8 @@ virDomainPtr domains; size_t ndomains = 0; - if (VIR_EXPAND_N(domains, ndomains, 1) < 0) { - virReportOOMError(); + if (VIR_EXPAND_N(domains, ndomains, 1) < 0) return NULL; - } domains[ndomains - 1] = domain; @@ -718,10 +710,8 @@ size_t ndomains = 0; size_t ndomains_max = 0; - if (VIR_RESIZE_N(domains, ndomains_max, ndomains, 1) < 0) { - virReportOOMError(); + if (VIR_RESIZE_N(domains, ndomains_max, ndomains, 1) < 0) return NULL; - } domains[ndomains++] = domain;