From 8cc2bbe33c4bbbc38098cba3714fdde8df78a6ab Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Wed, 28 Jan 2009 16:13:46 +0000 Subject: [PATCH] qparams.c: Use virReportOOMError(NULL), not qparam_report_oom() * src/qparams.c (VIR_FROM_THIS): Define to VIR_FROM_NONE. (qparam_report_oom): Remove definition. Replace all uses. --- ChangeLog | 7 +++++++ src/qparams.c | 22 ++++++++++------------ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 019f0ea559..ddcbb2e671 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Wed Jan 28 15:45:11 +0100 2009 Jim Meyering + + qparams.c: Use virReportOOMError(NULL), not qparam_report_oom() + * src/qparams.c (VIR_FROM_THIS): Define to VIR_FROM_NONE. + (qparam_report_oom): Remove definition. + Replace all uses. + Wed Jan 28 14:24:45 GMT 2009 John Levon * src/xend_internal.c: fix mis-use of PF_UNIX as a protocol diff --git a/src/qparams.c b/src/qparams.c index 22c5853400..d0a84b38e5 100644 --- a/src/qparams.c +++ b/src/qparams.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2007 Red Hat, Inc. +/* Copyright (C) 2007, 2009 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -33,9 +33,7 @@ #include "memory.h" #include "qparams.h" -#define qparam_report_oom(void) \ - virReportErrorHelper(NULL, VIR_FROM_NONE, VIR_ERR_NO_MEMORY, \ - __FILE__, __FUNCTION__, __LINE__, NULL) +#define VIR_FROM_THIS VIR_FROM_NONE struct qparam_set * new_qparam_set (int init_alloc, ...) @@ -47,14 +45,14 @@ new_qparam_set (int init_alloc, ...) if (init_alloc <= 0) init_alloc = 1; if (VIR_ALLOC(ps) < 0) { - qparam_report_oom(); + virReportOOMError(NULL); return NULL; } ps->n = 0; ps->alloc = init_alloc; if (VIR_ALLOC_N(ps->p, ps->alloc) < 0) { VIR_FREE (ps); - qparam_report_oom(); + virReportOOMError(NULL); return NULL; } @@ -98,7 +96,7 @@ grow_qparam_set (struct qparam_set *ps) { if (ps->n >= ps->alloc) { if (VIR_REALLOC_N(ps->p, ps->alloc * 2) < 0) { - qparam_report_oom(); + virReportOOMError(NULL); return -1; } ps->alloc *= 2; @@ -115,14 +113,14 @@ append_qparam (struct qparam_set *ps, pname = strdup (name); if (!pname) { - qparam_report_oom(); + virReportOOMError(NULL); return -1; } pvalue = strdup (value); if (!pvalue) { VIR_FREE (pname); - qparam_report_oom(); + virReportOOMError(NULL); return -1; } @@ -156,7 +154,7 @@ qparam_get_query (const struct qparam_set *ps) } if (virBufferError(&buf)) { - qparam_report_oom(); + virReportOOMError(NULL); return NULL; } @@ -184,7 +182,7 @@ qparam_query_parse (const char *query) ps = new_qparam_set (0, NULL); if (!ps) { - qparam_report_oom(); + virReportOOMError(NULL); return NULL; } @@ -257,7 +255,7 @@ qparam_query_parse (const char *query) return ps; out_of_memory: - qparam_report_oom(); + virReportOOMError(NULL); free_qparam_set (ps); return NULL; }