]> git.tdb.fi Git - libs/net.git/blobdiff - source/net/resolve.h
Use nullptr instead of 0 for pointers
[libs/net.git] / source / net / resolve.h
index 5e7781dfc64a3e66bf16d1b02c8beed05aaefc83..65d1db89977425ff6fc7079b83aef60ba74d680b 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 = nullptr;
+               std::runtime_error *error = nullptr;
 
                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();
@@ -68,7 +66,7 @@ private:
                IO::Pipe &get_notify_pipe() { return notify_pipe; }
 
        private:
-               virtual void main();
+               void main() override;
        };
 
 public:
@@ -76,9 +74,9 @@ public:
        sigc::signal<void, unsigned, const std::exception &> signal_resolve_failed;
 
 private:
-       IO::EventDispatcher *event_disp;
+       IO::EventDispatcher *event_disp = nullptr;
        WorkerThread thread;
-       unsigned next_tag;
+       unsigned next_tag = 1;
 
 public:
        Resolver();