]> git.tdb.fi Git - libs/net.git/blobdiff - source/net/resolve.h
Use default member initializers where possible
[libs/net.git] / source / net / resolve.h
index b006aff9986b7c5cf51ea5638fdcca6b53693e27..6a0479e6aa363f2b22a49b5e1b999860a7666417 100644 (file)
@@ -36,14 +36,12 @@ class Resolver
 private:
        struct Task
        {
-               unsigned tag;
+               unsigned tag = 0;
                std::string host;
                std::string serv;
-               Family family;
-               SockAddr *addr;
-               std::runtime_error *error;
-
-               Task();
+               Family family = UNSPEC;
+               SockAddr *addr = 0;
+               std::runtime_error *error = 0;
 
                bool is_complete() const { return addr || error; }
        };
@@ -55,7 +53,7 @@ private:
                Mutex queue_mutex;
                Semaphore sem;
                IO::Pipe notify_pipe;
-               bool done;
+               bool done = false;
 
        public:
                WorkerThread();
@@ -76,9 +74,9 @@ public:
        sigc::signal<void, unsigned, const std::exception &> signal_resolve_failed;
 
 private:
-       IO::EventDispatcher *event_disp;
+       IO::EventDispatcher *event_disp = 0;
        WorkerThread thread;
-       unsigned next_tag;
+       unsigned next_tag = 1;
 
 public:
        Resolver();