From f129e84addb1b0ba1240f39430404dad717c21c2 Mon Sep 17 00:00:00 2001 From: Bernhard Rosenkraenzer Date: Thu, 18 Sep 2014 21:17:29 +0200 Subject: Fix comparison of String8 to char* literal Clang (correctly) interprets if ("." == sName) as if ("." == (const char*)sName) and recognizes that comparing the pointers isn't what was meant. With if (sName == ".") both clang and gcc see and use String8::operator==(const char *), ensuring we get the wanted behavior. Change-Id: Ide240e13214a56f6899f72de3db75dac647e6d4b Signed-off-by: Bernhard Rosenkraenzer --- drm/libdrmframework/include/PlugInManager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drm') diff --git a/drm/libdrmframework/include/PlugInManager.h b/drm/libdrmframework/include/PlugInManager.h index c1d019a..a4c2bb9 100644 --- a/drm/libdrmframework/include/PlugInManager.h +++ b/drm/libdrmframework/include/PlugInManager.h @@ -238,7 +238,7 @@ private: */ bool isDotOrDDot(const struct dirent* pEntry) const { String8 sName(pEntry->d_name); - return "." == sName || ".." == sName; + return sName == "." || sName == ".."; } /** -- cgit v1.1