ARM: Improve memory instruction disassembly.
[gem5.git] / src / base / intmath.hh
index 51baddb916b2c40d16e674b41de13c3e474a90bc..a2960e75018120297729ba41f7a89fac3f7c5db3 100644 (file)
  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Authors: Nathan Binkert
  */
 
-#ifndef __INTMATH_HH__
-#define __INTMATH_HH__
+#ifndef __BASE_INTMATH_HH__
+#define __BASE_INTMATH_HH__
 
-#include <assert.h>
+#include <cassert>
 
-#include "sim/host.hh"
+#include "base/types.hh"
 
 // Returns the prime number one less than n.
 int prevPrime(int n);
@@ -195,9 +197,9 @@ roundDown(T val, int align)
 inline bool
 isHex(char c)
 {
-    return c >= '0' && c <= '9' ||
-        c >= 'A' && c <= 'F' ||
-        c >= 'a' && c <= 'f';
+    return (c >= '0' && c <= '9') ||
+        (c >= 'A' && c <= 'F') ||
+        (c >= 'a' && c <= 'f');
 }
 
 inline bool
@@ -227,4 +229,4 @@ hex2Int(char c)
   return 0;
 }
 
-#endif // __INTMATH_HH__
+#endif // __BASE_INTMATH_HH__