Browse Source

More tidy-ups

Davin McCall 1 year ago
parent
commit
8cbe235440
2 changed files with 2 additions and 2 deletions
  1. 1 1
      src/dinitctl.cc
  2. 1 1
      src/includes/cpbuffer.h

+ 1 - 1
src/dinitctl.cc

@@ -98,7 +98,7 @@ int dinitctl_main(int argc, char **argv)
     bool show_help = argc < 2;
     const char *service_name = nullptr;
     const char *to_service_name = nullptr;
-    dependency_type dep_type;
+    dependency_type dep_type = dependency_type::AFTER; // avoid maybe-uninitialised warning
     bool dep_type_set = false;
     
     std::string control_socket_str;

+ 1 - 1
src/includes/cpbuffer.h

@@ -123,7 +123,7 @@ template <unsigned SIZE> class cpbuffer
         if (index >= SIZE) index -= SIZE;
         if (index + length > SIZE) {
             // wrap-around copy
-            int half = SIZE - index;
+            unsigned half = SIZE - index;
             std::memcpy(dest, buf + index, half);
             std::memcpy(reinterpret_cast<void *>(reinterpret_cast<uintptr_t>(dest) + half),
                     buf, length - half);