Visitar URL original
Silence a couple of compiler/static analysis warnings · lovell/sharp@0e2e55e · GitHub
Skip to content

Commit 0e2e55e

Browse files
committed
Silence a couple of compiler/static analysis warnings
1 parent cef3b8c commit 0e2e55e

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎src/binding.gyp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright 2013 Lovell Fuller and others.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
{
4+
{ # noqa: B018
55
'variables': {
66
'vips_version': '<!(node -p "require(\'../dist/libvips.cjs\').minimumLibvipsVersion")',
77
'platform_and_arch': '<!(node -p "require(\'../dist/libvips.cjs\').buildPlatformArch()")',

‎src/pipeline.cc‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ class PipelineWorker : public Napi::AsyncWorker {
5656
hasAlpha |= image.has_alpha();
5757
}
5858
if (hasAlpha) {
59-
for (auto &image : images) {
60-
if (!image.has_alpha()) {
61-
image = sharp::EnsureAlpha(image, 1);
59+
for (size_t i = 0; i < images.size(); i++) {
60+
if (!images[i].has_alpha()) {
61+
images[i] = sharp::EnsureAlpha(images[i], 1);
6262
}
6363
}
6464
} else {

‎src/utilities.cc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ Napi::Value format(const Napi::CallbackInfo& info) {
133133
input.Set("file", hasInputFile);
134134
input.Set("buffer", hasInputBuffer);
135135
input.Set("stream", hasInputBuffer);
136-
if (hasInputFile) {
136+
if (oc) {
137137
const VipsForeignClass *fc = VIPS_FOREIGN_CLASS(oc);
138138
if (fc->suffs) {
139139
Napi::Array fileSuffix = Napi::Array::New(env);

0 commit comments

Comments
 (0)