Merge pull request #10881 from akallabeth/codespell

Codespell
This commit is contained in:
akallabeth 2024-11-21 11:36:04 +01:00 committed by GitHub
commit 2779b663ff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
14 changed files with 81 additions and 19 deletions

View File

@ -4,4 +4,4 @@ about: Create a issue to request/track a backport
---
Releated pull request for master:
Related pull request for master:

26
.github/workflows/codespell.yml vendored Normal file
View File

@ -0,0 +1,26 @@
name: codespell
on:
workflow_dispatch:
branches: [ master, stable* ]
pull_request:
branches: [ master, stable* ]
schedule:
- cron: '30 4 * * SUN'
jobs:
build:
runs-on: ubuntu-latest
name: "codespell"
steps:
- name: "Check out source"
uses: actions/checkout@v4
- name: "Prepare environment"
run: |
sudo apt-get update -q -y
sudo apt-get install -q -y \
codespell
- name: "Run codespell..."
run: |
./scripts/codespell.sh

View File

@ -69,7 +69,7 @@ contains a number of improvements for distributors:
Windows 7 RFX and bitmap updates with multiple rectangles have been deactivated, so adjust shadow to not send such.
Noteworthy changes:
* Fix ActionScript paramter (#10423)
* Fix ActionScript parameter (#10423)
* Support keyboard layouts as JSON resource (#10394)
* Support timezones as JSON resource and command line argument (#10428 #10393 #10391)
* Deactivate AsyncUpdate (#10402)

View File

@ -486,9 +486,9 @@ void SDLConnectionDialog::resetTimer()
Uint32 SDLConnectionDialog::timeout(Uint32 intervalMS, void* pvthis)
{
auto ths = static_cast<SDLConnectionDialog*>(pvthis);
ths->hide();
ths->_running = false;
auto self = static_cast<SDLConnectionDialog*>(pvthis);
self->hide();
self->_running = false;
return 0;
}

View File

@ -485,9 +485,9 @@ void SDLConnectionDialog::resetTimer()
Uint32 SDLConnectionDialog::timeout(void* pvthis, SDL_TimerID timerID, Uint32 intervalMS)
{
auto ths = static_cast<SDLConnectionDialog*>(pvthis);
ths->hide();
ths->_running = false;
auto self = static_cast<SDLConnectionDialog*>(pvthis);
self->hide();
self->_running = false;
return 0;
}

View File

@ -2864,7 +2864,7 @@ static int parse_kbd_options(rdpSettings* settings, const COMMAND_LINE_ARGUMENT_
if (option_starts_with("remap:", val))
{
/* Append this new occurence to the already existing list */
/* Append this new occurrence to the already existing list */
char* now = _strdup(&val[6]);
const char* old =
freerdp_settings_get_string(settings, FreeRDP_KeyboardRemappingList);

View File

@ -93,7 +93,7 @@ static const SYSTEM_LOCALE SYSTEM_LOCALE_TABLE[] = {
{ "en", "AU", ENGLISH_AUSTRALIAN }, /* English (Australia) */
{ "en", "BZ", ENGLISH_BELIZE }, /* English (Belize) */
{ "en", "CA", ENGLISH_CANADIAN }, /* English (Canada) */
{ "en", "CB", ENGLISH_CARIBBEAN }, /* English (Carribbean) */
{ "en", "CB", ENGLISH_CARIBBEAN }, /* English (Caribbean) */
{ "en", "IN", ENGLISH_INDIA }, /* Windows Vista and later: English (India) */
{ "en", "IE", ENGLISH_IRELAND }, /* English (Ireland) */
{ "en", "JM", ENGLISH_JAMAICA }, /* English (Jamaica) */

21
scripts/codespell.ignore Normal file
View File

@ -0,0 +1,21 @@
nin
pres
ptd
statics
inout
ontext
clen
usera
fom
fle
parm
tolen
psuh
larg
varn
wight
resizeable
wan
bre
sur
numer

15
scripts/codespell.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash -x
SCRIPT_PATH=$(dirname "${BASH_SOURCE[0]}")
SCRIPT_PATH=$(realpath "$SCRIPT_PATH")
# ignore the following regular expressions:
#
# 1. All words consisting of only 2 characters (too many issues with variable names)
# 2. Every word of the form 'pEvent', e.g. variable prefixed with p for pointer
# 3. Every word prefixed by e.g. '\tSome text', e.g. format string escapes
codespell \
-I "$SCRIPT_PATH/codespell.ignore" \
-S ".git,*.ai,*.svg,*.rtf,*/assets/de_*,*/res/values-*,*/protocols/xdg*,*/test/*" \
--ignore-regex "\b[a-zA-Z][a-zA-Z]\b|\bp[A-Z].*|\\\\[a-z][a-zA-Z].*" \
--count $SCRIPT_PATH/..

View File

@ -781,7 +781,7 @@ static INLINE void shadow_client_common_frame_acknowledge(rdpShadowClient* clien
* calculate how much frames are in progress.
* Some rdp clients (win7 mstsc) skips frame ACK if it is
* inactive, we should not expect ACK for each frame.
* So it is OK to calculate inflight frame count according to
* So it is OK to calculate in-flight frame count according to
* a latest acknowledged frame id.
*/
WINPR_ASSERT(client);

View File

@ -37,7 +37,7 @@ UINT32 shadow_encoder_preferred_fps(rdpShadowEncoder* encoder)
UINT32 shadow_encoder_inflight_frames(rdpShadowEncoder* encoder)
{
/* Return inflight frame count.
/* Return in-flight frame count.
* If queueDepth is SUSPEND_FRAME_ACKNOWLEDGEMENT, count = 0
* Otherwise, calculate count =
* <last sent frame id> - <last client-acknowledged frame id>

View File

@ -177,8 +177,8 @@ local field_rdpudp2_ackvec_base = Field.new("rdpudp2.ackvec.baseseqnum")
function unwrapPacket(tvbuf)
local len = tvbuf:reported_length_remaining()
local ret = tvbuf:bytes(7, 1) .. tvbuf:bytes(1, 6) .. tvbuf:bytes(0, 1) .. tvbuf:bytes(8, len-8)
--dprint2("iput first bytes=", tvbuf:bytes(0, 9):tohex(true, " "))
--dprint2("oput first bytes=", ret:subset(0, 9):tohex(true, " "))
--dprint2("input first bytes=", tvbuf:bytes(0, 9):tohex(true, " "))
--dprint2("output first bytes=", ret:subset(0, 9):tohex(true, " "))
return ret:tvb("RDP-UDP unwrapped")
end

View File

@ -972,7 +972,7 @@ static BOOL test_ConvertFromUnicode_wrapper(void)
}
if (dst == NULL)
{
(void)fprintf(stderr, "ConvertFromUnicode failure A2: destination ist NULL\n");
(void)fprintf(stderr, "ConvertFromUnicode failure A2: destination is NULL\n");
goto fail;
}
if ((i = strlen(dst)) != 16)
@ -1005,7 +1005,7 @@ static BOOL test_ConvertFromUnicode_wrapper(void)
}
if (dst == NULL)
{
(void)fprintf(stderr, "ConvertFromUnicode failure B2: destination ist NULL\n");
(void)fprintf(stderr, "ConvertFromUnicode failure B2: destination is NULL\n");
goto fail;
}
if ((i = strlen(dst)) != 16)
@ -1088,7 +1088,7 @@ static BOOL test_ConvertToUnicode_wrapper(void)
i = (size_t)ii;
if (dst == NULL)
{
(void)fprintf(stderr, "ConvertToUnicode failure A2: destination ist NULL\n");
(void)fprintf(stderr, "ConvertToUnicode failure A2: destination is NULL\n");
goto fail;
}
if ((i = _wcslen(dst)) != 16)
@ -1123,7 +1123,7 @@ static BOOL test_ConvertToUnicode_wrapper(void)
}
if (dst == NULL)
{
(void)fprintf(stderr, "ConvertToUnicode failure B2: destination ist NULL\n");
(void)fprintf(stderr, "ConvertToUnicode failure B2: destination is NULL\n");
goto fail;
}
if ((i = _wcslen(dst)) != 16)

View File

@ -125,7 +125,7 @@ void* winpr_backtrace(DWORD size)
return winpr_win_backtrace(size);
#else
LOGF(support_msg);
/* return a non NULL buffer to allow the backtrace function familiy to succeed without failing
/* return a non NULL buffer to allow the backtrace function family to succeed without failing
*/
return _strdup(support_msg);
#endif