Fix cppcheck warnings (#11883)
* remove unused variable * limit scope of variable 'ret' * pass shared_ptr<SkBitmap> by reference * silence warning: value reassign before read * fix oops * don't refer to 'response' after std::move()ing it * make the linter happy
This commit is contained in:
parent
f8b7145c6b
commit
402201ac39
5 changed files with 7 additions and 7 deletions
|
@ -95,9 +95,10 @@ bool AtomMainDelegate::BasicStartupComplete(int* exit_code) {
|
|||
logging::SetLogItems(true, false, true, false);
|
||||
|
||||
// Enable convient stack printing.
|
||||
bool enable_stack_dumping = env->HasVar("ELECTRON_ENABLE_STACK_DUMPING");
|
||||
#if defined(DEBUG) && defined(OS_LINUX)
|
||||
enable_stack_dumping = true;
|
||||
bool enable_stack_dumping = true;
|
||||
#else
|
||||
bool enable_stack_dumping = env->HasVar("ELECTRON_ENABLE_STACK_DUMPING");
|
||||
#endif
|
||||
if (enable_stack_dumping)
|
||||
base::debug::EnableInProcessStackDumping();
|
||||
|
|
|
@ -119,9 +119,8 @@ void ShutdownDetector::ThreadMain() {
|
|||
|
||||
int signal;
|
||||
size_t bytes_read = 0;
|
||||
ssize_t ret;
|
||||
do {
|
||||
ret = HANDLE_EINTR(
|
||||
ssize_t ret = HANDLE_EINTR(
|
||||
read(shutdown_fd_,
|
||||
reinterpret_cast<char*>(&signal) + bytes_read,
|
||||
sizeof(signal) - bytes_read));
|
||||
|
|
|
@ -52,7 +52,7 @@ AtomWebUIControllerFactory::CreateWebUIControllerForURL(content::WebUI* web_ui,
|
|||
if (url.host() == kPdfViewerUIHost) {
|
||||
base::StringPairs toplevel_params;
|
||||
base::SplitStringIntoKeyValuePairs(url.query(), '=', '&', &toplevel_params);
|
||||
std::string stream_id, src;
|
||||
std::string src;
|
||||
|
||||
const net::UnescapeRule::Type unescape_rules =
|
||||
net::UnescapeRule::SPACES | net::UnescapeRule::PATH_SEPARATORS |
|
||||
|
|
|
@ -194,7 +194,7 @@ class AtomCopyFrameGenerator {
|
|||
|
||||
void OnCopyFrameCaptureSuccess(
|
||||
const gfx::Rect& damage_rect,
|
||||
std::shared_ptr<SkBitmap> bitmap) {
|
||||
const std::shared_ptr<SkBitmap>& bitmap) {
|
||||
base::AutoLock lock(onPaintLock_);
|
||||
view_->OnPaint(damage_rect, *bitmap);
|
||||
}
|
||||
|
|
|
@ -72,10 +72,10 @@ std::unique_ptr<base::DictionaryValue>
|
|||
CreateFailureResponse(int id, const std::string& param) {
|
||||
auto response = base::MakeUnique<base::DictionaryValue>();
|
||||
auto error_object = base::MakeUnique<base::DictionaryValue>();
|
||||
response->Set(kError, std::move(error_object));
|
||||
error_object->SetInteger(params::kErrorCode, kErrorInvalidParams);
|
||||
error_object->SetString(params::kErrorMessage,
|
||||
base::StringPrintf("Missing or Invalid '%s' parameter", param.c_str()));
|
||||
response->Set(kError, std::move(error_object));
|
||||
return response;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue