diff options
author | Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org> | 2014-09-18 21:17:29 +0200 |
---|---|---|
committer | Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org> | 2014-09-18 21:17:29 +0200 |
commit | f129e84addb1b0ba1240f39430404dad717c21c2 (patch) | |
tree | 4e808b54b2013515a45031f46f3d368275d4a140 /drm | |
parent | 14fc930d5d2ef272b39342fa083f4097464fc9ea (diff) | |
download | frameworks_av-f129e84addb1b0ba1240f39430404dad717c21c2.zip frameworks_av-f129e84addb1b0ba1240f39430404dad717c21c2.tar.gz frameworks_av-f129e84addb1b0ba1240f39430404dad717c21c2.tar.bz2 |
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 <Bernhard.Rosenkranzer@linaro.org>
Diffstat (limited to 'drm')
-rw-r--r-- | drm/libdrmframework/include/PlugInManager.h | 2 |
1 files changed, 1 insertions, 1 deletions
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 == ".."; } /** |