microsoft / microsoft/terminal
Code Cleanup - Member variables not initialized in GdiEngine's constructor
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 105k
- Forks
- 9.6k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 29
Description
Minor Code cleanup
In src/renderer/gdi/state.cpp
GdiEngine's constructor is not initializing all of it's member variables.
_isTrueTypeFont
_fontCodepage
_tmFontMetrics
_coordFontLast
_psInvalidData
In Debug only
_debugWindow
_debugContext
As far as I can tell, none of the above variables are used before being initialized (in the normal code path). Most of these get set in UpdateFont and _CreateDebugWindow. It might make sense to make a pass and initialize these in the header with default values. Some members are correctly being set to a default value in the constructor, but it might be better for maintainability to remove those and initialize them in the header also.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/renderer/gdi/state.cpp and inspect GdiEngine's constructor alongside its class header. Check the listed normal and debug-only members, compare them with members already given defaults, and confirm that all intended members are initialized consistently without changing their later use in UpdateFont or _CreateDebugWindow.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100