richardphibel / rpms / libdnf

Forked from rpms/libdnf 2 years ago
Clone

Blame SOURCES/0001-queue_init_clone-const_cast.patch

18f9c1
diff -Naur a/libdnf/goal/IdQueue.hpp b/libdnf/goal/IdQueue.hpp
18f9c1
--- a/libdnf/goal/IdQueue.hpp	2019-01-04 14:12:04.000000000 +0100
18f9c1
+++ b/libdnf/goal/IdQueue.hpp	2019-01-08 09:54:45.858216988 +0100
18f9c1
@@ -51,13 +51,13 @@
18f9c1
 };
18f9c1
 
18f9c1
 inline IdQueue::IdQueue() { queue_init(&queue); }
18f9c1
-inline IdQueue::IdQueue(const IdQueue & src) { queue_init_clone(&queue, &src.queue); }
18f9c1
+inline IdQueue::IdQueue(const IdQueue & src) { queue_init_clone(&queue, const_cast<Queue *>(&src.queue)); }
18f9c1
 inline IdQueue::IdQueue(IdQueue && src)
18f9c1
 {
18f9c1
     queue_init(&queue);
18f9c1
     std::swap(queue, src.queue);
18f9c1
 }
18f9c1
-inline IdQueue::IdQueue(const Queue & src) { queue_init_clone(&queue, &src;; }
18f9c1
+inline IdQueue::IdQueue(const Queue & src) { queue_init_clone(&queue, const_cast<Queue *>(&src)); }
18f9c1
 
18f9c1
 inline IdQueue::~IdQueue() { queue_free(&queue); }
18f9c1
 
18f9c1
diff -Naur a/libdnf/repo/solvable/DependencyContainer.cpp b/libdnf/repo/solvable/DependencyContainer.cpp
18f9c1
--- a/libdnf/repo/solvable/DependencyContainer.cpp	2019-01-04 14:12:04.000000000 +0100
18f9c1
+++ b/libdnf/repo/solvable/DependencyContainer.cpp	2019-01-08 09:54:19.623031878 +0100
18f9c1
@@ -32,7 +32,7 @@
18f9c1
 DependencyContainer::DependencyContainer(const DependencyContainer &src)
18f9c1
         : sack(src.sack)
18f9c1
 {
18f9c1
-    queue_init_clone(&this->queue, &queue);
18f9c1
+    queue_init_clone(&this->queue, const_cast<Queue *>(&queue));
18f9c1
 }
18f9c1
 
18f9c1
 
18f9c1
@@ -45,7 +45,7 @@
18f9c1
 DependencyContainer::DependencyContainer(DnfSack *sack, Queue queue)
18f9c1
         : sack(sack)
18f9c1
 {
18f9c1
-    queue_init_clone(&this->queue, &queue);
18f9c1
+    queue_init_clone(&this->queue, const_cast<Queue *>(&queue));
18f9c1
 }
18f9c1
 
18f9c1
 DependencyContainer::~DependencyContainer()
18f9c1
@@ -56,7 +56,7 @@
18f9c1
 DependencyContainer &DependencyContainer::operator=(DependencyContainer &&src) noexcept
18f9c1
 {
18f9c1
     sack = src.sack;
18f9c1
-    queue_init_clone(&queue, &src.queue);
18f9c1
+    queue_init_clone(&queue, const_cast<Queue *>(&src.queue));
18f9c1
     return *this;
18f9c1
 }
18f9c1