From: Joel Rosdahl Date: Sun, 19 Apr 2020 20:21:50 +0000 (+0200) Subject: Make Context a class instead of a struct X-Git-Tag: v4.0~537 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=61bd2ef27e33918f8ca876ba952f0a93aabaf7e4;p=thirdparty%2Fccache.git Make Context a class instead of a struct I like it better that way. --- diff --git a/src/Context.hpp b/src/Context.hpp index 7845f1a21..f406dac94 100644 --- a/src/Context.hpp +++ b/src/Context.hpp @@ -33,8 +33,9 @@ #include #include -struct Context : NonCopyable +class Context : NonCopyable { +public: Context(); ArgsInfo args_info; diff --git a/src/ccache.hpp b/src/ccache.hpp index 572961b1e..b52f45354 100644 --- a/src/ccache.hpp +++ b/src/ccache.hpp @@ -28,7 +28,7 @@ #include "third_party/nonstd/optional.hpp" struct ArgsInfo; -struct Context; +class Context; class Config; #ifndef MYNAME diff --git a/src/compress.hpp b/src/compress.hpp index 118bab517..645f62943 100644 --- a/src/compress.hpp +++ b/src/compress.hpp @@ -23,7 +23,7 @@ #include "Util.hpp" struct Confix; -struct Context; +class Context; void compress_stats(const Config& config, const Util::ProgressReceiver& progress_receiver); diff --git a/src/execute.hpp b/src/execute.hpp index f1fb7a48b..00e0a02f1 100644 --- a/src/execute.hpp +++ b/src/execute.hpp @@ -22,7 +22,7 @@ #include -struct Context; +class Context; int execute(const char* const* argv, int fd_out, int fd_err, pid_t* pid); std::string diff --git a/src/exitfn.cpp b/src/exitfn.cpp index 5b1b153c6..d02376d62 100644 --- a/src/exitfn.cpp +++ b/src/exitfn.cpp @@ -35,7 +35,7 @@ struct nullary_exit_function }; static struct exit_function* exit_functions; -static struct Context* context_to_clean_up; +static class Context* context_to_clean_up; static void call_nullary_exit_function(void* context) diff --git a/src/exitfn.hpp b/src/exitfn.hpp index 15c136f5b..b806de49b 100644 --- a/src/exitfn.hpp +++ b/src/exitfn.hpp @@ -18,7 +18,7 @@ #pragma once -struct Context; +class Context; void exitfn_init(); void exitfn_add_nullary(void (*function)()); diff --git a/src/hashutil.hpp b/src/hashutil.hpp index 0f3cfc747..d691538ca 100644 --- a/src/hashutil.hpp +++ b/src/hashutil.hpp @@ -25,7 +25,7 @@ #include class Config; -struct Context; +class Context; unsigned hash_from_int(int i); diff --git a/src/manifest.hpp b/src/manifest.hpp index 85d88dad2..6dff9140e 100644 --- a/src/manifest.hpp +++ b/src/manifest.hpp @@ -24,7 +24,7 @@ #include class Config; -struct Context; +class Context; struct digest; extern const uint8_t k_manifest_magic[4]; diff --git a/src/result.hpp b/src/result.hpp index 606e41452..02351c66e 100644 --- a/src/result.hpp +++ b/src/result.hpp @@ -25,7 +25,7 @@ #include #include -struct Context; +class Context; extern const uint8_t k_result_magic[4]; extern const uint8_t k_result_version; diff --git a/src/stats.hpp b/src/stats.hpp index dab1da32b..4b3f7e30b 100644 --- a/src/stats.hpp +++ b/src/stats.hpp @@ -25,7 +25,7 @@ #include class Config; -struct Context; +class Context; // Statistics fields in storage order. enum stats {