Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
dinhngtu committed Aug 24, 2022
1 parent c27c41b commit 9b7988f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 20 deletions.
5 changes: 2 additions & 3 deletions Telex/TelexEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
namespace VietType {
namespace Telex {

enum ResposTransitions
{
enum ResposTransitions {
ResposExpunged = -1,
ResposTransitionC1 = -2,
ResposTransitionV = -3,
Expand Down Expand Up @@ -627,7 +626,7 @@ bool TelexEngine::FindTable(_Out_ map_iterator* it) const {
bool TelexEngine::GetTonePos(_In_ bool predict, _Out_ VInfo* vinfo) const {
map_iterator it;
auto found = FindTable(&it);
VInfo retinfo = {0};
VInfo retinfo = {0, C2Mode::Either};
if (found) {
retinfo = it->second;
} else if (predict) {
Expand Down
13 changes: 1 addition & 12 deletions Telex/TelexUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
namespace VietType {
namespace Telex {

enum class CharTypes : int
{
enum class CharTypes : int {
Uncategorized = 0,
Commit = 1 << 0,
ForceCommit = 1 << 1,
Expand All @@ -30,20 +29,10 @@ constexpr inline CharTypes operator|(CharTypes lhs, CharTypes rhs) {
return static_cast<CharTypes>(static_cast<chartypes_t>(lhs) | static_cast<chartypes_t>(rhs));
}

constexpr inline CharTypes& operator|=(CharTypes lhs, CharTypes rhs) {
lhs = static_cast<CharTypes>(static_cast<chartypes_t>(lhs) | static_cast<chartypes_t>(rhs));
return lhs;
}

constexpr inline CharTypes operator&(CharTypes lhs, CharTypes rhs) {
return static_cast<CharTypes>(static_cast<chartypes_t>(lhs) & static_cast<chartypes_t>(rhs));
}

constexpr inline CharTypes& operator&=(CharTypes lhs, CharTypes rhs) {
lhs = static_cast<CharTypes>(static_cast<chartypes_t>(lhs) & static_cast<chartypes_t>(rhs));
return lhs;
}

/// <summary>classifies lower characters only</summary>
CharTypes ClassifyCharacter(_In_ wchar_t c);
Tones GetTone(_In_ wchar_t c);
Expand Down
2 changes: 1 addition & 1 deletion VietTypeATL/EditSurroundingWord.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ static HRESULT DoEditSurroundingWord(
#pragma warning(pop)

auto displayText = controller->GetEngine().Peek();
compositionManager->SetCompositionText(ec, displayText.c_str(), displayText.length());
compositionManager->SetCompositionText(ec, displayText.c_str(), static_cast<LONG>(displayText.length()));

if (controller->GetEngine().GetState() == Telex::TelexStates::TxError) {
controller->GetEngine().Reset();
Expand Down
7 changes: 3 additions & 4 deletions VietTypeATL/EngineController.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ class EngineSettingsController;

class EngineController : public CComObjectRootEx<CComSingleThreadModel>, public ITfCompartmentEventSink {
public:
enum class BlockedKind
{
enum class BlockedKind {
// don't change enable setting
Free,
// don't change enable setting, but also completely block the engine
Expand Down Expand Up @@ -87,8 +86,8 @@ class EngineController : public CComObjectRootEx<CComSingleThreadModel>, public

CComPtr<EngineSettingsController> _settings;
// cached settings
DWORD _defaultEnabled;
DWORD _backconvertOnBackspace;
DWORD _defaultEnabled = 0;
DWORD _backconvertOnBackspace = 0;
CComPtr<CompartmentNotifier> _systemNotify;

BlockedKind _blocked = BlockedKind::Free;
Expand Down

0 comments on commit 9b7988f

Please sign in to comment.