summaryrefslogtreecommitdiffstats
path: root/sandbox
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-19 05:28:58 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-19 05:28:58 +0000
commitf76184af6b2b63d85d77d71b575a10dc1b6b1255 (patch)
tree85713845c4cb89488ae2aab0c99390b1bd865025 /sandbox
parent63035789c6166164f962c7a37c6ca487d92c2401 (diff)
downloadchromium_src-f76184af6b2b63d85d77d71b575a10dc1b6b1255.zip
chromium_src-f76184af6b2b63d85d77d71b575a10dc1b6b1255.tar.gz
chromium_src-f76184af6b2b63d85d77d71b575a10dc1b6b1255.tar.bz2
Cleanup: avoid foo ? true : false, part 2.
Review URL: https://chromiumcodereview.appspot.com/10942004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@157509 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sandbox')
-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
5 files changed, 9 insertions, 14 deletions
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);