]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Adapt to VIR_ALLOC and virAsprintf in docs/
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 4 Jul 2013 10:21:16 +0000 (12:21 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 10 Jul 2013 09:07:31 +0000 (11:07 +0200)
HACKING
docs/hacking.html.in

diff --git a/HACKING b/HACKING
index 7db7d3b8fca0fd1aaff302cfb5989fe9f5d484d7..9a421b0c3eb2b3d0a7394d7149c338d740cecd56 100644 (file)
--- 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;
 
 
index ba51e233c8ff65e30a1ef764d295155330b82071..700eb3ad5a1570a7d1f1f942390f27f00dfe1101 100644 (file)
 <pre>
   virDomainPtr domain;
 
-  if (VIR_ALLOC(domain) &lt; 0) {
-      virReportOOMError();
+  if (VIR_ALLOC(domain) &lt; 0)
       return NULL;
-  }
 </pre>
       </li>
 
   virDomainPtr domains;
   size_t ndomains = 10;
 
-  if (VIR_ALLOC_N(domains, ndomains) &lt; 0) {
-      virReportOOMError();
+  if (VIR_ALLOC_N(domains, ndomains) &lt; 0)
       return NULL;
-  }
 </pre>
       </li>
 
   virDomainPtr *domains;
   size_t ndomains = 10;
 
-  if (VIR_ALLOC_N(domains, ndomains) &lt; 0) {
-      virReportOOMError();
+  if (VIR_ALLOC_N(domains, ndomains) &lt; 0)
       return NULL;
-  }
 </pre>
       </li>
 
   virDomainPtr domains;
   size_t ndomains = 0;
 
-  if (VIR_EXPAND_N(domains, ndomains, 1) &lt; 0) {
-      virReportOOMError();
+  if (VIR_EXPAND_N(domains, ndomains, 1) &lt; 0)
       return NULL;
-  }
   domains[ndomains - 1] = domain;
 </pre></li>
 
   size_t ndomains = 0;
   size_t ndomains_max = 0;
 
-  if (VIR_RESIZE_N(domains, ndomains_max, ndomains, 1) &lt; 0) {
-      virReportOOMError();
+  if (VIR_RESIZE_N(domains, ndomains_max, ndomains, 1) &lt; 0)
       return NULL;
-  }
   domains[ndomains++] = domain;
 </pre>
       </li>