refactor(windows,linux,mac): request for code changes in several files used throughout mcompile for Windows, Linux and mac 🐘
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 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 and mcompile-Mac PR #11334
Changes should be made in:
util_filesystem.cpp
- use FUNCTION macro instead of hard coding the method name
- unneccessary code
- mount in the else branch
- unreachable code
mc_import_rules.cpp
- rename SGCAPS
- possibility of buffer overflow
- initialize *key->dpContext with NULL
- another initialize *key->dpContext with NULL
- use copy()-method
- use std::u16string instead of PKMX_WCHAR
- ignore the last element in the array
- move declaration of class deadkey
- use unordered map instead of arrays
- replace calls to KMX_MaxShiftState()
- remove lpKeyStateNul
- move definition
- if before for-loop when gp2 does not chenge
- pass vector as reference
mcompile.cpp
mc-kmxfile.cpp
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