Skip to content

Commit 2fdcfbc

Browse files
author
Philip Botha
committed
Fixed compiler errors from LTO.
1 parent 5319e70 commit 2fdcfbc

File tree

5 files changed

+16
-9
lines changed

5 files changed

+16
-9
lines changed

gui.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ static inline void set_hook_tab(int event_index, int action_index, bool changed)
302302
SendMessage(combo, CB_RESETCONTENT, 0, 0);
303303

304304
const TCHAR *hook_event = hook_event_strings[event_index];
305-
TCHAR *hook_action;
305+
TCHAR* hook_action{ nullptr };
306306
int i;
307307
switch (event_index + first_event) {
308308
case NSSM_GUI_HOOK_EVENT_ROTATE:

nssm.vcxproj

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,15 @@
2222
<VCProjectVersion>17.0</VCProjectVersion>
2323
<ProjectGuid>{32995E05-606F-4D83-A2E6-C2B361B34DF1}</ProjectGuid>
2424
<RootNamespace>nssm</RootNamespace>
25+
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
2526
</PropertyGroup>
2627
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
2728
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
2829
<ConfigurationType>Application</ConfigurationType>
2930
<PlatformToolset>v143</PlatformToolset>
3031
<UseOfMfc>false</UseOfMfc>
3132
<CharacterSet>Unicode</CharacterSet>
33+
<WholeProgramOptimization>true</WholeProgramOptimization>
3234
</PropertyGroup>
3335
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
3436
<ConfigurationType>Application</ConfigurationType>
@@ -129,6 +131,7 @@
129131
<WarningLevel>Level4</WarningLevel>
130132
<SuppressStartupBanner>true</SuppressStartupBanner>
131133
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
134+
<LanguageStandard_C>stdc17</LanguageStandard_C>
132135
</ClCompile>
133136
<ResourceCompile>
134137
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -222,7 +225,10 @@
222225
<ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>
223226
<WarningLevel>Level4</WarningLevel>
224227
<SuppressStartupBanner>true</SuppressStartupBanner>
225-
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
228+
<DebugInformationFormat>None</DebugInformationFormat>
229+
<LanguageStandard_C>stdc17</LanguageStandard_C>
230+
<SDLCheck>true</SDLCheck>
231+
<MultiProcessorCompilation>true</MultiProcessorCompilation>
226232
</ClCompile>
227233
<ResourceCompile>
228234
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -239,6 +245,7 @@
239245
<RandomizedBaseAddress>false</RandomizedBaseAddress>
240246
<DataExecutionPrevention />
241247
<TargetMachine>MachineX86</TargetMachine>
248+
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
242249
</Link>
243250
<Bscmake>
244251
<SuppressStartupBanner>true</SuppressStartupBanner>

registry.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1011,7 +1011,7 @@ int get_hook(const TCHAR *service_name, const TCHAR *hook_event, const TCHAR *ho
10111011
log_event(EVENTLOG_ERROR_TYPE, NSSM_EVENT_OUT_OF_MEMORY, _T("hook registry"), _T("get_hook()"), 0);
10121012
return 1;
10131013
}
1014-
HKEY key;
1014+
HKEY key{ nullptr };
10151015
long error = open_registry(service_name, registry, KEY_READ, &key, false);
10161016
if (! key) {
10171017
if (error == ERROR_FILE_NOT_FOUND) {

service.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ int affinity_string_to_mask(TCHAR *string, __int64 *mask) {
195195
list_t set[64];
196196

197197
TCHAR *s = string;
198-
TCHAR *end;
198+
TCHAR* end{ nullptr };
199199
int ret;
200200
int i;
201201
int n = 0;
@@ -925,7 +925,7 @@ int pre_edit_service(int argc, TCHAR **argv) {
925925

926926
const TCHAR *parameter = 0;
927927
settings_t *setting = 0;
928-
TCHAR *additional;
928+
TCHAR* additional{ nullptr };
929929

930930
/* Validate the parameter. */
931931
if (mandatory > 2) {
@@ -1065,7 +1065,7 @@ int pre_edit_service(int argc, TCHAR **argv) {
10651065
return 0;
10661066
}
10671067

1068-
HKEY key;
1068+
HKEY key{ nullptr };
10691069
value_t value;
10701070
int ret;
10711071

settings.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ static int setting_dump_string(const TCHAR *service_name, void *param, const TCH
156156

157157
static int setting_set_exit_action(const TCHAR *service_name, void *param, const TCHAR *name, void *default_value, value_t *value, const TCHAR *additional) {
158158
unsigned long exitcode;
159-
TCHAR *code;
159+
TCHAR* code{ nullptr };
160160
TCHAR action_string[ACTION_LEN];
161161

162162
if (additional) {
@@ -758,7 +758,7 @@ static int native_set_dependongroup(const TCHAR *service_name, void *param, cons
758758
}
759759

760760
/* Update the group list. */
761-
TCHAR *groups_buffer;
761+
TCHAR* groups_buffer{ nullptr };
762762
unsigned long groups_buflen;
763763
if (native_set_dependon(service_name, service_handle, &groups_buffer, &groups_buflen, value, DEPENDENCY_GROUPS)) return -1;
764764

@@ -873,7 +873,7 @@ static int native_set_dependonservice(const TCHAR *service_name, void *param, co
873873
}
874874

875875
/* Update the service list. */
876-
TCHAR *services_buffer;
876+
TCHAR* services_buffer{ nullptr };
877877
unsigned long services_buflen;
878878
if (native_set_dependon(service_name, service_handle, &services_buffer, &services_buflen, value, DEPENDENCY_SERVICES)) return -1;
879879

0 commit comments

Comments
 (0)