Replace curTick global variable with accessor functions.
[gem5.git] / src / base / stats / mysql.cc
index 6ef173f50106de395b9f8c5344d42aeccb1f0488..d257de7434aba62a13584824a67016ac2d1d274b 100644 (file)
@@ -481,9 +481,10 @@ MySql::configure(const DistInfo &info)
     if (!configure(info, "DIST"))
         return;
 
-    const DistParams *params =
-        safe_cast<const DistParams *>(info.storageParams);
-    if (params->type == Dist) {
+    const DistStor::Params *params =
+        dynamic_cast<const DistStor::Params *>(info.storageParams);
+    if (params) {
+        assert(params->type == Dist);
         stat.size = params->buckets;
         stat.min = params->min;
         stat.max = params->max;
@@ -498,9 +499,10 @@ MySql::configure(const VectorDistInfo &info)
     if (!configure(info, "VECTORDIST"))
         return;
 
-    const DistParams *params =
-        safe_cast<const DistParams *>(info.storageParams);
-    if (params->type == Dist) {
+    const DistStor::Params *params =
+        dynamic_cast<const DistStor::Params *>(info.storageParams);
+    if (params) {
+        assert(params->type == Dist);
         stat.size = params->buckets;
         stat.min = params->min;
         stat.max = params->max;
@@ -611,7 +613,7 @@ MySql::output()
         configure();
 
     // store sample #
-    newdata.tick = curTick;
+    newdata.tick = curTick();
 
     MySQL::Connection &mysql = run->conn();
 
@@ -834,4 +836,4 @@ initMySQL(string host, string user, string password, string database,
     return true;
 }
 
-/* end namespace Stats */ }
+} // namespace Stats