summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/base/escape.cc2
-rw-r--r--net/disk_cache/bitmap.cc4
-rw-r--r--net/disk_cache/entry_impl.cc3
-rw-r--r--net/disk_cache/stress_cache.cc2
-rw-r--r--net/http/http_response_info.cc2
-rw-r--r--net/url_request/url_request_file_dir_job.cc13
-rw-r--r--ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_font_rpc_server.cc3
-rw-r--r--ppapi/tests/test_graphics_2d.cc6
-rw-r--r--sandbox/win/src/interception.cc5
-rw-r--r--sandbox/win/src/policy_broker.cc4
-rw-r--r--sandbox/win/src/policy_engine_processor.cc4
-rw-r--r--sandbox/win/src/sandbox_nt_util.cc4
-rw-r--r--sandbox/win/src/sandbox_utils.cc6
13 files changed, 25 insertions, 33 deletions
diff --git a/net/base/escape.cc b/net/base/escape.cc
index bee60c1..f7ec008 100644
--- a/net/base/escape.cc
+++ b/net/base/escape.cc
@@ -30,7 +30,7 @@ inline char IntToHex(int i) {
// Does quick bit-flicking to lookup needed characters.
struct Charmap {
bool Contains(unsigned char c) const {
- return (map[c >> 5] & (1 << (c & 31))) ? true : false;
+ return ((map[c >> 5] & (1 << (c & 31))) != 0);
}
uint32 map[8];
diff --git a/net/disk_cache/bitmap.cc b/net/disk_cache/bitmap.cc
index 6c9aceb..6d469df 100644
--- a/net/disk_cache/bitmap.cc
+++ b/net/disk_cache/bitmap.cc
@@ -36,7 +36,7 @@ int FindLSBNonEmpty(uint32 word, bool value) {
return FindLSBSetNonZero(word);
}
-}
+} // namespace
namespace disk_cache {
@@ -105,7 +105,7 @@ bool Bitmap::Get(int index) const {
DCHECK_GE(index, 0);
const int i = index & (kIntBits-1);
const int j = index / kIntBits;
- return map_[j] & (1 << i) ? true : false;
+ return ((map_[j] & (1 << i)) != 0);
}
void Bitmap::Toggle(int index) {
diff --git a/net/disk_cache/entry_impl.cc b/net/disk_cache/entry_impl.cc
index 37df0d7..f8c3bb3 100644
--- a/net/disk_cache/entry_impl.cc
+++ b/net/disk_cache/entry_impl.cc
@@ -451,8 +451,7 @@ bool EntryImpl::IsSameEntry(const std::string& key, uint32 hash) {
static_cast<size_t>(entry_.Data()->key_len) != key.size())
return false;
- std::string my_key = GetKey();
- return key.compare(my_key) ? false : true;
+ return (key.compare(GetKey()) == 0);
}
void EntryImpl::InternalDoom() {
diff --git a/net/disk_cache/stress_cache.cc b/net/disk_cache/stress_cache.cc
index 20f63c3..cb63557 100644
--- a/net/disk_cache/stress_cache.cc
+++ b/net/disk_cache/stress_cache.cc
@@ -152,7 +152,7 @@ void StressTheCache(int iteration) {
for (int i = 0;; i++) {
int slot = rand() % kNumEntries;
int key = rand() % kNumKeys;
- bool truncate = rand() % 2 ? false : true;
+ bool truncate = (rand() % 2 == 0);
int size = kSize - (rand() % 20) * kSize / 20;
if (entries[slot])
diff --git a/net/http/http_response_info.cc b/net/http/http_response_info.cc
index e3fcb69..9c33ab4 100644
--- a/net/http/http_response_info.cc
+++ b/net/http/http_response_info.cc
@@ -221,7 +221,7 @@ bool HttpResponseInfo::InitFromPickle(const Pickle& pickle,
was_fetched_via_proxy = (flags & RESPONSE_INFO_WAS_PROXY) != 0;
- *response_truncated = (flags & RESPONSE_INFO_TRUNCATED) ? true : false;
+ *response_truncated = (flags & RESPONSE_INFO_TRUNCATED) != 0;
return true;
}
diff --git a/net/url_request/url_request_file_dir_job.cc b/net/url_request/url_request_file_dir_job.cc
index 7e59234..445c1eb 100644
--- a/net/url_request/url_request_file_dir_job.cc
+++ b/net/url_request/url_request_file_dir_job.cc
@@ -6,7 +6,6 @@
#include "base/bind.h"
#include "base/compiler_specific.h"
-#include "base/file_util.h"
#include "base/message_loop.h"
#include "base/sys_string_conversions.h"
#include "base/utf_string_conversions.h"
@@ -67,7 +66,7 @@ void URLRequestFileDirJob::Kill() {
}
bool URLRequestFileDirJob::ReadRawData(IOBuffer* buf, int buf_size,
- int *bytes_read) {
+ int* bytes_read) {
DCHECK(bytes_read);
*bytes_read = 0;
@@ -124,11 +123,11 @@ void URLRequestFileDirJob::OnListFile(
// ICU's datetime formatting APIs expect time in UTC and take into account
// the timezone before formatting.
data_.append(GetDirectoryListingEntry(
- data.info.cFileName, std::string(),
- (data.info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? true : false,
+ data.info.cFileName,
+ std::string(),
+ ((data.info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0),
size,
base::Time::FromFileTime(data.info.ftLastWriteTime)));
-
#elif defined(OS_POSIX)
// TOOD(jungshik): The same issue as for the directory name.
data_.append(GetDirectoryListingEntry(
@@ -176,8 +175,8 @@ void URLRequestFileDirJob::CompleteRead() {
}
}
-bool URLRequestFileDirJob::FillReadBuffer(char *buf, int buf_size,
- int *bytes_read) {
+bool URLRequestFileDirJob::FillReadBuffer(char* buf, int buf_size,
+ int* bytes_read) {
DCHECK(bytes_read);
*bytes_read = 0;
diff --git a/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_font_rpc_server.cc b/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_font_rpc_server.cc
index dffff7f..28c0a1e 100644
--- a/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_font_rpc_server.cc
+++ b/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_font_rpc_server.cc
@@ -142,8 +142,7 @@ void PpbFontRpcServer::PPB_Font_DrawTextAt(
reinterpret_cast<struct PP_Point*>(position);
struct PP_Rect* pp_clip =
reinterpret_cast<struct PP_Rect*>(clip);
- PP_Bool pp_image_data_is_opaque =
- PP_FromBool(image_data_is_opaque ? true : false);
+ PP_Bool pp_image_data_is_opaque = PP_FromBool(image_data_is_opaque != 0);
PP_Bool pp_success = PPBFontInterface()->DrawTextAt(font,
image_data,
pp_text_run,
diff --git a/ppapi/tests/test_graphics_2d.cc b/ppapi/tests/test_graphics_2d.cc
index 9cdd150..feefbd5 100644
--- a/ppapi/tests/test_graphics_2d.cc
+++ b/ppapi/tests/test_graphics_2d.cc
@@ -307,7 +307,7 @@ std::string TestGraphics2D::TestInitToZero() {
std::string TestGraphics2D::TestDescribe() {
const int w = 15, h = 17;
- const bool always_opaque = ::rand() % 2 ? true : false;
+ const bool always_opaque = (::rand() % 2 == 1);
pp::Graphics2D dc(instance_, pp::Size(w, h), always_opaque);
if (dc.is_null())
return "Failure creating a boring device";
@@ -651,8 +651,8 @@ std::string TestGraphics2D::TestFlush() {
std::string TestGraphics2D::TestDev() {
// Tests GetScale/SetScale via the Graphics2D_Dev C++ wrapper
- const int w=20, h=16;
- const float scale=1.0f/2.0f;
+ const int w = 20, h = 16;
+ const float scale = 1.0f/2.0f;
pp::Graphics2D dc(instance_, pp::Size(w, h), false);
if (dc.is_null())
return "Failure creating a boring device";
diff --git a/sandbox/win/src/interception.cc b/sandbox/win/src/interception.cc
index 929b621..d8c5b36 100644
--- a/sandbox/win/src/interception.cc
+++ b/sandbox/win/src/interception.cc
@@ -433,9 +433,8 @@ bool InterceptionManager::PatchNtdll(bool hot_patch_needed) {
PAGE_EXECUTE_READ, &old_protection);
ResultCode ret = child_->TransferVariable("g_originals", g_originals,
- sizeof(g_originals));
-
- return SBOX_ALL_OK == ret ? true : false;
+ sizeof(g_originals));
+ return (SBOX_ALL_OK == ret);
}
bool InterceptionManager::PatchClientFunctions(DllInterceptionData* thunks,
diff --git a/sandbox/win/src/policy_broker.cc b/sandbox/win/src/policy_broker.cc
index 210eb47..e36c343 100644
--- a/sandbox/win/src/policy_broker.cc
+++ b/sandbox/win/src/policy_broker.cc
@@ -80,9 +80,7 @@ bool SetupNtdllImports(TargetProcess *child) {
for (size_t i = 0; i < sizeof(g_nt)/sizeof(void*); i++)
DCHECK(reinterpret_cast<char**>(&g_nt)[i]);
#endif
- ResultCode ret = child->TransferVariable("g_nt", &g_nt, sizeof(g_nt));
-
- return SBOX_ALL_OK == ret ? true : false;
+ return (SBOX_ALL_OK == child->TransferVariable("g_nt", &g_nt, sizeof(g_nt)));
}
#undef INIT_GLOBAL_NT
diff --git a/sandbox/win/src/policy_engine_processor.cc b/sandbox/win/src/policy_engine_processor.cc
index a35eabf..7ca25b2 100644
--- a/sandbox/win/src/policy_engine_processor.cc
+++ b/sandbox/win/src/policy_engine_processor.cc
@@ -20,13 +20,13 @@ EvalResult PolicyProcessor::GetAction() const {
// true if the opcode should be skipped or not and also can set keep_skipping
// to false to signal that the current instruction should be skipped but not
// the next after the current one.
-bool SkipOpcode(PolicyOpcode& opcode, MatchContext* context,
+bool SkipOpcode(const PolicyOpcode& opcode, MatchContext* context,
bool* keep_skipping) {
if (opcode.IsAction()) {
uint32 options = context->options;
context->Clear();
*keep_skipping = false;
- return (kPolUseOREval == options)? false : true;
+ return (kPolUseOREval != options);
}
*keep_skipping = true;
return true;
diff --git a/sandbox/win/src/sandbox_nt_util.cc b/sandbox/win/src/sandbox_nt_util.cc
index 4c937bd..123a26e 100644
--- a/sandbox/win/src/sandbox_nt_util.cc
+++ b/sandbox/win/src/sandbox_nt_util.cc
@@ -13,7 +13,7 @@ namespace sandbox {
// This is the list of all imported symbols from ntdll.dll.
SANDBOX_INTERCEPT NtExports g_nt = { NULL };
-}
+} // namespace
namespace {
@@ -166,7 +166,7 @@ bool InitHeap() {
g_nt.RtlDestroyHeap(heap);
}
}
- return (g_heap) ? true : false;
+ return (g_heap != NULL);
}
// Physically reads or writes from memory to verify that (at this time), it is
diff --git a/sandbox/win/src/sandbox_utils.cc b/sandbox/win/src/sandbox_utils.cc
index 509c7c8..3aeb6a0 100644
--- a/sandbox/win/src/sandbox_utils.cc
+++ b/sandbox/win/src/sandbox_utils.cc
@@ -26,10 +26,8 @@ bool GetModuleHandleHelper(DWORD flags, const wchar_t* module_name,
GetModuleHandleExFunction get_module_handle_ex = reinterpret_cast<
GetModuleHandleExFunction>(::GetProcAddress(kernel32_base,
"GetModuleHandleExW"));
- if (get_module_handle_ex) {
- BOOL ret = get_module_handle_ex(flags, module_name, module);
- return (ret ? true : false);
- }
+ if (get_module_handle_ex)
+ return (get_module_handle_ex(flags, module_name, module) != FALSE);
if (!flags) {
*module = ::LoadLibrary(module_name);