[med-svn] [Git][med-team/libthread-pool][master] Use size_t type for max() comparison

Andreas Tille (@tille) gitlab at salsa.debian.org
Thu Mar 9 10:18:57 GMT 2023



Andreas Tille pushed to branch master at Debian Med / libthread-pool


Commits:
a3cc56de by Andreas Tille at 2023-03-09T11:15:40+01:00
Use size_t type for max() comparison

- - - - -


3 changed files:

- debian/changelog
- + debian/patches/fix-unsigned-cast.patch
- + debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+libthread-pool (4.0.0-2~exp) experimental; urgency=medium
+
+  [ Vladimir Petko ]
+  * Use size_t type for max() comparison
+    Closes: #1032532 (LP: #2009537)
+
+ -- Andreas Tille <tille at debian.org>  Thu, 09 Mar 2023 11:14:22 +0100
+
 libthread-pool (4.0.0-1) unstable; urgency=medium
 
   [ Nilesh Patra ]


=====================================
debian/patches/fix-unsigned-cast.patch
=====================================
@@ -0,0 +1,18 @@
+Description: Use size_t type for max() comparison
+ size_t is defined in an architecture-specific way. Construct size_t from int to avoid
+ the type mismatch error.
+Author: Vladimir Petko <vladimir.petko at canonical.com>
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libthread-pool/+bug/2009537
+Bug-Debian: https://bugs.debian.org/1032532
+Last-Update: 2023-03-08
+--- a/include/thread_pool/thread_pool.hpp
++++ b/include/thread_pool/thread_pool.hpp
+@@ -24,7 +24,7 @@
+       std::size_t num_threads = std::thread::hardware_concurrency())
+       : threads_(),
+         thread_map_(),
+-        queues_(std::max(1UL, num_threads)),
++        queues_(std::max(size_t(1), num_threads)),
+         task_id_(0) {
+     for (std::size_t i = 0; i != queues_.size(); ++i) {
+       threads_.emplace_back([this, i] () -> void { Task(i); });


=====================================
debian/patches/series
=====================================
@@ -0,0 +1 @@
+fix-unsigned-cast.patch



View it on GitLab: https://salsa.debian.org/med-team/libthread-pool/-/commit/a3cc56de11b3fe28498f74477a56d31e2cb76edf

-- 
View it on GitLab: https://salsa.debian.org/med-team/libthread-pool/-/commit/a3cc56de11b3fe28498f74477a56d31e2cb76edf
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20230309/333979ca/attachment-0001.htm>


More information about the debian-med-commit mailing list