Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement til::au16 and til::u16a conversion functions & make first use in WriteConsoleAImpl #4493

Closed
wants to merge 32 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
a8bd2df
implement til::au16 and til::u16a conversion functions & update relat…
german-one Feb 6, 2020
b19b066
eliminate redundant code, update comments, rearrange functions
german-one Feb 6, 2020
37324d5
add unit test for DBCS partials
german-one Feb 6, 2020
fcc9bf1
make first use in `WriteConsoleAImpl`
german-one Feb 6, 2020
2571d23
pass static analysis
german-one Feb 6, 2020
c7bdc90
try harder to pass the SA
german-one Feb 6, 2020
7f77579
have fun with C array
german-one Feb 6, 2020
c07cb48
get over the brace barrier?
german-one Feb 7, 2020
20f1d2b
see what til::at makes out of it
german-one Feb 7, 2020
aff87e0
try again to suppress warnings
german-one Feb 7, 2020
519c374
make the CPINFO a private member and only update it if necessary
german-one Feb 7, 2020
26ac753
update `til::at` to make it applicable for arrays
german-one Feb 10, 2020
542bfd2
reverse `til::at` update
german-one Feb 10, 2020
fb74524
add partials handling to GB 18030 and GSM 7 bit codepages
german-one Feb 17, 2020
3003ff2
make sure caching of partials still works if the string consists of a…
german-one Feb 21, 2020
c8735d5
Merge branch 'master' into master
german-one Feb 21, 2020
986b269
Merge branch 'master' into master
german-one Mar 4, 2020
34b6b1d
keep track of u8u16 PR crossfire and findings
german-one Mar 5, 2020
3462298
update `til::at` and use it
german-one Mar 6, 2020
f9acdfc
try to suppress array to pointer decay
german-one Mar 6, 2020
fe60901
funny business: try to call the pointer overload explicitely
german-one Mar 6, 2020
0d83b56
use rvalue reference
german-one Mar 6, 2020
385b735
remove array overload, use pointer
german-one Mar 6, 2020
11602df
make aState a public member of SCREEN_INFORMATION & use it in WriteCo…
german-one Mar 7, 2020
f2a4b3a
spelling
german-one Mar 8, 2020
9008eff
risk on more red X: explicitely exclude arrays in til::at overloads
german-one Mar 9, 2020
bd2be6b
undo, even that didn't work
german-one Mar 9, 2020
79f154e
Merge branch 'master' into master
german-one Mar 25, 2020
b857c3e
add `au` and `GSM` to `whitelist.txt`
german-one Mar 25, 2020
83443da
Merge remote-tracking branch 'upstream/master'
Mar 26, 2020
ab4e0d7
keep initialization style consistent
german-one Mar 26, 2020
4983479
Merge remote-tracking branch 'upstream/master'
Mar 28, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/inc/til/u8u16convert.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,13 @@ namespace til // Terminal Implementation Library. Also: "Today I Learned"
{
// We use our own algorithm because IsDBCSLeadByteEx() supports only a subset of DBCS codepages.
const auto uCh{ gsl::narrow_cast<byte>(ch) };
for (size_t idx{}; gsl::at(cpInfo.LeadByte, idx) != 0; idx += 2) // OK because the LeadByte array is guaranteed to end with two 0 bytes.
#pragma warning(push)
#pragma warning(suppress : 26482) // Suppress bounds.2 check for indexing with constant expressions.
#pragma warning(suppress : 26446) // Suppress bounds.4 check for subscript operator.
for (int idx{}; cpInfo.LeadByte[idx] != 0; idx += 2) // OK because the LeadByte array is guaranteed to end with two 0 bytes.
german-one marked this conversation as resolved.
Show resolved Hide resolved
{
if (uCh >= gsl::at(cpInfo.LeadByte, idx) && uCh <= gsl::at(cpInfo.LeadByte, idx + 1))
if (uCh >= cpInfo.LeadByte[idx] && uCh <= cpInfo.LeadByte[idx + 1])
#pragma warning(pop)
{
foundLeadByte = true;
break;
Expand Down