Skip to content

Commit cf2b323

Browse files
committed
Resolve SonarQube warnings
1 parent a7216aa commit cf2b323

6 files changed

+19
-9
lines changed

src/dll_main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ void register_property_store_file_extension(const wchar_t* file_extension)
123123
L"prop:System.ItemType;*System.DateModified;*System.Image.Dimensions;*System.Size");
124124
registry::set_value(sub_key, L"PreviewDetails",
125125
L"prop:*System.DateModified;*System.Image.Dimensions;*System.Size;*System.OfflineAvailability;"
126-
"*System.OfflineStatus;*System.DateCreated;*System.SharedWith");
126+
L"*System.OfflineStatus;*System.DateCreated;*System.SharedWith");
127127
}
128128

129129
void register_property_store()

src/jpegls-wic-codec.vcxproj

+1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
</Link>
7373
</ItemDefinitionGroup>
7474
<ItemGroup>
75+
<ClInclude Include="intellisense.hpp" />
7576
<ClInclude Include="macros.hpp" />
7677
<ClInclude Include="version.hpp" />
7778
</ItemGroup>

src/jpegls-wic-codec.vcxproj.filters

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
<ClInclude Include="macros.hpp">
2222
<Filter>Header Files</Filter>
2323
</ClInclude>
24+
<ClInclude Include="intellisense.hpp">
25+
<Filter>Header Files</Filter>
26+
</ClInclude>
2427
</ItemGroup>
2528
<ItemGroup>
2629
<ClCompile Include="dll_main.cpp">

src/jpegls_bitmap_frame_decode.cpp

+7-5
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,9 @@ uint32_t compute_minimal_stride(const frame_info& frame_info) noexcept
156156
void shift_samples(void* buffer, const size_t pixel_count, const uint32_t sample_shift)
157157
{
158158
auto* const pixels{static_cast<uint16_t*>(buffer)};
159-
std::transform(pixels, pixels + pixel_count, pixels,
160-
[sample_shift](const uint16_t pixel) -> uint16_t { return pixel << sample_shift; });
159+
std::transform(pixels, pixels + pixel_count, pixels, [sample_shift](const uint16_t pixel) {
160+
return static_cast<uint16_t>(pixel << sample_shift);
161+
});
161162
}
162163

163164
template<typename SizeType>
@@ -195,17 +196,18 @@ void set_resolution(const jpegls_decoder& decoder, IWICBitmap& bitmap)
195196
{
196197
switch (spiff_header.resolution_units)
197198
{
198-
case spiff_resolution_units::aspect_ratio:
199+
using enum spiff_resolution_units;
200+
case aspect_ratio:
199201
break;
200202

201-
case spiff_resolution_units::dots_per_centimeter: {
203+
case dots_per_centimeter: {
202204
constexpr double dpc_to_dpi{2.54};
203205
check_hresult(bitmap.SetResolution(std::round(spiff_header.horizontal_resolution * dpc_to_dpi),
204206
std::round(spiff_header.vertical_resolution * dpc_to_dpi)));
205207
return;
206208
}
207209

208-
case spiff_resolution_units::dots_per_inch:
210+
case dots_per_inch:
209211
check_hresult(bitmap.SetResolution(spiff_header.horizontal_resolution, spiff_header.vertical_resolution));
210212
return;
211213
}

src/jpegls_bitmap_frame_encode.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: © 2023 Team CharLS
1+
// SPDX-FileCopyrightText: © 2023 Team CharLS
22
// SPDX-License-Identifier: BSD-3-Clause
33

44
module;
@@ -199,7 +199,7 @@ try
199199

200200
allocate_pixel_buffer();
201201

202-
winrt::check_hresult(bitmap_source->CopyPixels(nullptr, static_cast<uint32_t>(source_stride_), static_cast<uint32_t>(source_.size()),
202+
winrt::check_hresult(bitmap_source->CopyPixels(nullptr, source_stride_, static_cast<uint32_t>(source_.size()),
203203
reinterpret_cast<BYTE*>(source_.data())));
204204
state_ = state::received_pixels;
205205
return success_ok;

src/jpegls_bitmap_frame_encode.ixx

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
// SPDX-FileCopyrightText: © 2019 Team CharLS
1+
// SPDX-FileCopyrightText: © 2019 Team CharLS
22
// SPDX-License-Identifier: BSD-3-Clause
33

4+
module;
5+
6+
#include "intellisense.hpp"
7+
48
export module jpegls_bitmap_frame_encode;
59

610
import std;

0 commit comments

Comments
 (0)