keymanapp / keymanapp/keyman

refactor(windows,linux,mac): request for code changes in several files used throughout mcompile for Windows, Linux and mac 🐘

Open
#11,802 0 comments 0 reactions 0 assignees View on GitHub
epic-linux-mcompile epic-macos-mcompile linux/ mac/ refactor windows/
Dominant language
Pascal
Stars
534
Forks
143
Avg merge
2d 10h
Merged PRs (30d)
113

Description

### Is your feature request related to a problem? Please describe.

No problem but code should be refactored in some places

### Describe the solution you'd like

While reviewing mnemonic keyboard layout-linux PR[#9384](https://github.com/keymanapp/keyman/pull/9384) some ideas came up about how to improve already existing code. The code is running fine so there is no immediate urgency to address this issue right away.

The code mentioned is used in mcompile-Windows, mcompile-Linux and mcompile-Mac (and possibly in other places as well).
In order to keep this specific code the same across all platforms, no changes have been made in _any_ of the mcompile versions for now.
Once this issue is addressed, improvements should be made in mcompile-Windows, mcompile-Linux [PR #9384](https://github.com/keymanapp/keyman/pull/9384) and mcompile-Mac [PR #11334](https://github.com/keymanapp/keyman/pull/11334)

Changes should be made in:

**util_filesystem.cpp**
- [ use __FUNCTION__ macro instead of hard coding the method name](https://github.com/keymanapp/keyman/pull/9384#discussion_r1613254679)
- [unneccessary code ](https://github.com/keymanapp/keyman/pull/9384/files#r1613263494)
- [mount in the else branch ](https://github.com/keymanapp/keyman/pull/9384#discussion_r1613267705)
- [unreachable code](https://github.com/keymanapp/keyman/pull/9384/files#r1613283398)

**mc_import_rules.cpp**

- [rename SGCAPS](https://github.com/keymanapp/keyman/pull/9384#discussion_r1625790119)
- [possibility of buffer overflow](https://github.com/keymanapp/keyman/pull/9384#discussion_r1627797712)
- [initialize *key->dpContext with NULL ](https://github.com/keymanapp/keyman/pull/9384#discussion_r1627807274)
- [another initialize *key->dpContext with NULL ](https://github.com/keymanapp/keyman/pull/9384#discussion_r1627804048)
- [use copy()-method ](https://github.com/keymanapp/keyman/pull/9384#discussion_r1627814029)
- [use std::u16string instead of PKMX_WCHAR](https://github.com/keymanapp/keyman/pull/9384#discussion_r1627823950)
- [ignore the last element in the array](https://github.com/keymanapp/keyman/pull/9384/files#r1629160269)
- [move declaration of class deadkey](https://github.com/keymanapp/keyman/pull/9384/files#r1625742125)
- [use unordered map instead of arrays](https://github.com/keymanapp/keyman/pull/9384/files#r1625786703)
- [replace calls to KMX_MaxShiftState()](https://github.com/keymanapp/keyman/pull/9384/files#r1627826807)
- [remove lpKeyStateNul](https://github.com/keymanapp/keyman/pull/9384/files#r1627828655)
- [move definition](https://github.com/keymanapp/keyman/pull/9384/files#r1629152737)
- [if before for-loop when gp2 does not chenge](https://github.com/keymanapp/keyman/pull/9384/files#r1629162646)
- [pass vector as reference](https://github.com/keymanapp/keyman/pull/11816#discussion_r1648674150)

**mcompile.cpp**
- [move forward declaration](https://github.com/keymanapp/keyman/pull/9384#discussion_r1627854203)

**mc-kmxfile.cpp**

- [compare dwFileVersion with VERSION_MIN /VERSION_MAX always returns FALSE](https://github.com/keymanapp/keyman/pull/9384#discussion_r1631040600)

**deadkey.cpp**

- [use a struct instead of a vector](https://github.com/keymanapp/keyman/pull/9384#discussion_r1613247549)

### Describe alternatives you've considered

_No response_

### Related issues

_No response_

### Keyman apps

- [ ] Keyman for Android
- [ ] Keyman for iPhone and iPad
- [X] Keyman for Linux
- [X] Keyman for macOS
- [X] Keyman for Windows
- [ ] Keyman Developer
- [ ] KeymanWeb
- [ ] Other - give details at bottom of form

### Keyman version

_No response_

### Operating system

_No response_

### Device

_No response_

### Target application

_No response_

### Browser

_No response_

### Keyboard name

_No response_

### Keyboard version

_No response_

### Language name

_No response_

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.