From 5711282f87afb609c79d657ed6aa8c9259b5b827 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Fri, 14 Nov 2008 04:55:30 -0800 Subject: Fix a bunch of bugs I introduced when I changed the flags stuff for packets. I did some of the flags and assertions wrong. Thanks to Brad Beckmann for pointing this out. I should have run the opt regressions instead of the fast. I also screwed up some of the logical functions in the Flags class. --- src/base/flags.hh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/base') diff --git a/src/base/flags.hh b/src/base/flags.hh index 7cf6ef9c6..712b65319 100644 --- a/src/base/flags.hh +++ b/src/base/flags.hh @@ -61,16 +61,14 @@ class Flags bool any() const { return _flags; } bool any(Type flags) const { return (_flags & flags); } - bool all() const { return (~_flags); } - bool all(Type flags) const { return (_flags & flags) != flags; } + bool all() const { return !(~_flags); } + bool all(Type flags) const { return (_flags & flags) == flags; } bool none() const { return _flags == 0; } bool none(Type flags) const { return (_flags & flags) == 0; } - bool exact(Type flags) const { return _flags = flags; } void clear() { _flags = 0; } void clear(Type flags) { _flags &= ~flags; } - void reset(Type flags) { _flags = flags;} void set(Type flags) { _flags |= flags; } - void set(Type f, bool val) { _flags = (_flags & f) | (val ? f : 0); } + void set(Type f, bool val) { _flags = (_flags & ~f) | (val ? f : 0); } void update(Type flags, Type mask) { -- cgit v1.2.3