From: David Bremner Date: Mon, 4 Jul 2016 21:31:26 +0000 (-0700) Subject: remove dead breaks and returns X-Git-Url: http://git.iain.cx/?a=commitdiff_plain;h=651295f206ecac10db9a24200e67762d24166db5;p=nssm.git remove dead breaks and returns --- diff --git a/io.cpp b/io.cpp index 508d7db..45d1e76 100644 --- a/io.cpp +++ b/io.cpp @@ -86,7 +86,7 @@ int get_createfile_parameters(HKEY key, TCHAR *prefix, TCHAR *path, unsigned lon switch (get_number(key, value, sharing, false)) { case 0: *sharing = default_sharing; break; /* Missing. */ case 1: break; /* Found. */ - case -2: return 4; break; /* Error. */ + case -2: return 4; /* Error. */ } /* CreationDisposition. */ @@ -97,7 +97,7 @@ int get_createfile_parameters(HKEY key, TCHAR *prefix, TCHAR *path, unsigned lon switch (get_number(key, value, disposition, false)) { case 0: *disposition = default_disposition; break; /* Missing. */ case 1: break; /* Found. */ - case -2: return 6; break; /* Error. */ + case -2: return 6; /* Error. */ } /* Flags. */ @@ -108,7 +108,7 @@ int get_createfile_parameters(HKEY key, TCHAR *prefix, TCHAR *path, unsigned lon switch (get_number(key, value, flags, false)) { case 0: *flags = default_flags; break; /* Missing. */ case 1: break; /* Found. */ - case -2: return 8; break; /* Error. */ + case -2: return 8; /* Error. */ } /* Rotate with CopyFile() and SetEndOfFile(). */ @@ -124,7 +124,7 @@ int get_createfile_parameters(HKEY key, TCHAR *prefix, TCHAR *path, unsigned lon if (data) *copy_and_truncate = true; else *copy_and_truncate = false; break; - case -2: return 9; break; /* Error. */ + case -2: return 9; /* Error. */ } } diff --git a/registry.cpp b/registry.cpp index b8aab78..258b96a 100644 --- a/registry.cpp +++ b/registry.cpp @@ -353,12 +353,10 @@ int set_string(HKEY key, TCHAR *value, TCHAR *string, bool expand) { int set_string(HKEY key, TCHAR *value, TCHAR *string) { return set_string(key, value, string, false); - return 1; } int set_expand_string(HKEY key, TCHAR *value, TCHAR *string) { return set_string(key, value, string, true); - return 1; } /* diff --git a/service.cpp b/service.cpp index b3b0c62..ce3fb92 100644 --- a/service.cpp +++ b/service.cpp @@ -653,8 +653,6 @@ int get_service_description(const TCHAR *service_name, SC_HANDLE service_handle, print_message(stderr, NSSM_MESSAGE_QUERYSERVICECONFIG2_FAILED, service_name, _T("SERVICE_CONFIG_DESCRIPTION"), error_string(error)); return 4; } - - return 0; } int get_service_startup(const TCHAR *service_name, SC_HANDLE service_handle, const QUERY_SERVICE_CONFIG *qsc, unsigned long *startup) { @@ -1982,7 +1980,6 @@ void CALLBACK end_service(void *arg, unsigned char why) { wait_for_hooks(service, false); free_imports(); exit(exitcode); - break; } }