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

feat(linux): add newest changes from mnemonic layout support-mac to mnemonic layout support-linux 🐘 #12837

Merged
merged 7 commits into from
Dec 19, 2024

Conversation

SabineSIL
Copy link
Contributor

This PR proposes changes to mcompile linux.
The proposed changes have already been done and been approved for mcompile-mac (see #11334).

Now those changes should be added to mcompile-linux as well

@keymanapp-test-bot skip

@SabineSIL SabineSIL added this to the A18S17 milestone Dec 17, 2024
@SabineSIL SabineSIL self-assigned this Dec 17, 2024
@keymanapp-test-bot
Copy link

keymanapp-test-bot bot commented Dec 17, 2024

@keymanapp-test-bot keymanapp-test-bot bot changed the title feat(linux): add newest changes from mnemonic layout support-mac to mnemonic layout support-linux feat(linux): add newest changes from mnemonic layout support-mac to mnemonic layout support-linux 🐘 Dec 17, 2024
@github-actions github-actions bot added the feat label Dec 17, 2024
@SabineSIL SabineSIL marked this pull request as ready for review December 17, 2024 09:31

while (*pdk) {
int n=0;
while (n < (int)vec_deadkeys.size()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be

Suggested change
while (n < (int)vec_deadkeys.size()) {
while (n < (int)vec_deadkeys.size() - 2) {

since we're accessing vec_deadkeys[n+2] (and n+1)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, its the same thing since we work with a set of 3 elements each ( vec_deadkeys is always a multiple of 3 in size) and then we do n += 3; further down
vec_deadkeys.size()-2 and vec_deadkeys.size() would stop the loop after the same amount of loops

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is true, and it works. However, using vec_deadkeys.size() - 2 doesn't change anything in the way the current code works, but it would be a sign of defensive programming.

* @param dk_Table shiftstate of the deadkey
* @param deadkey deadkey character
* @param[out] outputPairs pointer to array of [usvk, ch_out] pairs
* @param[out] dk_vec vector of [usvk, ch_out] pairs
* @param keymap pointer to the currently used (underlying) keyboard Layout
* @return size of array of [usvk, ch_out] pairs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @return size of array of [usvk, ch_out] pairs
* @return size of vector of [usvk, ch_out] pairs

Although I think it's triplets, not pairs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


while (*pdk) {
int n=0;
while (n < (int)vec_deadkeys.size()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is true, and it works. However, using vec_deadkeys.size() - 2 doesn't change anything in the way the current code works, but it would be a sign of defensive programming.

@SabineSIL SabineSIL merged commit b4014a9 into epic/linux-mcompile Dec 19, 2024
8 checks passed
@SabineSIL SabineSIL deleted the feat/linux/mcompile-PR_11334 branch December 19, 2024 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants