From 91393e78100e38eafdf3e6044741b6ee79cf4d00 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Tue, 23 Jun 2009 01:32:46 +0000 Subject: [PATCH] InterruptsSpinLocking: * Removed unused inner struct State. * Added work-around for the extremely annoying "fState my be used uninitialized" warning gcc 4 produces. I'm not aware of any solution that doesn't generate unnecessary code. :-/ git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31193 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/kernel/util/AutoLock.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/headers/private/kernel/util/AutoLock.h b/headers/private/kernel/util/AutoLock.h index 2f46733506..9c66268ed7 100644 --- a/headers/private/kernel/util/AutoLock.h +++ b/headers/private/kernel/util/AutoLock.h @@ -132,15 +132,15 @@ typedef AutoLocker SpinLocker; // InterruptsSpinLocking class InterruptsSpinLocking { public: - struct State { - State(spinlock* lock) - : lock(lock) - { - } - - int state; - spinlock* lock; - }; +// NOTE: work-around for annoying GCC 4 "fState may be used uninitialized" +// warning. +#if __GNUC__ == 4 + InterruptsSpinLocking() + : + fState(0) + { + } +#endif inline bool Lock(spinlock* lockable) {