Remove extra from getCppType.

The argument is used for array type originally. We
now use hidl_array instead of T[], so there is no
need to use extra.

Renamed the convenience getCppType to getCppStackType
to avoid casting to (Type *) before using this
method (which makes it inconvenient)

Also fixes:
* RefType::getCppType ignores specifyNamespaces
* ConstantExpression.cpp emits a C-style cast instead
  of static_cast

Bug: 32559427

Test: mma passes
Test: hidl_test

Change-Id: I7e2e31c34c1ca1aa83c4a5a4dbdf7fd6b9aff30c
diff --git a/EnumType.cpp b/EnumType.cpp
index 9903b3e..4a25bbe 100644
--- a/EnumType.cpp
+++ b/EnumType.cpp
@@ -72,10 +72,7 @@
 }
 
 std::string EnumType::getCppType(StorageMode,
-                                 std::string *extra,
                                  bool specifyNamespaces) const {
-    extra->clear();
-
     return specifyNamespaces ? fullName() : partialCppName();
 }
 
@@ -147,8 +144,7 @@
     const ScalarType *scalarType = mStorageType->resolveToScalarType();
     CHECK(scalarType != nullptr);
 
-    std::string extra;
-    const std::string storageType = ((Type *)scalarType)->getCppType(&extra);
+    const std::string storageType = scalarType->getCppStackType();
 
     out << "enum class "
         << localName()
@@ -192,8 +188,7 @@
     const ScalarType *scalarType = mStorageType->resolveToScalarType();
     CHECK(scalarType != nullptr);
 
-    std::string extra;
-    const std::string storageType = ((Type *)scalarType)->getCppType(&extra);
+    const std::string storageType = scalarType->getCppStackType();
 
     out << "inline "
         << fullName()