]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Use using instead of typedef
authorJoel Rosdahl <joel@rosdahl.net>
Sat, 9 May 2020 11:17:35 +0000 (13:17 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Tue, 12 May 2020 19:11:45 +0000 (21:11 +0200)
src/Config.cpp
src/Config.hpp
src/Util.hpp
src/stats.cpp

index 30a5f11df2cb22a70874f33c6400de40ef8f2e56..d7ce118a1631340f1da0e85e4ad91ed546c42da8 100644 (file)
@@ -148,9 +148,8 @@ const std::unordered_map<std::string, std::string> k_env_variable_table = {
   {"UMASK", "umask"},
 };
 
-typedef std::function<void(
-  const std::string& line, const std::string& key, const std::string& value)>
-  ConfigLineHandler;
+using ConfigLineHandler = std::function<void(
+  const std::string& line, const std::string& key, const std::string& value)>;
 
 bool
 parse_bool(const std::string& value,
index aea66db17b27fa7b9cf698b955d47c5a66fbf8b7..ae1abd8cb8efd6b2dc684508cde831a7d6b404e1 100644 (file)
@@ -91,10 +91,9 @@ public:
   void set_primary_config_path(std::string path);
   void set_secondary_config_path(std::string path);
 
-  typedef std::function<void(const std::string& key,
-                             const std::string& value,
-                             const std::string& origin)>
-    ItemVisitor;
+  using ItemVisitor = std::function<void(const std::string& key,
+                                         const std::string& value,
+                                         const std::string& origin)>;
 
   // Set config values from a configuration file.
   //
index c8a507fb35366e237ab35b960fb5e25eaddfa1a6..17220b80298fdf019db2985909f92b2cf12dd37e 100644 (file)
 
 namespace Util {
 
-typedef std::function<void(double)> ProgressReceiver;
-typedef std::function<void(std::shared_ptr<CacheFile>)> CacheFileVisitor;
-typedef std::function<void(const std::string& /*dir_path*/,
-                           const ProgressReceiver& /*progress_receiver*/)>
-  SubdirVisitor;
+using ProgressReceiver = std::function<void(double)>;
+using CacheFileVisitor = std::function<void(std::shared_ptr<CacheFile>)>;
+using SubdirVisitor =
+  std::function<void(const std::string& /*dir_path*/,
+                     const ProgressReceiver& /*progress_receiver*/)>;
 
 // Get base name of path.
 nonstd::string_view base_name(nonstd::string_view path);
index 701ea0e144555541afdc09cc45621aceb4dcead3..bd4972facd9dde9a45f4033f20b2f8bd47e1e7c4 100644 (file)
@@ -47,7 +47,7 @@
 
 // Returns a formatted version of a statistics value, or NULL if the statistics
 // line shouldn't be printed. Caller frees.
-typedef char* (*format_fn)(uint64_t value);
+using format_fn = char* (*)(uint64_t value);
 
 static char* format_size_times_1024(uint64_t size);
 static char* format_timestamp(uint64_t timestamp);