diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-02 01:24:49 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-02 01:24:49 +0000 |
commit | f884f2a323456f31486f9dd33d704ee086475355 (patch) | |
tree | 100e319bc567577f46f2d1c615ddce2988940d5e /base | |
parent | 4db1f795e123d9e1a7e848278d066ec189a063f3 (diff) | |
download | chromium_src-f884f2a323456f31486f9dd33d704ee086475355.zip chromium_src-f884f2a323456f31486f9dd33d704ee086475355.tar.gz chromium_src-f884f2a323456f31486f9dd33d704ee086475355.tar.bz2 |
linux: uncontroversial cleanups found by clang
Part of a larger patch to use clang to warning-check our code.
Review URL: http://codereview.chromium.org/561008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37781 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/sys_string_conversions_linux.cc | 12 | ||||
-rw-r--r-- | base/unix_domain_socket_posix.cc | 1 |
2 files changed, 7 insertions, 6 deletions
diff --git a/base/sys_string_conversions_linux.cc b/base/sys_string_conversions_linux.cc index 118f0ac..4c4f5ed 100644 --- a/base/sys_string_conversions_linux.cc +++ b/base/sys_string_conversions_linux.cc @@ -40,7 +40,7 @@ std::string SysWideToNativeMB(const std::wstring& wide) { size_t res = src ? wcrtomb(buf, src, &ps) : 0; switch (res) { // Handle any errors and return an empty string. - case -1: + case static_cast<size_t>(-1): return std::string(); break; case 0: @@ -68,7 +68,7 @@ std::string SysWideToNativeMB(const std::wstring& wide) { size_t res = src ? wcrtomb(&out[j], src, &ps) : 0; switch (res) { // Handle any errors and return an empty string. - case -1: + case static_cast<size_t>(-1): return std::string(); break; case 0: @@ -96,8 +96,8 @@ std::wstring SysNativeMBToWide(const StringPiece& native_mb) { size_t res = mbrtowc(NULL, src, native_mb.size() - i, &ps); switch (res) { // Handle any errors and return an empty string. - case -2: - case -1: + case static_cast<size_t>(-2): + case static_cast<size_t>(-1): return std::wstring(); break; case 0: @@ -125,8 +125,8 @@ std::wstring SysNativeMBToWide(const StringPiece& native_mb) { size_t res = mbrtowc(dst, src, native_mb.size() - i, &ps); switch (res) { // Handle any errors and return an empty string. - case -2: - case -1: + case static_cast<size_t>(-2): + case static_cast<size_t>(-1): return std::wstring(); break; case 0: diff --git a/base/unix_domain_socket_posix.cc b/base/unix_domain_socket_posix.cc index 024c086..08c41cf 100644 --- a/base/unix_domain_socket_posix.cc +++ b/base/unix_domain_socket_posix.cc @@ -4,6 +4,7 @@ #include "base/unix_domain_socket_posix.h" +#include <errno.h> #include <unistd.h> #include <sys/uio.h> #include <sys/socket.h> |