From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35921) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUfXg-0006dA-14 for qemu-devel@nongnu.org; Tue, 02 Aug 2016 15:39:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bUfXe-0003Y5-5W for qemu-devel@nongnu.org; Tue, 02 Aug 2016 15:39:55 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:33598) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUfXd-0003Xh-Un for qemu-devel@nongnu.org; Tue, 02 Aug 2016 15:39:54 -0400 Received: by mail-wm0-x244.google.com with SMTP id o80so32556948wme.0 for ; Tue, 02 Aug 2016 12:39:53 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Tue, 2 Aug 2016 21:39:21 +0200 Message-Id: <1470166775-3671-12-git-send-email-pbonzini@redhat.com> In-Reply-To: <1470166775-3671-1-git-send-email-pbonzini@redhat.com> References: <1470166775-3671-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PULL 11/25] qdist: use g_realloc_n instead of g_realloc List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: "Emilio G. Cota" From: "Emilio G. Cota" While at it, remove the unnecessary parentheses around dist->size. Signed-off-by: Emilio G. Cota Message-Id: <1469459025-23606-3-git-send-email-cota@braap.org> Signed-off-by: Paolo Bonzini --- util/qdist.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/qdist.c b/util/qdist.c index eb2236c..cc31140 100644 --- a/util/qdist.c +++ b/util/qdist.c @@ -62,8 +62,8 @@ void qdist_add(struct qdist *dist, double x, long count) if (unlikely(dist->n == dist->size)) { dist->size *= 2; - dist->entries = g_realloc(dist->entries, - sizeof(*dist->entries) * (dist->size)); + dist->entries = g_realloc_n(dist->entries, dist->size, + sizeof(*dist->entries)); } dist->n++; entry = &dist->entries[dist->n - 1]; -- 2.7.4