types: need typename keyword to get the type.
[gem5.git] / src / dev / baddev.hh
index 040fff8e543f16ef6cb804ca4a835bb1e571599e..9cf592c0ef5fb5cb90d6bf4388eceff5d68bcc57 100644 (file)
@@ -38,7 +38,7 @@
 
 #include "base/range.hh"
 #include "dev/io_device.hh"
-
+#include "params/BadDevice.hh"
 
 /**
  * BadDevice
@@ -52,12 +52,14 @@ class BadDevice : public BasicPioDevice
     std::string devname;
 
   public:
-    struct Params : public BasicPioDevice::Params
-    {
-        std::string device_name;
-    };
+    typedef BadDeviceParams Params;
+
   protected:
-    const Params *params() const { return (const Params *)_params; }
+    const Params *
+    params() const
+    {
+        return dynamic_cast<const Params *>(_params);
+    }
 
   public:
      /**