diff options
author | Andreas Sandberg <Andreas.Sandberg@ARM.com> | 2015-02-03 14:25:48 -0500 |
---|---|---|
committer | Andreas Sandberg <Andreas.Sandberg@ARM.com> | 2015-02-03 14:25:48 -0500 |
commit | fe200c24875d7f9484b539add6d9e75df06720f4 (patch) | |
tree | 30b8d2e750b38f607f5a18a5c2c4c9a06a6fc580 /src | |
parent | 851b29ad2077a886263be0973f58b84bea6641ab (diff) | |
download | gem5-fe200c24875d7f9484b539add6d9e75df06720f4.tar.xz |
sim: Remove test for non-NULL this in Event
The method Event::initialized() tests if this != NULL as a part of the
expression that tests if an event is initialized. The only case when
this check could be false is if the method is called on a null
pointer, which is illegal and leads to undefined behavior (such as
eating your pets) according to the C++ standard. Because of this,
modern compilers (specifically, recent versions of clang) warn about
this which we treat as an error. This changeset removes the redundant
check to fix said warning.
Diffstat (limited to 'src')
-rw-r--r-- | src/sim/eventq.hh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sim/eventq.hh b/src/sim/eventq.hh index 394fd4d8d..f726a6dbd 100644 --- a/src/sim/eventq.hh +++ b/src/sim/eventq.hh @@ -239,7 +239,7 @@ class Event : public EventBase, public Serializable bool initialized() const { - return this && (flags & InitMask) == Initialized; + return (flags & InitMask) == Initialized; } protected: |