pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

coin-or-lemon: patches borrowed from nix based distros on Linux



Module Name:	pkgsrc-wip
Committed By:	mayuresh <mayuresh%acm.org@localhost>
Pushed By:	mayuresh
Date:		Fri Sep 13 09:09:37 2024 +0530
Changeset:	91c2449d2574b693ecad178bcdff47cf10e3699b

Modified Files:
	coin-or-lemon/distinfo
Added Files:
	coin-or-lemon/patches/patch-lemon_bits_array__map.h
	coin-or-lemon/patches/patch-lemon_path.h

Log Message:
coin-or-lemon: patches borrowed from nix based distros on Linux

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=91c2449d2574b693ecad178bcdff47cf10e3699b

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 coin-or-lemon/distinfo                             |   2 +
 .../patches/patch-lemon_bits_array__map.h          | 127 +++++++++++++++++++++
 coin-or-lemon/patches/patch-lemon_path.h           | 100 ++++++++++++++++
 3 files changed, 229 insertions(+)

diffs:
diff --git a/coin-or-lemon/distinfo b/coin-or-lemon/distinfo
index adcee2aa40..3d3e122c8d 100644
--- a/coin-or-lemon/distinfo
+++ b/coin-or-lemon/distinfo
@@ -3,3 +3,5 @@ $NetBSD$
 BLAKE2s (lemon-1.3.1.tar.gz) = 2c5b9c34230358c845acb38089a1afd5433ae0d78eaa14e1193f8df529f28bcf
 SHA512 (lemon-1.3.1.tar.gz) = 715eb45e790c908e41de4c13e68b7880e1d86c54eca53f896c95b6bc411ded504f3f768bed9d63562ed4adad53167fb3a7828c67456fdea645a5d0a94ae2e038
 Size (lemon-1.3.1.tar.gz) = 5142826 bytes
+SHA1 (patch-lemon_bits_array__map.h) = c4fbd0aab2833faf8d62cbbf45f67058e57a3252
+SHA1 (patch-lemon_path.h) = 8224152318f1516d4e696d9abc9dd3a2bb63d3f5
diff --git a/coin-or-lemon/patches/patch-lemon_bits_array__map.h b/coin-or-lemon/patches/patch-lemon_bits_array__map.h
new file mode 100644
index 0000000000..32da5973de
--- /dev/null
+++ b/coin-or-lemon/patches/patch-lemon_bits_array__map.h
@@ -0,0 +1,127 @@
+$NetBSD$
+
+Patch by David Torres Sanchez borrowed from nix based distro on Linux
+
+--- lemon/bits/array_map.h.orig	2014-07-07 14:40:24.917315535 +0000
++++ lemon/bits/array_map.h
+@@ -75,6 +75,7 @@ namespace lemon {
+     typedef typename Notifier::ObserverBase Parent;
+ 
+     typedef std::allocator<Value> Allocator;
++    typedef std::allocator_traits<std::allocator<Value>> AllocatorTraits;
+ 
+   public:
+ 
+@@ -87,8 +88,8 @@ namespace lemon {
+       Notifier* nf = Parent::notifier();
+       Item it;
+       for (nf->first(it); it != INVALID; nf->next(it)) {
+-        int id = nf->id(it);;
+-        allocator.construct(&(values[id]), Value());
++        int id = nf->id(it);
++        AllocatorTraits::construct(allocator, &(values[id]), Value());
+       }
+     }
+ 
+@@ -101,8 +102,8 @@ namespace lemon {
+       Notifier* nf = Parent::notifier();
+       Item it;
+       for (nf->first(it); it != INVALID; nf->next(it)) {
+-        int id = nf->id(it);;
+-        allocator.construct(&(values[id]), value);
++        int id = nf->id(it);
++        AllocatorTraits::construct(allocator, &(values[id]), value);
+       }
+     }
+ 
+@@ -120,8 +121,8 @@ namespace lemon {
+       Notifier* nf = Parent::notifier();
+       Item it;
+       for (nf->first(it); it != INVALID; nf->next(it)) {
+-        int id = nf->id(it);;
+-        allocator.construct(&(values[id]), copy.values[id]);
++        int id = nf->id(it);
++        AllocatorTraits::construct(allocator, &(values[id]), copy.values[id]);
+       }
+     }
+ 
+@@ -216,17 +217,17 @@ namespace lemon {
+         Value* new_values = allocator.allocate(new_capacity);
+         Item it;
+         for (nf->first(it); it != INVALID; nf->next(it)) {
+-          int jd = nf->id(it);;
++          int jd = nf->id(it);
+           if (id != jd) {
+-            allocator.construct(&(new_values[jd]), values[jd]);
+-            allocator.destroy(&(values[jd]));
++            AllocatorTraits::construct(allocator, &(new_values[jd]), values[jd]);
++            AllocatorTraits::destroy(allocator, &(values[jd]));
+           }
+         }
+         if (capacity != 0) allocator.deallocate(values, capacity);
+         values = new_values;
+         capacity = new_capacity;
+       }
+-      allocator.construct(&(values[id]), Value());
++      AllocatorTraits::construct(allocator, &(values[id]), Value());
+     }
+ 
+     // \brief Adds more new keys to the map.
+@@ -260,8 +261,8 @@ namespace lemon {
+             }
+           }
+           if (found) continue;
+-          allocator.construct(&(new_values[id]), values[id]);
+-          allocator.destroy(&(values[id]));
++          AllocatorTraits::construct(allocator, &(new_values[id]), values[id]);
++          AllocatorTraits::destroy(allocator, &(values[id]));
+         }
+         if (capacity != 0) allocator.deallocate(values, capacity);
+         values = new_values;
+@@ -269,7 +270,7 @@ namespace lemon {
+       }
+       for (int i = 0; i < int(keys.size()); ++i) {
+         int id = nf->id(keys[i]);
+-        allocator.construct(&(values[id]), Value());
++        AllocatorTraits::construct(allocator, &(values[id]), Value());
+       }
+     }
+ 
+@@ -279,7 +280,7 @@ namespace lemon {
+     // and it overrides the erase() member function of the observer base.
+     virtual void erase(const Key& key) {
+       int id = Parent::notifier()->id(key);
+-      allocator.destroy(&(values[id]));
++      AllocatorTraits::destroy(allocator, &(values[id]));
+     }
+ 
+     // \brief Erase more keys from the map.
+@@ -289,7 +290,7 @@ namespace lemon {
+     virtual void erase(const std::vector<Key>& keys) {
+       for (int i = 0; i < int(keys.size()); ++i) {
+         int id = Parent::notifier()->id(keys[i]);
+-        allocator.destroy(&(values[id]));
++        AllocatorTraits::destroy(allocator, &(values[id]));
+       }
+     }
+ 
+@@ -302,8 +303,8 @@ namespace lemon {
+       allocate_memory();
+       Item it;
+       for (nf->first(it); it != INVALID; nf->next(it)) {
+-        int id = nf->id(it);;
+-        allocator.construct(&(values[id]), Value());
++        int id = nf->id(it);
++        AllocatorTraits::construct(allocator, &(values[id]), Value());
+       }
+     }
+ 
+@@ -317,7 +318,7 @@ namespace lemon {
+         Item it;
+         for (nf->first(it); it != INVALID; nf->next(it)) {
+           int id = nf->id(it);
+-          allocator.destroy(&(values[id]));
++          AllocatorTraits::destroy(allocator, &(values[id]));
+         }
+         allocator.deallocate(values, capacity);
+         capacity = 0;
diff --git a/coin-or-lemon/patches/patch-lemon_path.h b/coin-or-lemon/patches/patch-lemon_path.h
new file mode 100644
index 0000000000..6b52d6da0f
--- /dev/null
+++ b/coin-or-lemon/patches/patch-lemon_path.h
@@ -0,0 +1,100 @@
+$NetBSD$
+
+Patch by David Torres Sanchez borrowed from nix based distro on Linux
+
+--- lemon/path.h.orig	2014-07-07 14:40:24.963315795 +0000
++++ lemon/path.h
+@@ -393,7 +393,7 @@ namespace lemon {
+       data.resize(len);
+       int index = 0;
+       for (typename CPath::ArcIt it(path); it != INVALID; ++it) {
+-        data[index] = it;;
++        data[index] = it;
+         ++index;
+       }
+     }
+@@ -405,7 +405,7 @@ namespace lemon {
+       int index = len;
+       for (typename CPath::RevArcIt it(path); it != INVALID; ++it) {
+         --index;
+-        data[index] = it;;
++        data[index] = it;
+       }
+     }
+ 
+@@ -448,7 +448,9 @@ namespace lemon {
+ 
+     Node *first, *last;
+ 
+-    std::allocator<Node> alloc;
++  private:
++    typedef std::allocator<Node> Allocator;
++    typedef std::allocator_traits<std::allocator<Node>> AllocatorTraits;
+ 
+   public:
+ 
+@@ -582,8 +584,8 @@ namespace lemon {
+     void clear() {
+       while (first != 0) {
+         last = first->next;
+-        alloc.destroy(first);
+-        alloc.deallocate(first, 1);
++        AllocatorTraits::destroy(_allocator, first);
++        _allocator.deallocate(first, 1);
+         first = last;
+       }
+     }
+@@ -595,8 +597,8 @@ namespace lemon {
+ 
+     /// \brief Add a new arc before the current path
+     void addFront(const Arc& arc) {
+-      Node *node = alloc.allocate(1);
+-      alloc.construct(node, Node());
++      Node *node = _allocator.allocate(1);
++      AllocatorTraits::construct(_allocator, node, Node());
+       node->prev = 0;
+       node->next = first;
+       node->arc = arc;
+@@ -617,8 +619,8 @@ namespace lemon {
+       } else {
+         last = 0;
+       }
+-      alloc.destroy(node);
+-      alloc.deallocate(node, 1);
++      AllocatorTraits::destroy(_allocator, node);
++      _allocator.deallocate(node, 1);
+     }
+ 
+     /// \brief The last arc of the path.
+@@ -628,8 +630,8 @@ namespace lemon {
+ 
+     /// \brief Add a new arc behind the current path.
+     void addBack(const Arc& arc) {
+-      Node *node = alloc.allocate(1);
+-      alloc.construct(node, Node());
++      Node *node = _allocator.allocate(1);
++      AllocatorTraits::construct(_allocator, node, Node());
+       node->next = 0;
+       node->prev = last;
+       node->arc = arc;
+@@ -650,8 +652,8 @@ namespace lemon {
+       } else {
+         first = 0;
+       }
+-      alloc.destroy(node);
+-      alloc.deallocate(node, 1);
++      AllocatorTraits::destroy(_allocator, node);
++      _allocator.deallocate(node, 1);
+     }
+ 
+     /// \brief Splice a path to the back of the current path.
+@@ -766,6 +768,9 @@ namespace lemon {
+       }
+     }
+ 
++  private:
++    Allocator _allocator;
++
+   };
+ 
+   /// \brief A structure for representing directed paths in a digraph.


Home | Main Index | Thread Index | Old Index