From 96e9302ca8d9396d735fbfee171a86e453694a94 Mon Sep 17 00:00:00 2001 From: Julian Seward Date: Tue, 17 Oct 2006 01:40:33 +0000 Subject: [PATCH] Merge r6133: Inline stackPush and stackPop and placate gcc's resulting concerns about uninitialised variables. and also change ownership. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6270 --- coregrind/m_oset.c | 14 +++++++------- coregrind/pub_core_oset.h | 6 +++--- include/pub_tool_oset.h | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/coregrind/m_oset.c b/coregrind/m_oset.c index 212576b8b7..8a8d3ae940 100644 --- a/coregrind/m_oset.c +++ b/coregrind/m_oset.c @@ -7,7 +7,7 @@ This file is part of Valgrind, a dynamic binary instrumentation framework. - Copyright (C) 2005 Nicholas Nethercote + Copyright (C) 2005-2006 Nicholas Nethercote njn@valgrind.org This program is free software; you can redistribute it and/or @@ -236,7 +236,7 @@ static void stackClear(AvlTree* t) } // Push onto the iterator stack. -static void stackPush(AvlTree* t, AvlNode* n, Int i) +static inline void stackPush(AvlTree* t, AvlNode* n, Int i) { vg_assert(t->stackTop < STACK_MAX); vg_assert(1 <= i && i <= 3); @@ -246,7 +246,7 @@ static void stackPush(AvlTree* t, AvlNode* n, Int i) } // Pop from the iterator stack. -static Bool stackPop(AvlTree* t, AvlNode** n, Int* i) +static inline Bool stackPop(AvlTree* t, AvlNode** n, Int* i) { vg_assert(t->stackTop <= STACK_MAX); @@ -296,8 +296,8 @@ AvlTree* VG_(OSet_Create)(OffT _keyOff, OSetCmp_t _cmp, // Destructor, frees up all memory held by remaining nodes. void VG_(OSet_Destroy)(AvlTree* t, OSetNodeDestroy_t destroyNode) { - AvlNode* n; - Int i, sz = 0; + AvlNode* n = NULL; + Int i = 0, sz = 0; vg_assert(t); stackClear(t); @@ -682,8 +682,8 @@ void VG_(OSet_ResetIter)(AvlTree* t) void* VG_(OSet_Next)(AvlTree* t) { - Int i; - OSetNode* n; + Int i = 0; + OSetNode* n = NULL; vg_assert(t); diff --git a/coregrind/pub_core_oset.h b/coregrind/pub_core_oset.h index 37ebd48a77..0a8fd0863b 100644 --- a/coregrind/pub_core_oset.h +++ b/coregrind/pub_core_oset.h @@ -1,14 +1,14 @@ /*--------------------------------------------------------------------*/ -/*--- An ordered set implemenation. pub_core_oset.h ---*/ +/*--- An ordered set implementation. pub_core_oset.h ---*/ /*--------------------------------------------------------------------*/ /* This file is part of Valgrind, a dynamic binary instrumentation framework. - Copyright (C) 2000-2006 Julian Seward - jseward@acm.org + Copyright (C) 2005-2006 Nicholas Nethercote + njn@valgrind.org This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as diff --git a/include/pub_tool_oset.h b/include/pub_tool_oset.h index 2c0f697d7b..30367a6a51 100644 --- a/include/pub_tool_oset.h +++ b/include/pub_tool_oset.h @@ -7,8 +7,8 @@ This file is part of Valgrind, a dynamic binary instrumentation framework. - Copyright (C) 2000-2006 Julian Seward - jseward@acm.org + Copyright (C) 2005-2006 Nicholas Nethercote + njn@valgrind.org This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as -- 2.47.2