From: Davin McCall Date: Sun, 8 Dec 2019 07:29:36 +0000 (+1000) Subject: Clean up clang warnings X-Git-Tag: v0.8.0~5 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=627e9f660ce1e1a944b1a206f8c6ebb9f7efeaa0;p=oweals%2Fdinit.git Clean up clang warnings --- diff --git a/src/includes/dinit-client.h b/src/includes/dinit-client.h index a6afe2a..09746c9 100644 --- a/src/includes/dinit-client.h +++ b/src/includes/dinit-client.h @@ -49,14 +49,14 @@ template class static_membuf template static_membuf(const T &val) { - static_assert(sizeof(T) == N); + static_assert(sizeof(T) == N, "must initialise with object of correct size"); memcpy(buf, &val, N); } template static_membuf(char (&prevbuf)[M], const T &val) { - static_assert(M + sizeof(T) == N); + static_assert(M + sizeof(T) == N, "size is not correct"); memcpy(buf, prevbuf, M); memcpy(buf + M, &val, sizeof(val)); } diff --git a/src/includes/proc-service.h b/src/includes/proc-service.h index 7056a6d..a3ff05a 100644 --- a/src/includes/proc-service.h +++ b/src/includes/proc-service.h @@ -446,8 +446,8 @@ class process_service : public base_process_service return inittab_line; } - constexpr size_t get_utmp_id_size() { return sizeof(inittab_id); } - constexpr size_t get_utmp_line_size() { return sizeof(inittab_line); } + constexpr size_t get_utmp_id_size() const { return sizeof(inittab_id); } + constexpr size_t get_utmp_line_size() const { return sizeof(inittab_line); } #endif