Browse Source

remove dead breaks and returns

David Bremner 5 years ago
parent
commit
651295f206
3 changed files with 4 additions and 9 deletions
  1. 4 4
      io.cpp
  2. 0 2
      registry.cpp
  3. 0 3
      service.cpp

+ 4 - 4
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. */
     }
   }
 

+ 0 - 2
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;
 }
 
 /*

+ 0 - 3
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;
   }
 }