Skip to content

Commit

Permalink
Resolve relevant SonarCloud warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ns6089 authored and ReenigneArcher committed Aug 16, 2024
1 parent 870747c commit fd58f6b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/nvenc/nvenc_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace nvenc {
/**
* @param device_type Underlying device type used by derived class.
*/
nvenc_base(NV_ENC_DEVICE_TYPE device_type);
explicit nvenc_base(NV_ENC_DEVICE_TYPE device_type);
virtual ~nvenc_base();

nvenc_base(const nvenc_base &) = delete;
Expand Down
5 changes: 3 additions & 2 deletions src/nvenc/nvenc_d3d11.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ namespace nvenc {
*/
class nvenc_d3d11: public nvenc_base {
public:
nvenc_d3d11(NV_ENC_DEVICE_TYPE device_type):
explicit nvenc_d3d11(NV_ENC_DEVICE_TYPE device_type):
nvenc_base(device_type) {}

Check warning on line 27 in src/nvenc/nvenc_d3d11.h

View check run for this annotation

Codecov / codecov/patch

src/nvenc/nvenc_d3d11.h#L26-L27

Added lines #L26 - L27 were not covered by tests

virtual ~nvenc_d3d11();
~nvenc_d3d11();

/**
* @brief Get input surface texture.
Expand All @@ -39,6 +39,7 @@ namespace nvenc {
bool
init_library() override;

private:
HMODULE dll = NULL;
};

Expand Down
2 changes: 1 addition & 1 deletion src/nvenc/nvenc_d3d11_native.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace nvenc {
/**
* @param d3d_device Direct3D11 device used for encoding.
*/
nvenc_d3d11_native(ID3D11Device *d3d_device);
explicit nvenc_d3d11_native(ID3D11Device *d3d_device);
~nvenc_d3d11_native();

ID3D11Texture2D *
Expand Down
3 changes: 2 additions & 1 deletion src/nvenc/nvenc_d3d11_on_cuda.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace nvenc {
* @param d3d_device Direct3D11 device that will create input surface texture.
* CUDA encoding device will be derived from it.
*/
nvenc_d3d11_on_cuda(ID3D11Device *d3d_device);
explicit nvenc_d3d11_on_cuda(ID3D11Device *d3d_device);
~nvenc_d3d11_on_cuda();

ID3D11Texture2D *
Expand Down Expand Up @@ -51,6 +51,7 @@ namespace nvenc {

~autopop_context();

explicit
operator bool() const {

Check warning on line 55 in src/nvenc/nvenc_d3d11_on_cuda.h

View check run for this annotation

Codecov / codecov/patch

src/nvenc/nvenc_d3d11_on_cuda.h#L55

Added line #L55 was not covered by tests
return pushed_context != nullptr;
}
Expand Down
4 changes: 2 additions & 2 deletions src/video_colorspace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ namespace video {
Kr = 0.2627;
Kb = 0.0593;
break;
};
}
double Kg = 1.0 - Kr - Kb;

double y_mult, y_add;
Expand Down Expand Up @@ -280,7 +280,7 @@ namespace video {
case colorspace_e::bt2020sdr:
result = &colors[8];
break;

Check warning on line 282 in src/video_colorspace.cpp

View check run for this annotation

Codecov / codecov/patch

src/video_colorspace.cpp#L273-L282

Added lines #L273 - L282 were not covered by tests
};
}

if (colorspace.bit_depth == 10) result += 2;
if (colorspace.full_range) result += 1;
Expand Down

0 comments on commit fd58f6b

Please sign in to comment.