Fix comparisson operation of const char* with hidl_string
am: 62a38dfd2d
Change-Id: I880d3b0dce95aaf4227f417af4aa603cccbc6796
diff --git a/base/include/hidl/HidlSupport.h b/base/include/hidl/HidlSupport.h
index f44160f..5cda20a 100644
--- a/base/include/hidl/HidlSupport.h
+++ b/base/include/hidl/HidlSupport.h
@@ -173,15 +173,15 @@
};
// Use NOLINT to suppress missing parentheses warnings around OP.
-#define HIDL_STRING_OPERATOR(OP) \
- inline bool operator OP(const hidl_string &hs1, const hidl_string &hs2) { \
- return strcmp(hs1.c_str(), hs2.c_str()) OP 0; /* NOLINT */ \
- } \
- inline bool operator OP(const hidl_string &hs, const char *s) { \
- return strcmp(hs.c_str(), s) OP 0; /* NOLINT */ \
- } \
- inline bool operator OP(const char *s, const hidl_string &hs) { \
- return strcmp(hs.c_str(), s) OP 0; /* NOLINT */ \
+#define HIDL_STRING_OPERATOR(OP) \
+ inline bool operator OP(const hidl_string& hs1, const hidl_string& hs2) { \
+ return strcmp(hs1.c_str(), hs2.c_str()) OP 0; /* NOLINT */ \
+ } \
+ inline bool operator OP(const hidl_string& hs, const char* s) { \
+ return strcmp(hs.c_str(), s) OP 0; /* NOLINT */ \
+ } \
+ inline bool operator OP(const char* s, const hidl_string& hs) { \
+ return strcmp(s, hs.c_str()) OP 0; /* NOLINT */ \
}
HIDL_STRING_OPERATOR(==)