Skip to content

Commit

Permalink
[clang-tidy] fix some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanpoelen committed Jan 19, 2024
1 parent ba35944 commit df5bd6f
Show file tree
Hide file tree
Showing 13 changed files with 15 additions and 19 deletions.
3 changes: 1 addition & 2 deletions src/acl/module_manager/create_module_rdp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ enum class PerformAutomaticReconnection : bool { No, Yes, };

struct TransportWrapperFnView
{
TransportWrapperFnView() noexcept
{}
TransportWrapperFnView() noexcept = default;

TransportWrapperFnView(TransportWrapperFnView&&) noexcept = default;
TransportWrapperFnView(TransportWrapperFnView const&) noexcept = default;
Expand Down
2 changes: 1 addition & 1 deletion src/capture/capture.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class Capture final
bool capture_kbd, const KbdLogParams& kbd_log_params,
const VideoParams& video_params,
UpdateProgressData * update_progress_data,
CropperInfo cropping_info,
CropperInfo cropper_info,
Rect rail_window_rect
);

Expand Down
1 change: 0 additions & 1 deletion src/core/RDP/caches/pointercache.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include "core/RDP/rdp_pointer.hpp" // predefined_pointer_count
#include "cxx/cxx.hpp"
#include "gdi/graphic_api.hpp"
#include "core/RDP/rdp_pointer.hpp"


class PointerCache : noncopyable
Expand Down
2 changes: 1 addition & 1 deletion src/core/RDP/nla/kerberos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ static char const* get_krb_err_message(krb5_error_code ret)
return "<unknown>";
}

void Krb5Creds::KrbErrLogger::log_if_error()
void Krb5Creds::KrbErrLogger::log_if_error() const
{
if (!ret) {
return ;
Expand Down
2 changes: 1 addition & 1 deletion src/core/RDP/nla/kerberos.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class Krb5Creds final
char const* ctx_msg = nullptr;
char const* extra_param = nullptr;

void log_if_error();
void log_if_error() const;
};

bool resolve_cache_name(
Expand Down
3 changes: 2 additions & 1 deletion src/core/RDP/nla/nla_client_kerberos.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,8 @@ class rdpCredsspClientKerberos
if (!this->sspi_krb_ctx) {
return SEC_E_NO_CONTEXT;
}
gss_buffer_desc inbuf, outbuf;
gss_buffer_desc inbuf;
gss_buffer_desc outbuf;
inbuf.value = const_cast<uint8_t*>(data_in.data()); /*NOLINT*/
inbuf.length = data_in.size();
// LOG(LOG_INFO, "GSS_UNWRAP inbuf length : %d", inbuf.length);
Expand Down
2 changes: 1 addition & 1 deletion src/core/font.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ FontData::FontData(char const * file_path)
// extract replacement char
bool status = extract_contigous_glyph(-1u);
if (this->font_items.get() != font_char_p) {
this->unknown_item = *this->font_items.get();
this->unknown_item = this->font_items[0];
--number_of_glyph;
--font_char_p;
}
Expand Down
2 changes: 1 addition & 1 deletion src/mod/internal/widget_test_mod.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class WidgetTestMod : public RailInternalModBase
void rdp_gdi_down() override
{}

void rdp_input_invalidate(Rect rect) override;
void rdp_input_invalidate(Rect clip) override;

void rdp_input_mouse(uint16_t /*device_flags*/, uint16_t x, uint16_t y) override;

Expand Down
1 change: 0 additions & 1 deletion src/mod/rdp/rdp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ struct FileValidatorService;
#include "utils/sugar/split.hpp"
#include "utils/sugar/static_array_to_hexadecimal_chars.hpp"
#include "mod/rdp/rdp_negociation.hpp"
#include "acl/auth_api.hpp"
#include "configs/config.hpp"

class RdpSessionProbeWrapper;
Expand Down
2 changes: 1 addition & 1 deletion src/mod/rdp/rdp_negociation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ RdpNegociation::RdpNegociation(
, logon_info(logon_info)
, front(front)
, cbAutoReconnectCookie(info.cbAutoReconnectCookie)
, redirection_password_or_cookie(std::move(mod_rdp_params.redirection_password_or_cookie))
, redirection_password_or_cookie(mod_rdp_params.redirection_password_or_cookie)
, keylayout(info.keylayout)
, console_session(info.console_session)
, front_bpp(info.screen_info.bpp)
Expand Down
1 change: 0 additions & 1 deletion src/utils/meminfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ Author(s): Proxies Team

#include <cstdint>

#include <string.h>
#include <unistd.h>
#include <fcntl.h>

Expand Down
7 changes: 3 additions & 4 deletions src/utils/primitives/primitives.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ static Primitives::pstatus_t yCbCrToRGB_16s8u_P3AC4R_XXX(

for (uint32_t y = 0; y < roi->height; y++) {
for (uint32_t x = 0; x < roi->width; x++) {
int16_t R, G, B;
const int32_t divisor = 16;
const int32_t Y = ((*pY++) + 4096) << divisor;
const int32_t Cb = (*pCb++);
Expand All @@ -130,9 +129,9 @@ static Primitives::pstatus_t yCbCrToRGB_16s8u_P3AC4R_XXX(
const int32_t CrG = Cr * static_cast<int32_t>(0.714401f * (1 << divisor));
const int32_t CbG = Cb * static_cast<int32_t>(0.343730f * (1 << divisor));
const int32_t CbB = Cb * static_cast<int32_t>(1.769905f * (1 << divisor));
R = static_cast<int16_t>((CrR + Y) >> divisor) >> 5;
G = static_cast<int16_t>((Y - CbG - CrG) >> divisor) >> 5;
B = static_cast<int16_t>((CbB + Y) >> divisor) >> 5;
const int16_t R = static_cast<int16_t>((CrR + Y) >> divisor) >> 5;
const int16_t G = static_cast<int16_t>((Y - CbG - CrG) >> divisor) >> 5;
const int16_t B = static_cast<int16_t>((CbB + Y) >> divisor) >> 5;
pRGB = WritePixel::write(pRGB, formatSize, dstFormat, CLIP(R), CLIP(G),
CLIP(B), 0xFF);
}
Expand Down
6 changes: 3 additions & 3 deletions src/utils/strutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,16 @@ std::size_t strlcpy(char* dest, char const* src, std::size_t buflen) noexcept
}


void str_replace_inplace(std::string& str, chars_view tag, chars_view replacement)
void str_replace_inplace(std::string& str, chars_view pattern, chars_view replacement)
{
assert(!tag.empty());
assert(!pattern.empty());

#ifdef __EMSCRIPTEN__
std::experimental::boyer_moore_searcher<std::string_view::iterator>
#else
std::boyer_moore_searcher
#endif
searcher(tag.begin(), tag.end());
searcher(pattern.begin(), pattern.end());

std::ptrdiff_t i = 0;

Expand Down

0 comments on commit df5bd6f

Please sign in to comment.