Skip to content

Commit 014ad8f

Browse files
committed
fixed more resharper issues
1 parent ad9b529 commit 014ad8f

File tree

9 files changed

+24
-21
lines changed

9 files changed

+24
-21
lines changed

DebugView++/LogView.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ void CLogView::UpdateColumns()
278278

279279
ColumnInfo MakeColumn(Column::type column, const wchar_t* name, int format, int width)
280280
{
281-
ColumnInfo info = {0};
281+
auto info = ColumnInfo();
282282
info.enable = true;
283283
info.column.iSubItem = column;
284284
info.column.iOrder = column;
@@ -1801,6 +1801,7 @@ bool FilterSupportsColor(FilterType::type value)
18011801
case FilterType::Stop:
18021802
case FilterType::Once:
18031803
return true;
1804+
default: break;
18041805
}
18051806
return false;
18061807
}

DebugView++/PropertyColorItem.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class CPropertyColorItem : public CPropertyItem
106106
m_dlg.ShowAuto(show);
107107
}
108108

109-
virtual BOOL Activate(UINT action, LPARAM /*lParam*/) override
109+
virtual BOOL Activate(UINT action, LPARAM /*lParam*/) override
110110
{
111111
if (!IsEnabled())
112112
return FALSE;
@@ -119,15 +119,16 @@ class CPropertyColorItem : public CPropertyItem
119119
if (m_dlg.DoModal(m_hWndOwner) == IDOK)
120120
{
121121
// Let control owner know
122-
NMPROPERTYITEM nmh = { m_hWndOwner, ::GetDlgCtrlID(m_hWndOwner), PIN_ITEMCHANGED, this };
123-
::SendMessage(::GetParent(m_hWndOwner), WM_NOTIFY, nmh.hdr.idFrom, (LPARAM) &nmh);
122+
NMPROPERTYITEM nmh = {m_hWndOwner, ::GetDlgCtrlID(m_hWndOwner), PIN_ITEMCHANGED, this};
123+
::SendMessage(::GetParent(m_hWndOwner), WM_NOTIFY, nmh.hdr.idFrom, reinterpret_cast<LPARAM>(&nmh));
124124
}
125125
break;
126+
default: break;
126127
}
127128
return TRUE;
128129
}
129130

130-
virtual void DrawValue(PROPERTYDRAWINFO& di) override
131+
virtual void DrawValue(PROPERTYDRAWINFO& di) override
131132
{
132133
CDCHandle dc(di.hDC);
133134
RECT rect = di.rcItem;
@@ -152,13 +153,13 @@ class CPropertyColorItem : public CPropertyItem
152153
}
153154
}
154155

155-
virtual BOOL GetValue(VARIANT* pValue) const override
156+
virtual BOOL GetValue(VARIANT* pValue) const override
156157
{
157158
CComVariant var(GetColor());
158159
return SUCCEEDED(var.Detach(pValue));
159160
}
160161

161-
virtual BOOL SetValue(const VARIANT& value) override
162+
virtual BOOL SetValue(const VARIANT& value) override
162163
{
163164
CComVariant var;
164165
if (FAILED(VariantChangeType(&var, &value, 0, VT_COLOR)))

DebugView++/SourceDlg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ void CSourceDlg::OnException(const std::exception& ex)
6868
BOOL CSourceDlg::OnInitDialog(CWindow /*wndFocus*/, LPARAM /*lInitParam*/)
6969
{
7070
CenterWindow(GetParent());
71-
CComboBox combo = GetDlgItem(IDC_TYPE);
71+
CComboBox combo(GetDlgItem(IDC_TYPE));
7272
combo.AddString(WStr(SourceTypeToString(SourceType::Udp)));
7373
combo.AddString(WStr(SourceTypeToString(SourceType::Tcp)));
7474
combo.AddString(WStr(SourceTypeToString(SourceType::DebugViewAgent)));

DebugView++Lib/Colors.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ COLORREF HsvToRgb(double h, double s, double v)
4141
case 3: return RGB(pi, qi, vi);
4242
case 4: return RGB(ti, pi, vi);
4343
case 5: return RGB(vi, pi, qi);
44+
default: break;
4445
}
4546
return 0;
4647
}

DebugView++Lib/DbgviewReader.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ std::string ToHex(const T& s)
6464
result << "[" << s.size() << "] ";
6565

6666
for (size_t i = 0; i < s.size(); ++i)
67-
result << std::hex << std::setfill('0') << std::setw(2) << std::uppercase << ((int)s[i] & 0xff) << " ";
67+
result << std::hex << std::setfill('0') << std::setw(2) << std::uppercase << (static_cast<int>(s[i]) & 0xff) << " ";
6868
return result.str();
6969
}
7070

@@ -78,7 +78,7 @@ std::string ToChar(const T& s)
7878
{
7979
if (s[i] > 32)
8080
{
81-
result << std::setfill(' ') << std::setw(2) << (char)s[i] << " ";
81+
result << std::setfill(' ') << std::setw(2) << static_cast<char>(s[i]) << " ";
8282
}
8383
else
8484
{

DebugView++Lib/FileIO.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ FileType::type IdentifyFile(const std::wstring& filename)
119119
// Encoding detection is very complex, see #107
120120
std::ifstream fs(filename, std::ios::binary);
121121
std::vector<unsigned char> buffer(3);
122-
fs.read((char*)buffer.data(), buffer.size());
122+
fs.read(reinterpret_cast<char*>(buffer.data()), buffer.size());
123123
if (buffer[0] == 0xfe && buffer[1] == 0xff)
124124
{
125125
return FileType::UTF16BE;

DebugView++Lib/PolledLogSource.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ PolledLogSource::PolledLogSource(Timer& timer, SourceType::type sourceType, ILin
5757

5858
PolledLogSource::~PolledLogSource()
5959
{
60-
Abort();
60+
PolledLogSource::Abort();
6161
}
6262

6363
void PolledLogSource::StartThread()

DebugViewConsole/DebugViewConsole.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -291,11 +291,11 @@ fusion::debugviewpp::Settings CreateSettings(const std::map<std::string, docopt:
291291
settings.tabs = args.at("-q").asBool();
292292
settings.pid = args.at("-p").asBool();
293293
settings.processName = args.at("-n").asBool();
294-
settings.include = args.at("--include").asStringList();
295-
settings.exclude = args.at("--exclude").asStringList();
296-
settings.includeprocesses = args.at("--include-process").asStringList();
297-
settings.excludeprocesses = args.at("--exclude-process").asStringList();
298-
auto quitmessageEntry = args.at("--quit-message");
294+
settings.include = args.at("--include").asStringList();
295+
settings.exclude = args.at("--exclude").asStringList();
296+
settings.includeprocesses = args.at("--include-process").asStringList();
297+
settings.excludeprocesses = args.at("--exclude-process").asStringList();
298+
auto quitmessageEntry = args.at("--quit-message");
299299
settings.quitmessage = (quitmessageEntry) ? quitmessageEntry.asString() : "";
300300
return settings;
301301
}

plugins/cs/HttpMonitor/Program.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public List<string> Get()
126126

127127
static class Util
128128
{
129-
static public void DebugWrite(string msg)
129+
public static void DebugWrite(string msg)
130130
{
131131
Console.WriteLine(msg);
132132
Trace.WriteLine(msg);
@@ -135,9 +135,9 @@ static public void DebugWrite(string msg)
135135

136136
static class Settings
137137
{
138-
static public bool Verbose;
139-
static public int PollInterval = 5000;
140-
static public int HttpTimeout = 5000;
138+
public static bool Verbose;
139+
public static int PollInterval = 5000;
140+
public static int HttpTimeout = 5000;
141141
}
142142

143143
class DebugViewPlugin

0 commit comments

Comments
 (0)