From eeab7107c0ca56201a001e0e74d9c507811b0513 Mon Sep 17 00:00:00 2001 From: Davin McCall Date: Thu, 13 Sep 2018 15:38:38 +0100 Subject: [PATCH] Minor header/signature adjustments. Add const to some method arguments. --- src/baseproc-service.cc | 2 +- src/includes/cpbuffer.h | 1 + src/includes/dinit-client.h | 2 ++ src/includes/proc-service.h | 5 +++-- src/proc-service.cc | 3 ++- 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/baseproc-service.cc b/src/baseproc-service.cc index 42f603d..9e9d5c1 100644 --- a/src/baseproc-service.cc +++ b/src/baseproc-service.cc @@ -164,7 +164,7 @@ bool base_process_service::start_ps_process(const std::vector &cmd base_process_service::base_process_service(service_set *sset, string name, service_type_t service_type_p, string &&command, - std::list> &command_offsets, + const std::list> &command_offsets, const std::list &deplist_p) : service_record(sset, name, service_type_p, deplist_p), child_listener(this), child_status_listener(this), restart_timer(this) diff --git a/src/includes/cpbuffer.h b/src/includes/cpbuffer.h index ac9a22c..9471ad8 100644 --- a/src/includes/cpbuffer.h +++ b/src/includes/cpbuffer.h @@ -1,6 +1,7 @@ #ifndef CPBUFFER_H #define CPBUFFER_H +#include #include #include diff --git a/src/includes/dinit-client.h b/src/includes/dinit-client.h index 0492408..6fdf9b9 100644 --- a/src/includes/dinit-client.h +++ b/src/includes/dinit-client.h @@ -1,6 +1,8 @@ #include #include +#include "cpbuffer.h" + // Client library for Dinit clients diff --git a/src/includes/proc-service.h b/src/includes/proc-service.h index 398eb2a..a0b2f5c 100644 --- a/src/includes/proc-service.h +++ b/src/includes/proc-service.h @@ -9,7 +9,8 @@ // Given a string and a list of pairs of (start,end) indices for each argument in that string, // store a null terminator for the argument. Return a `char *` vector containing the beginning // of each argument and a trailing nullptr. (The returned array is invalidated if the string is later modified). -std::vector separate_args(std::string &s, std::list> &arg_indices); +std::vector separate_args(std::string &s, + const std::list> &arg_indices); class base_process_service; @@ -138,7 +139,7 @@ class base_process_service : public service_record // Constructor for a base_process_service. Note that the various parameters not specified here must in // general be set separately (using the appropriate set_xxx function for each). base_process_service(service_set *sset, string name, service_type_t record_type_p, string &&command, - std::list> &command_offsets, + const std::list> &command_offsets, const std::list &deplist_p); ~base_process_service() noexcept diff --git a/src/proc-service.cc b/src/proc-service.cc index 40d0585..d664142 100644 --- a/src/proc-service.cc +++ b/src/proc-service.cc @@ -16,7 +16,8 @@ // Given a string and a list of pairs of (start,end) indices for each argument in that string, // store a null terminator for the argument. Return a `char *` vector containing the beginning // of each argument and a trailing nullptr. (The returned array is invalidated if the string is later modified). -std::vector separate_args(std::string &s, std::list> &arg_indices) +std::vector separate_args(std::string &s, + const std::list> &arg_indices) { std::vector r; r.reserve(arg_indices.size() + 1); -- 2.25.1