idmap2: fix cpplint warnings

Fix the following to make cpplint happy again:

  - Use C++ style casts
  - Rename a few header guards
  - Add missing includes of standard C++ headers
  - Add comments to the end of namespaces

Also, for consistency, always use "..." instead of <...> for local
include files, i.e.

  #include "idmap2/.*"

Test: cmds/idmap2/static-checks.sh
Change-Id: Ie735a36d562d1fc51b61f1f0f45aec0d160f602d
diff --git a/cmds/idmap2/tests/R.h b/cmds/idmap2/tests/R.h
index aed263a..4f2ee1c 100644
--- a/cmds/idmap2/tests/R.h
+++ b/cmds/idmap2/tests/R.h
@@ -14,10 +14,12 @@
  * limitations under the License.
  */
 
-#ifndef IDMAP2_TESTS_R_H
-#define IDMAP2_TESTS_R_H
+#ifndef IDMAP2_TESTS_R_H_
+#define IDMAP2_TESTS_R_H_
 
-#include <idmap2/ResourceUtils.h>
+#include <string>
+
+#include "idmap2/ResourceUtils.h"
 
 namespace android::idmap2 {
 
@@ -29,15 +31,15 @@
 
 // clang-format off
 namespace R::target {
-  namespace integer {
+  namespace integer {  // NOLINT(runtime/indentation_namespace)
     constexpr ResourceId int1 = 0x7f010000;
 
-    namespace literal {
+    namespace literal {  // NOLINT(runtime/indentation_namespace)
       inline const std::string int1 = hexify(R::target::integer::int1);
     }
   }
 
-  namespace string {
+  namespace string {  // NOLINT(runtime/indentation_namespace)
     constexpr ResourceId not_overlayable = 0x7f020003;
     constexpr ResourceId other = 0x7f020004;
     constexpr ResourceId policy_actor = 0x7f020005;
@@ -52,19 +54,19 @@
     constexpr ResourceId str3 = 0x7f02000f;
     constexpr ResourceId str4 = 0x7f020010;
 
-    namespace literal {
+    namespace literal {  // NOLINT(runtime/indentation_namespace)
       inline const std::string str1 = hexify(R::target::string::str1);
       inline const std::string str3 = hexify(R::target::string::str3);
       inline const std::string str4 = hexify(R::target::string::str4);
     }
-  }
-}
+  }  // namespace string
+}  // namespace R::target
 
 namespace R::overlay {
-  namespace integer {
+  namespace integer {  // NOLINT(runtime/indentation_namespace)
     constexpr ResourceId int1 = 0x7f010000;
   }
-  namespace string {
+  namespace string {  // NOLINT(runtime/indentation_namespace)
     constexpr ResourceId str1 = 0x7f020000;
     constexpr ResourceId str3 = 0x7f020001;
     constexpr ResourceId str4 = 0x7f020002;
@@ -72,10 +74,10 @@
 }
 
 namespace R::overlay_shared {
-  namespace integer {
+  namespace integer {  // NOLINT(runtime/indentation_namespace)
     constexpr ResourceId int1 = 0x00010000;
   }
-  namespace string {
+  namespace string {  // NOLINT(runtime/indentation_namespace)
     constexpr ResourceId str1 = 0x00020000;
     constexpr ResourceId str3 = 0x00020001;
     constexpr ResourceId str4 = 0x00020002;
@@ -99,9 +101,9 @@
   constexpr ResourceId policy_signature = 0x7f010007;
   constexpr ResourceId policy_system = 0x7f010008;
   constexpr ResourceId policy_system_vendor = 0x7f010009;
-};
+}  // namespace R::system_overlay_invalid::string
 // clang-format on
 
 }  // namespace android::idmap2
 
-#endif  // IDMAP2_TESTS_R_H
+#endif  // IDMAP2_TESTS_R_H_