Skip to content

Commit 52ab89a

Browse files
committed
Enable C++20 features
1 parent d2944af commit 52ab89a

File tree

5 files changed

+12
-6
lines changed

5 files changed

+12
-6
lines changed

NppJSONViewer/NPPJSONViewer.sln

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 16
4-
VisualStudioVersion = 16.0.31205.134
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.3.32804.467
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NPPJSONViewer", "NppJsonViewer\NPPJSONViewer.vcxproj", "{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}"
77
EndProject

NppJSONViewer/NppJsonViewer/JSONDialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ HTREEITEM JSONDialog::initTree(HWND hWndDlg)
4545
tvinsert.hInsertAfter=TVI_ROOT;
4646
tvinsert.item.mask=TVIF_TEXT;
4747

48-
tvinsert.item.pszText=L"JSON";
48+
tvinsert.item.pszText = const_cast<wchar_t*>(L"JSON");
4949
HTREEITEM item=(HTREEITEM)SendDlgItemMessage(hWndDlg,IDC_TREE,TVM_INSERTITEM,0,(LPARAM)&tvinsert);
5050

5151
return item;

NppJSONViewer/NppJsonViewer/NPPJSONViewer.vcxproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@
136136
<SDLCheck>true</SDLCheck>
137137
<MultiProcessorCompilation>true</MultiProcessorCompilation>
138138
<TreatWarningAsError>true</TreatWarningAsError>
139+
<LanguageStandard>stdcpp20</LanguageStandard>
139140
</ClCompile>
140141
<Link>
141142
<AdditionalDependencies>shlwapi.lib;comctl32.lib;Version.lib;%(AdditionalDependencies)</AdditionalDependencies>
@@ -156,6 +157,7 @@
156157
<SDLCheck>true</SDLCheck>
157158
<MultiProcessorCompilation>true</MultiProcessorCompilation>
158159
<TreatWarningAsError>true</TreatWarningAsError>
160+
<LanguageStandard>stdcpp20</LanguageStandard>
159161
</ClCompile>
160162
<Link>
161163
<AdditionalDependencies>shlwapi.lib;comctl32.lib;Version.lib;%(AdditionalDependencies)</AdditionalDependencies>
@@ -172,6 +174,7 @@
172174
<SDLCheck>true</SDLCheck>
173175
<MultiProcessorCompilation>true</MultiProcessorCompilation>
174176
<TreatWarningAsError>true</TreatWarningAsError>
177+
<LanguageStandard>stdcpp20</LanguageStandard>
175178
</ClCompile>
176179
<Link>
177180
<AdditionalDependencies>shlwapi.lib;comctl32.lib;Version.lib;%(AdditionalDependencies)</AdditionalDependencies>
@@ -191,6 +194,7 @@
191194
<SDLCheck>true</SDLCheck>
192195
<MultiProcessorCompilation>true</MultiProcessorCompilation>
193196
<TreatWarningAsError>true</TreatWarningAsError>
197+
<LanguageStandard>stdcpp20</LanguageStandard>
194198
</ClCompile>
195199
<Link>
196200
<AdditionalDependencies>shlwapi.lib;comctl32.lib;Version.lib;%(AdditionalDependencies)</AdditionalDependencies>
@@ -209,6 +213,7 @@
209213
<SDLCheck>true</SDLCheck>
210214
<MultiProcessorCompilation>true</MultiProcessorCompilation>
211215
<TreatWarningAsError>true</TreatWarningAsError>
216+
<LanguageStandard>stdcpp20</LanguageStandard>
212217
</ClCompile>
213218
<Link>
214219
<AdditionalDependencies>shlwapi.lib;comctl32.lib;Version.lib;%(AdditionalDependencies)</AdditionalDependencies>
@@ -231,6 +236,7 @@
231236
<SDLCheck>true</SDLCheck>
232237
<MultiProcessorCompilation>true</MultiProcessorCompilation>
233238
<TreatWarningAsError>true</TreatWarningAsError>
239+
<LanguageStandard>stdcpp20</LanguageStandard>
234240
</ClCompile>
235241
<Link>
236242
<AdditionalDependencies>shlwapi.lib;comctl32.lib;Version.lib;%(AdditionalDependencies)</AdditionalDependencies>

NppJSONViewer/NppJsonViewer/PluginDefinition.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ void commandMenuCleanUp()
145145
//
146146
// This function help you to initialize your plugin commands
147147
//
148-
bool setCommand(size_t index, TCHAR* cmdName, PFUNCPLUGINCMD pFunc, ShortcutKey* sk, bool check0nInit)
148+
bool setCommand(size_t index, const TCHAR* cmdName, PFUNCPLUGINCMD pFunc, ShortcutKey* sk, bool check0nInit)
149149
{
150150
if (index >= nbFunc)
151151
return false;
@@ -179,7 +179,7 @@ void showJSONDialog(char* json)
179179
data.uMask = DWS_DF_CONT_LEFT;
180180

181181
data.pszModuleName = jsonDialog.getPluginFileName();
182-
data.pszName = L"JSON Viewer";
182+
data.pszName = const_cast<wchar_t*>(L"JSON Viewer");
183183

184184
// the dlgDlg should be the index of funcItem where the current function pointer is
185185
data.dlgID = 0;

NppJSONViewer/NppJsonViewer/PluginDefinition.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ void commandMenuCleanUp();
6464
//
6565
// Function which sets your command
6666
//
67-
bool setCommand(size_t index, TCHAR *cmdName, PFUNCPLUGINCMD pFunc, ShortcutKey *sk = NULL, bool check0nInit = false);
67+
bool setCommand(size_t index, const TCHAR *cmdName, PFUNCPLUGINCMD pFunc, ShortcutKey *sk = NULL, bool check0nInit = false);
6868

6969

7070
//

0 commit comments

Comments
 (0)