aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2010-11-23 13:31:43 +0000
committerDaniel P. Berrange <berrange@redhat.com>2010-11-23 15:19:35 +0000
commitc73bd6f34a03c6824543c47a1222dcc7f7a3c781 (patch)
tree2e2b747a882f62614a8ca9ecff6a5b24897e36da
parentFix 32-bit int truncation in QED header check (diff)
downloadlibvirt-c73bd6f34a03c6824543c47a1222dcc7f7a3c781.tar.gz
libvirt-c73bd6f34a03c6824543c47a1222dcc7f7a3c781.tar.bz2
libvirt-c73bd6f34a03c6824543c47a1222dcc7f7a3c781.zip
Rename 'remove' param to 'toremove' to avoid clash with stdio.h
The stdio.h header has a function called 'remove' declared. This clashes with the 'remove' parameter in virShrinkN * src/util/memory.c: Rename 'remove' to 'toremove'
-rw-r--r--src/util/memory.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/util/memory.c b/src/util/memory.c
index 96222db3d..f5061c092 100644
--- a/src/util/memory.c
+++ b/src/util/memory.c
@@ -237,18 +237,18 @@ int virResizeN(void *ptrptr, size_t size, size_t *allocptr, size_t count,
* @ptrptr: pointer to pointer for address of allocated memory
* @size: number of bytes per element
* @countptr: pointer to number of elements in array
- * @remove: number of elements to remove
+ * @toremove: number of elements to remove
*
* Resize the block of memory in 'ptrptr' to be an array of
- * '*countptr' - 'remove' elements, each 'size' bytes in length.
+ * '*countptr' - 'toremove' elements, each 'size' bytes in length.
* Update 'ptrptr' and 'countptr' with the details of the newly
- * allocated memory. If 'remove' is larger than 'countptr', free
+ * allocated memory. If 'toremove' is larger than 'countptr', free
* the entire array.
*/
-void virShrinkN(void *ptrptr, size_t size, size_t *countptr, size_t remove)
+void virShrinkN(void *ptrptr, size_t size, size_t *countptr, size_t toremove)
{
- if (remove < *countptr)
- ignore_value(virReallocN(ptrptr, size, *countptr -= remove));
+ if (toremove < *countptr)
+ ignore_value(virReallocN(ptrptr, size, *countptr -= toremove));
else {
virFree(ptrptr);
*countptr = 0;